Definition StrictCompSpec {A} (eq lt: A -> A -> Prop)
                          (cmp: A -> A -> comparison) :=
  StrictOrder lt /\ forall x y, CompSpec eq lt x y (cmp x y).Definition CompSpec' {A} (cmp: A -> A -> comparison) :=
   StrictCompSpec (@Logic.eq A) (fun x y => Lt = cmp x y) cmp.Ltac do_comp cspec x y := destruct (CompSpec2Type (proj2 cspec x y)).

(* Specifications: *)
Lemma lt_comp: forall {A} lt cmp, StrictCompSpec Logic.eq lt cmp -> forall x y: A, (lt x y <-> Lt = cmp x y).
Lemma eq_comp: forall {A} lt cmp, StrictCompSpec Logic.eq lt cmp -> forall x y: A, (x = y <-> Eq = cmp x y).
Lemma gt_comp: forall {A} lt cmp, StrictCompSpec Logic.eq lt cmp -> forall x y: A, (lt x y <-> Gt = cmp y x).
Lemma comp_refl: forall {A} (cmp: A -> A -> comparison) (cspec: CompSpec' cmp), forall x, cmp x x = Eq.
Lemma comp_eq: forall {A} (cmp: A -> A -> comparison) (cspec: CompSpec' cmp), forall x y, Eq = cmp x y -> x=y.
Lemma comp_trans: forall {A} (cmp: A -> A -> comparison) (cspec: CompSpec' cmp), forall x y z, Lt = cmp x y -> Lt = cmp y z -> Lt = cmp x z.