Fixpoint maxl l := 
  match l with
    | nil => 0
    | a :: l' => max a (maxl l')
  end.

(* Specifications: *)
Lemma in_le_maxl x l : In x l -> x <= maxl l.
Lemma maxl_map A l (f : A -> nat) n : (forall x, In x l -> f x = n) -> maxl (map f l) <= n.
Lemma maxl_le l e : maxl l <= e -> (forall x, In x l -> x <= e).
Lemma maxl_eq_le l e : maxl l = e -> (forall x, In x l -> x <= e).
Lemma maxl_eq_le3 e1 e2 e3 e : maxl [e1; e2; e3] = e -> e1 <= e /\ e2 <= e /\ e3 <= e.
Lemma maxl_le3 e1 e2 e3 e : maxl [e1; e2; e3] <= e -> e1 <= e /\ e2 <= e /\ e3 <= e.
Lemma maxl_bound e1 e2 e3 e : e1 <= e -> e2 <= e -> e3 <= e -> maxl [e1; e2; e3] <= e.
Lemma maxl_bound_in l e : (forall e', In e' l -> e' <= e) -> maxl l <= e.
Lemma maxl_cons l n : n <= maxl (n :: l).
Lemma le_maxl_cons l m n : n <= maxl l -> n <= maxl (m :: l).
Lemma nth_maxl_bound : forall A (l : list A) (m:A->nat) d i, m d = 0 -> m (nth i l d) <= maxl (map m l).
Lemma length_hd_app A (l1 l2 : list (list A)) : length (hd nil l1) <= length (hd nil (l1 ++ l2)).
Lemma length_nth_app A (l1 l2 : list (list A)) i : length (nth i l1 nil) <= length (nth i (l1 ++ l2) nil).
Lemma maxl_nth l : exists i, maxl l = nth i l 0.
Lemma maxl_map_0 A l (f : A -> nat) : (forall x, In x l -> (f x) = 0) -> maxl (map f l) = 0.
Lemma maxl_le_plusl : forall l, maxl l <= plusl l.
Lemma forallb_forall_conv : forall A f (l:list A), forallb f l = false <-> (exists x, In x l /\ f x = false).
Lemma forallb_nth : forall A (l : list A) (p : A -> bool) n d, p d = true -> forallb p l = true -> p (nth n l d) = true.
Lemma forallb_hd : forall A (l : list A) (p : A -> bool) d, forallb p l = true -> p d = true -> p (hd d l) = true.
Lemma forallb_tl : forall A (l : list A) (p : A -> bool), forallb p l = true -> forallb p (tail l) = true.
Lemma forallb_map : forall A B (l : list A) (p : B -> bool) (f : A -> B), (forall x, In x l -> p (f x) = true) -> forallb p (map f l) = true.