A question about conditional expectation Let $X_1,X_2,...,X_n$ and $Y$ be random variables. I know that:
$$\label{aaa}\tag{I}
E\left[\sum_{j=1}^n  X_j \Bigg |  Y \right]=\sum_{j=1}^n E\left[ X_j \Big |  Y \right] $$
Now, suppose that $Y$ takes values $1,2, 3,...$.
How to prove the following?
$$E\left[\sum_{j=1}^Y  X_j \Bigg |  Y \right]=\sum_{j=1}^Y E\left[ X_j \Big |  Y \right] $$

The most immediate is to apply the formula: $E[f(X,Y)|Y=y]=E[f(X,y)|Y=y]$.  So: $$E\left[\sum_{1}^{Y}X_i\bigg|Y=y\right]=E\left[\sum_{1}^{y}X_i\bigg|Y=y\right]=\sum_{1}^{y}E\left[X_i\bigg|Y=y\right]$$
