Theorem: integrableOn_rpow_mul_exp_neg_rpow
File: Mathlib/Analysis/SpecialFunctions/Gaussian/GaussianIntegral.lean

tactic: obtain hp | hp := le_iff_lt_or_eq.mp hp
state_before: p s : ℝ
hs : -1 < s
hp : 1 ≤ p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume
state_after: case inl
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume

case inr
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume

tactic: have h_exp : ∀ x, ContinuousAt (fun x => exp (- x)) x := fun x => continuousAt_neg.rexp
state_before: case inl
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume
state_after: case inl
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume

tactic: rw [← Ioc_union_Ioi_eq_Ioi zero_le_one, integrableOn_union]
state_before: case inl
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume
state_after: case inl
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioc 0 1) volume ∧
    IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 1) volume

tactic: constructor
state_before: case inl
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioc 0 1) volume ∧
    IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 1) volume
state_after: case inl.left
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioc 0 1) volume

case inl.right
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 1) volume

tactic: rw [← integrableOn_Icc_iff_integrableOn_Ioc]
state_before: case inl.left
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioc 0 1) volume
state_after: case inl.left
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Icc 0 1) volume

tactic: refine IntegrableOn.mul_continuousOn ?_ ?_ isCompact_Icc
state_before: case inl.left
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Icc 0 1) volume
state_after: case inl.left.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s) (Icc 0 1) volume

case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ ContinuousOn (fun x => rexp (-x ^ p)) (Icc 0 1)

tactic: refine (intervalIntegrable_iff_integrableOn_Icc_of_le zero_le_one).mp ?_
state_before: case inl.left.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s) (Icc 0 1) volume
state_after: case inl.left.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntervalIntegrable (fun x => x ^ s) volume 0 1

tactic: exact intervalIntegral.intervalIntegrable_rpow' hs
state_before: case inl.left.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntervalIntegrable (fun x => x ^ s) volume 0 1
state_after: no goals

tactic: intro x _
state_before: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ ContinuousOn (fun x => rexp (-x ^ p)) (Icc 0 1)
state_after: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x : ℝ
a✝ : x ∈ Icc 0 1
⊢ ContinuousWithinAt (fun x => rexp (-x ^ p)) (Icc 0 1) x

tactic: change ContinuousWithinAt ((fun x => exp (- x)) ∘ (fun x => x ^ p)) (Icc 0 1) x
state_before: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x : ℝ
a✝ : x ∈ Icc 0 1
⊢ ContinuousWithinAt (fun x => rexp (-x ^ p)) (Icc 0 1) x
state_after: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x : ℝ
a✝ : x ∈ Icc 0 1
⊢ ContinuousWithinAt ((fun x => rexp (-x)) ∘ fun x => x ^ p) (Icc 0 1) x

tactic: refine ContinuousAt.comp_continuousWithinAt (h_exp _) ?_
state_before: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x : ℝ
a✝ : x ∈ Icc 0 1
⊢ ContinuousWithinAt ((fun x => rexp (-x)) ∘ fun x => x ^ p) (Icc 0 1) x
state_after: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x : ℝ
a✝ : x ∈ Icc 0 1
⊢ ContinuousWithinAt (fun x => x ^ p) (Icc 0 1) x

tactic: exact continuousWithinAt_id.rpow_const (Or.inr (le_of_lt (lt_trans zero_lt_one hp)))
state_before: case inl.left.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x : ℝ
a✝ : x ∈ Icc 0 1
⊢ ContinuousWithinAt (fun x => x ^ p) (Icc 0 1) x
state_after: no goals

tactic: have h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x := by
  intro _ _ hx
  refine continuousWithinAt_id.rpow_const (Or.inl ?_)
  exact ne_of_gt (lt_of_lt_of_le zero_lt_one hx)
state_before: case inl.right
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 1) volume
state_after: case inl.right
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 1) volume

tactic: refine integrable_of_isBigO_exp_neg (by norm_num : (0:ℝ) < 1 / 2)
  (ContinuousOn.mul (fun x hx => h_rpow x s hx) (fun x hx => ?_)) (IsLittleO.isBigO ?_)
