l3lab/ntp-mathlib huggingface dataset:
theorem differentiableAt_GammaAux (s : ℂ) (n : ℕ) (h1 : 1 - s.re < n) (h2 : ∀ m : ℕ, s ≠ -m) :
    DifferentiableAt ℂ (GammaAux n) s := by
  induction' n with n hn generalizing s
  · refine' (hasDerivAt_GammaIntegral _).differentiableAt
    rw [Nat.cast_zero] at h1; linarith
  · dsimp only [GammaAux]
    specialize hn (s + 1)
    have a : 1 - (s + 1).re < ↑n := by
      rw [Nat.cast_succ] at h1; rw [Complex.add_re, Complex.one_re]; linarith
    have b : ∀ m : ℕ, s + 1 ≠ -m := by
      intro m; have := h2 (1 + m)
      contrapose! this
      rw [← eq_sub_iff_add_eq] at this
      simpa using this
    refine' DifferentiableAt.div (DifferentiableAt.comp _ (hn a b) _) _ _
    · 

Proof state:
case succ.refine'_1
n : ℕ
s : ℂ
h1 : 1 - s.re < ↑(Nat.succ n)
h2 : ∀ (m : ℕ), s ≠ -↑m
hn : 1 - (s + 1).re < ↑n → (∀ (m : ℕ), s + 1 ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) (s + 1)
a : 1 - (s + 1).re < ↑n
b : ∀ (m : ℕ), s + 1 ≠ -↑m
⊢ DifferentiableAt ℂ (fun s => s + 1) s

Next tactic:
rw [differentiableAt_add_const_iff (1 : ℂ)]
theorem differentiableAt_GammaAux (s : ℂ) (n : ℕ) (h1 : 1 - s.re < n) (h2 : ∀ m : ℕ, s ≠ -m) :
    DifferentiableAt ℂ (GammaAux n) s := by
  induction' n with n hn generalizing s
  · refine' (hasDerivAt_GammaIntegral _).differentiableAt
    rw [Nat.cast_zero] at h1; linarith
  · dsimp only [GammaAux]
    specialize hn (s + 1)
    have a : 1 - (s + 1).re < ↑n := by
      rw [Nat.cast_succ] at h1; rw [Complex.add_re, Complex.one_re]; linarith
    have b : ∀ m : ℕ, s + 1 ≠ -m := by
      intro m; have := h2 (1 + m)
      contrapose! this
      rw [← eq_sub_iff_add_eq] at this
      simpa using this
    refine' DifferentiableAt.div (DifferentiableAt.comp _ (hn a b) _) _ _
    · rw [differentiableAt_add_const_iff (1 : ℂ)]; 

Proof state:
case succ.refine'_1
n : ℕ
s : ℂ
h1 : 1 - s.re < ↑(Nat.succ n)
h2 : ∀ (m : ℕ), s ≠ -↑m
hn : 1 - (s + 1).re < ↑n → (∀ (m : ℕ), s + 1 ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) (s + 1)
a : 1 - (s + 1).re < ↑n
b : ∀ (m : ℕ), s + 1 ≠ -↑m
⊢ DifferentiableAt ℂ (fun s => s) s

Next tactic:
exact differentiableAt_id
theorem differentiableAt_GammaAux (s : ℂ) (n : ℕ) (h1 : 1 - s.re < n) (h2 : ∀ m : ℕ, s ≠ -m) :
    DifferentiableAt ℂ (GammaAux n) s := by
  induction' n with n hn generalizing s
  · refine' (hasDerivAt_GammaIntegral _).differentiableAt
    rw [Nat.cast_zero] at h1; linarith
  · dsimp only [GammaAux]
    specialize hn (s + 1)
    have a : 1 - (s + 1).re < ↑n := by
      rw [Nat.cast_succ] at h1; rw [Complex.add_re, Complex.one_re]; linarith
    have b : ∀ m : ℕ, s + 1 ≠ -m := by
      intro m; have := h2 (1 + m)
      contrapose! this
      rw [← eq_sub_iff_add_eq] at this
      simpa using this
    refine' DifferentiableAt.div (DifferentiableAt.comp _ (hn a b) _) _ _
    · rw [differentiableAt_add_const_iff (1 : ℂ)]; exact differentiableAt_id
    · 

