Module Type EqLt := Typ <+ HasEq <+ HasLt.Module Type EqLe := Typ <+ HasEq <+ HasLe.Module Type EqLtLe := Typ <+ HasEq <+ HasLt <+ HasLe.Module Type EqLtNotation (E:EqLt) := EqNotation E <+ LtNotation E.Module Type EqLeNotation (E:EqLe) := EqNotation E <+ LeNotation E.Module Type EqLtLeNotation (E:EqLtLe) := EqNotation E <+ LtLeNotation E.Module Type EqLt' := EqLt <+ EqLtNotation.Module Type EqLe' := EqLe <+ EqLeNotation.Module Type EqLtLe' := EqLtLe <+ EqLtLeNotation.Module Type StrOrder := EqualityType <+ HasLt <+ IsStrOrder.Module Type StrOrder' := StrOrder <+ EqLtNotation.Module Type HasCompare (E:EqLt) := HasCmp E <+ CmpSpec E.Module Type DecStrOrder := StrOrder <+ HasCompare.Module Type DecStrOrder' := DecStrOrder <+ EqLtNotation <+ CmpNotation.Module Type OrderedType <: DecidableType := DecStrOrder <+ HasEqDec.Module Type OrderedType' := OrderedType <+ EqLtNotation <+ CmpNotation.Module Type OrderedTypeFull := OrderedType <+ HasLe <+ LeIsLtEq.Module Type OrderedTypeFull' :=
 OrderedTypeFull <+ EqLtLeNotation <+ CmpNotation.(** NB: in [OrderedType], an [eq_dec] could be deduced from [compare].
  But adding this redundant field allows seeing an [OrderedType] as a
  [DecidableType]. *)

(** * Versions with [eq] being the usual Leibniz equality of Coq *)

Module Type UsualStrOrder := UsualEqualityType <+ HasLt <+ IsStrOrder.Module Type UsualDecStrOrder := UsualStrOrder <+ HasCompare.Module Type UsualOrderedType <: UsualDecidableType <: OrderedType
 := UsualDecStrOrder <+ HasEqDec.Module Type UsualOrderedTypeFull := UsualOrderedType <+ HasLe <+ LeIsLtEq.(** NB: in [UsualOrderedType], the field [lt_compat] is
    useless since [eq] is [Leibniz], but it should be
    there for subtyping. *)

Module Type UsualStrOrder' := UsualStrOrder <+ LtNotation.Module Type UsualDecStrOrder' := UsualDecStrOrder <+ LtNotation.Module Type UsualOrderedType' := UsualOrderedType <+ LtNotation.Module Type UsualOrderedTypeFull' := UsualOrderedTypeFull <+ LtLeNotation.Module Type TotalOrder := StrOrder <+ HasLe <+ LeIsLtEq <+ LtIsTotal.Module Type UsualTotalOrder <: TotalOrder
 := UsualStrOrder <+ HasLe <+ LeIsLtEq <+ LtIsTotal.Module Type TotalOrder' := TotalOrder <+ EqLtLeNotation.Module Type UsualTotalOrder' := UsualTotalOrder <+ LtLeNotation.Definition eqb x y :=
   match compare x y with Eq => true | _ => false end.

Lemma eqb_eq : forall x y, eqb x y = true <-> x==y.