Theorem: Real.tendsto_eulerMascheroniSeq'
File: Mathlib/NumberTheory/Harmonic/EulerMascheroni.lean

tactic: suffices Tendsto (fun n ↦ eulerMascheroniSeq' n - eulerMascheroniSeq n) atTop (𝓝 0) by
  simpa using this.add tendsto_eulerMascheroniSeq
state_before: ⊢ Tendsto eulerMascheroniSeq' atTop (𝓝 eulerMascheroniConstant)
state_after: ⊢ Tendsto (fun n => eulerMascheroniSeq' n - eulerMascheroniSeq n) atTop (𝓝 0)

tactic: suffices Tendsto (fun x : ℝ ↦ log (x + 1) - log x) atTop (𝓝 0) by
  apply (this.comp tendsto_natCast_atTop_atTop).congr'
  filter_upwards [eventually_ne_atTop 0] with n hn
  simp [eulerMascheroniSeq, eulerMascheroniSeq', eq_false_intro hn]
state_before: ⊢ Tendsto (fun n => eulerMascheroniSeq' n - eulerMascheroniSeq n) atTop (𝓝 0)
state_after: ⊢ Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)

tactic: suffices Tendsto (fun x : ℝ ↦ log (1 + 1 / x)) atTop (𝓝 0) by
  apply this.congr'
  filter_upwards [eventually_gt_atTop 0] with x hx
  rw [← log_div (by positivity) (by positivity), add_div, div_self hx.ne']
state_before: ⊢ Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
state_after: ⊢ Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)

tactic: simpa only [add_zero, log_one] using
  ((tendsto_const_nhds.div_atTop tendsto_id).const_add 1).log (by positivity)
state_before: ⊢ Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
state_after: no goals

tactic: simpa using this.add tendsto_eulerMascheroniSeq
state_before: this : Tendsto (fun n => eulerMascheroniSeq' n - eulerMascheroniSeq n) atTop (𝓝 0)
⊢ Tendsto eulerMascheroniSeq' atTop (𝓝 eulerMascheroniConstant)
state_after: no goals

tactic: apply (this.comp tendsto_natCast_atTop_atTop).congr'
state_before: this : Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
⊢ Tendsto (fun n => eulerMascheroniSeq' n - eulerMascheroniSeq n) atTop (𝓝 0)
state_after: this : Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
⊢ (fun x => log (x + 1) - log x) ∘ Nat.cast =ᶠ[atTop] fun n => eulerMascheroniSeq' n - eulerMascheroniSeq n

tactic: filter_upwards [eventually_ne_atTop 0] with n hn
state_before: this : Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
⊢ (fun x => log (x + 1) - log x) ∘ Nat.cast =ᶠ[atTop] fun n => eulerMascheroniSeq' n - eulerMascheroniSeq n
state_after: case h
this : Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
n : ℕ
hn : n ≠ 0
⊢ ((fun x => log (x + 1) - log x) ∘ Nat.cast) n = eulerMascheroniSeq' n - eulerMascheroniSeq n

tactic: simp [eulerMascheroniSeq, eulerMascheroniSeq', eq_false_intro hn]
state_before: case h
this : Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
n : ℕ
hn : n ≠ 0
⊢ ((fun x => log (x + 1) - log x) ∘ Nat.cast) n = eulerMascheroniSeq' n - eulerMascheroniSeq n
state_after: no goals

tactic: apply this.congr'
state_before: this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
⊢ Tendsto (fun x => log (x + 1) - log x) atTop (𝓝 0)
state_after: this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
⊢ (fun x => log (1 + 1 / x)) =ᶠ[atTop] fun x => log (x + 1) - log x

tactic: filter_upwards [eventually_gt_atTop 0] with x hx
state_before: this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
⊢ (fun x => log (1 + 1 / x)) =ᶠ[atTop] fun x => log (x + 1) - log x
state_after: case h
this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
x : ℝ
hx : 0 < x
⊢ log (1 + 1 / x) = log (x + 1) - log x

tactic: rw [← log_div (by positivity) (by positivity), add_div, div_self hx.ne']
state_before: case h
this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
x : ℝ
hx : 0 < x
⊢ log (1 + 1 / x) = log (x + 1) - log x
state_after: no goals

tactic: positivity
state_before: this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
x : ℝ
hx : 0 < x
⊢ x + 1 ≠ 0
state_after: no goals

tactic: positivity
state_before: this : Tendsto (fun x => log (1 + 1 / x)) atTop (𝓝 0)
x : ℝ
hx : 0 < x
⊢ x ≠ 0
state_after: no goals

tactic: positivity
state_before: ⊢ 1 + 0 ≠ 0
state_after: no goals