Section ListDenoteInsertUniq.
Context {A T : Type}.
Variables (f : A -> T) (g : T -> T -> T) (b : T).
Variable (gS : forall x y, g x y = g y x).
Variable (gA : forall x y z, g x (g y z) = g (g x y) z).
Variable (cmp : A -> A -> comparison).
Variable (Hcmp : forall x y, Eq = cmp x y ->
forall b, g (f x) (g (f y) b) = g (f y) b).
Proof with auto.
induction l; simpl...
remember (cmp a a0) as d; destruct d; simpl... rewrite Hcmp...
rewrite IHl... rewrite fgAS...
Qed.

Lemma listd_sort_uniq l : listd f g b (rsort_uniq cmp l) = listd f g b l.