(* End of proof of lem_sig_equiv_fun_make                                  *)

(***************************************************************************)
(* Projection sur le quotient                                              *)
(***************************************************************************)
Definition projQuotient (r a : E) (rRel : rel_sig r a a)
  (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a) :=
  subset
    (fun x : E =>
     exists z : E,
       (exists t : E, x = couple z t /\ t = equivClass r a rRel rEqv z))
    (cartesien a (quotient r a rRel rEqv rD)).

(* Specifications: *)
Lemma lem_projQuotient_is_fun : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a), fun_ (projQuotient r a rRel rEqv rD).
Lemma lem_projQuotient_dom : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a), dom (projQuotient r a rRel rEqv rD) = a.
Lemma lem_projQuotient_img : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a), Img (projQuotient r a rRel rEqv rD) = quotient r a rRel rEqv rD.
Lemma lem_projQuotient_is_surj : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a), fun_surj (projQuotient r a rRel rEqv rD) a (quotient r a rRel rEqv rD).
Lemma lem_projQuotient_eval : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a) (x : E), In x a -> App (projQuotient r a rRel rEqv rD) (lem_projQuotient_is_fun r a rRel rEqv rD) x = equivClass r a rRel rEqv x.
Lemma lem_x_equiv_in_projQ : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a) (x : E), In x a -> In (couple x (equivClass r a rRel rEqv x)) (projQuotient r a rRel rEqv rD).
Lemma lem_x_in_equivClass_x : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a) (x : E), In x a -> In x (equivClass r a rRel rEqv x).
Lemma lem_projQuotient_equiv_fun : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a), equiv_fun (projQuotient r a rRel rEqv rD) (lem_projQuotient_is_fun r a rRel rEqv rD) = r.
Lemma lem_projQuotient_sig : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a), fun_sig (projQuotient r a rRel rEqv rD) a (quotient r a rRel rEqv rD).
Lemma lem_equivClass_is_same : forall (r a : E) (rRel : rel_sig r a a) (rEqv : equivalence r a rRel) (rD : rdom r a a rRel = a) (x y : E), In x a -> In y a -> equivClass r a rRel rEqv x = equivClass r a rRel rEqv y -> In (couple x y) r.