Theorem: Complex.hasSum_taylorSeries_log
File: Mathlib/Analysis/SpecialFunctions/Complex/LogBounds.lean

tactic: refine (hasSum_iff_tendsto_nat_of_summable_norm ?_).mpr ?_
state_before: z : ℂ
hz : ‖z‖ < 1
⊢ HasSum (fun n => (-1) ^ (n + 1) * z ^ n / ↑n) (log (1 + z))
state_after: case refine_1
z : ℂ
hz : ‖z‖ < 1
⊢ Summable fun i => ‖(-1) ^ (i + 1) * z ^ i / ↑i‖

case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ (i + 1) * z ^ i / ↑i) atTop (nhds (log (1 + z)))

tactic: refine (summable_geometric_of_norm_lt_one hz).norm.of_nonneg_of_le (fun _ ↦ norm_nonneg _) ?_
state_before: case refine_1
z : ℂ
hz : ‖z‖ < 1
⊢ Summable fun i => ‖(-1) ^ (i + 1) * z ^ i / ↑i‖
state_after: case refine_1
z : ℂ
hz : ‖z‖ < 1
⊢ ∀ (b : ℕ), ‖(-1) ^ (b + 1) * z ^ b / ↑b‖ ≤ ‖z ^ b‖

tactic: intro n
state_before: case refine_1
z : ℂ
hz : ‖z‖ < 1
⊢ ∀ (b : ℕ), ‖(-1) ^ (b + 1) * z ^ b / ↑b‖ ≤ ‖z ^ b‖
state_after: case refine_1
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖(-1) ^ (n + 1) * z ^ n / ↑n‖ ≤ ‖z ^ n‖

tactic: simp only [norm_div, norm_mul, norm_pow, norm_neg, norm_one, one_pow, one_mul, norm_nat]
state_before: case refine_1
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖(-1) ^ (n + 1) * z ^ n / ↑n‖ ≤ ‖z ^ n‖
state_after: case refine_1
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖z‖ ^ n / ↑n ≤ ‖z‖ ^ n

tactic: rcases n.eq_zero_or_pos with rfl | hn
state_before: case refine_1
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖z‖ ^ n / ↑n ≤ ‖z‖ ^ n
state_after: case refine_1.inl
z : ℂ
hz : ‖z‖ < 1
⊢ ‖z‖ ^ 0 / ↑0 ≤ ‖z‖ ^ 0

case refine_1.inr
z : ℂ
hz : ‖z‖ < 1
n : ℕ
hn : n > 0
⊢ ‖z‖ ^ n / ↑n ≤ ‖z‖ ^ n

tactic: conv => enter [2]; rw [← div_one (‖z‖ ^ n)]
state_before: case refine_1.inr
z : ℂ
hz : ‖z‖ < 1
n : ℕ
hn : n > 0
⊢ ‖z‖ ^ n / ↑n ≤ ‖z‖ ^ n
state_after: case refine_1.inr
z : ℂ
hz : ‖z‖ < 1
n : ℕ
hn : n > 0
⊢ ‖z‖ ^ n / ↑n ≤ ‖z‖ ^ n / 1

tactic: gcongr
state_before: case refine_1.inr
z : ℂ
hz : ‖z‖ < 1
n : ℕ
hn : n > 0
⊢ ‖z‖ ^ n / ↑n ≤ ‖z‖ ^ n / 1
state_after: case refine_1.inr.h
z : ℂ
hz : ‖z‖ < 1
n : ℕ
hn : n > 0
⊢ 1 ≤ ↑n

tactic: norm_cast
state_before: case refine_1.inr.h
z : ℂ
hz : ‖z‖ < 1
n : ℕ
hn : n > 0
⊢ 1 ≤ ↑n
state_after: no goals

tactic: simp
state_before: case refine_1.inl
z : ℂ
hz : ‖z‖ < 1
⊢ ‖z‖ ^ 0 / ↑0 ≤ ‖z‖ ^ 0
state_after: no goals

tactic: rw [← tendsto_sub_nhds_zero_iff]
state_before: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ (i + 1) * z ^ i / ↑i) atTop (nhds (log (1 + z)))
state_after: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ Tendsto (fun x => ∑ i ∈ Finset.range x, (-1) ^ (i + 1) * z ^ i / ↑i - log (1 + z)) atTop (nhds 0)

tactic: conv => enter [1, x]; rw [← div_one (_ - _), ← logTaylor]
state_before: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ Tendsto (fun x => ∑ i ∈ Finset.range x, (-1) ^ (i + 1) * z ^ i / ↑i - log (1 + z)) atTop (nhds 0)
state_after: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ Tendsto (fun x => (logTaylor x z - log (1 + z)) / 1) atTop (nhds 0)

