Theorem: MeasureTheory.IntegrableOn.hasBoxIntegral
File: Mathlib/Analysis/BoxIntegral/Integrability.lean

tactic: borelize E
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
⊢ HasIntegral I l f (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (x : ι → ℝ) in ↑I, f x ∂μ)

tactic: rcases hf.aestronglyMeasurable with ⟨g, hg, hfg⟩
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
⊢ HasIntegral I l f (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (x : ι → ℝ) in ↑I, f x ∂μ)

tactic: haveI : SeparableSpace (range g ∪ {0} : Set E) := hg.separableSpace_range_union_singleton
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
hfg : f =ᵐ[Measure.restrict μ ↑I] g
⊢ HasIntegral I l f (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (x : ι → ℝ) in ↑I, f x ∂μ)

tactic: rw [integral_congr_ae hfg]
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
hfg : f =ᵐ[Measure.restrict μ ↑I] g
this : SeparableSpace ↑(Set.range g ∪ {0})
⊢ HasIntegral I l f (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (x : ι → ℝ) in ↑I, f x ∂μ)

tactic: have hgi : IntegrableOn g I μ := (integrable_congr hfg).1 hf
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
hfg : f =ᵐ[Measure.restrict μ ↑I] g
this : SeparableSpace ↑(Set.range g ∪ {0})
⊢ HasIntegral I l f (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: refine' BoxIntegral.HasIntegral.congr_ae _ hfg.symm hl
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
hfg : f =ᵐ[Measure.restrict μ ↑I] g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
⊢ HasIntegral I l f (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: clear! f
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
f : (ι → ℝ) → E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
hf : IntegrableOn f ↑I
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
hfg : f =ᵐ[Measure.restrict μ ↑I] g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
⊢ HasIntegral I l g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: set f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g hg.measurable (range g ∪ {0}) 0 (by simp)
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
⊢ HasIntegral I l g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: have hfi : ∀ n, IntegrableOn (f n) I μ :=
  SimpleFunc.integrable_approxOn_range hg.measurable hgi
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
⊢ HasIntegral I l g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: have hfi' := fun n => ((f n).hasBoxIntegral μ I l hl).integrable
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
⊢ HasIntegral I l g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: have hfg_mono : ∀ (x) {m n}, m ≤ n → ‖f n x - g x‖ ≤ ‖f m x - g x‖ := by
  intro x m n hmn
  rw [← dist_eq_norm, ← dist_eq_norm, dist_nndist, dist_nndist, NNReal.coe_le_coe, ←
    ENNReal.coe_le_coe, ← edist_nndist, ← edist_nndist]
  exact SimpleFunc.edist_approxOn_mono hg.measurable _ x hmn
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
⊢ HasIntegral I l g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: refine' HasIntegral.of_mul ((μ I).toReal + 1 + 1) fun ε ε0 => _
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
⊢ HasIntegral I l g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) (∫ (a : ι → ℝ) in ↑I, g a ∂μ)

tactic: lift ε to ℝ≥0 using ε0.le
state_before: case intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ
ε0 : 0 < ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ε

tactic: rw [NNReal.coe_pos] at ε0
state_before: case intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ↑ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: have ε0' := ENNReal.coe_pos.2 ε0
state_before: case intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: obtain ⟨N₀, hN₀⟩ : ∃ N : ℕ, (∫ x in I, ‖f N x - g x‖ ∂μ) ≤ ε := by
  have : Tendsto (fun n => ∫⁻ x in I, ‖f n x - g x‖₊ ∂μ) atTop (𝓝 0) :=
    SimpleFunc.tendsto_approxOn_range_L1_nnnorm hg.measurable hgi
  refine' (this.eventually (ge_mem_nhds ε0')).exists.imp fun N hN => _
  exact integral_coe_le_of_lintegral_coe_le hN
