Section AllB.
Variable T : Type.
Variable p : T -> bool.
Fixpoint allb (ls : list T) : bool :=
match ls with
| nil => true
| l :: ls =>
if p l then allb ls else false
end.
Fixpoint anyb (ls : list T) : bool :=
match ls with
| nil => false
| l :: ls =>
if p l then true else anyb ls
end.
End AllB.

(* Specifications: *)
Lemma Forall_map
: forall T U (f : T -> U) P ls,
Forall P (List.map f ls) <-> Forall (fun x => P (f x)) ls.
Lemma Forall_cons_iff : forall (T : Type) (P : T -> Prop) a b,
Forall P (a :: b) <-> (P a /\ Forall P b).
Lemma Forall_nil_iff : forall (T : Type) (P : T -> Prop),
Forall P nil <-> True.