Variant rat_spec (* (x : rat) *) : rat -> int -> int -> Type :=
Rat_spec (n : int) (d : nat)  & coprime `|n| d.+1
: rat_spec (* x  *) (n%:Q / d.+1%:Q) n d.+1.

(* Specifications: *)
Lemma ratP x : rat_spec x (numq x) (denq x).
Lemma coprimeq_num n d : coprime `|n| `|d| -> numq (n%:~R / d%:~R) = sgr d * n.
Lemma coprimeq_den n d :
coprime `|n| `|d| -> denq (n%:~R / d%:~R) = (if d == 0 then 1 else `|d|).
Lemma denqVz (i : int) : i != 0 -> denq (i%:~R^-1) = `|i|.
Lemma numqE x : (numq x)%:~R = x * (denq x)%:~R.
Fact le_rat0M x y : le_rat 0 x -> le_rat 0 y -> le_rat 0 (x * y).