Proof state:
case succ.refine'_2
n : ℕ
s : ℂ
h1 : 1 - s.re < ↑(Nat.succ n)
h2 : ∀ (m : ℕ), s ≠ -↑m
hn : 1 - (s + 1).re < ↑n → (∀ (m : ℕ), s + 1 ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) (s + 1)
a : 1 - (s + 1).re < ↑n
b : ∀ (m : ℕ), s + 1 ≠ -↑m
⊢ DifferentiableAt ℂ (fun s => s) s

Next tactic:
exact differentiableAt_id
theorem differentiableAt_GammaAux (s : ℂ) (n : ℕ) (h1 : 1 - s.re < n) (h2 : ∀ m : ℕ, s ≠ -m) :
    DifferentiableAt ℂ (GammaAux n) s := by
  induction' n with n hn generalizing s
  · refine' (hasDerivAt_GammaIntegral _).differentiableAt
    rw [Nat.cast_zero] at h1; linarith
  · dsimp only [GammaAux]
    specialize hn (s + 1)
    have a : 1 - (s + 1).re < ↑n := by
      rw [Nat.cast_succ] at h1; rw [Complex.add_re, Complex.one_re]; linarith
    have b : ∀ m : ℕ, s + 1 ≠ -m := by
      intro m; have := h2 (1 + m)
      contrapose! this
      rw [← eq_sub_iff_add_eq] at this
      simpa using this
    refine' DifferentiableAt.div (DifferentiableAt.comp _ (hn a b) _) _ _
    · rw [differentiableAt_add_const_iff (1 : ℂ)]; exact differentiableAt_id
    · exact differentiableAt_id
    · 

Proof state:
case succ.refine'_3
n : ℕ
s : ℂ
h1 : 1 - s.re < ↑(Nat.succ n)
h2 : ∀ (m : ℕ), s ≠ -↑m
hn : 1 - (s + 1).re < ↑n → (∀ (m : ℕ), s + 1 ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) (s + 1)
a : 1 - (s + 1).re < ↑n
b : ∀ (m : ℕ), s + 1 ≠ -↑m
⊢ s ≠ 0

Next tactic:
simpa using h2 0
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ Gamma s

Next tactic:
let n := ⌊1 - s.re⌋₊ + 1
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
⊢ DifferentiableAt ℂ Gamma s

Next tactic:
have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
⊢ DifferentiableAt ℂ Gamma s

Next tactic:
apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
⊢ Gamma =ᶠ[𝓝 s] GammaAux n

Next tactic:
let S := {t : ℂ | 1 - t.re < n}
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ Gamma =ᶠ[𝓝 s] GammaAux n

Next tactic:
have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ S ∈ 𝓝 s

Next tactic:
rw [mem_nhds_iff]
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; 

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ ∃ t ⊆ S, IsOpen t ∧ s ∈ t

Next tactic:
use S
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    

Proof state:
case h
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ S ⊆ S ∧ IsOpen S ∧ s ∈ S

Next tactic:
refine' ⟨Subset.rfl, _, hn⟩
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    

Proof state:
case h
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ IsOpen S

Next tactic:
have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ S = re ⁻¹' Ioi (1 - ↑n)

Next tactic:
ext
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; 

Proof state:
case h
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
x✝ : ℂ
⊢ x✝ ∈ S ↔ x✝ ∈ re ⁻¹' Ioi (1 - ↑n)

Next tactic:
rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; 

Proof state:
case h
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
x✝ : ℂ
⊢ 1 - x✝.re < ↑n ↔ 1 - ↑n < x✝.re

Next tactic:
exact sub_lt_comm
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    

Proof state:
case h
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S = re ⁻¹' Ioi (1 - ↑n)
⊢ IsOpen S

Next tactic:
rw [this]
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    

