Notation " 1 " := (Q2Qc 1) : Qc_scope.
Definition Qcle (x y : Qc) := (x <= y)%Q.
Definition Qclt (x y : Qc) := (x < y)%Q.
Notation Qcgt := (fun x y : Qc => Qlt y x).
Notation Qcge := (fun x y : Qc => Qle y x).
Infix "<" := Qclt : Qc_scope.
Infix "<=" := Qcle : Qc_scope.
Infix ">" := Qcgt : Qc_scope.
Infix ">=" := Qcge : Qc_scope.
Notation "x <= y <= z" := (x<=y/\y<=z) : Qc_scope.
Notation "x < y < z" := (x<y/\y<z) : Qc_scope.
Definition Qccompare (p q : Qc) := (Qcompare p q).
Notation "p ?= q" := (Qccompare p q) : Qc_scope.

(* Specifications: *)
Lemma Qceq_alt : forall p q, (p = q) <-> (p ?= q) = Eq.
Lemma Qclt_alt : forall p q, (p<q) <-> (p?=q = Lt).
Lemma Qcgt_alt : forall p q, (p>q) <-> (p?=q = Gt).
Lemma Qcle_alt : forall p q, (p<=q) <-> (p?=q <> Gt).
Lemma Qcge_alt : forall p q, (p>=q) <-> (p?=q <> Lt).
(** equality on [Qc] is decidable: *)
Theorem Qc_eq_dec : forall x y:Qc, {x=y} + {x<>y}.
Ltac qc := match goal with
| q:Qc |- _ => destruct q; qc
| _ => apply Qc_is_canon; simpl; rewrite !Qred_correct
end.