l3lab/ntp-mathlib huggingface dataset:
/-- The recurrence relation for the indefinite version of the `Γ` function. -/
theorem partialGamma_add_one {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    partialGamma (s + 1) X = s * partialGamma s X - (-X).exp * X ^ s := by
  rw [partialGamma, partialGamma, add_sub_cancel]
  have F_der_I : ∀ x : ℝ, x ∈ Ioo 0 X → HasDerivAt (fun x => (-x).exp * x ^ s : ℝ → ℂ)
      (-((-x).exp * x ^ s) + (-x).exp * (s * x ^ (s - 1))) x := by
    intro x hx
    have d1 : HasDerivAt (fun y : ℝ => (-y).exp) (-(-x).exp) x := by
      simpa using (hasDerivAt_neg x).exp
    have d2 : HasDerivAt (fun y : ℝ => (y : ℂ) ^ s) (s * x ^ (s - 1)) x := by
      have t := @HasDerivAt.cpow_const _ _ _ s (hasDerivAt_id ↑x) ?_
      simpa only [mul_one] using t.comp_ofReal
      simpa only [id.def, ofReal_re, ofReal_im, Ne.def, eq_self_iff_true, not_true, or_false_iff,
        mul_one] using hx.1
    simpa only [ofReal_neg, neg_mul] using d1.ofReal_comp.mul d2
  have cont := (continuous_ofReal.comp continuous_neg.exp).mul (continuous_ofReal_cpow_const hs)
  have der_ible :=
    (Gamma_integrand_deriv_integrable_A hs hX).add (Gamma_integrand_deriv_integrable_B hs hX)
  have int_eval := integral_eq_sub_of_hasDerivAt_of_le hX cont.continuousOn F_der_I der_ible
  -- We are basically done here but manipulating the output into the right form is fiddly.
  apply_fun fun x : ℂ => -x at int_eval
  rw [intervalIntegral.integral_add (Gamma_integrand_deriv_integrable_A hs hX)
      (Gamma_integrand_deriv_integrable_B hs hX),
    intervalIntegral.integral_neg, neg_add, neg_neg] at int_eval
  rw [eq_sub_of_add_eq int_eval, sub_neg_eq_add, neg_sub, add_comm, add_sub]
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * (-x).exp * x ^ (s - 1) : ℝ → ℂ) := by ext1; ring
  rw [this]
  have t := @integral_const_mul 0 X volume _ _ s fun x : ℝ => (-x).exp * x ^ (s - 1)
  rw [← t, ofReal_zero, zero_cpow]
  · rw [mul_zero, add_zero]; congr 2; 

