(** Remove by filtering *)
Definition remove' (x : A) : list A -> list A :=
filter (fun y => if eq_dec x y then false else true).

(* Specifications: *)
Lemma remove_alt (x : A) (l : list A) : remove' x l = remove eq_dec x l.
Definition count_occ' (l : list A) (x : A) : nat :=
length (filter (fun y => if eq_dec y x then true else false) l).