-- Mathlib/MeasureTheory/Integral/DominatedConvergence.lean
theorem hasSum_intervalIntegral_of_summable_norm [Countable ι] {f : ι → C(ℝ, E)}
    (hf_sum : Summable fun i : ι => ‖(f i).restrict (⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ)‖) :
    HasSum (fun i : ι => ∫ x in a..b, f i x) (∫ x in a..b, ∑' i : ι, f i x)

Proof state:
case pos.h_lim
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
x : ℝ
hx : x ∈ Ι a b
⊢ Summable fun n => (f n) x

Tactic:
let x : (⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ) := ⟨x, ⟨hx.1.le, hx.2⟩⟩

Result:
case pos.h_lim
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
x✝ : ℝ
hx : x✝ ∈ Ι a b
x : ↥{ carrier := uIcc a b, isCompact' := ⋯ } := ⟨x✝, ⋯⟩
⊢ Summable fun n => (f n) x✝

Proof state:
case neg
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : ¬CompleteSpace E
⊢ HasSum (fun i => ∫ (x : ℝ) in a..b, (f i) x) (∫ (x : ℝ) in a..b, ∑' (i : ι), (f i) x)

Tactic:
simp [intervalIntegral, integral, hE, hasSum_zero]

Result:
no goals

Proof state:
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
i : ι
x : ℝ
hx : x ∈ Ι a b
⊢ x ∈ ↑{ carrier := uIcc a b, isCompact' := ⋯ }

Tactic:
exact ⟨hx.1.le, hx.2⟩

Result:
no goals

Proof state:
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
⊢ HasSum (fun i => ∫ (x : ℝ) in a..b, (f i) x) (∫ (x : ℝ) in a..b, ∑' (i : ι), (f i) x)

Tactic:
by_cases hE : CompleteSpace E

Result:
case pos
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
⊢ HasSum (fun i => ∫ (x : ℝ) in a..b, (f i) x) (∫ (x : ℝ) in a..b, ∑' (i : ι), (f i) x)

case neg
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : ¬CompleteSpace E
⊢ HasSum (fun i => ∫ (x : ℝ) in a..b, (f i) x) (∫ (x : ℝ) in a..b, ∑' (i : ι), (f i) x)

Proof state:
case pos.bound_integrable
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
⊢ IntervalIntegrable (fun t => ∑' (n : ι), ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f n)‖)
    volume a b

Tactic:
exact intervalIntegrable_const

Result:
no goals

Proof state:
case pos.bound_summable
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
⊢ ∀ᵐ (t : ℝ), t ∈ Ι a b → Summable fun n => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f n)‖

Tactic:
exact ae_of_all _ fun x _ => hf_sum

Result:
no goals

Proof state:
case pos.h_lim
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
⊢ ∀ᵐ (t : ℝ), t ∈ Ι a b → HasSum (fun n => (f n) t) (∑' (i : ι), (f i) t)

Tactic:
refine ae_of_all _ fun x hx => Summable.hasSum ?_

Result:
case pos.h_lim
ι : Type u_1
E : Type u_2
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
a b : ℝ
inst✝ : Countable ι
f : ι → C(ℝ, E)
hf_sum : Summable fun i => ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖
hE : CompleteSpace E
x : ℝ
hx : x ∈ Ι a b
⊢ Summable fun n => (f n) x