Theorem: tendsto_riemannZeta_sub_one_div
File: Mathlib/NumberTheory/Harmonic/ZetaAsymp.lean

tactic: let f (s : ℂ) := riemannZeta s - 1 / (s - 1)
state_before: ⊢ Tendsto (fun s => riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 ↑γ)
state_after: f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun s => riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 ↑γ)

tactic: refine ⟨_, Complex.tendsto_limUnder_of_differentiable_on_punctured_nhds_of_isLittleO ?_ ?_⟩
state_before: f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ ∃ C, Tendsto f (𝓝[≠] 1) (𝓝 C)
state_after: case refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ ∀ᶠ (z : ℂ) in 𝓝[≠] 1, DifferentiableAt ℂ f z

case refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ (fun z => f z - f 1) =o[𝓝[≠] 1] fun z => (z - 1)⁻¹

tactic: cases' this with C hC
state_before: f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
this : ∃ C, Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto (fun s => riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 ↑γ)
state_after: case intro
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto (fun s => riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 ↑γ)

tactic: suffices Tendsto (fun s : ℝ ↦ f s) _ _
  from (tendsto_nhds_unique this tendsto_riemannZeta_sub_one_div_nhds_right) ▸ hC
state_before: case intro
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto (fun s => riemannZeta s - 1 / (s - 1)) (𝓝[≠] 1) (𝓝 ↑γ)
state_after: case intro
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto (fun s => f ↑s) (𝓝[>] 1) (𝓝 C)

tactic: refine hC.comp (tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within _ ?_ ?_)
state_before: case intro
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto (fun s => f ↑s) (𝓝[>] 1) (𝓝 C)
state_after: case intro.refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto Complex.ofReal' (𝓝[>] 1) (𝓝 1)

case intro.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ ∀ᶠ (x : ℝ) in 𝓝[>] 1, ↑x ∈ {1}ᶜ

tactic: exact (Complex.continuous_ofReal.tendsto 1).mono_left (nhdsWithin_le_nhds ..)
state_before: case intro.refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ Tendsto Complex.ofReal' (𝓝[>] 1) (𝓝 1)
state_after: no goals

tactic: filter_upwards [self_mem_nhdsWithin] with a ha
state_before: case intro.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
⊢ ∀ᶠ (x : ℝ) in 𝓝[>] 1, ↑x ∈ {1}ᶜ
state_after: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
a : ℝ
ha : a ∈ Ioi 1
⊢ ↑a ∈ {1}ᶜ

tactic: rw [mem_compl_singleton_iff, ← Complex.ofReal_one, Ne, Complex.ofReal_inj]
state_before: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
a : ℝ
ha : a ∈ Ioi 1
⊢ ↑a ∈ {1}ᶜ
state_after: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
a : ℝ
ha : a ∈ Ioi 1
⊢ ¬a = 1

tactic: exact ne_of_gt ha
state_before: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
C : ℂ
hC : Tendsto f (𝓝[≠] 1) (𝓝 C)
a : ℝ
ha : a ∈ Ioi 1
⊢ ¬a = 1
state_after: no goals

tactic: filter_upwards [self_mem_nhdsWithin] with s hs
state_before: case refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ ∀ᶠ (z : ℂ) in 𝓝[≠] 1, DifferentiableAt ℂ f z
state_after: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
s : ℂ
hs : s ∈ {1}ᶜ
⊢ DifferentiableAt ℂ f s

tactic: refine (differentiableAt_riemannZeta hs).sub ((differentiableAt_const _).div ?_ ?_)
state_before: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
s : ℂ
hs : s ∈ {1}ᶜ
⊢ DifferentiableAt ℂ f s
state_after: case h.refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
s : ℂ
hs : s ∈ {1}ᶜ
⊢ DifferentiableAt ℂ (fun s => s - 1) s

case h.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
s : ℂ
hs : s ∈ {1}ᶜ
⊢ s - 1 ≠ 0

tactic: fun_prop
state_before: case h.refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
s : ℂ
hs : s ∈ {1}ᶜ
⊢ DifferentiableAt ℂ (fun s => s - 1) s
state_after: no goals

tactic: rwa [mem_compl_singleton_iff, ← sub_ne_zero] at hs
state_before: case h.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
s : ℂ
hs : s ∈ {1}ᶜ
⊢ s - 1 ≠ 0
state_after: no goals

tactic: refine Asymptotics.isLittleO_of_tendsto' ?_ ?_
state_before: case refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ (fun z => f z - f 1) =o[𝓝[≠] 1] fun z => (z - 1)⁻¹
state_after: case refine_2.refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ ∀ᶠ (x : ℂ) in 𝓝[≠] 1, (x - 1)⁻¹ = 0 → f x - f 1 = 0

