Documentation

Mathlib.Data.EReal.Basic

The extended real numbers #

This file defines EReal, with a top element and a bottom element , implemented as WithBot (WithTop ℝ).

EReal is a CompleteLinearOrder, deduced by typeclass inference from the fact that WithBot (WithTop L) completes a conditionally complete linear order L.

Coercions from (called coe in lemmas) and from ℝ≥0∞ (coe_ennreal) are registered and their basic properties proved. The latter takes up most of the rest of this file.

Tags #

real, ereal, complete lattice

def EReal :

The type of extended real numbers [-∞, ∞], constructed as WithBot (WithTop ℝ).

Equations
    Instances For
      Equations
        Equations
          Equations

            The canonical inclusion from reals to ereals. Registered as a coercion.

            Equations
              Instances For
                Equations
                  @[simp]
                  theorem EReal.coe_le_coe_iff {x y : } :
                  x y x y
                  theorem EReal.coe_le_coe {x y : } :
                  x yx y

                  Alias of the reverse direction of EReal.coe_le_coe_iff.

                  @[simp]
                  theorem EReal.coe_lt_coe_iff {x y : } :
                  x < y x < y
                  theorem EReal.coe_lt_coe {x y : } :
                  x < yx < y

                  Alias of the reverse direction of EReal.coe_lt_coe_iff.

                  @[simp]
                  theorem EReal.coe_eq_coe_iff {x y : } :
                  x = y x = y
                  theorem EReal.coe_ne_coe_iff {x y : } :
                  x y x y
                  @[simp]
                  theorem EReal.coe_natCast {n : } :
                  n = n

                  The canonical map from nonnegative extended reals to extended reals.

                  Equations
                    Instances For
                      @[simp]
                      theorem EReal.coe_zero :
                      0 = 0
                      @[simp]
                      theorem EReal.coe_one :
                      1 = 1
                      def EReal.rec {motive : ERealSort u_1} (bot : motive ) (coe : (a : ) → motive a) (top : motive ) (a : EReal) :
                      motive a

                      A recursor for EReal in terms of the coercion.

                      When working in term mode, note that pattern matching can be used directly.

                      Equations
                        Instances For
                          theorem EReal.forall {p : ERealProp} :
                          (∀ (r : EReal), p r) p p ∀ (r : ), p r
                          theorem EReal.exists {p : ERealProp} :
                          (∃ (r : EReal), p r) p p ∃ (r : ), p r
                          def EReal.mul :
                          ERealERealEReal

                          The multiplication on EReal. Our definition satisfies 0 * x = x * 0 = 0 for any x, and picks the only sensible value elsewhere.

                          Equations
                            Instances For
                              Equations
                                @[simp]
                                theorem EReal.coe_mul (x y : ) :
                                ↑(x * y) = x * y
                                theorem EReal.induction₂ {P : ERealERealProp} (top_top : P ) (top_pos : ∀ (x : ), 0 < xP x) (top_zero : P 0) (top_neg : x < 0, P x) (top_bot : P ) (pos_top : ∀ (x : ), 0 < xP x ) (pos_bot : ∀ (x : ), 0 < xP x ) (zero_top : P 0 ) (coe_coe : ∀ (x y : ), P x y) (zero_bot : P 0 ) (neg_top : x < 0, P x ) (neg_bot : x < 0, P x ) (bot_top : P ) (bot_pos : ∀ (x : ), 0 < xP x) (bot_zero : P 0) (bot_neg : x < 0, P x) (bot_bot : P ) (x y : EReal) :
                                P x y

                                Induct on two EReals by performing case splits on the sign of one whenever the other is infinite.

                                theorem EReal.induction₂_symm {P : ERealERealProp} (symm : ∀ {x y : EReal}, P x yP y x) (top_top : P ) (top_pos : ∀ (x : ), 0 < xP x) (top_zero : P 0) (top_neg : x < 0, P x) (top_bot : P ) (pos_bot : ∀ (x : ), 0 < xP x ) (coe_coe : ∀ (x y : ), P x y) (zero_bot : P 0 ) (neg_bot : x < 0, P x ) (bot_bot : P ) (x y : EReal) :
                                P x y

                                Induct on two EReals by performing case splits on the sign of one whenever the other is infinite. This version eliminates some cases by assuming that the relation is symmetric.

                                theorem EReal.mul_comm (x y : EReal) :
                                x * y = y * x
                                theorem EReal.one_mul (x : EReal) :
                                1 * x = x
                                theorem EReal.zero_mul (x : EReal) :
                                0 * x = 0

                                Real coercion #

                                The map from extended reals to reals sending infinities to zero.

                                Equations
                                  Instances For
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    theorem EReal.toReal_coe (x : ) :
                                    (↑x).toReal = x
                                    @[simp]
                                    theorem EReal.bot_lt_coe (x : ) :
                                    < x
                                    @[simp]
                                    theorem EReal.coe_ne_bot (x : ) :
                                    x
                                    @[simp]
                                    theorem EReal.bot_ne_coe (x : ) :
                                    x
                                    @[simp]
                                    theorem EReal.coe_lt_top (x : ) :
                                    x <
                                    @[simp]
                                    theorem EReal.coe_ne_top (x : ) :
                                    x
                                    @[simp]
                                    theorem EReal.top_ne_coe (x : ) :
                                    x
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    theorem EReal.coe_add (x y : ) :
                                    ↑(x + y) = x + y
                                    theorem EReal.coe_nsmul (n : ) (x : ) :
                                    ↑(n x) = n x
                                    @[simp]
                                    theorem EReal.coe_eq_zero {x : } :
                                    x = 0 x = 0
                                    @[simp]
                                    theorem EReal.coe_eq_one {x : } :
                                    x = 1 x = 1
                                    theorem EReal.coe_ne_zero {x : } :
                                    x 0 x 0
                                    theorem EReal.coe_ne_one {x : } :
                                    x 1 x 1
                                    @[simp]
                                    theorem EReal.coe_nonneg {x : } :
                                    0 x 0 x
                                    @[simp]
                                    theorem EReal.coe_nonpos {x : } :
                                    x 0 x 0
                                    @[simp]
                                    theorem EReal.coe_pos {x : } :
                                    0 < x 0 < x
                                    @[simp]
                                    theorem EReal.coe_neg' {x : } :
                                    x < 0 x < 0
                                    theorem EReal.toReal_eq_toReal {x y : EReal} (hx_top : x ) (hx_bot : x ) (hy_top : y ) (hy_bot : y ) :
                                    x.toReal = y.toReal x = y
                                    theorem EReal.toReal_nonneg {x : EReal} (hx : 0 x) :
                                    theorem EReal.toReal_nonpos {x : EReal} (hx : x 0) :
                                    theorem EReal.toReal_le_toReal {x y : EReal} (h : x y) (hx : x ) (hy : y ) :
                                    theorem EReal.coe_toReal {x : EReal} (hx : x ) (h'x : x ) :
                                    x.toReal = x
                                    theorem EReal.le_coe_toReal {x : EReal} (h : x ) :
                                    x x.toReal
                                    theorem EReal.coe_toReal_le {x : EReal} (h : x ) :
                                    x.toReal x
                                    theorem EReal.eq_top_iff_forall_lt (x : EReal) :
                                    x = ∀ (y : ), y < x
                                    theorem EReal.eq_bot_iff_forall_lt (x : EReal) :
                                    x = ∀ (y : ), x < y

                                    Intervals and coercion from reals #

                                    theorem EReal.exists_between_coe_real {x z : EReal} (h : x < z) :
                                    ∃ (y : ), x < y y < z
                                    @[simp]
                                    theorem EReal.image_coe_Icc (x y : ) :
                                    @[simp]
                                    theorem EReal.image_coe_Ico (x y : ) :
                                    @[simp]
                                    theorem EReal.image_coe_Ioc (x y : ) :
                                    @[simp]
                                    theorem EReal.image_coe_Ioo (x y : ) :
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    @[simp]

                                    ennreal coercion #

                                    @[simp]
                                    @[simp]
                                    theorem EReal.coe_ennreal_ofReal {x : } :
                                    (ENNReal.ofReal x) = (max x 0)
                                    theorem EReal.coe_ennreal_toReal {x : ENNReal} (hx : x ) :
                                    x.toReal = x
                                    theorem EReal.coe_nnreal_eq_coe_real (x : NNReal) :
                                    x = x
                                    @[simp]
                                    theorem EReal.coe_ennreal_zero :
                                    0 = 0
                                    @[simp]
                                    theorem EReal.coe_ennreal_one :
                                    1 = 1
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    theorem EReal.coe_nnreal_lt_top (x : NNReal) :
                                    x <
                                    @[simp]
                                    theorem EReal.coe_ennreal_le_coe_ennreal_iff {x y : ENNReal} :
                                    x y x y
                                    @[simp]
                                    theorem EReal.coe_ennreal_lt_coe_ennreal_iff {x y : ENNReal} :
                                    x < y x < y
                                    @[simp]
                                    theorem EReal.coe_ennreal_eq_coe_ennreal_iff {x y : ENNReal} :
                                    x = y x = y
                                    @[simp]
                                    theorem EReal.coe_ennreal_eq_zero {x : ENNReal} :
                                    x = 0 x = 0
                                    @[simp]
                                    theorem EReal.coe_ennreal_eq_one {x : ENNReal} :
                                    x = 1 x = 1
                                    @[simp]
                                    theorem EReal.coe_ennreal_pos {x : ENNReal} :
                                    0 < x 0 < x
                                    @[simp]
                                    @[simp]
                                    @[simp]
                                    theorem EReal.coe_ennreal_add (x y : ENNReal) :
                                    ↑(x + y) = x + y
                                    @[simp]
                                    theorem EReal.coe_ennreal_mul (x y : ENNReal) :
                                    ↑(x * y) = x * y
                                    theorem EReal.coe_ennreal_nsmul (n : ) (x : ENNReal) :
                                    ↑(n x) = n x

                                    toENNReal #

                                    noncomputable def EReal.toENNReal (x : EReal) :

                                    x.toENNReal returns x if it is nonnegative, 0 otherwise.

                                    Equations
                                      Instances For
                                        @[simp]
                                        theorem EReal.toENNReal_of_nonpos {x : EReal} (hx : x 0) :
                                        @[simp]
                                        theorem EReal.toENNReal_pos_iff {x : EReal} :
                                        0 < x.toENNReal 0 < x
                                        @[simp]
                                        theorem EReal.coe_toENNReal {x : EReal} (hx : 0 x) :
                                        x.toENNReal = x
                                        @[simp]
                                        theorem EReal.toENNReal_coe {x : ENNReal} :
                                        (↑x).toENNReal = x
                                        @[simp]
                                        theorem EReal.toReal_toENNReal {x : EReal} (hx : 0 x) :
                                        theorem EReal.toENNReal_eq_toENNReal {x y : EReal} (hx : 0 x) (hy : 0 y) :
                                        theorem EReal.toENNReal_lt_toENNReal {x y : EReal} (hx : 0 x) (hxy : x < y) :

                                        nat coercion #

                                        theorem EReal.coe_coe_eq_natCast (n : ) :
                                        n = n
                                        theorem EReal.natCast_eq_iff {m n : } :
                                        m = n m = n
                                        theorem EReal.natCast_ne_iff {m n : } :
                                        m n m n
                                        theorem EReal.natCast_le_iff {m n : } :
                                        m n m n
                                        theorem EReal.natCast_lt_iff {m n : } :
                                        m < n m < n
                                        @[simp]
                                        theorem EReal.natCast_mul (m n : ) :
                                        ↑(m * n) = m * n

                                        Miscellaneous lemmas #

                                        theorem EReal.exists_rat_btwn_of_lt {a b : EReal} :
                                        a < b∃ (x : ), a < x x < b
                                        theorem EReal.lt_iff_exists_rat_btwn {a b : EReal} :
                                        a < b ∃ (x : ), a < x x < b
                                        theorem EReal.lt_iff_exists_real_btwn {a b : EReal} :
                                        a < b ∃ (x : ), a < x x < b

                                        The set of numbers in EReal that are not equal to ±∞ is equivalent to .

                                        Equations
                                          Instances For

                                            Extension for the positivity tactic: cast from to EReal.

                                            Equations
                                              Instances For

                                                Extension for the positivity tactic: cast from ℝ≥0∞ to EReal.

                                                Equations
                                                  Instances For

                                                    Extension for the positivity tactic: projection from EReal to .

                                                    We prove that EReal.toReal x is nonnegative whenever x is nonnegative. Since EReal.toReal ⊤ = 0, we cannot prove a stronger statement, at least without relying on a tactic like finiteness.

                                                    Equations
                                                      Instances For

                                                        Extension for the positivity tactic: projection from EReal to ℝ≥0∞.

                                                        We show that EReal.toENNReal x is positive whenever x is positive, and it is nonnegative otherwise. We cannot deduce any corollaries from x ≠ 0, since EReal.toENNReal x = 0 for x < 0.

                                                        Equations
                                                          Instances For