(** Another approach : using Qcompare for defining order relations. *)

Definition Qcompare (p q : Q) := (Qnum p * QDen q ?= Qnum q * QDen p)%Z.Notation "p ?= q" := (Qcompare p q) : Q_scope.

(* Specifications: *)
Lemma Qeq_alt p q : (p == q) <-> (p ?= q) = Eq.
Lemma Qlt_alt p q : (p<q) <-> (p?=q = Lt).
Lemma Qgt_alt p q : (p>q) <-> (p?=q = Gt).
Lemma Qle_alt p q : (p<=q) <-> (p?=q <> Gt).
Lemma Qge_alt p q : (p>=q) <-> (p?=q <> Lt).