Section Maps1_2.
Comments "We define now injections, surjections and bijections.".
Variable A B : Setoid.
Definition injective (f : MAP A B) : Prop :=
forall x y : A, Equal (f x) (f y) -> Equal x y.
Definition surjective (f : MAP A B) : Prop :=
forall y : B, exists x : A, Equal y (f x).
Definition bijective (f : MAP A B) : Prop := injective f /\ surjective f.
End Maps1_2.
Comments "These definitions are coherent with equality of maps:".
unfold injective in |- *.
intros A B f f' H' H'0 x y H'1; try assumption.
apply H'.
apply Trans with (Ap f' x); auto with algebra.
apply Trans with (Ap f' y); auto with algebra.
Qed.
unfold surjective in |- *.
intros A B f f' H' H'0 y; try assumption.
elim (H' y); intros x E; try exact E.
exists x; try assumption.
apply Trans with (Ap f x); auto with algebra.
Qed.

Lemma bijective_comp :
forall (A B : Setoid) (f f' : MAP A B),
bijective f -> Equal f f' -> bijective f'.