l3lab/ntp-mathlib huggingface dataset:
theorem integral_finset_sum_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    {s : Finset ι} (hf : ∀ i ∈ s, Integrable f (μ i)) :
    ∫ a, f a ∂(∑ i in s, μ i) = ∑ i in s, ∫ a, f a ∂μ i := by
  induction s using Finset.cons_induction_on with
  | h₁ => simp
  | h₂ h ih =>
    

Proof state:
case h₂
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
a✝ : ι
s✝ : Finset ι
h : a✝ ∉ s✝
ih : (∀ i ∈ s✝, Integrable f) → ∫ (a : α), f a ∂∑ i in s✝, μ i = ∑ i in s✝, ∫ (a : α), f a ∂μ i
hf : ∀ i ∈ Finset.cons a✝ s✝ h, Integrable f
⊢ ∫ (a : α), f a ∂∑ i in Finset.cons a✝ s✝ h, μ i = ∑ i in Finset.cons a✝ s✝ h, ∫ (a : α), f a ∂μ i

Next tactic:
rw [Finset.forall_mem_cons] at hf
theorem integral_finset_sum_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    {s : Finset ι} (hf : ∀ i ∈ s, Integrable f (μ i)) :
    ∫ a, f a ∂(∑ i in s, μ i) = ∑ i in s, ∫ a, f a ∂μ i := by
  induction s using Finset.cons_induction_on with
  | h₁ => simp
  | h₂ h ih =>
    rw [Finset.forall_mem_cons] at hf
    

Proof state:
case h₂
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
a✝ : ι
s✝ : Finset ι
h : a✝ ∉ s✝
ih : (∀ i ∈ s✝, Integrable f) → ∫ (a : α), f a ∂∑ i in s✝, μ i = ∑ i in s✝, ∫ (a : α), f a ∂μ i
hf : Integrable f ∧ ∀ x ∈ s✝, Integrable f
⊢ ∫ (a : α), f a ∂∑ i in Finset.cons a✝ s✝ h, μ i = ∑ i in Finset.cons a✝ s✝ h, ∫ (a : α), f a ∂μ i

Next tactic:
rw [Finset.sum_cons, Finset.sum_cons, ← ih hf.2]
theorem integral_finset_sum_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    {s : Finset ι} (hf : ∀ i ∈ s, Integrable f (μ i)) :
    ∫ a, f a ∂(∑ i in s, μ i) = ∑ i in s, ∫ a, f a ∂μ i := by
  induction s using Finset.cons_induction_on with
  | h₁ => simp
  | h₂ h ih =>
    rw [Finset.forall_mem_cons] at hf
    rw [Finset.sum_cons, Finset.sum_cons, ← ih hf.2]
    

Proof state:
case h₂
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
a✝ : ι
s✝ : Finset ι
h : a✝ ∉ s✝
ih : (∀ i ∈ s✝, Integrable f) → ∫ (a : α), f a ∂∑ i in s✝, μ i = ∑ i in s✝, ∫ (a : α), f a ∂μ i
hf : Integrable f ∧ ∀ x ∈ s✝, Integrable f
⊢ ∫ (a : α), f a ∂(μ a✝ + ∑ x in s✝, μ x) = ∫ (a : α), f a ∂μ a✝ + ∫ (a : α), f a ∂∑ i in s✝, μ i

Next tactic:
exact integral_add_measure hf.1 (integrable_finset_sum_measure.2 hf.2)
theorem nndist_integral_add_measure_le_lintegral
    {f : α → G} (h₁ : Integrable f μ) (h₂ : Integrable f ν) :
    (nndist (∫ x, f x ∂μ) (∫ x, f x ∂(μ + ν)) : ℝ≥0∞) ≤ ∫⁻ x, ‖f x‖₊ ∂ν := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m : MeasurableSpace α
μ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
f : α → G
h₁ : Integrable f
h₂ : Integrable f
⊢ ↑(nndist (∫ (x : α), f x ∂μ) (∫ (x : α), f x ∂(μ + ν))) ≤ ∫⁻ (x : α), ↑‖f x‖₊ ∂ν

