Module docstring
{"# Nonnegative real numbers
In this file we define NNReal (notation: ℝ≥0) to be the type of non-negative real numbers,
a.k.a. the interval [0, ∞). We also define the following operations and structures on ℝ≥0:
the order on
ℝ≥0is the restriction of the order onℝ; these relations define a conditionally complete linear order with a bottom element,ConditionallyCompleteLinearOrderBot;a + banda * bare the restrictions of addition and multiplication of real numbers toℝ≥0; these operations together with0 = ⟨0, _⟩and1 = ⟨1, _⟩turnℝ≥0into a conditionally complete linear ordered archimedean commutative semifield; we have no typeclass for this inmathlibyet, so we define the following instances instead:LinearOrderedSemiring ℝ≥0;OrderedCommSemiring ℝ≥0;CanonicallyOrderedAdd ℝ≥0;LinearOrderedCommGroupWithZero ℝ≥0;CanonicallyLinearOrderedAddCommMonoid ℝ≥0;Archimedean ℝ≥0;ConditionallyCompleteLinearOrderBot ℝ≥0.
These instances are derived from corresponding instances about the type
{x : α // 0 ≤ x}in an appropriate ordered field/ring/group/monoidα, seeMathlib.Algebra.Order.Nonneg.OrderedRing.Real.toNNReal xis defined as⟨max x 0, _⟩, i.e.↑(Real.toNNReal x) = xwhen0 ≤ xand↑(Real.toNNReal x) = 0otherwise.
We also define an instance CanLift ℝ ℝ≥0. This instance can be used by the lift tactic to
replace x : ℝ and hx : 0 ≤ x in the proof context with x : ℝ≥0 while replacing all occurrences
of x with ↑x. This tactic also works for a function f : α → ℝ with a hypothesis
hf : ∀ x, 0 ≤ f x.
Notations
This file defines ℝ≥0 as a localized notation for NNReal.
","### Lemmas about subtraction
In this section we provide a few lemmas about subtraction that do not fit well into any other
typeclass. For lemmas about subtraction and addition see lemmas about OrderedSub in the file
Mathlib.Algebra.Order.Sub.Basic. See also mul_tsub and tsub_mul.
"}