Proof of monotonicity of conditional expectation I am trying to show monotonicity of conditional expectation. Namely, if $X\leq Y$ almost surely, and $\mathcal{M}$ is some $\sigma$-algebra then $\mathbb{E}[X|\mathcal{M}]\leq\mathbb{E}[Y|\mathcal{M}]$. I know that $\forall E \in \mathcal{M}$,
$$\int_E \mathbf{E}[Y|\mathcal{M}]-\mathbf{E}[X|\mathcal{M}]dP \geq 0$$
Thus, consider the set of elements for which $\mathbf{E}[Y|\mathcal{M}]-\mathbf{E}[X|\mathcal{M}] < 0$ denoted $G$, on this set, $\int_G \mathbf{E}[Y|\mathcal{M}]-\mathbf{E}[X|\mathcal{M}]dP< 0$ which implies that $G\notin \mathcal{M}$.
I would like to say then that $P(G)=0$, but since $G$ is not in the $\sigma$-algebra I don't even know if it is measurable. What am I missing here? How do I know that this set has zero measure?
 A: $\newcommand{\field}{\mathscr{M}}$
Let $G$ be defined as you described. You cannot derive $G \notin \field$ -- in fact, because $E[Y|\field] - E[X|\field]$ is $\field$-measurable, it is certain that $G \in \field$.  One correct way to show the monotonicity is via proof by contradiction as follows:
By the definition of $G$, we have that $(E[X|\field] - E[Y|\field])I_G \geq 0$ everywhere.  If $P(G) > 0$, then
\begin{align}
 & P[(E[X|\field] - E[Y|\field])I_G > 0] \\
=& P[[(E[X|\field] - E[Y|\field])I_G > 0]\cap G] + P[[(E[X|\field] - E[Y|\field])I_G > 0]\cap G^c] \\
=& P(G \cap G) + P(\varnothing) = P(G) > 0.
\end{align}
It then follows (as we have just shown that the non-negative random variable $(E[X|\field] - E[Y|\field])I_G$ has positive probability of being positive) by Theorem $15.2$ of Probability and Measure that
$$\int_G (E[X|\field] - E[Y|\field])dP = \int (E[X|\field] - E[Y|\field])I_GdP > 0,$$
which contradicts with $\int_G (E[Y|\field] - E[X|\field])dP \geq 0$.  Therefore $P(G) = 0$, i.e., $E[Y|\field] - E[X|\field]) \geq 0$ almost surely.
A: Notice that $E(X|\mathcal{M})$ and $E(Y|\mathcal{M})$ are $\mathcal{M}$-measurable. Therefore, the set
\begin{equation*}
G = \{x | E(X|\mathcal{M}) > E(Y|\mathcal{M})\}
\end{equation*}
is $\mathcal{M}$-measurable.
Now, since $G \in \mathcal{M}$,
\begin{equation*}
0 \leq \int_G (Y - X) \,\mathrm{d}P = \int_G (E(Y|\mathcal{M}) - E(X|\mathcal{M}))\, \,\mathrm{d}P \leq 0.
\end{equation*}
Therefore,
\begin{equation*}
\int_G E(Y|\mathcal{M}) \,\mathrm{d}P = \int_G E(X|\mathcal{M}) \,\mathrm{d}P.
\end{equation*}
And this implies that $P(G) = 0$.
