Proof using.
induction xs; simpl.
- constructor.
- break_if; auto.
constructor; auto.
intro.
apply n.
eapply in_dedup_was_in; eauto.
Qed.

Lemma remove_dedup_comm : forall (x : A) xs,
remove A_eq_dec x (dedup xs) =
dedup (remove A_eq_dec x xs).