Conditional expectation and product measure space Let $X$ and $Y$ be $\mathbb{R}^n$- and $\mathbb{R^m}$-valued random variables on the probability space $(\Omega, \mathcal{F}, P)$. Further assume that $X$ is $\mathcal{F}_1$-measurable and $Y$ is $\mathcal{F}_2$-measurable, where $\mathcal{F}_1$ and $\mathcal{F}_2$ are independent sub-$\sigma$-algebras of $\mathcal{F}$.
Now, for $A \in \mathcal{B}(\mathbb{R}^n)$ and $B \in \mathcal{B}(\mathbb{R}^m)$ consider the maps
\begin{align}
f(x, y) &= 1_{A \times B} (x, y), \\
f( x, Y) &= 1_{A \times B} (x, Y), \\
g(x) &= E[f(x, Y )] = E[1_{A \times B} (x, Y)], \\
g(X) &= E[f(x, Y)] \big|_{x = X} = E[1_{A \times B} (x, Y)] \big|_{x = X}.
\end{align} Suppose I know that
$$
E[1_{A \times B}(X, Y) | \mathcal{F}_1] = E[1_{A \times B} (x, Y)] \big|_{x = X}.
$$
Then by the definition of the conditional expectation this means that for any $F \in \mathcal{F}_1$
$$\tag{1}
\int_{F} 1_{A \times B}(X, Y) dP = \int_F E[1_{A \times B} (x, Y)] \big|_{x = X} dP.
$$
I want to show that we also have
$$ \tag{2}
\int_{F} h(X, Y) dP = \int_F E[h (x, Y)] \big|_{x = X} dP
$$
for all $\mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m} )$-measurable positive step functions $h$. The latter of course will follow by linearity if we can show that
$$\tag{3}
\int_{F} 1_D (X, Y) dP = \int_F E[1_D (x, Y)] \big|_{x = X} dP
$$
for any $D \in \mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m} )$.

An argument I have come across says:

Both sides of $(1)$ can be extended from $\mathcal{B}( \mathbb{R^n} ) \times \mathcal{B}( \mathbb{R^m} )$ to define measures on $\mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m} )$. By linearity $(1)$ becomes $(2)$.

How exactly should one understand this argument? For instance, if we take $F = \Omega$, the LHS of $(1)$ is $P ( (X, Y ) \in A \times B )$. The independence of $X$ and $Y$ then gives
$$P ( (X, Y ) \in A \times B ) = P ( X \in A) P ( X \in B),$$
and for the distribution functions we have $P_{( X, Y)} ( A \times B ) = P_X ( A ) \times P_Y ( B )$, where $P_{(X, Y)}$ is a probability measure on $\mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m} )$. Does this have any connection with the quoted argument? What about the RHS of $(1)$. And how does one obtain $(2)$ or $3$? A detailed demonstration would be very much appreciated.
 A: 1 to 3 is a standard $\pi$-$\lambda$ lemma argument.  The collection $\mathcal{P}$ of sets of the form $A \times B$ is certainly closed under intersection, i.e. is a $\pi$-system.  Now show that the collection $\mathcal{L}$ of all sets $D$ satisfying (3) is a $\lambda$-system.  (The monotone convergence theorem will be useful.)  You conclude that $\mathcal{L}$ contains $\sigma(\mathcal{P})$, which by definition equals $\mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m} )$, and so you have shown that (3) holds for all $D \in \mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m} )$.
It can also be done with the monotone class theorem.
A: Following the steps described in Nate Eldrege's answer:
Let $\mathcal{L}$ denote the family of sets $D \in \mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m})$ for which we have
$$
\int_{F} 1_D (X, Y) dP = \int_F E[1_D (x, Y)] \big|_{x = X} dP, \quad \text{for all } F \in \mathcal{F}_1.
$$
According to $(1)$, the family $\mathcal{P} := \{ A \times B : A \in \mathcal{B}( \mathbb{R^n} ), \, B \in\mathcal{B}( \mathbb{R^m} ) \} \subset \mathcal{L}$. Moreover, $\mathcal{P}$ is intersaection-stable ($\pi$-system) and $\sigma(\mathcal{P}) = \mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m})$.
Let us now show that $\mathcal{L}$ is a Dynkin system ($\lambda$-system) on $\mathbb{R}^n \times \mathbb{R}^m$:


*

*$\mathbb{R}^n \times \mathbb{R}^m \in \mathcal{P} \Rightarrow \mathbb{R}^n \times \mathbb{R}^m \in \mathcal{L}$.

*Let $D_1, D_2 \in \mathcal{L}$ such that $D_2 \subset D_1$. Then $1_{ \{ D_1 \setminus D_2 \} } = 1_{D_1} - 1_{D_2}$ and 
\begin{align*}
\int_{F} 1_{ \{ D_2 \setminus D_1 \} } (X, Y) dP
&= \int_{F} 1_{D_1} (X, Y) dP - \int_{F} 1_{D_2} (X, Y) dP \\
&= \int_F E[1_{D_1} (X(\omega), Y)] P(d \omega ) - \int_F E[1_{D_2} (X(\omega), Y)] P(d \omega ) \\
&= \int_F \{ E[1_{D_1} (X(\omega), Y)]  - E[1_{D_2} (X(\omega), Y)] \}P(d \omega ) \\
&= \int_F \{ E[1_{D_1} (X(\omega), Y) - 1_{D_2} (X(\omega), Y)] \}P(d \omega ) \\
&= \int_F E \left[ 1_{ \{ D_1 \setminus D_2 \} } (X(\omega), Y) \right] P(d \omega ),
\end{align*}
hence $( D_1 \setminus D_2 ) \in \mathcal{F}_1$

*Let $D_n \in \mathcal{L}$, $n \in \mathbb{N}$, such that $D_1 \subset D_2 \subset D_3 \subset \ldots$ and  $D := \bigcup_{n \in N} D_n$. Fix some $x \in \mathbb{R}^n \times \mathbb{R}^m$. If $x \notin D$, then $x \notin D_n$ for all $n \in \mathbb{N}$. If $x \in D$, then there is some $n_0 \in N$ such that $x \in \bigcup_{n=1}^{n_0} D_n = D_{n_0} \subset D$. In either case, $1_{D_n} (x) = 1_D (x)$ for all $n \geq n_0$. Therefore, necessarily, $1_{D_n} (x) \uparrow 1_D (x)$ for every $x \in \mathbb{R}^n \times \mathbb{R}^m$ (pointwise). Similarly, for every $\omega \in \Omega$ there is some $n_0 \in \mathbb{N}$ $1_{D_n} ( X ( \omega ), Y ( \omega ) ) = 1_D ( X(\omega), Y(\omega))$ for all $n \geq n_0$. Trivially, $1_{D_n} ( X ( \omega ), Y ( \omega ) ) \uparrow 1_D ( X(\omega), Y(\omega))$ for every $\omega \in \Omega$ (pointiwse). Using the monotone convergence theorem, we can write
\begin{align}
\int_{F} 1_D (X, Y) dP
&= \int_{F} \lim_{n \rightarrow \infty} 1_{D_n} (X, Y) dP = \lim_{n \rightarrow \infty} \int_{F}  1_{D_n} (X, Y) dP \\
&= \lim_{n \rightarrow \infty} \int_F E[1_{D_n} ( X(\omega), Y)] P(d \omega) = \ldots
\end{align}
For $x = X(\omega)$, $\omega \in \Omega$ fixed, using the continuity of the measure $P$ from below, we can write
\begin{align}
\lim_{n \rightarrow \infty} E[1_{D_n} (x, Y)]
&= \lim_{ n \rightarrow \infty} P ( \{ \omega' \in \Omega: ( x, \omega' ) \in D_n \} ) = P \left( \bigcup_{n \in N} \{ \omega' \in \Omega: ( x, \omega' ) \in D_n \} \right) \\
&= P ( \{ \omega' \in \Omega: ( x, \omega' ) \in D \} ) = E[1_D (x, Y)].
\end{align}
Thus,
$$
E[1_{D_n} (x, Y)] \big|_{x = X(\omega)} \uparrow E[1_D (x, Y)] |_{x = X(\omega)} \quad \text{for every } \omega \in \Omega \text{ (pointwise)}.
$$
Applying the monotone convergence theorem once again, we get
$$
\ldots = \int_F \lim_{n \rightarrow \infty} E[1_{D_n} ( X(\omega), Y)] P(d \omega) = \int_F E[1_D ( X(\omega), Y)] P(d \omega).
$$
This shows that $\mathcal{L}$ is a Dynkin system. By Dynkin's lemma $\mathcal{L} = \sigma(\mathcal{P}) = \mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m})$ and thus $(3)$ hols for all $D \in \mathcal{B}( \mathbb{R^n} ) \otimes \mathcal{B}( \mathbb{R^m})$.
