In my introductory probability class I ran across these two expressions in a solution to a homework problem.
X and Y are two random variables, and f(Y) is any function.
$\mathbb{E}[\mathbb{E}[X|Y]f(Y)]$ = $\mathbb{E}[\mathbb{E}[f(Y)X|Y]]$
or without the outside expectiaton:
$\mathbb{E}[X|Y]f(Y)$ = $\mathbb{E}[f(Y)X|Y]$
Can someone help clarify, more intuitively, why these two expressions are equivalent? The only idea I have is that since we are "fixing" Y in the expectation, f(Y) acts almost as a constant. However, the "fixing" of Y happens in the expectation, yet the function of Y is multiplied afterwards. I know this is probably supposed to be very basic, but it simply isn't clicking for me.
It reminds me of one of the basic properties of conditional expectations, namely "Taking out what's known": if $Y$ is $\mathcal{G}$- measurable and $XY$ - integrable, then $\mathbb{E}[XY|\mathcal{G}] = Y\mathbb{E}[X|\mathcal{G}]$.
The proof of this is quite standard - start by showing the result when Y is an indicator function, then apply linearity to prove it for $Y$ - simple, Monotone Convergence for any non-negative measurable function and finally use $Y = Y^+ -Y^-$ to complete the argument.
In your case $\mathcal{G}$ is simply the sigma-algebra generated by $Y$. However, I'm not entirely sure if $f$ can be any function - $f(Y)$ needs to remain $\sigma(Y)$-measurable.