#[global]
Hint Immediate eq_sym : ordered_type.
#[global]
Hint Resolve eq_refl eq_trans lt_not_eq lt_trans : ordered_type.
End MiniOrderedType.
Module Type OrderedType.
Include MiniOrderedType.
(** A [eq_dec] can be deduced from [compare] below. But adding this redundant field allows seeing an OrderedType as a DecidableType. *)
Parameter eq_dec : forall x y, { eq x y } + { ~ eq x y }.
End OrderedType.
Module MOT_to_OT (Import O : MiniOrderedType) <: OrderedType.
Include O.
Definition eq_dec : forall x y : t, {eq x y} + {~ eq x y}.
Proof with auto with ordered_type.
intros x y; elim (compare x y); intro H; [ right | left | right ]...
assert (~ eq y x)...
Defined.
End MOT_to_OT.
(** * Ordered types properties *)
(** Additional properties that can be derived from signature [OrderedType]. *)
Module OrderedTypeFacts (Import O: OrderedType).
#[global]
Instance eq_equiv : Equivalence eq.
#[global]
Instance lt_strorder : StrictOrder lt.

Lemma eq_lt : forall x y z, eq x y -> lt y z -> lt x z.
Proof with auto with ordered_type.