Module OrderedPair (X:OrderedType) (Y:OrderedType) <: OrderedType with
Definition t := (X.t * Y.t)%type.
Definition t := (X.t * Y.t)%type.
Definition eq (xy1:t) (xy2:t) :=
let (x1,y1) := xy1 in
let (x2,y2) := xy2 in
(X.eq x1 x2) /\ (Y.eq y1 y2).
Definition lt (xy1:t) (xy2:t) :=
let (x1,y1) := xy1 in
let (x2,y2) := xy2 in
(X.lt x1 x2) \/ ((X.eq x1 x2) /\ (Y.lt y1 y2)).
destruct x.
unfold eq.
split;[apply X.eq_refl | apply Y.eq_refl].
Qed.
destruct x;destruct y;unfold eq;intro.
elim H;clear H;intros.
split;[apply X.eq_sym | apply Y.eq_sym];trivial.
Qed.
unfold eq;destruct x;destruct y;destruct z;intros.
elim H;clear H;intros.
elim H0;clear H0;intros.
split;[eapply X.eq_trans | eapply Y.eq_trans];eauto.
Qed.

Lemma lt_trans : forall (x y z:t),(lt x y)->(lt y z)->(lt x z).