state_before: case intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: choose Nx hNx hNxε using this
state_before: case intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
this : ∀ (x : ι → ℝ), ∃ N₁, N₀ ≤ N₁ ∧ dist (↑(f N₁) x) (g x) ≤ ↑ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: rcases NNReal.exists_pos_sum_of_countable ε0.ne' ℕ with ⟨δ, δ0, c, hδc, hcε⟩
state_before: case intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: set r : ℝ≥0 → (ι → ℝ) → Ioi (0 : ℝ) := fun c x => (hfi' <| Nx x).convergenceR (δ <| Nx x) c x
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c : ℝ≥0
hδc : HasSum δ c
hcε : c < ε
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: refine' ⟨r, fun c => l.rCond_of_bRiemann_eq_false hl, fun c π hπ hπp => _⟩
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c : ℝ≥0
hδc : HasSum δ c
hcε : c < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
⊢ ∃ r,
    (∀ (c : ℝ≥0), IntegrationParams.RCond l (r c)) ∧
      ∀ (c : ℝ≥0) (π : TaggedPrepartition I),
        IntegrationParams.MemBaseSet l I c (r c) π →
          TaggedPrepartition.IsPartition π →
            dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
              (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: refine' (dist_triangle4 _ (∑ J in π.boxes, (μ J).toReal • f (Nx <| π.tag J) (π.tag J))
  (∑ J in π.boxes, ∫ x in J, f (Nx <| π.tag J) x ∂μ) _).trans _
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π) (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: rw [add_mul, add_mul, one_mul]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π)
          (∑ J in π.boxes,
            ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J)) +
        dist
          (∑ J in π.boxes,
            ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
          (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) +
      dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
        (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    (ENNReal.toReal (↑↑μ ↑I) + 1 + 1) * ↑ε

tactic: refine' add_le_add_three _ _ _
state_before: case intro.intro.intro.intro.intro.intro.intro.intro
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π)
          (∑ J in π.boxes,
            ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J)) +
        dist
          (∑ J in π.boxes,
            ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
          (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) +
      dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
        (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    ENNReal.toReal (↑↑μ ↑I) * ↑ε + ↑ε + ↑ε

tactic: simp
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
⊢ 0 ∈ Set.range g ∪ {0}

tactic: intro x m n hmn
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
⊢ ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖

tactic: rw [← dist_eq_norm, ← dist_eq_norm, dist_nndist, dist_nndist, NNReal.coe_le_coe, ←
  ENNReal.coe_le_coe, ← edist_nndist, ← edist_nndist]
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
x : ι → ℝ
m n : ℕ
hmn : m ≤ n
⊢ ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖

tactic: exact SimpleFunc.edist_approxOn_mono hg.measurable _ x hmn
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
x : ι → ℝ
m n : ℕ
hmn : m ≤ n
⊢ edist (↑(f n) x) (g x) ≤ edist (↑(f m) x) (g x)

tactic: have : Tendsto (fun n => ∫⁻ x in I, ‖f n x - g x‖₊ ∂μ) atTop (𝓝 0) :=
  SimpleFunc.tendsto_approxOn_range_L1_nnnorm hg.measurable hgi
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
⊢ ∃ N, (∫ (x : ι → ℝ) in ↑I, ‖↑(f N) x - g x‖ ∂μ) ≤ ↑ε

tactic: refine' (this.eventually (ge_mem_nhds ε0')).exists.imp fun N hN => _
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
this : Tendsto (fun n => ∫⁻ (x : ι → ℝ) in ↑I, ↑‖↑(f n) x - g x‖₊ ∂μ) atTop (𝓝 0)
⊢ ∃ N, (∫ (x : ι → ℝ) in ↑I, ‖↑(f N) x - g x‖ ∂μ) ≤ ↑ε

tactic: exact integral_coe_le_of_lintegral_coe_le hN
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
this : Tendsto (fun n => ∫⁻ (x : ι → ℝ) in ↑I, ↑‖↑(f n) x - g x‖₊ ∂μ) atTop (𝓝 0)
N : ℕ
hN : (∫⁻ (x : ι → ℝ) in ↑I, ↑‖↑(f N) x - g x‖₊ ∂μ) ≤ ↑ε
⊢ (∫ (x : ι → ℝ) in ↑I, ‖↑(f N) x - g x‖ ∂μ) ≤ ↑ε

