# Equal Set Differences iff Equal Intersections

## Theorem

$R \setminus S = R \setminus T \iff R \cap S = R \cap T$

## Proof 1

 $\displaystyle R \setminus S$ $=$ $\displaystyle R \setminus T$ $\displaystyle \leadstoandfrom \ \$ $\displaystyle \set {x \in R: x \notin S}$ $=$ $\displaystyle \set {x \in R: x \notin T}$ Definition of Set Difference $\displaystyle \leadstoandfrom \ \$ $\displaystyle \forall x \in R: \quad x \notin S$ $\iff$ $\displaystyle x \notin T$ $\displaystyle \leadstoandfrom \ \$ $\displaystyle \forall x \in R: \quad x \in S$ $\iff$ $\displaystyle x \in T$ $\displaystyle \leadstoandfrom \ \$ $\displaystyle \set {\paren {x \in R} \land \paren {x \in S} }$ $=$ $\displaystyle \set {\paren {x \in R} \land \paren {x \in T} }$ $\displaystyle \leadstoandfrom \ \$ $\displaystyle R \cap S$ $=$ $\displaystyle R \cap T$ Definition of Set Intersection

$\blacksquare$

## Proof 2

$\paren {R \setminus S} \cup \paren {R \cap S} = R = \paren {R \setminus T} \cup \paren {R \cap T}$
$\paren {R \cap S} \cap \paren {R \setminus S} = \O = \paren {R \cap T} \cap \paren {R \setminus T}$

whatever $R, S, T$ might be.

Let $R \setminus S = R \setminus T$.

Then:

 $\displaystyle \paren {\paren {R \setminus S} \cup \paren {R \cap S} } \setminus \paren {R \setminus S}$ $=$ $\displaystyle \paren {\paren {R \setminus T} \cup \paren {R \cap T} } \setminus \paren {R \setminus T}$ $\displaystyle \leadsto \ \$ $\displaystyle \paren {R \cap S} \setminus \paren {R \setminus S}$ $=$ $\displaystyle \paren {R \cap T} \setminus \paren {R \setminus T}$ Set Difference with Union is Set Difference

Now, we have from Set Difference with Disjoint Set:

$S \cap T = \O \iff S \setminus T = S$

and so:

$\paren {R \cap S} \setminus \paren {R \setminus S} = R \cap S$

and:

$\paren {R \cap T} \setminus \paren {R \setminus T} = R \cap T$

So:

$R \cap S = R \cap T$

We can use exactly the same reasoning if we assume $R \cap S = R \cap T$:

 $\displaystyle \paren {\paren {R \setminus S} \cup \paren {R \cap S} } \setminus \paren {R \cap S}$ $=$ $\displaystyle \paren {\paren {R \setminus T} \cup \paren {R \cap T} } \setminus \paren {R \cap T}$ $\displaystyle \leadsto \ \$ $\displaystyle \paren {R \setminus S} \setminus \paren {R \cap S}$ $=$ $\displaystyle \paren {R \setminus T} \setminus \paren {R \cap T}$ Set Difference with Union is Set Difference

and then because of Set Difference with Disjoint Set as above:

$\paren {R \setminus S} \setminus \paren {R \cap S} = R \setminus S$

and:

$\paren {R \setminus T} \setminus \paren {R \cap T} = R \setminus T$

So:

$R \setminus S = R \setminus T$

$\blacksquare$