Fixpoint Qhomographic_sign (a b c d : Z) (p : Qpositive) {struct p} :
  forall (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
  Z * (Z * (Z * (Z * Z)) * Qpositive).Scheme Qhomographic_sg_denom_nonzero_inv_dep :=
  Induction for Qhomographic_sg_denom_nonzero Sort Prop.

(* Specifications: *)
Lemma Qhomographic_sign_equal : forall (a b c d : Z) (p : Qpositive) (H1 H2 : Qhomographic_sg_denom_nonzero c d p), Qhomographic_sign a b c d p H1 = Qhomographic_sign a b c d p H2.
Lemma Qhomographic_sign_equal_strong : forall (a1 a2 b1 b2 c1 c2 d1 d2 : Z) (p1 p2 : Qpositive) (H_ok_1 : Qhomographic_sg_denom_nonzero c1 d1 p1) (H_ok_2 : Qhomographic_sg_denom_nonzero c2 d2 p2), a1 = a2 -> b1 = b2 -> c1 = c2 -> d1 = d2 -> p1 = p2 -> Qhomographic_sign a1 b1 c1 d1 p1 H_ok_1 = Qhomographic_sign a2 b2 c2 d2 p2 H_ok_2.
Lemma sg_One_2 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = One -> Z.sgn (a + b) = 0%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (0%Z, (a, (b, (c, d)), One)).
Lemma sg_One_3 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = One -> Z.sgn (a + b) <> 0%Z -> Z.sgn (a + b) = Z.sgn (c + d) -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (1%Z, (a, (b, (c, d)), One)).
Lemma sg_One_4 : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = One -> Z.sgn (a + b) <> 0%Z -> Z.sgn (a + b) <> Z.sgn (c + d) -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((-1)%Z, (a, (b, (c, d)), One)).
Lemma Qhomographic_sign_nR_1 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b = 0%Z -> d = 0%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((Z.sgn a * Z.sgn c)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_2 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b = 0%Z -> d <> 0%Z -> (0 < outside_interval c d)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (Z.sgn a, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_3 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b = 0%Z -> d <> 0%Z -> ~ (0 < outside_interval c d)%Z -> (outside_interval c d < 0)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((- Z.sgn a)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_4 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c (c + d) xs) (H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d (nR xs)), b = 0%Z -> d <> 0%Z -> ~ (0 < outside_interval c d)%Z -> ~ (outside_interval c d < 0)%Z -> Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR = Qhomographic_sign a (a + b) c (c + d) xs H_Qhomographic_sg_denom_nonzero.
Lemma Qhomographic_sign_nR_5 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b <> 0%Z -> d = 0%Z -> (0 < outside_interval a b)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (Z.sgn c, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_6 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b <> 0%Z -> d = 0%Z -> ~ (0 < outside_interval a b)%Z -> (outside_interval a b < 0)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((- Z.sgn c)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_7 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c (c + d) xs) (H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d (nR xs)), b <> 0%Z -> d = 0%Z -> ~ (0 < outside_interval a b)%Z -> ~ (outside_interval a b < 0)%Z -> Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR = Qhomographic_sign a (a + b) c (c + d) xs H_Qhomographic_sg_denom_nonzero.
Lemma Qhomographic_sign_nR_8 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b <> 0%Z -> d <> 0%Z -> inside_interval_1 (outside_interval a b) (outside_interval c d) -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (1%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_9 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = nR xs -> b <> 0%Z -> d <> 0%Z -> ~ inside_interval_1 (outside_interval a b) (outside_interval c d) -> inside_interval_2 (outside_interval a b) (outside_interval c d) -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((-1)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_nR_10 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c (c + d) xs) (H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d (nR xs)), b <> 0%Z -> d <> 0%Z -> ~ inside_interval_1 (outside_interval a b) (outside_interval c d) -> ~ inside_interval_2 (outside_interval a b) (outside_interval c d) -> Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR = Qhomographic_sign a (a + b) c (c + d) xs H_Qhomographic_sg_denom_nonzero.
Lemma Qhomographic_sign_dL_1 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b = 0%Z -> d = 0%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((Z.sgn a * Z.sgn c)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_2 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b = 0%Z -> d <> 0%Z -> (0 < outside_interval c d)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (Z.sgn a, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_3 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b = 0%Z -> d <> 0%Z -> ~ (0 < outside_interval c d)%Z -> (outside_interval c d < 0)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((- Z.sgn a)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_4 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero (c + d) d xs) (H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d (dL xs)), b = 0%Z -> d <> 0%Z -> ~ (0 < outside_interval c d)%Z -> ~ (outside_interval c d < 0)%Z -> Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL = Qhomographic_sign (a + b) b (c + d) d xs H_Qhomographic_sg_denom_nonzero.
Lemma Qhomographic_sign_dL_5 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b <> 0%Z -> d = 0%Z -> (0 < outside_interval a b)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (Z.sgn c, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_6 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b <> 0%Z -> d = 0%Z -> ~ (0 < outside_interval a b)%Z -> (outside_interval a b < 0)%Z -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((- Z.sgn c)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_7 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero (c + d) d xs) (H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d (dL xs)), b <> 0%Z -> d = 0%Z -> ~ (0 < outside_interval a b)%Z -> ~ (outside_interval a b < 0)%Z -> Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL = Qhomographic_sign (a + b) b (c + d) d xs H_Qhomographic_sg_denom_nonzero.
Lemma Qhomographic_sign_dL_8 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b <> 0%Z -> d <> 0%Z -> inside_interval_1 (outside_interval a b) (outside_interval c d) -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = (1%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_9 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), p = dL xs -> b <> 0%Z -> d <> 0%Z -> ~ inside_interval_1 (outside_interval a b) (outside_interval c d) -> inside_interval_2 (outside_interval a b) (outside_interval c d) -> Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero = ((-1)%Z, (a, (b, (c, d)), p)).
Lemma Qhomographic_sign_dL_10 : forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero (c + d) d xs) (H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d (dL xs)), b <> 0%Z -> d <> 0%Z -> ~ inside_interval_1 (outside_interval a b) (outside_interval c d) -> ~ inside_interval_2 (outside_interval a b) (outside_interval c d) -> Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL = Qhomographic_sign (a + b) b (c + d) d xs H_Qhomographic_sg_denom_nonzero.
Lemma sg_sign : forall (a b c d : Z) (qp : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d qp), let (l1, L2) := Qhomographic_sign a b c d qp H_Qhomographic_sg_denom_nonzero in {l1 = 0%Z} + {l1 = 1%Z} + {l1 = (-1)%Z}.