tactic: exact ((eventually_ge_atTop N₀).and <| this <| closedBall_mem_nhds _ ε0).exists
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
x : ι → ℝ
this : Tendsto (fun x_1 => ↑(f x_1) x) atTop (𝓝 (g x))
⊢ ∃ N₁, N₀ ≤ N₁ ∧ dist (↑(f N₁) x) (g x) ≤ ↑ε

tactic: simp
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
x : ι → ℝ
⊢ g x ∈ Set.range g ∪ {0}

tactic: rw [← hπp.iUnion_eq, π.measure_iUnion_toReal, sum_mul, integralSum]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (integralSum g (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) π)
      (∑ J in π.boxes, ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J)) ≤
    ENNReal.toReal (↑↑μ ↑I) * ↑ε

tactic: refine' dist_sum_sum_le_of_le _ fun J _ => _
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (∑ J in π.boxes, ↑(↑(BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) J) (g (TaggedPrepartition.tag π J)))
      (∑ J in π.boxes, ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J)) ≤
    ∑ x in π.boxes, ENNReal.toReal (↑↑μ ↑x) * ↑ε

tactic: dsimp
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
J : Box ι
x✝ : J ∈ π.boxes
⊢ dist (↑(↑(BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) J) (g (TaggedPrepartition.tag π J)))
      (ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J)) ≤
    ENNReal.toReal (↑↑μ ↑J) * ↑ε

tactic: rw [dist_eq_norm, ← smul_sub, norm_smul, Real.norm_eq_abs, abs_of_nonneg ENNReal.toReal_nonneg]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
J : Box ι
x✝ : J ∈ π.boxes
⊢ dist (ENNReal.toReal (↑↑μ ↑J) • g (TaggedPrepartition.tag π J))
      (ENNReal.toReal (↑↑μ ↑J) •
        ↑(SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
              (Nx (TaggedPrepartition.tag π J)))
          (TaggedPrepartition.tag π J)) ≤
    ENNReal.toReal (↑↑μ ↑J) * ↑ε

tactic: refine' mul_le_mul_of_nonneg_left _ ENNReal.toReal_nonneg
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
J : Box ι
x✝ : J ∈ π.boxes
⊢ ENNReal.toReal (↑↑μ ↑J) *
      ‖g (TaggedPrepartition.tag π J) -
          ↑(SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
                (Nx (TaggedPrepartition.tag π J)))
            (TaggedPrepartition.tag π J)‖ ≤
    ENNReal.toReal (↑↑μ ↑J) * ↑ε

tactic: rw [← dist_eq_norm']
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
J : Box ι
x✝ : J ∈ π.boxes
⊢ ‖g (TaggedPrepartition.tag π J) -
        ↑(SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
              (Nx (TaggedPrepartition.tag π J)))
          (TaggedPrepartition.tag π J)‖ ≤
    ↑ε

tactic: exact hNxε _
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_1
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
J : Box ι
x✝ : J ∈ π.boxes
⊢ dist
      (↑(SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
            (Nx (TaggedPrepartition.tag π J)))
        (TaggedPrepartition.tag π J))
      (g (TaggedPrepartition.tag π J)) ≤
    ↑ε

tactic: rw [← π.sum_fiberwise fun J => Nx (π.tag J), ← π.sum_fiberwise fun J => Nx (π.tag J)]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (∑ J in π.boxes, ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑ε

tactic: refine' le_trans _ (NNReal.coe_lt_coe.2 hcε).le
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist
      (∑ y in Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes,
        ∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = y).boxes,
          ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ y in Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes,
        ∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = y).boxes,
          ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑ε

tactic: refine'
  (dist_sum_sum_le_of_le _ fun n hn => _).trans
    (sum_le_hasSum _ (fun n _ => (δ n).2) (NNReal.hasSum_coe.2 hδc))
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist
      (∑ y in Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes,
        ∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = y).boxes,
          ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ y in Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes,
        ∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = y).boxes,
          ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑c✝

