(** find whether a boolean function is satisfied by
    all the elements of a list. *)

    Fixpoint forallb (l:list A) : bool :=
      match l with
      | [] => true
      | a::l => f a && forallb l
      end.

(* Specifications: *)
Lemma forallb_forall : forall l, forallb l = true <-> (forall x, In x l -> f x = true).
Lemma forallb_app : forall l1 l2, forallb (l1++l2) = forallb l1 && forallb l2.