[GOAL]
s : ℝ
⊢ (fun x => exp (-x) * x ^ s) =o[atTop] fun x => exp (-(1 / 2) * x)
[PROOFSTEP]
refine' isLittleO_of_tendsto (fun x hx => _) _
[GOAL]
case refine'_1
s x : ℝ
hx : exp (-(1 / 2) * x) = 0
⊢ exp (-x) * x ^ s = 0
[PROOFSTEP]
exfalso
[GOAL]
case refine'_1.h
s x : ℝ
hx : exp (-(1 / 2) * x) = 0
⊢ False
[PROOFSTEP]
exact (exp_pos (-(1 / 2) * x)).ne' hx
[GOAL]
case refine'_2
s : ℝ
⊢ Tendsto (fun x => exp (-x) * x ^ s / exp (-(1 / 2) * x)) atTop (𝓝 0)
[PROOFSTEP]
have : (fun x : ℝ => exp (-x) * x ^ s / exp (-(1 / 2) * x)) = (fun x : ℝ => exp (1 / 2 * x) / x ^ s)⁻¹ :=
  by
  ext1 x
  field_simp [exp_ne_zero, exp_neg, ← Real.exp_add]
  left
  ring
[GOAL]
s : ℝ
⊢ (fun x => exp (-x) * x ^ s / exp (-(1 / 2) * x)) = (fun x => exp (1 / 2 * x) / x ^ s)⁻¹
[PROOFSTEP]
ext1 x
[GOAL]
case h
s x : ℝ
⊢ exp (-x) * x ^ s / exp (-(1 / 2) * x) = (fun x => exp (1 / 2 * x) / x ^ s)⁻¹ x
[PROOFSTEP]
field_simp [exp_ne_zero, exp_neg, ← Real.exp_add]
[GOAL]
case h
s x : ℝ
⊢ x = x * 2 + -x ∨ x ^ s = 0
[PROOFSTEP]
left
[GOAL]
case h.h
s x : ℝ
⊢ x = x * 2 + -x
[PROOFSTEP]
ring
[GOAL]
case refine'_2
s : ℝ
this : (fun x => exp (-x) * x ^ s / exp (-(1 / 2) * x)) = (fun x => exp (1 / 2 * x) / x ^ s)⁻¹
⊢ Tendsto (fun x => exp (-x) * x ^ s / exp (-(1 / 2) * x)) atTop (𝓝 0)
[PROOFSTEP]
rw [this]
[GOAL]
case refine'_2
s : ℝ
this : (fun x => exp (-x) * x ^ s / exp (-(1 / 2) * x)) = (fun x => exp (1 / 2 * x) / x ^ s)⁻¹
⊢ Tendsto (fun x => exp (1 / 2 * x) / x ^ s)⁻¹ atTop (𝓝 0)
[PROOFSTEP]
exact (tendsto_exp_mul_div_rpow_atTop s (1 / 2) one_half_pos).inv_tendsto_atTop
[GOAL]
s : ℝ
h : 0 < s
⊢ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Ioi 0)
[PROOFSTEP]
rw [← Ioc_union_Ioi_eq_Ioi (@zero_le_one ℝ _ _ _ _), integrableOn_union]
[GOAL]
s : ℝ
h : 0 < s
⊢ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Ioc 0 1) ∧ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Ioi 1)
[PROOFSTEP]
constructor
[GOAL]
case left
s : ℝ
h : 0 < s
⊢ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Ioc 0 1)
[PROOFSTEP]
rw [← integrableOn_Icc_iff_integrableOn_Ioc]
[GOAL]
case left
s : ℝ
h : 0 < s
⊢ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Icc 0 1)
[PROOFSTEP]
refine' IntegrableOn.continuousOn_mul continuousOn_id.neg.exp _ isCompact_Icc
[GOAL]
case left
s : ℝ
h : 0 < s
⊢ IntegrableOn (fun x => x ^ (s - 1)) (Icc 0 1)
[PROOFSTEP]
refine' (intervalIntegrable_iff_integrable_Icc_of_le zero_le_one).mp _
[GOAL]
case left
s : ℝ
h : 0 < s
⊢ IntervalIntegrable (fun x => x ^ (s - 1)) volume 0 1
[PROOFSTEP]
exact intervalIntegrable_rpow' (by linarith)
[GOAL]
s : ℝ
h : 0 < s
⊢ -1 < s - 1
[PROOFSTEP]
linarith
[GOAL]
case right
s : ℝ
h : 0 < s
⊢ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Ioi 1)
[PROOFSTEP]
refine' integrable_of_isBigO_exp_neg one_half_pos _ (Gamma_integrand_isLittleO _).isBigO
[GOAL]
case right
s : ℝ
h : 0 < s
⊢ ContinuousOn (fun x => exp (-x) * x ^ (s - 1)) (Ici 1)
[PROOFSTEP]
refine' continuousOn_id.neg.exp.mul (continuousOn_id.rpow_const _)
[GOAL]
case right
s : ℝ
h : 0 < s
⊢ ∀ (x : ℝ), x ∈ Ici 1 → id x ≠ 0 ∨ 0 ≤ s - 1
[PROOFSTEP]
intro x hx
[GOAL]
case right
s : ℝ
h : 0 < s
x : ℝ
hx : x ∈ Ici 1
⊢ id x ≠ 0 ∨ 0 ≤ s - 1
[PROOFSTEP]
exact Or.inl ((zero_lt_one : (0 : ℝ) < 1).trans_le hx).ne'
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ IntegrableOn (fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) (Ioi 0)
[PROOFSTEP]
constructor
[GOAL]
case left
s : ℂ
hs : 0 < s.re
⊢ AEStronglyMeasurable (fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) (Measure.restrict volume (Ioi 0))
[PROOFSTEP]
refine' ContinuousOn.aestronglyMeasurable _ measurableSet_Ioi
[GOAL]
case left
s : ℂ
hs : 0 < s.re
⊢ ContinuousOn (fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) (Ioi 0)
[PROOFSTEP]
apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
[GOAL]
case left
s : ℂ
hs : 0 < s.re
⊢ ContinuousOn (fun x => ↑x ^ (s - 1)) (Ioi 0)
[PROOFSTEP]
apply ContinuousAt.continuousOn
[GOAL]
case left.hcont
s : ℂ
hs : 0 < s.re
⊢ ∀ (x : ℝ), x ∈ Ioi 0 → ContinuousAt (fun x => ↑x ^ (s - 1)) x
[PROOFSTEP]
intro x hx
[GOAL]
case left.hcont
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ ContinuousAt (fun x => ↑x ^ (s - 1)) x
[PROOFSTEP]
have : ContinuousAt (fun x : ℂ => x ^ (s - 1)) ↑x := by apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx
[GOAL]
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ ContinuousAt (fun x => x ^ (s - 1)) ↑x
[PROOFSTEP]
apply continuousAt_cpow_const
[GOAL]
case ha
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ 0 < (↑x).re ∨ (↑x).im ≠ 0
[PROOFSTEP]
rw [ofReal_re]
[GOAL]
case ha
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ 0 < x ∨ (↑x).im ≠ 0
[PROOFSTEP]
exact Or.inl hx
[GOAL]
case left.hcont
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
this : ContinuousAt (fun x => x ^ (s - 1)) ↑x
⊢ ContinuousAt (fun x => ↑x ^ (s - 1)) x
[PROOFSTEP]
exact ContinuousAt.comp this continuous_ofReal.continuousAt
[GOAL]
case right
s : ℂ
hs : 0 < s.re
⊢ HasFiniteIntegral fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)
[PROOFSTEP]
rw [← hasFiniteIntegral_norm_iff]
[GOAL]
case right
s : ℂ
hs : 0 < s.re
⊢ HasFiniteIntegral fun a => ‖↑(Real.exp (-a)) * ↑a ^ (s - 1)‖
[PROOFSTEP]
refine' HasFiniteIntegral.congr (Real.GammaIntegral_convergent hs).2 _
[GOAL]
case right
s : ℂ
hs : 0 < s.re
⊢ (fun x => Real.exp (-x) * x ^ (s.re - 1)) =ᵐ[Measure.restrict volume (Ioi 0)] fun a =>
    ‖↑(Real.exp (-a)) * ↑a ^ (s - 1)‖
[PROOFSTEP]
refine' (ae_restrict_iff' measurableSet_Ioi).mpr (ae_of_all _ fun x hx => _)
[GOAL]
case right
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ (fun x => Real.exp (-x) * x ^ (s.re - 1)) x = (fun a => ‖↑(Real.exp (-a)) * ↑a ^ (s - 1)‖) x
[PROOFSTEP]
dsimp only
[GOAL]
case right
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ Real.exp (-x) * x ^ (s.re - 1) = ‖↑(Real.exp (-x)) * ↑x ^ (s - 1)‖
[PROOFSTEP]
rw [norm_eq_abs, map_mul, abs_of_nonneg <| le_of_lt <| exp_pos <| -x, abs_cpow_eq_rpow_re_of_pos hx _]
[GOAL]
case right
s : ℂ
hs : 0 < s.re
x : ℝ
hx : x ∈ Ioi 0
⊢ Real.exp (-x) * x ^ (s.re - 1) = Real.exp (-x) * x ^ (s - 1).re
[PROOFSTEP]
simp
[GOAL]
s : ℂ
⊢ GammaIntegral (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaIntegral s)
[PROOFSTEP]
rw [GammaIntegral, GammaIntegral, ← integral_conj]
[GOAL]
s : ℂ
⊢ ∫ (x : ℝ) in Ioi 0, ↑(Real.exp (-x)) * ↑x ^ (↑(starRingEnd ℂ) s - 1) =
    ∫ (a : ℝ) in Ioi 0, ↑(starRingEnd ℂ) (↑(Real.exp (-a)) * ↑a ^ (s - 1))
