l3lab/ntp-mathlib huggingface dataset:
theorem GammaIntegral_ofReal (s : ℝ) :
    GammaIntegral ↑s = ↑(∫ x : ℝ in Ioi 0, Real.exp (-x) * x ^ (s - 1)) := by
  have : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
  rw [GammaIntegral]
  conv_rhs => rw [this, ← _root_.integral_ofReal]
  refine' set_integral_congr measurableSet_Ioi _
  intro x hx; 

Proof state:
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ (fun x => ↑(rexp (-x)) * ↑x ^ (↑s - 1)) x = (fun a => ↑(rexp (-a) * a ^ (s - 1))) x

Next tactic:
dsimp only
theorem GammaIntegral_ofReal (s : ℝ) :
    GammaIntegral ↑s = ↑(∫ x : ℝ in Ioi 0, Real.exp (-x) * x ^ (s - 1)) := by
  have : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
  rw [GammaIntegral]
  conv_rhs => rw [this, ← _root_.integral_ofReal]
  refine' set_integral_congr measurableSet_Ioi _
  intro x hx; dsimp only
  

Proof state:
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(rexp (-x)) * ↑x ^ (↑s - 1) = ↑(rexp (-x) * x ^ (s - 1))

Next tactic:
conv_rhs => rw [← this]
theorem GammaIntegral_ofReal (s : ℝ) :
    GammaIntegral ↑s = ↑(∫ x : ℝ in Ioi 0, Real.exp (-x) * x ^ (s - 1)) := by
  have : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
  rw [GammaIntegral]
  conv_rhs => rw [this, ← _root_.integral_ofReal]
  refine' set_integral_congr measurableSet_Ioi _
  intro x hx; dsimp only
  conv_rhs => 

Proof state:
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
| ↑(rexp (-x) * x ^ (s - 1))

Next tactic:
rw [← this]
theorem GammaIntegral_ofReal (s : ℝ) :
    GammaIntegral ↑s = ↑(∫ x : ℝ in Ioi 0, Real.exp (-x) * x ^ (s - 1)) := by
  have : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
  rw [GammaIntegral]
  conv_rhs => rw [this, ← _root_.integral_ofReal]
  refine' set_integral_congr measurableSet_Ioi _
  intro x hx; dsimp only
  conv_rhs => rw [← this]
  

Proof state:
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(rexp (-x)) * ↑x ^ (↑s - 1) = ↑(rexp (-x) * x ^ (s - 1))

Next tactic:
rw [ofReal_mul, ofReal_cpow (mem_Ioi.mp hx).le]
theorem GammaIntegral_ofReal (s : ℝ) :
    GammaIntegral ↑s = ↑(∫ x : ℝ in Ioi 0, Real.exp (-x) * x ^ (s - 1)) := by
  have : ∀ r : ℝ, Complex.ofReal' r = @IsROrC.ofReal ℂ _ r := fun r => rfl
  rw [GammaIntegral]
  conv_rhs => rw [this, ← _root_.integral_ofReal]
  refine' set_integral_congr measurableSet_Ioi _
  intro x hx; dsimp only
  conv_rhs => rw [← this]
  rw [ofReal_mul, ofReal_cpow (mem_Ioi.mp hx).le]
  

Proof state:
s : ℝ
this : ∀ (r : ℝ), ↑r = ↑r
x : ℝ
hx : x ∈ Ioi 0
⊢ ↑(rexp (-x)) * ↑x ^ (↑s - 1) = ↑(rexp (-x)) * ↑x ^ ↑(s - 1)

Next tactic:
simp
@[simp]
theorem GammaIntegral_one : GammaIntegral 1 = 1 := by
  

Proof state:
⊢ GammaIntegral 1 = 1

Next tactic:
simpa only [← ofReal_one, GammaIntegral_ofReal, ofReal_inj, sub_self, rpow_zero,
    mul_one] using integral_exp_neg_Ioi_zero
private theorem Gamma_integrand_interval_integrable (s : ℂ) {X : ℝ} (hs : 0 < s.re) (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => (-x).exp * x ^ (s - 1) : ℝ → ℂ) volume 0 X := by
  

Proof state:
s : ℂ
X : ℝ
hs : 0 < s.re
hX : 0 ≤ X
⊢ IntervalIntegrable (fun x => ↑(rexp (-x)) * ↑x ^ (s - 1)) volume 0 X

Next tactic:
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hX]
private theorem Gamma_integrand_interval_integrable (s : ℂ) {X : ℝ} (hs : 0 < s.re) (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => (-x).exp * x ^ (s - 1) : ℝ → ℂ) volume 0 X := by
  rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hX]
  

Proof state:
s : ℂ
X : ℝ
hs : 0 < s.re
hX : 0 ≤ X
⊢ IntegrableOn (fun x => ↑(rexp (-x)) * ↑x ^ (s - 1)) (Ioc 0 X)

