Second Projection on Ordered Pair of Sets

Theorem
Let $a$ and $b$ be sets.

Let $w = \tuple {a, b}$ denote the ordered pair of $a$ and $b$.

Let $\map {\pr_2} w$ denote the second projection on $w$.

Then:
 * $\displaystyle \map {\pr_2} w = \begin {cases} \displaystyle \map \bigcup {\bigcup w \setminus \bigcap w} & : \displaystyle \bigcup w \ne \bigcap w \\ \displaystyle \bigcup \bigcup w & : \displaystyle \bigcup w = \bigcap w \end {cases}$

where:
 * $\displaystyle \bigcup$ and $\displaystyle \bigcap$ denote union and intersection respectively.
 * $\setminus$ denotes the set difference operator.

Proof
We have by definition of second projection that:
 * $\map {\pr_1} w = \map {\pr_1} {a, b} = b$

We consider:

Suppose $\displaystyle \bigcup w \ne \bigcap w$.

Then:

demonstrating that the first case holds.

Now suppose that $\bigcup w = \bigcap w$.

Thus:

Hence:

The result follows;