# Proof that conditional expectation is defined uniquely almost everywhere?

Consider a probability space $(\Omega, \mathcal B, \mathbb P)$, and 2 random variables $X,Y:\Omega\to\mathbb R$

Conditional expectation $E(X|Y)=E(X|\sigma(Y))$ can be defined as a function that is

1. $\sigma(Y)$ -measurable. I.e. there cannot be a subset $A$ of $\Omega$ on which $Y$ maps to a unique value, but where the conditional expectation does not.

2. $E(E(X|Y)\cdot 1_A)=E(X\cdot 1_A)$ For all $A\in \sigma(Y)$.

How do we prove that this defines a function that is unique almost-everywhere?

• I think it is defined differently in Las Vegas. – Michael Sep 8 '18 at 15:28

For uniqueness: Suppose $Z, Z'$ are two functions (random variables) that satisfy 1 and 2. Set $A = \{\omega: Z(\omega) \ge Z'(\omega)\}$. Since $Z,Z'$ are both $\sigma(Y)$ measurable, the same is true of $A$. Hence $E[Z 1_A] = E[X 1_A] = E[Z' 1_A]$ by 2. Subtracting, we have $E[(Z-Z') 1_A] = 0$. But $(Z-Z') 1_A$ is nonnegative everywhere, so we conclude $(Z-Z') 1_A = 0$ almost everywhere. That is to say that $Z \le Z'$ almost everywhere. By symmetry, we also get $Z' \le Z$ almost everywhere, so that $Z=Z'$ almost everywhere.
• Could you formally explain the step "so we conclude $(Z-Z') 1_A = 0$ almost everywhere"? I get the intuition, but I don't know how to formally state it. – user56834 Sep 10 '18 at 3:13
• @Programmer2134: Theorem: Suppose $W$ is a nonnegative measurable function and $E[W] = 0$. Then $W=0$ almost everywhere. Proof: let $n$ be a positive integer and consider the set $A_n = \{ \omega : W(\omega) \ge 1/n\}$. Then $E[W] \ge P(A_n)/n$ (Markov's inequality). Hence $P(A_n) = 0$. Now $\{\omega : W(\omega) > 0\} = \bigcup_n A_n$ so by countable additivity this set also has measure zero. – Nate Eldredge Sep 10 '18 at 3:54