l3lab/ntp-mathlib huggingface dataset:
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
⊢ ∀ (k : ℤ), ↑π * s ≠ ↑k * ↑π

Next tactic:
intro k
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      intro k
      

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
k : ℤ
⊢ ↑π * s ≠ ↑k * ↑π

Next tactic:
apply_fun im
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      intro k
      apply_fun im
      

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
k : ℤ
⊢ (↑π * s).im ≠ (↑k * ↑π).im

Next tactic:
rw [ofReal_mul_im, ← ofReal_int_cast, ← ofReal_mul, ofReal_im]
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      intro k
      apply_fun im
      rw [ofReal_mul_im, ← ofReal_int_cast, ← ofReal_mul, ofReal_im]
      

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
k : ℤ
⊢ π * s.im ≠ 0

Next tactic:
exact mul_ne_zero Real.pi_pos.ne' h_im
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      intro k
      apply_fun im
      rw [ofReal_mul_im, ← ofReal_int_cast, ← ofReal_mul, ofReal_im]
      exact mul_ne_zero Real.pi_pos.ne' h_im
    

Proof state:
case neg
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
this : sin (↑π * s) ≠ 0
⊢ Gamma s ≠ 0

Next tactic:
have A := div_ne_zero (ofReal_ne_zero.mpr Real.pi_pos.ne') this
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      intro k
      apply_fun im
      rw [ofReal_mul_im, ← ofReal_int_cast, ← ofReal_mul, ofReal_im]
      exact mul_ne_zero Real.pi_pos.ne' h_im
    have A := div_ne_zero (ofReal_ne_zero.mpr Real.pi_pos.ne') this
    

Proof state:
case neg
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
this : sin (↑π * s) ≠ 0
A : ↑π / sin (↑π * s) ≠ 0
⊢ Gamma s ≠ 0

Next tactic:
rw [← Complex.Gamma_mul_Gamma_one_sub s, mul_ne_zero_iff] at A
/-- The Gamma function does not vanish on `ℂ` (except at non-positive integers, where the function
is mathematically undefined and we set it to `0` by convention). -/
theorem Gamma_ne_zero {s : ℂ} (hs : ∀ m : ℕ, s ≠ -m) : Gamma s ≠ 0 := by
  by_cases h_im : s.im = 0
  · have : s = ↑s.re := by
      conv_lhs => rw [← Complex.re_add_im s]
      rw [h_im, ofReal_zero, zero_mul, add_zero]
    rw [this, Gamma_ofReal, ofReal_ne_zero]
    refine' Real.Gamma_ne_zero fun n => _
    specialize hs n
    contrapose! hs
    rwa [this, ← ofReal_nat_cast, ← ofReal_neg, ofReal_inj]
  · have : sin (↑π * s) ≠ 0 := by
      rw [Complex.sin_ne_zero_iff]
      intro k
      apply_fun im
      rw [ofReal_mul_im, ← ofReal_int_cast, ← ofReal_mul, ofReal_im]
      exact mul_ne_zero Real.pi_pos.ne' h_im
    have A := div_ne_zero (ofReal_ne_zero.mpr Real.pi_pos.ne') this
    rw [← Complex.Gamma_mul_Gamma_one_sub s, mul_ne_zero_iff] at A
    

Proof state:
case neg
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
h_im : ¬s.im = 0
this : sin (↑π * s) ≠ 0
A : Gamma s ≠ 0 ∧ Gamma (1 - s) ≠ 0
⊢ Gamma s ≠ 0

Next tactic:
exact A.1
theorem Gamma_eq_zero_iff (s : ℂ) : Gamma s = 0 ↔ ∃ m : ℕ, s = -m := by
  

Proof state:
s : ℂ
⊢ Gamma s = 0 ↔ ∃ m, s = -↑m

Next tactic:
constructor
theorem Gamma_eq_zero_iff (s : ℂ) : Gamma s = 0 ↔ ∃ m : ℕ, s = -m := by
  constructor
  · 

Proof state:
case mp
s : ℂ
⊢ Gamma s = 0 → ∃ m, s = -↑m

Next tactic:
contrapose!
theorem Gamma_eq_zero_iff (s : ℂ) : Gamma s = 0 ↔ ∃ m : ℕ, s = -m := by
  constructor
  · contrapose!; 

Proof state:
case mp
s : ℂ
⊢ (∀ (m : ℕ), s ≠ -↑m) → Gamma s ≠ 0

Next tactic:
exact Gamma_ne_zero
theorem Gamma_eq_zero_iff (s : ℂ) : Gamma s = 0 ↔ ∃ m : ℕ, s = -m := by
  constructor
  · contrapose!; exact Gamma_ne_zero
  · 

Proof state:
case mpr
s : ℂ
⊢ (∃ m, s = -↑m) → Gamma s = 0

Next tactic:
rintro ⟨m, rfl⟩
theorem Gamma_eq_zero_iff (s : ℂ) : Gamma s = 0 ↔ ∃ m : ℕ, s = -m := by
  constructor
  · contrapose!; exact Gamma_ne_zero
  · rintro ⟨m, rfl⟩; 

Proof state:
case mpr.intro
m : ℕ
⊢ Gamma (-↑m) = 0

Next tactic:
exact Gamma_neg_nat_eq_zero m
/-- A weaker, but easier-to-apply, version of `Complex.Gamma_ne_zero`. -/
theorem Gamma_ne_zero_of_re_pos {s : ℂ} (hs : 0 < re s) : Gamma s ≠ 0 := by
  

Proof state:
s : ℂ
hs : 0 < s.re
⊢ Gamma s ≠ 0

Next tactic:
refine' Gamma_ne_zero fun m => _
/-- A weaker, but easier-to-apply, version of `Complex.Gamma_ne_zero`. -/
theorem Gamma_ne_zero_of_re_pos {s : ℂ} (hs : 0 < re s) : Gamma s ≠ 0 := by
  refine' Gamma_ne_zero fun m => _
  

Proof state:
s : ℂ
hs : 0 < s.re
m : ℕ
⊢ s ≠ -↑m

Next tactic:
contrapose! hs
/-- A weaker, but easier-to-apply, version of `Complex.Gamma_ne_zero`. -/
theorem Gamma_ne_zero_of_re_pos {s : ℂ} (hs : 0 < re s) : Gamma s ≠ 0 := by
  refine' Gamma_ne_zero fun m => _
  contrapose! hs
  

Proof state:
s : ℂ
m : ℕ
hs : s = -↑m
⊢ s.re ≤ 0

Next tactic:
simpa only [hs, neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg _
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  

Proof state:
s : ℝ
⊢ Tendsto (GammaSeq s) atTop (𝓝 (Gamma s))

Next tactic:
suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
  

Proof state:
s : ℝ
this : Tendsto (Complex.ofReal' ∘ GammaSeq s) atTop (𝓝 (Complex.Gamma ↑s))
⊢ Tendsto (GammaSeq s) atTop (𝓝 (Gamma s))
case this s : ℝ ⊢ Tendsto (Complex.ofReal' ∘ GammaSeq s) atTop (𝓝 (Complex.Gamma ↑s))

Next tactic:
exact (Complex.continuous_re.tendsto (Complex.Gamma ↑s)).comp this
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
  exact (Complex.continuous_re.tendsto (Complex.Gamma ↑s)).comp this
  

Proof state:
case this
s : ℝ
⊢ Tendsto (Complex.ofReal' ∘ GammaSeq s) atTop (𝓝 (Complex.Gamma ↑s))

Next tactic:
convert Complex.GammaSeq_tendsto_Gamma s
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
  exact (Complex.continuous_re.tendsto (Complex.Gamma ↑s)).comp this
  convert Complex.GammaSeq_tendsto_Gamma s
  

Proof state:
case h.e'_3
s : ℝ
⊢ Complex.ofReal' ∘ GammaSeq s = Complex.GammaSeq ↑s

Next tactic:
ext1 n
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
  exact (Complex.continuous_re.tendsto (Complex.Gamma ↑s)).comp this
  convert Complex.GammaSeq_tendsto_Gamma s
  ext1 n
  

Proof state:
case h.e'_3.h
s : ℝ
n : ℕ
⊢ (Complex.ofReal' ∘ GammaSeq s) n = Complex.GammaSeq (↑s) n

Next tactic:
dsimp only [GammaSeq, Function.comp_apply, Complex.GammaSeq]
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
  exact (Complex.continuous_re.tendsto (Complex.Gamma ↑s)).comp this
  convert Complex.GammaSeq_tendsto_Gamma s
  ext1 n
  dsimp only [GammaSeq, Function.comp_apply, Complex.GammaSeq]
  

Proof state:
case h.e'_3.h
s : ℝ
n : ℕ
⊢ ↑(↑n ^ s * ↑n ! / ∏ j in Finset.range (n + 1), (s + ↑j)) = ↑n ^ ↑s * ↑n ! / ∏ j in Finset.range (n + 1), (↑s + ↑j)

Next tactic:
push_cast
/-- Euler's limit formula for the real Gamma function. -/
theorem GammaSeq_tendsto_Gamma (s : ℝ) : Tendsto (GammaSeq s) atTop (𝓝 <| Gamma s) := by
  suffices : Tendsto ((↑) ∘ GammaSeq s : ℕ → ℂ) atTop (𝓝 <| Complex.Gamma s)
  exact (Complex.continuous_re.tendsto (Complex.Gamma ↑s)).comp this
  convert Complex.GammaSeq_tendsto_Gamma s
  ext1 n
  dsimp only [GammaSeq, Function.comp_apply, Complex.GammaSeq]
  push_cast
  

Proof state:
case h.e'_3.h
s : ℝ
n : ℕ
⊢ ↑(↑n ^ s) * ↑n ! / ∏ x in Finset.range (n + 1), (↑s + ↑x) = ↑n ^ ↑s * ↑n ! / ∏ x in Finset.range (n + 1), (↑s + ↑x)

Next tactic:
rw [Complex.ofReal_cpow n.cast_nonneg, Complex.ofReal_nat_cast]
/-- Euler's reflection formula for the real Gamma function. -/
theorem Gamma_mul_Gamma_one_sub (s : ℝ) : Gamma s * Gamma (1 - s) = π / sin (π * s) := by
  

Proof state:
s : ℝ
⊢ Gamma s * Gamma (1 - s) = π / sin (π * s)

Next tactic:
simp_rw [← Complex.ofReal_inj, Complex.ofReal_div, Complex.ofReal_sin, Complex.ofReal_mul, ←
    Complex.Gamma_ofReal, Complex.ofReal_sub, Complex.ofReal_one]
/-- Euler's reflection formula for the real Gamma function. -/
theorem Gamma_mul_Gamma_one_sub (s : ℝ) : Gamma s * Gamma (1 - s) = π / sin (π * s) := by
  simp_rw [← Complex.ofReal_inj, Complex.ofReal_div, Complex.ofReal_sin, Complex.ofReal_mul, ←
    Complex.Gamma_ofReal, Complex.ofReal_sub, Complex.ofReal_one]
  

Proof state:
s : ℝ
⊢ Complex.Gamma ↑s * Complex.Gamma (1 - ↑s) = ↑π / Complex.sin (↑π * ↑s)

Next tactic:
exact Complex.Gamma_mul_Gamma_one_sub s
/-- A reformulation of the Gamma recurrence relation which is true for `s = 0` as well. -/
theorem one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (s : ℂ) :
    (Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹ := by
  

Proof state:
s : ℂ
⊢ (Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹

Next tactic:
rcases ne_or_eq s 0 with (h | rfl)
/-- A reformulation of the Gamma recurrence relation which is true for `s = 0` as well. -/
theorem one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (s : ℂ) :
    (Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹ := by
  rcases ne_or_eq s 0 with (h | rfl)
  · 

Proof state:
case inl
s : ℂ
h : s ≠ 0
⊢ (Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹

Next tactic:
rw [Gamma_add_one s h, mul_inv, mul_inv_cancel_left₀ h]
/-- A reformulation of the Gamma recurrence relation which is true for `s = 0` as well. -/
theorem one_div_Gamma_eq_self_mul_one_div_Gamma_add_one (s : ℂ) :
    (Gamma s)⁻¹ = s * (Gamma (s + 1))⁻¹ := by
  rcases ne_or_eq s 0 with (h | rfl)
  · rw [Gamma_add_one s h, mul_inv, mul_inv_cancel_left₀ h]
  · 

Proof state:
case inr
⊢ (Gamma 0)⁻¹ = 0 * (Gamma (0 + 1))⁻¹

Next tactic:
rw [zero_add, Gamma_zero, inv_zero, zero_mul]
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  

Proof state:
⊢ Differentiable ℂ fun s => (Gamma s)⁻¹

Next tactic:
suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  

Proof state:
this : ∀ (n : ℕ) (s : ℂ), -s.re < ↑n → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s
⊢ Differentiable ℂ fun s => (Gamma s)⁻¹
case this ⊢ ∀ (n : ℕ) (s : ℂ), -s.re < ↑n → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  

Proof state:
case this
⊢ ∀ (n : ℕ) (s : ℂ), -s.re < ↑n → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
intro n
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  

Proof state:
case this
n : ℕ
⊢ ∀ (s : ℂ), -s.re < ↑n → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
induction' n with m hm
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · 

Proof state:
case this.zero
⊢ ∀ (s : ℂ), -s.re < ↑Nat.zero → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
intro s hs
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    

Proof state:
case this.zero
s : ℂ
hs : -s.re < ↑Nat.zero
⊢ DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
rw [Nat.cast_zero, neg_lt_zero] at hs
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    

Proof state:
case this.zero
s : ℂ
hs : 0 < s.re
⊢ DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
suffices : ∀ m : ℕ, s ≠ -↑m
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; 

Proof state:
case this.zero
s : ℂ
hs : 0 < s.re
this : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s
case this s : ℂ hs : 0 < s.re ⊢ ∀ (m : ℕ), s ≠ -↑m

Next tactic:
exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    

Proof state:
case this
s : ℂ
hs : 0 < s.re
⊢ ∀ (m : ℕ), s ≠ -↑m

Next tactic:
contrapose! hs
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    contrapose! hs
    

Proof state:
case this
s : ℂ
hs : ∃ m, s = -↑m
⊢ s.re ≤ 0

Next tactic:
rcases hs with ⟨m, rfl⟩
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    contrapose! hs
    rcases hs with ⟨m, rfl⟩
    

Proof state:
case this.intro
m : ℕ
⊢ (-↑m).re ≤ 0

Next tactic:
simpa only [neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg m
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    contrapose! hs
    rcases hs with ⟨m, rfl⟩
    simpa only [neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg m
  · 

Proof state:
case this.succ
m : ℕ
hm : ∀ (s : ℂ), -s.re < ↑m → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s
⊢ ∀ (s : ℂ), -s.re < ↑(Nat.succ m) → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
intro s hs
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    contrapose! hs
    rcases hs with ⟨m, rfl⟩
    simpa only [neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg m
  · intro s hs
    

Proof state:
case this.succ
m : ℕ
hm : ∀ (s : ℂ), -s.re < ↑m → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s
s : ℂ
hs : -s.re < ↑(Nat.succ m)
⊢ DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s

Next tactic:
rw [funext one_div_Gamma_eq_self_mul_one_div_Gamma_add_one]
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    contrapose! hs
    rcases hs with ⟨m, rfl⟩
    simpa only [neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg m
  · intro s hs
    rw [funext one_div_Gamma_eq_self_mul_one_div_Gamma_add_one]
    

Proof state:
case this.succ
m : ℕ
hm : ∀ (s : ℂ), -s.re < ↑m → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s
s : ℂ
hs : -s.re < ↑(Nat.succ m)
⊢ DifferentiableAt ℂ (fun x => x * (Gamma (x + 1))⁻¹) s

Next tactic:
specialize hm (s + 1) (by rwa [add_re, one_re, neg_add', sub_lt_iff_lt_add, ← Nat.cast_succ])
/-- The reciprocal of the Gamma function is differentiable everywhere (including the points where
Gamma itself is not). -/
theorem differentiable_one_div_Gamma : Differentiable ℂ fun s : ℂ => (Gamma s)⁻¹ := by
  suffices : ∀ n : ℕ, ∀ (s : ℂ) (_ : -s.re < n), DifferentiableAt ℂ (fun u : ℂ => (Gamma u)⁻¹) s
  exact fun s =>
    let ⟨n, h⟩ := exists_nat_gt (-s.re)
    this n s h
  intro n
  induction' n with m hm
  · intro s hs
    rw [Nat.cast_zero, neg_lt_zero] at hs
    suffices : ∀ m : ℕ, s ≠ -↑m; exact (differentiableAt_Gamma _ this).inv (Gamma_ne_zero this)
    contrapose! hs
    rcases hs with ⟨m, rfl⟩
    simpa only [neg_re, ← ofReal_nat_cast, ofReal_re, neg_nonpos] using Nat.cast_nonneg m
  · intro s hs
    rw [funext one_div_Gamma_eq_self_mul_one_div_Gamma_add_one]
    specialize hm (s + 1) (by 

Proof state:
m : ℕ
hm : ∀ (s : ℂ), -s.re < ↑m → DifferentiableAt ℂ (fun u => (Gamma u)⁻¹) s
s : ℂ
hs : -s.re < ↑(Nat.succ m)
⊢ -(s + 1).re < ↑m

Next tactic:
rwa [add_re, one_re, neg_add', sub_lt_iff_lt_add, ← Nat.cast_succ]