Module PairOrderedType(O1 O2:OrderedType) <: OrderedType.
Include PairDecidableType O1 O2.
Definition lt :=
(relation_disjunction (O1.lt @@1) (O1.eq * O2.lt))%signature.
Instance lt_strorder : StrictOrder lt.
Instance lt_compat : Proper (eq==>eq==>iff) lt.
Definition compare x y :=
match O1.compare (fst x) (fst y) with
| Eq => O2.compare (snd x) (snd y)
| Lt => Lt
| Gt => Gt
end.

Lemma compare_spec : forall x y, CompSpec eq lt x y (compare x y).