state_before: case inl.right
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 1) volume
state_after: case inl.right.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
x : ℝ
hx : x ∈ Ici 1
⊢ ContinuousWithinAt (fun x => rexp (-x ^ p)) (Ici 1) x

case inl.right.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
⊢ (fun x => x ^ s * rexp (-x ^ p)) =o[atTop] fun x => rexp (-(1 / 2) * x)

tactic: intro _ _ hx
state_before: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
⊢ ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
state_after: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x✝ r✝ : ℝ
hx : x✝ ∈ Ici 1
⊢ ContinuousWithinAt (fun x => x ^ r✝) (Ici 1) x✝

tactic: refine continuousWithinAt_id.rpow_const (Or.inl ?_)
state_before: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x✝ r✝ : ℝ
hx : x✝ ∈ Ici 1
⊢ ContinuousWithinAt (fun x => x ^ r✝) (Ici 1) x✝
state_after: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x✝ r✝ : ℝ
hx : x✝ ∈ Ici 1
⊢ id x✝ ≠ 0

tactic: exact ne_of_gt (lt_of_lt_of_le zero_lt_one hx)
state_before: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
x✝ r✝ : ℝ
hx : x✝ ∈ Ici 1
⊢ id x✝ ≠ 0
state_after: no goals

tactic: norm_num
state_before: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
⊢ 0 < 1 / 2
state_after: no goals

tactic: change ContinuousWithinAt ((fun x => exp (- x)) ∘ (fun x => x ^ p)) (Ici 1) x
state_before: case inl.right.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
x : ℝ
hx : x ∈ Ici 1
⊢ ContinuousWithinAt (fun x => rexp (-x ^ p)) (Ici 1) x
state_after: case inl.right.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
x : ℝ
hx : x ∈ Ici 1
⊢ ContinuousWithinAt ((fun x => rexp (-x)) ∘ fun x => x ^ p) (Ici 1) x

tactic: exact ContinuousAt.comp_continuousWithinAt (h_exp _) (h_rpow x p hx)
state_before: case inl.right.refine_1
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
x : ℝ
hx : x ∈ Ici 1
⊢ ContinuousWithinAt ((fun x => rexp (-x)) ∘ fun x => x ^ p) (Ici 1) x
state_after: no goals

tactic: convert rpow_mul_exp_neg_mul_rpow_isLittleO_exp_neg s hp (by norm_num : (0:ℝ) < 1) using 3
state_before: case inl.right.refine_2
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
⊢ (fun x => x ^ s * rexp (-x ^ p)) =o[atTop] fun x => rexp (-(1 / 2) * x)
state_after: case h.e'_7.h.h.e'_6
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
x✝ : ℝ
⊢ rexp (-x✝ ^ p) = rexp (-1 * x✝ ^ p)

tactic: rw [neg_mul, one_mul]
state_before: case h.e'_7.h.h.e'_6
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
x✝ : ℝ
⊢ rexp (-x✝ ^ p) = rexp (-1 * x✝ ^ p)
state_after: no goals

tactic: norm_num
state_before: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 < p
h_exp : ∀ (x : ℝ), ContinuousAt (fun x => rexp (-x)) x
h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x
⊢ 0 < 1
state_after: no goals

tactic: simp_rw [← hp, Real.rpow_one]
state_before: case inr
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x ^ p)) (Ioi 0) volume
state_after: case inr
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x)) (Ioi 0) volume

tactic: convert Real.GammaIntegral_convergent (by linarith : 0 < s + 1) using 2
state_before: case inr
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
⊢ IntegrableOn (fun x => x ^ s * rexp (-x)) (Ioi 0) volume
state_after: case h.e'_5.h
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
x✝ : ℝ
⊢ x✝ ^ s * rexp (-x✝) = rexp (-x✝) * x✝ ^ (s + 1 - 1)

tactic: rw [add_sub_cancel_right, mul_comm]
state_before: case h.e'_5.h
p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
x✝ : ℝ
⊢ x✝ ^ s * rexp (-x✝) = rexp (-x✝) * x✝ ^ (s + 1 - 1)
state_after: no goals

tactic: linarith
state_before: p s : ℝ
hs : -1 < s
hp✝ : 1 ≤ p
hp : 1 = p
⊢ 0 < s + 1
state_after: no goals