Prove that $(A\times B)\setminus(C\times D)=\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$.

elementary-set-theoryproof-writingsolution-verification

Not a duplicate of

Prove $(A\times C)\setminus (B\times D)=(A\times (C\setminus D))\cup((A\setminus B)\times C)$

This is exercise $4.1.9$ from the book How to Prove it by Velleman $($$2^{nd}$ edition$)$:

Prove that for any sets $A$, $B$, $C$, and $D$, $(A\times B)\setminus(C\times D)=\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$.

Here is my proof:

$(\rightarrow)$ Let $(x,y)$ be an arbitrary element of $(A\times B)\setminus(C\times D)$, then $(x,y)\in A\times B$ which means $x\in A$ and $y\in B$, and $(x,y)\notin C\times D$. We consider two cases.

Case $1.$ Suppose $(x,y)\in\bigr[A\times(B\setminus D)\bigr]$ and so $x\in\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$.

Case $2.$ Suppose $(x,y)\notin\bigr[A\times(B\setminus D)\bigr]$ and since $x\in A$, then $y\notin B\setminus D$. We consider two cases.

Case $2.1.$ Suppose $y\notin B$ which is a contradiction.

Case $2.2.$ Suppose $y\in D$. From $(x,y)\notin C\times D$ and $y\in D$, $x\notin C$. Thus $x\in A\setminus C$ and so $(x,y)\in\bigr[(A\setminus C)\times B\bigr]$.

From case $2.1$ or case $2.2$ we obtain $(x,y)\in\bigr[(A\setminus C)\times B\bigr]$ and so $x\in\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$. Since cases $1$ and $2$ are exhaustive, $x\in\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$. Therefore if $(x,y)\in(A\times B)\setminus(C\times D)$ then $(x,y)\in\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$. Since $(x,y)$ is arbitrary, $(A\times B)\setminus(C\times D)\subseteq\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$.

$(\leftarrow)$ Let $(x,y)$ be an arbitrary element of $\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$ and also let $x$ be an arbitrary element of $C$. We consider two cases.

Case $1.$ Suppose $(x,y)\in\bigr[A\times(B\setminus D)\bigr]$, then $x\in A$ and $y\in B\setminus D$ which means $y\in B$ and $y\notin D$. Thus $(x,y)\in A\times B$. Also from $x\in C$ and $y\notin D$, $(x,y)\notin C\times D$ and ergo $(x,y)\in(A\times B)\setminus(C\times D)$.

Case $2.$ Suppose $(x,y)\in\bigr[(A\setminus C)\times B\bigr]$ and so $x\notin C$ which is a contradiction.

From a contradiction or $(x,y)\in(A\times B)\setminus(C\times D)$, we obtain $(x,y)\in(A\times B)\setminus(C\times D)$. Therefore if $(x,y)\in\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$ then $(x,y)\in(A\times B)\setminus(C\times D)$. Since $(x,y)$ is arbitrary, $\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]\subseteq(A\times B)\setminus(C\times D)$.

Ergo $(A\times B)\setminus(C\times D)=\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$. $Q.E.D.$

Is my proof valid$?$

One other question: In the answer to the above linked-post, it is mentioned that for the right-to-left direction of the proof, cases are symmetrical and so we are justified to use the phrase "without loss of generality". In my proof cases turned out not to be symmetrical. Is there another way of proving the right-to-left direction that makes the cases symmetrical$?$

Thanks for your attention.

Edit:

$(\leftarrow)$ Let $(x,y)$ be an arbitrary element of $\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]$. We consider two cases.

Case $1.$ Suppose $(x,y)\in\bigr[A\times(B\setminus D)\bigr]$ and so $x\in A$ and $y\in B\setminus D$. Since $y\notin D$, then $(x,y)\notin C\times D$ and ergo $(x,y)\in(A\times B)\setminus (C\times D)$.

Case $2.$ Suppose $(x,y)\in\bigr[(A\setminus C)\times B\bigr]$ and so $x\in A\setminus C$ and $y\in B$. Since $x\notin C$, then $(x,y)\notin C\times D$ and ergo $(x,y)\in(A\times B)\setminus (C\times D)$.

Since the above cases are exhaustive, $(x,y)\in(A\times B)\setminus (C\times D)$. Since $(x,y)$ is arbitrary, $\bigr[A\times(B\setminus D)\bigr]\cup\bigr[(A\setminus C)\times B\bigr]\subseteq(A\times B)\setminus(C\times D)$.

Best Answer

For the ($\Rightarrow$) direction of your proof: It would have been quicker, after saying that $(x,y) \notin C \times D$, to say that therefore either $x \notin C$ or $y \notin D$. Your cases could then be: case (1), $x \notin C$; case (2), $y \notin D$. (To see why $(x,y) \notin C \times D$ means that $x \notin C$ or $y \notin D$: write it as $\neg(x \in C \wedge y \in D)$ and then use DeMorgan's law.)

For the ($\Leftarrow$) direction: After you say "Let $(x,y)$ be an arbitrary element of $[A \times (B \setminus D)] \cup [(A \setminus C) \times B]$," you cannot say "and also let $x$ be an arbitrary element of $C$." You have already said what $x$ is -it is the first coordinate of your arbitrary element of $[A \times (B \setminus D)] \cup [(A \setminus C) \times B]$. You can't change it. However, there is no need to assume $x \in C$. For example, in case (1), once you have $y \notin D$, you can say "therefore $(x,y) \notin C \times D$"; you don't need to know $x \in C$ to draw this conclusion.