Proof using.
intros l1; elim l1; auto.
intros l2; case l2; simpl in |- *; auto; intros; discriminate.
intros a l H l2 l3 l4; case l2.
simpl in |- *; intros; discriminate.
intros b l0 H0.
apply trans_equal with (f a b :: map2 (l ++ l3) (l0 ++ l4)).
simpl in |- *; auto.
rewrite H; auto.
Qed.
End map2.
Arguments map2 [A B C].
(* Definitions of the first and skip function *)
Section First.
Variable A : Type.
(* Take the first elements of a list *)
Fixpoint first_n (l : list A) (n : nat) {struct n} :
list A :=
match n with
| O => nil
| S n1 => match l with
| nil => nil
| a :: l1 => a :: first_n l1 n1
end
end.

(* Properties of first_n *)
Theorem first_n_app1 :
forall (n : nat) (l1 l2 : list A),
length l1 <= n -> first_n (l1 ++ l2) n = l1 ++ first_n l2 (n - length l1).