Next tactic:
exact IntegrableOn.mono_set (GammaIntegral_convergent hs) Ioc_subset_Ioi_self
private theorem Gamma_integrand_deriv_integrable_A {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => -((-x).exp * x ^ s) : ℝ → ℂ) volume 0 X := by
  

Proof state:
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ IntervalIntegrable (fun x => -(↑(rexp (-x)) * ↑x ^ s)) volume 0 X

Next tactic:
convert (Gamma_integrand_interval_integrable (s + 1) _ hX).neg
private theorem Gamma_integrand_deriv_integrable_A {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => -((-x).exp * x ^ s) : ℝ → ℂ) volume 0 X := by
  convert (Gamma_integrand_interval_integrable (s + 1) _ hX).neg
  · 

Proof state:
case h.e'_3.h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x✝ : ℝ
⊢ -(↑(rexp (-x✝)) * ↑x✝ ^ s) = (-fun x => ↑(rexp (-x)) * ↑x ^ (s + 1 - 1)) x✝

Next tactic:
simp only [ofReal_exp, ofReal_neg, add_sub_cancel]
private theorem Gamma_integrand_deriv_integrable_A {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => -((-x).exp * x ^ s) : ℝ → ℂ) volume 0 X := by
  convert (Gamma_integrand_interval_integrable (s + 1) _ hX).neg
  · simp only [ofReal_exp, ofReal_neg, add_sub_cancel]; 

Proof state:
case h.e'_3.h
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
x✝ : ℝ
⊢ -(cexp (-↑x✝) * ↑x✝ ^ s) = (-fun x => cexp (-↑x) * ↑x ^ s) x✝

Next tactic:
rfl
private theorem Gamma_integrand_deriv_integrable_A {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => -((-x).exp * x ^ s) : ℝ → ℂ) volume 0 X := by
  convert (Gamma_integrand_interval_integrable (s + 1) _ hX).neg
  · simp only [ofReal_exp, ofReal_neg, add_sub_cancel]; rfl
  · 

Proof state:
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ 0 < (s + 1).re

Next tactic:
simp only [add_re, one_re]
private theorem Gamma_integrand_deriv_integrable_A {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => -((-x).exp * x ^ s) : ℝ → ℂ) volume 0 X := by
  convert (Gamma_integrand_interval_integrable (s + 1) _ hX).neg
  · simp only [ofReal_exp, ofReal_neg, add_sub_cancel]; rfl
  · simp only [add_re, one_re]; 

Proof state:
s : ℂ
hs : 0 < s.re
X : ℝ
hX : 0 ≤ X
⊢ 0 < s.re + 1

Next tactic:
linarith
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  

Proof state:
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
⊢ IntervalIntegrable (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) volume 0 Y

Next tactic:
have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by 

Proof state:
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
⊢ (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))

Next tactic:
ext1
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; 

Proof state:
case h
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
x✝ : ℝ
⊢ ↑(rexp (-x✝)) * (s * ↑x✝ ^ (s - 1)) = s * (↑(rexp (-x✝)) * ↑x✝ ^ (s - 1))

Next tactic:
ring
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  

Proof state:
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ IntervalIntegrable (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) volume 0 Y

Next tactic:
rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  

Proof state:
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ IntegrableOn (fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))) (Ioc 0 Y)

Next tactic:
constructor
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · 

Proof state:
case left
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ AEStronglyMeasurable (fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))) (Measure.restrict volume (Ioc 0 Y))

Next tactic:
refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    

Proof state:
case left
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ ContinuousOn (fun x => ↑(rexp (-x)) * ↑x ^ (s - 1)) (Ioc 0 Y)

Next tactic:
apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    

Proof state:
case left
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ ContinuousOn (fun x => ↑x ^ (s - 1)) (Ioc 0 Y)

Next tactic:
apply ContinuousAt.continuousOn
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    

Proof state:
case left.hcont
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ ∀ x ∈ Ioc 0 Y, ContinuousAt (fun x => ↑x ^ (s - 1)) x

Next tactic:
intro x hx
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    

Proof state:
case left.hcont
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ ContinuousAt (fun x => ↑x ^ (s - 1)) x

Next tactic:
refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    

Proof state:
case left.hcont
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ ContinuousAt (fun x => x ^ (s - 1)) ↑x

Next tactic:
apply continuousAt_cpow_const
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; 

Proof state:
case left.hcont.ha
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ 0 < (↑x).re ∨ (↑x).im ≠ 0

Next tactic:
rw [ofReal_re]
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; 

Proof state:
case left.hcont.ha
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ 0 < x ∨ (↑x).im ≠ 0

Next tactic:
exact Or.inl hx.1
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  

