Section Filter.
Variable X : Type.
Implicit Types (x y: X) (A B C: list X) (p q: X -> bool).
(* Fixpoint filter p A : list X := *)
(*   match A with *)
(*   | nil => nil *)
(*   | x::A' => if p x then x :: filter p A' else filter p A' *)
(*   end. *)
End Filter.

Lemma filter_map X Y p (f: X -> Y) A :
filter p (map f A) = map f (filter (fun x => p (f x)) A).