proposition: Lemma minusNonnegativeRationals_ltcompat_r: ∏ x y z : NonnegativeRationals, x < y -> x < z -> z - y < z - x.
proof: Proof. intros x y z Hxy Hxz. generalize (isdecrel_leNonnegativeRationals y z) ; apply sumofmaps ; intros Hky. - apply_pr2 (plusNonnegativeRationals_ltcompat_r y). rewrite minusNonnegativeRationals_plus_r, minusNonnegativeRationals_plus_exchange, iscomm_plusNonnegativeRationals, <- minusNonnegativeRationals_plus_exchange. + pattern z at 1 ; rewrite <- (islunit_zeroNonnegativeRationals z). apply plusNonnegativeRationals_ltcompat_r. now apply (pr1 (ispositive_minusNonnegativeRationals _ _)), Hxy. + now apply lt_leNonnegativeRationals, Hxy. + now apply lt_leNonnegativeRationals, Hxz. + exact Hky. - rewrite minusNonnegativeRationals_eq_zero. + now apply (pr1 (ispositive_minusNonnegativeRationals _ _)), Hxz. + now apply lt_leNonnegativeRationals, notge_ltNonnegativeRationals, Hky. Qed.
imports: UniMath.MoreFoundations.Tactics UniMath.MoreFoundations.PartA UniMath.MoreFoundations.Sets UniMath.MoreFoundations.Orders UniMath.RealNumbers.Sets UniMath.RealNumbers.Fields UniMath.Algebra.DivisionRig UniMath.OrderTheory.Lattice.Lattice UniMath.RealNumbers.Prelim