unfold surjective in |- *.
intros A B C f g H' y; try assumption.
elim (H' y); intros x E; try exact E.
simpl in E.
unfold comp_map_fun in E.
exists (Ap f x); try assumption; auto with algebra.
Qed.

(* Specifications: *)
Lemma comp_is_id_then_bijective :
forall (A B : Setoid) (f : MAP A B) (g : MAP B A),
Equal (comp_map_map g f) (Id A) ->
Equal (comp_map_map f g) (Id B) -> bijective f.