Show that $A_1 \cup A_2$ and $B$ are independent if and only if $A_1 \cap A_2$ and $B$ are independent Suppose that $A_1, A_2$ and $B$ are events in $F$ such that
$A_1$ and $B$ are independent and that $A_2$ and $B$ are independent. Show that $A_1 \cup A_2$ and $B$ are
independent if and only if $A_1 \cap A_2$ and $B$ are independent.
I've started by saying $P(A_1\cap B)= P(A_1)P(B)$ and  $P(A_2 \cap B)= P(A_2)P(B)$ but not sure where to go from there.
 A: Let's begin by defining $$x:=P((A_1\cup A_2)\cap B)-P(A_1\cup A_2)P(B),\\\,y:=P((A_1\cap A_2)\cap B)-P(A_1\cap A_2)P(B).$$We want to prove $x=0\iff y=0$. In fact, we can prove $x+y=0$. Recall that $$P(A_1\cup A_2)+P(A_1\cap A_2)=P(A_1)+P(A_2),$$and similarly $$P((A_1\cup A_2)\cap B)+P((A_1\cap A_2)\cap B)=P(A_1\cap B)+P(A_2\cap B).$$Rearranging a little, $$x+y=P(A_1\cap B)-P(A_1)P(B)+P(A_2\cap B)-P(A_2)P(B)=0+0=0.$$
A: \begin{align}
& &P(A_1 \cup A_2) \cdot P(B) &\stackrel{A_1 \cup A_2, B\ \text{ind}}{=}P((A_1 \cup A_2) \cap B)=P((A_1 \cap B)\cup (A_2 \cap B))\\
&&\Longleftrightarrow P(A_1 \cup A_2) \cdot P(B)&=P(A_1 \cap B)+P(A_2 \cap B)-P(A_1 \cap A_2 \cap B) \\
&&\Longleftrightarrow P(A_1 \cup A_2) \cdot P(B)&=P(A_1)P(B)+P(A_2)P(B)-P(A_1\cap A_2 \cap B) \\
&&\Longleftrightarrow P(A_1 \cap A_2 \cap B)&=P(A_1)P(B)+P(A_2)P(B)-P(A_1\cup A_2)P(B) \\
&&\Longleftrightarrow P(A_1 \cap A_2 \cap B)&=P(B)(P(A_1)+P(A_2)-P(A_1\cup A_2))\\
&&\Longleftrightarrow P(A_1 \cap A_2 \cap B)&\stackrel{A_1 \cap A_2, B\ \text{ind}}{=}P(B)P(A_1\cap A_2)
\end{align}
