Qed.

(* Specifications: *)
Theorem add_sub_le1 :
forall a b c : Qpositive,
a <> b ->
Qpositive_le b a ->
Qpositive_le (Qpositive_sub a b) c -> Qpositive_le a (Qpositive_plus b c).
Lemma Zero_not_lt_Qneg : forall x, ~ Qlt Zero (Qneg x).
Lemma Qpos_not_lt_Qneg : forall x y, ~ Qlt (Qpos y) (Qneg x).
Lemma Qlt_dec_Qneg : forall x y, {~ Qlt (Qneg y) (Qneg x)} + {Qlt (Qneg y) (Qneg x)}.
Lemma Q_le_lt_dec:forall (x y:Q), {Qle x y}+{Qlt y x}.
Lemma Qle_dec:forall (x y:Q), {Qle x y}+{~(Qle x y)}.
Lemma Qlt_dec:forall (x y:Q), {Qlt x y}+{~(Qlt x y)}.
Lemma Qtrichotomy_inf:forall x y,{Qlt x y}+{x=y}+{Qlt y x}.
Lemma Qle_dec_weak:forall (x y:Q), {Qle x y}+{(Qle y x)}.
Lemma not_Qeq_inf : forall x y : Q, x <> y -> {Qlt x y} + {Qlt y x}.
Lemma Qlt_stepl:forall x y z, Qlt x y -> x=z -> Qlt z y.
Lemma Qlt_stepr:forall x y z, Qlt x y -> y=z -> Qlt x z.
Lemma Qle_stepl:forall x y z, Qle x y -> x=z -> Qle z y.
Lemma Qle_stepr:forall x y z, Qle x y -> y=z -> Qle x z.
Lemma Qneq_stepl:forall (x y z:Q), x<>y -> x=z -> z<>y.
Lemma Qneq_stepr:forall (x y z:Q), x<>y -> y=z -> x<>z.
Declare Left Step Qlt_stepl.
Theorem Qpositive_le_total :
forall w w' : Qpositive, Qpositive_le w w' \/ Qpositive_le w' w.
Lemma Qabs_8: forall q p, - p <= q -> q <= p -> Qabs q <= p.
Lemma Qabs_nonneg: forall q, Zero <= Qabs q.
Lemma Qle_Qabs: forall q, q <= Qabs q.
Lemma Qle_Qabs_Qopp: forall q, -q <= Qabs q.
Lemma Qabs_Qle_Qopp: forall q, - (Qabs q) <= q.
Lemma Qabs_triangle: forall p q, Qabs (p + q) <= Qabs p + Qabs q.
Lemma Qabs_Qopp:forall q, Qabs q = Qabs (-q).
Lemma Qabs_Qminus_sym:forall q1 q2, Qabs (q1-q2) = Qabs (q2-q1).
Lemma Qabs_nonzero_pos:forall q, q<> Zero -> Zero < Qabs q.
Lemma Qabs_Qminus_Zero_eq:forall q1 q2, Qabs (q1-q2) = Zero -> q1=q2.
Lemma Qabs_Zero_Qminus_eq:forall q1 q2, q1=q2 -> Qabs (q1-q2) = Zero.
Lemma Qabs_Qminus_bound:forall low up q1 q2, low <= q1 -> q1 <= up -> low <= q2 -> q2 <= up -> Qabs (q1-q2) <= up-low.
Lemma upper_bound_affine_base_interval_twice:forall a b c d x, -Qone<=x -> x<=Qone ->
(a*x+b)*(c*x+d) <= Qabs (a*c) + Qabs (a*d+c*b)+b*d.
Lemma lower_bound_affine_base_interval_twice:forall a b c d x, -Qone<=x -> x<=Qone ->
-Qabs (a*c) + -Qabs (a*d+c*b)+b*d <= (a*x+b)*(c*x+d).
Theorem comparison3 : 4 * q < 3 * p.
solve_comparison.
Lemma Rdiv_Rmult_numerator: forall (x y z:R), y<>R0 -> (z*(x/y)=(z*x)/y)%R.
Lemma Rdiv_Rmult_numerator_r: forall (x y z:R), y<>R0 -> ((x/y)*z=(x*z)/y)%R.
Lemma Rdiv_Rplus_Rmult: forall (x y z:R), y<>R0 -> (x/y + z = (x+y*z)/y)%R.
Lemma Rdiv_Rminus_Rmult: forall x y z, y<>R0 -> (x/y - z = (x-y*z)/y)%R.
Lemma Rminus_Rdiv_Rmult: forall x y z, ~(y=R0)->(z-x/y=(y*z-x)/y)%R.
Lemma Rplus_Rdiv_Rmult: forall x y z, ~(y=R0)->(z+x/y=(y*z+x)/y)%R.
Lemma Rminus_Rdiv:forall x y z t, z<>R0 -> t<>R0 -> (x/z - y/t = (x*t-y*z)/(z*t))%R.
Lemma Rle_pos_nonneg_Rmult: forall r1 r2 : R, 0 < r1 ->  0 <= r2 * r1 -> 0<= r2.
Lemma Rle_pos_nonneg_Rdiv: forall r1 r2 : R, 0 < r1 ->  0 <= r2 / r1 -> 0<= r2.
Lemma Rle_mult_nonpos_nonpos: forall r1 r2 : R, r1<=0 -> r2<=0 -> 0 <= r1 * r2.
Lemma Rlt_pos_pos_Rmult: forall r1 r2 : R, 0 < r1 ->  0 < r2 * r1 -> 0< r2.
Lemma Rlt_pos_pos_Rdiv: forall r1 r2 : R, 0 < r1 ->  0 < r2 / r1 -> 0< r2.
Lemma Rdiv_Rdiv_simplify: forall x y z : R, z <> R0 -> y <> R0 -> x / z / (y / z) = x / y.
Definition Rmult_reg_l := RIneq.Rmult_eq_reg_l.
Lemma Rmult_reg_r : forall r r1 r2 : R, r1 * r = r2 * r -> r <> 0 -> r1 = r2.
Lemma Rmult_Rdiv: forall x y z t : R, z <> R0 -> t <> R0 -> x * t = y * z -> x / z = y / t.
Lemma Rmult_Rdiv_pos_Rle: forall x y z t, (R0 < z)%R -> (R0 < t)%R -> (x * t <= y * z)%R -> (x / z <= y / t)%R.
Lemma Rmult_Rdiv_neg_Rle: forall x y z t, (z < R0)%R -> (t < R0)%R -> (x * t <= y * z)%R -> (x / z <= y / t)%R.
Lemma Rdiv_Rmult_simplify: forall x y z : R, z <> 0%R -> y <> 0%R -> (x * z / (y * z))%R = (x / y)%R.
Lemma Rdiv_Rmult_numerator_denominator: forall x y z t: R, t <> 0%R -> y <> 0%R -> ((x/y)*(z/t))%R=((x*z)/(y*t))%R.
Lemma Rdiv_Rdiv_Rmult_numerator: forall x y z : R, y <> 0 -> z <> 0 -> (x / y / z) = (x / (y * z)).
Lemma Rdiv_Rdiv_Rmult_denominator: forall x y z : R, y <> 0 -> z <> 0 -> (x / (y / z)) = (x*z / y ).
Lemma Rmult_Rdiv_pos_Rlt: forall x y z t, (R0 < z)%R -> (R0 < t)%R -> (x * t < y * z)%R -> (x / z < y / t)%R.
Lemma Rmult_Rdiv_neg_Rlt: forall x y z t, (z < R0)%R -> (t < R0)%R -> (x * t < y * z)%R -> (x / z < y / t)%R.
Lemma Rlinear_non_zero_1:forall a b x y, (y<>0)%R -> (a*x+b*y<>0)%R -> (a*(x/y)+b<>0)%R.
Lemma Rlinear_non_zero_2:forall a b x y, (y<>0)%R -> (a*(x/y)+b<>0)%R -> (a*x+b*y<>0)%R.
Lemma Rlinear_non_zero_3: forall a b x : R, a <> 0 -> x <> -b/a -> a * x + b <> 0.
Lemma Rbilinear_non_zero_2:forall a b c d x y x' y', y<>0 -> y'<>0 ->
(a*(x/y)*(x'/y')+b*(x/y)+c*(x'/y')+d<>0)%R -> (a*x*x'+b*x*y'+c*y*x'+d*y*y'<>0)%R.
Lemma Rle_dec_weak:forall (x y:R), {Rle x y}+{(Rle y x)}.
Lemma not_O_S_INR: forall n : nat, INR (S n) <> 0%R.
Lemma pos_S_INR: forall n : nat, (0 < INR (S n))%R.
Hint Resolve not_O_S_INR pos_S_INR pos_INR.
Lemma Req_Rdiv_Rone:forall x y, y<>0 -> x=y -> x/y =1.
Lemma Req_Ropp_Rdiv_minus_Rone:forall x y, y<>0 -> x=-y -> x/y =-1.
Lemma Rmax_involutive: forall q, Rmax q q = q.
Lemma Rabs_Rle: forall q p : R, (- p <= q)%R -> (q <= p)%R -> (Rabs q <= p)%R.
Lemma Rabs_Rle_1: forall q, (- 1 <= q)%R -> (q <= 1)%R -> (Rabs q <= 1)%R.
Lemma pow_Rle_r : forall (x y : R) (n : nat),  - x <= y -> y <= x -> pow y n <= pow x n.
Lemma pow_Rle_r_1 : forall (y: R) (n : nat),  - 1 <= y -> y <= 1 -> pow y n <= 1.
Lemma pow_even_nonneg:forall (y: R) (n : nat), 0 <= pow y (2*n)%nat.
Lemma pow_Rle_l_1 : forall (y: R) (n : nat),  - 1 <= y -> y <= 1 -> -1 <= pow y n.
Lemma conjL_range_l:forall r, -1 <= r -> -1<= (r-1)/(r+3).
Lemma conjL_range_r:forall r, -1<=r -> r <= 1 -> (r-1)/(r+3) <= 0.
Lemma conjL_range_weak:forall r, -1 <= r <= 1-> -1<= (r-1)/(r+3)<=1.
Lemma conjR_range_l:forall r, -1 <= r -> r <= 1 -> 0<= (r+1)/(-r+3).
Lemma conjR_range_r:forall r, r <= 1 -> (r+1)/(-r+3)<=1.
Lemma conjR_range_weak:forall r, -1 <= r <= 1-> -1<= (r+1)/(-r+3)<=1.
Lemma conjM_range_l:forall r, -1 <= r -> -1/3<= r/3.
Lemma conjM_range_r:forall r, r <= 1 -> r/3<=1/3.
Lemma conjM_range_weak:forall r, -1 <= r <= 1-> -1<= r/3 <=1.
Lemma conjLinv_range_r:forall r, r <= 0 -> (3*r+1)/(-r+1)<=1.
Lemma conjLinv_range_l:forall r, -1<=r -> r <= 0 -> -1<=(3*r+1)/(-r+1).
Lemma conjRinv_range_r:forall r, 0<=r-> r <= 1 -> (3*r-1)/(r+1)<=1.
Lemma conjRinv_range_l:forall r, 0<=r -> -1<=(3*r-1)/(r+1).
Lemma conjMinv_range_r:forall r, r <= 1/3 -> 3*r<=1.
Lemma conjMinv_range_l:forall r, -1/3<=r -> -1<=3*r.
Lemma CV_const:  forall const, Un_cv (fun i : nat => const) const.
Lemma CV_shift_S' : forall Un l,  Un_cv (fun n => Un (S n)) l -> Un_cv Un l.
Lemma CV_shift_S : forall Un l,  Un_cv Un l -> Un_cv (fun n => Un (S n)) l.
Lemma CV_extensionality : forall Un Un', (forall n, Un n = Un' n) ->  forall l, Un_cv Un l -> Un_cv Un' l.
Ltac ring_exact_R hyp :=
match type of hyp with
| Rlt ?X1 ?X2 => (stepr X2; trivial; ring) || (stepl X1; trivial; ring)
| Rle ?X1 ?X2 => (stepr X2; trivial; ring) || (stepl X1; trivial; ring)
| ~(@eq R ?X1 ?X2) => (stepr X2; trivial; ring) || (stepl X1; trivial; ring)
| ?X3 => fail 1
end.
Theorem Qmult_assoc :
forall n m p : Q, Qmult n (Qmult m p) = Qmult (Qmult n m) p.
Theorem Qmult_one_left : forall n : Q, Qmult (Qpos One) n = n.
intros n; case n; simpl in |- *; auto; intros; rewrite Qpositive_mult_One;
auto.
Theorem Q_opp_def : forall n : Q, Qplus n (Qopp n) = Zero.
intros n; case n; simpl in |- *; auto.
Theorem Qmult_neg :
forall (x : Q) (y' : Qpositive),
Qopp (Qmult x (Qneg y')) = Qmult x (Qpos y').