tactic: have hNxn : ∀ J ∈ π.filter fun J => Nx (π.tag J) = n, Nx (π.tag J) = n := fun J hJ =>
  (π.mem_filter.1 hJ).2
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
⊢ dist
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑(δ n)

tactic: have hrn : ∀ J ∈ π.filter fun J => Nx (π.tag J) = n,
    r c (π.tag J) = (hfi' n).convergenceR (δ n) c (π.tag J) := fun J hJ ↦ by
  obtain rfl := hNxn J hJ
  rfl
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
⊢ dist
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑(δ n)

tactic: have :
    l.MemBaseSet I c ((hfi' n).convergenceR (δ n) c) (π.filter fun J => Nx (π.tag J) = n) :=
  (hπ.filter _).mono' _ le_rfl le_rfl fun J hJ => (hrn J hJ).le
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
⊢ dist
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑(δ n)

tactic: convert (hfi' n).dist_integralSum_sum_integral_le_of_memBaseSet (δ0 _) this using 2
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_2
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
this :
  IntegrationParams.MemBaseSet l I c
    (Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c)
    (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)
⊢ dist
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J))
      (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
        ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) ≤
    ↑(δ n)

tactic: obtain rfl := hNxn J hJ
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
J : Box ι
hJ : J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n
⊢ r c (TaggedPrepartition.tag π J) =
    Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c (TaggedPrepartition.tag π J)

tactic: rfl
state_before: ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
J : Box ι
hn : Nx (TaggedPrepartition.tag π J) ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J_1 : Box ι),
    (J_1 ∈ TaggedPrepartition.filter π fun J_2 => Nx (TaggedPrepartition.tag π J_2) = Nx (TaggedPrepartition.tag π J)) →
      Nx (TaggedPrepartition.tag π J_1) = Nx (TaggedPrepartition.tag π J)
hJ : J ∈ TaggedPrepartition.filter π fun J_1 => Nx (TaggedPrepartition.tag π J_1) = Nx (TaggedPrepartition.tag π J)
⊢ r c (TaggedPrepartition.tag π J) =
    Integrable.convergenceR
      (_ :
        BoxIntegral.Integrable I l (↑(f (Nx (TaggedPrepartition.tag π J))))
          (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ (Nx (TaggedPrepartition.tag π J)))) c (TaggedPrepartition.tag π J)

tactic: refine' sum_congr rfl fun J hJ => _
state_before: case h.e'_3.h.e'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
this :
  IntegrationParams.MemBaseSet l I c
    (Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c)
    (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)
⊢ ∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
      ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J) =
    integralSum (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
      (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)

tactic: simp [hNxn J hJ]
state_before: case h.e'_3.h.e'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
this :
  IntegrationParams.MemBaseSet l I c
    (Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c)
    (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)
J : Box ι
hJ : J ∈ (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n).toPrepartition.boxes
⊢ ENNReal.toReal (↑↑μ ↑J) • ↑(f (Nx (TaggedPrepartition.tag π J))) (TaggedPrepartition.tag π J) =
    ↑(↑(BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)) J)
      (↑(f n) (TaggedPrepartition.tag (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) J))

tactic: refine' sum_congr rfl fun J hJ => _
state_before: case h.e'_3.h.e'_4
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
this :
  IntegrationParams.MemBaseSet l I c
    (Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c)
    (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)
⊢ (∑ J in (Prepartition.filter π.toPrepartition fun J => Nx (TaggedPrepartition.tag π J) = n).boxes,
      ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) =
    ∑ J in (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n).toPrepartition.boxes,
      BoxIntegral.integral J l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))

tactic: rw [← SimpleFunc.integral_eq_integral, SimpleFunc.box_integral_eq_integral _ _ _ _ hl,
  hNxn J hJ]
