Extended non-negative reals #
We define ENNReal = ℝ≥0∞ := WithTop ℝ≥0 to be the type of extended nonnegative real numbers,
i.e., the interval [0, +∞]. This type is used as the codomain of a MeasureTheory.Measure,
and of the extended distance edist in an EMetricSpace.
In this file we define some algebraic operations and a linear order on ℝ≥0∞
and prove basic properties of these operations, order, and conversions to/from ℝ, ℝ≥0, and ℕ.
Main definitions #
-
ℝ≥0∞: the extended nonnegative real numbers[0, ∞]; defined asWithTop ℝ≥0; it is equipped with the following structures:-
coercion from
ℝ≥0defined in the natural way; -
the natural structure of a complete dense linear order:
↑p ≤ ↑q ↔ p ≤ qand∀ a, a ≤ ∞; -
a + bis defined so that↑p + ↑q = ↑(p + q)for(p q : ℝ≥0)anda + ∞ = ∞ + a = ∞; -
a * bis defined so that↑p * ↑q = ↑(p * q)for(p q : ℝ≥0),0 * ∞ = ∞ * 0 = 0, anda * ∞ = ∞ * a = ∞fora ≠ 0; -
a - bis defined as the minimaldsuch thata ≤ d + b; this way we have↑p - ↑q = ↑(p - q),∞ - ↑p = ∞,↑p - ∞ = ∞ - ∞ = 0; note that there is no negation, only subtraction; -
a⁻¹is defined asInf {b | 1 ≤ a * b}. This way we have(↑p)⁻¹ = ↑(p⁻¹)forp : ℝ≥0,p ≠ 0,0⁻¹ = ∞, and∞⁻¹ = 0. -
a / bis defined asa * b⁻¹.
The addition and multiplication defined this way together with
0 = ↑0and1 = ↑1turnℝ≥0∞into a canonically ordered commutative semiring of characteristic zero. -
-
Coercions to/from other types:
-
coercion
ℝ≥0 → ℝ≥0∞is defined asCoe, so one can use(p : ℝ≥0)in a context that expectsa : ℝ≥0∞, and Lean will applycoeautomatically; -
ENNReal.toNNRealsends↑ptopand∞to0; -
ENNReal.toReal := coe ∘ ENNReal.toNNRealsends↑p,p : ℝ≥0to(↑p : ℝ)and∞to0; -
ENNReal.ofReal := coe ∘ Real.toNNRealsendsx : ℝto↑⟨max x 0, _⟩ -
ENNReal.neTopEquivNNRealis an equivalence between{a : ℝ≥0∞ // a ≠ 0}andℝ≥0.
-
Implementation notes #
We define a CanLift ℝ≥0∞ ℝ≥0 instance, so one of the ways to prove theorems about an ℝ≥0∞
number a is to consider the cases a = ∞ and a ≠ ∞, and use the tactic lift a to ℝ≥0 using ha
in the second case. This instance is even more useful if one already has ha : a ≠ ∞ in the
context, or if we have (f : α → ℝ≥0∞) (hf : ∀ x, f x ≠ ∞).
Notations #
ℝ≥0∞: the type of the extended nonnegative real numbers;ℝ≥0: the type of nonnegative real numbers[0, ∞); defined indata.real.nnreal;∞: a localized notation inℝ≥0∞for⊤ : ℝ≥0∞.
The extended nonnegative real numbers. This is usually denoted [0, ∞], and is relevant as the codomain of a measure.
Equations
- ENNReal.«termℝ≥0∞» = Lean.ParserDescr.node `ENNReal.termℝ≥0∞ 1024 (Lean.ParserDescr.symbol "ℝ≥0∞")
Instances For
Notation for infinity as an ENNReal number.
Equations
- ENNReal.«term∞» = Lean.ParserDescr.node `ENNReal.term∞ 1024 (Lean.ParserDescr.symbol "∞")
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- ENNReal.instInhabitedENNReal = { default := 0 }
Equations
- ENNReal.instCoeNNRealENNReal = { coe := ENNReal.some }
A version of WithTop.recTopCoe that uses ENNReal.some.
Equations
- ENNReal.recTopCoe top coe x = WithTop.recTopCoe top coe x
Instances For
toReal x returns x if it is real, 0 otherwise.
Equations
- ENNReal.toReal a = ↑(ENNReal.toNNReal a)
Instances For
ofReal x returns x if it is nonnegative, 0 otherwise.
Equations
- ENNReal.ofReal r = ↑(Real.toNNReal r)
Instances For
Alias of the reverse direction of ENNReal.coe_le_coe.
Alias of the reverse direction of ENNReal.coe_lt_coe.
(1 : ℝ≥0∞) ≤ 1, recorded as a Fact for use with Lp spaces.
(1 : ℝ≥0∞) ≤ 2, recorded as a Fact for use with Lp spaces.
(1 : ℝ≥0∞) ≤ ∞, recorded as a Fact for use with Lp spaces.
A MulAction over ℝ≥0∞ restricts to a MulAction over ℝ≥0.
Equations
- ENNReal.instMulActionNNRealToMonoidToMonoidWithZeroInstNNRealSemiring = MulAction.compHom M ↑ENNReal.ofNNRealHom
Equations
- One or more equations did not get rendered due to their size.
A DistribMulAction over ℝ≥0∞ restricts to a DistribMulAction over ℝ≥0.
Equations
- ENNReal.instDistribMulActionNNRealToMonoidToMonoidWithZeroInstNNRealSemiring = DistribMulAction.compHom M ↑ENNReal.ofNNRealHom
A Module over ℝ≥0∞ restricts to a Module over ℝ≥0.
Equations
- ENNReal.instModuleNNRealInstNNRealSemiring = Module.compHom M ENNReal.ofNNRealHom
An element a is AddLECancellable if a + b ≤ a + c implies b ≤ c for all b and c.
This is true in ℝ≥0∞ for all elements except ∞.
This lemma has an abbreviated name because it is used frequently.
This lemma has an abbreviated name because it is used frequently.
This lemma has an abbreviated name because it is used frequently.
This lemma has an abbreviated name because it is used frequently.
This is a special case of WithTop.coe_sub in the ENNReal namespace
This is a special case of WithTop.top_sub_coe in the ENNReal namespace
This is a special case of WithTop.sub_top in the ENNReal namespace
Seeing ℝ≥0∞ as ℝ≥0 does not change their sum, unless one of the ℝ≥0∞ is
infinity
seeing ℝ≥0∞ as Real does not change their sum, unless one of the ℝ≥0∞ is infinity
Equations
- ENNReal.instInvENNReal = { inv := fun a => sInf {b | 1 ≤ a * b} }
Equations
An order isomorphism between the extended nonnegative real numbers and the unit interval.
Equations
Instances For
If a ≤ b + c and a = ∞ whenever b = ∞ or c = ∞, then
ENNReal.toReal a ≤ ENNReal.toReal b + ENNReal.toReal c. This lemma is useful to transfer
triangle-like inequalities from ENNReals to Reals.
If a ≤ b + c, b ≠ ∞, and c ≠ ∞, then
ENNReal.toReal a ≤ ENNReal.toReal b + ENNReal.toReal c. This lemma is useful to transfer
triangle-like inequalities from ENNReals to Reals.
Alias of the reverse direction of ENNReal.ofReal_eq_zero.
ENNReal.toNNReal as a MonoidHom.
Equations
- One or more equations did not get rendered due to their size.
Instances For
ENNReal.toReal as a MonoidHom.
Instances For
If x ≠ ∞, then right multiplication by x maps infimum over a nonempty type to infimum. See
also ENNReal.iInf_mul_of_ne that assumes x ≠ 0 but does not require [Nonempty ι].
If x ≠ ∞, then left multiplication by x maps infimum over a nonempty type to infimum. See
also ENNReal.mul_iInf_of_ne that assumes x ≠ 0 but does not require [Nonempty ι].
supr_mul, mul_supr and variants are in Topology.Instances.ENNReal.
Extension for the positivity tactic: ENNReal.toReal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extension for the positivity tactic: ENNReal.toReal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extension for the positivity tactic: ENNReal.some.
Equations
- One or more equations did not get rendered due to their size.