(** An injective and surjective function is bijective. We need here stronger hypothesis : decidability of equality in Type. *)
Definition EqDec (A:Type) := forall x y:A, {x=y}+{x<>y}.
(** First, we show that a surjective f has an inverse function g such that f.g = id. *)
(* NB: instead of (Finite A), we could ask for (RecEnum A) with: Definition RecEnum A := exists h:nat->A, surjective h. *)

Lemma Finite_Empty_or_not A :
Finite A -> (A->False) \/ exists a:A,True.