Fixpoint remove (x : A) (l : list A) : list A :=
    match l with
      | [] => []
      | y::tl => if (eq_dec x y) then remove x tl else y :: remove x tl
    end.

(* Specifications: *)
Lemma remove_cons : forall x l, remove x (x :: l) = remove x l.
Lemma remove_app : forall x l1 l2, remove x (l1 ++ l2) = remove x l1 ++ remove x l2.
Theorem remove_In : forall (l : list A) (x : A), ~ In x (remove x l).
Lemma notin_remove: forall l x, ~ In x l -> remove x l = l.
Lemma in_remove: forall l x y, In x (remove y l) -> In x l /\ x <> y.
Lemma in_in_remove : forall l x y, x <> y -> In x l -> In x (remove y l).
Lemma remove_remove_comm : forall l x y, remove x (remove y l) = remove y (remove x l).
Lemma remove_remove_eq : forall l x, remove x (remove x l) = remove x l.
Lemma remove_length_le : forall l x, length (remove x l) <= length l.
Lemma remove_length_lt : forall l x, In x l -> length (remove x l) < length l.