Hint Resolve Qlt_plus_pos_pos.

(* Specifications: *)
(** This lemma also holds for q2=Zero, due to our definition of (Qinv Zero):=Zero, Perhaps it is not right to state it like this but anyways it is true *)
Lemma Qdiv_num_denom :
forall q1 q2 p : Q,
p <> Zero -> Qmult q1 (Qinv q2) = Qmult (Qmult q1 p) (Qinv (Qmult q2 p)).
Lemma Qinv_1 : forall q : Q, Qlt Zero (Qinv q) -> Qlt Zero q.
Lemma Qinv_2 : forall q : Q, Qlt (Qinv q) Zero -> Qlt q Zero.
Lemma Qinv_pos : forall q : Q, Qlt Zero q -> Qlt Zero (Qinv q).
Lemma Qmult_one_right : forall x : Q, Qmult x Qone = x.
Lemma Qpos_POS_1 :
forall (m : Z) (qp : Qpositive), Z_to_Q m = Qpos qp -> (0 < m)%Z.
Lemma Qneg_NEG_1 :
forall (m : Z) (qp : Qpositive), Z_to_Q m = Qneg qp -> (m < 0)%Z.
Lemma Qopp_Qpos : forall q : Qpositive, Qneg q = Qopp (Qpos q).
Lemma Qopp_Qneg : forall q : Qpositive, Qpos q = Qopp (Qneg q).
Lemma Qopp_linear :
forall (a b : Z) (q : Qpositive),
Qplus (Qmult (Z_to_Q (- a)) (Qpos q)) (Z_to_Q (- b)) =
Qopp (Qplus (Qmult (Z_to_Q a) (Qpos q)) (Z_to_Q b)).
Lemma Qopp_resp_nonzero : forall x : Q, x <> Zero -> Qopp x <> Zero.
(** This also holds for q=Zero so we don't exclude that case *)
Lemma Qinv_Qopp : forall q : Q, Qinv (Qopp q) = Qopp (Qinv q).
Lemma Qmult_Qopp_left : forall x y : Q, Qmult (Qopp x) y = Qopp (Qmult x y).
Lemma Qpositive_dec_One : forall p : Qpositive, {p = One} + {p <> One}.
Lemma Qinv_resp_nonzero : forall x : Q, x <> Zero -> Qinv x <> Zero.
Lemma Qlt_zero_one : Qlt Zero Qone.
Hint Resolve Qlt_zero_one.
Lemma Z_to_Qpositive_Q_tail_pos :
forall (a : Z) (Ha : (0 < a)%Z), Z_to_Qpositive a Ha = Q_tail a.
Lemma Q_tail_Qinv : forall x : Q, Q_tail (Qinv x) = Qpositive_inv (Q_tail x).
Lemma Q_tail_Qmult :
forall x y : Q,
x <> Zero ->
y <> Zero -> Q_tail (Qmult x y) = Qpositive_mult (Q_tail x) (Q_tail y).
Lemma Q_tail_Qplus_pos :
forall x y : Q,
Qlt Zero x ->
Qlt Zero y -> Q_tail (Qplus x y) = Qpositive_plus (Q_tail x) (Q_tail y).
Lemma Q_tail_Qplus_neg :
forall x y : Q,
Qlt x Zero ->
Qlt y Zero -> Q_tail (Qplus x y) = Qpositive_plus (Q_tail x) (Q_tail y).
Lemma Qplus_zero_right : forall n : Q, Qplus n Zero = n.
Lemma Qmult_zero_right : forall x : Q, Qmult x Zero = Zero.
Lemma Qle_Qpositive_le_pos :
forall x y : Qpositive, Qle (Qpos x) (Qpos y) -> Qpositive_le x y.
Lemma Qle_Qpositive_le_neg :
forall x y : Qpositive, Qle (Qneg x) (Qneg y) -> Qpositive_le y x.
Lemma Qle_lt_eq_dec : forall x y : Q, Qle x y -> {Qlt x y} + {x = y}.
Lemma Qle_lt_trans : forall x y z : Q, Qle x y -> Qlt y z -> Qlt x z.
Lemma Qlt_le_trans : forall x y z : Q, Qlt x y -> Qle y z -> Qlt x z.
Lemma Qle_trans : forall x y z : Q, Qle x y -> Qle y z -> Qle x z.
Lemma Qlt_plus_plus :
forall a b c d : Q, Qlt a b -> Qlt c d -> Qlt (Qplus a c) (Qplus b d).
Lemma Qle_lt_reg :
forall a b c d : Q, Qle a b -> Qlt c d -> Qlt (Qplus a c) (Qplus b d).
Lemma Qlt_le_reg :
forall a b c d : Q, Qlt a b -> Qle c d -> Qlt (Qplus a c) (Qplus b d).
Lemma Qlt_le_reg_pos :
forall b d : Q, Qlt Zero b -> Qle Zero d -> Qlt Zero (Qplus b d).
Lemma Qle_lt_reg_pos :
forall b d : Q, Qle Zero b -> Qlt Zero d -> Qlt Zero (Qplus b d).
Lemma Qlt_le_reg_neg :
forall b d : Q, Qlt b Zero -> Qle d Zero -> Qlt (Qplus b d) Zero.
Lemma Qle_lt_reg_neg :
forall b d : Q, Qle b Zero -> Qlt d Zero -> Qlt (Qplus b d) Zero.
Lemma Qle_plus_plus :
forall a b c d : Q, Qle a b -> Qle c d -> Qle (Qplus a c) (Qplus b d).
Lemma Qle_plus_pos_pos :
forall x y : Q, Qle Zero x -> Qle Zero y -> Qle Zero (Qplus x y).
Lemma Qle_plus_neg_neg :
forall x y : Q, Qle x Zero -> Qle y Zero -> Qle (Qplus x y) Zero.
Lemma Qle_mult_nonneg_nonneg :
forall x y : Q, Qle Zero x -> Qle Zero y -> Qle Zero (Qmult x y).
Lemma Qle_mult_nonpos_nonneg :
forall x y : Q, Qle x Zero -> Qle Zero y -> Qle (Qmult x y) Zero.
Lemma Qle_mult_nonneg_nonpos :
forall x y : Q, Qle Zero x -> Qle y Zero -> Qle (Qmult x y) Zero.
Lemma Qle_mult_nonpos_pos:
forall x y : Q, Qle x Zero -> Qlt Zero y -> Qle (Qmult x y) Zero.
Lemma Qle_mult_neg_nonneg :
forall x y : Q, Qlt x Zero -> Qle Zero y -> Qle (Qmult x y) Zero.
Lemma Qle_reflexive:forall x, Qle x x.
Hint Resolve Qplus_zero_right Qlt_le_reg_pos Qle_lt_reg_pos Qlt_le_reg
Qle_lt_reg Qlt_le_weak Qlt_le_reg_neg Qle_lt_reg_neg Qle_plus_pos_pos
Qle_plus_neg_neg Qle_mult_nonneg_nonneg Qle_mult_nonneg_nonpos
Qle_mult_nonpos_nonneg Qle_mult_nonpos_pos Qle_mult_neg_nonneg
Qle_reflexive.
Lemma Qpos_not_lt_Zero : forall x, ~ Qlt (Qpos x) Zero.
Lemma Qlt_dec_Qpos : forall x y, {~ Qlt (Qpos y) (Qpos x)} + {Qlt (Qpos y) (Qpos x)}.
intros x y; case Qpositive_le_dec with x y; intro H'; [left;intro H; inversion H; contradiction | right;unfold Qlt; constructor; trivial].