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

Lemma filter_cons : forall (A : Set)(P : A -> bool)(ls : list A) a, filter P (a :: ls) = if (P a) then (a :: (filter P ls)) else (filter P ls).