Proof First_uniqueness.
Record pairwise_EQ (A B C D : Ens) : Prop :=
{pairwise_EQ_ac : EQ A C; pairwise_EQ_bd : EQ B D}.
Section doubleton_uniqueness_proof.
Variable P : Ens -> Prop.
Variable A : Ens.
Variable B : Ens.
Variable C : Ens.
Variable D : Ens.
Hypothesis pA : P A.
Hypothesis nB : ~ P B.
Hypothesis pC : P C.
Hypothesis nD : ~ P D.
Hypothesis e : EQ (Doubleton A B) (Doubleton C D).
Let Doub := Doubleton C D.
Let iA : IN A (Doubleton A B) := Doubleton_th1 A B.
Let iB : IN B (Doubleton A B) := Doubleton_th2 A B.
Let step1 : SUB (Doubleton A B) Doub := EQ_forwards (Doubleton A B) Doub e.
Let iAdoub : IN A Doub := step1 A iA.
Let iBdoub : IN B Doub := step1 B iB.
Section doubleton_uniqueness_1.
Hypothesis k : EQ A D.
(* Definition Big_Extensionality: (P: Ens-> Prop) (X,Y: Ens) (p: (P X)) (e : (EQ X Y)) (P Y) :=  big_extensionality_Out. *)
Let step1_2 : P D := Big_Extensionality P A D pA k.
Definition doubleton_uniqueness_1_Out : False := nD step1_2.
End doubleton_uniqueness_1.
Let step2 : NEQ A D := doubleton_uniqueness_1_Out.
Section doubleton_uniqueness_2.
Hypothesis k : EQ B C.
Let step1_1 : EQ C B := EQ_symm B C k.
(* Definition Big_Extensionality: (P: Ens-> Prop) (X,Y: Ens) (p: (P X)) (e : (EQ X Y)) (P Y) :=  big_extensionality_Out. *)
Let step1_2 : P B := Big_Extensionality P C B pC step1_1.
Definition doubleton_uniqueness_2_Out : False := nB step1_2.
End doubleton_uniqueness_2.
Let step3 : NEQ B C := doubleton_uniqueness_2_Out.
(* Definition Doubleton_th4_b : (X,Y: Ens) (Z: Ens) (k: (IN Z (Doubleton X Y))) (n: (not (EQ Z Y))) (EQ Z X) := doubleton_th4b_Out. th4a same but with NEQ Z X and conclusion EQ Z Y *)
Let conclusionAC : EQ A C := Doubleton_th4_b C D A iAdoub step2.
Let conclusionBD : EQ B D := Doubleton_th4_a C D B iBdoub step3.
Definition doubleton_uniqueness_Out : pairwise_EQ A B C D :=
Build_pairwise_EQ A B C D conclusionAC conclusionBD.
End doubleton_uniqueness_proof.

Theorem Doubleton_uniqueness :
forall (P : Ens -> Prop) (A B C D : Ens) (pA : P A)
(nB : ~ P B) (pC : P C) (nD : ~ P D)
(e : EQ (Doubleton A B) (Doubleton C D)), pairwise_EQ A B C D.