Given the definition of Kuratowski pairs, Pairs have right identity conditions I'm supposed to prove that $\{\{a\}, \{a,b\}\} = \{\{c\}, \{c,d\}\}$ iff $a = c \wedge  b = d.$
I'm trying to show that if {{a}, {a,b}} = {{c}, {c,d}} then ((a = c) & (b = d)) on the assumption that a = b.
However, I'm only ever able to show that (a = c) follows and not that (b = d). 
Does anyone have any advice?
 A: Assuming the Axiom of Extensionality, that $x=y \iff \forall z\;(z\in x\iff z\in y)$: Let $S=\{\{a\},\{a,b\}=\{\{c\},\{c,d\}\}.$
Suppose $a\ne c.$ Then $\{a\}\ne \{c\}$ but $\{a\}\in S$ so $\{a\}=\{c,d\}$ so $c=d=a.$
Therefore $a\ne c\implies a=c,$ so we must have $a=c.$  
Now if  $b=a=c$ then $S=\{\{a\}\}=\{\{a\},\{a,d\}\}$ so $d=a,$ so $d=a=c=b.$ 
Or if $b\ne a=c$ then $\{c\}=\{a\}\ne\{a,b\}\in S$ so $\{a,b\}=\{c,d\}=\{a,d\}.$ And $(b\ne a\land \{a,b\}=\{a,d\})\implies b=d.$
The reverse implication $(a=c\land b=d)\implies \{\{a\},\{a,b\}\}=\{\{c\},\{c,d\}\}$ is obvious.
A: First suppose that $a \neq b$ and $c \neq d$. Given that you already know that $a = c$, look at
$$
\begin{align*}
\{ b \} &= \{a,b \} \setminus \{a \} \\
&= ( \bigcup \{ \{a \}, \{a,b\} \} ) \setminus \{ a \} \\
&= ( \bigcup \{ \{c \}, \{c,d \} \} ) \setminus \{ a \} \\
&= ( \bigcup \{ \{c \}, \{c,d \} \} ) \setminus \{ c \} \\
&= \{ c, d \} \setminus \{ c \} \\
&= \{ d \}
\end{align*}
$$
and now observe that
$$
b = \bigcup \{b \} = \bigcup \{d \} = d.
$$
If $a = b$. Then 
$$
\begin{align*}
\{ \{a \}, \{a,b \} \} &= \{ \{a \} \} \\
&= \{ \{c\}, \{c,d \} \}
\end{align*}
$$
and hence $\{a\} = \{c\} = \{c,d \}$, the only element of the above set. But this yields $a = c = d$ and thus $a = b = c =d $, as desired. 
The remaining case $c = d$ follows by symmetry.
