Theorem: ZetaAsymptotics.tendsto_riemannZeta_sub_one_div_nhds_right
File: Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean

tactic: suffices Tendsto (fun s : ℝ ↦ (∑' n : ℕ, 1 / (n + 1 : ℝ) ^ s) - 1 / (s - 1))
  (𝓝[>] 1) (𝓝 γ) by
  apply ((Complex.continuous_ofReal.tendsto _).comp this).congr'
  filter_upwards [self_mem_nhdsWithin] with s hs
  simp only [Function.comp_apply, Complex.ofReal_sub, Complex.ofReal_div,
    Complex.ofReal_one, sub_left_inj, Complex.ofReal_tsum]
  rw [zeta_eq_tsum_one_div_nat_add_one_cpow (by simpa using hs)]
  congr 1 with n
  rw [Complex.ofReal_cpow (by positivity)]
  norm_cast
state_before: ⊢ Tendsto (fun s => riemannZeta ↑s - 1 / (↑s - 1)) (𝓝[>] 1) (𝓝 ↑γ)
state_after: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)

tactic: suffices aux2 : Tendsto (fun s : ℝ ↦ (∑' n : ℕ, 1 / (n + 1 : ℝ) ^ s) - 1 / (s - 1))
  (𝓝[>] 1) (𝓝 (1 - term_tsum 1)) by
  have := term_tsum_one.tsum_eq
  rw [← term_tsum, eq_sub_iff_add_eq, ← eq_sub_iff_add_eq'] at this
  simpa only [this] using aux2
state_before: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
state_after: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))

tactic: apply Tendsto.congr'
state_before: ⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
state_after: case hl

⊢ ?f₁ =ᶠ[𝓝[>] 1] fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)

case h

⊢ Tendsto ?f₁ (𝓝[>] 1) (𝓝 (1 - term_tsum 1))

case f₁

⊢ ℝ → ℝ

tactic: apply ((Complex.continuous_ofReal.tendsto _).comp this).congr'
state_before: this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
⊢ Tendsto (fun s => riemannZeta ↑s - 1 / (↑s - 1)) (𝓝[>] 1) (𝓝 ↑γ)
state_after: this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
⊢ (Complex.ofReal' ∘ fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) =ᶠ[𝓝[>] 1] fun s =>
    riemannZeta ↑s - 1 / (↑s - 1)

tactic: filter_upwards [self_mem_nhdsWithin] with s hs
state_before: this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
⊢ (Complex.ofReal' ∘ fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) =ᶠ[𝓝[>] 1] fun s =>
    riemannZeta ↑s - 1 / (↑s - 1)
state_after: case h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ (Complex.ofReal' ∘ fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) s = riemannZeta ↑s - 1 / (↑s - 1)

tactic: simp only [Function.comp_apply, Complex.ofReal_sub, Complex.ofReal_div,
  Complex.ofReal_one, sub_left_inj, Complex.ofReal_tsum]
state_before: case h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ (Complex.ofReal' ∘ fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) s = riemannZeta ↑s - 1 / (↑s - 1)
state_after: case h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ ∑' (a : ℕ), 1 / ↑((↑a + 1) ^ s) = riemannZeta ↑s

tactic: rw [zeta_eq_tsum_one_div_nat_add_one_cpow (by simpa using hs)]
state_before: case h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ ∑' (a : ℕ), 1 / ↑((↑a + 1) ^ s) = riemannZeta ↑s
state_after: case h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ ∑' (a : ℕ), 1 / ↑((↑a + 1) ^ s) = ∑' (n : ℕ), 1 / (↑n + 1) ^ ↑s

tactic: congr 1 with n
state_before: case h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ ∑' (a : ℕ), 1 / ↑((↑a + 1) ^ s) = ∑' (n : ℕ), 1 / (↑n + 1) ^ ↑s
state_after: case h.e_f.h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
n : ℕ
⊢ 1 / ↑((↑n + 1) ^ s) = 1 / (↑n + 1) ^ ↑s

tactic: rw [Complex.ofReal_cpow (by positivity)]
state_before: case h.e_f.h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
n : ℕ
⊢ 1 / ↑((↑n + 1) ^ s) = 1 / (↑n + 1) ^ ↑s
state_after: case h.e_f.h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
n : ℕ
⊢ 1 / ↑(↑n + 1) ^ ↑s = 1 / (↑n + 1) ^ ↑s

tactic: norm_cast
state_before: case h.e_f.h
this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
n : ℕ
⊢ 1 / ↑(↑n + 1) ^ ↑s = 1 / (↑n + 1) ^ ↑s
state_after: no goals

tactic: simpa using hs
state_before: this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
⊢ 1 < (↑s).re
state_after: no goals

tactic: positivity
state_before: this : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
s : ℝ
hs : s ∈ Ioi 1
n : ℕ
⊢ 0 ≤ ↑n + 1
state_after: no goals

tactic: have := term_tsum_one.tsum_eq
state_before: aux2 : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
state_after: aux2 : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
this : ∑' (b : ℕ), term (b + 1) 1 = 1 - γ
⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)

tactic: rw [← term_tsum, eq_sub_iff_add_eq, ← eq_sub_iff_add_eq'] at this
state_before: aux2 : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
this : ∑' (b : ℕ), term (b + 1) 1 = 1 - γ
⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
state_after: aux2 : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
this : γ = 1 - term_tsum 1
⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)

tactic: simpa only [this] using aux2
state_before: aux2 : Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
this : γ = 1 - term_tsum 1
⊢ Tendsto (fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)) (𝓝[>] 1) (𝓝 γ)
state_after: no goals

tactic: filter_upwards [self_mem_nhdsWithin] with s hs using (zeta_limit_aux1 hs).symm
state_before: case hl

⊢ ?f₁ =ᶠ[𝓝[>] 1] fun s => ∑' (n : ℕ), 1 / (↑n + 1) ^ s - 1 / (s - 1)
state_after: no goals

tactic: apply tendsto_const_nhds.sub
state_before: case h

⊢ Tendsto (fun s => 1 - s * term_tsum s) (𝓝[>] 1) (𝓝 (1 - term_tsum 1))
state_after: case h

⊢ Tendsto (fun x => x * term_tsum x) (𝓝[>] 1) (𝓝 (term_tsum 1))

tactic: rw [← one_mul (term_tsum 1)]
state_before: case h

⊢ Tendsto (fun x => x * term_tsum x) (𝓝[>] 1) (𝓝 (term_tsum 1))
state_after: case h

⊢ Tendsto (fun x => x * term_tsum x) (𝓝[>] 1) (𝓝 (1 * term_tsum 1))

tactic: apply (tendsto_id.mono_left nhdsWithin_le_nhds).mul
state_before: case h

⊢ Tendsto (fun x => x * term_tsum x) (𝓝[>] 1) (𝓝 (1 * term_tsum 1))
state_after: case h

⊢ Tendsto term_tsum (𝓝[>] 1) (𝓝 (term_tsum 1))

tactic: have := continuousOn_term_tsum.continuousWithinAt left_mem_Ici
state_before: case h

⊢ Tendsto term_tsum (𝓝[>] 1) (𝓝 (term_tsum 1))
state_after: case h
this : ContinuousWithinAt term_tsum (Ici 1) 1
⊢ Tendsto term_tsum (𝓝[>] 1) (𝓝 (term_tsum 1))

tactic: exact Tendsto.mono_left this (nhdsWithin_mono _ Ioi_subset_Ici_self)
state_before: case h
this : ContinuousWithinAt term_tsum (Ici 1) 1
⊢ Tendsto term_tsum (𝓝[>] 1) (𝓝 (term_tsum 1))
state_after: no goals