Theorem: integral_rpow_mul_exp_neg_rpow
File: Mathlib/MeasureTheory/Integral/Gamma.lean

tactic: calc
  _ = ∫ (x : ℝ) in Ioi 0,  (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * exp (-x)) := by
    rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
      abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
    refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
    rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
  _ = ∫ (x : ℝ) in Ioi 0, 1 / p * exp (-x) * x ^ (1 / p - 1 + q / p) := by
    simp_rw [smul_eq_mul, mul_assoc]
    refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
    rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
    ring_nf
  _ = (1 / p) * Gamma ((q + 1) / p) := by
    rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
    simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; ring, ← integral_mul_left,
      ← mul_assoc]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, x ^ q * rexp (-x ^ p) = 1 / p * Gamma ((q + 1) / p)
state_after: no goals

tactic: rw [← integral_comp_rpow_Ioi _ (one_div_ne_zero (ne_of_gt hp)),
  abs_eq_self.mpr (le_of_lt (one_div_pos.mpr hp))]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, x ^ q * rexp (-x ^ p) =
    ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x))
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-(x ^ (1 / p)) ^ p)) =
    ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x))

tactic: refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-(x ^ (1 / p)) ^ p)) =
    ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x))
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ (1 / p * x✝ ^ (1 / p - 1)) • ((x✝ ^ (1 / p)) ^ q * rexp (-(x✝ ^ (1 / p)) ^ p)) =
    (1 / p * x✝ ^ (1 / p - 1)) • ((x✝ ^ (1 / p)) ^ q * rexp (-x✝))

tactic: rw [← rpow_mul (le_of_lt hx) _ p, one_div_mul_cancel (ne_of_gt hp), rpow_one]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ (1 / p * x✝ ^ (1 / p - 1)) • ((x✝ ^ (1 / p)) ^ q * rexp (-(x✝ ^ (1 / p)) ^ p)) =
    (1 / p * x✝ ^ (1 / p - 1)) • ((x✝ ^ (1 / p)) ^ q * rexp (-x✝))
state_after: no goals

tactic: simp_rw [smul_eq_mul, mul_assoc]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, (1 / p * x ^ (1 / p - 1)) • ((x ^ (1 / p)) ^ q * rexp (-x)) =
    ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p)
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * (x ^ (1 / p - 1) * ((x ^ (1 / p)) ^ q * rexp (-x))) =
    ∫ (x : ℝ) in Ioi 0, 1 / p * (rexp (-x) * x ^ (1 / p - 1 + q / p))

tactic: refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * (x ^ (1 / p - 1) * ((x ^ (1 / p)) ^ q * rexp (-x))) =
    ∫ (x : ℝ) in Ioi 0, 1 / p * (rexp (-x) * x ^ (1 / p - 1 + q / p))
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 1 / p * (x✝ ^ (1 / p - 1) * ((x✝ ^ (1 / p)) ^ q * rexp (-x✝))) = 1 / p * (rexp (-x✝) * x✝ ^ (1 / p - 1 + q / p))

tactic: rw [← rpow_mul (le_of_lt hx), div_mul_eq_mul_div, one_mul, rpow_add hx]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 1 / p * (x✝ ^ (1 / p - 1) * ((x✝ ^ (1 / p)) ^ q * rexp (-x✝))) = 1 / p * (rexp (-x✝) * x✝ ^ (1 / p - 1 + q / p))
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ x✝ ^ (1 / p - 1) * (x✝ ^ (1 / p * q) * rexp (-x✝)) / p = 1 / p * (rexp (-x✝) * (x✝ ^ (1 / p - 1) * x✝ ^ (q / p)))

tactic: ring_nf
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ x✝ ^ (1 / p - 1) * (x✝ ^ (1 / p * q) * rexp (-x✝)) / p = 1 / p * (rexp (-x✝) * (x✝ ^ (1 / p - 1) * x✝ ^ (q / p)))
state_after: no goals

tactic: rw [Gamma_eq_integral (div_pos (neg_lt_iff_pos_add.mp hq) hp)]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p) = 1 / p * Gamma ((q + 1) / p)
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p) =
    1 / p * ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ ((q + 1) / p - 1)

tactic: simp_rw [show 1 / p - 1 + q / p = (q + 1) / p - 1 by field_simp; ring, ← integral_mul_left,
  ← mul_assoc]
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ ∫ (x : ℝ) in Ioi 0, 1 / p * rexp (-x) * x ^ (1 / p - 1 + q / p) =
    1 / p * ∫ (x : ℝ) in Ioi 0, rexp (-x) * x ^ ((q + 1) / p - 1)
state_after: no goals

tactic: field_simp
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ 1 / p - 1 + q / p = (q + 1) / p - 1
state_after: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ 1 - p + q = q + 1 - p

tactic: ring
state_before: p q : ℝ
hp : 0 < p
hq : -1 < q
⊢ 1 - p + q = q + 1 - p
state_after: no goals