Fixpoint forNats(n : nat) :=
  match n with
      | 0 => nil
      | S n' =>
        cons n' (forNats n')
  end.

Theorem hd_filter_false_eq_and_false : forall (A : Type)(ls : list A)(P : A -> bool), (if hd_error (filter P ls) then false else true) = fold_left (fun (b : bool) (z : A) => b && negb (P z)) ls true.