-- Mathlib/Analysis/SpecialFunctions/Integrals.lean
theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
    IntervalIntegrable (fun x : ℝ => (x : ℂ) ^ r) volume a b

Proof state:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
⊢ Complex.exp (↑π * Complex.I * r) * ↑x ^ r = ↑(-x) ^ r

Tactic:
have : -x ≤ 0 := by linarith [hx.1]

Result:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this✝ : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
this : -x ≤ 0
⊢ Complex.exp (↑π * Complex.I * r) * ↑x ^ r = ↑(-x) ^ r

Proof state:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
⊢ IntervalIntegrable (fun x => ↑(-x) ^ r) volume 0 (-c)

Tactic:
have m := (this (-c) (by linarith)).const_mul (Complex.exp (π * Complex.I * r))

Result:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntervalIntegrable (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) volume 0 (-c)
⊢ IntervalIntegrable (fun x => ↑(-x) ^ r) volume 0 (-c)

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ AEStronglyMeasurable (fun x => ↑x ^ r) (volume.restrict (Ι 0 c))

Tactic:
refine ContinuousOn.aestronglyMeasurable ?_ measurableSet_uIoc

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ ContinuousOn (fun x => ↑x ^ r) (Ι 0 c)

Proof state:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this✝ : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
this : -x ≤ 0
⊢ Complex.exp (↑π * Complex.I * r) * ↑x ^ r = ↑(-x) ^ r

Tactic:
rw [Complex.ofReal_cpow_of_nonpos this, mul_comm]

Result:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this✝ : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
this : -x ≤ 0
⊢ ↑x ^ r * Complex.exp (↑π * Complex.I * r) = (-↑(-x)) ^ r * Complex.exp (↑π * Complex.I * r)

Proof state:
case inl
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable (fun x => ↑x ^ r) volume 0 c

Tactic:
exact this c hc

Result:
no goals

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
⊢ -x ≤ 0

Tactic:
linarith [hx.1]

Result:
no goals

Proof state:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntervalIntegrable (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) volume 0 (-c)
⊢ IntervalIntegrable (fun x => ↑(-x) ^ r) volume 0 (-c)

Tactic:
rw [intervalIntegrable_iff, uIoc_of_le (by linarith : 0 ≤ -c)] at m ⊢

Result:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
⊢ IntegrableOn (fun x => ↑(-x) ^ r) (Set.Ioc 0 (-c)) volume

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable (fun t => ‖↑t ^ r‖) volume 0 c

Tactic:
rw [intervalIntegrable_iff]

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ IntegrableOn (fun t => ‖↑t ^ r‖) (Ι 0 c) volume

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
⊢ 0 ≤ -c

Tactic:
linarith

Result:
no goals

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Ι 0 c
⊢ ContinuousAt (fun x => ↑x ^ r) x

Tactic:
rw [uIoc_of_le hc] at hx

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Set.Ioc 0 c
⊢ ContinuousAt (fun x => ↑x ^ r) x

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ ContinuousOn (fun x => ↑x ^ r) (Ι 0 c)

Tactic:
refine continuousOn_of_forall_continuousAt fun x hx => ?_

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Ι 0 c
⊢ ContinuousAt (fun x => ↑x ^ r) x

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
⊢ 0 ≤ -c

Tactic:
linarith

Result:
no goals

Proof state:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
⊢ IntegrableOn (fun x => ↑(-x) ^ r) (Set.Ioc 0 (-c)) volume

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

Result:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
⊢ Complex.exp (↑π * Complex.I * r) * ↑x ^ r = ↑(-x) ^ r

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Set.Ioc 0 c
⊢ 0 < (↑x).re

Tactic:
rw [Complex.ofReal_re]

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Set.Ioc 0 c
⊢ 0 < x

Proof state:
case hs
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ MeasurableSet (Ι 0 c)

Tactic:
exact measurableSet_uIoc

Result:
no goals

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
this : ∀ (c : ℝ), IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
⊢ IntervalIntegrable (fun x => ↑x ^ r) volume a b

Tactic:
exact IntervalIntegrable.trans (this a).symm (this b)

Result:
no goals

Proof state:
case h
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable ?m.45094 volume 0 c

a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ ℝ → ℝ

Tactic:
exact intervalIntegral.intervalIntegrable_rpow' h

Result:
no goals

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable (fun x => ↑x ^ r) volume 0 c

Tactic:
rw [← IntervalIntegrable.intervalIntegrable_norm_iff]

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable (fun t => ‖↑t ^ r‖) volume 0 c

a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ AEStronglyMeasurable (fun x => ↑x ^ r) (volume.restrict (Ι 0 c))

Proof state:
a b : ℝ
r : ℂ
h : -1 < r.re
⊢ ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c

Tactic:
intro c hc

Result:
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
⊢ IntervalIntegrable (fun x => ↑x ^ r) volume 0 c

Proof state:
case inr
a b : ℝ
r : ℂ
h : -1 < r.re
this✝ : ∀ (c : ℝ), 0 ≤ c → IntervalIntegrable (fun x => ↑x ^ r) volume 0 c
c : ℝ
hc : c ≤ 0
m : IntegrableOn (fun x => Complex.exp (↑π * Complex.I * r) * ↑x ^ r) (Set.Ioc 0 (-c)) volume
x : ℝ
hx : x ∈ Set.Ioc 0 (-c)
this : -x ≤ 0
⊢ ↑x ^ r * Complex.exp (↑π * Complex.I * r) = (-↑(-x)) ^ r * Complex.exp (↑π * Complex.I * r)

Tactic:
simp

Result:
no goals

Proof state:
case hst
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Ι 0 c
⊢ (fun x => x ^ r.re) x = (fun t => ‖↑t ^ r‖) x

Tactic:
rw [uIoc_of_le hc] at hx

Result:
case hst
a b : ℝ
r : ℂ
h : -1 < r.re
c : ℝ
hc : 0 ≤ c
x : ℝ
hx : x ∈ Set.Ioc 0 c
⊢ (fun x => x ^ r.re) x = (fun t => ‖↑t ^ r‖) x