Proof with auto.
induction l; simpl...
remember (cmp a a0) as d; destruct d; simpl... rewrite Hcmp...
rewrite IHl... rewrite fgAS...
Qed.

(* Specifications: *)
Lemma listd_sort_uniq l : listd f g b (rsort_uniq cmp l) = listd f g b l.
Proof with auto.