tactic: rw [← isLittleO_iff_tendsto fun _ h ↦ (one_ne_zero h).elim]
state_before: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ Tendsto (fun x => (logTaylor x z - log (1 + z)) / 1) atTop (nhds 0)
state_after: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ (fun x => logTaylor x z - log (1 + z)) =o[atTop] fun x => 1

tactic: refine IsLittleO.trans_isBigO ?_ <| isBigO_const_one ℂ (1 : ℝ) atTop
state_before: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ (fun x => logTaylor x z - log (1 + z)) =o[atTop] fun x => 1
state_after: case refine_2
z : ℂ
hz : ‖z‖ < 1
⊢ (fun x => logTaylor x z - log (1 + z)) =o[atTop] fun _x => 1

tactic: refine IsBigO.trans_isLittleO H ?_
state_before: case refine_2
z : ℂ
hz : ‖z‖ < 1
H : (fun n => logTaylor n z - log (1 + z)) =O[atTop] fun n => ‖z‖ ^ n
⊢ (fun x => logTaylor x z - log (1 + z)) =o[atTop] fun _x => 1
state_after: case refine_2
z : ℂ
hz : ‖z‖ < 1
H : (fun n => logTaylor n z - log (1 + z)) =O[atTop] fun n => ‖z‖ ^ n
⊢ (fun n => ‖z‖ ^ n) =o[atTop] fun _x => 1

tactic: convert isLittleO_pow_pow_of_lt_left (norm_nonneg z) hz
state_before: case refine_2
z : ℂ
hz : ‖z‖ < 1
H : (fun n => logTaylor n z - log (1 + z)) =O[atTop] fun n => ‖z‖ ^ n
⊢ (fun n => ‖z‖ ^ n) =o[atTop] fun _x => 1
state_after: case h.e'_8.h
z : ℂ
hz : ‖z‖ < 1
H : (fun n => logTaylor n z - log (1 + z)) =O[atTop] fun n => ‖z‖ ^ n
x✝ : ℕ
⊢ 1 = 1 ^ x✝

tactic: exact (one_pow _).symm
state_before: case h.e'_8.h
z : ℂ
hz : ‖z‖ < 1
H : (fun n => logTaylor n z - log (1 + z)) =O[atTop] fun n => ‖z‖ ^ n
x✝ : ℕ
⊢ 1 = 1 ^ x✝
state_after: no goals

tactic: exact (isBigOWith_of_le' atTop this).isBigO
state_before: z : ℂ
hz : ‖z‖ < 1
this : ∀ (n : ℕ), ‖logTaylor n z - log (1 + z)‖ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖‖z‖ ^ n‖
⊢ (fun n => logTaylor n z - log (1 + z)) =O[atTop] fun n => ‖z‖ ^ n
state_after: no goals

tactic: rw [norm_sub_rev, norm_pow, norm_norm]
state_before: z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖logTaylor n z - log (1 + z)‖ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖‖z‖ ^ n‖
state_after: z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖log (1 + z) - logTaylor n z‖ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ n

tactic: simp [logTaylor_zero]
state_before: case zero
z : ℂ
hz : ‖z‖ < 1
⊢ ‖log (1 + z) - logTaylor 0 z‖ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ 0
state_after: no goals

tactic: refine (norm_log_sub_logTaylor_le n hz).trans ?_
state_before: case succ
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖log (1 + z) - logTaylor (n + 1) z‖ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1)
state_after: case succ
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖z‖ ^ (n + 1) * (1 - ‖z‖)⁻¹ / (↑n + 1) ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1)

tactic: rw [mul_comm, ← div_one ((max _ _) * _)]
state_before: case succ
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ ‖z‖ ^ (n + 1) * (1 - ‖z‖)⁻¹ / (↑n + 1) ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1)
state_after: case succ
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1) / (↑n + 1) ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1) / 1

tactic: gcongr
state_before: case succ
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1) / (↑n + 1) ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹ * ‖z‖ ^ (n + 1) / 1
state_after: case succ.hac.h
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ (1 - ‖z‖)⁻¹ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹

case succ.hbd
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ 1 ≤ ↑n + 1

tactic: exact le_max_right ..
state_before: case succ.hac.h
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ (1 - ‖z‖)⁻¹ ≤ max ‖log (1 + z)‖ (1 - ‖z‖)⁻¹
state_after: no goals

tactic: linarith
state_before: case succ.hbd
z : ℂ
hz : ‖z‖ < 1
n : ℕ
⊢ 1 ≤ ↑n + 1
state_after: no goals