Documentation

Mathlib.Analysis.SpecialFunctions.Log.Base

Real logarithm base b #

In this file we define Real.logb to be the logarithm of a real number in a given base b. We define this as the division of the natural logarithms of the argument and the base, so that we have a globally defined function with logb b 0 = 0, logb b (-x) = logb b x, logb 0 x = 0, and logb (-b) x = logb b x.

We prove some basic properties of this function and its relation to rpow.

Tags #

logarithm, continuity

noncomputable def Real.logb (b x : โ„) :

The real logarithm in a given base. As with the natural logarithm, we define logb b x to be logb b |x| for x < 0, and 0 for x = 0.

Instances For
    @[simp]
    theorem Real.logb_zero {b : โ„} :
    logb b 0 = 0
    @[simp]
    theorem Real.logb_one {b : โ„} :
    logb b 1 = 0
    @[simp]
    theorem Real.logb_self_eq_one {b : โ„} (hb : 1 < b) :
    logb b b = 1
    theorem Real.logb_self_eq_one_iff {b : โ„} :
    logb b b = 1 โ†” b โ‰  0 โˆง b โ‰  1 โˆง b โ‰  -1
    @[simp]
    theorem Real.logb_abs_base (b x : โ„) :
    logb |b| x = logb b x
    @[simp]
    theorem Real.logb_abs (b x : โ„) :
    logb b |x| = logb b x
    @[simp]
    theorem Real.logb_neg_eq_logb (b x : โ„) :
    logb b (-x) = logb b x
    theorem Real.logb_mul {b x y : โ„} (hx : x โ‰  0) (hy : y โ‰  0) :
    logb b (x * y) = logb b x + logb b y
    theorem Real.logb_div {b x y : โ„} (hx : x โ‰  0) (hy : y โ‰  0) :
    logb b (x / y) = logb b x - logb b y
    theorem Real.inv_logb_mul_base {a b : โ„} (hโ‚ : a โ‰  0) (hโ‚‚ : b โ‰  0) (c : โ„) :
    theorem Real.inv_logb_div_base {a b : โ„} (hโ‚ : a โ‰  0) (hโ‚‚ : b โ‰  0) (c : โ„) :
    theorem Real.logb_mul_base {a b : โ„} (hโ‚ : a โ‰  0) (hโ‚‚ : b โ‰  0) (c : โ„) :
    theorem Real.logb_div_base {a b : โ„} (hโ‚ : a โ‰  0) (hโ‚‚ : b โ‰  0) (c : โ„) :
    theorem Real.mul_logb {a b c : โ„} (hโ‚ : b โ‰  0) (hโ‚‚ : b โ‰  1) (hโ‚ƒ : b โ‰  -1) :
    logb a b * logb b c = logb a c
    theorem Real.div_logb {a b c : โ„} (hโ‚ : c โ‰  0) (hโ‚‚ : c โ‰  1) (hโ‚ƒ : c โ‰  -1) :
    logb a c / logb b c = logb a b
    theorem Real.logb_rpow_eq_mul_logb_of_pos {b x y : โ„} (hx : 0 < x) :
    logb b (x ^ y) = y * logb b x
    theorem Real.logb_pow (b x : โ„) (k : โ„•) :
    logb b (x ^ k) = โ†‘k * logb b x
    @[simp]
    theorem Real.logb_rpow {b x : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) :
    logb b (b ^ x) = x
    theorem Real.rpow_logb_eq_abs {b x : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) (hx : x โ‰  0) :
    b ^ logb b x = |x|
    @[simp]
    theorem Real.rpow_logb {b x : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) (hx : 0 < x) :
    b ^ logb b x = x
    theorem Real.rpow_logb_of_neg {b x : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) (hx : x < 0) :
    b ^ logb b x = -x
    theorem Real.logb_eq_iff_rpow_eq {b x y : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) (hy : 0 < y) :
    logb b y = x โ†” b ^ x = y
    theorem Real.surjOn_logb {b : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) :
    theorem Real.logb_surjective {b : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) :
    Function.Surjective (logb b)
    @[simp]
    theorem Real.range_logb {b : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) :
    theorem Real.surjOn_logb' {b : โ„} (b_pos : 0 < b) (b_ne_one : b โ‰  1) :
    @[simp]
    theorem Real.logb_le_logb {b x y : โ„} (hb : 1 < b) (h : 0 < x) (hโ‚ : 0 < y) :
    logb b x โ‰ค logb b y โ†” x โ‰ค y
    theorem Real.logb_le_logb_of_le {b x y : โ„} (hb : 1 < b) (h : 0 < x) (hxy : x โ‰ค y) :
    theorem Real.logb_lt_logb {b x y : โ„} (hb : 1 < b) (hx : 0 < x) (hxy : x < y) :
    logb b x < logb b y
    @[simp]
    theorem Real.logb_lt_logb_iff {b x y : โ„} (hb : 1 < b) (hx : 0 < x) (hy : 0 < y) :
    logb b x < logb b y โ†” x < y
    theorem Real.logb_le_iff_le_rpow {b x y : โ„} (hb : 1 < b) (hx : 0 < x) :
    logb b x โ‰ค y โ†” x โ‰ค b ^ y
    theorem Real.logb_lt_iff_lt_rpow {b x y : โ„} (hb : 1 < b) (hx : 0 < x) :
    logb b x < y โ†” x < b ^ y
    theorem Real.le_logb_iff_rpow_le {b x y : โ„} (hb : 1 < b) (hy : 0 < y) :
    x โ‰ค logb b y โ†” b ^ x โ‰ค y
    theorem Real.lt_logb_iff_rpow_lt {b x y : โ„} (hb : 1 < b) (hy : 0 < y) :
    x < logb b y โ†” b ^ x < y
    theorem Real.logb_pos_iff {b x : โ„} (hb : 1 < b) (hx : 0 < x) :
    0 < logb b x โ†” 1 < x
    theorem Real.logb_pos {b x : โ„} (hb : 1 < b) (hx : 1 < x) :
    0 < logb b x
    theorem Real.logb_neg_iff {b x : โ„} (hb : 1 < b) (h : 0 < x) :
    logb b x < 0 โ†” x < 1
    theorem Real.logb_neg {b x : โ„} (hb : 1 < b) (h0 : 0 < x) (h1 : x < 1) :
    logb b x < 0
    theorem Real.logb_nonneg_iff {b x : โ„} (hb : 1 < b) (hx : 0 < x) :
    0 โ‰ค logb b x โ†” 1 โ‰ค x
    theorem Real.logb_nonneg {b x : โ„} (hb : 1 < b) (hx : 1 โ‰ค x) :
    theorem Real.logb_nonpos_iff {b x : โ„} (hb : 1 < b) (hx : 0 < x) :
    logb b x โ‰ค 0 โ†” x โ‰ค 1
    theorem Real.logb_nonpos_iff' {b x : โ„} (hb : 1 < b) (hx : 0 โ‰ค x) :
    logb b x โ‰ค 0 โ†” x โ‰ค 1
    theorem Real.logb_nonpos {b x : โ„} (hb : 1 < b) (hx : 0 โ‰ค x) (h'x : x โ‰ค 1) :
    theorem Real.eq_one_of_pos_of_logb_eq_zero {b x : โ„} (hb : 1 < b) (hโ‚ : 0 < x) (hโ‚‚ : logb b x = 0) :
    x = 1
    theorem Real.logb_ne_zero_of_pos_of_ne_one {b x : โ„} (hb : 1 < b) (hx_pos : 0 < x) (hx : x โ‰  1) :
    logb b x โ‰  0
    @[simp]
    theorem Real.logb_le_logb_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (h : 0 < x) (hโ‚ : 0 < y) :
    logb b x โ‰ค logb b y โ†” y โ‰ค x
    theorem Real.logb_lt_logb_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) (hxy : x < y) :
    logb b y < logb b x
    @[simp]
    theorem Real.logb_lt_logb_iff_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) (hy : 0 < y) :
    logb b x < logb b y โ†” y < x
    theorem Real.logb_le_iff_le_rpow_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) :
    logb b x โ‰ค y โ†” b ^ y โ‰ค x
    theorem Real.logb_lt_iff_lt_rpow_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) :
    logb b x < y โ†” b ^ y < x
    theorem Real.le_logb_iff_rpow_le_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hy : 0 < y) :
    x โ‰ค logb b y โ†” y โ‰ค b ^ x
    theorem Real.lt_logb_iff_rpow_lt_of_base_lt_one {b x y : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hy : 0 < y) :
    x < logb b y โ†” y < b ^ x
    theorem Real.logb_pos_iff_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) :
    0 < logb b x โ†” x < 1
    theorem Real.logb_pos_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) (hx' : x < 1) :
    0 < logb b x
    theorem Real.logb_neg_iff_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (h : 0 < x) :
    logb b x < 0 โ†” 1 < x
    theorem Real.logb_neg_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (h1 : 1 < x) :
    logb b x < 0
    theorem Real.logb_nonneg_iff_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) :
    0 โ‰ค logb b x โ†” x โ‰ค 1
    theorem Real.logb_nonneg_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) (hx' : x โ‰ค 1) :
    theorem Real.logb_nonpos_iff_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx : 0 < x) :
    logb b x โ‰ค 0 โ†” 1 โ‰ค x
    theorem Real.strictAntiOn_logb_of_base_lt_one {b : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) :
    theorem Real.strictMonoOn_logb_of_base_lt_one {b : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) :
    theorem Real.logb_injOn_pos_of_base_lt_one {b : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) :
    theorem Real.eq_one_of_pos_of_logb_eq_zero_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hโ‚ : 0 < x) (hโ‚‚ : logb b x = 0) :
    x = 1
    theorem Real.logb_ne_zero_of_pos_of_ne_one_of_base_lt_one {b x : โ„} (b_pos : 0 < b) (b_lt_one : b < 1) (hx_pos : 0 < x) (hx : x โ‰  1) :
    logb b x โ‰  0
    theorem Real.floor_logb_natCast {b : โ„•} {r : โ„} (hr : 0 โ‰ค r) :
    โŒŠlogb (โ†‘b) rโŒ‹ = Int.log b r
    theorem Real.ceil_logb_natCast {b : โ„•} {r : โ„} (hr : 0 โ‰ค r) :
    โŒˆlogb (โ†‘b) rโŒ‰ = Int.clog b r
    theorem Real.natLog_le_logb (a b : โ„•) :
    โ†‘(Nat.log b a) โ‰ค logb โ†‘b โ†‘a
    theorem Real.log2_le_logb (n : โ„•) :
    โ†‘n.log2 โ‰ค logb 2 โ†‘n
    @[simp]
    theorem Real.logb_eq_zero {b x : โ„} :
    logb b x = 0 โ†” b = 0 โˆจ b = 1 โˆจ b = -1 โˆจ x = 0 โˆจ x = 1 โˆจ x = -1
    theorem Real.tendsto_abs_logb_atTop {b : โ„} (hb : b โ‰  -1 โˆง b โ‰  0 โˆง b โ‰  1) :

    The function |logb b x| tends to +โˆž as x tendsto +โˆž. See also tendsto_logb_atTop and tendsto_logb_atTop_of_base_lt_one.

    theorem Real.continuous_logb {b : โ„} :
    Continuous fun (x : { x : โ„ // x โ‰  0 }) => logb b โ†‘x

    The real logarithm base b is continuous as a function from nonzero reals.

    theorem Real.continuous_logb' {b : โ„} :
    Continuous fun (x : { x : โ„ // 0 < x }) => logb b โ†‘x

    The real logarithm base b is continuous as a function from positive reals.

    theorem Real.continuousAt_logb {b x : โ„} (hx : x โ‰  0) :
    @[simp]
    theorem Real.continuousAt_logb_iff {b x : โ„} (hbโ‚€ : 0 < b) (hb : b โ‰  1) :
    ContinuousAt (logb b) x โ†” x โ‰  0
    theorem Real.logb_prod {b : โ„} {ฮฑ : Type u_1} (s : Finset ฮฑ) (f : ฮฑ โ†’ โ„) (hf : โˆ€ x โˆˆ s, f x โ‰  0) :
    logb b (โˆ i โˆˆ s, f i) = โˆ‘ i โˆˆ s, logb b (f i)
    theorem Finsupp.logb_prod {b : โ„} {ฮฑ : Type u_1} {ฮฒ : Type u_2} [Zero ฮฒ] (f : ฮฑ โ†’โ‚€ ฮฒ) (g : ฮฑ โ†’ ฮฒ โ†’ โ„) (hg : โˆ€ (a : ฮฑ), g a (f a) = 0 โ†’ f a = 0) :
    Real.logb b (f.prod g) = f.sum fun (a : ฮฑ) (c : ฮฒ) => Real.logb b (g a c)
    theorem Real.logb_nat_eq_sum_factorization {b : โ„} (n : โ„•) :
    logb b โ†‘n = n.factorization.sum fun (p t : โ„•) => โ†‘t * logb b โ†‘p
    theorem Real.tendsto_pow_logb_div_mul_add_atTop {b : โ„} (a c : โ„) (n : โ„•) (ha : a โ‰  0) :
    Filter.Tendsto (fun (x : โ„) => logb b x ^ n / (a * x + c)) Filter.atTop (nhds 0)
    theorem Real.isLittleO_pow_logb_id_atTop {b : โ„} {n : โ„•} :
    (fun (x : โ„) => logb b x ^ n) =o[Filter.atTop] id
    theorem Real.isLittleO_const_logb_atTop {b c : โ„} (hb : b โ‰  -1 โˆง b โ‰  0 โˆง b โ‰  1) :
    (fun (x : โ„) => c) =o[Filter.atTop] logb b
    theorem Filter.Tendsto.logb {ฮฑ : Type u_1} {b : โ„} {f : ฮฑ โ†’ โ„} {l : Filter ฮฑ} {x : โ„} (h : Tendsto f l (nhds x)) (hx : x โ‰  0) :
    Tendsto (fun (y : ฮฑ) => Real.logb b (f y)) l (nhds (Real.logb b x))
    theorem Continuous.logb {ฮฑ : Type u_1} {b : โ„} [TopologicalSpace ฮฑ] {f : ฮฑ โ†’ โ„} (hf : Continuous f) (hโ‚€ : โˆ€ (x : ฮฑ), f x โ‰  0) :
    Continuous fun (x : ฮฑ) => Real.logb b (f x)
    theorem ContinuousAt.logb {ฮฑ : Type u_1} {b : โ„} [TopologicalSpace ฮฑ] {f : ฮฑ โ†’ โ„} {a : ฮฑ} (hf : ContinuousAt f a) (hโ‚€ : f a โ‰  0) :
    ContinuousAt (fun (x : ฮฑ) => Real.logb b (f x)) a
    theorem ContinuousWithinAt.logb {ฮฑ : Type u_1} {b : โ„} [TopologicalSpace ฮฑ] {f : ฮฑ โ†’ โ„} {s : Set ฮฑ} {a : ฮฑ} (hf : ContinuousWithinAt f s a) (hโ‚€ : f a โ‰  0) :
    ContinuousWithinAt (fun (x : ฮฑ) => Real.logb b (f x)) s a
    theorem ContinuousOn.logb {ฮฑ : Type u_1} {b : โ„} [TopologicalSpace ฮฑ] {f : ฮฑ โ†’ โ„} {s : Set ฮฑ} (hf : ContinuousOn f s) (hโ‚€ : โˆ€ x โˆˆ s, f x โ‰  0) :
    ContinuousOn (fun (x : ฮฑ) => Real.logb b (f x)) s
    theorem Real.tendsto_logb_nat_add_one_sub_logb {b : โ„} :
    Filter.Tendsto (fun (k : โ„•) => logb b (โ†‘k + 1) - logb b โ†‘k) Filter.atTop (nhds 0)
    theorem Real.induction_Ico_mul {P : โ„ โ†’ Prop} (xโ‚€ r : โ„) (hr : 1 < r) (hxโ‚€ : 0 < xโ‚€) (base : โˆ€ x โˆˆ Set.Ico xโ‚€ (r * xโ‚€), P x) (step : โˆ€ n โ‰ฅ 1, (โˆ€ z โˆˆ Set.Ico xโ‚€ (r ^ n * xโ‚€), P z) โ†’ โˆ€ z โˆˆ Set.Ico (r ^ n * xโ‚€) (r ^ (n + 1) * xโ‚€), P z) (x : โ„) :
    x โ‰ฅ xโ‚€ โ†’ P x

    Induction principle for intervals of real numbers: if a proposition P is true on [xโ‚€, r * xโ‚€) and if P for [xโ‚€, r^n * xโ‚€) implies P for [r^n * xโ‚€, r^(n+1) * xโ‚€), then P is true for all x โ‰ฅ xโ‚€.