Definition rev_cmp {A : Type} (cmp : A -> A -> comparison) :=
  fun a b => match cmp a b with Eq => Eq | Lt => Gt | Gt => Lt end.

(* Specifications: *)
Lemma rev_cmp_cspec {A} (c: A -> A -> comparison) : CompSpec' c -> CompSpec' (rev_cmp c).
Lemma rev_cmp_eq : forall {A : Type} (cmp : A -> A -> comparison) (x y : A), (forall x0 y0 : A, Eq = cmp x0 y0 -> x0 = y0) -> Eq = rev_cmp cmp x y -> x = y.