l3lab/ntp-mathlib huggingface dataset:
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    

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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∫⁻ (a : α), ∑' (i : ι), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
x : α
hx : ∑' (i : ι), ↑‖f i x‖₊ < ⊤
⊢ Summable fun n => ↑‖f n x‖₊

Next tactic:
rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    

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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∫⁻ (a : α), ∑' (i : ι), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
x : α
hx : ∑' (i : ι), ↑‖f i x‖₊ < ⊤
⊢ ∑' (a : ι), ↑‖f a x‖₊ ≠ ⊤

Next tactic:
exact hx.ne
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  

Proof state:
case pos
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ ∫ (a : α), ∑' (i : ι), f i a ∂μ = ∑' (i : ι), ∫ (a : α), f i a ∂μ

Next tactic:
convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · 

Proof state:
case pos.convert_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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ ∀ (n : ι), ∀ᵐ (a : α) ∂μ, ‖f n a‖ ≤ (fun i a => ↑‖f i a‖₊) n a

Next tactic:
intro n
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    

Proof state:
case pos.convert_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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
n : ι
⊢ ∀ᵐ (a : α) ∂μ, ‖f n a‖ ≤ (fun i a => ↑‖f i a‖₊) n a

Next tactic:
filter_upwards with x
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    

Proof state:
case pos.convert_2.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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
n : ι
x : α
⊢ ‖f n x‖ ≤ ↑‖f n x‖₊

Next tactic:
rfl
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · 

Proof state:
case pos.convert_3
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ AEStronglyMeasurable (fun a => ∑' (n : ι), (fun i a => ↑‖f i a‖₊) n a) μ

Next tactic:
simp_rw [← NNReal.coe_tsum]
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    

Proof state:
case pos.convert_3
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ AEStronglyMeasurable (fun a => ↑(∑' (a_1 : ι), ‖f a_1 a‖₊)) μ

Next tactic:
rw [aestronglyMeasurable_iff_aemeasurable]
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    rw [aestronglyMeasurable_iff_aemeasurable]
    

Proof state:
case pos.convert_3
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ AEMeasurable fun a => ↑(∑' (a_1 : ι), ‖f a_1 a‖₊)

Next tactic:
apply AEMeasurable.coe_nnreal_real
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.coe_nnreal_real
    

Proof state:
case pos.convert_3.hf
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ AEMeasurable fun x => ∑' (a : ι), ‖f a x‖₊

Next tactic:
apply AEMeasurable.nnreal_tsum
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.coe_nnreal_real
    apply AEMeasurable.nnreal_tsum
    

Proof state:
case pos.convert_3.hf.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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ ∀ (i : ι), AEMeasurable fun x => ‖f i x‖₊

Next tactic:
exact fun i => (hf i).nnnorm.aemeasurable
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.coe_nnreal_real
    apply AEMeasurable.nnreal_tsum
    exact fun i => (hf i).nnnorm.aemeasurable
  · 

Proof state:
case pos.convert_4
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ HasFiniteIntegral fun a => ∑' (n : ι), (fun i a => ↑‖f i a‖₊) n a

Next tactic:
dsimp [HasFiniteIntegral]
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.coe_nnreal_real
    apply AEMeasurable.nnreal_tsum
    exact fun i => (hf i).nnnorm.aemeasurable
  · dsimp [HasFiniteIntegral]
    

Proof state:
case pos.convert_4
α : 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ ∫⁻ (a : α), ↑‖∑' (n : ι), ‖f n a‖‖₊ ∂μ < ⊤

Next tactic:
have : ∫⁻ a, ∑' n, ‖f n a‖₊ ∂μ < ⊤ := by rwa [lintegral_tsum hf'', lt_top_iff_ne_top]
theorem integral_tsum {ι} [Countable ι] {f : ι → α → G} (hf : ∀ i, AEStronglyMeasurable (f i) μ)
    (hf' : ∑' i, ∫⁻ a : α, ‖f i a‖₊ ∂μ ≠ ∞) :
    ∫ a : α, ∑' i, f i a ∂μ = ∑' i, ∫ a : α, f i a ∂μ := by
  by_cases hG : CompleteSpace G; swap
  · simp [integral, hG]
  have hf'' : ∀ i, AEMeasurable (fun x => (‖f i x‖₊ : ℝ≥0∞)) μ := fun i => (hf i).ennnorm
  have hhh : ∀ᵐ a : α ∂μ, Summable fun n => (‖f n a‖₊ : ℝ) := by
    rw [← lintegral_tsum hf''] at hf'
    refine' (ae_lt_top' (AEMeasurable.ennreal_tsum hf'') hf').mono _
    intro x hx
    rw [← ENNReal.tsum_coe_ne_top_iff_summable_coe]
    exact hx.ne
  convert (MeasureTheory.hasSum_integral_of_dominated_convergence (fun i a => ‖f i a‖₊) hf _ hhh
          ⟨_, _⟩ _).tsum_eq.symm
  · intro n
    filter_upwards with x
    rfl
  · simp_rw [← NNReal.coe_tsum]
    rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.coe_nnreal_real
    apply AEMeasurable.nnreal_tsum
    exact fun i => (hf i).nnnorm.aemeasurable
  · dsimp [HasFiniteIntegral]
    have : ∫⁻ a, ∑' n, ‖f n a‖₊ ∂μ < ⊤ := 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
inst✝ : Countable ι
f : ι → α → G
hf : ∀ (i : ι), AEStronglyMeasurable (f i) μ
hf' : ∑' (i : ι), ∫⁻ (a : α), ↑‖f i a‖₊ ∂μ ≠ ⊤
hG : CompleteSpace G
hf'' : ∀ (i : ι), AEMeasurable fun x => ↑‖f i x‖₊
hhh : ∀ᵐ (a : α) ∂μ, Summable fun n => ↑‖f n a‖₊
⊢ ∫⁻ (a : α), ∑' (n : ι), ↑‖f n a‖₊ ∂μ < ⊤

Next tactic:
rwa [lintegral_tsum hf'', lt_top_iff_ne_top]