Implicit Types A B : list X.Definition inclp (X : Type) (A : list X) (p : X -> Prop) : Prop :=
  forall x, x el A -> p x.Instance incl_preorder X : PreOrder (@incl X).Instance equi_Equivalence X : Equivalence (@equi X).(* * 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.

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