Lemma minus_divNonnegativeRationals : ∏ x y : NonnegativeRationals, 0 < y -> / x - / y = (y - x) / (x * y). Proof. intros x y Hy0. generalize (eq0orgt0NonnegativeRationals x) ; apply sumofmaps ; intros Hx0. - unfold divNonnegativeRationals. rewrite Hx0, islabsorb_zero_multNonnegativeRationals, inv_zeroNonnegativeRationals, israbsorb_zero_multNonnegativeRationals, minusNonnegativeRationals_zero_l. reflexivity. - apply multNonnegativeRationals_eqcompat_l with (x * y). + apply ispositive_multNonnegativeRationals, Hy0. exact Hx0. + rewrite multdivNonnegativeRationals. 2: apply ispositive_multNonnegativeRationals, Hy0. * rewrite isldistr_mult_minusNonnegativeRationals. rewrite iscomm_multNonnegativeRationals, <- isassoc_multNonnegativeRationals, islinv_NonnegativeRationals, islunit_oneNonnegativeRationals. 2: exact Hx0. rewrite isassoc_multNonnegativeRationals, isrinv_NonnegativeRationals, isrunit_oneNonnegativeRationals. 2: exact Hy0. reflexivity. * exact Hx0. Qed.
Require Import UniMath.MoreFoundations.Tactics. Require Import UniMath.MoreFoundations.PartA. Require Import UniMath.MoreFoundations.Sets. Require Import UniMath.MoreFoundations.Orders. Require Import UniMath.RealNumbers.Sets. Require Import UniMath.RealNumbers.Fields. Require Import UniMath.OrderTheory.Lattice.Lattice. Require Import UniMath.RealNumbers.Prelim.