Definition intersect(A : Set)(eqd : eq_dec A)(ls1 ls2 : list A) :=
  filter (fun x => if (in_dec eqd x ls1) then true else false) ls2.

Lemma in_intersect : forall (A : Set)(eqd : eq_dec A)(ls1 ls2 : list A) a, In a (intersect eqd ls1 ls2) <-> In a ls1 /\ In a ls2.