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.

Lemma max_l x y : y<=x -> max x y == x.