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 set up many of the instances on ℝ≥0∞, and provide relationships between ℝ≥0∞ and
ℝ≥0, and between ℝ≥0∞ and ℝ. In particular, we provide a coercion from ℝ≥0 to ℝ≥0∞ as well
as functions ENNReal.toNNReal, ENNReal.ofReal and ENNReal.toReal, all of which take the value
zero wherever they cannot be the identity. Also included is the relationship between ℝ≥0∞ and ℕ.
The interaction of these functions, especially ENNReal.ofReal and ENNReal.toReal, with the
algebraic and lattice structure can be found in Data.ENNReal.Real.
This file proves many of the order properties of ℝ≥0∞, with the exception of the ways those relate
to the algebraic structure, which are included in Data.ENNReal.Operations.
This file also defines inversion and division: this includes Inv and Div instances on ℝ≥0∞
making it into a DivInvOneMonoid.
As a consequence of being a DivInvOneMonoid, ℝ≥0∞ inherits a power operation with integer
exponent: this and other properties is shown in Data.ENNReal.Inv.
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;
The addition and multiplication defined this way together with
0 = ↑0and1 = ↑1turnℝ≥0∞into a canonically ordered commutative semiring of characteristic zero.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⁻¹.
This inversion and division include
InvandDivinstances onℝ≥0∞, making it into aDivInvOneMonoid. Further properties of these are shown inData.ENNReal.Inv.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 ≠ ∞).
Notation #
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
Equations
Equations
Equations
Equations
Equations
Equations
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
- ENNReal.instUniqueAddUnits = { default := 0, uniq := ENNReal.instUniqueAddUnits._proof_1 }
Equations
- ENNReal.instInhabited = { default := 0 }
Coercion from ℝ≥0 to ℝ≥0∞.
Equations
Instances For
Equations
- ENNReal.instCoeNNReal = { coe := ENNReal.ofNNReal }
A version of WithTop.recTopCoe that uses ENNReal.ofNNReal.
Equations
- ENNReal.recTopCoe top coe x = WithTop.recTopCoe top coe x
Instances For
Equations
- ENNReal.instNNRatCast = { nnratCast := fun (r : ℚ≥0) => ↑↑r }
ofReal x returns x if it is nonnegative, 0 otherwise.
Equations
- ENNReal.ofReal r = ↑r.toNNReal
Instances For
Alias of ENNReal.toNNReal_top.
Alias of ENNReal.toReal_top.
Alias of ENNReal.toReal_one.
Alias of ENNReal.toNNReal_one.
Alias of ENNReal.toNNReal_zero.
Alias of ENNReal.toReal_zero.
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.
Coercion ℝ≥0 → ℝ≥0∞ as a RingHom.
Equations
- ENNReal.ofNNRealHom = { toFun := WithTop.some, map_one' := ENNReal.coe_one, map_mul' := ⋯, map_zero' := ENNReal.coe_zero, map_add' := ⋯ }
Instances For
While not very useful, this instance uses the same representation as Real.instRepr.
Equations
- One or more equations did not get rendered due to their size.
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.ofNNReal.
Equations
- One or more equations did not get rendered due to their size.