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_Q : forall (m n : Z) (Hdenom : n <> 0%Z), fraction_encoding m n Hdenom = spec_fraction_encoding m n.