Section Images1.
Variable E F : Setoid.
Variable f : MAP E F.
Definition image : part_set E -> part_set F.
intros A.
apply
(Build_Predicate
(Pred_fun:=fun y : F => exists x : E, in_part x A /\ Equal y (f x))).
red in |- *.
intros y y' H' H'0; try assumption.
elim H'; intros x E0; elim E0; intros H'1 H'2; try exact H'1; clear E0 H'.
exists x; split; [ try assumption | idtac ].
apply Trans with y; auto with algebra.
Defined.
simpl in |- *; auto with algebra.
Qed.
simpl in |- *; auto with algebra.
intros A x y H' H'0; try assumption.
exists x; split; [ try assumption | idtac ]; auto with algebra.
Qed.
Hint Resolve in_image: algebra.
intros A B H'; try assumption.
unfold included in |- *.
intros x H'0; try assumption.
elim H'0.
intros x0 H'1; try assumption.
apply in_image with (x := x0); auto with algebra.
red in H'.
elim H'1.
auto with algebra.
elim H'1; auto with algebra.
Qed.
Hint Resolve image_included: algebra.
intros A B H'; try assumption.
apply included_antisym; auto with algebra.
Qed.
Hint Resolve image_comp: algebra.
simpl in |- *; auto with algebra.
intros A x H'; try assumption.
exists x; split; [ try assumption | idtac ]; auto with algebra.
Qed.
Hint Resolve image_in_image: algebra.
Definition image_map := image (full E).
Let surj_set_image_fun : E -> image_map.
intros x; try assumption.
unfold image_map in |- *.
simpl in |- *.
cut (in_part (f x) (image (full E))).
intros H'; try assumption.
apply (Build_subtype (P:=image (full E)) (subtype_elt:=f x) H').
auto with algebra.
Defined.
Definition surj_set_image : MAP E image_map.
apply (Build_Map (Ap:=surj_set_image_fun)).
red in |- *.
simpl in |- *.
unfold subtype_image_equal in |- *.
simpl in |- *.
auto with algebra.
Defined.
red in |- *.
simpl in |- *.
unfold subtype_image_equal in |- *.
simpl in |- *.
unfold image_map in |- *.
intros y; try assumption.
elim y.
intros x' subtype_prf; try assumption.
elim subtype_prf.
intros x H'; try assumption.
exists x; try assumption.
elim H'; intros H'0 H'1; try exact H'1; clear H'.
Qed.
Let surj_part_image_fun : forall A : part_set E, A -> image A.
intros A x; try assumption.
elim x.
intros x' H'; try assumption.
cut (in_part (f x') (image A)).
intros H'0; try assumption.
simpl in |- *.
apply (Build_subtype (P:=image A) (subtype_elt:=f x') H'0).
auto with algebra.
Defined.
Definition surj_part_image : forall A : part_set E, MAP A (image A).
intros A; try assumption.
apply (Build_Map (Ap:=surj_part_image_fun (A:=A))).
red in |- *.
simpl in |- *.
unfold subtype_image_equal in |- *.
intros x y; try assumption.
elim x.
elim y.
simpl in |- *.
auto with algebra.
Defined.

Lemma surj_part_image_surjective :
forall A : part_set E, surjective (surj_part_image A).