state_before: case h.e'_3.h.e'_4
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
this :
  IntegrationParams.MemBaseSet l I c
    (Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c)
    (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)
J : Box ι
hJ : J ∈ (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n).toPrepartition.boxes
⊢ (∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) =
    BoxIntegral.integral J l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))

tactic: exact (hfi _).mono_set (Prepartition.le_of_mem _ hJ)
state_before: case h.e'_3.h.e'_4.hfi
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝² : MeasurableSpace E := borel E
this✝¹ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this✝ : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
n : ℕ
hn : n ∈ Finset.image (fun J => Nx (TaggedPrepartition.tag π J)) π.boxes
hNxn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) → Nx (TaggedPrepartition.tag π J) = n
hrn :
  ∀ (J : Box ι),
    (J ∈ TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n) →
      r c (TaggedPrepartition.tag π J) =
        Integrable.convergenceR
          (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ n)) c
          (TaggedPrepartition.tag π J)
this :
  IntegrationParams.MemBaseSet l I c
    (Integrable.convergenceR (_ : BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ)))
      (↑(δ n)) c)
    (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n)
J : Box ι
hJ : J ∈ (TaggedPrepartition.filter π fun J => Nx (TaggedPrepartition.tag π J) = n).toPrepartition.boxes
⊢ Integrable ↑(f (Nx (TaggedPrepartition.tag π J)))

