# 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

$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$
$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:

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

$\blacksquare$