Fixpoint Zlength_aux (acc:Z) (A:Type) (l:list A) : Z :=
  match l with
    | nil => acc
    | _ :: l => Zlength_aux (Z.succ acc) A l
  end.Definition Zlength := Zlength_aux 0.Implicit Type l : list A.

Lemma Zlength_cons (x:A) l : Zlength (x :: l) = Z.succ (Zlength l).