Proof using.
intros xs p ys xs' ys' H.
f_apply H (remove A_eq_dec p).
rewrite remove_dedup_comm, remove_partition in *.
find_rewrite.
rewrite remove_partition.
apply remove_not_in.
apply NoDup_remove_2.
rewrite <- H.
apply NoDup_dedup.
Qed.

Lemma dedup_NoDup_id : forall (xs : list A),
NoDup xs -> dedup xs = xs.