Suppose the $X,Y \in \mathcal L^1(\Omega,\mathcal F,\mathbf P)$ and that
$\mathbf E(X|Y)=Y$ a.s. and $\mathbf E(Y|X)=X$ a.s.
Prove that $\mathbf P(X=Y)=1$.
It is an exercise in Probability with Martingales.
Here is the hint in that book:
Consider $\mathbf E(X-Y;X>c,Y\le c)+\mathbf E(X-Y;X\le c,Y\le c)$.
However, I have no idea what this hint means.
Below is my attempt:
I suppose that $\mathbf P(X=Y)< 1$, and without loss of generality I suppose $\mathbf P(X>Y)>0$.
So for some $\epsilon>0$, $\mathbf P(X-Y>\epsilon)>0$. Let $S:=(X-Y>\epsilon)$ be an event.
Then integrate on $S$: $\int_S(X-Y) \text{d}\mathbf{P}>0$.
By $\mathbf E(X|Y)=Y$ a.s. and $\mathbf E(Y|X)=X$ a.s., we have $\int_D(X-T)\text{d}\mathbf P=0$ for any $D\in \sigma(X)\cup \sigma(Y)$.
But it is not guaranteed that $S\in\sigma(X)\cup \sigma(Y)$. So I am not clear how to continue my proof...
Thanks in advance.