Theorem: Complex.GammaSeq_tendsto_Gamma
File: Mathlib/Analysis/SpecialFunctions/Gamma/Beta.lean

tactic: intro m
state_before: s : ℂ
⊢ ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
state_after: s : ℂ
m : ℕ
⊢ -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))

tactic: induction' m with m IH generalizing s
state_before: s : ℂ
m : ℕ
⊢ -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
state_after: case zero
s : ℂ
⊢ -↑0 < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux 0 s))

case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
⊢ -↑(m + 1) < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux (m + 1) s))

tactic: rw [Gamma]
state_before: s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ Tendsto s.GammaSeq atTop (𝓝 (Gamma s))
state_after: s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux ⌊1 - s.re⌋₊ s))

tactic: apply this
state_before: s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux ⌊1 - s.re⌋₊ s))
state_after: case a
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ -↑⌊1 - s.re⌋₊ < s.re

tactic: rw [neg_lt]
state_before: case a
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ -↑⌊1 - s.re⌋₊ < s.re
state_after: case a
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ -s.re < ↑⌊1 - s.re⌋₊

tactic: rcases lt_or_le 0 (re s) with (hs | hs)
state_before: case a
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
⊢ -s.re < ↑⌊1 - s.re⌋₊
state_after: case a.inl
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
hs : 0 < s.re
⊢ -s.re < ↑⌊1 - s.re⌋₊

case a.inr
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
hs : s.re ≤ 0
⊢ -s.re < ↑⌊1 - s.re⌋₊

tactic: exact (neg_neg_of_pos hs).trans_le (Nat.cast_nonneg _)
state_before: case a.inl
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
hs : 0 < s.re
⊢ -s.re < ↑⌊1 - s.re⌋₊
state_after: no goals

tactic: refine (Nat.lt_floor_add_one _).trans_le ?_
state_before: case a.inr
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
hs : s.re ≤ 0
⊢ -s.re < ↑⌊1 - s.re⌋₊
state_after: case a.inr
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
hs : s.re ≤ 0
⊢ ↑⌊-s.re⌋₊ + 1 ≤ ↑⌊1 - s.re⌋₊

tactic: rw [sub_eq_neg_add, Nat.floor_add_one (neg_nonneg.mpr hs), Nat.cast_add_one]
state_before: case a.inr
s : ℂ
this : ∀ (m : ℕ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
hs : s.re ≤ 0
⊢ ↑⌊-s.re⌋₊ + 1 ≤ ↑⌊1 - s.re⌋₊
state_after: no goals

tactic: intro hs
state_before: case zero
s : ℂ
⊢ -↑0 < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux 0 s))
state_after: case zero
s : ℂ
hs : -↑0 < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux 0 s))

tactic: rw [Nat.cast_zero, neg_zero] at hs
state_before: case zero
s : ℂ
hs : -↑0 < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux 0 s))
state_after: case zero
s : ℂ
hs : 0 < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux 0 s))

tactic: rw [← Gamma_eq_GammaAux]
state_before: case zero
s : ℂ
hs : 0 < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux 0 s))
state_after: case zero
s : ℂ
hs : 0 < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (Gamma s))

case zero.h1
s : ℂ
hs : 0 < s.re
⊢ -s.re < ↑0

tactic: refine Tendsto.congr' ?_ (approx_Gamma_integral_tendsto_Gamma_integral hs)
state_before: case zero
s : ℂ
hs : 0 < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (Gamma s))
state_after: case zero
s : ℂ
hs : 0 < s.re
⊢ (fun n => ∫ (x : ℝ) in 0 ..↑n, ↑((1 - x / ↑n) ^ n) * ↑x ^ (s - 1)) =ᶠ[atTop] s.GammaSeq

tactic: refine (eventually_ne_atTop 0).mp (eventually_of_forall fun n hn => ?_)
state_before: case zero
s : ℂ
hs : 0 < s.re
⊢ (fun n => ∫ (x : ℝ) in 0 ..↑n, ↑((1 - x / ↑n) ^ n) * ↑x ^ (s - 1)) =ᶠ[atTop] s.GammaSeq
state_after: case zero
s : ℂ
hs : 0 < s.re
n : ℕ
hn : n ≠ 0
⊢ (fun n => ∫ (x : ℝ) in 0 ..↑n, ↑((1 - x / ↑n) ^ n) * ↑x ^ (s - 1)) n = s.GammaSeq n

tactic: exact (GammaSeq_eq_approx_Gamma_integral hs hn).symm
state_before: case zero
s : ℂ
hs : 0 < s.re
n : ℕ
hn : n ≠ 0
⊢ (fun n => ∫ (x : ℝ) in 0 ..↑n, ↑((1 - x / ↑n) ^ n) * ↑x ^ (s - 1)) n = s.GammaSeq n
state_after: no goals

