# Equality of two definitions of conditional expectation

Let $X,Y$ be two random variables and let $Q(x,B)$ be a transition kernel from $X$ to $Y$: $$\mathsf P_{X,Y}(A,B) = \int\limits_{A}Q(x,B) \, \mathsf P_{X}(dx)$$ Then we can define $\mathsf E(Y \mid X=x) := \int y \,Q(x,dy)$. On the other hand we can define $$\mathsf E(Y \mid X) := \mathsf E ( Y \mid \sigma(X))$$ Since $\mathsf E(Y \mid X)$ is $\sigma(X)$ mesurable there exists a Borel function $\varphi(x)$ such that $\mathsf E( Y \mid X) = \varphi(X)$. We can define $\mathsf E (Y \mid X = x) := \varphi(x)$. My question is why do these two definitions agree? Why $$\varphi(x) = \int y \, Q(x,dy) ?$$

-

The definition $$P(X\in A,Y\in B)=\int_A Q(x,B)\,P_X(\mathrm dx), \quad A,B\in\mathcal{B}(\mathbb{R})$$ implies via a standard argument that $$E[\psi(X,Y)]=\int_\mathbb{R} \int_\mathbb{R} \psi(x,y)\, Q(x,\mathrm dy)\, P_X(\mathrm dx)$$ holds for any Borel-measurable $\psi:\mathbb{R}^2\to\mathbb{R}$ with $\psi(X,Y)$ being integrable. In particular, if $A\in\mathcal{B}(\mathbb{R})$ and we let $\psi(x,y)=1_A(x)\cdot y$, then $$\int_A \varphi(x)\, P_X(\mathrm dx)=\int_{\{X\in A\}} Y\,\mathrm dP$$ with $\varphi(x)=\int y\, Q(x,\mathrm d y)$. Now, let us prove that $\varphi(X)=E[Y\mid X]$. For any $A\in\mathcal{B}(\mathbb{R})$ we have \begin{align} \int_{\{X\in A\}}Y\,\mathrm dP&=\int_A\varphi(x)\,P_X(\mathrm dx)=\int_\mathbb{R} 1_A(x)\varphi(x)\, P_X(\mathrm dx) \\ &=\int_\Omega 1_A(X)\varphi(X)\,\mathrm dP=\int_{\{X\in A\}}\phi(X)\,\mathrm dP, \end{align} and since $\sigma(X)=\{ \{X\in A\}\mid A\in\mathcal{B}(\mathbb{R})\}$, we are done.