Proof state:
case h
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S = re ⁻¹' Ioi (1 - ↑n)
⊢ IsOpen (re ⁻¹' Ioi (1 - ↑n))

Next tactic:
refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S ∈ 𝓝 s
⊢ Gamma =ᶠ[𝓝 s] GammaAux n

Next tactic:
apply eventuallyEq_of_mem this
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
  apply eventuallyEq_of_mem this
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S ∈ 𝓝 s
⊢ EqOn Gamma (GammaAux n) S

Next tactic:
intro t ht
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
  apply eventuallyEq_of_mem this
  intro t ht; 

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S ∈ 𝓝 s
t : ℂ
ht : t ∈ S
⊢ Gamma t = GammaAux n t

Next tactic:
rw [mem_setOf_eq] at ht
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
  apply eventuallyEq_of_mem this
  intro t ht; rw [mem_setOf_eq] at ht
  

Proof state:
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S ∈ 𝓝 s
t : ℂ
ht : 1 - t.re < ↑n
⊢ Gamma t = GammaAux n t

Next tactic:
apply Gamma_eq_GammaAux
theorem differentiableAt_Gamma (s : ℂ) (hs : ∀ m : ℕ, s ≠ -m) : DifferentiableAt ℂ Gamma s := by
  let n := ⌊1 - s.re⌋₊ + 1
  have hn : 1 - s.re < n := mod_cast Nat.lt_floor_add_one (1 - s.re)
  apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
  let S := {t : ℂ | 1 - t.re < n}
  have : S ∈ 𝓝 s := by
    rw [mem_nhds_iff]; use S
    refine' ⟨Subset.rfl, _, hn⟩
    have : S = re ⁻¹' Ioi (1 - n : ℝ) := by
      ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]; exact sub_lt_comm
    rw [this]
    refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
  apply eventuallyEq_of_mem this
  intro t ht; rw [mem_setOf_eq] at ht
  apply Gamma_eq_GammaAux; 

Proof state:
case h1
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
this : S ∈ 𝓝 s
t : ℂ
ht : 1 - t.re < ↑n
⊢ -t.re < ↑n

Next tactic:
linarith
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  

Proof state:
⊢ Tendsto (fun z => z * Gamma z) (𝓝[≠] 0) (𝓝 1)

Next tactic:
rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by 

Proof state:
⊢ 𝓝 1 = 𝓝 (Gamma (0 + 1))

Next tactic:
simp only [zero_add, Complex.Gamma_one]
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
  

Proof state:
⊢ Tendsto (fun z => z * Gamma z) (𝓝[≠] 0) (𝓝 (Gamma (0 + 1)))

