-- Mathlib/Analysis/SpecialFunctions/Integrals.lean
theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a, b]]) :
    IntervalIntegrable (fun x : ℝ => (x : ℂ) ^ r) μ a b

Proof state:
case neg.inr
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

Tactic:
refine (IntervalIntegrable.intervalIntegrable_norm_iff ?_).mp ?_

Result:
case neg.inr.refine_1
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
⊢ AEStronglyMeasurable (fun x => ↑x ^ r) (μ.restrict (Ι a b))

case neg.inr.refine_2
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
⊢ IntervalIntegrable (fun t => ‖↑t ^ r‖) μ a b

Proof state:
case pos
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re ∨ 0 ∉ [[a, b]]
h2 : 0 ∉ [[a, b]]
x : ℝ
hx : x ∈ [[a, b]]
⊢ ContinuousAt (fun x => ↑x ^ r) x

Tactic:
exact Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)

Result:
no goals

Proof state:
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re ∨ 0 ∉ [[a, b]]
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

Tactic:
by_cases h2 : (0 : ℝ) ∉ [[a, b]]

Result:
case pos
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re ∨ 0 ∉ [[a, b]]
h2 : 0 ∉ [[a, b]]
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

case neg
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re ∨ 0 ∉ [[a, b]]
h2 : ¬0 ∉ [[a, b]]
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

Proof state:
case neg.inr.refine_2.inr.h.right
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
this : ∀ x ∈ Set.Ioo c 0, ‖Complex.exp (↑π * Complex.I * r)‖ = ‖↑x ^ r‖
⊢ μ (Set.Icc c 0) < ⊤

Tactic:
exact isFiniteMeasureOnCompacts_of_isLocallyFiniteMeasure.lt_top_of_isCompact isCompact_Icc

Result:
no goals

Proof state:
case neg.inr.refine_2.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : 0 ≤ c
this : IntegrableOn (fun x => 1) (Set.Ioc 0 c) μ
⊢ IntegrableOn (fun x => ‖↑x ^ r‖) (Set.Ioc 0 c) μ

Tactic:
refine IntegrableOn.congr_fun this (fun x hx => ?_) measurableSet_Ioc

Result:
case neg.inr.refine_2.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : 0 ≤ c
this : IntegrableOn (fun x => 1) (Set.Ioc 0 c) μ
x : ℝ
hx : x ∈ Set.Ioc 0 c
⊢ 1 = ‖↑x ^ r‖

Proof state:
case neg.inr.refine_2.inr.h.right
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
this : ∀ x ∈ Set.Ioo c 0, ‖Complex.exp (↑π * Complex.I * r)‖ = ‖↑x ^ r‖
⊢ IntegrableOn (fun x => ‖↑x ^ r‖) (Set.Ioo c 0) μ

Tactic:
refine IntegrableOn.congr_fun ?_ this measurableSet_Ioo

Result:
case neg.inr.refine_2.inr.h.right
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
this : ∀ x ∈ Set.Ioo c 0, ‖Complex.exp (↑π * Complex.I * r)‖ = ‖↑x ^ r‖
⊢ IntegrableOn (fun x => ‖Complex.exp (↑π * Complex.I * r)‖) (Set.Ioo c 0) μ

Proof state:
case neg.inr.refine_2.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : 0 ≤ c
this : IntegrableOn (fun x => 1) (Set.Ioc 0 c) μ
x : ℝ
hx : x ∈ Set.Ioc 0 c
⊢ 1 = ‖↑x ^ r‖

Tactic:
rw [Complex.norm_cpow_eq_rpow_re_of_pos hx.1, ← h', rpow_zero]

Result:
no goals

Proof state:
case neg.inr.refine_1
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
⊢ ContinuousOn (fun x => ↑x ^ r) {0}ᶜ

Tactic:
exact continuousOn_of_forall_continuousAt fun x hx =>
  Complex.continuousAt_ofReal_cpow_const x r (Or.inr hx)

Result:
no goals

Proof state:
case neg.inr.refine_1
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
⊢ AEStronglyMeasurable (fun x => ↑x ^ r) (μ.restrict (Ι a b))

Tactic:
refine (measurable_of_continuousOn_compl_singleton (0 : ℝ) ?_).aestronglyMeasurable

Result:
case neg.inr.refine_1
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
⊢ ContinuousOn (fun x => ↑x ^ r) {0}ᶜ

Proof state:
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
x : ℝ
hx : x ∈ Set.Ioo c 0
⊢ ‖Complex.exp (↑π * Complex.I * r)‖ = ‖↑x ^ r‖

Tactic:
rw [Complex.ofReal_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
  Complex.norm_cpow_eq_rpow_re_of_pos (neg_pos.mpr hx.2), ← h',
  rpow_zero, one_mul]

Result:
no goals

Proof state:
case neg.inr.refine_2
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
⊢ IntervalIntegrable (fun x => ‖↑x ^ r‖) μ 0 c

Tactic:
rcases le_or_lt 0 c with (hc | hc)

Result:
case neg.inr.refine_2.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable (fun x => ‖↑x ^ r‖) μ 0 c

case neg.inr.refine_2.inr
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
⊢ IntervalIntegrable (fun x => ‖↑x ^ r‖) μ 0 c

Proof state:
case neg.inr.refine_2.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : 0 ≤ c
this : IntervalIntegrable (fun x => 1) μ 0 c
⊢ IntervalIntegrable (fun x => ‖↑x ^ r‖) μ 0 c

Tactic:
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc] at this ⊢

Result:
case neg.inr.refine_2.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : 0 ≤ c
this : IntegrableOn (fun x => 1) (Set.Ioc 0 c) μ
⊢ IntegrableOn (fun x => ‖↑x ^ r‖) (Set.Ioc 0 c) μ

Proof state:
case neg
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re ∨ 0 ∉ [[a, b]]
h2 : ¬0 ∉ [[a, b]]
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

Tactic:
rw [eq_false h2, or_false] at h

Result:
case neg
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

Proof state:
case neg.inr.refine_2.inr.h.right
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
this : ∀ x ∈ Set.Ioo c 0, ‖Complex.exp (↑π * Complex.I * r)‖ = ‖↑x ^ r‖
⊢ ‖Complex.exp (↑π * Complex.I * r)‖ = 0 ∨ μ (Set.Ioo c 0) < ⊤

Tactic:
refine Or.inr ((measure_mono Set.Ioo_subset_Icc_self).trans_lt ?_)

Result:
case neg.inr.refine_2.inr.h.right
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 = r.re
c : ℝ
hc : c < 0
this : ∀ x ∈ Set.Ioo c 0, ‖Complex.exp (↑π * Complex.I * r)‖ = ‖↑x ^ r‖
⊢ μ (Set.Icc c 0) < ⊤

Proof state:
case neg.inl
a b : ℝ
μ : Measure ℝ
inst✝ : IsLocallyFiniteMeasure μ
r : ℂ
h : 0 ≤ r.re
h2 : ¬0 ∉ [[a, b]]
h' : 0 < r.re
⊢ IntervalIntegrable (fun x => ↑x ^ r) μ a b

Tactic:
exact (Complex.continuous_ofReal_cpow_const h').intervalIntegrable _ _

Result:
no goals