tactic: refine' le_trans _ hN₀
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
      (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    ↑ε

tactic: have hfi : ∀ (n), ∀ J ∈ π, IntegrableOn (f n) (↑J) μ := fun n J hJ =>
  (hfi n).mono_set (π.le_of_mem' J hJ)
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
⊢ dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
      (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    ∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ

tactic: have hgi : ∀ J ∈ π, IntegrableOn g (↑J) μ := fun J hJ => hgi.mono_set (π.le_of_mem' J hJ)
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
⊢ dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
      (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    ∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ

tactic: have hfgi : ∀ (n), ∀ J ∈ π, IntegrableOn (fun x => ‖f n x - g x‖) J μ := fun n J hJ =>
  ((hfi n J hJ).sub (hgi J hJ)).norm
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi✝ : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
hgi : ∀ (J : Box ι), J ∈ π → IntegrableOn g ↑J
⊢ dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
      (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    ∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ

tactic: rw [← hπp.iUnion_eq, Prepartition.iUnion_def',
  integral_finset_biUnion π.boxes (fun J _ => J.measurableSet_coe) π.pairwiseDisjoint hgi,
  integral_finset_biUnion π.boxes (fun J _ => J.measurableSet_coe) π.pairwiseDisjoint (hfgi _)]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi✝ : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
hgi : ∀ (J : Box ι), J ∈ π → IntegrableOn g ↑J
hfgi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn (fun x => ‖↑(f n) x - g x‖) ↑J
⊢ dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
      (∫ (a : ι → ℝ) in ↑I, g a ∂μ) ≤
    ∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ

tactic: refine' dist_sum_sum_le_of_le _ fun J hJ => _
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi✝ : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
hgi : ∀ (J : Box ι), J ∈ π → IntegrableOn g ↑J
hfgi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn (fun x => ‖↑(f n) x - g x‖) ↑J
⊢ dist (∑ J in π.boxes, ∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ)
      (∑ i in π.boxes, ∫ (x : ι → ℝ) in ↑i, g x ∂μ) ≤
    ∑ i in π.boxes, ∫ (x : ι → ℝ) in ↑i, ‖↑(f N₀) x - g x‖ ∂μ

tactic: rw [dist_eq_norm, ← integral_sub (hfi _ J hJ) (hgi J hJ)]
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi✝ : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
hgi : ∀ (J : Box ι), J ∈ π → IntegrableOn g ↑J
hfgi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn (fun x => ‖↑(f n) x - g x‖) ↑J
J : Box ι
hJ : J ∈ π.boxes
⊢ dist (∫ (x : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) x ∂μ) (∫ (x : ι → ℝ) in ↑J, g x ∂μ) ≤
    ∫ (x : ι → ℝ) in ↑J, ‖↑(f N₀) x - g x‖ ∂μ

tactic: refine' norm_integral_le_of_norm_le (hfgi _ J hJ) (eventually_of_forall fun x => _)
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi✝ : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
hgi : ∀ (J : Box ι), J ∈ π → IntegrableOn g ↑J
hfgi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn (fun x => ‖↑(f n) x - g x‖) ↑J
J : Box ι
hJ : J ∈ π.boxes
⊢ ‖∫ (a : ι → ℝ) in ↑J, ↑(f (Nx (TaggedPrepartition.tag π J))) a - g a ∂μ‖ ≤ ∫ (x : ι → ℝ) in ↑J, ‖↑(f N₀) x - g x‖ ∂μ

tactic: exact hfg_mono x (hNx (π.tag J))
state_before: case intro.intro.intro.intro.intro.intro.intro.intro.refine'_3
ι : Type u
E : Type v
inst✝⁴ : Fintype ι
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace ℝ E
inst✝¹ : CompleteSpace E
μ : Measure (ι → ℝ)
inst✝ : IsLocallyFiniteMeasure μ
I : Box ι
l : IntegrationParams
hl : l.bRiemann = false
this✝¹ : MeasurableSpace E := borel E
this✝ : BorelSpace E
g : (ι → ℝ) → E
hg : StronglyMeasurable g
this : SeparableSpace ↑(Set.range g ∪ {0})
hgi✝ : IntegrableOn g ↑I
f : ℕ → SimpleFunc (ι → ℝ) E :=
  SimpleFunc.approxOn g (_ : Measurable g) (Set.range g ∪ {0}) 0 (_ : 0 ∈ Set.range g ∪ {0})
hfi✝ : ∀ (n : ℕ), IntegrableOn ↑(f n) ↑I
hfi' : ∀ (n : ℕ), BoxIntegral.Integrable I l (↑(f n)) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))
hfg_mono : ∀ (x : ι → ℝ) {m n : ℕ}, m ≤ n → ‖↑(f n) x - g x‖ ≤ ‖↑(f m) x - g x‖
ε : ℝ≥0
ε0 : 0 < ε
ε0' : 0 < ↑ε
N₀ : ℕ
hN₀ : (∫ (x : ι → ℝ) in ↑I, ‖↑(f N₀) x - g x‖ ∂μ) ≤ ↑ε
Nx : (ι → ℝ) → ℕ
hNx : ∀ (x : ι → ℝ), N₀ ≤ Nx x
hNxε : ∀ (x : ι → ℝ), dist (↑(f (Nx x)) x) (g x) ≤ ↑ε
δ : ℕ → ℝ≥0
δ0 : ∀ (i : ℕ), 0 < δ i
c✝ : ℝ≥0
hδc : HasSum δ c✝
hcε : c✝ < ε
r : ℝ≥0 → (ι → ℝ) → ↑(Set.Ioi 0) :=
  fun c x =>
    Integrable.convergenceR
      (_ : BoxIntegral.Integrable I l (↑(f (Nx x))) (BoxAdditiveMap.toSMul (Measure.toBoxAdditive μ))) (↑(δ (Nx x))) c x
c : ℝ≥0
π : TaggedPrepartition I
hπ : IntegrationParams.MemBaseSet l I c (r c) π
hπp : TaggedPrepartition.IsPartition π
hfi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn ↑(f n) ↑J
hgi : ∀ (J : Box ι), J ∈ π → IntegrableOn g ↑J
hfgi : ∀ (n : ℕ) (J : Box ι), J ∈ π → IntegrableOn (fun x => ‖↑(f n) x - g x‖) ↑J
J : Box ι
hJ : J ∈ π.boxes
x : ι → ℝ
⊢ ‖↑(f (Nx (TaggedPrepartition.tag π J))) x - g x‖ ≤ ‖↑(f N₀) x - g x‖