induction ls1; intuition; simpl in *.
case_eq (f a); intuition.
rewrite <- app_comm_cons.
f_equal.
eauto.
Qed.

(* Specifications: *)
Theorem filter_true :
forall (A : Set)(ls : list A)(f : A -> bool),
(forall a, In a ls -> (f a) = true) ->
filter f ls = ls.