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
ℝ≥0
defined in the natural way; -
the natural structure of a complete dense linear order:
↑p ≤ ↑q ↔ p ≤ q
and∀ a, a ≤ ∞
; -
a + b
is defined so that↑p + ↑q = ↑(p + q)
for(p q : ℝ≥0)
anda + ∞ = ∞ + a = ∞
; -
a * b
is defined so that↑p * ↑q = ↑(p * q)
for(p q : ℝ≥0)
,0 * ∞ = ∞ * 0 = 0
, anda * ∞ = ∞ * a = ∞
fora ≠ 0
; -
a - b
is defined as the minimald
such 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 / b
is defined asa * b⁻¹
.
The addition and multiplication defined this way together with
0 = ↑0
and1 = ↑1
turnℝ≥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 applycoe
automatically; -
ENNReal.toNNReal
sends↑p
top
and∞
to0
; -
ENNReal.toReal := coe ∘ ENNReal.toNNReal
sends↑p
,p : ℝ≥0
to(↑p : ℝ)
and∞
to0
; -
ENNReal.ofReal := coe ∘ Real.toNNReal
sendsx : ℝ
to↑⟨max x 0, _⟩
-
ENNReal.neTopEquivNNReal
is 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
Equations
- One or more equations did not get rendered due to their size.
Equations
- ENNReal.covariantClass_mul_le = (_ : CovariantClass ENNReal ENNReal (fun (x x_1 : ENNReal) => x * x_1) fun (x x_1 : ENNReal) => x ≤ x_1)
Equations
- ENNReal.covariantClass_add_le = (_ : CovariantClass ENNReal ENNReal (fun (x x_1 : ENNReal) => x + x_1) fun (x x_1 : ENNReal) => x ≤ x_1)
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.ofNNReal }
A version of WithTop.recTopCoe
that uses ENNReal.ofNNReal
.
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.
Equations
- fact_one_le_one_ennreal = (_ : Fact (1 ≤ 1))
(1 : ℝ≥0∞) ≤ 2
, recorded as a Fact
for use with Lp
spaces.
Equations
- fact_one_le_two_ennreal = (_ : Fact (1 ≤ 2))
A MulAction
over ℝ≥0∞
restricts to a MulAction
over ℝ≥0
.
Equations
- ENNReal.instMulActionNNRealToMonoidToMonoidWithZeroInstNNRealSemiring = MulAction.compHom M ↑ENNReal.ofNNRealHom
Equations
- (_ : IsScalarTower NNReal M N) = (_ : IsScalarTower NNReal M N)
Equations
- (_ : SMulCommClass NNReal M N) = (_ : SMulCommClass NNReal M N)
Equations
- (_ : SMulCommClass M NNReal N) = (_ : SMulCommClass M NNReal N)
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
A product of finite numbers is still finite
A sum of finite numbers is still finite
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
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 ENNReal
s to Real
s.
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 ENNReal
s to Real
s.
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.ofNNReal
.
Equations
- One or more equations did not get rendered due to their size.