(****************************************************************)
(* 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.

(* Specifications: *)
Lemma length_map : forall (l : list A) (f : A -> B), length (map l f) = length l.
Lemma eq_cons : forall (l1 l2 : list A) (a1 a2 : A), a1 :: l1 = a2 :: l2 -> l1 = l2.
Lemma not_eq_cons : forall (l1 l2 : list A) (a1 a2 : A), l1 <> l2 -> a1 :: l1 <> a2 :: l2.