case refine_2.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => (f x - f 1) / (x - 1)⁻¹) (𝓝[≠] 1) (𝓝 0)

tactic: filter_upwards [self_mem_nhdsWithin] with t ht ht'
state_before: case refine_2.refine_1
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ ∀ᶠ (x : ℂ) in 𝓝[≠] 1, (x - 1)⁻¹ = 0 → f x - f 1 = 0
state_after: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
t : ℂ
ht : t ∈ {1}ᶜ
ht' : (t - 1)⁻¹ = 0
⊢ f t - f 1 = 0

tactic: rw [inv_eq_zero, sub_eq_zero] at ht'
state_before: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
t : ℂ
ht : t ∈ {1}ᶜ
ht' : (t - 1)⁻¹ = 0
⊢ f t - f 1 = 0
state_after: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
t : ℂ
ht : t ∈ {1}ᶜ
ht' : t = 1
⊢ f t - f 1 = 0

tactic: tauto
state_before: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
t : ℂ
ht : t ∈ {1}ᶜ
ht' : t = 1
⊢ f t - f 1 = 0
state_after: no goals

tactic: simp_rw [div_eq_mul_inv, inv_inv, sub_mul,
  (by ring_nf : 𝓝 (0 : ℂ) = 𝓝 ((1 - 1) - f 1 * (1 - 1)))]
state_before: case refine_2.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => (f x - f 1) / (x - 1)⁻¹) (𝓝[≠] 1) (𝓝 0)
state_after: case refine_2.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => f x * (x - 1) - f 1 * (x - 1)) (𝓝[≠] 1) (𝓝 (1 - 1 - f 1 * (1 - 1)))

tactic: apply Tendsto.sub
state_before: case refine_2.refine_2
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => f x * (x - 1) - f 1 * (x - 1)) (𝓝[≠] 1) (𝓝 (1 - 1 - f 1 * (1 - 1)))
state_after: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => f x * (x - 1)) (𝓝[≠] 1) (𝓝 (1 - 1))

case refine_2.refine_2.hg
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => f 1 * (x - 1)) (𝓝[≠] 1) (𝓝 (f 1 * (1 - 1)))

tactic: ring_nf
state_before: f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ 𝓝 0 = 𝓝 (1 - 1 - f 1 * (1 - 1))
state_after: no goals

tactic: simp_rw [mul_comm (f _), f, mul_sub]
state_before: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => f x * (x - 1)) (𝓝[≠] 1) (𝓝 (1 - 1))
state_after: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => (x - 1) * riemannZeta x - (x - 1) * (1 / (x - 1))) (𝓝[≠] 1) (𝓝 (1 - 1))

tactic: apply riemannZeta_residue_one.sub
state_before: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => (x - 1) * riemannZeta x - (x - 1) * (1 / (x - 1))) (𝓝[≠] 1) (𝓝 (1 - 1))
state_after: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => (x - 1) * (1 / (x - 1))) (𝓝[≠] 1) (𝓝 1)

tactic: refine Tendsto.congr' ?_ (tendsto_const_nhds.mono_left nhdsWithin_le_nhds)
state_before: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => (x - 1) * (1 / (x - 1))) (𝓝[≠] 1) (𝓝 1)
state_after: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ (fun x => 1) =ᶠ[𝓝[≠] 1] fun x => (x - 1) * (1 / (x - 1))

tactic: filter_upwards [self_mem_nhdsWithin] with x hx
state_before: case refine_2.refine_2.hf
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ (fun x => 1) =ᶠ[𝓝[≠] 1] fun x => (x - 1) * (1 / (x - 1))
state_after: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
x : ℂ
hx : x ∈ {1}ᶜ
⊢ 1 = (x - 1) * (1 / (x - 1))

tactic: field_simp [sub_ne_zero.mpr <| mem_compl_singleton_iff.mp hx]
state_before: case h
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
x : ℂ
hx : x ∈ {1}ᶜ
⊢ 1 = (x - 1) * (1 / (x - 1))
state_after: no goals

tactic: exact ((tendsto_id.sub tendsto_const_nhds).mono_left nhdsWithin_le_nhds).const_mul _
state_before: case refine_2.refine_2.hg
f : ℂ → ℂ := fun s => riemannZeta s - 1 / (s - 1)
⊢ Tendsto (fun x => f 1 * (x - 1)) (𝓝[≠] 1) (𝓝 (f 1 * (1 - 1)))
state_after: no goals