(********* existence definitions **********************)

Definition DOESNT_EXIST (P : Ens -> Prop) := forall A : Ens, ~ P A.Definition EXISTS (P : Ens -> Prop) := ~ DOESNT_EXIST P.(********* the axiom of choice, applied to the whole Ens *******)

Parameter CHOICE : forall P : Ens -> Prop, Ens.Axiom CHOICE_pr : forall (P : Ens -> Prop) (h : EXISTS P), P (CHOICE P).(**** we need to assume that something exists, for simplicity assume the
emptyset  *****)

Parameter EmptySet : Ens.Axiom EmptySet_pr : DOESNT_EXIST (fun X : Ens => IN X EmptySet).(********* we have to define Bounded *********************)

Definition Bounded_By (A : Ens) (P : Ens -> Prop) :=
  forall X : Ens, P X -> IN X A.Definition Bounded (P : Ens -> Prop) :=
  EXISTS (fun A : Ens => Bounded_By A P).(********** unions of two sets, then big Unions ************)

Parameter union : forall A B : Ens, Ens.Axiom union_pr1 : forall A B : Ens, SUB A (union A B).Axiom union_pr2 : forall A B : Ens, SUB B (union A B).Axiom
  union_pr3 :
    forall (A B C : Ens) (h : SUB A C) (k : SUB B C), SUB (union A B) C.Record nested_IN (A B C : Ens) : Prop := 
  {nested_IN_ab : IN A B; nested_IN_bc : IN B C}.Record nested_IN (A B C : Ens) : Prop := 
  {nested_IN_ab : IN A B; nested_IN_bc : IN B C}.Record nested_IN (A B C : Ens) : Prop := 
  {nested_IN_ab : IN A B; nested_IN_bc : IN B C}.Definition b_in_Union_a (A B : Ens) :=
  EXISTS (fun C : Ens => nested_IN B C A).Axiom Union_bounded : forall F : Ens, Bounded (b_in_Union_a F).(******** singletons ****************)

Parameter Singleton : Ens -> Ens.Axiom Singleton_pr1 : forall X : Ens, IN X (Singleton X).Axiom Singleton_pr2 : forall (X Y : Ens) (h : IN Y (Singleton X)), EQ X Y.(********* extensionality ******************)

Axiom Extensionality : forall (X Y Z : Ens) (h : EQ X Y) (k : IN Y Z), IN X Z.(********* powerset ******************)

Axiom Powerset_bounded : forall X : Ens, Bounded (fun Y : Ens => SUB Y X).(********* replacement axioms *********)



Parameter REPLACEMENT : forall P : Ens -> Prop, Ens.Axiom
  REPLACEMENT_pr1 :
    forall (P : Ens -> Prop) (b : Bounded P) (X : Ens),
    P X -> IN X (REPLACEMENT P).Axiom
  REPLACEMENT_pr2 :
    forall (P : Ens -> Prop) (b : Bounded P) (X : Ens),
    IN X (REPLACEMENT P) -> P X.(*********** for the natural numbers ***********)

Definition Zero := EmptySet.Definition Next (X : Ens) : Ens := union X (Singleton X).Record Contains_NN (X : Ens) : Prop := 
  {Contains_NN_zero : IN Zero X;
   Contains_NN_nexts : forall (A : Ens) (h : IN A X), IN (Next A) X}.Record Contains_NN (X : Ens) : Prop := 
  {Contains_NN_zero : IN Zero X;
   Contains_NN_nexts : forall (A : Ens) (h : IN A X), IN (Next A) X}.Record Contains_NN (X : Ens) : Prop := 
  {Contains_NN_zero : IN Zero X;
   Contains_NN_nexts : forall (A : Ens) (h : IN A X), IN (Next A) X}.Axiom Infinity_exists : EXISTS Contains_NN.

Lemma subset_reflexive_Out : IN B A.