analysis.special_functions.log.deriv
⟷
Mathlib.Analysis.SpecialFunctions.Log.Deriv
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -306,7 +306,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
have : ∑ i in range n, (↑i + 1) * y ^ i / (↑i + 1) = ∑ i in range n, y ^ i :=
by
congr with i
- exact mul_div_cancel_left _ (Nat.cast_add_one_pos i).ne'
+ exact mul_div_cancel_left₀ _ (Nat.cast_add_one_pos i).ne'
field_simp [F, this, geom_sum_eq (ne_of_lt hy.2), sub_ne_zero_of_ne (ne_of_gt hy.2),
sub_ne_zero_of_ne (ne_of_lt hy.2)]
ring
@@ -335,7 +335,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
· simp
· simp [le_abs_self x, neg_le.mp (neg_le_abs x)]
-- fourth step: conclude by massaging the inequality of the third step
- simpa [F, norm_eq_abs, div_mul_eq_mul_div, pow_succ'] using C
+ simpa [F, norm_eq_abs, div_mul_eq_mul_div, pow_succ] using C
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
-/
@@ -351,7 +351,7 @@ theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
refine' squeeze_zero (fun n => abs_nonneg _) (abs_log_sub_add_sum_range_le h) _
suffices tendsto (fun t : ℕ => |x| ^ (t + 1) / (1 - |x|)) at_top (𝓝 (|x| * 0 / (1 - |x|))) by
simpa
- simp only [pow_succ]
+ simp only [pow_succ']
refine' (tendsto_const_nhds.mul _).div_const _
exact tendsto_pow_atTop_nhds_zero_of_lt_one (abs_nonneg _) h
show Summable fun n : ℕ => x ^ (n + 1) / (n + 1)
@@ -367,7 +367,7 @@ theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
i.cast_nonneg]
norm_num
_ ≤ |x| ^ i := by
- simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
+ simpa [pow_succ] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_one
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -41,7 +41,7 @@ theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x
(hasStrictDerivAt_exp <| log x).of_local_left_inverse (continuousAt_log hx.ne')
(ne_of_gt <| exp_pos _) <|
Eventually.mono (lt_mem_nhds hx) @exp_log
- rwa [exp_log hx] at this
+ rwa [exp_log hx] at this
#align real.has_strict_deriv_at_log_of_pos Real.hasStrictDerivAt_log_of_pos
-/
@@ -363,7 +363,8 @@ theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
rw [norm_eq_abs, abs_div, ← pow_abs, abs_of_nonneg this]
_ ≤ |x| ^ (i + 1) / (0 + 1) :=
by
- apply_rules [div_le_div_of_le_left, pow_nonneg, abs_nonneg, add_le_add_right, i.cast_nonneg]
+ apply_rules [div_le_div_of_nonneg_left, pow_nonneg, abs_nonneg, add_le_add_right,
+ i.cast_nonneg]
norm_num
_ ≤ |x| ^ i := by
simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
@@ -389,7 +390,7 @@ theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
convert h₁.add (has_sum_pow_div_log_of_abs_lt_1 h)
ring_nf
· intro m hm
- rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
+ rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
dsimp [term]
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_one
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -339,9 +339,9 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
-/
-#print Real.hasSum_pow_div_log_of_abs_lt_1 /-
+#print Real.hasSum_pow_div_log_of_abs_lt_one /-
/-- Power series expansion of the logarithm around `1`. -/
-theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
+theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
HasSum (fun n : ℕ => x ^ (n + 1) / (n + 1)) (-log (1 - x)) :=
by
rw [Summable.hasSum_iff_tendsto_nat]
@@ -353,9 +353,9 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
simpa
simp only [pow_succ]
refine' (tendsto_const_nhds.mul _).div_const _
- exact tendsto_pow_atTop_nhds_0_of_lt_1 (abs_nonneg _) h
+ exact tendsto_pow_atTop_nhds_zero_of_lt_one (abs_nonneg _) h
show Summable fun n : ℕ => x ^ (n + 1) / (n + 1)
- · refine' Summable.of_norm_bounded _ (summable_geometric_of_lt_1 (abs_nonneg _) h) fun i => _
+ · refine' Summable.of_norm_bounded _ (summable_geometric_of_lt_one (abs_nonneg _) h) fun i => _
calc
‖x ^ (i + 1) / (i + 1)‖ = |x| ^ (i + 1) / (i + 1) :=
by
@@ -367,12 +367,12 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
norm_num
_ ≤ |x| ^ i := by
simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
-#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_1
+#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_one
-/
-#print Real.hasSum_log_sub_log_of_abs_lt_1 /-
+#print Real.hasSum_log_sub_log_of_abs_lt_one /-
/-- Power series expansion of `log(1 + x) - log(1 - x)` for `|x| < 1`. -/
-theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
+theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * x ^ (2 * k + 1))
(log (1 + x) - log (1 - x)) :=
by
@@ -392,7 +392,7 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
dsimp [term]
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
-#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_1
+#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_one
-/
#print Real.hasSum_log_one_add_inv /-
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -333,7 +333,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
simp [F, this]
apply Convex.norm_image_sub_le_of_norm_deriv_le this B (convex_Icc _ _) _ _
· simp
- · simp [le_abs_self x, neg_le.mp (neg_le_abs_self x)]
+ · simp [le_abs_self x, neg_le.mp (neg_le_abs x)]
-- fourth step: conclude by massaging the inequality of the third step
simpa [F, norm_eq_abs, div_mul_eq_mul_div, pow_succ'] using C
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -322,7 +322,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
have : 0 < 1 - |x| := by linarith
have : 1 - |x| ≤ |1 - y| := le_trans (by linarith [hy.2]) (le_abs_self _)
simp only [← pow_abs, abs_div, abs_neg]
- apply_rules [div_le_div, pow_nonneg, abs_nonneg, pow_le_pow_of_le_left]
+ apply_rules [div_le_div, pow_nonneg, abs_nonneg, pow_le_pow_left]
-- third step: apply the mean value inequality
have C : ‖F x - F 0‖ ≤ |x| ^ n / (1 - |x|) * ‖x - 0‖ :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -102,7 +102,7 @@ theorem deriv_log' : deriv log = Inv.inv :=
theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log ({0}ᶜ) :=
by
suffices : ContDiffOn ℝ ⊤ log ({0}ᶜ); exact this.of_le le_top
- refine' (contDiffOn_top_iff_deriv_of_open isOpen_compl_singleton).2 _
+ refine' (contDiffOn_top_iff_deriv_of_isOpen isOpen_compl_singleton).2 _
simp [differentiable_on_log, contDiffOn_inv]
#align real.cont_diff_on_log Real.contDiffOn_log
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -355,7 +355,7 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
refine' (tendsto_const_nhds.mul _).div_const _
exact tendsto_pow_atTop_nhds_0_of_lt_1 (abs_nonneg _) h
show Summable fun n : ℕ => x ^ (n + 1) / (n + 1)
- · refine' summable_of_norm_bounded _ (summable_geometric_of_lt_1 (abs_nonneg _) h) fun i => _
+ · refine' Summable.of_norm_bounded _ (summable_geometric_of_lt_1 (abs_nonneg _) h) fun i => _
calc
‖x ^ (i + 1) / (i + 1)‖ = |x| ^ (i + 1) / (i + 1) :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
-/
-import Mathbin.Analysis.Calculus.Deriv.Pow
-import Mathbin.Analysis.Calculus.Deriv.Inv
-import Mathbin.Analysis.SpecialFunctions.Log.Basic
-import Mathbin.Analysis.SpecialFunctions.ExpDeriv
+import Analysis.Calculus.Deriv.Pow
+import Analysis.Calculus.Deriv.Inv
+import Analysis.SpecialFunctions.Log.Basic
+import Analysis.SpecialFunctions.ExpDeriv
#align_import analysis.special_functions.log.deriv from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
mathlib commit https://github.com/leanprover-community/mathlib/commit/442a83d738cb208d3600056c489be16900ba701d
@@ -346,7 +346,7 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
by
rw [Summable.hasSum_iff_tendsto_nat]
show tendsto (fun n : ℕ => ∑ i : ℕ in range n, x ^ (i + 1) / (i + 1)) at_top (𝓝 (-log (1 - x)))
- · rw [tendsto_iff_norm_tendsto_zero]
+ · rw [tendsto_iff_norm_sub_tendsto_zero]
simp only [norm_eq_abs, sub_neg_eq_add]
refine' squeeze_zero (fun n => abs_nonneg _) (abs_log_sub_add_sum_range_le h) _
suffices tendsto (fun t : ℕ => |x| ^ (t + 1) / (1 - |x|)) at_top (𝓝 (|x| * 0 / (1 - |x|))) by
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -385,7 +385,7 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
push_cast
ring_nf
rw [← h_term_eq_goal, (mul_right_injective₀ (two_ne_zero' ℕ)).hasSum_iff]
- · have h₁ := (has_sum_pow_div_log_of_abs_lt_1 (Eq.trans_lt (abs_neg x) h)).mul_left (-1)
+ · have h₁ := (has_sum_pow_div_log_of_abs_lt_1 (Eq.trans_lt (abs_neg x) h)).hMul_left (-1)
convert h₁.add (has_sum_pow_div_log_of_abs_lt_1 h)
ring_nf
· intro m hm
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
-
-! This file was ported from Lean 3 source module analysis.special_functions.log.deriv
-! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Analysis.Calculus.Deriv.Pow
import Mathbin.Analysis.Calculus.Deriv.Inv
import Mathbin.Analysis.SpecialFunctions.Log.Basic
import Mathbin.Analysis.SpecialFunctions.ExpDeriv
+#align_import analysis.special_functions.log.deriv from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
+
/-!
# Derivative and series expansion of real logarithm
mathlib commit https://github.com/leanprover-community/mathlib/commit/9240e8be927a0955b9a82c6c85ef499ee3a626b8
@@ -314,7 +314,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
sub_ne_zero_of_ne (ne_of_lt hy.2)]
ring
-- second step: show that the derivative of `F` is small
- have B : ∀ y ∈ Icc (-|x|) (|x|), |deriv F y| ≤ |x| ^ n / (1 - |x|) :=
+ have B : ∀ y ∈ Icc (-|x|) |x|, |deriv F y| ≤ |x| ^ n / (1 - |x|) :=
by
intro y hy
have : y ∈ Ioo (-(1 : ℝ)) 1 := ⟨lt_of_lt_of_le (neg_lt_neg h) hy.1, lt_of_le_of_lt hy.2 h⟩
@@ -329,7 +329,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
-- third step: apply the mean value inequality
have C : ‖F x - F 0‖ ≤ |x| ^ n / (1 - |x|) * ‖x - 0‖ :=
by
- have : ∀ y ∈ Icc (-|x|) (|x|), DifferentiableAt ℝ F y :=
+ have : ∀ y ∈ Icc (-|x|) |x|, DifferentiableAt ℝ F y :=
by
intro y hy
have : 1 - y ≠ 0 := sub_ne_zero_of_ne (ne_of_gt (lt_of_le_of_lt hy.2 h))
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -37,6 +37,7 @@ namespace Real
variable {x : ℝ}
+#print Real.hasStrictDerivAt_log_of_pos /-
theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x :=
by
have : HasStrictDerivAt log (exp <| log x)⁻¹ x :=
@@ -45,7 +46,9 @@ theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x
Eventually.mono (lt_mem_nhds hx) @exp_log
rwa [exp_log hx] at this
#align real.has_strict_deriv_at_log_of_pos Real.hasStrictDerivAt_log_of_pos
+-/
+#print Real.hasStrictDerivAt_log /-
theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x :=
by
cases' hx.lt_or_lt with hx hx
@@ -54,24 +57,34 @@ theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x :=
· field_simp [hx.ne]
· exact has_strict_deriv_at_log_of_pos hx
#align real.has_strict_deriv_at_log Real.hasStrictDerivAt_log
+-/
+#print Real.hasDerivAt_log /-
theorem hasDerivAt_log (hx : x ≠ 0) : HasDerivAt log x⁻¹ x :=
(hasStrictDerivAt_log hx).HasDerivAt
#align real.has_deriv_at_log Real.hasDerivAt_log
+-/
+#print Real.differentiableAt_log /-
theorem differentiableAt_log (hx : x ≠ 0) : DifferentiableAt ℝ log x :=
(hasDerivAt_log hx).DifferentiableAt
#align real.differentiable_at_log Real.differentiableAt_log
+-/
+#print Real.differentiableOn_log /-
theorem differentiableOn_log : DifferentiableOn ℝ log ({0}ᶜ) := fun x hx =>
(differentiableAt_log hx).DifferentiableWithinAt
#align real.differentiable_on_log Real.differentiableOn_log
+-/
+#print Real.differentiableAt_log_iff /-
@[simp]
theorem differentiableAt_log_iff : DifferentiableAt ℝ log x ↔ x ≠ 0 :=
⟨fun h => continuousAt_log_iff.1 h.ContinuousAt, differentiableAt_log⟩
#align real.differentiable_at_log_iff Real.differentiableAt_log_iff
+-/
+#print Real.deriv_log /-
theorem deriv_log (x : ℝ) : deriv log x = x⁻¹ :=
if hx : x = 0 then by
rw [deriv_zero_of_not_differentiableAt
@@ -79,23 +92,30 @@ theorem deriv_log (x : ℝ) : deriv log x = x⁻¹ :=
hx, inv_zero]
else (hasDerivAt_log hx).deriv
#align real.deriv_log Real.deriv_log
+-/
+#print Real.deriv_log' /-
@[simp]
theorem deriv_log' : deriv log = Inv.inv :=
funext deriv_log
#align real.deriv_log' Real.deriv_log'
+-/
+#print Real.contDiffOn_log /-
theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log ({0}ᶜ) :=
by
suffices : ContDiffOn ℝ ⊤ log ({0}ᶜ); exact this.of_le le_top
refine' (contDiffOn_top_iff_deriv_of_open isOpen_compl_singleton).2 _
simp [differentiable_on_log, contDiffOn_inv]
#align real.cont_diff_on_log Real.contDiffOn_log
+-/
+#print Real.contDiffAt_log /-
theorem contDiffAt_log {n : ℕ∞} : ContDiffAt ℝ n log x ↔ x ≠ 0 :=
⟨fun h => continuousAt_log_iff.1 h.ContinuousAt, fun hx =>
(contDiffOn_log x hx).ContDiffAt <| IsOpen.mem_nhds isOpen_compl_singleton hx⟩
#align real.cont_diff_at_log Real.contDiffAt_log
+-/
end Real
@@ -107,38 +127,48 @@ section deriv
variable {f : ℝ → ℝ} {x f' : ℝ} {s : Set ℝ}
+#print HasDerivWithinAt.log /-
theorem HasDerivWithinAt.log (hf : HasDerivWithinAt f f' s x) (hx : f x ≠ 0) :
HasDerivWithinAt (fun y => log (f y)) (f' / f x) s x :=
by
rw [div_eq_inv_mul]
exact (has_deriv_at_log hx).comp_hasDerivWithinAt x hf
#align has_deriv_within_at.log HasDerivWithinAt.log
+-/
+#print HasDerivAt.log /-
theorem HasDerivAt.log (hf : HasDerivAt f f' x) (hx : f x ≠ 0) :
HasDerivAt (fun y => log (f y)) (f' / f x) x :=
by
rw [← hasDerivWithinAt_univ] at *
exact hf.log hx
#align has_deriv_at.log HasDerivAt.log
+-/
+#print HasStrictDerivAt.log /-
theorem HasStrictDerivAt.log (hf : HasStrictDerivAt f f' x) (hx : f x ≠ 0) :
HasStrictDerivAt (fun y => log (f y)) (f' / f x) x :=
by
rw [div_eq_inv_mul]
exact (has_strict_deriv_at_log hx).comp x hf
#align has_strict_deriv_at.log HasStrictDerivAt.log
+-/
+#print derivWithin.log /-
theorem derivWithin.log (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0)
(hxs : UniqueDiffWithinAt ℝ s x) :
derivWithin (fun x => log (f x)) s x = derivWithin f s x / f x :=
(hf.HasDerivWithinAt.log hx).derivWithin hxs
#align deriv_within.log derivWithin.log
+-/
+#print deriv.log /-
@[simp]
theorem deriv.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
deriv (fun x => log (f x)) x = deriv f x / f x :=
(hf.HasDerivAt.log hx).deriv
#align deriv.log deriv.log
+-/
end deriv
@@ -147,71 +177,97 @@ section fderiv
variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : E →L[ℝ] ℝ}
{s : Set E}
+#print HasFDerivWithinAt.log /-
theorem HasFDerivWithinAt.log (hf : HasFDerivWithinAt f f' s x) (hx : f x ≠ 0) :
HasFDerivWithinAt (fun x => log (f x)) ((f x)⁻¹ • f') s x :=
(hasDerivAt_log hx).comp_hasFDerivWithinAt x hf
#align has_fderiv_within_at.log HasFDerivWithinAt.log
+-/
+#print HasFDerivAt.log /-
theorem HasFDerivAt.log (hf : HasFDerivAt f f' x) (hx : f x ≠ 0) :
HasFDerivAt (fun x => log (f x)) ((f x)⁻¹ • f') x :=
(hasDerivAt_log hx).comp_hasFDerivAt x hf
#align has_fderiv_at.log HasFDerivAt.log
+-/
+#print HasStrictFDerivAt.log /-
theorem HasStrictFDerivAt.log (hf : HasStrictFDerivAt f f' x) (hx : f x ≠ 0) :
HasStrictFDerivAt (fun x => log (f x)) ((f x)⁻¹ • f') x :=
(hasStrictDerivAt_log hx).comp_hasStrictFDerivAt x hf
#align has_strict_fderiv_at.log HasStrictFDerivAt.log
+-/
+#print DifferentiableWithinAt.log /-
theorem DifferentiableWithinAt.log (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0) :
DifferentiableWithinAt ℝ (fun x => log (f x)) s x :=
(hf.HasFDerivWithinAt.log hx).DifferentiableWithinAt
#align differentiable_within_at.log DifferentiableWithinAt.log
+-/
+#print DifferentiableAt.log /-
@[simp]
theorem DifferentiableAt.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
DifferentiableAt ℝ (fun x => log (f x)) x :=
(hf.HasFDerivAt.log hx).DifferentiableAt
#align differentiable_at.log DifferentiableAt.log
+-/
+#print ContDiffAt.log /-
theorem ContDiffAt.log {n} (hf : ContDiffAt ℝ n f x) (hx : f x ≠ 0) :
ContDiffAt ℝ n (fun x => log (f x)) x :=
(contDiffAt_log.2 hx).comp x hf
#align cont_diff_at.log ContDiffAt.log
+-/
+#print ContDiffWithinAt.log /-
theorem ContDiffWithinAt.log {n} (hf : ContDiffWithinAt ℝ n f s x) (hx : f x ≠ 0) :
ContDiffWithinAt ℝ n (fun x => log (f x)) s x :=
(contDiffAt_log.2 hx).comp_contDiffWithinAt x hf
#align cont_diff_within_at.log ContDiffWithinAt.log
+-/
+#print ContDiffOn.log /-
theorem ContDiffOn.log {n} (hf : ContDiffOn ℝ n f s) (hs : ∀ x ∈ s, f x ≠ 0) :
ContDiffOn ℝ n (fun x => log (f x)) s := fun x hx => (hf x hx).log (hs x hx)
#align cont_diff_on.log ContDiffOn.log
+-/
+#print ContDiff.log /-
theorem ContDiff.log {n} (hf : ContDiff ℝ n f) (h : ∀ x, f x ≠ 0) :
ContDiff ℝ n fun x => log (f x) :=
contDiff_iff_contDiffAt.2 fun x => hf.ContDiffAt.log (h x)
#align cont_diff.log ContDiff.log
+-/
+#print DifferentiableOn.log /-
theorem DifferentiableOn.log (hf : DifferentiableOn ℝ f s) (hx : ∀ x ∈ s, f x ≠ 0) :
DifferentiableOn ℝ (fun x => log (f x)) s := fun x h => (hf x h).log (hx x h)
#align differentiable_on.log DifferentiableOn.log
+-/
+#print Differentiable.log /-
@[simp]
theorem Differentiable.log (hf : Differentiable ℝ f) (hx : ∀ x, f x ≠ 0) :
Differentiable ℝ fun x => log (f x) := fun x => (hf x).log (hx x)
#align differentiable.log Differentiable.log
+-/
+#print fderivWithin.log /-
theorem fderivWithin.log (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0)
(hxs : UniqueDiffWithinAt ℝ s x) :
fderivWithin ℝ (fun x => log (f x)) s x = (f x)⁻¹ • fderivWithin ℝ f s x :=
(hf.HasFDerivWithinAt.log hx).fderivWithin hxs
#align fderiv_within.log fderivWithin.log
+-/
+#print fderiv.log /-
@[simp]
theorem fderiv.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
fderiv ℝ (fun x => log (f x)) x = (f x)⁻¹ • fderiv ℝ f x :=
(hf.HasFDerivAt.log hx).fderiv
#align fderiv.log fderiv.log
+-/
end fderiv
@@ -219,6 +275,7 @@ end LogDifferentiable
namespace Real
+#print Real.tendsto_mul_log_one_plus_div_atTop /-
/-- The function `x * log (1 + t / x)` tends to `t` at `+∞`. -/
theorem tendsto_mul_log_one_plus_div_atTop (t : ℝ) :
Tendsto (fun x => x * log (1 + t / x)) atTop (𝓝 t) :=
@@ -230,9 +287,11 @@ theorem tendsto_mul_log_one_plus_div_atTop (t : ℝ) :
tendsto_inv_at_top_zero'.mono_right (nhdsWithin_mono _ fun x hx => (set.mem_Ioi.mp hx).ne')
simpa only [(· ∘ ·), inv_inv] using h₁.comp h₂
#align real.tendsto_mul_log_one_plus_div_at_top Real.tendsto_mul_log_one_plus_div_atTop
+-/
open scoped BigOperators
+#print Real.abs_log_sub_add_sum_range_le /-
/-- 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 `has_sum_pow_div_log_of_abs_lt_1`.
@@ -281,7 +340,9 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
-- fourth step: conclude by massaging the inequality of the third step
simpa [F, norm_eq_abs, div_mul_eq_mul_div, pow_succ'] using C
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
+-/
+#print Real.hasSum_pow_div_log_of_abs_lt_1 /-
/-- Power series expansion of the logarithm around `1`. -/
theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
HasSum (fun n : ℕ => x ^ (n + 1) / (n + 1)) (-log (1 - x)) :=
@@ -310,7 +371,9 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
_ ≤ |x| ^ i := by
simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_1
+-/
+#print Real.hasSum_log_sub_log_of_abs_lt_1 /-
/-- Power series expansion of `log(1 + x) - log(1 - x)` for `|x| < 1`. -/
theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * x ^ (2 * k + 1))
@@ -333,7 +396,9 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
dsimp [term]
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_1
+-/
+#print Real.hasSum_log_one_add_inv /-
/-- Expansion of `log (1 + a⁻¹)` as a series in powers of `1 / (2 * a + 1)`. -/
theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * (1 / (2 * a + 1)) ^ (2 * k + 1))
@@ -355,6 +420,7 @@ theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
linarith
· field_simp
#align real.has_sum_log_one_add_inv Real.hasSum_log_one_add_inv
+-/
end Real
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -238,16 +238,16 @@ where the main point of the bound is that it tends to `0`. The goal is to deduce
expansion of the logarithm, in `has_sum_pow_div_log_of_abs_lt_1`.
-/
theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
- |(∑ i in range n, x ^ (i + 1) / (i + 1)) + log (1 - x)| ≤ |x| ^ (n + 1) / (1 - |x|) :=
+ |∑ i in range n, x ^ (i + 1) / (i + 1) + log (1 - x)| ≤ |x| ^ (n + 1) / (1 - |x|) :=
by
/- For the proof, we show that the derivative of the function to be estimated is small,
and then apply the mean value inequality. -/
- let F : ℝ → ℝ := fun x => (∑ i in range n, x ^ (i + 1) / (i + 1)) + log (1 - x)
+ let F : ℝ → ℝ := fun x => ∑ i in range n, x ^ (i + 1) / (i + 1) + log (1 - x)
-- First step: compute the derivative of `F`
have A : ∀ y ∈ Ioo (-1 : ℝ) 1, deriv F y = -y ^ n / (1 - y) :=
by
intro y hy
- have : (∑ i in range n, (↑i + 1) * y ^ i / (↑i + 1)) = ∑ i in range n, y ^ i :=
+ have : ∑ i in range n, (↑i + 1) * y ^ i / (↑i + 1) = ∑ i in range n, y ^ i :=
by
congr with i
exact mul_div_cancel_left _ (Nat.cast_add_one_pos i).ne'
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -267,7 +267,6 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
have : 1 - |x| ≤ |1 - y| := le_trans (by linarith [hy.2]) (le_abs_self _)
simp only [← pow_abs, abs_div, abs_neg]
apply_rules [div_le_div, pow_nonneg, abs_nonneg, pow_le_pow_of_le_left]
-
-- third step: apply the mean value inequality
have C : ‖F x - F 0‖ ≤ |x| ^ n / (1 - |x|) * ‖x - 0‖ :=
by
@@ -310,7 +309,6 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
norm_num
_ ≤ |x| ^ i := by
simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
-
#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_1
/-- Power series expansion of `log(1 + x) - log(1 - x)` for `|x| < 1`. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/58a272265b5e05f258161260dd2c5d247213cbd3
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
! This file was ported from Lean 3 source module analysis.special_functions.log.deriv
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
+! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -16,6 +16,9 @@ import Mathbin.Analysis.SpecialFunctions.ExpDeriv
/-!
# Derivative and series expansion of real logarithm
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
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`.
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -46,7 +46,7 @@ theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x
theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x :=
by
cases' hx.lt_or_lt with hx hx
- · convert(has_strict_deriv_at_log_of_pos (neg_pos.mpr hx)).comp x (hasStrictDerivAt_neg x)
+ · convert (has_strict_deriv_at_log_of_pos (neg_pos.mpr hx)).comp x (hasStrictDerivAt_neg x)
· ext y; exact (log_neg_eq_log y).symm
· field_simp [hx.ne]
· exact has_strict_deriv_at_log_of_pos hx
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -40,7 +40,7 @@ theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x
(hasStrictDerivAt_exp <| log x).of_local_left_inverse (continuousAt_log hx.ne')
(ne_of_gt <| exp_pos _) <|
Eventually.mono (lt_mem_nhds hx) @exp_log
- rwa [exp_log hx] at this
+ rwa [exp_log hx] at this
#align real.has_strict_deriv_at_log_of_pos Real.hasStrictDerivAt_log_of_pos
theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x :=
@@ -328,7 +328,7 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
convert h₁.add (has_sum_pow_div_log_of_abs_lt_1 h)
ring_nf
· intro m hm
- rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
+ rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
dsimp [term]
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_1
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -28,7 +28,7 @@ logarithm, derivative
open Filter Finset Set
-open Topology BigOperators
+open scoped Topology BigOperators
namespace Real
@@ -228,7 +228,7 @@ theorem tendsto_mul_log_one_plus_div_atTop (t : ℝ) :
simpa only [(· ∘ ·), inv_inv] using h₁.comp h₂
#align real.tendsto_mul_log_one_plus_div_at_top Real.tendsto_mul_log_one_plus_div_atTop
-open BigOperators
+open scoped BigOperators
/-- 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
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -47,8 +47,7 @@ theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x :=
by
cases' hx.lt_or_lt with hx hx
· convert(has_strict_deriv_at_log_of_pos (neg_pos.mpr hx)).comp x (hasStrictDerivAt_neg x)
- · ext y
- exact (log_neg_eq_log y).symm
+ · ext y; exact (log_neg_eq_log y).symm
· field_simp [hx.ne]
· exact has_strict_deriv_at_log_of_pos hx
#align real.has_strict_deriv_at_log Real.hasStrictDerivAt_log
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -4,10 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
! This file was ported from Lean 3 source module analysis.special_functions.log.deriv
-! leanprover-community/mathlib commit 8c8c544bf24ced19b1e76c34bb3262bdae620f82
+! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
+import Mathbin.Analysis.Calculus.Deriv.Pow
+import Mathbin.Analysis.Calculus.Deriv.Inv
import Mathbin.Analysis.SpecialFunctions.Log.Basic
import Mathbin.Analysis.SpecialFunctions.ExpDeriv
mathlib commit https://github.com/leanprover-community/mathlib/commit/33c67ae661dd8988516ff7f247b0be3018cdd952
@@ -143,30 +143,30 @@ section fderiv
variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : E →L[ℝ] ℝ}
{s : Set E}
-theorem HasFderivWithinAt.log (hf : HasFderivWithinAt f f' s x) (hx : f x ≠ 0) :
- HasFderivWithinAt (fun x => log (f x)) ((f x)⁻¹ • f') s x :=
- (hasDerivAt_log hx).comp_hasFderivWithinAt x hf
-#align has_fderiv_within_at.log HasFderivWithinAt.log
+theorem HasFDerivWithinAt.log (hf : HasFDerivWithinAt f f' s x) (hx : f x ≠ 0) :
+ HasFDerivWithinAt (fun x => log (f x)) ((f x)⁻¹ • f') s x :=
+ (hasDerivAt_log hx).comp_hasFDerivWithinAt x hf
+#align has_fderiv_within_at.log HasFDerivWithinAt.log
-theorem HasFderivAt.log (hf : HasFderivAt f f' x) (hx : f x ≠ 0) :
- HasFderivAt (fun x => log (f x)) ((f x)⁻¹ • f') x :=
- (hasDerivAt_log hx).comp_hasFderivAt x hf
-#align has_fderiv_at.log HasFderivAt.log
+theorem HasFDerivAt.log (hf : HasFDerivAt f f' x) (hx : f x ≠ 0) :
+ HasFDerivAt (fun x => log (f x)) ((f x)⁻¹ • f') x :=
+ (hasDerivAt_log hx).comp_hasFDerivAt x hf
+#align has_fderiv_at.log HasFDerivAt.log
-theorem HasStrictFderivAt.log (hf : HasStrictFderivAt f f' x) (hx : f x ≠ 0) :
- HasStrictFderivAt (fun x => log (f x)) ((f x)⁻¹ • f') x :=
- (hasStrictDerivAt_log hx).comp_hasStrictFderivAt x hf
-#align has_strict_fderiv_at.log HasStrictFderivAt.log
+theorem HasStrictFDerivAt.log (hf : HasStrictFDerivAt f f' x) (hx : f x ≠ 0) :
+ HasStrictFDerivAt (fun x => log (f x)) ((f x)⁻¹ • f') x :=
+ (hasStrictDerivAt_log hx).comp_hasStrictFDerivAt x hf
+#align has_strict_fderiv_at.log HasStrictFDerivAt.log
theorem DifferentiableWithinAt.log (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0) :
DifferentiableWithinAt ℝ (fun x => log (f x)) s x :=
- (hf.HasFderivWithinAt.log hx).DifferentiableWithinAt
+ (hf.HasFDerivWithinAt.log hx).DifferentiableWithinAt
#align differentiable_within_at.log DifferentiableWithinAt.log
@[simp]
theorem DifferentiableAt.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
DifferentiableAt ℝ (fun x => log (f x)) x :=
- (hf.HasFderivAt.log hx).DifferentiableAt
+ (hf.HasFDerivAt.log hx).DifferentiableAt
#align differentiable_at.log DifferentiableAt.log
theorem ContDiffAt.log {n} (hf : ContDiffAt ℝ n f x) (hx : f x ≠ 0) :
@@ -200,13 +200,13 @@ theorem Differentiable.log (hf : Differentiable ℝ f) (hx : ∀ x, f x ≠ 0) :
theorem fderivWithin.log (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0)
(hxs : UniqueDiffWithinAt ℝ s x) :
fderivWithin ℝ (fun x => log (f x)) s x = (f x)⁻¹ • fderivWithin ℝ f s x :=
- (hf.HasFderivWithinAt.log hx).fderivWithin hxs
+ (hf.HasFDerivWithinAt.log hx).fderivWithin hxs
#align fderiv_within.log fderivWithin.log
@[simp]
theorem fderiv.log (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0) :
fderiv ℝ (fun x => log (f x)) x = (f x)⁻¹ • fderiv ℝ f x :=
- (hf.HasFderivAt.log hx).fderiv
+ (hf.HasFDerivAt.log hx).fderiv
#align fderiv.log fderiv.log
end fderiv
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce7e9d53d4bbc38065db3b595cd5bd73c323bc1d
@@ -44,7 +44,7 @@ theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x
theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x :=
by
cases' hx.lt_or_lt with hx hx
- · convert (has_strict_deriv_at_log_of_pos (neg_pos.mpr hx)).comp x (hasStrictDerivAt_neg x)
+ · convert(has_strict_deriv_at_log_of_pos (neg_pos.mpr hx)).comp x (hasStrictDerivAt_neg x)
· ext y
exact (log_neg_eq_log y).symm
· field_simp [hx.ne]
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -269,8 +269,8 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
HasSum (fun n : ℕ => x ^ (n + 1) / (n + 1)) (-log (1 - x)) := by
rw [Summable.hasSum_iff_tendsto_nat]
- show Tendsto (fun n : ℕ => ∑ i : ℕ in range n, x ^ (i + 1) / (i + 1)) atTop (𝓝 (-log (1 - x)))
- · rw [tendsto_iff_norm_sub_tendsto_zero]
+ · show Tendsto (fun n : ℕ => ∑ i : ℕ in range n, x ^ (i + 1) / (i + 1)) atTop (𝓝 (-log (1 - x)))
+ rw [tendsto_iff_norm_sub_tendsto_zero]
simp only [norm_eq_abs, sub_neg_eq_add]
refine' squeeze_zero (fun n => abs_nonneg _) (abs_log_sub_add_sum_range_le h) _
suffices Tendsto (fun t : ℕ => |x| ^ (t + 1) / (1 - |x|)) atTop (𝓝 (|x| * 0 / (1 - |x|))) by
@@ -290,7 +290,7 @@ theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
_ ≤ |x| ^ i := by
simpa [pow_succ] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_one
-@[deprecated] alias hasSum_pow_div_log_of_abs_lt_1 := hasSum_pow_div_log_of_abs_lt_one
+@[deprecated] alias hasSum_pow_div_log_of_abs_lt_1 := hasSum_pow_div_log_of_abs_lt_one -- 2024-01-31
/-- Power series expansion of `log(1 + x) - log(1 - x)` for `|x| < 1`. -/
theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
@@ -313,7 +313,7 @@ theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
dsimp [term]
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_one
-@[deprecated] alias hasSum_log_sub_log_of_abs_lt_1 := hasSum_log_sub_log_of_abs_lt_one
+@[deprecated] alias hasSum_log_sub_log_of_abs_lt_1 := hasSum_log_sub_log_of_abs_lt_one -- 2024-01-31
-- Adaptation note: after v4.7.0-rc1, there is a performance problem in `field_simp`.
-- (Part of the code was ignoring the `maxDischargeDepth` setting: now that we have to increase it,
We change the following field in the definition of an additive commutative monoid:
nsmul_succ : ∀ (n : ℕ) (x : G),
- AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+ AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
where the latter is more natural
We adjust the definitions of ^
in monoids, groups, etc.
Originally there was a warning comment about why this natural order was preferred
use
x * npowRec n x
and notnpowRec n x * x
in the definition to make sure that definitional unfolding ofnpowRec
is blocked, to avoid deep recursion issues.
but it seems to no longer apply.
Remarks on the PR :
pow_succ
and pow_succ'
have switched their meanings.Ideal.IsPrime.mul_mem_pow
which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul
.@@ -262,7 +262,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
· simp
· simp [le_abs_self x, neg_le.mp (neg_le_abs x)]
-- fourth step: conclude by massaging the inequality of the third step
- simpa [F, div_mul_eq_mul_div, pow_succ'] using C
+ simpa [F, div_mul_eq_mul_div, pow_succ] using C
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
/-- Power series expansion of the logarithm around `1`. -/
@@ -275,7 +275,7 @@ theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
refine' squeeze_zero (fun n => abs_nonneg _) (abs_log_sub_add_sum_range_le h) _
suffices Tendsto (fun t : ℕ => |x| ^ (t + 1) / (1 - |x|)) atTop (𝓝 (|x| * 0 / (1 - |x|))) by
simpa
- simp only [pow_succ]
+ simp only [pow_succ']
refine' (tendsto_const_nhds.mul _).div_const _
exact tendsto_pow_atTop_nhds_zero_of_lt_one (abs_nonneg _) h
show Summable fun n : ℕ => x ^ (n + 1) / (n + 1)
@@ -288,7 +288,7 @@ theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
gcongr
exact i.cast_nonneg
_ ≤ |x| ^ i := by
- simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
+ simpa [pow_succ] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_one
@[deprecated] alias hasSum_pow_div_log_of_abs_lt_1 := hasSum_pow_div_log_of_abs_lt_one
mul
-div
cancellation lemmas (#11530)
Lemma names around cancellation of multiplication and division are a mess.
This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero
lemma name, the Group
lemma, the AddGroup
lemma name).
| Statement | New name | Old name | |
@@ -244,7 +244,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
ring
_ = ∑ i in Finset.range n, ↑(i + 1) * y ^ i / (↑i + 1) + -1 / (1 - y) := by
congr with i
- rw [Nat.cast_succ, mul_div_cancel_left _ (Nat.cast_add_one_pos i).ne']
+ rw [Nat.cast_succ, mul_div_cancel_left₀ _ (Nat.cast_add_one_pos i).ne']
-- second step: show that the derivative of `F` is small
have B : ∀ y ∈ Icc (-|x|) |x|, |F' y| ≤ |x| ^ n / (1 - |x|) := fun y hy ↦
calc
@@ -221,7 +221,8 @@ open scoped BigOperators
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`.
-Porting note: TODO: use one of generic theorems about Taylor's series to prove this estimate.
+Porting note (#11215): TODO: use one of generic theorems about Taylor's series
+to prove this estimate.
-/
theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
|(∑ i in range n, x ^ (i + 1) / (i + 1)) + log (1 - x)| ≤ |x| ^ (n + 1) / (1 - |x|) := by
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -314,6 +314,10 @@ theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_one
@[deprecated] alias hasSum_log_sub_log_of_abs_lt_1 := hasSum_log_sub_log_of_abs_lt_one
+-- Adaptation note: after v4.7.0-rc1, there is a performance problem in `field_simp`.
+-- (Part of the code was ignoring the `maxDischargeDepth` setting: now that we have to increase it,
+-- other paths becomes slow.)
+set_option maxHeartbeats 400000 in
/-- Expansion of `log (1 + a⁻¹)` as a series in powers of `1 / (2 * a + 1)`. -/
theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * (1 / (2 * a + 1)) ^ (2 * k + 1))
@@ -247,7 +247,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
-- second step: show that the derivative of `F` is small
have B : ∀ y ∈ Icc (-|x|) |x|, |F' y| ≤ |x| ^ n / (1 - |x|) := fun y hy ↦
calc
- |F' y| = |y| ^ n / |1 - y| := by simp [abs_div]
+ |F' y| = |y| ^ n / |1 - y| := by simp [F', abs_div]
_ ≤ |x| ^ n / (1 - |x|) := by
have : |y| ≤ |x| := abs_le.2 hy
have : 1 - |x| ≤ |1 - y| := le_trans (by linarith [hy.2]) (le_abs_self _)
@@ -261,7 +261,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
· simp
· simp [le_abs_self x, neg_le.mp (neg_le_abs x)]
-- fourth step: conclude by massaging the inequality of the third step
- simpa [div_mul_eq_mul_div, pow_succ'] using C
+ simpa [F, div_mul_eq_mul_div, pow_succ'] using C
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
/-- Power series expansion of the logarithm around `1`. -/
@@ -299,7 +299,7 @@ theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
have h_term_eq_goal :
term ∘ (2 * ·) = fun k : ℕ => 2 * (1 / (2 * k + 1)) * x ^ (2 * k + 1) := by
ext n
- dsimp only [(· ∘ ·)]
+ dsimp only [term, (· ∘ ·)]
rw [Odd.neg_pow (⟨n, rfl⟩ : Odd (2 * n + 1)) x]
push_cast
ring_nf
@@ -309,7 +309,7 @@ theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
ring_nf
· intro m hm
rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
- dsimp
+ dsimp [term]
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_one
@[deprecated] alias hasSum_log_sub_log_of_abs_lt_1 := hasSum_log_sub_log_of_abs_lt_one
have
, replace
and suffices
(#10640)
No changes to tactic file, it's just boring fixes throughout the library.
This follows on from #6964.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -75,7 +75,7 @@ theorem deriv_log' : deriv log = Inv.inv :=
#align real.deriv_log' Real.deriv_log'
theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log {0}ᶜ := by
- suffices : ContDiffOn ℝ ⊤ log {0}ᶜ; exact this.of_le le_top
+ suffices ContDiffOn ℝ ⊤ log {0}ᶜ from this.of_le le_top
refine' (contDiffOn_top_iff_deriv_of_isOpen isOpen_compl_singleton).2 _
simp [differentiableOn_log, contDiffOn_inv]
#align real.cont_diff_on_log Real.contDiffOn_log
@@ -265,7 +265,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
/-- Power series expansion of the logarithm around `1`. -/
-theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
+theorem hasSum_pow_div_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
HasSum (fun n : ℕ => x ^ (n + 1) / (n + 1)) (-log (1 - x)) := by
rw [Summable.hasSum_iff_tendsto_nat]
show Tendsto (fun n : ℕ => ∑ i : ℕ in range n, x ^ (i + 1) / (i + 1)) atTop (𝓝 (-log (1 - x)))
@@ -276,9 +276,9 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
simpa
simp only [pow_succ]
refine' (tendsto_const_nhds.mul _).div_const _
- exact tendsto_pow_atTop_nhds_0_of_lt_1 (abs_nonneg _) h
+ exact tendsto_pow_atTop_nhds_zero_of_lt_one (abs_nonneg _) h
show Summable fun n : ℕ => x ^ (n + 1) / (n + 1)
- · refine' .of_norm_bounded _ (summable_geometric_of_lt_1 (abs_nonneg _) h) fun i => _
+ · refine' .of_norm_bounded _ (summable_geometric_of_lt_one (abs_nonneg _) h) fun i => _
calc
‖x ^ (i + 1) / (i + 1)‖ = |x| ^ (i + 1) / (i + 1) := by
have : (0 : ℝ) ≤ i + 1 := le_of_lt (Nat.cast_add_one_pos i)
@@ -288,10 +288,11 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
exact i.cast_nonneg
_ ≤ |x| ^ i := by
simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
-#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_1
+#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_one
+@[deprecated] alias hasSum_pow_div_log_of_abs_lt_1 := hasSum_pow_div_log_of_abs_lt_one
/-- Power series expansion of `log(1 + x) - log(1 - x)` for `|x| < 1`. -/
-theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
+theorem hasSum_log_sub_log_of_abs_lt_one {x : ℝ} (h : |x| < 1) :
HasSum (fun k : ℕ => (2 : ℝ) * (1 / (2 * k + 1)) * x ^ (2 * k + 1))
(log (1 + x) - log (1 - x)) := by
set term := fun n : ℕ => -1 * ((-x) ^ (n + 1) / ((n : ℝ) + 1)) + x ^ (n + 1) / (n + 1)
@@ -303,14 +304,15 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
push_cast
ring_nf
rw [← h_term_eq_goal, (mul_right_injective₀ (two_ne_zero' ℕ)).hasSum_iff]
- · have h₁ := (hasSum_pow_div_log_of_abs_lt_1 (Eq.trans_lt (abs_neg x) h)).mul_left (-1)
- convert h₁.add (hasSum_pow_div_log_of_abs_lt_1 h) using 1
+ · have h₁ := (hasSum_pow_div_log_of_abs_lt_one (Eq.trans_lt (abs_neg x) h)).mul_left (-1)
+ convert h₁.add (hasSum_pow_div_log_of_abs_lt_one h) using 1
ring_nf
· intro m hm
rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
dsimp
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
-#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_1
+#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_one
+@[deprecated] alias hasSum_log_sub_log_of_abs_lt_1 := hasSum_log_sub_log_of_abs_lt_one
/-- Expansion of `log (1 + a⁻¹)` as a series in powers of `1 / (2 * a + 1)`. -/
theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
@@ -321,7 +323,7 @@ theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
· linarith
· linarith
· exact div_pos one_pos (by linarith)
- convert hasSum_log_sub_log_of_abs_lt_1 h₁ using 1
+ convert hasSum_log_sub_log_of_abs_lt_one h₁ using 1
have h₂ : (2 : ℝ) * a + 1 ≠ 0 := by linarith
have h₃ := h.ne'
rw [← log_div]
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
-/
import Mathlib.Analysis.Calculus.Deriv.Pow
-import Mathlib.Analysis.Calculus.Deriv.Inv
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
abs
(#9553)
The current design for abs
is flawed:
Abs
notation typeclass has exactly two instances: one for [Neg α] [Sup α]
, one for [Inv α] [Sup α]
. This means that:
Abs.abs
Abs
instances!Algebra.Order.Group.Abs
are about the additive version.Algebra.Order.Group.PosPart
, and they get additivised to duplicates of the lemmas in Algebra.Order.Group.Abs
!This PR changes the notation typeclass with two new definitions (related through to_additive
): mabs
and abs
. abs
inherits the |a|
notation and mabs
gets |a|ₘ
instead.
The first half of Algebra.Order.Group.Abs
gets multiplicativised. A later PR will multiplicativise the second half, and another one will deduplicate the lemmas in Algebra.Order.Group.PosPart
.
Part of #9411.
Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
@@ -260,7 +260,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
(fun y hy ↦ (A _ ?_).hasDerivWithinAt) B (convex_Icc _ _) ?_ ?_
· exact Icc_subset_Ioo (neg_lt_neg h) h hy
· simp
- · simp [le_abs_self x, neg_le.mp (neg_le_abs_self x)]
+ · simp [le_abs_self x, neg_le.mp (neg_le_abs x)]
-- fourth step: conclude by massaging the inequality of the third step
simpa [div_mul_eq_mul_div, pow_succ'] using C
#align real.abs_log_sub_add_sum_range_le Real.abs_log_sub_add_sum_range_le
(· op ·) a
by (a op ·)
(#8843)
I used the regex \(\(· (.) ·\) (.)\)
, replacing with ($2 $1 ·)
.
@@ -297,7 +297,7 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
(log (1 + x) - log (1 - x)) := by
set term := fun n : ℕ => -1 * ((-x) ^ (n + 1) / ((n : ℝ) + 1)) + x ^ (n + 1) / (n + 1)
have h_term_eq_goal :
- term ∘ (· * ·) 2 = fun k : ℕ => 2 * (1 / (2 * k + 1)) * x ^ (2 * k + 1) := by
+ term ∘ (2 * ·) = fun k : ℕ => 2 * (1 / (2 * k + 1)) * x ^ (2 * k + 1) := by
ext n
dsimp only [(· ∘ ·)]
rw [Odd.neg_pow (⟨n, rfl⟩ : Odd (2 * n + 1)) x]
Mostly, this means replacing "of_open" by "of_isOpen". A few lemmas names were misleading and are corrected differently. Zulip discussion.
@@ -77,7 +77,7 @@ theorem deriv_log' : deriv log = Inv.inv :=
theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log {0}ᶜ := by
suffices : ContDiffOn ℝ ⊤ log {0}ᶜ; exact this.of_le le_top
- refine' (contDiffOn_top_iff_deriv_of_open isOpen_compl_singleton).2 _
+ refine' (contDiffOn_top_iff_deriv_of_isOpen isOpen_compl_singleton).2 _
simp [differentiableOn_log, contDiffOn_inv]
#align real.cont_diff_on_log Real.contDiffOn_log
summable_of_norm_bounded
-> Summable.of_norm_bounded
;summable_of_norm_bounded_eventually
-> Summable.of_norm_bounded_eventually
;summable_of_nnnorm_bounded
-> Summable.of_nnnorm_bounded
;summable_of_summable_norm
-> Summable.of_norm
;summable_of_summable_nnnorm
-> Summable.of_nnnorm
;Summable.of_norm_bounded_eventually_nat
Summable.norm
@@ -279,7 +279,7 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
refine' (tendsto_const_nhds.mul _).div_const _
exact tendsto_pow_atTop_nhds_0_of_lt_1 (abs_nonneg _) h
show Summable fun n : ℕ => x ^ (n + 1) / (n + 1)
- · refine' summable_of_norm_bounded _ (summable_geometric_of_lt_1 (abs_nonneg _) h) fun i => _
+ · refine' .of_norm_bounded _ (summable_geometric_of_lt_1 (abs_nonneg _) h) fun i => _
calc
‖x ^ (i + 1) / (i + 1)‖ = |x| ^ (i + 1) / (i + 1) := by
have : (0 : ℝ) ≤ i + 1 := le_of_lt (Nat.cast_add_one_pos i)
Rename:
tendsto_iff_norm_tendsto_one
→
tendsto_iff_norm_div_tendsto_zero
;tendsto_iff_norm_tendsto_zero
→
tendsto_iff_norm_sub_tendsto_zero
;tendsto_one_iff_norm_tendsto_one
→
tendsto_one_iff_norm_tendsto_zero
;Filter.Tendsto.continuous_of_equicontinuous_at
→
Filter.Tendsto.continuous_of_equicontinuousAt
.@@ -270,7 +270,7 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
HasSum (fun n : ℕ => x ^ (n + 1) / (n + 1)) (-log (1 - x)) := by
rw [Summable.hasSum_iff_tendsto_nat]
show Tendsto (fun n : ℕ => ∑ i : ℕ in range n, x ^ (i + 1) / (i + 1)) atTop (𝓝 (-log (1 - x)))
- · rw [tendsto_iff_norm_tendsto_zero]
+ · rw [tendsto_iff_norm_sub_tendsto_zero]
simp only [norm_eq_abs, sub_neg_eq_add]
refine' squeeze_zero (fun n => abs_nonneg _) (abs_log_sub_add_sum_range_le h) _
suffices Tendsto (fun t : ℕ => |x| ^ (t + 1) / (1 - |x|)) atTop (𝓝 (|x| * 0 / (1 - |x|))) by
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -130,7 +130,7 @@ end deriv
section fderiv
-variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : E →L[ℝ] ℝ}
+variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {x : E} {f' : E →L[ℝ] ℝ}
{s : Set E}
theorem HasFDerivWithinAt.log (hf : HasFDerivWithinAt f f' s x) (hx : f x ≠ 0) :
@@ -2,17 +2,14 @@
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne
-
-! This file was ported from Lean 3 source module analysis.special_functions.log.deriv
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Analysis.Calculus.Deriv.Pow
import Mathlib.Analysis.Calculus.Deriv.Inv
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
+#align_import analysis.special_functions.log.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
/-!
# Derivative and series expansion of real logarithm
@@ -249,7 +249,7 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
congr with i
rw [Nat.cast_succ, mul_div_cancel_left _ (Nat.cast_add_one_pos i).ne']
-- second step: show that the derivative of `F` is small
- have B : ∀ y ∈ Icc (-|x|) (|x|), |F' y| ≤ |x| ^ n / (1 - |x|) := fun y hy ↦
+ have B : ∀ y ∈ Icc (-|x|) |x|, |F' y| ≤ |x| ^ n / (1 - |x|) := fun y hy ↦
calc
|F' y| = |y| ^ n / |1 - y| := by simp [abs_div]
_ ≤ |x| ^ n / (1 - |x|) := by
@@ -58,7 +58,7 @@ theorem differentiableAt_log (hx : x ≠ 0) : DifferentiableAt ℝ log x :=
(hasDerivAt_log hx).differentiableAt
#align real.differentiable_at_log Real.differentiableAt_log
-theorem differentiableOn_log : DifferentiableOn ℝ log ({0}ᶜ) := fun _x hx =>
+theorem differentiableOn_log : DifferentiableOn ℝ log {0}ᶜ := fun _x hx =>
(differentiableAt_log hx).differentiableWithinAt
#align real.differentiable_on_log Real.differentiableOn_log
@@ -78,8 +78,8 @@ theorem deriv_log' : deriv log = Inv.inv :=
funext deriv_log
#align real.deriv_log' Real.deriv_log'
-theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log ({0}ᶜ) := by
- suffices : ContDiffOn ℝ ⊤ log ({0}ᶜ); exact this.of_le le_top
+theorem contDiffOn_log {n : ℕ∞} : ContDiffOn ℝ n log {0}ᶜ := by
+ suffices : ContDiffOn ℝ ⊤ log {0}ᶜ; exact this.of_le le_top
refine' (contDiffOn_top_iff_deriv_of_open isOpen_compl_singleton).2 _
simp [differentiableOn_log, contDiffOn_inv]
#align real.cont_diff_on_log Real.contDiffOn_log
@@ -223,7 +223,7 @@ open scoped BigOperators
/-- 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 `has_sum_pow_div_log_of_abs_lt_1`.
+expansion of the logarithm, in `hasSum_pow_div_log_of_abs_lt_1`.
Porting note: TODO: use one of generic theorems about Taylor's series to prove this estimate.
-/
@@ -39,7 +39,7 @@ theorem hasStrictDerivAt_log_of_pos (hx : 0 < x) : HasStrictDerivAt log x⁻¹ x
(hasStrictDerivAt_exp <| log x).of_local_left_inverse (continuousAt_log hx.ne')
(ne_of_gt <| exp_pos _) <|
Eventually.mono (lt_mem_nhds hx) @exp_log
- rwa [exp_log hx] at this
+ rwa [exp_log hx] at this
#align real.has_strict_deriv_at_log_of_pos Real.hasStrictDerivAt_log_of_pos
theorem hasStrictDerivAt_log (hx : x ≠ 0) : HasStrictDerivAt log x⁻¹ x := by
@@ -252,10 +252,11 @@ theorem abs_log_sub_add_sum_range_le {x : ℝ} (h : |x| < 1) (n : ℕ) :
have B : ∀ y ∈ Icc (-|x|) (|x|), |F' y| ≤ |x| ^ n / (1 - |x|) := fun y hy ↦
calc
|F' y| = |y| ^ n / |1 - y| := by simp [abs_div]
- _ ≤ |x| ^ n / (1 - |x|) :=
+ _ ≤ |x| ^ n / (1 - |x|) := by
have : |y| ≤ |x| := abs_le.2 hy
have : 1 - |x| ≤ |1 - y| := le_trans (by linarith [hy.2]) (le_abs_self _)
- div_le_div (by positivity) (pow_le_pow_of_le_left (abs_nonneg _) ‹_› _) (sub_pos.2 h) ‹_›
+ gcongr
+ exact sub_pos.2 h
-- third step: apply the mean value inequality
have C : ‖F x - F 0‖ ≤ |x| ^ n / (1 - |x|) * ‖x - 0‖ := by
refine Convex.norm_image_sub_le_of_norm_hasDerivWithin_le
@@ -287,8 +288,8 @@ theorem hasSum_pow_div_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
have : (0 : ℝ) ≤ i + 1 := le_of_lt (Nat.cast_add_one_pos i)
rw [norm_eq_abs, abs_div, ← pow_abs, abs_of_nonneg this]
_ ≤ |x| ^ (i + 1) / (0 + 1) := by
- apply_rules [div_le_div_of_le_left, pow_nonneg, abs_nonneg, add_le_add_right, i.cast_nonneg]
- norm_num
+ gcongr
+ exact i.cast_nonneg
_ ≤ |x| ^ i := by
simpa [pow_succ'] using mul_le_of_le_one_right (pow_nonneg (abs_nonneg x) i) (le_of_lt h)
#align real.has_sum_pow_div_log_of_abs_lt_1 Real.hasSum_pow_div_log_of_abs_lt_1
@@ -310,7 +311,7 @@ theorem hasSum_log_sub_log_of_abs_lt_1 {x : ℝ} (h : |x| < 1) :
convert h₁.add (hasSum_pow_div_log_of_abs_lt_1 h) using 1
ring_nf
· intro m hm
- rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
+ rw [range_two_mul, Set.mem_setOf_eq, ← Nat.even_add_one] at hm
dsimp
rw [Even.neg_pow hm, neg_one_mul, neg_add_self]
#align real.has_sum_log_sub_log_of_abs_lt_1 Real.hasSum_log_sub_log_of_abs_lt_1
@@ -337,4 +338,3 @@ theorem hasSum_log_one_add_inv {a : ℝ} (h : 0 < a) :
#align real.has_sum_log_one_add_inv Real.hasSum_log_one_add_inv
end Real
-
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file