Lemma
spec_Qquadratic_Qpositive_to_Q_spec_Qquadratic_Qpositive_to_Qpositive2_pos :
forall (a b c d e f g h : Z) (p1 p2 : Qpositive),
Qsgn (spec_Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2) = 1%Z ->
spec_Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 =
Qpos (spec_Qquadratic_Qpositive_to_Qpositive2 a b c d e f g h p1 p2).
(** We use this when (Z.sgn a+b+c+d)<0 *)
Lemma
spec_Qquadratic_Qpositive_to_Q_spec_Qquadratic_Qpositive_to_Qpositive2_neg_1
:
forall (a b c d e f g h : Z) (p1 p2 : Qpositive),
Qsgn (spec_Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2) = (-1)%Z ->
spec_Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 =
Qneg
(spec_Qquadratic_Qpositive_to_Qpositive2 (- a) (- b)
(- c) (- d) e f g h p1 p2).
(** We use this when 0<=(Z.sgn a+b+c+d) *)
Lemma
spec_Qquadratic_Qpositive_to_Q_spec_Qquadratic_Qpositive_to_Qpositive2_neg_2
:
forall (a b c d e f g h : Z) (p1 p2 : Qpositive),
Qsgn (spec_Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2) = (-1)%Z ->
spec_Qquadratic_Qpositive_to_Q a b c d e f g h p1 p2 =
Qneg
(spec_Qquadratic_Qpositive_to_Qpositive2 a b c d
(- e) (- f) (- g) (- h) p1 p2).

Lemma quadratic :
forall (a b c d e f g h : Z) (s1 s2 : Q)
(H_Qquadratic_denom_nonzero : Qquadratic_denom_nonzero e f g h s1 s2),
Qquadratic a b c d e f g h s1 s2 H_Qquadratic_denom_nonzero =
spec_q a b c d e f g h s1 s2.