Next tactic:
convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr'
    (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
  convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr'
    (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
  

Proof state:
case convert_1
⊢ Tendsto (fun x => Gamma (x + 1)) (𝓝 0) (𝓝 (Gamma (0 + 1)))

Next tactic:
refine' ContinuousAt.comp (g := Gamma) _ (continuous_id.add continuous_const).continuousAt
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
  convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr'
    (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
  refine' ContinuousAt.comp (g := Gamma) _ (continuous_id.add continuous_const).continuousAt
  

Proof state:
case convert_1
⊢ ContinuousAt Gamma (0 + 1)

Next tactic:
refine' (Complex.differentiableAt_Gamma _ fun m => _).continuousAt
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
  convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr'
    (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
  refine' ContinuousAt.comp (g := Gamma) _ (continuous_id.add continuous_const).continuousAt
  refine' (Complex.differentiableAt_Gamma _ fun m => _).continuousAt
  

Proof state:
case convert_1
m : ℕ
⊢ 0 + 1 ≠ -↑m

Next tactic:
rw [zero_add, ← ofReal_nat_cast, ← ofReal_neg, ← ofReal_one, Ne.def, ofReal_inj]
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
  convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr'
    (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
  refine' ContinuousAt.comp (g := Gamma) _ (continuous_id.add continuous_const).continuousAt
  refine' (Complex.differentiableAt_Gamma _ fun m => _).continuousAt
  rw [zero_add, ← ofReal_nat_cast, ← ofReal_neg, ← ofReal_one, Ne.def, ofReal_inj]
  

Proof state:
case convert_1
m : ℕ
⊢ ¬1 = -↑m

Next tactic:
refine' (lt_of_le_of_lt _ zero_lt_one).ne'
/-- At `s = 0`, the Gamma function has a simple pole with residue 1. -/
theorem tendsto_self_mul_Gamma_nhds_zero : Tendsto (fun z : ℂ => z * Gamma z) (𝓝[≠] 0) (𝓝 1) := by
  rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
  convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr'
    (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
  refine' ContinuousAt.comp (g := Gamma) _ (continuous_id.add continuous_const).continuousAt
  refine' (Complex.differentiableAt_Gamma _ fun m => _).continuousAt
  rw [zero_add, ← ofReal_nat_cast, ← ofReal_neg, ← ofReal_one, Ne.def, ofReal_inj]
  refine' (lt_of_le_of_lt _ zero_lt_one).ne'
  

Proof state:
case convert_1
m : ℕ
⊢ -↑m ≤ 0

Next tactic:
exact neg_nonpos.mpr (Nat.cast_nonneg _)
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  

Proof state:
s : ℝ
hs : 0 < s
⊢ Gamma s = ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)

Next tactic:
rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  rw [Gamma, Complex.Gamma_eq_integral (by 

Proof state:
s : ℝ
hs : 0 < s
⊢ 0 < (↑s).re

Next tactic:
rwa [Complex.ofReal_re]
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
  

Proof state:
s : ℝ
hs : 0 < s
⊢ (Complex.GammaIntegral ↑s).re = ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)

Next tactic:
dsimp only [Complex.GammaIntegral]
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
  dsimp only [Complex.GammaIntegral]
  

Proof state:
s : ℝ
hs : 0 < s
⊢ (∫ (x : ℝ) in Ioi 0, ↑(rexp (-x)) * ↑x ^ (↑s - 1)).re = ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)

Next tactic:
simp_rw [← Complex.ofReal_one, ← Complex.ofReal_sub]
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
  dsimp only [Complex.GammaIntegral]
  simp_rw [← Complex.ofReal_one, ← Complex.ofReal_sub]
  

Proof state:
s : ℝ
hs : 0 < s
⊢ (∫ (x : ℝ) in Ioi 0, ↑(rexp (-x)) * ↑x ^ ↑(s - 1)).re = ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)

Next tactic:
suffices ∫ x : ℝ in Ioi 0, ↑(exp (-x)) * (x : ℂ) ^ ((s - 1 : ℝ) : ℂ) =
      ∫ x : ℝ in Ioi 0, ((exp (-x) * x ^ (s - 1) : ℝ) : ℂ) by
    have cc : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
    conv_lhs => rw [this]; enter [1, 2, x]; rw [cc]
    rw [_root_.integral_ofReal, ← cc, Complex.ofReal_re]
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
  dsimp only [Complex.GammaIntegral]
  simp_rw [← Complex.ofReal_one, ← Complex.ofReal_sub]
  suffices ∫ x : ℝ in Ioi 0, ↑(exp (-x)) * (x : ℂ) ^ ((s - 1 : ℝ) : ℂ) =
      ∫ x : ℝ in Ioi 0, ((exp (-x) * x ^ (s - 1) : ℝ) : ℂ) by
    

Proof state:
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(rexp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(rexp (-x) * x ^ (s - 1))
⊢ (∫ (x : ℝ) in Ioi 0, ↑(rexp (-x)) * ↑x ^ ↑(s - 1)).re = ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)

Next tactic:
have cc : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
theorem Gamma_eq_integral {s : ℝ} (hs : 0 < s) :
    Gamma s = ∫ x in Ioi 0, exp (-x) * x ^ (s - 1) := by
  rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
  dsimp only [Complex.GammaIntegral]
  simp_rw [← Complex.ofReal_one, ← Complex.ofReal_sub]
  suffices ∫ x : ℝ in Ioi 0, ↑(exp (-x)) * (x : ℂ) ^ ((s - 1 : ℝ) : ℂ) =
      ∫ x : ℝ in Ioi 0, ((exp (-x) * x ^ (s - 1) : ℝ) : ℂ) by
    have cc : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
    

Proof state:
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(rexp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(rexp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
⊢ (∫ (x : ℝ) in Ioi 0, ↑(rexp (-x)) * ↑x ^ ↑(s - 1)).re = ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ (s - 1)

Next tactic:
conv_lhs => rw [this]; enter [1, 2, x]; rw [cc]