Reference for a characterization of conditional expectation Answers in these posts

*

*Let $X,Y$ be two real valued random variables. What is the joint density of the pair $(X, X)$ and how do we calculate $E[h(X,Y)|X=x]$?

*Conditional density of Sum of two independent and continuous random variables
use the following fact:

reacall that $E(h(X,Y)\mid X)=u(X)$ for some measurable function $u$ if and only if $E(h(X,Y)v(X))=E(u(X)v(X))$ for every bounded measurable function $v$

(Starting from the factorization lemma, which characterizes the conditional expectation a.s.,)
I believe one direction is the a.s.-point-wise approximation of measurable functions together wth the dominated convergence theorem, and the other direction is indicator functions being bounded.
Is this written somewhere? ("Recall" sounds like it is, but I did not know this result and I had to think a bit.)

($\Rightarrow$). Suppose $E[h(X,Y)|X]=u(X)$ for some measurable $u$. Since $v$ is assumed to be bounded and measurable, then $v(X)$ is integrable and $\sigma(v(X))\subseteq \sigma(X)$ so
$$\begin{aligned}E[h(X,Y)v(X)]&=E[E[h(X,Y)|X]v(X)]=\\
&=E[u(X)v(X)]
\end{aligned}$$
($\Leftarrow$). Let $A\in \mathscr{B}(\mathbb{R})$. Choose $v(x)=\mathbf{1}_A(x)$, which is bounded and measurable. Then $\mathbf{1}_A(X(\omega))=\mathbf{1}_{\{X\in A\}}(\omega)$. Recall $\sigma(X)=X^{-1}(\mathscr{B}(\mathbb{R}))$ so that if $C\in \sigma(X)$ then $C=X^{-1}(A)$ for some Borel $A$. By assumption
$$E[h(X,Y)\mathbf{1}_{X^{-1}(A)}]=E[u(X)\mathbf{1}_{X^{-1}(A)}],\,\forall A \in \mathscr{B}(\mathbb{R})$$
but this means $E[h(X,Y)|X]=u(X)$, $P$-a.e.
