Module Type HasMinMax (E:EqLe) := HasMax E <+ HasMin E.(** ** Any [OrderedTypeFull] can be equipped by [max] and [min]
    based on the compare function. *)

Definition gmax {A} (cmp : A->A->comparison) x y :=
 match cmp x y with Lt => y | _ => x end.Definition gmin {A} (cmp : A->A->comparison) x y :=
 match cmp x y with Gt => y | _ => x end.Definition max := gmax O.compare.Definition min := gmin O.compare.

(* Specifications: *)
Lemma ge_not_lt x y : y<=x -> x<y -> False.
Lemma max_l x y : y<=x -> max x y == x.
Lemma max_r x y : x<=y -> max x y == y.
Lemma min_l x y : x<=y -> min x y == x.
Lemma min_r x y : y<=x -> min x y == y.