[PROOFSTEP]
refine' set_integral_congr measurableSet_Ioi fun x hx => _
[GOAL]
s : ℂ
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(Real.exp (-x)) * ↑x ^ (↑(starRingEnd ℂ) s - 1) = ↑(starRingEnd ℂ) (↑(Real.exp (-x)) * ↑x ^ (s - 1))
[PROOFSTEP]
dsimp only
[GOAL]
s : ℂ
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(Real.exp (-x)) * ↑x ^ (↑(starRingEnd ℂ) s - 1) = ↑(starRingEnd ℂ) (↑(Real.exp (-x)) * ↑x ^ (s - 1))
[PROOFSTEP]
rw [RingHom.map_mul, conj_ofReal, cpow_def_of_ne_zero (ofReal_ne_zero.mpr (ne_of_gt hx)),
  cpow_def_of_ne_zero (ofReal_ne_zero.mpr (ne_of_gt hx)), ← exp_conj, RingHom.map_mul, ← ofReal_log (le_of_lt hx),
  conj_ofReal, RingHom.map_sub, RingHom.map_one]
[GOAL]
s : ℝ
⊢ GammaIntegral ↑s = ↑(∫ (x : ℝ) in Ioi 0, Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
have : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
⊢ GammaIntegral ↑s = ↑(∫ (x : ℝ) in Ioi 0, Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [GammaIntegral]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
⊢ ∫ (x : ℝ) in Ioi 0, ↑(Real.exp (-x)) * ↑x ^ (↑s - 1) = ↑(∫ (x : ℝ) in Ioi 0, Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
conv_rhs => rw [this, ← _root_.integral_ofReal]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
| ↑(∫ (x : ℝ) in Ioi 0, Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [this, ← _root_.integral_ofReal]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
| ↑(∫ (x : ℝ) in Ioi 0, Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [this, ← _root_.integral_ofReal]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
| ↑(∫ (x : ℝ) in Ioi 0, Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [this, ← _root_.integral_ofReal]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
⊢ ∫ (x : ℝ) in Ioi 0, ↑(Real.exp (-x)) * ↑x ^ (↑s - 1) = ∫ (a : ℝ) in Ioi 0, ↑(Real.exp (-a) * a ^ (s - 1))
[PROOFSTEP]
refine' set_integral_congr measurableSet_Ioi _
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
⊢ EqOn (fun x => ↑(Real.exp (-x)) * ↑x ^ (↑s - 1)) (fun a => ↑(Real.exp (-a) * a ^ (s - 1))) (Ioi 0)
[PROOFSTEP]
intro x hx
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ (fun x => ↑(Real.exp (-x)) * ↑x ^ (↑s - 1)) x = (fun a => ↑(Real.exp (-a) * a ^ (s - 1))) x
[PROOFSTEP]
dsimp only
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(Real.exp (-x)) * ↑x ^ (↑s - 1) = ↑(Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
conv_rhs => rw [← this]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
| ↑(Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [← this]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
| ↑(Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [← this]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
| ↑(Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [← this]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(Real.exp (-x)) * ↑x ^ (↑s - 1) = ↑(Real.exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [ofReal_mul, ofReal_cpow (mem_Ioi.mp hx).le]
[GOAL]
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(Real.exp (-x)) * ↑x ^ (↑s - 1) = ↑(Real.exp (-x)) * ↑x ^ ↑(s - 1)
[PROOFSTEP]
simp
[GOAL]
⊢ GammaIntegral 1 = 1
[PROOFSTEP]
simpa only [← ofReal_one, GammaIntegral_ofReal, ofReal_inj, sub_self, rpow_zero, mul_one] using
  integral_exp_neg_Ioi_zero
[GOAL]
s : ℂ
X : ℝ
hs : 0 < s.re
hX : 0 ≤ X
⊢ IntervalIntegrable (fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) volume 0 X
[PROOFSTEP]
rw [intervalIntegrable_iff_integrable_Ioc_of_le hX]
[GOAL]
s : ℂ
X : ℝ
hs : 0 < s.re
hX : 0 ≤ X
⊢ IntegrableOn (fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) (Ioc 0 X)
[PROOFSTEP]
exact IntegrableOn.mono_set (GammaIntegral_convergent hs) Ioc_subset_Ioi_self
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s)) volume 0 X
[PROOFSTEP]
convert (Gamma_integrand_interval_integrable (s + 1) _ hX).neg
[GOAL]
case h.e'_3.h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x✝ : ℝ
⊢ -(↑(Real.exp (-x✝)) * ↑x✝ ^ s) = (-fun x => ↑(Real.exp (-x)) * ↑x ^ (s + 1 - 1)) x✝
[PROOFSTEP]
simp only [ofReal_exp, ofReal_neg, add_sub_cancel]
[GOAL]
case h.e'_3.h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x✝ : ℝ
⊢ -(exp (-↑x✝) * ↑x✝ ^ s) = (-fun x => exp (-↑x) * ↑x ^ s) x✝
[PROOFSTEP]
rfl
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ 0 < (s + 1).re
[PROOFSTEP]
simp only [add_re, one_re]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ 0 < s.re + 1
[PROOFSTEP]
linarith
[GOAL]
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
⊢ IntervalIntegrable (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 Y
[PROOFSTEP]
have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) = (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1;
  ring
[GOAL]
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
⊢ (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
[PROOFSTEP]
ext1
[GOAL]
case h
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
x✝ : ℝ
⊢ ↑(Real.exp (-x✝)) * (s * ↑x✝ ^ (s - 1)) = s * (↑(Real.exp (-x✝)) * ↑x✝ ^ (s - 1))
[PROOFSTEP]
ring
[GOAL]
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ IntervalIntegrable (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 Y
[PROOFSTEP]
rw [this, intervalIntegrable_iff_integrable_Ioc_of_le hY]
[GOAL]
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ IntegrableOn (fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))) (Ioc 0 Y)
[PROOFSTEP]
constructor
[GOAL]
case left
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ AEStronglyMeasurable (fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))) (Measure.restrict volume (Ioc 0 Y))
[PROOFSTEP]
refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
[GOAL]
case left
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ ContinuousOn (fun x => ↑(Real.exp (-x)) * ↑x ^ (s - 1)) (Ioc 0 Y)
[PROOFSTEP]
apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
[GOAL]
case left
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ ContinuousOn (fun x => ↑x ^ (s - 1)) (Ioc 0 Y)
[PROOFSTEP]
apply ContinuousAt.continuousOn
[GOAL]
case left.hcont
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ ∀ (x : ℝ), x ∈ Ioc 0 Y → ContinuousAt (fun x => ↑x ^ (s - 1)) x
[PROOFSTEP]
intro x hx
[GOAL]
case left.hcont
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ ContinuousAt (fun x => ↑x ^ (s - 1)) x
[PROOFSTEP]
refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
[GOAL]
case left.hcont
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ ContinuousAt (fun x => x ^ (s - 1)) ↑x
[PROOFSTEP]
apply continuousAt_cpow_const
[GOAL]
case left.hcont.ha
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ 0 < (↑x).re ∨ (↑x).im ≠ 0
[PROOFSTEP]
rw [ofReal_re]
[GOAL]
case left.hcont.ha
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ 0 < x ∨ (↑x).im ≠ 0
[PROOFSTEP]
exact Or.inl hx.1
[GOAL]
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ HasFiniteIntegral fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
[PROOFSTEP]
rw [← hasFiniteIntegral_norm_iff]
[GOAL]
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ HasFiniteIntegral fun a => ‖s * (↑(Real.exp (-a)) * ↑a ^ (s - 1))‖
[PROOFSTEP]
simp_rw [norm_eq_abs, map_mul]
[GOAL]
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ HasFiniteIntegral fun a => ↑abs s * (↑abs ↑(Real.exp (-a)) * ↑abs (↑a ^ (s - 1)))
[PROOFSTEP]
refine' (((Real.GammaIntegral_convergent hs).mono_set Ioc_subset_Ioi_self).hasFiniteIntegral.congr _).const_mul _
[GOAL]
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ (fun x => Real.exp (-x) * x ^ (s.re - 1)) =ᵐ[Measure.restrict volume (Ioc 0 Y)] fun a =>
    ↑abs ↑(Real.exp (-a)) * ↑abs (↑a ^ (s - 1))
[PROOFSTEP]
rw [EventuallyEq, ae_restrict_iff']
[GOAL]
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ ∀ᵐ (x : ℝ), x ∈ Ioc 0 Y → Real.exp (-x) * x ^ (s.re - 1) = ↑abs ↑(Real.exp (-x)) * ↑abs (↑x ^ (s - 1))
[PROOFSTEP]
apply ae_of_all
[GOAL]
case right.a
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ ∀ (a : ℝ), a ∈ Ioc 0 Y → Real.exp (-a) * a ^ (s.re - 1) = ↑abs ↑(Real.exp (-a)) * ↑abs (↑a ^ (s - 1))
[PROOFSTEP]
intro x hx
[GOAL]
case right.a
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ Real.exp (-x) * x ^ (s.re - 1) = ↑abs ↑(Real.exp (-x)) * ↑abs (↑x ^ (s - 1))
[PROOFSTEP]
rw [abs_of_nonneg (exp_pos _).le, abs_cpow_eq_rpow_re_of_pos hx.1]
[GOAL]
case right.a
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ Real.exp (-x) * x ^ (s.re - 1) = Real.exp (-x) * x ^ (s - 1).re
[PROOFSTEP]
simp
[GOAL]
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
⊢ MeasurableSet (Ioc 0 Y)
[PROOFSTEP]
exact measurableSet_Ioc
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ partialGamma (s + 1) X = s * partialGamma s X - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
rw [partialGamma, partialGamma, add_sub_cancel]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
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
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
[PROOFSTEP]
intro x hx
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
⊢ HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s) (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)))
    x
[PROOFSTEP]
have d1 : HasDerivAt (fun y : ℝ => (-y).exp) (-(-x).exp) x := by simpa using (hasDerivAt_neg x).exp
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
⊢ HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
[PROOFSTEP]
simpa using (hasDerivAt_neg x).exp
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
d1 : HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
⊢ HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s) (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)))
    x
[PROOFSTEP]
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
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
d1 : HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
⊢ HasDerivAt (fun y => ↑y ^ s) (s * ↑x ^ (s - 1)) x
[PROOFSTEP]
have t := @HasDerivAt.cpow_const _ _ _ s (hasDerivAt_id ↑x) ?_
[GOAL]
case refine_2
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
d1 : HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
t : HasDerivAt (fun x => id x ^ s) (s * id ↑x ^ (s - 1) * 1) ↑x
⊢ HasDerivAt (fun y => ↑y ^ s) (s * ↑x ^ (s - 1)) x
case refine_1
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
d1 : HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
⊢ 0 < (id ↑x).re ∨ (id ↑x).im ≠ 0
[PROOFSTEP]
simpa only [mul_one] using t.comp_ofReal
[GOAL]
case refine_1
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
d1 : HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
⊢ 0 < (id ↑x).re ∨ (id ↑x).im ≠ 0
[PROOFSTEP]
simpa only [id.def, ofReal_re, ofReal_im, Ne.def, eq_self_iff_true, not_true, or_false_iff, mul_one] using hx.1
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x : ℝ
hx : x ∈ Ioo 0 X
d1 : HasDerivAt (fun y => Real.exp (-y)) (-Real.exp (-x)) x
d2 : HasDerivAt (fun y => ↑y ^ s) (s * ↑x ^ (s - 1)) x
⊢ HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s) (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)))
    x
