The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V15. Real analysis in one variable

Mathlib.Analysis.SpecialFunctions.Log.Deriv

40 declarations. Mathlib docs · Source

Derivative and series expansion of real logarithm

In this file we prove that Real.log is infinitely smooth at all nonzero x : ℝ. We also prove that the series ∑' n : ℕ, x ^ (n + 1) / (n + 1) converges to (-Real.log (1 - x)) for all x : ℝ, |x| < 1.

Tags

logarithm, derivative

theorem Real.hasStrictDerivAt_log_of_pos E1 #

∀ {x : ℝ}, 0 < x → HasStrictDerivAt Real.log x⁻¹ x

theorem Real.hasStrictDerivAt_log E1 #

∀ {x : ℝ}, x ≠ 0 → HasStrictDerivAt Real.log x⁻¹ x

theorem Real.hasDerivAt_log E1 #

∀ {x : ℝ}, x ≠ 0 → HasDerivAt Real.log x⁻¹ x

theorem Real.differentiableAt_log E1 #

∀ {x : ℝ}, x ≠ 0 → DifferentiableAt ℝ Real.log x

theorem Real.differentiableOn_log E1 #

DifferentiableOn ℝ Real.log {0}ᶜ

theorem Real.differentiableAt_log_iff E0 #

∀ {x : ℝ}, DifferentiableAt ℝ Real.log x ↔ x ≠ 0

theorem Real.deriv_log E1 #

∀ (x : ℝ), deriv Real.log x = x⁻¹

theorem Real.deriv_log' E0 #

deriv Real.log = Inv.inv

theorem Real.contDiffAt_log E1 #

∀ {n : WithTop ℕ∞} {x : ℝ}, ContDiffAt ℝ n Real.log x ↔ x ≠ 0

theorem Real.contDiffOn_log E1 #

∀ {n : WithTop ℕ∞}, ContDiffOn ℝ n Real.log {0}ᶜ

theorem HasDerivWithinAt.log E1 #

∀ {f : ℝ → ℝ} {x f' : ℝ} {s : Set ℝ},
  HasDerivWithinAt f f' s x → f x ≠ 0 → HasDerivWithinAt (fun y ↦ Real.log (f y)) (f' / f x) s x

theorem HasDerivAt.log E1 #

∀ {f : ℝ → ℝ} {x f' : ℝ}, HasDerivAt f f' x → f x ≠ 0 → HasDerivAt (fun y ↦ Real.log (f y)) (f' / f x) x

theorem HasStrictDerivAt.log E1 #

∀ {f : ℝ → ℝ} {x f' : ℝ}, HasStrictDerivAt f f' x → f x ≠ 0 → HasStrictDerivAt (fun y ↦ Real.log (f y)) (f' / f x) x

theorem derivWithin.log E1 #

∀ {f : ℝ → ℝ} {x : ℝ} {s : Set ℝ},
  DifferentiableWithinAt ℝ f s x →
    f x ≠ 0 → UniqueDiffWithinAt ℝ s x → derivWithin (fun x ↦ Real.log (f x)) s x = derivWithin f s x / f x

theorem deriv.log E0 #

∀ {f : ℝ → ℝ} {x : ℝ}, DifferentiableAt ℝ f x → f x ≠ 0 → deriv (fun x ↦ Real.log (f x)) x = deriv f x / f x

theorem Real.deriv_log_comp_eq_logDeriv E1 #

∀ {f : ℝ → ℝ} {x : ℝ}, DifferentiableAt ℝ f x → f x ≠ 0 → deriv (Real.log ∘ f) x = logDeriv f x

The derivative of log ∘ f is the logarithmic derivative provided f is differentiable and f x ≠ 0.

theorem HasFDerivWithinAt.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : StrongDual ℝ E}
  {s : Set E}, HasFDerivWithinAt f f' s x → f x ≠ 0 → HasFDerivWithinAt (fun x ↦ Real.log (f x)) ((f x)⁻¹ • f') s x

theorem HasFDerivAt.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : StrongDual ℝ E},
  HasFDerivAt f f' x → f x ≠ 0 → HasFDerivAt (fun x ↦ Real.log (f x)) ((f x)⁻¹ • f') x

