(** * Setoid compatibility results *)
#[global]
Instance Qopp_comp : Proper (Qeq==>Qeq) Qopp.
#[global]
Instance Qminus_comp : Proper (Qeq==>Qeq==>Qeq) Qminus.
#[global]
Instance Qmult_comp : Proper (Qeq==>Qeq==>Qeq) Qmult.
#[global]
Instance Qinv_comp : Proper (Qeq==>Qeq) Qinv.
#[global]
Instance Qdiv_comp : Proper (Qeq==>Qeq==>Qeq) Qdiv.
#[global]
Instance Qcompare_comp : Proper (Qeq==>Qeq==>eq) Qcompare.
#[global]
Instance Qle_comp : Proper (Qeq==>Qeq==>iff) Qle.
#[global]
Instance Qlt_compat : Proper (Qeq==>Qeq==>iff) Qlt.
#[global]
Instance Qeqb_comp : Proper (Qeq==>Qeq==>eq) Qeq_bool.
#[global]
Instance Qleb_comp : Proper (Qeq==>Qeq==>eq) Qle_bool.
(** [0] and [1] are apart *)

(* Specifications: *)
Lemma Q_apart_0_1 : ~ 1 == 0.
(** * Properties of [Qadd] *)
(** Addition is associative: *)
Theorem Qplus_assoc : forall x y z, x+(y+z)==(x+y)+z.
(** [0] is a neutral element for addition: *)
Lemma Qplus_0_l : forall x, 0+x == x.
Lemma Qplus_0_r : forall x, x+0 == x.
(** Commutativity of addition: *)
Theorem Qplus_comm : forall x y, x+y == y+x.
(** * Properties of [Qopp] *)
Lemma Qopp_involutive : forall q, - -q == q.
Theorem Qplus_opp_r : forall q, q+(-q) == 0.
(** Injectivity of addition (uses theory about Qopp above): *)
Lemma Qplus_inj_r (x y z: Q):
x + z == y + z <-> x == y.
Lemma Qplus_inj_l (x y z: Q):
z + x == z + y <-> x == y.