Module OTF_to_TotalOrder (O:OrderedTypeFull) <: TotalOrder
 := O <+ OTF_LtIsTotal.Module Type LeBool := Typ <+ HasLeb.Module Type LtBool := Typ <+ HasLtb.Module Type LeBool' := LeBool <+ LebNotation.Module Type LtBool' := LtBool <+ LtbNotation.Module Type TotalLeBool := LeBool <+ LebIsTotal.Module Type TotalLeBool' := LeBool' <+ LebIsTotal.Module Type TotalTransitiveLeBool := TotalLeBool <+ LebIsTransitive.Module Type TotalTransitiveLeBool' := TotalLeBool' <+ LebIsTransitive.(** Grouping all boolean comparison functions *)

Module Type HasBoolOrdFuns (T:Typ) := HasEqb T <+ HasLtb T <+ HasLeb T.Module Type HasBoolOrdFuns' (T:Typ) :=
 HasBoolOrdFuns T <+ EqbNotation T <+ LtbNotation T <+ LebNotation T.Module Type BoolOrdSpecs (O:EqLtLe)(F:HasBoolOrdFuns O) :=
 EqbSpec O O F <+ LtbSpec O O F <+ LebSpec O O F.Module Type OrderFunctions (E:EqLtLe) :=
  HasCompare E <+ HasBoolOrdFuns E <+ BoolOrdSpecs E.Module Type OrderFunctions' (E:EqLtLe) :=
  HasCompare E <+ CmpNotation E <+ HasBoolOrdFuns' E <+ BoolOrdSpecs E.Definition leb x y :=
  match compare x y with Gt => false | _ => true end.

Lemma leb_le : forall x y, leb x y <-> x <= y.