# Vanishing of Expecation and conditional expectation (on RV) is really equivalent (E(X)=0 <=> E(X|Y)=0)?

I just stumbled upon seeing that being-zero of expectation and conditional expectation on random variables is equivalent, more exactly:

Let $X$,$Y$ be random variables. Then $E(X)=0$ if and only if $E(X|Y)=0$ a.s.

This is a bit surprising, one implication I have already seen here, but now it's even equivalent. Q: Is my argument right? It is quite straightforward, but because the result is counter-intuitive I'd like to have a look that I didnt miss something.

Proof. By definition of conditional expectation, we have $$E[E(X|Y) 1_A]=E[X 1_A]$$ We condition on $Y$, that means on the generated $\sigma$-algebra $\sigma(Y)$. Choose $A=\Omega$: $$E[ E(X|Y)] =E(X)$$ Now, if rhs$=0$ then the integrand, $E(X|Y)=0$ a.s. If, on the other hand, $E(X|Y)=0$, the expectation on the lhs is $0$ and therefore $E(X)=0$.

-
The argument is wrong. If RHS is zero then $E(E(X|Y))=0$ (and not $E(X|Y)=0$). Try the case $X=Y$ to see what is happening. – Did Sep 22 '11 at 9:03
yes, now with the counter-example from Gortaur I see it, I would have to add that $E(X|Y) \geq0$ – Johannes L Sep 22 '11 at 9:07
If $E(X|Y)\geq 0$ a.s. then $E(X) = E(E(X|Y)) = 0$ iff $E(X|Y) = 0$ a.s. which is a known fact about Lebesgue integrals, I guess. – Ilya Sep 22 '11 at 10:44

Here is a counterexample. Let $X$ admit only values $-1$ and $1$ with equal probabilities and $Y = 2X$, then $\mathsf E X =0$ while $\mathsf E[X|Y] = \frac12 Y$ which is a.s. non-zero.