proposition: Lemma minusNonnegativeRationals_lecompat_r : ∏ k x y : NonnegativeRationals, x <= y -> k - y <= k - x.
proof: Proof. intros k x y Hxy. generalize (isdecrel_leNonnegativeRationals y k) ; apply sumofmaps ; intros Hky. - apply_pr2 (plusNonnegativeRationals_lecompat_r y). rewrite minusNonnegativeRationals_plus_r, minusNonnegativeRationals_plus_exchange, iscomm_plusNonnegativeRationals, <- minusNonnegativeRationals_plus_exchange. + apply plusNonnegativeRationals_le_l. + exact Hxy. + apply istrans_leNonnegativeRationals with y. * exact Hxy. * exact Hky. + exact Hky. - rewrite minusNonnegativeRationals_eq_zero. + now apply isnonnegative_NonnegativeRationals. + now apply lt_leNonnegativeRationals, notge_ltNonnegativeRationals. 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