TITLE: Can't find mistake in an easy proof.
QUESTION [27 upvotes]: Consider the following theorem.
$\textbf{Theorem:}$ for any sets $A, B, C, D$, if $A \times B \subseteq C \times D$ then $A \subseteq C$ and $B \subseteq D$.
Then the following proof is given.
$\textbf{Proof:}$ Suppose $A \times B \subseteq C \times D$. Let $a$ be an arbitrary element of $A$ and let $b$ be an arbitrary element of $B$. Then $(a,b) \in A\times B$. so since $A\times B \subseteq C \times D$, $(a,b) \in C \times D$. Therefore $a \in C$ and $b \in D$. Since $a$ and $b$ were arbitrary elements of $A$ and $B$, respectively, this shows that $A \subseteq C$ and $B \subseteq D$. QED.
I know that the theorem is not correct, because there is a counterexample $A = \left\lbrace 1 \right\rbrace$, $B = C = D = \emptyset$. Notice that $A \times B \subseteq C \times D \sim \emptyset \subseteq \emptyset$ but $A \nsubseteq C$.
So, clearly, this is an invalid proof, but I cannot figure out which step is wrong.

REPLY [3 votes]: Since this is an exercise 12 in Section 4.1 of Velleman's book "How To Prove It", lets see what the author himself thinks about it.
He writes on page 137 of Daniel J. Velleman, Variable declarations in natural deduction / Annals of Pure and Applied Logic 144 (2006) 133-146, available as pdf at
http://www.sciencedirect.com/science/article/pii/S0168007206000649
:

Where did the proof go wrong? The problem is that the proof that $A \subseteq C$ improperly makes use of the arbitrary element $b$ of $B$, and the proof that $B \subseteq D$ improperly makes use of the arbitrary element $a$ of $A$. The author of the proof has tried to take a shortcut by proving $A \subseteq C$ and $B \subseteq D$ simultaneously. If we eliminate the shortcut and structure the proof properly, then we must prove that $A \subseteq C$ by letting $a$ be an arbitrary element of $A$ and proving that $a \in C$, and then we must prove that $B \subseteq D$ by letting $b$ be an arbitrary element of $B$ and proving that $b \in D$. In neither part of the proof can the arbitrary object from the other part be used.
This proof illustrates that the dependencies among assertions, assumptions, and introductions of variables can be quite subtle, and catching errors resulting from improper dependencies can be difficult. The safest policy is the one that I believe mathematicians generally follow: once an assumption or a declaration that a variable stands for an arbitrary object is retracted, nothing that has appeared in the proof since the assumption or declaration can be used.