Fixpoint remove_all (to_delete l : list A) : list A :=
    match to_delete with
    | [] => l
    | d :: ds => remove_all ds (remove A_eq_dec d l)
    end.

(* Specifications: *)
Lemma in_remove_all_was_in : forall ds l x, In x (remove_all ds l) -> In x l.
Lemma in_remove_all_preserve : forall ds l x, ~ In x ds -> In x l -> In x (remove_all ds l).
Lemma in_remove_all_not_in : forall ds l x, In x (remove_all ds l) -> In x ds -> False.
Lemma remove_all_nil : forall ys, remove_all ys [] = [].
Lemma remove_all_cons : forall ys a l, (remove_all ys (a :: l) = remove_all ys l /\ In a ys) \/ (remove_all ys (a :: l) = a :: (remove_all ys l) /\ ~In a ys).
Lemma before_remove_all : forall x y l ys, before x y (remove_all ys l) -> ~ In y ys -> before x y l.
Lemma before_remove_all_if : forall x y l xs, before x y l -> ~ In x xs -> before x y (remove_all xs l).
Lemma NoDup_remove_all : forall l l', NoDup l' -> NoDup (remove_all l l').
Lemma remove_all_NoDup_split : forall l l' l0 l1 a, NoDup l' -> remove_all l l' = l0 ++ a :: l1 -> remove_all l (remove A_eq_dec a l') = l0 ++ l1.
Lemma remove_all_app_l : forall xs ys zs, remove_all (xs ++ ys) zs = remove_all xs (remove_all ys zs).
Lemma remove_all_app_r : forall xs ys zs, remove_all xs (ys ++ zs) = remove_all xs ys ++ remove_all xs zs.
Lemma remove_all_del_comm : forall xs ys zs, remove_all xs (remove_all ys zs) = remove_all ys (remove_all xs zs).