-- 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_bound
ι : 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 : ι
⊢ ∀ᵐ (t : ℝ), t ∈ Ι a b → ‖(f i) t‖ ≤ ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖

Tactic:
filter_upwards with x hx

Result:
case pos.h_bound.h
ι : 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
⊢ ‖(f i) x‖ ≤ ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖

Proof state:
case pos.h_bound
ι : 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
⊢ ∀ (n : ι),
    ∀ᵐ (t : ℝ), t ∈ Ι a b → ‖(f n) t‖ ≤ ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f n)‖

Tactic:
intro i

Result:
case pos.h_bound
ι : 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 : ι
⊢ ∀ᵐ (t : ℝ), t ∈ Ι a b → ‖(f i) t‖ ≤ ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖

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
x : ↥{ carrier := uIcc a b, isCompact' := ⋯ } := ⟨x✝, ⋯⟩
this : Summable fun i => ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)
⊢ Summable fun n => (f n) x✝

Tactic:
simpa only [Compacts.coe_mk, ContinuousMap.restrict_apply]
  using ContinuousMap.summable_apply this x

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
x✝ : ℝ
hx : x✝ ∈ Ι a b
x : ↥{ carrier := uIcc a b, isCompact' := ⋯ } := ⟨x✝, ⋯⟩
⊢ Summable fun n => (f n) x✝

Tactic:
have := hf_sum.of_norm

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✝, ⋯⟩
this : Summable fun i => ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)
⊢ Summable fun n => (f n) x✝

Proof state:
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)

Tactic:
swap

Result:
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)

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)

Proof state:
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)

Tactic:
apply hasSum_integral_of_dominated_convergence
  (fun i (x : ℝ) => ‖(f i).restrict ↑(⟨uIcc a b, isCompact_uIcc⟩ : Compacts ℝ)‖)
  (fun i => (map_continuous <| f i).aestronglyMeasurable)

Result:
case pos.h_bound
ι : 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
⊢ ∀ (n : ι),
    ∀ᵐ (t : ℝ), t ∈ Ι a b → ‖(f n) t‖ ≤ ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f n)‖

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)‖

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

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)

Proof state:
case pos.h_bound.h
ι : 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
⊢ ‖(f i) x‖ ≤ ‖ContinuousMap.restrict (↑{ carrier := uIcc a b, isCompact' := ⋯ }) (f i)‖

Tactic:
apply ContinuousMap.norm_coe_le_norm ((f i).restrict _) ⟨x, _⟩

Result:
ι : 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' := ⋯ }