theorem HasStrictFDerivAt.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : StrongDual ℝ E},
  HasStrictFDerivAt f f' x → f x ≠ 0 → HasStrictFDerivAt (fun x ↦ Real.log (f x)) ((f x)⁻¹ • f') x

theorem DifferentiableWithinAt.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {s : Set E},
  DifferentiableWithinAt ℝ f s x → f x ≠ 0 → DifferentiableWithinAt ℝ (fun x ↦ Real.log (f x)) s x

theorem DifferentiableAt.log E0 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E},
  DifferentiableAt ℝ f x → f x ≠ 0 → DifferentiableAt ℝ (fun x ↦ Real.log (f x)) x

theorem ContDiffAt.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {n : WithTop ℕ∞},
  ContDiffAt ℝ n f x → f x ≠ 0 → ContDiffAt ℝ n (fun x ↦ Real.log (f x)) x

theorem ContDiffWithinAt.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {s : Set E}
  {n : WithTop ℕ∞}, ContDiffWithinAt ℝ n f s x → f x ≠ 0 → ContDiffWithinAt ℝ n (fun x ↦ Real.log (f x)) s x

theorem ContDiffOn.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E} {n : WithTop ℕ∞},
  ContDiffOn ℝ n f s → (∀ x ∈ s, f x ≠ 0) → ContDiffOn ℝ n (fun x ↦ Real.log (f x)) s

theorem ContDiff.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {n : WithTop ℕ∞},
  ContDiff ℝ n f → (∀ (x : E), f x ≠ 0) → ContDiff ℝ n fun x ↦ Real.log (f x)

theorem DifferentiableOn.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {s : Set E},
  DifferentiableOn ℝ f s → (∀ x ∈ s, f x ≠ 0) → DifferentiableOn ℝ (fun x ↦ Real.log (f x)) s

theorem Differentiable.log E0 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ},
  Differentiable ℝ f → (∀ (x : E), f x ≠ 0) → Differentiable ℝ fun x ↦ Real.log (f x)

theorem fderivWithin.log E1 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E} {s : Set E},
  DifferentiableWithinAt ℝ f s x →
    f x ≠ 0 → UniqueDiffWithinAt ℝ s x → fderivWithin ℝ (fun x ↦ Real.log (f x)) s x = (f x)⁻¹ • fderivWithin ℝ f s x

theorem fderiv.log E0 #

∀ {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : NormedSpace ℝ E] {f : E → ℝ} {x : E},
  DifferentiableAt ℝ f x → f x ≠ 0 → fderiv ℝ (fun x ↦ Real.log (f x)) x = (f x)⁻¹ • fderiv ℝ f x

theorem Real.abs_log_sub_add_sum_range_le E1 #

∀ {x : ℝ},
  |x| < 1 → ∀ (n : ℕ), |∑ i ∈ Finset.range n, x ^ (i + 1) / (↑i + 1) + Real.log (1 - x)| ≤ |x| ^ (n + 1) / (1 - |x|)

A crude lemma estimating the difference between log (1-x) and its Taylor series at 0, where the main point of the bound is that it tends to 0. The goal is to deduce the series expansion of the logarithm, in hasSum_pow_div_log_of_abs_lt_1.

TODO: use one of generic theorems about Taylor's series to prove this estimate.

theorem Real.hasDerivAt_half_log_one_add_div_one_sub_sub_sum_range E2 #

∀ {y : ℝ} (n : ℕ),
  -1 < y →
    y < 1 →
      HasDerivAt (fun x ↦ 1 / 2 * Real.log ((1 + x) / (1 - x)) - ∑ i ∈ Finset.range n, x ^ (2 * i + 1) / (2 * ↑i + 1))
        ((y ^ 2) ^ n / (1 - y ^ 2)) y

