Lemma isassoc_minusNonnegativeReals : ∏ x y z : NonnegativeReals, (x - y) - z = x - (y + z). Proof. intros x y z. apply plusNonnegativeReals_eqcompat_l with (y + z). rewrite <- maxNonnegativeReals_minus_plus. rewrite (iscomm_plusNonnegativeReals y). rewrite <- isassoc_plusNonnegativeReals. rewrite <- maxNonnegativeReals_minus_plus. rewrite isrdistr_max_plusNonnegativeReals. rewrite <- maxNonnegativeReals_minus_plus. rewrite isassoc_maxNonnegativeReals. apply maponpaths. apply maxNonnegativeReals_carac_r. now apply plusNonnegativeReals_le_r. Qed.
Require Import UniMath.MoreFoundations.Orders. Require Import UniMath.MoreFoundations.Tactics. Require Import UniMath.MoreFoundations.Notations. Require Import UniMath.RealNumbers.Sets. Require Import UniMath.OrderTheory.Lattice.Lattice. Require Import UniMath.RealNumbers.Prelim. Require Import UniMath.RealNumbers.NonnegativeRationals.