Proof state:
case e_a.e_f
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ x ∈ Ioo 0 X,
    HasDerivAt (fun x => ↑(rexp (-x)) * ↑x ^ s) (-(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => rexp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => rexp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => rexp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(rexp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(rexp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ (s - 1)
⊢ (fun x => s * ↑(rexp (-x)) * ↑x ^ (s - 1)) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))

Next tactic:
ext1
/-- The recurrence relation for the indefinite version of the `Γ` function. -/
theorem partialGamma_add_one {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    partialGamma (s + 1) X = s * partialGamma s X - (-X).exp * X ^ s := by
  rw [partialGamma, partialGamma, add_sub_cancel]
  have F_der_I : ∀ x : ℝ, x ∈ Ioo 0 X → HasDerivAt (fun x => (-x).exp * x ^ s : ℝ → ℂ)
      (-((-x).exp * x ^ s) + (-x).exp * (s * x ^ (s - 1))) x := by
    intro x hx
    have d1 : HasDerivAt (fun y : ℝ => (-y).exp) (-(-x).exp) x := by
      simpa using (hasDerivAt_neg x).exp
    have d2 : HasDerivAt (fun y : ℝ => (y : ℂ) ^ s) (s * x ^ (s - 1)) x := by
      have t := @HasDerivAt.cpow_const _ _ _ s (hasDerivAt_id ↑x) ?_
      simpa only [mul_one] using t.comp_ofReal
      simpa only [id.def, ofReal_re, ofReal_im, Ne.def, eq_self_iff_true, not_true, or_false_iff,
        mul_one] using hx.1
    simpa only [ofReal_neg, neg_mul] using d1.ofReal_comp.mul d2
  have cont := (continuous_ofReal.comp continuous_neg.exp).mul (continuous_ofReal_cpow_const hs)
  have der_ible :=
    (Gamma_integrand_deriv_integrable_A hs hX).add (Gamma_integrand_deriv_integrable_B hs hX)
  have int_eval := integral_eq_sub_of_hasDerivAt_of_le hX cont.continuousOn F_der_I der_ible
  -- We are basically done here but manipulating the output into the right form is fiddly.
  apply_fun fun x : ℂ => -x at int_eval
  rw [intervalIntegral.integral_add (Gamma_integrand_deriv_integrable_A hs hX)
      (Gamma_integrand_deriv_integrable_B hs hX),
    intervalIntegral.integral_neg, neg_add, neg_neg] at int_eval
  rw [eq_sub_of_add_eq int_eval, sub_neg_eq_add, neg_sub, add_comm, add_sub]
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * (-x).exp * x ^ (s - 1) : ℝ → ℂ) := by ext1; ring
  rw [this]
  have t := @integral_const_mul 0 X volume _ _ s fun x : ℝ => (-x).exp * x ^ (s - 1)
  rw [← t, ofReal_zero, zero_cpow]
  · rw [mul_zero, add_zero]; congr 2; ext1; 

Proof state:
case e_a.e_f.h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ x ∈ Ioo 0 X,
    HasDerivAt (fun x => ↑(rexp (-x)) * ↑x ^ s) (-(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => rexp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => rexp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => rexp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(rexp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(rexp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ (s - 1)
x✝ : ℝ
⊢ s * ↑(rexp (-x✝)) * ↑x✝ ^ (s - 1) = s * (↑(rexp (-x✝)) * ↑x✝ ^ (s - 1))

Next tactic:
ring
/-- The recurrence relation for the indefinite version of the `Γ` function. -/
theorem partialGamma_add_one {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    partialGamma (s + 1) X = s * partialGamma s X - (-X).exp * X ^ s := by
  rw [partialGamma, partialGamma, add_sub_cancel]
  have F_der_I : ∀ x : ℝ, x ∈ Ioo 0 X → HasDerivAt (fun x => (-x).exp * x ^ s : ℝ → ℂ)
      (-((-x).exp * x ^ s) + (-x).exp * (s * x ^ (s - 1))) x := by
    intro x hx
    have d1 : HasDerivAt (fun y : ℝ => (-y).exp) (-(-x).exp) x := by
      simpa using (hasDerivAt_neg x).exp
    have d2 : HasDerivAt (fun y : ℝ => (y : ℂ) ^ s) (s * x ^ (s - 1)) x := by
      have t := @HasDerivAt.cpow_const _ _ _ s (hasDerivAt_id ↑x) ?_
      simpa only [mul_one] using t.comp_ofReal
      simpa only [id.def, ofReal_re, ofReal_im, Ne.def, eq_self_iff_true, not_true, or_false_iff,
        mul_one] using hx.1
    simpa only [ofReal_neg, neg_mul] using d1.ofReal_comp.mul d2
  have cont := (continuous_ofReal.comp continuous_neg.exp).mul (continuous_ofReal_cpow_const hs)
  have der_ible :=
    (Gamma_integrand_deriv_integrable_A hs hX).add (Gamma_integrand_deriv_integrable_B hs hX)
  have int_eval := integral_eq_sub_of_hasDerivAt_of_le hX cont.continuousOn F_der_I der_ible
  -- We are basically done here but manipulating the output into the right form is fiddly.
  apply_fun fun x : ℂ => -x at int_eval
  rw [intervalIntegral.integral_add (Gamma_integrand_deriv_integrable_A hs hX)
      (Gamma_integrand_deriv_integrable_B hs hX),
    intervalIntegral.integral_neg, neg_add, neg_neg] at int_eval
  rw [eq_sub_of_add_eq int_eval, sub_neg_eq_add, neg_sub, add_comm, add_sub]
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * (-x).exp * x ^ (s - 1) : ℝ → ℂ) := by ext1; ring
  rw [this]
  have t := @integral_const_mul 0 X volume _ _ s fun x : ℝ => (-x).exp * x ^ (s - 1)
  rw [← t, ofReal_zero, zero_cpow]
  · rw [mul_zero, add_zero]; congr 2; ext1; ring
  · 

Proof state:
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ x ∈ Ioo 0 X,
    HasDerivAt (fun x => ↑(rexp (-x)) * ↑x ^ s) (-(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => rexp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => rexp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => rexp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(rexp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(rexp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ (s - 1)
⊢ s ≠ 0

Next tactic:
contrapose! hs
/-- The recurrence relation for the indefinite version of the `Γ` function. -/
theorem partialGamma_add_one {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    partialGamma (s + 1) X = s * partialGamma s X - (-X).exp * X ^ s := by
  rw [partialGamma, partialGamma, add_sub_cancel]
  have F_der_I : ∀ x : ℝ, x ∈ Ioo 0 X → HasDerivAt (fun x => (-x).exp * x ^ s : ℝ → ℂ)
      (-((-x).exp * x ^ s) + (-x).exp * (s * x ^ (s - 1))) x := by
    intro x hx
    have d1 : HasDerivAt (fun y : ℝ => (-y).exp) (-(-x).exp) x := by
      simpa using (hasDerivAt_neg x).exp
    have d2 : HasDerivAt (fun y : ℝ => (y : ℂ) ^ s) (s * x ^ (s - 1)) x := by
      have t := @HasDerivAt.cpow_const _ _ _ s (hasDerivAt_id ↑x) ?_
      simpa only [mul_one] using t.comp_ofReal
      simpa only [id.def, ofReal_re, ofReal_im, Ne.def, eq_self_iff_true, not_true, or_false_iff,
        mul_one] using hx.1
    simpa only [ofReal_neg, neg_mul] using d1.ofReal_comp.mul d2
  have cont := (continuous_ofReal.comp continuous_neg.exp).mul (continuous_ofReal_cpow_const hs)
  have der_ible :=
    (Gamma_integrand_deriv_integrable_A hs hX).add (Gamma_integrand_deriv_integrable_B hs hX)
  have int_eval := integral_eq_sub_of_hasDerivAt_of_le hX cont.continuousOn F_der_I der_ible
  -- We are basically done here but manipulating the output into the right form is fiddly.
  apply_fun fun x : ℂ => -x at int_eval
  rw [intervalIntegral.integral_add (Gamma_integrand_deriv_integrable_A hs hX)
      (Gamma_integrand_deriv_integrable_B hs hX),
    intervalIntegral.integral_neg, neg_add, neg_neg] at int_eval
  rw [eq_sub_of_add_eq int_eval, sub_neg_eq_add, neg_sub, add_comm, add_sub]
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * (-x).exp * x ^ (s - 1) : ℝ → ℂ) := by ext1; ring
  rw [this]
  have t := @integral_const_mul 0 X volume _ _ s fun x : ℝ => (-x).exp * x ^ (s - 1)
  rw [← t, ofReal_zero, zero_cpow]
  · rw [mul_zero, add_zero]; congr 2; ext1; ring
  · contrapose! hs; 

Proof state:
s : ℂ
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ x ∈ Ioo 0 X,
    HasDerivAt (fun x => ↑(rexp (-x)) * ↑x ^ s) (-(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => rexp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(rexp (-x)) * ↑x ^ s) + ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => rexp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => rexp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(rexp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(rexp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(rexp (-x)) * ↑x ^ (s - 1)
hs : s = 0
⊢ s.re ≤ 0

Next tactic:
rw [hs, zero_re]
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  

Proof state:
s : ℂ
hs : 0 < s.re
⊢ GammaIntegral (s + 1) = s * GammaIntegral s

Next tactic:
suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    

Proof state:
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ GammaIntegral (s + 1) = s * GammaIntegral s

Next tactic:
refine' tendsto_nhds_unique _ this
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    

Proof state:
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ Tendsto (partialGamma (s + 1)) atTop (𝓝 (GammaIntegral (s + 1)))

Next tactic:
apply tendsto_partialGamma
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; 

Proof state:
case hs
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ 0 < (s + 1).re

Next tactic:
rw [add_re, one_re]
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; 

Proof state:
case hs
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ 0 < s.re + 1

Next tactic:
linarith
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  

Proof state:
s : ℂ
hs : 0 < s.re
⊢ Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))

Next tactic:
have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    

Proof state:
s : ℂ
hs : 0 < s.re
⊢ (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)

Next tactic:
apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    

Proof state:
s : ℂ
hs : 0 < s.re
⊢ EqOn (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) (partialGamma (s + 1)) (Ici 0)

Next tactic:
intro X hX
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    

Proof state:
s : ℂ
hs : 0 < s.re
X : ℝ
hX : X ∈ Ici 0
⊢ (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) X = partialGamma (s + 1) X

Next tactic:
rw [partialGamma_add_one hs (mem_Ici.mp hX)]
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    

Proof state:
s : ℂ
hs : 0 < s.re
X : ℝ
hX : X ∈ Ici 0
⊢ (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) X = s * partialGamma s X - ↑(rexp (-X)) * ↑X ^ s

Next tactic:
ring_nf
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
  

Proof state:
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))

Next tactic:
refine' Tendsto.congr' this _
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
  refine' Tendsto.congr' this _
  

Proof state:
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) atTop (𝓝 (s * GammaIntegral s))

Next tactic:
suffices Tendsto (fun X => -X ^ s * (-X).exp : ℝ → ℂ) atTop (𝓝 0) by
    simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
  refine' Tendsto.congr' this _
  suffices Tendsto (fun X => -X ^ s * (-X).exp : ℝ → ℂ) atTop (𝓝 0) by
    

Proof state:
s : ℂ
hs : 0 < s.re
this✝ : (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)
this : Tendsto (fun X => -↑X ^ s * ↑(rexp (-X))) atTop (𝓝 0)
⊢ Tendsto (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) atTop (𝓝 (s * GammaIntegral s))

Next tactic:
simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
  refine' Tendsto.congr' this _
  suffices Tendsto (fun X => -X ^ s * (-X).exp : ℝ → ℂ) atTop (𝓝 0) by
    simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
  

Proof state:
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (fun X => -↑X ^ s * ↑(rexp (-X))) atTop (𝓝 0)

Next tactic:
rw [tendsto_zero_iff_norm_tendsto_zero]
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
  refine' Tendsto.congr' this _
  suffices Tendsto (fun X => -X ^ s * (-X).exp : ℝ → ℂ) atTop (𝓝 0) by
    simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
  rw [tendsto_zero_iff_norm_tendsto_zero]
  

Proof state:
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (fun x => ‖-↑x ^ s * ↑(rexp (-x))‖) atTop (𝓝 0)

Next tactic:
have :
      (fun e : ℝ => ‖-(e : ℂ) ^ s * (-e).exp‖) =ᶠ[atTop] fun e : ℝ => e ^ s.re * (-1 * e).exp := by
    refine' eventuallyEq_of_mem (Ioi_mem_atTop 0) _
    intro x hx; dsimp only
    rw [norm_eq_abs, map_mul, abs.map_neg, abs_cpow_eq_rpow_re_of_pos hx,
      abs_of_nonneg (exp_pos (-x)).le, neg_mul, one_mul]
/-- The recurrence relation for the `Γ` integral. -/
theorem GammaIntegral_add_one {s : ℂ} (hs : 0 < s.re) :
    GammaIntegral (s + 1) = s * GammaIntegral s := by
  suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s) by
    refine' tendsto_nhds_unique _ this
    apply tendsto_partialGamma; rw [add_re, one_re]; linarith
  have : (fun X : ℝ => s * partialGamma s X - X ^ s * (-X).exp) =ᶠ[atTop]
      (s + 1).partialGamma := by
    apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
    intro X hX
    rw [partialGamma_add_one hs (mem_Ici.mp hX)]
    ring_nf
  refine' Tendsto.congr' this _
  suffices Tendsto (fun X => -X ^ s * (-X).exp : ℝ → ℂ) atTop (𝓝 0) by
    simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
  rw [tendsto_zero_iff_norm_tendsto_zero]
  have :
      (fun e : ℝ => ‖-(e : ℂ) ^ s * (-e).exp‖) =ᶠ[atTop] fun e : ℝ => e ^ s.re * (-1 * e).exp := by
    

Proof state:
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(rexp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ (fun e => ‖-↑e ^ s * ↑(rexp (-e))‖) =ᶠ[atTop] fun e => e ^ s.re * rexp (-1 * e)

Next tactic:
refine' eventuallyEq_of_mem (Ioi_mem_atTop 0) _