Definition spec_h (a b c d : Z) (q : Q) : Q :=
  Qmult (Qplus (Qmult a q) b) (Qinv (Qplus (Qmult c q) d)).Definition spec_Qhomographic_Qpositive_to_Q (a b c d : Z) 
  (p : Qpositive) : Q :=
  Qmult (Qplus (Qmult a (Qpos p)) b) (Qinv (Qplus (Qmult c (Qpos p)) d)).Definition spec_ni (a b c d : Z) (p : Qpositive) : Qpositive :=
  Q_tail
    (Qmult (Qplus (Qmult a (Qpos p)) b) (Qinv (Qplus (Qmult c (Qpos p)) d))).(* Here we should expect that a*p+b > 0 and c*p+d > 0, this follow from homographicAcc *)
Definition spec_ni2 (a b c d : Z) (p : Qpositive) : Qpositive :=
  Qpositive_mult (Q_tail (Qplus (Qmult a (Qpos p)) b))
    (Qpositive_inv (Q_tail (Qplus (Qmult c (Qpos p)) d))).

Lemma sg_pres_fraction : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), Qmult (Qplus (Qmult (new_a a b c d p H_Qhomographic_sg_denom_nonzero) (Qpos (new_p a b c d p H_Qhomographic_sg_denom_nonzero))) (new_b a b c d p H_Qhomographic_sg_denom_nonzero)) (Qinv (Qplus (Qmult (new_c a b c d p H_Qhomographic_sg_denom_nonzero) (Qpos (new_p a b c d p H_Qhomographic_sg_denom_nonzero))) (new_d a b c d p H_Qhomographic_sg_denom_nonzero))) = Qmult (Qplus (Qmult a (Qpos p)) b) (Qinv (Qplus (Qmult c (Qpos p)) d)).