Section AllB.
Universe u.
Variable T : Type@{u}.
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.

Lemma Forall_map@{uT uU}
: forall (T : Type@{uT}) (U : Type@{uU}) (f : T -> U) P ls,
Forall P (List.map f ls) <-> Forall (fun x => P (f x)) ls.