Relative Complement of Cartesian Product

Theorem
Let $A$ and $B$ be sets.

Let $X \subseteq A$ and $Y \subseteq B$.

Then:
 * $\complement_{A \mathop \times B} \left({X \times Y}\right) = \left({A \times \complement_B \left({Y}\right)}\right) \cup \left({\complement_A \left({X}\right) \times B}\right)$

Proof
From Set with Relative Complement forms Partition:
 * $A = \left\{ {X \mid \complement_A \left({X}\right)} \right\}$
 * $B = \left\{ {Y \mid \complement_B \left({Y}\right)} \right\}$

and so by definition of partition:
 * $A = X \cup \complement_A \left({X}\right)$
 * $B = Y \cup \complement_B \left({Y}\right)$

By Cartesian Product of Unions:


 * $A \times B = \left({X \times Y}\right) \cup \left({\complement_A \left({X}\right) \times \complement_B \left({Y}\right)}\right) \cup \left({X \times \complement_B \left({Y}\right)}\right) \cup \left({\complement_A \left({X}\right) \times Y}\right)$

and so: