(****************************************************************)
(* map *)

Fixpoint map (l : list A) : (A -> B) -> list B :=
  
 (************************)
 fun f : A -> B =>
 match l return (list B) with
 | nil => nil
 | b :: l' => f b :: map l' f
 end.

Lemma eq_cons : forall (l1 l2 : list A) (a1 a2 : A), a1 :: l1 = a2 :: l2 -> l1 = l2.