(* Specifications: *)
Lemma Qhomographic_sg_denom_nonzero_nonzero : forall (c d : Z) (p : Qpositive), c = 0%Z -> d = 0%Z -> ~ Qhomographic_sg_denom_nonzero c d p.
Lemma Qhomographic_sg_denom_nonzero_nonzero_2 : forall (c d : Z) (p : Qpositive), Qhomographic_sg_denom_nonzero c d p -> c <> d \/ c <> 0%Z.
Lemma Qhomographic_sg_denom_nonzero_nonzero_3 : forall (c d : Z) (p : Qpositive), Qhomographic_sg_denom_nonzero c d p -> c <> 0%Z \/ d <> 0%Z.
Lemma Qquadratic_sg_denom_nonzero_always : forall (k e f g h : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < e)%Z -> (0 < f)%Z -> (0 < g)%Z -> (0 < h)%Z -> Qquadratic_sg_denom_nonzero (k * e) (k * f) (k * g) (k * h) p1 p2.
Lemma Qquadratic_sg_denom_nonzero_Zero_Zero_always : forall (k g h : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < g)%Z -> (0 < h)%Z -> Qquadratic_sg_denom_nonzero 0 0 (k * g) (k * h) p1 p2.
Lemma Qquadratic_sg_denom_nonzero_Zero_always_Zero_always : forall (k f h : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < f)%Z -> (0 < h)%Z -> Qquadratic_sg_denom_nonzero 0 (k * f) 0 (k * h) p1 p2.
Lemma Qquadratic_sg_denom_nonzero_always_Zero_always_Zero : forall (k e g : Z) (p1 p2 : Qpositive), k <> 0%Z -> (0 < e)%Z -> (0 < g)%Z -> Qquadratic_sg_denom_nonzero (k * e) 0 (k * g) 0 p1 p2.
Lemma Qquadratic_sg_denom_nonzero_Zero_Zero_Zero_always : forall (h : Z) (p1 p2 : Qpositive), h <> 0%Z -> Qquadratic_sg_denom_nonzero 0 0 0 h p1 p2.
Lemma Qquadratic_sg_denom_nonzero_Zero_Zero_always_Zero : forall (g : Z) (p1 p2 : Qpositive), g <> 0%Z -> Qquadratic_sg_denom_nonzero 0 0 g 0 p1 p2.
Lemma Qquadratic_sg_denom_nonzero_nonzero : forall (e f g h : Z) (p1 p2 : Qpositive), e = 0%Z -> f = 0%Z -> g = 0%Z -> h = 0%Z -> ~ Qquadratic_sg_denom_nonzero e f g h p1 p2.
Lemma Qquadratic_sg_denom_nonzero_nonzero_1 : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_sg_denom_nonzero e f g h p1 p2 -> ~ (e = 0%Z /\ f = 0%Z /\ g = 0%Z /\ h = 0%Z).
Lemma Qquadratic_sg_denom_nonzero_nonzero_inf : forall (e f g h : Z) (p1 p2 : Qpositive), Qquadratic_sg_denom_nonzero e f g h p1 p2 -> {e <> 0%Z} + {f <> 0%Z} + {g <> 0%Z} + {h <> 0%Z}.
Lemma Qquadratic_sg_denom_nonzero_nonzero_3 : forall (g h : Z) (p1 p2 : Qpositive), Qquadratic_sg_denom_nonzero 0 0 g h p1 p2 -> g <> 0%Z \/ h <> 0%Z.
Lemma Qopp_lazy_Qopp : forall x : Q, Qopp_lazy x = Qopp x.
Lemma Qinv_lazy_Qinv : forall (x : Q) (Hx : x <> Zero), Qinv_lazy x Hx = Qinv x.
Lemma Qplus_lazy_Qplus : forall x y : Q, Qplus_lazy x y = Qplus x y.
Lemma Qminus_lazy_Qminus : forall x y : Q, Qminus_lazy x y = Qminus x y.
Lemma Qmult_lazy_Qmult : forall x y : Q, Qmult_lazy x y = Qmult x y.
Lemma Qdiv_lazy_Qdiv : forall (x y : Q) (Hy : y <> Zero), Qdiv_lazy x y Hy = Qdiv x y.
Lemma second_Q_Ring_Theory : ring_theory Zero Qone Qplus_lazy Qmult_lazy Qminus_lazy Qopp_lazy (eq(A:=Q)).
Lemma fraction_encoding_equal : forall (m n : Z) (Hn1 Hn2 : n <> 0%Z), fraction_encoding m n Hn1 = fraction_encoding m n Hn2.
Lemma Z_of_nat_Zabs_nat_pos: forall z, (0<=z)%Z -> Z_of_nat (Z.abs_nat z) = z.
Lemma Qmult_absorb_nonzero_r: forall x y : Q, x * y <> Zero -> y <> Zero.
Lemma Qmult_absorb_nonzero_l: forall x y : Q, x * y <> Zero -> x <> Zero.
Lemma Qle_Qminus_Zero: forall x y: Q, x <= y -> Zero <= y-x.
Lemma Qle_Qminus_Zero_neg: forall x y : Q, x <= y -> x-y <= Zero.
Lemma Qle_Zero_Qminus_neg: forall x y : Q, x-y <= Zero -> x <= y.
Lemma Qle_Zero_Qminus: forall x y: Q, Zero <= y-x -> x <= y.
Lemma Qmult_mult_nonneg: forall x:Q, Zero <= x*x.
Lemma Qmult_mult_pos: forall x:Q, x<> Zero -> Zero < x*x.
Lemma Qlt_opp:forall x y, Qopp x < Qopp y -> y < x.
Lemma Qlt_plus:forall x y z : Q, x < y -> z + x < z + y.
Lemma Qlt_Qminus_Zero: forall x y : Q, x < y -> Zero < y - x.
Lemma Qlt_Qminus_Zero_neg: forall x y : Q, x < y -> x-y < Zero.
Lemma Qlt_Zero_Qminus_neg: forall x y : Q, x-y < Zero -> x < y.
Lemma Qlt_reg_mult_pos_l: forall x y z : Q, Zero < x -> y < z -> x * y < x * z.
Lemma Qlt_reg_mult_pos_r: forall x y z : Q, Zero < x -> y < z -> y * x < z * x.
Lemma Qlt_reg_mult_neg_l: forall x y z : Q, x < Zero -> y < z -> x * z < x * y.
Lemma Qlt_reg_mult_neg_r: forall x y z : Q, x < Zero -> y < z -> z * x < y * x.
Lemma Qdiv_Qmult_pos:forall x y z t: Q, Zero < z*t -> x/z < y/t -> x*t < y*z.
Lemma Qinv_involutive:forall x:Q, x<>Zero -> Qinv (Qinv x) = x.
Lemma Qmult_Qdiv_pos:forall x y z t: Q, Zero < z*t -> x*t < y*z -> x/z < y/t.
Lemma Qlt_Qopp_pos: forall x: Q, x < Zero -> Zero < - x.
Lemma Qlt_Qopp_neg: forall x: Q, Zero < x -> -x < Zero.
Lemma Qmult_one_left:forall x : Q, Qone * x = x.
Lemma Qdiv_Qone_Qone: Qdiv Qone Qone = Qone.
Lemma Qinv_Qdiv_Qone:forall x, Qinv x = Qone/x.
Lemma Qminus_Qdiv:forall x y z t, z<>Zero -> t<>Zero -> x/z - y/t = (x*t-y*z)/(z*t).
Lemma Qplus_Qdiv:forall x y z t, z<>Zero -> t<>Zero -> x/z + y/t = (x*t+y*z)/(z*t).
Lemma Qpositive_in_Q_Archimedean_inf:forall qp:Qpositive, {z:Z | (Qpos qp)<=z /\ (z-(Qpos qp))<= Qone}.
Theorem Q_Archimedean_inf:forall q:Q, {z:Z | q<=z /\ (z-q)<= Qone}.
Lemma Q_Ring_Theory : ring_theory Zero Qone Qplus Qmult Qminus Qopp (eq(A:=Q)).
Lemma Qinv_defT : forall n : Q, n <> Zero -> Qmult (Qinv n) n = Qone.
Lemma QField : field_theory Zero Qone Qplus Qmult Qminus Qopp Qdiv Qinv (eq(A:=Q)).
Lemma fraction_encoding_reduces : forall (a b m n : Z) (Hb : b <> 0%Z) (Hn : n <> 0%Z), (a * n)%Z = (m * b)%Z -> fraction_encoding a b Hb = fraction_encoding m n Hn.
Lemma Qquadratic_Qpositive_to_Q_0 : forall (a b c d e f g h : Z) (p1 p2 : Qpositive) (H_Qquadratic_sg_denom_nonzero : Qquadratic_sg_denom_nonzero e f g h p1 p2) (Hh : h <> 0%Z), same_ratio a b c d e f g h -> Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 H_Qquadratic_sg_denom_nonzero = fraction_encoding d h Hh.
Lemma Qquadratic_Qpositive_to_Q_1 : forall (a b c d e f g h : Z) (p1 p2 : Qpositive) (H_Qquadratic_sg_denom_nonzero : Qquadratic_sg_denom_nonzero e f g h p1 p2) (Hg : g <> 0%Z), same_ratio a b c d e f g h -> Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 H_Qquadratic_sg_denom_nonzero = fraction_encoding c g Hg.
Lemma Qquadratic_Qpositive_to_Q_2 : forall (a b c d e f g h : Z) (p1 p2 : Qpositive) (H_Qquadratic_sg_denom_nonzero : Qquadratic_sg_denom_nonzero e f g h p1 p2) (Hf : f <> 0%Z), same_ratio a b c d e f g h -> Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 H_Qquadratic_sg_denom_nonzero = fraction_encoding b f Hf.
Lemma Qquadratic_Qpositive_to_Q_3 : forall (a b c d e f g h : Z) (p1 p2 : Qpositive) (H_Qquadratic_sg_denom_nonzero : Qquadratic_sg_denom_nonzero e f g h p1 p2) (He : e <> 0%Z), same_ratio a b c d e f g h -> Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 H_Qquadratic_sg_denom_nonzero = fraction_encoding a e He.
Theorem minus_minus : forall a b c : nat, a - b - c = a - (b + c).
Lemma Rlt_stepl:forall x y z, Rlt x y -> x=z -> Rlt z y.
Lemma Rlt_stepr:forall x y z, Rlt x y -> y=z -> Rlt x z.
Lemma Rle_stepl:forall x y z, Rle x y -> x=z -> Rle z y.
Lemma Rle_stepr:forall x y z, Rle x y -> y=z -> Rle x z.
Lemma Rneq_stepl:forall x y z:R, x<>y -> x=z -> z<>y.
Lemma Rneq_stepr:forall x y z:R, x<>y -> y=z -> x<>z.
Lemma Rlt_zero_Rminus : forall r1 r2:R , 0 < r1-r2 -> r2 < r1.
Lemma Rle_zero_Rminus : forall r1 r2:R , 0 <= r1-r2 -> r2 <= r1.
Lemma Rle_Rminus_zero : forall r1 r2:R , r2 <= r1 -> 0 <= r1-r2.
Lemma Rlt_Rminus_zero : forall r1 r2:R , r2 < r1 -> 0 < r1-r2.
Lemma Rlt_not_eq': forall r1 r2 : R, r1 < r2 -> r2 <> r1.
Lemma Rmult_reg_nonzero_r: forall r1 r2 : R, r1 * r2 <> 0 -> r2 <> 0.
Lemma Rmult_reg_nonzero_l: forall r1 r2 : R, r1 * r2 <> 0 -> r1 <> 0.
Lemma Rlt_Ropp_pos: forall r : R, r < 0 -> 0 < - r.
Lemma Rlt_mult_neg_neg: forall r1 r2 : R, r1<0 -> r2<0 -> 0 < r1 * r2.
Lemma sg_tuple_equal : forall (l1 a1 b1 c1 d1 : Z) (p1 : Qpositive) (l2 a2 b2 c2 d2 : Z) (p2 : Qpositive), (l1, (a1, (b1, (c1, d1)), p1)) = (l2, (a2, (b2, (c2, d2)), p2)) -> l1 = l2 /\ (a1 = a2 /\ b1 = b2 /\ c1 = c2 /\ d1 = d2) /\ p1 = p2.
Lemma inside_interval_1_inf : forall o1 o2 : Z, inside_interval_1 o1 o2 -> {(0 < o1)%Z /\ (0 < o2)%Z} + {(o1 < 0)%Z /\ (o2 < 0)%Z}.
Lemma inside_interval_2_inf : forall o1 o2 : Z, inside_interval_2 o1 o2 -> {(0 < o1)%Z /\ (o2 < 0)%Z} + {(o1 < 0)%Z /\ (0 < o2)%Z}.
Lemma sg_pos_1 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (na nb nc nd : Z) (np : Qpositive), Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (1%Z, (na, (nb, (nc, nd)), np)) -> {(0 < na + nb)%Z /\ (0 < nc + nd)%Z} + {(na + nb < 0)%Z /\ (nc + nd < 0)%Z}.
Lemma sg_pos_2 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (na nb nc nd : Z) (np : Qpositive), Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (1%Z, (na, (nb, (nc, nd)), np)) -> {(0 <= na)%Z /\ (0 <= nb)%Z /\ (0 <= nc)%Z /\ (0 <= nd)%Z} + {(na <= 0)%Z /\ (nb <= 0)%Z /\ (nc <= 0)%Z /\ (nd <= 0)%Z} + {np = One}.
Lemma sg_neg_1 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (na nb nc nd : Z) (np : Qpositive), Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((-1)%Z, (na, (nb, (nc, nd)), np)) -> {(0 < na + nb)%Z /\ (nc + nd < 0)%Z} + {(na + nb < 0)%Z /\ (0 < nc + nd)%Z}.
Lemma sg_neg_2 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (na nb nc nd : Z) (np : Qpositive), Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((-1)%Z, (na, (nb, (nc, nd)), np)) -> {(0 <= na)%Z /\ (0 <= nb)%Z /\ (nc <= 0)%Z /\ (nd <= 0)%Z} + {(na <= 0)%Z /\ (nb <= 0)%Z /\ (0 <= nc)%Z /\ (0 <= nd)%Z} + {np = One}.
Theorem Qmult_sym : forall n m : Q, Qmult n m = Qmult m n.
Theorem Qmult_assoc : forall n m p : Q, Qmult n (Qmult m p) = Qmult (Qmult n m) p.
Theorem Qplus_zero_left : forall n : Q, Qplus Zero n = n.
Theorem Qmult_one_left : forall n : Q, Qmult (Qpos One) n = n.
Theorem Q_opp_def : forall n : Q, Qplus n (Qopp n) = Zero.