(* Proof of lem_fun_equiv_is_equiv                                         *)
unfold equivalence in |- *; intros.
split;
[ unfold reflexivity in |- *; intros
| split;
[ unfold symmetry in |- *; intros | unfold transitivity in |- *; intros ] ].
unfold equiv_fun in |- *.
elim
(axs_comprehension
(fun x0 : E =>
exists a : E, (exists b : E, x0 = couple a b /\ App f Af a = App f Af b))
(cartesien (dom f) (dom f)) (couple x x)); intros;
apply H1; clear H0 H1; intros.
split; [ idtac | exists x; exists x; split; reflexivity ].
elim (lem_cartesian_propertie (dom f) (dom f) (couple x x)); intros; apply H1;
clear H0 H1; intros.
exists x; exists x.
unfold rdom in H.
elim
(axs_comprehension
(fun x0 : E => exists y : E, In (couple x0 y) (equiv_fun f Af))
(dom f) x); intros; generalize (H0 H); clear H H0 H1;
intros.
elim H; clear H; intros.
split; [ auto with zfc | split; [ auto with zfc | reflexivity ] ].
unfold equiv_fun in H.
elim
(axs_comprehension
(fun x0 : E =>
exists a : E, (exists b : E, x0 = couple a b /\ App f Af a = App f Af b))
(cartesien (dom f) (dom f)) (couple x y)); intros;
generalize (H0 H); clear H H0 H1; intros.
elim H; clear H; intros; elim H0; clear H0; intros; elim H0; clear H0; intros;
elim H0; clear H0; intros.
elim (lem_couple_propertie x x0 y x1); intros; generalize (H2 H0);
clear H0 H2 H3; intros; elim H0; clear H0; intros.
generalize H; rewrite H0; rewrite H2; clear H H0 H2; intros.
elim (lem_cartesian_propertie (dom f) (dom f) (couple x0 x1)); intros;
generalize (H0 H); clear H H0 H2; intros.
elim H; clear H; intros; elim H; clear H; intros; elim H; clear H; intros;
elim H0; clear H0; intros.
elim (lem_couple_propertie x0 x2 x1 x3); intros; generalize (H3 H2);
clear H2 H3 H4; intros; elim H2; clear H2; intros.
generalize H H0; rewrite <- H2; rewrite <- H3; clear H H0 H2 H3; intros.
unfold equiv_fun in |- *.
elim
(axs_comprehension
(fun x : E =>
exists a : E, (exists b : E, x = couple a b /\ App f Af a = App f Af b))
(cartesien (dom f) (dom f)) (couple x1 x0)); intros;
apply H3; clear H2 H3; intros.
split;
[ idtac
| exists x1; exists x0; split;
[ reflexivity | symmetry  in |- *; auto with zfc ] ].
elim (lem_cartesian_propertie (dom f) (dom f) (couple x1 x0)); intros;
apply H3; clear H2 H3; intros.
exists x1; exists x0; split;
[ auto with zfc | split; [ auto with zfc | reflexivity ] ].
unfold equiv_fun in H.
elim
(axs_comprehension
(fun x0 : E =>
exists a : E, (exists b : E, x0 = couple a b /\ App f Af a = App f Af b))
(cartesien (dom f) (dom f)) (couple x y)); intros;
generalize (H1 H); clear H H1 H2; intros.
elim H; clear H; intros; elim H1; clear H1; intros; elim H1; clear H1; intros;
elim H1; clear H1; intros.
elim (lem_couple_propertie x x0 y x1); intros; generalize (H3 H1);
clear H1 H3 H4; intros.
elim H1; clear H1; intros.
generalize H2; rewrite <- H1; rewrite <- H3; clear H1 H2 H3; intros.
elim (lem_cartesian_propertie (dom f) (dom f) (couple x y)); intros;
generalize (H1 H); clear H H1 H3; intros.
elim H; clear H; intros; elim H; clear H; intros; elim H; clear H; intros;
elim H1; clear H1; intros.
elim (lem_couple_propertie x x2 y x3); intros; generalize (H4 H3);
clear H3 H4 H5; intros.
elim H3; clear H3; intros.
generalize H H1; rewrite <- H3; rewrite <- H4; clear H H1 H3 H4; intros.
unfold equiv_fun in H0.
elim
(axs_comprehension
(fun x : E =>
exists a : E, (exists b : E, x = couple a b /\ App f Af a = App f Af b))
(cartesien (dom f) (dom f)) (couple y z)); intros;
generalize (H3 H0); clear H0 H3 H4; intros.
elim H0; clear H0; intros; elim H3; clear H3; intros; elim H3; clear H3;
intros; elim H3; clear H3; intros.
elim (lem_couple_propertie y x4 z x5); intros; generalize (H5 H3);
clear H3 H5 H6; intros.
elim H3; clear H3; intros.
generalize H4; rewrite <- H3; rewrite <- H5; clear H3 H4 H5; intros.
elim (lem_cartesian_propertie (dom f) (dom f) (couple y z)); intros;
generalize (H3 H0); clear H0 H3 H5; intros.
elim H0; clear H0; intros; elim H0; clear H0; intros; elim H0; clear H0;
intros; elim H3; clear H3; intros.
elim (lem_couple_propertie y x6 z x7); intros; generalize (H6 H5);
clear H5 H6 H7; intros.
elim H5; clear H5; intros.
generalize H0 H3; rewrite <- H5; rewrite <- H6; clear H0 H3 H5 H6; intros.
clear H1; unfold equiv_fun in |- *.
elim
(axs_comprehension
(fun x0 : E =>
exists a : E, (exists b : E, x0 = couple a b /\ App f Af a = App f Af b))
(cartesien (dom f) (dom f)) (couple x z)); intros;
apply H5; clear H1 H5; intros.
split;
[ idtac
| exists x; exists z; split;
[ reflexivity | rewrite <- H4; auto with zfc ] ].
elim (lem_cartesian_propertie (dom f) (dom f) (couple x z)); intros; apply H5;
clear H1 H5; intros.
exists x; exists z; split;
[ auto with zfc | split; [ auto with zfc | reflexivity ] ].
Qed.
(* End of proof of lem_fun_equiv_is_equiv                                  *)

(* Specifications: *)
Lemma lem_sig_fun_equiv_is_equiv :
forall (f a s : E) (Afs : fun_sig f a s),
equivalence (equiv_fun f (lem_fun_sig_is_fun f a s Afs)) a
(lem_sig_fun_equiv_is_rel f a s Afs).