(** * Polymorphic lists *)

Inductive list (A : Set) : Set :=
  | Nil : list A
  | Cons : A -> list A -> list A.(** * Polymorphic lists *)

Inductive list (A : Set) : Set :=
  | Nil : list A
  | Cons : A -> list A -> list A.(** * Polymorphic lists *)

Inductive list (A : Set) : Set :=
  | Nil : list A
  | Cons : A -> list A -> list A.(** Length of a list *)

Fixpoint length (A : Set) (l : list A) {struct l} : nat :=
  match l with
  | Nil => 0
  | Cons a r => S (length A r)
  end.

(* Specifications: *)
Lemma length_0 : forall (A : Set) (l : list A), length A l = 0 -> l = Nil A.
Lemma length_S : forall (A : Set) (l : list A) (n : nat), length A l = S n -> exists h : A, (exists t : list A, l = Cons A h t /\ length A t = n).