Theorem: Existence and Essential Uniqueness of Conditional Expectation Conditioned on Sigma-Algebra

Let $\struct {\Omega, \Sigma, \Pr}$ be a probability space.
Let $X$ be an integrable random variable on $\struct {\Omega, \Sigma, \Pr}$.
Let $\GG \subseteq \Sigma$ be a sub-$\sigma$-algebra of $\Sigma$.
Then there exists an integrable random variable $Z$ on $\struct {\Omega, \GG, \Pr}$ such that: 
:$\ds \int_G Z \rd \Pr = \int_G X \rd \Pr$ for each $G \in \GG$.
Further, if $Z$ and $Z'$ are two integrable random variables satisfying this condition, we have: 
:$Z = Z'$ almost everywhere.

Proof:
Observe that:
:$\map {L^2} {\Omega, \GG, \Pr} \subseteq \map {L^2} {\Omega, \Sigma, \Pr}$
is a closed linear space.
Let:
:$P : \map {L^2} {\Omega, \Sigma, \Pr} \to \map {L^2} {\Omega, \GG, \Pr}$
be the orthogonal projection.
Observe that for all $f \in \map {L^2} {\Omega, \Sigma, \Pr}$ and $g \in \map {L^2} {\Omega, \GG, \Pr}$:
{{begin-eqn}}
{{eqn | l = \int \map P f g \rd \Pr
      | r = \int f g \rd \Pr + \int \paren {\map P f - f} g \rd \Pr
}}
{{eqn | r = \int f g \rd \Pr
      | c = as $\map P f - f \in \map {L^2} {\Omega, \GG, \Pr}^\perp$
      | n = 1
}}
{{end-eqn}}
Let $f \in \map {L^2} {\Omega, \Sigma, \Pr}$.
Let:
:$\ds g := \chi_{\set {P f \ge 0} } - \chi_{\set {P f < 0} }$
so that:
:$\size {\map P f} = \map P f g$
Since $g \in \map {L^2} {\Omega, \GG, \Pr}$, we have:
{{begin-eqn}}
{{eqn | l = \int \size {\map P f} \rd \Pr
      | r = \int \map P f g\rd \Pr
}}
{{eqn | r = \int f g \rd \Pr
      | c =  by $(1)$
}}
{{eqn | o = \le
      | r = \int \size f \rd \Pr
      | c = as $\size g \le 1$
}}
{{end-eqn}}
On the other hand, by Cauchy inequality and  the density of simple functions:
:$\map {L^2} {\Omega, \Sigma, \Pr} \subseteq \map {L^1} {\Omega, \Sigma, \Pr}$
is a dense subspace.
Therefore, we can extend:
:$P : \map {L^1} {\Omega, \Sigma, \Pr} \to \map {L^1} {\Omega, \GG, \Pr}$
so that:
:$\ds \forall f \in \map {L^1} {\Omega, \Sigma, \Pr} : \norm {P f}_{\map {L^1} {\Omega, \Sigma, \Pr} } \le \norm f_{\map {L^1} {\Omega, \GG, \Pr} }$
Let $X \in \map {L^1} {\Omega, \Sigma, \Pr}$.
Let $\sequence {X_n} \subseteq \map {L^2} {\Omega, \Sigma, \Pr}$ such that:
:$\ds \lim_{n \mathop \to \infty} \norm {X_n - X}_{\map {L^1} {\Omega, \Sigma, \Pr} }$
Then for each $G \in \GG$:
{{begin-eqn}}
{{eqn | l = \int_G \map P X \rd \Pr
      | r = \lim_{n \mathop \to \infty} \int_G \map P {X_n} \rd \Pr
}}
{{eqn | r = \lim_{n \mathop \to \infty} \int_G X_n \rd \Pr
      | c = by $(1)$
}}
{{eqn | r = \int_G X \rd \Pr
}}
{{end-eqn}}
Hence we can choose $Z = \map P X$.
{{qed|lemma}}
Now let $Z'$ be another integrable random variable that is $\GG$-measurable with: 
:$\ds \int_A X \rd \Pr = \int_A Z' \rd \Pr$
for all $A \in \GG$.
Then:
{{begin-eqn}}
{{eqn | l = \int \size {Z - Z'} \rd \Pr
      | r = \int \paren {Z - Z'} \paren {\chi_{\set {Z \ge Z'} } - \chi_{\set {Z < Z'} } } \rd \Pr
}}
{{eqn | r = \int_{\set {Z \ge Z'} } Z \rd \Pr - \int_{\set {Z < Z'} } Z \rd \Pr - \int_{\set {Z \ge Z'} } Z' \rd \Pr + \int_{\set {Z < Z'} } Z' \rd \Pr
}}
{{eqn | r = \int_{\set {Z \ge Z'} } X \rd \Pr - \int_{\set {Z < Z'} } X \rd \Pr - \int_{\set {Z \ge Z'} } X \rd \Pr + \int_{\set {Z < Z'} } X \rd \Pr
      | c = {{hypothesis}}
}}
{{eqn | r = 0
}}
{{end-eqn}}
By Measurable Function Zero A.E. iff Absolute Value has Zero Integral:
:$Z = Z'$ almost everywhere
{{qed}}