Sorry if the title is confusing. I am studying this property: $$ \mathbb{E}[\mathbb{E}(Y|W)|X] = \mathbb E[Y|X] $$ where $X=f(W)$, and I don't really know if I am proving it right.
Here's my proof:
$$
\begin{align}
\mathbb{E}[\mathbb{E}(Y|W)|X]
&= \mathbb{E}\left[ \int_\mathbb R y \frac{f_{WXY}(w,x,y)} {f_{WX}(w,x)} dy \big|X \right]\\
&=\int_\mathbb R\int_\mathbb R y \frac{f_{WXY}(w,x,y)} {f_{WX}(w,x)} dy
\frac {f_{WX}(w,x)} {f_X(x)} dw \\
\end{align}
$$
and so the $f_{WX}$'s cancel out and we have
$$
\begin{align}
&=\int_\mathbb R\int_\mathbb R y \frac{f_{WXY}}{f_X}dydw = \int_\mathbb R y\frac{f_{XY}}{f_X}dy=\mathbb E(Y|X)
\end{align}
$$
Am I getting anything wrong here?
What makes me unsure about my proof is the first step, i.e. writing
$$
\mathbb{E}(Y|W) = \int_\mathbb R y \frac{f_{WXY}(w,x,y)} {f_{WX}(w,x)} dy
$$
But I am not able to prove it otherwise.
Thank you.
It is enough to apply the definition of conditional expectation: \begin{gather*} E\biggl[E\Bigl[E\big[Y\mid W\big]\Big| X\Bigr]I_A(X)\biggr]= E\Bigl[E\big[Y\mid W\big]I_A(X)\Bigr]=\\ =E\Bigl[E\big[Y\mid W\big]I_A(f(W))\Bigr]= E\Bigl[E\big[Y\mid W\big]I_{f^{-1}(A)}(W)\Bigr]=\\ =E\big[YI_{f^{-1}(A)}(W)\big]=E\big[YI_A(f(W)\big]=E\big[YI_A(X)\big] \end{gather*}