Definition spec_fraction_encoding (a b : Z) : Q := Qmult a (Qinv b).Definition spec_positive_fraction_encoding (a b : Z) 
  (Ha : (0 < a)%Z) (Hb : (0 < b)%Z) :=
  Qpositive_mult (Z_to_Qpositive a Ha) (Qpositive_inv (Z_to_Qpositive b Hb)).Definition spec_positive_fraction_encoding1 (a b : Z) :=
  Q_tail (Qmult a (Qinv b)).Definition spec_positive_fraction_encoding2 (a b : Z) :=
  Qpositive_mult (Q_tail a) (Qpositive_inv (Q_tail b)).

Lemma coding : forall (m n : Z) (Hm : (0 < m)%Z) (Hn : (0 < n)%Z), positive_fraction_encoding m n Hm Hn = spec_positive_fraction_encoding m n Hm Hn.