-- Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean
theorem integrableOn_rpow_mul_exp_neg_mul_rpow {p s b : ℝ} (hs : -1 < s) (hp : 1 ≤ p) (hb : 0 < b) :
    IntegrableOn (fun x : ℝ => x ^ s * exp (- b * x ^ p)) (Ioi 0)

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
⊢ IntegrableOn (fun x => x ^ s * rexp (-b * x ^ p)) (Ioi 0) volume

Tactic:
have hib : 0 < b ^ (-p⁻¹) := rpow_pos_of_pos hb _

Result:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ IntegrableOn (fun x => x ^ s * rexp (-b * x ^ p)) (Ioi 0) volume

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ (b ^ (-p⁻¹)) ^ s * (x✝ ^ s * rexp (-x✝ ^ p)) = (b ^ (-p⁻¹) * x✝) ^ s * rexp (-b * (b ^ (-p⁻¹) * x✝) ^ p)

Tactic:
rw [← mul_assoc, mul_rpow, mul_rpow, ← rpow_mul (z := p), neg_mul, neg_mul, inv_mul_cancel₀,
  rpow_neg_one, mul_inv_cancel_left₀]

Result:
case h
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ b ≠ 0

p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ p ≠ 0

case hx
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ b

case hx
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ b ^ (-p⁻¹)

case hy
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ x✝

case hx
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ b ^ (-p⁻¹)

case hy
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ x✝

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume

Tactic:
exact integrableOn_rpow_mul_exp_neg_rpow hs hp

Result:
no goals

Proof state:
case hy
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ x✝

Tactic:
linarith [mem_Ioi.mp hx]

Result:
no goals

Proof state:
case h
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ b ≠ 0

p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ p ≠ 0

case hx
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ b

case hx
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ b ^ (-p⁻¹)

case hy
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ x✝

case hx
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ b ^ (-p⁻¹)

case hy
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ 0 ≤ x✝

Tactic:
all_goals linarith [mem_Ioi.mp hx]

Result:
no goals

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
⊢ IntegrableOn (fun x => (b ^ (-p⁻¹) * x) ^ s * rexp (-b * (b ^ (-p⁻¹) * x) ^ p)) (Ioi 0) volume

Tactic:
refine this.congr_fun (fun _ hx => ?_) measurableSet_Ioi

Result:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
x✝ : ℝ
hx : x✝ ∈ Ioi 0
⊢ (b ^ (-p⁻¹)) ^ s * (x✝ ^ s * rexp (-x✝ ^ p)) = (b ^ (-p⁻¹) * x✝) ^ s * rexp (-b * (b ^ (-p⁻¹) * x✝) ^ p)

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
⊢ 0 = b ^ (-p⁻¹) * 0

Tactic:
rw [mul_zero]

Result:
no goals

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
⊢ IntegrableOn (fun x => x ^ s * rexp (-b * x ^ p)) (Ioi 0) volume

Tactic:
rw [show 0 = b ^ (-p⁻¹) * 0 by rw [mul_zero], ← integrableOn_Ioi_comp_mul_left_iff _ _ hib]

Result:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
this : IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume
⊢ IntegrableOn (fun x => (b ^ (-p⁻¹) * x) ^ s * rexp (-b * (b ^ (-p⁻¹) * x) ^ p)) (Ioi 0) volume

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ IntegrableOn (fun x => x ^ s * rexp (-b * x ^ p)) (Ioi 0) volume

Tactic:
suffices IntegrableOn (fun x ↦ (b ^ (-p⁻¹)) ^ s * (x ^ s * exp (-x ^ p))) (Ioi 0) by
  rw [show 0 = b ^ (-p⁻¹) * 0 by rw [mul_zero], ← integrableOn_Ioi_comp_mul_left_iff _ _ hib]
  refine this.congr_fun (fun _ hx => ?_) measurableSet_Ioi
  rw [← mul_assoc, mul_rpow, mul_rpow, ← rpow_mul (z := p), neg_mul, neg_mul, inv_mul_cancel₀,
    rpow_neg_one, mul_inv_cancel_left₀]
  all_goals linarith [mem_Ioi.mp hx]

Result:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ Integrable (fun x => x ^ s * rexp (-x ^ p)) (volume.restrict (Ioi 0))

Tactic:
rw [← IntegrableOn]

Result:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume

Proof state:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ IntegrableOn (fun x => (b ^ (-p⁻¹)) ^ s * (x ^ s * rexp (-x ^ p))) (Ioi 0) volume

Tactic:
refine Integrable.const_mul ?_ _

Result:
p s b : ℝ
hs : -1 < s
hp : 1 ≤ p
hb : 0 < b
hib : 0 < b ^ (-p⁻¹)
⊢ Integrable (fun x => x ^ s * rexp (-x ^ p)) (volume.restrict (Ioi 0))