[PROOFSTEP]
simpa only [ofReal_neg, neg_mul] using d1.ofReal_comp.mul d2
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
have cont := (continuous_ofReal.comp continuous_neg.exp).mul (continuous_ofReal_cpow_const hs)
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
have der_ible := (Gamma_integrand_deriv_integrable_A hs hX).add (Gamma_integrand_deriv_integrable_B hs hX)
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
have int_eval := integral_eq_sub_of_hasDerivAt_of_le hX cont.continuousOn F_der_I der_ible
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  ∫ (y : ℝ) in 0 ..X, -(↑(Real.exp (-y)) * ↑y ^ s) + ↑(Real.exp (-y)) * (s * ↑y ^ (s - 1)) =
    (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
apply_fun fun x : ℂ => -x at int_eval
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  -∫ (y : ℝ) in 0 ..X, -(↑(Real.exp (-y)) * ↑y ^ s) + ↑(Real.exp (-y)) * (s * ↑y ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
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
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
⊢ ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
rw [eq_sub_of_add_eq int_eval, sub_neg_eq_add, neg_sub, add_comm, add_sub]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
⊢ (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) + (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s -
      (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) = (fun x => s * (-x).exp * x ^ (s - 1) : ℝ → ℂ) := by ext1; ring
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
⊢ (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
[PROOFSTEP]
ext1
[GOAL]
case h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
x✝ : ℝ
⊢ ↑(Real.exp (-x✝)) * (s * ↑x✝ ^ (s - 1)) = s * ↑(Real.exp (-x✝)) * ↑x✝ ^ (s - 1)
[PROOFSTEP]
ring
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) + (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s -
      (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
rw [this]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ (∫ (x : ℝ) in 0 ..X, s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)) + (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s -
      (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
have t := @integral_const_mul 0 X volume _ _ s fun x : ℝ => (-x).exp * x ^ (s - 1)
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ (∫ (x : ℝ) in 0 ..X, s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)) + (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s -
      (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s =
    (s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
rw [← t, ofReal_zero, zero_cpow]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ (∫ (x : ℝ) in 0 ..X, s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)) + (ofReal' ∘ fun y => Real.exp (-y)) 0 * 0 -
      (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s =
    (∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
rw [mul_zero, add_zero]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ (∫ (x : ℝ) in 0 ..X, s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)) - (ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s =
    (∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))) - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
congr 2
[GOAL]
case e_a.e_f
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ (fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)) = fun x => s * (↑(Real.exp (-x)) * ↑x ^ (s - 1))
[PROOFSTEP]
ext1
[GOAL]
case e_a.e_f.h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
x✝ : ℝ
⊢ s * ↑(Real.exp (-x✝)) * ↑x✝ ^ (s - 1) = s * (↑(Real.exp (-x✝)) * ↑x✝ ^ (s - 1))
[PROOFSTEP]
ring
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
⊢ s ≠ 0
[PROOFSTEP]
contrapose! hs
[GOAL]
s : ℂ
X : ℝ
hX : 0 ≤ X
F_der_I :
  ∀ (x : ℝ),
    x ∈ Ioo 0 X →
      HasDerivAt (fun x => ↑(Real.exp (-x)) * ↑x ^ s)
        (-(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) x
cont : Continuous fun x => (ofReal' ∘ fun y => Real.exp (-y)) x * ↑x ^ s
der_ible : IntervalIntegrable (fun x => -(↑(Real.exp (-x)) * ↑x ^ s) + ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) volume 0 X
int_eval :
  (∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ s) + -∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1)) =
    -((ofReal' ∘ fun y => Real.exp (-y)) X * ↑X ^ s - (ofReal' ∘ fun y => Real.exp (-y)) 0 * ↑0 ^ s)
this : (fun x => ↑(Real.exp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * ↑(Real.exp (-x)) * ↑x ^ (s - 1)
t : ∫ (x : ℝ) in 0 ..X, s * (↑(Real.exp (-x)) * ↑x ^ (s - 1)) = s * ∫ (x : ℝ) in 0 ..X, ↑(Real.exp (-x)) * ↑x ^ (s - 1)
hs : s = 0
⊢ s.re ≤ 0
[PROOFSTEP]
rw [hs, zero_re]
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ GammaIntegral (s + 1) = s * GammaIntegral s
[PROOFSTEP]
suffices Tendsto (s + 1).partialGamma atTop (𝓝 <| s * GammaIntegral s)
  by
  refine' tendsto_nhds_unique _ this
  apply tendsto_partialGamma; rw [add_re, one_re]; linarith
[GOAL]
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ GammaIntegral (s + 1) = s * GammaIntegral s
[PROOFSTEP]
refine' tendsto_nhds_unique _ this
[GOAL]
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ Tendsto (partialGamma (s + 1)) atTop (𝓝 (GammaIntegral (s + 1)))
[PROOFSTEP]
apply tendsto_partialGamma
[GOAL]
case hs
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ 0 < (s + 1).re
[PROOFSTEP]
rw [add_re, one_re]
[GOAL]
case hs
s : ℂ
hs : 0 < s.re
this : Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
⊢ 0 < s.re + 1
[PROOFSTEP]
linarith
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
[PROOFSTEP]
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
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
[PROOFSTEP]
apply eventuallyEq_of_mem (Ici_mem_atTop (0 : ℝ))
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ EqOn (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) (partialGamma (s + 1)) (Ici 0)
[PROOFSTEP]
intro X hX
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : X ∈ Ici 0
⊢ (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) X = partialGamma (s + 1) X
[PROOFSTEP]
rw [partialGamma_add_one hs (mem_Ici.mp hX)]
[GOAL]
s : ℂ
hs : 0 < s.re
X : ℝ
hX : X ∈ Ici 0
⊢ (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) X = s * partialGamma s X - ↑(Real.exp (-X)) * ↑X ^ s
[PROOFSTEP]
ring_nf
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (partialGamma (s + 1)) atTop (𝓝 (s * GammaIntegral s))
[PROOFSTEP]
refine' Tendsto.congr' this _
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) atTop (𝓝 (s * GammaIntegral s))
[PROOFSTEP]
suffices Tendsto (fun X => -X ^ s * (-X).exp : ℝ → ℂ) atTop (𝓝 0) by
  simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
[GOAL]
s : ℂ
hs : 0 < s.re
this✝ : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
this : Tendsto (fun X => -↑X ^ s * ↑(Real.exp (-X))) atTop (𝓝 0)
⊢ Tendsto (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) atTop (𝓝 (s * GammaIntegral s))
[PROOFSTEP]
simpa using Tendsto.add (Tendsto.const_mul s (tendsto_partialGamma hs)) this
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (fun X => -↑X ^ s * ↑(Real.exp (-X))) atTop (𝓝 0)
[PROOFSTEP]
rw [tendsto_zero_iff_norm_tendsto_zero]
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ Tendsto (fun e => ‖-↑e ^ s * ↑(Real.exp (-e))‖) atTop (𝓝 0)
[PROOFSTEP]
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]
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ (fun e => ‖-↑e ^ s * ↑(Real.exp (-e))‖) =ᶠ[atTop] fun e => e ^ s.re * Real.exp (-1 * e)
[PROOFSTEP]
refine' eventuallyEq_of_mem (Ioi_mem_atTop 0) _
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
⊢ EqOn (fun e => ‖-↑e ^ s * ↑(Real.exp (-e))‖) (fun e => e ^ s.re * Real.exp (-1 * e)) (Ioi 0)
[PROOFSTEP]
intro x hx
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
x : ℝ
hx : x ∈ Ioi 0
⊢ (fun e => ‖-↑e ^ s * ↑(Real.exp (-e))‖) x = (fun e => e ^ s.re * Real.exp (-1 * e)) x
[PROOFSTEP]
dsimp only
[GOAL]
s : ℂ
hs : 0 < s.re
this : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
x : ℝ
hx : x ∈ Ioi 0
⊢ ‖-↑x ^ s * ↑(Real.exp (-x))‖ = x ^ s.re * Real.exp (-1 * x)
[PROOFSTEP]
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]
[GOAL]
s : ℂ
hs : 0 < s.re
this✝ : (fun X => s * partialGamma s X - ↑X ^ s * ↑(Real.exp (-X))) =ᶠ[atTop] partialGamma (s + 1)
this : (fun e => ‖-↑e ^ s * ↑(Real.exp (-e))‖) =ᶠ[atTop] fun e => e ^ s.re * Real.exp (-1 * e)
⊢ Tendsto (fun e => ‖-↑e ^ s * ↑(Real.exp (-e))‖) atTop (𝓝 0)
[PROOFSTEP]
exact (tendsto_congr' this).mpr (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_0 _ _ zero_lt_one)
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
⊢ GammaAux n s = GammaAux n (s + 1) / s
[PROOFSTEP]
induction' n with n hn generalizing s
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : -s.re < ↑Nat.zero
⊢ GammaAux Nat.zero s = GammaAux Nat.zero (s + 1) / s
[PROOFSTEP]
simp only [Nat.zero_eq, CharP.cast_eq_zero, Left.neg_neg_iff] at h1
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : 0 < s.re
⊢ GammaAux Nat.zero s = GammaAux Nat.zero (s + 1) / s
[PROOFSTEP]
dsimp only [GammaAux]
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : 0 < s.re
⊢ GammaIntegral s = GammaIntegral (s + 1) / s
[PROOFSTEP]
rw [GammaIntegral_add_one h1]
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : 0 < s.re
⊢ GammaIntegral s = s * GammaIntegral s / s
[PROOFSTEP]
rw [mul_comm, mul_div_cancel]
[GOAL]
case zero.h
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : 0 < s.re
⊢ s ≠ 0
[PROOFSTEP]
contrapose! h1
[GOAL]
case zero.h
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : s = 0
⊢ s.re ≤ 0
[PROOFSTEP]
rw [h1]
[GOAL]
case zero.h
s✝ : ℂ
n : ℕ
h1✝ : -s✝.re < ↑n
s : ℂ
h1 : s = 0
⊢ 0.re ≤ 0
[PROOFSTEP]
simp
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : -s✝.re < ↑n✝
n : ℕ
hn : ∀ (s : ℂ), -s.re < ↑n → GammaAux n s = GammaAux n (s + 1) / s
s : ℂ
h1 : -s.re < ↑(Nat.succ n)
⊢ GammaAux (Nat.succ n) s = GammaAux (Nat.succ n) (s + 1) / s
[PROOFSTEP]
dsimp only [GammaAux]
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : -s✝.re < ↑n✝
n : ℕ
hn : ∀ (s : ℂ), -s.re < ↑n → GammaAux n s = GammaAux n (s + 1) / s
s : ℂ
h1 : -s.re < ↑(Nat.succ n)
⊢ GammaAux n (s + 1) / s = GammaAux n (s + 1 + 1) / (s + 1) / s
[PROOFSTEP]
have hh1 : -(s + 1).re < n := by
  rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one] at h1
  rw [add_re, one_re]; linarith
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : -s✝.re < ↑n✝
n : ℕ
hn : ∀ (s : ℂ), -s.re < ↑n → GammaAux n s = GammaAux n (s + 1) / s
s : ℂ
h1 : -s.re < ↑(Nat.succ n)
⊢ -(s + 1).re < ↑n
[PROOFSTEP]
rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one] at h1
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : -s✝.re < ↑n✝
n : ℕ
hn : ∀ (s : ℂ), -s.re < ↑n → GammaAux n s = GammaAux n (s + 1) / s
s : ℂ
h1 : -s.re < ↑n + 1
⊢ -(s + 1).re < ↑n
[PROOFSTEP]
rw [add_re, one_re]
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : -s✝.re < ↑n✝
n : ℕ
hn : ∀ (s : ℂ), -s.re < ↑n → GammaAux n s = GammaAux n (s + 1) / s
s : ℂ
h1 : -s.re < ↑n + 1
⊢ -(s.re + 1) < ↑n
[PROOFSTEP]
linarith
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : -s✝.re < ↑n✝
n : ℕ
hn : ∀ (s : ℂ), -s.re < ↑n → GammaAux n s = GammaAux n (s + 1) / s
s : ℂ
h1 : -s.re < ↑(Nat.succ n)
hh1 : -(s + 1).re < ↑n
⊢ GammaAux n (s + 1) / s = GammaAux n (s + 1 + 1) / (s + 1) / s
[PROOFSTEP]
rw [← hn (s + 1) hh1]
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
⊢ GammaAux n s = GammaAux (n + 1) s
[PROOFSTEP]
cases' n with n n
[GOAL]
case zero
s : ℂ
h1 : -s.re < ↑Nat.zero
⊢ GammaAux Nat.zero s = GammaAux (Nat.zero + 1) s
[PROOFSTEP]
simp only [Nat.zero_eq, CharP.cast_eq_zero, Left.neg_neg_iff] at h1
[GOAL]
case zero
s : ℂ
h1 : 0 < s.re
⊢ GammaAux Nat.zero s = GammaAux (Nat.zero + 1) s
[PROOFSTEP]
dsimp only [GammaAux]
[GOAL]
case zero
s : ℂ
h1 : 0 < s.re
⊢ GammaIntegral s = GammaIntegral (s + 1) / s
[PROOFSTEP]
rw [GammaIntegral_add_one h1, mul_div_cancel_left]
[GOAL]
case zero.ha
s : ℂ
h1 : 0 < s.re
⊢ s ≠ 0
[PROOFSTEP]
rintro rfl
[GOAL]
case zero.ha
h1 : 0 < 0.re
⊢ False
[PROOFSTEP]
rw [zero_re] at h1
[GOAL]
case zero.ha
h1 : 0 < 0
⊢ False
[PROOFSTEP]
exact h1.false
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑(Nat.succ n)
⊢ GammaAux (Nat.succ n) s = GammaAux (Nat.succ n + 1) s
[PROOFSTEP]
dsimp only [GammaAux]
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑(Nat.succ n)
⊢ GammaAux n (s + 1) / s = GammaAux n (s + 1 + 1) / (s + 1) / s
[PROOFSTEP]
have : GammaAux n (s + 1 + 1) / (s + 1) = GammaAux n (s + 1) :=
  by
  have hh1 : -(s + 1).re < n :=
    by
    rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one] at h1
    rw [add_re, one_re]; linarith
  rw [GammaAux_recurrence1 (s + 1) n hh1]
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑(Nat.succ n)
⊢ GammaAux n (s + 1 + 1) / (s + 1) = GammaAux n (s + 1)
[PROOFSTEP]
have hh1 : -(s + 1).re < n := by
  rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one] at h1
  rw [add_re, one_re]; linarith
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑(Nat.succ n)
⊢ -(s + 1).re < ↑n
[PROOFSTEP]
rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one] at h1
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n + 1
⊢ -(s + 1).re < ↑n
[PROOFSTEP]
rw [add_re, one_re]
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n + 1
⊢ -(s.re + 1) < ↑n
[PROOFSTEP]
linarith
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑(Nat.succ n)
hh1 : -(s + 1).re < ↑n
⊢ GammaAux n (s + 1 + 1) / (s + 1) = GammaAux n (s + 1)
[PROOFSTEP]
rw [GammaAux_recurrence1 (s + 1) n hh1]
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑(Nat.succ n)
this : GammaAux n (s + 1 + 1) / (s + 1) = GammaAux n (s + 1)
⊢ GammaAux n (s + 1) / s = GammaAux n (s + 1 + 1) / (s + 1) / s
[PROOFSTEP]
rw [this]
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
⊢ Gamma s = GammaAux n s
[PROOFSTEP]
have u : ∀ k : ℕ, GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s :=
  by
  intro k; induction' k with k hk
  · simp [Gamma]
  · rw [← hk, Nat.succ_eq_add_one, ← add_assoc]
    refine' (GammaAux_recurrence2 s (⌊1 - s.re⌋₊ + k) _).symm
    rw [Nat.cast_add]
    have i0 := Nat.sub_one_lt_floor (1 - s.re)
    simp only [sub_sub_cancel_left] at i0
    refine' lt_add_of_lt_of_nonneg i0 _
    rw [← Nat.cast_zero, Nat.cast_le]; exact Nat.zero_le k
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
⊢ ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
[PROOFSTEP]
intro k
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
⊢ GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
[PROOFSTEP]
induction' k with k hk
[GOAL]
case zero
s : ℂ
n : ℕ
h1 : -s.re < ↑n
⊢ GammaAux (⌊1 - s.re⌋₊ + Nat.zero) s = Gamma s
[PROOFSTEP]
simp [Gamma]
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ GammaAux (⌊1 - s.re⌋₊ + Nat.succ k) s = Gamma s
[PROOFSTEP]
rw [← hk, Nat.succ_eq_add_one, ← add_assoc]
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ GammaAux (⌊1 - s.re⌋₊ + k + 1) s = GammaAux (⌊1 - s.re⌋₊ + k) s
[PROOFSTEP]
refine' (GammaAux_recurrence2 s (⌊1 - s.re⌋₊ + k) _).symm
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ -s.re < ↑(⌊1 - s.re⌋₊ + k)
[PROOFSTEP]
rw [Nat.cast_add]
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ -s.re < ↑⌊1 - s.re⌋₊ + ↑k
[PROOFSTEP]
have i0 := Nat.sub_one_lt_floor (1 - s.re)
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
i0 : 1 - s.re - 1 < ↑⌊1 - s.re⌋₊
⊢ -s.re < ↑⌊1 - s.re⌋₊ + ↑k
[PROOFSTEP]
simp only [sub_sub_cancel_left] at i0
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
i0 : -s.re < ↑⌊1 - s.re⌋₊
⊢ -s.re < ↑⌊1 - s.re⌋₊ + ↑k
[PROOFSTEP]
refine' lt_add_of_lt_of_nonneg i0 _
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
i0 : -s.re < ↑⌊1 - s.re⌋₊
⊢ 0 ≤ ↑k
[PROOFSTEP]
rw [← Nat.cast_zero, Nat.cast_le]
[GOAL]
case succ
s : ℂ
n : ℕ
h1 : -s.re < ↑n
k : ℕ
hk : GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
i0 : -s.re < ↑⌊1 - s.re⌋₊
⊢ 0 ≤ k
[PROOFSTEP]
exact Nat.zero_le k
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ Gamma s = GammaAux n s
[PROOFSTEP]
convert (u <| n - ⌊1 - s.re⌋₊).symm
[GOAL]
case h.e'_3.h.e'_1
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ n = ⌊1 - s.re⌋₊ + (n - ⌊1 - s.re⌋₊)
[PROOFSTEP]
rw [Nat.add_sub_of_le]
[GOAL]
case h.e'_3.h.e'_1
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ ⌊1 - s.re⌋₊ ≤ n
[PROOFSTEP]
by_cases 0 ≤ 1 - s.re
[GOAL]
case h.e'_3.h.e'_1
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
⊢ ⌊1 - s.re⌋₊ ≤ n
[PROOFSTEP]
by_cases 0 ≤ 1 - s.re
[GOAL]
case pos
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : 0 ≤ 1 - s.re
⊢ ⌊1 - s.re⌋₊ ≤ n
[PROOFSTEP]
apply Nat.le_of_lt_succ
[GOAL]
case pos.a
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : 0 ≤ 1 - s.re
⊢ ⌊1 - s.re⌋₊ < Nat.succ n
[PROOFSTEP]
exact_mod_cast lt_of_le_of_lt (Nat.floor_le h) (by linarith : 1 - s.re < n + 1)
[GOAL]
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : 0 ≤ 1 - s.re
⊢ 1 - s.re < ↑n + 1
[PROOFSTEP]
linarith
[GOAL]
case neg
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : ¬0 ≤ 1 - s.re
⊢ ⌊1 - s.re⌋₊ ≤ n
[PROOFSTEP]
rw [Nat.floor_of_nonpos]
[GOAL]
case neg
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : ¬0 ≤ 1 - s.re
⊢ 0 ≤ n
case neg
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : ¬0 ≤ 1 - s.re
⊢ 1 - s.re ≤ 0
[PROOFSTEP]
linarith
[GOAL]
case neg
s : ℂ
n : ℕ
h1 : -s.re < ↑n
u : ∀ (k : ℕ), GammaAux (⌊1 - s.re⌋₊ + k) s = Gamma s
h : ¬0 ≤ 1 - s.re
⊢ 1 - s.re ≤ 0
[PROOFSTEP]
linarith
[GOAL]
s : ℂ
h2 : s ≠ 0
⊢ Gamma (s + 1) = s * Gamma s
[PROOFSTEP]
let n := ⌊1 - s.re⌋₊
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
⊢ Gamma (s + 1) = s * Gamma s
[PROOFSTEP]
have t1 : -s.re < n := by simpa only [sub_sub_cancel_left] using Nat.sub_one_lt_floor (1 - s.re)
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
⊢ -s.re < ↑n
[PROOFSTEP]
simpa only [sub_sub_cancel_left] using Nat.sub_one_lt_floor (1 - s.re)
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
t1 : -s.re < ↑n
⊢ Gamma (s + 1) = s * Gamma s
[PROOFSTEP]
have t2 : -(s + 1).re < n := by rw [add_re, one_re]; linarith
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
t1 : -s.re < ↑n
⊢ -(s + 1).re < ↑n
[PROOFSTEP]
rw [add_re, one_re]
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
t1 : -s.re < ↑n
⊢ -(s.re + 1) < ↑n
[PROOFSTEP]
linarith
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
t1 : -s.re < ↑n
t2 : -(s + 1).re < ↑n
⊢ Gamma (s + 1) = s * Gamma s
[PROOFSTEP]
rw [Gamma_eq_GammaAux s n t1, Gamma_eq_GammaAux (s + 1) n t2, GammaAux_recurrence1 s n t1]
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
t1 : -s.re < ↑n
t2 : -(s + 1).re < ↑n
⊢ GammaAux n (s + 1) = s * (GammaAux n (s + 1) / s)
[PROOFSTEP]
field_simp
[GOAL]
s : ℂ
h2 : s ≠ 0
n : ℕ := ⌊1 - s.re⌋₊
t1 : -s.re < ↑n
t2 : -(s + 1).re < ↑n
⊢ GammaAux ⌊1 - s.re⌋₊ (s + 1) * s = s * GammaAux ⌊1 - s.re⌋₊ (s + 1)
[PROOFSTEP]
ring
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ -s.re < ↑0
[PROOFSTEP]
norm_cast
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ -s.re < 0
[PROOFSTEP]
linarith
[GOAL]
⊢ Gamma 1 = 1
[PROOFSTEP]
rw [Gamma_eq_integral]
[GOAL]
⊢ GammaIntegral 1 = 1
⊢ 0 < 1.re
[PROOFSTEP]
simpa using GammaIntegral_one
[GOAL]
⊢ 0 < 1.re
[PROOFSTEP]
simp
[GOAL]
n : ℕ
⊢ Gamma (↑n + 1) = ↑n !
[PROOFSTEP]
induction' n with n hn
[GOAL]
case zero
⊢ Gamma (↑Nat.zero + 1) = ↑Nat.zero !
[PROOFSTEP]
simpa using Gamma_one
[GOAL]
case succ
n : ℕ
hn : Gamma (↑n + 1) = ↑n !
⊢ Gamma (↑(Nat.succ n) + 1) = ↑(Nat.succ n)!
[PROOFSTEP]
rw [Gamma_add_one n.succ <| Nat.cast_ne_zero.mpr <| Nat.succ_ne_zero n]
[GOAL]
case succ
n : ℕ
hn : Gamma (↑n + 1) = ↑n !
⊢ ↑(Nat.succ n) * Gamma ↑(Nat.succ n) = ↑(Nat.succ n)!
[PROOFSTEP]
simp only [Nat.cast_succ, Nat.factorial_succ, Nat.cast_mul]
[GOAL]
case succ
n : ℕ
hn : Gamma (↑n + 1) = ↑n !
⊢ (↑n + 1) * Gamma (↑n + 1) = (↑n + 1) * ↑n !
[PROOFSTEP]
congr
[GOAL]
⊢ Gamma 0 = 0
[PROOFSTEP]
simp_rw [Gamma, zero_re, sub_zero, Nat.floor_one, GammaAux, div_zero]
[GOAL]
n : ℕ
⊢ Gamma (-↑n) = 0
[PROOFSTEP]
induction' n with n IH
[GOAL]
case zero
⊢ Gamma (-↑Nat.zero) = 0
[PROOFSTEP]
rw [Nat.cast_zero, neg_zero, Gamma_zero]
[GOAL]
case succ
n : ℕ
IH : Gamma (-↑n) = 0
⊢ Gamma (-↑(Nat.succ n)) = 0
[PROOFSTEP]
have A : -(n.succ : ℂ) ≠ 0 := by
  rw [neg_ne_zero, Nat.cast_ne_zero]
  apply Nat.succ_ne_zero
[GOAL]
n : ℕ
IH : Gamma (-↑n) = 0
⊢ -↑(Nat.succ n) ≠ 0
[PROOFSTEP]
rw [neg_ne_zero, Nat.cast_ne_zero]
[GOAL]
n : ℕ
IH : Gamma (-↑n) = 0
⊢ Nat.succ n ≠ 0
[PROOFSTEP]
apply Nat.succ_ne_zero
[GOAL]
case succ
n : ℕ
IH : Gamma (-↑n) = 0
A : -↑(Nat.succ n) ≠ 0
⊢ Gamma (-↑(Nat.succ n)) = 0
[PROOFSTEP]
have : -(n : ℂ) = -↑n.succ + 1 := by simp
[GOAL]
n : ℕ
IH : Gamma (-↑n) = 0
A : -↑(Nat.succ n) ≠ 0
⊢ -↑n = -↑(Nat.succ n) + 1
[PROOFSTEP]
simp
[GOAL]
case succ
n : ℕ
IH : Gamma (-↑n) = 0
A : -↑(Nat.succ n) ≠ 0
this : -↑n = -↑(Nat.succ n) + 1
⊢ Gamma (-↑(Nat.succ n)) = 0
[PROOFSTEP]
rw [this, Gamma_add_one _ A] at IH
[GOAL]
case succ
n : ℕ
IH : -↑(Nat.succ n) * Gamma (-↑(Nat.succ n)) = 0
A : -↑(Nat.succ n) ≠ 0
this : -↑n = -↑(Nat.succ n) + 1
⊢ Gamma (-↑(Nat.succ n)) = 0
[PROOFSTEP]
contrapose! IH
[GOAL]
case succ
n : ℕ
A : -↑(Nat.succ n) ≠ 0
this : -↑n = -↑(Nat.succ n) + 1
IH : Gamma (-↑(Nat.succ n)) ≠ 0
⊢ -↑(Nat.succ n) * Gamma (-↑(Nat.succ n)) ≠ 0
[PROOFSTEP]
exact mul_ne_zero A IH
[GOAL]
s : ℂ
⊢ Gamma (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (Gamma s)
[PROOFSTEP]
suffices : ∀ (n : ℕ) (s : ℂ), GammaAux n (conj s) = conj (GammaAux n s)
[GOAL]
s : ℂ
this : ∀ (n : ℕ) (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
⊢ Gamma (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (Gamma s)
case this s : ℂ ⊢ ∀ (n : ℕ) (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
[PROOFSTEP]
exact this _ _
[GOAL]
case this
s : ℂ
⊢ ∀ (n : ℕ) (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
[PROOFSTEP]
intro n
[GOAL]
case this
s : ℂ
n : ℕ
⊢ ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
[PROOFSTEP]
induction' n with n IH
[GOAL]
case this.zero
s : ℂ
⊢ ∀ (s : ℂ), GammaAux Nat.zero (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux Nat.zero s)
[PROOFSTEP]
rw [GammaAux]
[GOAL]
case this.zero
s : ℂ
⊢ ∀ (s : ℂ), GammaIntegral (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaIntegral s)
[PROOFSTEP]
exact GammaIntegral_conj
[GOAL]
case this.succ
s : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
⊢ ∀ (s : ℂ), GammaAux (Nat.succ n) (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux (Nat.succ n) s)
[PROOFSTEP]
intro s
[GOAL]
case this.succ
s✝ : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
s : ℂ
⊢ GammaAux (Nat.succ n) (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux (Nat.succ n) s)
[PROOFSTEP]
rw [GammaAux]
[GOAL]
case this.succ
s✝ : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
s : ℂ
⊢ (fun s => GammaAux n (s + 1) / s) (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) ((fun s => GammaAux n (s + 1) / s) s)
[PROOFSTEP]
dsimp only
[GOAL]
case this.succ
s✝ : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
s : ℂ
⊢ GammaAux n (↑(starRingEnd ℂ) s + 1) / ↑(starRingEnd ℂ) s = ↑(starRingEnd ℂ) (GammaAux n (s + 1) / s)
[PROOFSTEP]
rw [div_eq_mul_inv _ s, RingHom.map_mul, conj_inv, ← div_eq_mul_inv]
[GOAL]
case this.succ
s✝ : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
s : ℂ
⊢ GammaAux n (↑(starRingEnd ℂ) s + 1) / ↑(starRingEnd ℂ) s = ↑(starRingEnd ℂ) (GammaAux n (s + 1)) / ↑(starRingEnd ℂ) s
[PROOFSTEP]
suffices conj s + 1 = conj (s + 1) by rw [this, IH]
[GOAL]
s✝ : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
s : ℂ
this : ↑(starRingEnd ℂ) s + 1 = ↑(starRingEnd ℂ) (s + 1)
⊢ GammaAux n (↑(starRingEnd ℂ) s + 1) / ↑(starRingEnd ℂ) s = ↑(starRingEnd ℂ) (GammaAux n (s + 1)) / ↑(starRingEnd ℂ) s
[PROOFSTEP]
rw [this, IH]
[GOAL]
case this.succ
s✝ : ℂ
n : ℕ
IH : ∀ (s : ℂ), GammaAux n (↑(starRingEnd ℂ) s) = ↑(starRingEnd ℂ) (GammaAux n s)
s : ℂ
⊢ ↑(starRingEnd ℂ) s + 1 = ↑(starRingEnd ℂ) (s + 1)
[PROOFSTEP]
rw [RingHom.map_add, RingHom.map_one]
[GOAL]
s : ℂ
⊢ GammaIntegral s = mellin (fun x => ↑(Real.exp (-x))) s
[PROOFSTEP]
simp only [mellin, GammaIntegral, smul_eq_mul, mul_comm]
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ HasDerivAt GammaIntegral (∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) * (↑(Real.log t) * ↑(Real.exp (-t)))) s
[PROOFSTEP]
rw [GammaIntegral_eq_mellin]
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ HasDerivAt (mellin fun x => ↑(Real.exp (-x))) (∫ (t : ℝ) in Ioi 0, ↑t ^ (s - 1) * (↑(Real.log t) * ↑(Real.exp (-t))))
    s
[PROOFSTEP]
convert (mellin_hasDerivAt_of_isBigO_rpow (E := ℂ) _ _ (lt_add_one _) _ hs).2
[GOAL]
case convert_2
s : ℂ
hs : 0 < s.re
⊢ LocallyIntegrableOn (fun x => ↑(Real.exp (-x))) (Ioi 0)
[PROOFSTEP]
refine' (Continuous.continuousOn _).locallyIntegrableOn measurableSet_Ioi
[GOAL]
case convert_2
s : ℂ
hs : 0 < s.re
⊢ Continuous fun x => ↑(Real.exp (-x))
[PROOFSTEP]
exact continuous_ofReal.comp (Real.continuous_exp.comp continuous_neg)
[GOAL]
case convert_3
s : ℂ
hs : 0 < s.re
⊢ (fun x => ↑(Real.exp (-x))) =O[atTop] fun x => x ^ (-(s.re + 1))
[PROOFSTEP]
rw [← isBigO_norm_left]
[GOAL]
case convert_3
s : ℂ
hs : 0 < s.re
⊢ (fun x => ‖↑(Real.exp (-x))‖) =O[atTop] fun x => x ^ (-(s.re + 1))
[PROOFSTEP]
simp_rw [Complex.norm_eq_abs, abs_ofReal, ← Real.norm_eq_abs, isBigO_norm_left]
[GOAL]
case convert_3
s : ℂ
hs : 0 < s.re
⊢ (fun x => Real.exp (-x)) =O[atTop] fun x => x ^ (-(s.re + 1))
[PROOFSTEP]
simpa only [neg_one_mul] using (isLittleO_exp_neg_mul_rpow_atTop zero_lt_one _).isBigO
[GOAL]
case convert_4
s : ℂ
hs : 0 < s.re
⊢ (fun x => ↑(Real.exp (-x))) =O[𝓝[Ioi 0] 0] fun x => x ^ (-0)
[PROOFSTEP]
simp_rw [neg_zero, rpow_zero]
[GOAL]
case convert_4
s : ℂ
hs : 0 < s.re
⊢ (fun x => ↑(Real.exp (-x))) =O[𝓝[Ioi 0] 0] fun x => 1
[PROOFSTEP]
refine' isBigO_const_of_tendsto (_ : Tendsto _ _ (𝓝 (1 : ℂ))) one_ne_zero
[GOAL]
case convert_4
s : ℂ
hs : 0 < s.re
⊢ Tendsto (fun x => ↑(Real.exp (-x))) (𝓝[Ioi 0] 0) (𝓝 1)
[PROOFSTEP]
rw [(by simp : (1 : ℂ) = Real.exp (-0))]
[GOAL]
s : ℂ
hs : 0 < s.re
⊢ 1 = ↑(Real.exp (-0))
[PROOFSTEP]
simp
[GOAL]
case convert_4
s : ℂ
hs : 0 < s.re
⊢ Tendsto (fun x => ↑(Real.exp (-x))) (𝓝[Ioi 0] 0) (𝓝 ↑(Real.exp (-0)))
[PROOFSTEP]
exact (continuous_ofReal.comp (Real.continuous_exp.comp continuous_neg)).continuousWithinAt
[GOAL]
s : ℂ
n : ℕ
h1 : 1 - s.re < ↑n
h2 : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ (GammaAux n) s
[PROOFSTEP]
induction' n with n hn generalizing s
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : 1 - s✝.re < ↑n
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
s : ℂ
h1 : 1 - s.re < ↑Nat.zero
h2 : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ (GammaAux Nat.zero) s
[PROOFSTEP]
refine' (hasDerivAt_GammaIntegral _).differentiableAt
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : 1 - s✝.re < ↑n
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
s : ℂ
h1 : 1 - s.re < ↑Nat.zero
h2 : ∀ (m : ℕ), s ≠ -↑m
⊢ 0 < s.re
[PROOFSTEP]
rw [Nat.cast_zero] at h1
[GOAL]
case zero
s✝ : ℂ
n : ℕ
h1✝ : 1 - s✝.re < ↑n
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
s : ℂ
h1 : 1 - s.re < 0
h2 : ∀ (m : ℕ), s ≠ -↑m
⊢ 0 < s.re
[PROOFSTEP]
linarith
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n : ℕ
hn : ∀ (s : ℂ), 1 - s.re < ↑n → (∀ (m : ℕ), s ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) s
s : ℂ
h1 : 1 - s.re < ↑(Nat.succ n)
h2 : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ (GammaAux (Nat.succ n)) s
[PROOFSTEP]
dsimp only [GammaAux]
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n : ℕ
hn : ∀ (s : ℂ), 1 - s.re < ↑n → (∀ (m : ℕ), s ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) s
s : ℂ
h1 : 1 - s.re < ↑(Nat.succ n)
h2 : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ (fun s => GammaAux n (s + 1) / s) s
[PROOFSTEP]
specialize hn (s + 1)
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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)
⊢ DifferentiableAt ℂ (fun s => GammaAux n (s + 1) / s) s
[PROOFSTEP]
have a : 1 - (s + 1).re < ↑n := by rw [Nat.cast_succ] at h1 ; rw [Complex.add_re, Complex.one_re]; linarith
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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)
⊢ 1 - (s + 1).re < ↑n
[PROOFSTEP]
rw [Nat.cast_succ] at h1
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n : ℕ
s : ℂ
h1 : 1 - s.re < ↑n + 1
h2 : ∀ (m : ℕ), s ≠ -↑m
hn : 1 - (s + 1).re < ↑n → (∀ (m : ℕ), s + 1 ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) (s + 1)
⊢ 1 - (s + 1).re < ↑n
[PROOFSTEP]
rw [Complex.add_re, Complex.one_re]
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n : ℕ
s : ℂ
h1 : 1 - s.re < ↑n + 1
h2 : ∀ (m : ℕ), s ≠ -↑m
hn : 1 - (s + 1).re < ↑n → (∀ (m : ℕ), s + 1 ≠ -↑m) → DifferentiableAt ℂ (GammaAux n) (s + 1)
⊢ 1 - (s.re + 1) < ↑n
[PROOFSTEP]
linarith
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
⊢ DifferentiableAt ℂ (fun s => GammaAux n (s + 1) / s) s
[PROOFSTEP]
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
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
⊢ ∀ (m : ℕ), s + 1 ≠ -↑m
[PROOFSTEP]
intro m
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
m : ℕ
⊢ s + 1 ≠ -↑m
[PROOFSTEP]
have := h2 (1 + m)
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
m : ℕ
this : s ≠ -↑(1 + m)
⊢ s + 1 ≠ -↑m
[PROOFSTEP]
contrapose! this
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
m : ℕ
this : s + 1 = -↑m
⊢ s = -↑(1 + m)
[PROOFSTEP]
rw [← eq_sub_iff_add_eq] at this
[GOAL]
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
m : ℕ
this : s = -↑m - 1
⊢ s = -↑(1 + m)
[PROOFSTEP]
simpa using this
[GOAL]
case succ
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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 => GammaAux n (s + 1) / s) s
[PROOFSTEP]
refine' DifferentiableAt.div (DifferentiableAt.comp _ (hn a b) _) _ _
[GOAL]
case succ.refine'_1
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
[PROOFSTEP]
rw [differentiableAt_add_const_iff (1 : ℂ)]
[GOAL]
case succ.refine'_1
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
[PROOFSTEP]
exact differentiableAt_id
[GOAL]
case succ.refine'_2
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
[PROOFSTEP]
exact differentiableAt_id
[GOAL]
case succ.refine'_3
s✝ : ℂ
n✝ : ℕ
h1✝ : 1 - s✝.re < ↑n✝
h2✝ : ∀ (m : ℕ), s✝ ≠ -↑m
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
[PROOFSTEP]
simpa using h2 0
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℂ Gamma s
[PROOFSTEP]
let n := ⌊1 - s.re⌋₊ + 1
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
⊢ DifferentiableAt ℂ Gamma s
[PROOFSTEP]
have hn : 1 - s.re < n := by exact_mod_cast Nat.lt_floor_add_one (1 - s.re)
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
⊢ 1 - s.re < ↑n
[PROOFSTEP]
exact_mod_cast Nat.lt_floor_add_one (1 - s.re)
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
⊢ DifferentiableAt ℂ Gamma s
[PROOFSTEP]
apply (differentiableAt_GammaAux s n hn hs).congr_of_eventuallyEq
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
⊢ Gamma =ᶠ[𝓝 s] GammaAux n
[PROOFSTEP]
let S := {t : ℂ | 1 - t.re < n}
[GOAL]
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
[PROOFSTEP]
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
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ S ∈ 𝓝 s
[PROOFSTEP]
rw [mem_nhds_iff]
[GOAL]
s : ℂ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ := ⌊1 - s.re⌋₊ + 1
hn : 1 - s.re < ↑n
S : Set ℂ := {t | 1 - t.re < ↑n}
⊢ ∃ t, t ⊆ S ∧ IsOpen t ∧ s ∈ t
[PROOFSTEP]
use S
[GOAL]
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
[PROOFSTEP]
refine' ⟨Subset.rfl, _, hn⟩
[GOAL]
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
[PROOFSTEP]
have : S = re ⁻¹' Ioi (1 - n : ℝ) := by ext; rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq];
  exact sub_lt_comm
[GOAL]
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)
[PROOFSTEP]
ext
[GOAL]
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)
[PROOFSTEP]
rw [preimage, Ioi, mem_setOf_eq, mem_setOf_eq, mem_setOf_eq]
[GOAL]
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
[PROOFSTEP]
exact sub_lt_comm
[GOAL]
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
[PROOFSTEP]
rw [this]
[GOAL]
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))
[PROOFSTEP]
refine' Continuous.isOpen_preimage continuous_re _ isOpen_Ioi
[GOAL]
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
[PROOFSTEP]
apply eventuallyEq_of_mem this
[GOAL]
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
[PROOFSTEP]
intro t ht
[GOAL]
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
[PROOFSTEP]
rw [mem_setOf_eq] at ht
[GOAL]
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
[PROOFSTEP]
apply Gamma_eq_GammaAux
[GOAL]
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
[PROOFSTEP]
linarith
[GOAL]
⊢ Tendsto (fun z => z * Gamma z) (𝓝[{0}ᶜ] 0) (𝓝 1)
[PROOFSTEP]
rw [show 𝓝 (1 : ℂ) = 𝓝 (Gamma (0 + 1)) by simp only [zero_add, Complex.Gamma_one]]
[GOAL]
⊢ 𝓝 1 = 𝓝 (Gamma (0 + 1))
[PROOFSTEP]
simp only [zero_add, Complex.Gamma_one]
[GOAL]
⊢ Tendsto (fun z => z * Gamma z) (𝓝[{0}ᶜ] 0) (𝓝 (Gamma (0 + 1)))
[PROOFSTEP]
convert (Tendsto.mono_left _ nhdsWithin_le_nhds).congr' (eventuallyEq_of_mem self_mem_nhdsWithin Complex.Gamma_add_one)
[GOAL]
case convert_1
⊢ Tendsto (fun x => Gamma (x + 1)) (𝓝 0) (𝓝 (Gamma (0 + 1)))
[PROOFSTEP]
refine' ContinuousAt.comp (g := Gamma) _ (continuous_id.add continuous_const).continuousAt
[GOAL]
case convert_1
⊢ ContinuousAt Gamma (0 + 1)
[PROOFSTEP]
refine' (Complex.differentiableAt_Gamma _ fun m => _).continuousAt
[GOAL]
case convert_1
m : ℕ
⊢ 0 + 1 ≠ -↑m
[PROOFSTEP]
rw [zero_add, ← ofReal_nat_cast, ← ofReal_neg, ← ofReal_one, Ne.def, ofReal_inj]
[GOAL]
case convert_1
m : ℕ
⊢ ¬1 = -↑m
[PROOFSTEP]
refine' (lt_of_le_of_lt _ zero_lt_one).ne'
[GOAL]
case convert_1
m : ℕ
⊢ -↑m ≤ 0
[PROOFSTEP]
exact neg_nonpos.mpr (Nat.cast_nonneg _)
[GOAL]
s : ℝ
hs : 0 < s
⊢ Gamma s = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
rw [Gamma, Complex.Gamma_eq_integral (by rwa [Complex.ofReal_re] : 0 < Complex.re s)]
[GOAL]
s : ℝ
hs : 0 < s
⊢ 0 < (↑s).re
[PROOFSTEP]
rwa [Complex.ofReal_re]
[GOAL]
s : ℝ
hs : 0 < s
⊢ (Complex.GammaIntegral ↑s).re = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
dsimp only [Complex.GammaIntegral]
[GOAL]
s : ℝ
hs : 0 < s
⊢ (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ (↑s - 1)).re = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
simp_rw [← Complex.ofReal_one, ← Complex.ofReal_sub]
[GOAL]
s : ℝ
hs : 0 < s
⊢ (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1)).re = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
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]
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
⊢ (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1)).re = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
have cc : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
⊢ (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1)).re = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
conv_lhs => rw [this]; enter [1, 2, x]; rw [cc]
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
| (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1)).re
[PROOFSTEP]
rw [this]; enter [1, 2, x]; rw [cc]
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
| (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1)).re
[PROOFSTEP]
rw [this]; enter [1, 2, x]; rw [cc]
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
| (∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1)).re
[PROOFSTEP]
rw [this]
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
| (∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))).re
[PROOFSTEP]
enter [1, 2, x]
[GOAL]
case h
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
| ↑(exp (-x) * x ^ (s - 1))
[PROOFSTEP]
rw [cc]
[GOAL]
s : ℝ
hs : 0 < s
this : ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
cc : ∀ (r : ℝ), ↑r = ↑r
⊢ (∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))).re = ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
rw [_root_.integral_ofReal, ← cc, Complex.ofReal_re]
[GOAL]
s : ℝ
hs : 0 < s
⊢ ∫ (x : ℝ) in Ioi 0, ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ∫ (x : ℝ) in Ioi 0, ↑(exp (-x) * x ^ (s - 1))
[PROOFSTEP]
refine' set_integral_congr measurableSet_Ioi fun x hx => _
[GOAL]
s : ℝ
hs : 0 < s
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(exp (-x)) * ↑x ^ ↑(s - 1) = ↑(exp (-x) * x ^ (s - 1))
[PROOFSTEP]
push_cast
[GOAL]
s : ℝ
hs : 0 < s
x : ℝ
hx : x ∈ Ioi 0
⊢ Complex.exp (-↑x) * ↑x ^ (↑s - 1) = Complex.exp (-↑x) * ↑(x ^ (s - 1))
[PROOFSTEP]
rw [Complex.ofReal_cpow (le_of_lt hx)]
[GOAL]
s : ℝ
hs : 0 < s
x : ℝ
hx : x ∈ Ioi 0
⊢ Complex.exp (-↑x) * ↑x ^ (↑s - 1) = Complex.exp (-↑x) * ↑x ^ ↑(s - 1)
[PROOFSTEP]
push_cast
[GOAL]
s : ℝ
hs : 0 < s
x : ℝ
hx : x ∈ Ioi 0
⊢ Complex.exp (-↑x) * ↑x ^ (↑s - 1) = Complex.exp (-↑x) * ↑x ^ (↑s - 1)
[PROOFSTEP]
rfl
[GOAL]
s : ℝ
hs : s ≠ 0
⊢ Gamma (s + 1) = s * Gamma s
[PROOFSTEP]
simp_rw [Gamma]
[GOAL]
s : ℝ
hs : s ≠ 0
⊢ (Complex.Gamma ↑(s + 1)).re = s * (Complex.Gamma ↑s).re
[PROOFSTEP]
rw [Complex.ofReal_add, Complex.ofReal_one, Complex.Gamma_add_one, Complex.ofReal_mul_re]
[GOAL]
case h2
s : ℝ
hs : s ≠ 0
⊢ ↑s ≠ 0
[PROOFSTEP]
rwa [Complex.ofReal_ne_zero]
[GOAL]
⊢ Gamma 1 = 1
[PROOFSTEP]
rw [Gamma, Complex.ofReal_one, Complex.Gamma_one, Complex.one_re]
[GOAL]
s : ℝ
⊢ Complex.Gamma ↑s = ↑(Gamma s)
[PROOFSTEP]
rw [Gamma, eq_comm, ← Complex.conj_eq_iff_re, ← Complex.Gamma_conj, Complex.conj_ofReal]
[GOAL]
n : ℕ
⊢ Gamma (↑n + 1) = ↑n !
[PROOFSTEP]
rw [Gamma, Complex.ofReal_add, Complex.ofReal_nat_cast, Complex.ofReal_one, Complex.Gamma_nat_eq_factorial, ←
  Complex.ofReal_nat_cast, Complex.ofReal_re]
