(** * Properties of [OrderedType] *)
Module OrderedTypeFacts (Import O: OrderedType').
Module OrderTac := OT_to_OrderTac O.
Ltac order := OrderTac.order.
Declare Scope order.
Notation "x <= y" := (~lt y x) : order.
Infix "?=" := compare (at level 70, no associativity) : order.
Local Open Scope order.
Tactic Notation "elim_compare" constr(x) constr(y) :=
destruct (compare_spec x y).
Tactic Notation "elim_compare" constr(x) constr(y) "as" ident(h) :=
destruct (compare_spec x y) as [h|h|h].
(** The following lemmas are either re-phrasing of [eq_equiv] and [lt_strorder] or immediately provable by [order]. Interest: compatibility, test of order, etc *)
Definition eq_refl (x:t) : x==x := Equivalence_Reflexive x.
Definition eq_sym (x y:t) : x==y -> y==x := Equivalence_Symmetric x y.
Definition eq_trans (x y z:t) : x==y -> y==z -> x==z :=
Equivalence_Transitive x y z.
Definition lt_trans (x y z:t) : x<y -> y<z -> x<z :=
StrictOrder_Transitive x y z.
Definition lt_irrefl (x:t) : ~x<x := StrictOrder_Irreflexive x.
Include CompareFacts O.
Notation compare_le_iff := compare_ngt_iff (only parsing).
Notation compare_ge_iff := compare_nlt_iff (only parsing).
(** For compatibility reasons *)
Definition eq_dec := eq_dec.

Lemma eqb_alt :
forall x y, eqb x y = match compare x y with Eq => true | _ => false end.