# Independence and conditional expectation

So, it's pretty clear that for independent $X,Y\in L_1(P)$ (with $E(X|Y)=E(X|\sigma(Y))$), we have $E(X|Y)=E(X)$. It is also quite easy to construct an example (for instance, $X=Y=1$) which shows that $E(X|Y)=E(X)$, does not imply independence of $X$ and $Y$.

However, since $X,Y$ are independent iff $E(f(X)g(Y))=E(f(X))E(g(Y))$ for all bounded Borel functions $f,g:\mathbb{R}\to\mathbb{R}$, does it not make sense that $X$ and $Y$ are independent iff $E(f(X)|Y)=E(f(X))$, again for all bounded Borel functions $f:\mathbb{R}\to\mathbb{R}$?

Clearly, one of the implications hold (since $f(X)$ will be independent of $Y$), but what about the other way around? Am I completely wrong in my assessment?

-
Indeed "E(X|Y)=E(X), does not imply independence of X and Y" but the case when X=Y=1 with full probability is not a counterexample since constant random variables are iundependent of everything. –  Did Apr 29 '13 at 11:49

Assume that ${\rm E}[h(X)\mid Y]={\rm E}[h(X)]$ holds for any bounded Borel-measurable function $h$ and let $f,g$ be bounded Borel-measurable functions. Then \begin{align} {\rm E}[f(X)g(Y)]&={\rm E}[{\rm E}[f(X)g(Y)\mid Y]]={\rm E}[g(Y){\rm E}[f(X)\mid Y]]\\ &={\rm E}[g(Y){\rm E}[f(X)]]={\rm E}[g(Y)]{\rm E}[f(X)] \end{align} which shows that $X$ and $Y$ are independent.