tactic: rwa [Nat.cast_zero, neg_lt_zero]
state_before: case zero.h1
s : ℂ
hs : 0 < s.re
⊢ -s.re < ↑0
state_after: no goals

tactic: intro hs
state_before: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
⊢ -↑(m + 1) < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux (m + 1) s))
state_after: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑(m + 1) < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux (m + 1) s))

tactic: rw [Nat.cast_succ, neg_add, ← sub_eq_add_neg, sub_lt_iff_lt_add, ← one_re, ← add_re] at hs
state_before: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑(m + 1) < s.re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux (m + 1) s))
state_after: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux (m + 1) s))

tactic: rw [GammaAux]
state_before: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ Tendsto s.GammaSeq atTop (𝓝 (GammaAux (m + 1) s))
state_after: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))

tactic: have := @Tendsto.congr' _ _ _ ?_ _ _
  ((eventually_ne_atTop 0).mp (eventually_of_forall fun n hn => ?_)) ((IH _ hs).div_const s)
state_before: case succ
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))
state_after: case succ.refine_3
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto ?succ.refine_1 atTop (𝓝 (GammaAux m (s + 1) / s))
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))

case succ.refine_1
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ ℕ → ℂ

case succ.refine_2
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
n : ℕ
hn : n ≠ 0
⊢ (s + 1).GammaSeq n / s = ?succ.refine_1 n

tactic: pick_goal 3
state_before: case succ.refine_3
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto ?succ.refine_1 atTop (𝓝 (GammaAux m (s + 1) / s))
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))

case succ.refine_1
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ ℕ → ℂ

case succ.refine_2
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
n : ℕ
hn : n ≠ 0
⊢ (s + 1).GammaSeq n / s = ?succ.refine_1 n
state_after: case succ.refine_2
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
n : ℕ
hn : n ≠ 0
⊢ (s + 1).GammaSeq n / s = ?succ.refine_1 n

case succ.refine_3
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto ?succ.refine_1 atTop (𝓝 (GammaAux m (s + 1) / s))
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))

case succ.refine_1
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
⊢ ℕ → ℂ

tactic: conv at this => arg 1; intro n; rw [mul_comm]
state_before: case succ.refine_3
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => ↑n / (↑n + 1 + s) * s.GammaSeq n) atTop (𝓝 (GammaAux m (s + 1) / s))
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))
state_after: case succ.refine_3
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => s.GammaSeq n * (↑n / (↑n + 1 + s))) atTop (𝓝 (GammaAux m (s + 1) / s))
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))

tactic: rwa [← mul_one (GammaAux m (s + 1) / s), tendsto_mul_iff_of_ne_zero _ (one_ne_zero' ℂ)] at this
state_before: case succ.refine_3
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => s.GammaSeq n * (↑n / (↑n + 1 + s))) atTop (𝓝 (GammaAux m (s + 1) / s))
⊢ Tendsto s.GammaSeq atTop (𝓝 ((fun s => GammaAux m (s + 1) / s) s))
state_after: m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => s.GammaSeq n * (↑n / (↑n + 1 + s))) atTop (𝓝 (GammaAux m (s + 1) / s * 1))
⊢ Tendsto (fun n => ↑n / (↑n + 1 + s)) atTop (𝓝 1)

tactic: simp_rw [add_assoc]
state_before: m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => s.GammaSeq n * (↑n / (↑n + 1 + s))) atTop (𝓝 (GammaAux m (s + 1) / s * 1))
⊢ Tendsto (fun n => ↑n / (↑n + 1 + s)) atTop (𝓝 1)
state_after: m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => s.GammaSeq n * (↑n / (↑n + 1 + s))) atTop (𝓝 (GammaAux m (s + 1) / s * 1))
⊢ Tendsto (fun n => ↑n / (↑n + (1 + s))) atTop (𝓝 1)

tactic: exact tendsto_natCast_div_add_atTop (1 + s)
state_before: m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
this : Tendsto (fun n => s.GammaSeq n * (↑n / (↑n + 1 + s))) atTop (𝓝 (GammaAux m (s + 1) / s * 1))
⊢ Tendsto (fun n => ↑n / (↑n + (1 + s))) atTop (𝓝 1)
state_after: no goals

tactic: exact GammaSeq_add_one_left s hn
state_before: case succ.refine_2
m : ℕ
IH : ∀ (s : ℂ), -↑m < s.re → Tendsto s.GammaSeq atTop (𝓝 (GammaAux m s))
s : ℂ
hs : -↑m < (s + 1).re
n : ℕ
hn : n ≠ 0
⊢ (s + 1).GammaSeq n / s = ?succ.refine_1 n
state_after: no goals