(* End of proof of lem_App_rev                                        *)

(***************************************************************************)
(***************************************************************************)
(* Composition d'application                                               *)
(***************************************************************************)
(***************************************************************************)
Definition comp (f g a b c : E) (Af : fun_sig f a b) 
  (Ag : fun_sig g b c) :=
  subset
    (fun c : E =>
     exists y : E, In (couple (first c) y) f /\ In (couple y (second c)) g)
    (cartesien a c).(***************************************************************************)
(* Il peut paraitre necessaire de reformuler la definition de la           *)
(* composition.                                                            *)
(***************************************************************************)
Definition comp2 (f g a b c : E) :=
  subset
    (fun x : E =>
     fun_sig f a b ->
     fun_sig g b c ->
     exists y : E, In (couple (first x) y) f /\ In (couple y (second x)) g)
    (cartesien a c).

Lemma lem_comp_intermed : forall (f g a b c x z : E) (Af : fun_sig f a b) (Ag : fun_sig g b c), In (couple x z) (comp f g a b c Af Ag) -> exists y : E, In (couple x y) f /\ In (couple y z) g.