(** ** Construction of a new rational by multiplication with an integer or pure fraction *)
(** (or to be more precise multiplication with a rational of the form z/1 or 1/p) *)

(* Specifications: *)
Lemma Qmult_inject_Z_l : forall (a : Z) (b : positive) (z : Z),
(inject_Z z) * (a#b) == z*a#b.
Lemma Qmult_inject_Z_r : forall (a : Z) (b : positive) (z : Z),
(a#b) * inject_Z z == a*z#b.
Lemma Qmult_frac_l : forall (a:Z) (b c:positive), (a # (b * c)) == (1#b) * (a#c).
Lemma Qmult_frac_r : forall (a:Z) (b c:positive), (a # (b * c)) == (a#b) * (1#c).
(** * Properties of order upon Q. *)
Lemma Qle_refl x : x<=x.
Lemma Qle_antisym x y : x<=y -> y<=x -> x==y.
#[global]
Hint Resolve Qle_trans : qarith.
Lemma Qlt_irrefl x : ~x<x.
Lemma Zlt_Qlt (x y: Z): (x < y)%Z = (inject_Z x < inject_Z y).
(** Large = strict or equal *)
Lemma Qle_lteq x y : x<=y <-> x<y \/ x==y.
Lemma Qlt_leneq: forall p q : Q, p < q <-> p <= q /\ ~ (p == q).
Lemma Qlt_le_weak x y : x<y -> x<=y.
Lemma Qlt_gt: forall p q : Q, p < q -> q > p.
Lemma Qge_le: forall p q : Q, p >= q -> q <= p.
Lemma Qle_ge: forall p q : Q, p <= q -> q >= p.
Lemma Qle_lt_trans : forall x y z, x<=y -> y<z -> x<z.
Lemma Qlt_le_trans : forall x y z, x<y -> y<=z -> x<z.
Lemma Qlt_trans : forall x y z, x<y -> y<z -> x<z.
(** [x<y] iff [~(y<=x)] *)
Lemma Qnot_lt_le x y : ~ x < y -> y <= x.
#[global]
Hint Resolve Qle_not_lt Qlt_not_le Qnot_le_lt Qnot_lt_le
Qlt_le_weak Qlt_not_eq Qle_antisym Qle_refl: qarith.