Relative Complement of Cartesian Product

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

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

Then:
 * $\relcomp {A \mathop \times B} {X \times Y} = \paren {A \times \relcomp B Y} \cup \paren {\relcomp A X \times B}$

Proof
From Set with Relative Complement forms Partition:
 * $A = \set {X \mid \relcomp A X}$
 * $B = \set {Y \mid \relcomp B Y}$

and so by definition of partition:
 * $A = X \cup \relcomp A X$
 * $B = Y \cup \relcomp B Y$

By Cartesian Product of Unions:


 * $A \times B = \paren {X \times Y} \cup \paren {\relcomp A X \times \relcomp B Y} \cup \paren {X \times \relcomp B Y} \cup \paren {\relcomp A X \times Y}$

and so: