Why is this a Dynkin system: $\{A \in \mathcal{A} \colon E[X1_A]=E[Y1_A]\}$ Let $X,Y$ be two random variables on $(\Omega, \mathcal{A},P)$. 
Why is the set $\mathcal{D}:=\{A \in \mathcal{A} \colon E[X 1_A] = E[Y 1_A]\}$ a Dynkin system?
Suppose $A \in \mathcal{D}$. Then $E[X1_A] = E[Y1_A]$. 
All I could think of was the following: 
Therefore $E[X 1_{A^c}]= E[X(1-1_A)]=E[X]-E[X1_A] = E[X]-E[Y1_A]$
But this is not what we need. 
Also if $A_i \in \mathcal{D}$ for $A_i$ pairwise disjoint. 
Then $E[X 1_{\bigcup_i A_i}] = E[X \sum_{i} A_i]= \sum_i E[X A_i] = \sum_i E[Y A_i] = E[Y 1_{\bigcup_i A_i}]$. 
But here I am not sure whether I can change the sum and the Expectation. Is this possible due to Monotone convergence theorem?
 A: Because $\Omega \in \mathcal{D}$ is a necessary condition for $\mathcal{D}$ to be a Dynkin system, we got to have $E[X] = E[Y]$ or $\mathcal{D}$ will not be a Dynkin system.
Let $A \in \mathcal{D}$. Then 
$$E[X 1_{A^c}]= E[X(1-1_A)]=E[X]-E[X1_A] = E[Y]-E[Y1_A] = E[Y 1_{A^{c}}]$$
So $A^{c} \in \mathcal{D}$.
Now let's look at a sequence $(A_n) \in \mathcal{D}$ with $A_i \cap A_j = \emptyset $ if $i \neq j$. Let $A = \cup_{i=1}^{\infty} A_i$. We now want to show that we may interchange taking the expectation with summation. Let $X^{+}$ be the positive part of $X$. Define $$ X_n^{+} := X^{+}1_{\cup_{i=1}^{n} A_i}.$$ We trivially have $X_n^{+} \leq X_{n+1}^{+}$, so the monotone convergence theorem yields
$$\lim_{n\to\infty} E[X_{n}^{+}] = E[\lim_{n\to\infty} X_{n}^{+}]$$
The same argument applied to the negative part of $X$ shows that we have 
$$\lim_{n\to\infty} E[X_{n}] = E[\lim_{n\to\infty} X_{n}] = E[X1_{A}]$$
with $X_n := X1_{\cup_{i=1}^{n} A_i}$. We can of course carry out the same argument with $Y$. Thus we obtain
\begin{align} E[X1_{A}] &= E[\lim_{n\to\infty} X_n] = \lim_{n\to\infty} E[X_n] = \lim_{n\to\infty} E\left[\sum_{i=1}^{n} X1_{A_i}\right] = \lim_{n\to\infty} E\left[\sum_{i=1}^{n} Y1_{A_i}\right] \\ &=\lim_{n\to\infty} E[Y_n] = E[\lim_{n\to\infty} Y_n] = E[Y1_{A}] \end{align}
Which shows $A \in \mathcal{D}$.
