Fixpoint map_rec {A B} (f : A -> B) (l : list A) (acc : list B) :=
  match l with
  | [] => rev' acc
  | a :: l => map_rec f l (f a :: acc)
  end.

Lemma map_rec_spec : forall {A B} (f : A -> B) (l : list A) (acc : list B), map_rec f l acc = rev acc ++ List.map f l.