Proof state:
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ HasFiniteIntegral fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))

Next tactic:
rw [← hasFiniteIntegral_norm_iff]
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  rw [← hasFiniteIntegral_norm_iff]
  

Proof state:
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ HasFiniteIntegral fun a => ‖s * (↑(rexp (-a)) * ↑a ^ (s - 1))‖

Next tactic:
simp_rw [norm_eq_abs, map_mul]
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  rw [← hasFiniteIntegral_norm_iff]
  simp_rw [norm_eq_abs, map_mul]
  

Proof state:
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ HasFiniteIntegral fun a => abs s * (abs ↑(rexp (-a)) * abs (↑a ^ (s - 1)))

Next tactic:
refine' (((Real.GammaIntegral_convergent hs).mono_set
    Ioc_subset_Ioi_self).hasFiniteIntegral.congr _).const_mul _
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  rw [← hasFiniteIntegral_norm_iff]
  simp_rw [norm_eq_abs, map_mul]
  refine' (((Real.GammaIntegral_convergent hs).mono_set
    Ioc_subset_Ioi_self).hasFiniteIntegral.congr _).const_mul _
  

Proof state:
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ (fun x => rexp (-x) * x ^ (s.re - 1)) =ᵐ[Measure.restrict volume (Ioc 0 Y)] fun a =>
    abs ↑(rexp (-a)) * abs (↑a ^ (s - 1))

Next tactic:
rw [EventuallyEq, ae_restrict_iff']
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  rw [← hasFiniteIntegral_norm_iff]
  simp_rw [norm_eq_abs, map_mul]
  refine' (((Real.GammaIntegral_convergent hs).mono_set
    Ioc_subset_Ioi_self).hasFiniteIntegral.congr _).const_mul _
  rw [EventuallyEq, ae_restrict_iff']
  · 

Proof state:
case right
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ ∀ᵐ (x : ℝ) ∂volume, x ∈ Ioc 0 Y → rexp (-x) * x ^ (s.re - 1) = abs ↑(rexp (-x)) * abs (↑x ^ (s - 1))

Next tactic:
apply ae_of_all
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  rw [← hasFiniteIntegral_norm_iff]
  simp_rw [norm_eq_abs, map_mul]
  refine' (((Real.GammaIntegral_convergent hs).mono_set
    Ioc_subset_Ioi_self).hasFiniteIntegral.congr _).const_mul _
  rw [EventuallyEq, ae_restrict_iff']
  · apply ae_of_all; 

Proof state:
case right.a
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
⊢ ∀ a ∈ Ioc 0 Y, rexp (-a) * a ^ (s.re - 1) = abs ↑(rexp (-a)) * abs (↑a ^ (s - 1))

Next tactic:
intro x hx
private theorem Gamma_integrand_deriv_integrable_B {s : ℂ} (hs : 0 < s.re) {Y : ℝ} (hY : 0 ≤ Y) :
    IntervalIntegrable (fun x : ℝ => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) volume 0 Y := by
  have : (fun x => (-x).exp * (s * x ^ (s - 1)) : ℝ → ℂ) =
      (fun x => s * ((-x).exp * x ^ (s - 1)) : ℝ → ℂ) := by ext1; ring
  rw [this, intervalIntegrable_iff_integrableOn_Ioc_of_le hY]
  constructor
  · refine' (continuousOn_const.mul _).aestronglyMeasurable measurableSet_Ioc
    apply (continuous_ofReal.comp continuous_neg.exp).continuousOn.mul
    apply ContinuousAt.continuousOn
    intro x hx
    refine' (_ : ContinuousAt (fun x : ℂ => x ^ (s - 1)) _).comp continuous_ofReal.continuousAt
    apply continuousAt_cpow_const; rw [ofReal_re]; exact Or.inl hx.1
  rw [← hasFiniteIntegral_norm_iff]
  simp_rw [norm_eq_abs, map_mul]
  refine' (((Real.GammaIntegral_convergent hs).mono_set
    Ioc_subset_Ioi_self).hasFiniteIntegral.congr _).const_mul _
  rw [EventuallyEq, ae_restrict_iff']
  · apply ae_of_all; intro x hx
    

Proof state:
case right.a
s : ℂ
hs : 0 < s.re
Y : ℝ
hY : 0 ≤ Y
this : (fun x => ↑(rexp (-x)) * (s * ↑x ^ (s - 1))) = fun x => s * (↑(rexp (-x)) * ↑x ^ (s - 1))
x : ℝ
hx : x ∈ Ioc 0 Y
⊢ rexp (-x) * x ^ (s.re - 1) = abs ↑(rexp (-x)) * abs (↑x ^ (s - 1))

Next tactic:
rw [abs_of_nonneg (exp_pos _).le, abs_cpow_eq_rpow_re_of_pos hx.1]