[GOAL]
⊢ Gamma 0 = 0
[PROOFSTEP]
simpa only [← Complex.ofReal_zero, Complex.Gamma_ofReal, Complex.ofReal_inj] using Complex.Gamma_zero
[GOAL]
n : ℕ
⊢ Gamma (-↑n) = 0
[PROOFSTEP]
simpa only [← Complex.ofReal_nat_cast, ← Complex.ofReal_neg, Complex.Gamma_ofReal, Complex.ofReal_eq_zero] using
  Complex.Gamma_neg_nat_eq_zero n
[GOAL]
s : ℝ
hs : 0 < s
⊢ 0 < Gamma s
[PROOFSTEP]
rw [Gamma_eq_integral hs]
[GOAL]
s : ℝ
hs : 0 < s
⊢ 0 < ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
have : (Function.support fun x : ℝ => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0 :=
  by
  rw [inter_eq_right_iff_subset]
  intro x hx
  rw [Function.mem_support]
  exact mul_ne_zero (exp_pos _).ne' (rpow_pos_of_pos hx _).ne'
[GOAL]
s : ℝ
hs : 0 < s
⊢ (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
[PROOFSTEP]
rw [inter_eq_right_iff_subset]
[GOAL]
s : ℝ
hs : 0 < s
⊢ Ioi 0 ⊆ Function.support fun x => exp (-x) * x ^ (s - 1)
[PROOFSTEP]
intro x hx
[GOAL]
s : ℝ
hs : 0 < s
x : ℝ
hx : x ∈ Ioi 0
⊢ x ∈ Function.support fun x => exp (-x) * x ^ (s - 1)
[PROOFSTEP]
rw [Function.mem_support]
[GOAL]
s : ℝ
hs : 0 < s
x : ℝ
hx : x ∈ Ioi 0
⊢ exp (-x) * x ^ (s - 1) ≠ 0
[PROOFSTEP]
exact mul_ne_zero (exp_pos _).ne' (rpow_pos_of_pos hx _).ne'
[GOAL]
s : ℝ
hs : 0 < s
this : (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
⊢ 0 < ∫ (x : ℝ) in Ioi 0, exp (-x) * x ^ (s - 1)
[PROOFSTEP]
rw [set_integral_pos_iff_support_of_nonneg_ae]
[GOAL]
s : ℝ
hs : 0 < s
this : (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
⊢ 0 < ↑↑volume ((Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0)
[PROOFSTEP]
rw [this, volume_Ioi, ← ENNReal.ofReal_zero]
[GOAL]
s : ℝ
hs : 0 < s
this : (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
⊢ ENNReal.ofReal 0 < ⊤
[PROOFSTEP]
exact ENNReal.ofReal_lt_top
[GOAL]
case hf
s : ℝ
hs : 0 < s
this : (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
⊢ 0 ≤ᵐ[Measure.restrict volume (Ioi 0)] fun x => exp (-x) * x ^ (s - 1)
[PROOFSTEP]
refine' eventually_of_mem (self_mem_ae_restrict measurableSet_Ioi) _
[GOAL]
case hf
s : ℝ
hs : 0 < s
this : (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
⊢ ∀ (x : ℝ), x ∈ Ioi 0 → OfNat.ofNat 0 x ≤ (fun x => exp (-x) * x ^ (s - 1)) x
[PROOFSTEP]
exact fun x hx => (mul_pos (exp_pos _) (rpow_pos_of_pos hx _)).le
[GOAL]
case hfi
s : ℝ
hs : 0 < s
this : (Function.support fun x => exp (-x) * x ^ (s - 1)) ∩ Ioi 0 = Ioi 0
⊢ IntegrableOn (fun x => exp (-x) * x ^ (s - 1)) (Ioi 0)
[PROOFSTEP]
exact GammaIntegral_convergent hs
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ Gamma s ≠ 0
[PROOFSTEP]
suffices ∀ {n : ℕ}, -(n : ℝ) < s → Gamma s ≠ 0 by
  apply this
  swap; exact ⌊-s⌋₊ + 1
  rw [neg_lt, Nat.cast_add, Nat.cast_one]
  exact Nat.lt_floor_add_one _
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0
⊢ Gamma s ≠ 0
[PROOFSTEP]
apply this
[GOAL]
case a
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0
⊢ -↑?n < s
case n s : ℝ hs : ∀ (m : ℕ), s ≠ -↑m this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0 ⊢ ℕ
[PROOFSTEP]
swap
[GOAL]
case n
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0
⊢ ℕ
case a s : ℝ hs : ∀ (m : ℕ), s ≠ -↑m this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0 ⊢ -↑?n < s
[PROOFSTEP]
exact ⌊-s⌋₊ + 1
[GOAL]
case a
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0
⊢ -↑(⌊-s⌋₊ + 1) < s
[PROOFSTEP]
rw [neg_lt, Nat.cast_add, Nat.cast_one]
[GOAL]
case a
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
this : ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0
⊢ -s < ↑⌊-s⌋₊ + 1
[PROOFSTEP]
exact Nat.lt_floor_add_one _
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ ∀ {n : ℕ}, -↑n < s → Gamma s ≠ 0
[PROOFSTEP]
intro n
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
n : ℕ
⊢ -↑n < s → Gamma s ≠ 0
[PROOFSTEP]
induction' n with _ n_ih generalizing s
[GOAL]
case zero
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ -↑Nat.zero < s → Gamma s ≠ 0
[PROOFSTEP]
intro hs
[GOAL]
case zero
s✝ : ℝ
hs✝¹ : ∀ (m : ℕ), s✝ ≠ -↑m
s : ℝ
hs✝ : ∀ (m : ℕ), s ≠ -↑m
hs : -↑Nat.zero < s
⊢ Gamma s ≠ 0
[PROOFSTEP]
refine' (Gamma_pos_of_pos _).ne'
[GOAL]
case zero
s✝ : ℝ
hs✝¹ : ∀ (m : ℕ), s✝ ≠ -↑m
s : ℝ
hs✝ : ∀ (m : ℕ), s ≠ -↑m
hs : -↑Nat.zero < s
⊢ 0 < s
[PROOFSTEP]
rwa [Nat.cast_zero, neg_zero] at hs
[GOAL]
case succ
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ -↑(Nat.succ n✝) < s → Gamma s ≠ 0
[PROOFSTEP]
intro hs'
[GOAL]
case succ
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
⊢ Gamma s ≠ 0
[PROOFSTEP]
have : Gamma (s + 1) ≠ 0 := by
  apply n_ih
  · intro m
    specialize hs (1 + m)
    contrapose! hs
    rw [← eq_sub_iff_add_eq] at hs
    rw [hs]
    push_cast
    ring
  · rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one, neg_add] at hs'
    linarith
[GOAL]
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
⊢ Gamma (s + 1) ≠ 0
[PROOFSTEP]
apply n_ih
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
⊢ ∀ (m : ℕ), s + 1 ≠ -↑m
[PROOFSTEP]
intro m
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
m : ℕ
⊢ s + 1 ≠ -↑m
[PROOFSTEP]
specialize hs (1 + m)
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs' : -↑(Nat.succ n✝) < s
m : ℕ
hs : s ≠ -↑(1 + m)
⊢ s + 1 ≠ -↑m
[PROOFSTEP]
contrapose! hs
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs' : -↑(Nat.succ n✝) < s
m : ℕ
hs : s + 1 = -↑m
⊢ s = -↑(1 + m)
[PROOFSTEP]
rw [← eq_sub_iff_add_eq] at hs
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs' : -↑(Nat.succ n✝) < s
m : ℕ
hs : s = -↑m - 1
⊢ s = -↑(1 + m)
[PROOFSTEP]
rw [hs]
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs' : -↑(Nat.succ n✝) < s
m : ℕ
hs : s = -↑m - 1
⊢ -↑m - 1 = -↑(1 + m)
[PROOFSTEP]
push_cast
[GOAL]
case hs
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs' : -↑(Nat.succ n✝) < s
m : ℕ
hs : s = -↑m - 1
⊢ -↑m - 1 = -(1 + ↑m)
[PROOFSTEP]
ring
[GOAL]
case a
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
⊢ -↑n✝ < s + 1
[PROOFSTEP]
rw [Nat.succ_eq_add_one, Nat.cast_add, Nat.cast_one, neg_add] at hs'
[GOAL]
case a
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑n✝ + -1 < s
⊢ -↑n✝ < s + 1
[PROOFSTEP]
linarith
[GOAL]
case succ
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
this : Gamma (s + 1) ≠ 0
⊢ Gamma s ≠ 0
[PROOFSTEP]
rw [Gamma_add_one, mul_ne_zero_iff] at this
[GOAL]
case succ
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
this : s ≠ 0 ∧ Gamma s ≠ 0
⊢ Gamma s ≠ 0
[PROOFSTEP]
exact this.2
[GOAL]
case succ
s✝ : ℝ
hs✝ : ∀ (m : ℕ), s✝ ≠ -↑m
n✝ : ℕ
n_ih : ∀ {s : ℝ}, (∀ (m : ℕ), s ≠ -↑m) → -↑n✝ < s → Gamma s ≠ 0
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
hs' : -↑(Nat.succ n✝) < s
this : Gamma (s + 1) ≠ 0
⊢ s ≠ 0
[PROOFSTEP]
simpa using hs 0
[GOAL]
s : ℝ
⊢ Gamma s = 0 → ∃ m, s = -↑m
[PROOFSTEP]
contrapose!
[GOAL]
s : ℝ
⊢ (∀ (m : ℕ), s ≠ -↑m) → Gamma s ≠ 0
[PROOFSTEP]
exact Gamma_ne_zero
[GOAL]
s : ℝ
⊢ (∃ m, s = -↑m) → Gamma s = 0
[PROOFSTEP]
rintro ⟨m, rfl⟩
[GOAL]
case intro
m : ℕ
⊢ Gamma (-↑m) = 0
[PROOFSTEP]
exact Gamma_neg_nat_eq_zero m
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ DifferentiableAt ℝ Gamma s
[PROOFSTEP]
refine' (Complex.differentiableAt_Gamma _ _).hasDerivAt.real_of_complex.differentiableAt
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ ∀ (m : ℕ), ↑s ≠ -↑m
[PROOFSTEP]
simp_rw [← Complex.ofReal_nat_cast, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
[GOAL]
s : ℝ
hs : ∀ (m : ℕ), s ≠ -↑m
⊢ ∀ (m : ℕ), ¬s = -↑m
[PROOFSTEP]
exact hs