End Equi.
(* * Filter *)
Definition filter (X : Type) (p : X -> Prop) (p_dec : forall x, dec (p x)) : list X -> list X :=
fix f A := match A with
| nil => nil
| x::A' => if decision (p x) then x :: f A' else f A'
end.
Arguments filter {X} p {p_dec} A.
Section FilterLemmas.
Variable X : Type.
Variable p : X -> Prop.
Context {p_dec : forall x, dec (p x)}.

Lemma in_filter_iff x A :
x el filter p A <-> x el A /\ p x.