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 homography_positive_input : forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), Qhomographic_Qpositive_to_Q a b c d p H_Qhomographic_sg_denom_nonzero = Qmult (Qplus (Qmult a (Qpos p)) b) (Qinv (Qplus (Qmult c (Qpos p)) d)).