Next tactic:
rw [integral_add_measure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel']
theorem nndist_integral_add_measure_le_lintegral
    {f : α → G} (h₁ : Integrable f μ) (h₂ : Integrable f ν) :
    (nndist (∫ x, f x ∂μ) (∫ x, f x ∂(μ + ν)) : ℝ≥0∞) ≤ ∫⁻ x, ‖f x‖₊ ∂ν := by
  rw [integral_add_measure h₁ h₂, nndist_comm, nndist_eq_nnnorm, add_sub_cancel']
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m : MeasurableSpace α
μ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
f : α → G
h₁ : Integrable f
h₂ : Integrable f
⊢ ↑‖∫ (x : α), f x ∂ν‖₊ ≤ ∫⁻ (x : α), ↑‖f x‖₊ ∂ν

Next tactic:
exact ennnorm_integral_le_lintegral_ennnorm _
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
⊢ HasSum (fun i => ∫ (a : α), f a ∂μ i) (∫ (a : α), f a ∂Measure.sum μ)

Next tactic:
have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
⊢ HasSum (fun i => ∫ (a : α), f a ∂μ i) (∫ (a : α), f a ∂Measure.sum μ)

Next tactic:
simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
⊢ Tendsto (fun s => ∫ (a : α), f a ∂∑ i in s, μ i) atTop (𝓝 (∫ (a : α), f a ∂Measure.sum μ))

Next tactic:
refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ
ε0 : 0 < ε
⊢ ∀ᶠ (x : Finset ι) in atTop, ∫ (a : α), f a ∂∑ i in x, μ i ∈ Metric.ball (∫ (a : α), f a ∂Measure.sum μ) ε

Next tactic:
lift ε to ℝ≥0 using ε0.le
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  

Proof state:
case intro
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
⊢ ∀ᶠ (x : Finset ι) in atTop, ∫ (a : α), f a ∂∑ i in x, μ i ∈ Metric.ball (∫ (a : α), f a ∂Measure.sum μ) ↑ε

Next tactic:
have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
  

Proof state:
case intro
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
⊢ ∀ᶠ (x : Finset ι) in atTop, ∫ (a : α), f a ∂∑ i in x, μ i ∈ Metric.ball (∫ (a : α), f a ∂Measure.sum μ) ↑ε

Next tactic:
have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
    refine' tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right _ _)
    exacts [hf_lt.ne, ENNReal.coe_ne_zero.2 (NNReal.coe_ne_zero.1 ε0.ne')]
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
  have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
⊢ ∀ᶠ (y : ℝ≥0∞) in 𝓝 (∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ), ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < y + ↑ε

Next tactic:
refine' tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right _ _)
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
  have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
    refine' tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right _ _)
    

Proof state:
case refine'_1
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
⊢ ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ ≠ ⊤
case refine'_2
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
⊢ ↑ε ≠ 0

Next tactic:
exacts [hf_lt.ne, ENNReal.coe_ne_zero.2 (NNReal.coe_ne_zero.1 ε0.ne')]
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
  have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
    refine' tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right _ _)
    exacts [hf_lt.ne, ENNReal.coe_ne_zero.2 (NNReal.coe_ne_zero.1 ε0.ne')]
  

Proof state:
case intro
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
hmem : ∀ᶠ (y : ℝ≥0∞) in 𝓝 (∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ), ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < y + ↑ε
⊢ ∀ᶠ (x : Finset ι) in atTop, ∫ (a : α), f a ∂∑ i in x, μ i ∈ Metric.ball (∫ (a : α), f a ∂Measure.sum μ) ↑ε

Next tactic:
refine' ((hasSum_lintegral_measure (fun x => ‖f x‖₊) μ).eventually hmem).mono fun s hs => _
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
  have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
    refine' tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right _ _)
    exacts [hf_lt.ne, ENNReal.coe_ne_zero.2 (NNReal.coe_ne_zero.1 ε0.ne')]
  refine' ((hasSum_lintegral_measure (fun x => ‖f x‖₊) μ).eventually hmem).mono fun s hs => _
  

Proof state:
case intro
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
hmem : ∀ᶠ (y : ℝ≥0∞) in 𝓝 (∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ), ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < y + ↑ε
s : Finset ι
hs : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ∑ b in s, (fun i => ∫⁻ (a : α), ↑‖f a‖₊ ∂μ i) b + ↑ε
⊢ ∫ (a : α), f a ∂∑ i in s, μ i ∈ Metric.ball (∫ (a : α), f a ∂Measure.sum μ) ↑ε

Next tactic:
obtain ⟨ν, hν⟩ : ∃ ν, (∑ i in s, μ i) + ν = Measure.sum μ := by
    refine' ⟨Measure.sum fun i : ↥(sᶜ : Set ι) => μ i, _⟩
    simpa only [← Measure.sum_coe_finset] using Measure.sum_add_sum_compl (s : Set ι) μ
theorem hasSum_integral_measure {ι} {m : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) :
    HasSum (fun i => ∫ a, f a ∂μ i) (∫ a, f a ∂Measure.sum μ) := by
  have hfi : ∀ i, Integrable f (μ i) := fun i => hf.mono_measure (Measure.le_sum _ _)
  simp only [HasSum, ← integral_finset_sum_measure fun i _ => hfi i]
  refine' Metric.nhds_basis_ball.tendsto_right_iff.mpr fun ε ε0 => _
  lift ε to ℝ≥0 using ε0.le
  have hf_lt : (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < ∞ := hf.2
  have hmem : ∀ᶠ y in 𝓝 (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ), (∫⁻ x, ‖f x‖₊ ∂Measure.sum μ) < y + ε := by
    refine' tendsto_id.add tendsto_const_nhds (lt_mem_nhds (α := ℝ≥0∞) <| ENNReal.lt_add_right _ _)
    exacts [hf_lt.ne, ENNReal.coe_ne_zero.2 (NNReal.coe_ne_zero.1 ε0.ne')]
  refine' ((hasSum_lintegral_measure (fun x => ‖f x‖₊) μ).eventually hmem).mono fun s hs => _
  obtain ⟨ν, hν⟩ : ∃ ν, (∑ i in s, μ i) + ν = Measure.sum μ := by
    

Proof state:
α : Type u_1
E : Type u_2
F : Type u_3
𝕜 : Type u_4
inst✝¹¹ : NormedAddCommGroup E
inst✝¹⁰ : NormedSpace ℝ E
hE : CompleteSpace E
inst✝⁹ : NontriviallyNormedField 𝕜
inst✝⁸ : NormedSpace 𝕜 E
inst✝⁷ : SMulCommClass ℝ 𝕜 E
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace ℝ F
inst✝⁴ : CompleteSpace F
G : Type u_5
inst✝³ : NormedAddCommGroup G
inst✝² : NormedSpace ℝ G
f✝ g : α → E
m✝ : MeasurableSpace α
μ✝ : Measure α
X : Type u_6
inst✝¹ : TopologicalSpace X
inst✝ : FirstCountableTopology X
ν : Measure α
ι : Type u_7
m : MeasurableSpace α
f : α → G
μ : ι → Measure α
hf : Integrable f
hfi : ∀ (i : ι), Integrable f
ε : ℝ≥0
ε0 : 0 < ↑ε
hf_lt : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ⊤
hmem : ∀ᶠ (y : ℝ≥0∞) in 𝓝 (∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ), ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < y + ↑ε
s : Finset ι
hs : ∫⁻ (x : α), ↑‖f x‖₊ ∂Measure.sum μ < ∑ b in s, (fun i => ∫⁻ (a : α), ↑‖f a‖₊ ∂μ i) b + ↑ε
⊢ ∃ ν, ∑ i in s, μ i + ν = Measure.sum μ

Next tactic:
refine' ⟨Measure.sum fun i : ↥(sᶜ : Set ι) => μ i, _⟩