Compute the derivative of the difference between $\frac{1}{2} * \log(\frac{1+x}{1-x})$ and its Taylor series at 0 up to order n. This is an auxiliary lemma for sum_range_sub_log_div_le and sum_range_le_log_div. Note that thanks to the geometric series, the derivative has a particularly simple form, and means that it is more convenient to avoid Taylor's theorem.

theorem Real.sum_range_sub_log_div_le E2 #

∀ {x : ℝ},
  |x| < 1 →
    ∀ (n : ℕ),
      |1 / 2 * Real.log ((1 + x) / (1 - x)) - ∑ i ∈ Finset.range n, x ^ (2 * i + 1) / (2 * ↑i + 1)| ≤
        |x| ^ (2 * n + 1) / (1 - x ^ 2)

A lemma estimating the difference between $\frac{1}{2} * \log(\frac{1+x}{1-x})$ and its Taylor series at 0, where the bound tends to 0. This bound is particularly useful for explicit estimates of logarithms.

Note that thanks to the geometric series, the derivative has a particularly simple form, and means that it is more convenient to avoid Taylor's theorem for this proof.

theorem Real.sum_range_le_log_div E1 #

∀ {x : ℝ},
  0 ≤ x → x < 1 → ∀ (n : ℕ), ∑ i ∈ Finset.range n, x ^ (2 * i + 1) / (2 * ↑i + 1) ≤ 1 / 2 * Real.log ((1 + x) / (1 - x))

For 0 ≤ x < 1, the partial sums of the series expansion of $\frac{1}{2} * \log(\frac{1+x}{1-x})$ at 0 form a lower bound for it. This shows that the absolute value in sum_range_sub_log_div_le can be dropped, and gives explicit lower bounds for logarithms.

theorem Real.log_div_le_sum_range_add E1 #

∀ {x : ℝ},
  0 ≤ x →
    x < 1 →
      ∀ (n : ℕ),
        1 / 2 * Real.log ((1 + x) / (1 - x)) ≤
          ∑ i ∈ Finset.range n, x ^ (2 * i + 1) / (2 * ↑i + 1) + x ^ (2 * n + 1) / (1 - x ^ 2)

theorem Real.sum_range_le_artanh E1 #

∀ {x : ℝ}, 0 ≤ x → x < 1 → ∀ (n : ℕ), ∑ i ∈ Finset.range n, x ^ (2 * i + 1) / (2 * ↑i + 1) ≤ Real.artanh x

theorem Real.artanh_le_sum_range_add E1 #

∀ {x : ℝ},
  0 ≤ x →
    x < 1 →
      ∀ (n : ℕ), Real.artanh x ≤ ∑ i ∈ Finset.range n, x ^ (2 * i + 1) / (2 * ↑i + 1) + x ^ (2 * n + 1) / (1 - x ^ 2)

theorem Real.hasSum_pow_div_log_of_abs_lt_one E1 #

∀ {x : ℝ}, |x| < 1 → HasSum (fun n ↦ x ^ (n + 1) / (↑n + 1)) (-Real.log (1 - x))

Power series expansion of the logarithm around 1.

theorem Real.hasSum_log_sub_log_of_abs_lt_one E1 #

∀ {x : ℝ}, |x| < 1 → HasSum (fun k ↦ 2 * (1 / (2 * ↑k + 1)) * x ^ (2 * k + 1)) (Real.log (1 + x) - Real.log (1 - x))

Power series expansion of log(1 + x) - log(1 - x) for |x| < 1.

theorem Real.hasSum_log_one_add_inv E1 #

∀ {a : ℝ}, 0 < a → HasSum (fun k ↦ 2 * (1 / (2 * ↑k + 1)) * (1 / (2 * a + 1)) ^ (2 * k + 1)) (Real.log (1 + a⁻¹))

Expansion of log (1 + a⁻¹) as a series in powers of 1 / (2 * a + 1).

theorem Real.hasSum_log_one_add E1 #

∀ {a : ℝ}, 0 ≤ a → HasSum (fun k ↦ 2 * (1 / (2 * ↑k + 1)) * (a / (a + 2)) ^ (2 * k + 1)) (Real.log (1 + a))

Expansion of log (1 + a) as a series in powers of a / (a + 2).