Cross Products Problem

If $A_1 \times B_1 \cup A_2 \times B_2 = A \times B$ then show that $A = A_1 \cup A_2$ and $B = B_1\cup B_2$

-
This question should come with the hypothesis that neither A nor B are empty. – Jason Polak Sep 27 '12 at 23:00
@Jason: In fact it requires the hypothesis that none of the sets $A,B,A_1,B_1,A_2,B_2$ be empty. – Brian M. Scott Sep 27 '12 at 23:16

It’s necessary to assume that the sets $A_1,A_2,B_1$, and $B_2$ are all non-empty. Otherwise we might have, for instance. $A=B=A_1=B_1=\{0\}$, $A_2=\{1\}$, and $B_2=\varnothing$; then $$A\times B=\{\langle 0,0\rangle\}=(A_1\times B_1)\cup\varnothing=(A_1\times B_1)\cup(A_2\times B_2)\;,$$ but $A=\{0\}\ne\{0,1\}=A_1\cup A_2$. This of course implies that $$A\times B=(A_1\times B_1)\cup(A_2\times B_2)\ne\varnothing$$ and hence that $A\ne\varnothing\ne B$.
Fix some $b\in B$. Then
\begin{align*} a\in A\quad &\text{iff}\quad \langle a,b\rangle\in A\times B\\ &\text{iff}\quad\langle a,b\rangle\in(A_1\times B_1)\cup(A_2\times B_2)\;, \end{align*}
which implies that $a\in A_1$ or $a\in A_2$, i.e., that $a\in A_1\cup A_2$. Thus, $A\subseteq A_1\cup A_2$. Conversely, if $a\in A_1\cup A_2$, then $a\in A_1$ or $a\in A_2$; suppose without loss of generality that $a\in A_1$. Choose any $b\in B_1$; then $\langle a,b\rangle\in A_1\times B_1\subseteq A\times B$, so $a\in A$. Thus, $A_1\cup A_2\subseteq A$, and w conclude that $A=A_1\cup B_1$. The proof that $B=B_1\cup B_2$ is entirely similar.