Need help in understanding this theorem..

Theorem 2.1.1. Let <a, b> and <c, d> be ordered pairs. Then <a, b> = <c, d> if and only if a = c and b = d.

Remark. The expression “if and only if” means that

1. If <a, b> = <c, d> , then a = c and b = d.

2. If a = c and b = d, then <a, b> = <c, d> . (This is called "the converse" of 1.)

So, we have to prove two directions, namely 1. and 2. Usually, “if and only if” is abbreviated as simply “iff”.

Proof. “⇒”: Suppose <a, b> = <c, d> ; then, by deﬁnition of ordered pair,

<a, b> = {{a}, {a, b}},

<c, d> = {{c}, {c, d}},

and since they are equal by our hypothesis, we have

{{a}, {a, b}} = {{c}, {c, d}}.

We consider two cases:

1. a = b: Then,

<a, b> = {{a}, {a, b}} = {{a}} = {{c}, {c, d}},

hence, {a} = {c} which implies a = c. Furthermore, {a} = {c, d} = {a, d}

which implies d = a = b. Thus, for this case we have shown that a = c and b = d.

I got stuck at this d=a=b. how?

someone please explain.