# Why Does $\rm{E}[1_A \mid X] = P^X(A\mid X)$?

Following the excellent answer here, it is stated that

Connection: Let $P^X(\cdot\mid\cdot)$ be a regular conditional probability of $P$ given $X$. Then for any $A \in \mathcal{F}$ we have $${\rm E}[1_A\mid X]=\varphi(X),$$ where $\varphi(x) = P^X(A\mid x)$. In short we write ${\rm E}[1_A\mid X]=P^X(A\mid X)$.

I'm trying to prove this for myself, but I'd appreciate some help. We need to show two things:

1. $P^X(A\mid X)$ is $\sigma(X)$-measurable
2. $\rm{E}[1_C P^X(A\mid X)] = \rm{E}[1_C 1_A]$ for all $C \in \sigma(X)$.

Since $P^X(\cdot\mid\cdot)$ is a regular conditional probability, we know that for fixed $A \in \mathcal{F}$, the mapping $x \mapsto P^X(A\mid x)$ is $(\mathcal{B}(\mathbb{R}),\mathcal{B}(\mathbb{R}))$-measurable. Hence the composition $P^X(A\mid \cdot) \circ X: \Omega \to \mathbb{R}$ is a random variable for fixed $A \in \mathcal{F}$, which the author writes as $P^X(A\mid \cdot) \circ X = P^X(A|X)$. Thus $P^X(A\mid X)$ is $\sigma(X)$-measurable, and we have 1.

For 2, recall that for all $A \in \mathcal{F}$ and $B \in \mathcal{B}(\mathbb{R})$ the conditional probability is defined to satisfy $$\int_B P^X(A\mid x) \,d\mu_X(x) = P(A \cap \{X \in B\}),$$ where $\mu_X$ is the distribution measure of $X$ on $\mathcal{B}(\mathbb{R})$. This is the part I'm having trouble with. Here's my attempt: \begin{align*} \rm{E}[1_C P^X(A\mid X)] & = \int_{\Omega} 1_C(\omega)P^X(A\mid X)(\omega) dP(\omega) \\ & = \int_{\mathbb{R}} 1_{\{1\}}(x) P^X(A\mid x)d\mu_X(x) &\qquad& (2) \\ & = \int_{\{1\}}P^X(A\mid x)d\mu_X(x) \\ & = P(A \cap \{X = 1\}) \\ & = \int_\Omega 1_A(\omega) 1_{\{X = 1\}}(\omega) dP(\omega) \\ & = \int_\Omega 1_A(\omega) 1_C(\omega) dP(\omega) &\qquad& (6) \\ & = \rm{E}[1_A 1_C]. \end{align*}

I'm almost certain lines (2) and (6) aren't true, but I'm not sure how else to write the indicator random variable when transitioning to the distribution measure in (2). For (6), I don't see why $\{X = 1\} = C$, either, but it's my best shot at it right now :/

Note that $C\in\sigma(X)$ can be written as $X^{-1}(B)=\{X\in B\}$ for some $B\in\mathcal{B}(\mathbb{R})$ and hence $\mathbf{1}_C=\mathbf{1}_B(X)$. Therefore, $$\mathrm{E}[\mathbf{1}_CP^X(A\mid X)]=\int_\Omega \mathbf{1}_B(X)P^X(A\mid X)\,\mathrm dP=\int_BP^X(A\mid x)\,P_X(\mathrm dx)=P(A\cap \{X\in B\}).$$ But $$P(A\cap \{X\in B\})=P(A\cap C)=\mathrm{E}[\mathbf{1}_A\mathbf{1}_C]$$ which is what we want.