Section FORALL2.
Variable A: Type.
Variable B: Type.
Variable P: A -> B -> Prop.
Inductive list_forall2: list A -> list B -> Prop :=
| list_forall2_nil:
list_forall2 nil nil
| list_forall2_cons:
forall a1 al b1 bl,
P a1 b1 ->
list_forall2 al bl ->
list_forall2 (a1 :: al) (b1 :: bl).
End FORALL2.
(** Dropping the first N elements of a list. *)
Fixpoint list_drop (A: Type) (n: nat) (x: list A) {struct n} : list A :=
match n with
| O => x
| S n' => match x with nil => nil | hd :: tl => list_drop n' tl end
end.
(** A list of [n] elements, all equal to [x]. *)
Fixpoint list_repeat {A: Type} (n: nat) (x: A) {struct n} :=
match n with
| O => nil
| S m => x :: list_repeat m x
end.

Lemma length_list_repeat:
forall (A: Type) n (x: A), length (list_repeat n x) = n.