(* Proof of lem_fun_part_img                                               *)
intros; apply axs_extensionnalite; intros; unfold iff in |- *; split; intros.
unfold Img in H.
elim
(axs_comprehension
(fun v1 : E =>
fun_ (fun_part f Af) -> exists v0 : E, In (couple v0 v1) (fun_part f Af))
(reunion (reunion (fun_part f Af))) v2); intros;
generalize (H0 H); clear H H0 H1; intros.
elim H; clear H; intros.
generalize (H0 (lem_fun_part_is_fun f Af)); clear H0; intros; elim H0;
clear H0; intros.
unfold fun_part in H0.
elim
(axs_comprehension
(fun x0 : E => exists y : E, x0 = couple y (fun_img_directe f Af y))
(cartesien (parties (dom f)) (parties (Img f)))
(couple x v2)); intros; generalize (H1 H0); clear H0 H1 H2;
intros.
elim H0; clear H0; intros.
elim H1; clear H1; intros.
elim
(lem_cartesian_propertie (parties (dom f)) (parties (Img f)) (couple x v2));
intros; generalize (H2 H0); clear H0 H2 H3; intros.
elim H0; clear H0; intros; elim H0; clear H0; intros; elim H0; clear H0;
intros; elim H2; clear H2; intros.
elim (lem_couple_propertie x x1 v2 x2); intros; generalize (H4 H3);
clear H3 H4 H5; intros.
elim H3; clear H3; intros.
rewrite H4; auto with zfc.
unfold Img in |- *.
elim
(axs_comprehension
(fun v1 : E =>
fun_ (fun_part f Af) -> exists v0 : E, In (couple v0 v1) (fun_part f Af))
(reunion (reunion (fun_part f Af))) v2); intros;
apply H1; clear H0 H1; intros.
split; intros.
elim (axs_reunion (reunion (fun_part f Af)) v2); intros; apply H1;
clear H0 H1; intros.
exists (paire (fun_img_inverse f Af v2) v2); split;
[ idtac
| elim (axs_paire (fun_img_inverse f Af v2) v2 v2); intros; apply H1; right;
reflexivity ].
elim (axs_reunion (fun_part f Af) (paire (fun_img_inverse f Af v2) v2));
intros; apply H1; clear H0 H1; intros.
exists (couple (fun_img_inverse f Af v2) v2); split;
[ idtac
| unfold couple in |- *;
elim
(axs_paire (singleton (fun_img_inverse f Af v2))
(paire (fun_img_inverse f Af v2) v2)
(paire (fun_img_inverse f Af v2) v2)); intros;
apply H1; right; reflexivity ].
unfold fun_part in |- *.
elim
(axs_comprehension
(fun x : E => exists y : E, x = couple y (fun_img_directe f Af y))
(cartesien (parties (dom f)) (parties (Img f)))
(couple (fun_img_inverse f Af v2) v2)); intros;
apply H1; clear H0 H1; intros.
split; [ idtac | exists (fun_img_inverse f Af v2) ].
elim
(lem_cartesian_propertie (parties (dom f)) (parties (Img f))
(couple (fun_img_inverse f Af v2) v2)); intros;
apply H1; clear H0 H1; intros.
exists (fun_img_inverse f Af v2); exists v2; split;
[ idtac | split; [ auto with zfc | reflexivity ] ].
elim (axs_parties (dom f) (fun_img_inverse f Af v2)); intros; apply H1;
clear H0 H1; intros.
unfold fun_img_inverse in H0.
elim
(axs_comprehension
(fun x : E => In v2 (parties (Img f)) -> In (App f Af x) v2)
(dom f) v3); intros; generalize (H1 H0); clear H0 H1 H2;
intros.
elim H0; clear H0; intros; auto with zfc.
elim
(lem_couple_propertie (fun_img_inverse f Af v2) (fun_img_inverse f Af v2) v2
(fun_img_directe f Af (fun_img_inverse f Af v2)));
intros; apply H1; clear H0 H1; intros.
split;
[ reflexivity
| apply axs_extensionnalite; intros; unfold iff in |- *; split; intros ].
unfold fun_img_directe in |- *.
elim
(axs_comprehension
(fun x : E =>
In (fun_img_inverse f Af v2) (parties (dom f)) ->
exists y : E, In y (fun_img_inverse f Af v2) /\ x = App f Af y)
(Img f) v0); intros; apply H2; clear H1 H2; intros.
split; intros.
elim (axs_parties (Img f) v2); intros; generalize (H1 H); clear H1; intros.
exact (H1 v0 H0).
elim (axs_parties (Img f) v2); intros; generalize (H2 H); clear H2 H3; intros.
generalize (H2 v0 H0); clear H2; intros.
generalize (lem_App_rev f v0 Af H2); intros; elim H3; clear H3; intros;
elim H3; clear H3; intros.
exists x; split.
unfold fun_img_inverse in |- *.
elim
(axs_comprehension
(fun x0 : E => In v2 (parties (Img f)) -> In (App f Af x0) v2)
(dom f) x); intros; apply H6; clear H5 H6; intros.
split; [ auto with zfc | intros ].
generalize (lem_eval_propertie f x v0 Af H4); intros.
rewrite <- H6; auto with zfc.
exact (lem_eval_propertie f x v0 Af H4).
unfold fun_img_directe in H0.
elim
(axs_comprehension
(fun x : E =>
In (fun_img_inverse f Af v2) (parties (dom f)) ->
exists y : E, In y (fun_img_inverse f Af v2) /\ x = App f Af y)
(Img f) v0); intros; generalize (H1 H0); clear H0 H1 H2;
intros.
elim H0; clear H0; intros.
cut (In (fun_img_inverse f Af v2) (parties (dom f))); intros.
generalize (H1 H2); clear H1 H2; intros.
elim H1; clear H1; intros; elim H1; clear H1; intros.
unfold fun_img_inverse in H1.
elim
(axs_comprehension
(fun x0 : E => In v2 (parties (Img f)) -> In (App f Af x0) v2)
(dom f) x); intros; generalize (H3 H1); clear H1 H3 H4;
intros.
elim H1; clear H1; intros; generalize (H3 H); clear H3; intros.
rewrite H2; auto with zfc.
clear H1; elim (axs_parties (dom f) (fun_img_inverse f Af v2)); intros;
apply H2; clear H1 H2; intros.
unfold fun_img_inverse in H1.
elim
(axs_comprehension
(fun x : E => In v2 (parties (Img f)) -> In (App f Af x) v2)
(dom f) v3); intros; generalize (H2 H1); clear H1 H2 H3;
intros.
elim H1; clear H1; intros; auto with zfc.
exists (fun_img_inverse f Af v2).
unfold fun_part in |- *.
elim
(axs_comprehension
(fun x : E => exists y : E, x = couple y (fun_img_directe f Af y))
(cartesien (parties (dom f)) (parties (Img f)))
(couple (fun_img_inverse f Af v2) v2)); intros;
apply H2; clear H1 H2; intros.
split; [ idtac | exists (fun_img_inverse f Af v2) ].
elim
(lem_cartesian_propertie (parties (dom f)) (parties (Img f))
(couple (fun_img_inverse f Af v2) v2)); intros;
apply H2; clear H1 H2; intros.
exists (fun_img_inverse f Af v2); exists v2; split;
[ idtac | split; [ auto with zfc | reflexivity ] ].
elim (axs_parties (dom f) (fun_img_inverse f Af v2)); intros; apply H2;
clear H1 H2; intros.
unfold fun_img_inverse in H1.
elim
(axs_comprehension
(fun x : E => In v2 (parties (Img f)) -> In (App f Af x) v2)
(dom f) v3); intros; generalize (H2 H1); clear H1 H2 H3;
intros.
elim H1; clear H1; intros; generalize (H2 H); clear H2; intros;
auto with zfc.
elim
(lem_couple_propertie (fun_img_inverse f Af v2) (fun_img_inverse f Af v2) v2
(fun_img_directe f Af (fun_img_inverse f Af v2)));
intros; apply H2; clear H1 H2; intros.
split;
[ reflexivity
| apply axs_extensionnalite; unfold iff in |- *; split; intros ].
unfold fun_img_directe in |- *.
elim
(axs_comprehension
(fun x : E =>
In (fun_img_inverse f Af v2) (parties (dom f)) ->
exists y : E, In y (fun_img_inverse f Af v2) /\ x = App f Af y)
(Img f) v0); intros; apply H3; clear H2 H3; intros.
split; elim (axs_parties (Img f) v2); intros.
exact (H2 H v0 H1).
elim (axs_parties (Img f) v2); intros.
generalize (H5 H v0 H1); clear H5 H6; intros.
generalize (lem_App_rev f v0 Af H5); intros.
elim H6; clear H6; intros; elim H6; clear H6; intros.
exists x; split.
unfold fun_img_inverse in |- *.
elim
(axs_comprehension
(fun x0 : E => In v2 (parties (Img f)) -> In (App f Af x0) v2)
(dom f) x); intros; apply H9; clear H8 H9; intros.
split; [ auto with zfc | intros ].
generalize (lem_eval_propertie f x v0 Af H7); intros.
rewrite <- H9; auto with zfc.
exact (lem_eval_propertie f x v0 Af H7).
unfold fun_img_directe in H1.
elim
(axs_comprehension
(fun x : E =>
In (fun_img_inverse f Af v2) (parties (dom f)) ->
exists y : E, In y (fun_img_inverse f Af v2) /\ x = App f Af y)
(Img f) v0); intros; generalize (H2 H1); clear H1 H2 H3;
intros.
elim H1; clear H1; intros.
cut (In (fun_img_inverse f Af v2) (parties (dom f))); intros.
generalize (H2 H3); clear H2 H3; intros.
elim H2; clear H2; intros; elim H2; clear H2; intros.
unfold fun_img_inverse in H2.
elim
(axs_comprehension
(fun x0 : E => In v2 (parties (Img f)) -> In (App f Af x0) v2)
(dom f) x); intros; generalize (H4 H2); clear H2 H4 H5;
intros.
elim H2; clear H2; intros; generalize (H4 H); clear H4; intros.
rewrite H3; auto with zfc.
clear H2; elim (axs_parties (dom f) (fun_img_inverse f Af v2)); intros;
apply H3; clear H2 H3; intros.
unfold fun_img_inverse in H2.
elim
(axs_comprehension
(fun x : E => In v2 (parties (Img f)) -> In (App f Af x) v2)
(dom f) v3); intros; generalize (H3 H2); clear H2 H3 H4;
intros.
elim H2; clear H2; intros; auto with zfc.
Qed.
(* End of proof of lem_fun_part_img                                        *)

(* Specifications: *)
(***************************************************************************)
(* Les lemmes dont on avait besoin dans la preuve d'avant                  *)
(***************************************************************************)
(***************************************************************************)
(* (fun_img_inverse f Af x) est un element de (parties (dom f))            *)
(***************************************************************************)
Lemma lem_fun_img_inv_is_in_pdom :
forall (f : E) (Af : fun_ f) (x : E),
In x (parties (Img f)) -> In (fun_img_inverse f Af x) (parties (dom f)).