Equality case for conditional second moments (source code)

= Equality case for conditional second moments
{title2=$\mathbb EY^2=\mathbb EX^2+\mathbb E(Y-X)^2$}

If $Y$ is a real square-integrable <random variable> and $X=\mathbb E[Y\mid\mathcal G]$, then $\mathbb E[XY]=\mathbb EX^2$ and the displayed identity follows by expansion. Thus equality of the second moments forces $X=Y$ as an <almost sure equality>. This is the equality case of the <conditional Jensen inequality> for the strictly convex function $z\mapsto z^2$.