Theorem: BoxIntegral.Integrable.dist_integralSum_le_of_memBaseSet
File: Mathlib/Analysis/BoxIntegral/Basic.lean

tactic: rcases h₁.exists_common_compl h₂ HU with ⟨π, hπU, hπc₁, hπc₂⟩
state_before: ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: set r : ℝⁿ → Ioi (0 : ℝ) := fun x => min (h.convergenceR ε₁ c₁ x) (h.convergenceR ε₂ c₂ x)
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: have hr : l.RCond r := (h.convergenceR_cond _ c₁).min (h.convergenceR_cond _ c₂)
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
r : (ι → ℝ) → ↑(Set.Ioi 0) := fun x => min (convergenceR h ε₁ c₁ x) (convergenceR h ε₂ c₂ x)
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: set πr := π.toSubordinate r
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
r : (ι → ℝ) → ↑(Set.Ioi 0) := fun x => min (convergenceR h ε₁ c₁ x) (convergenceR h ε₂ c₂ x)
hr : RCond l r
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: have H₁ :
  dist (integralSum f vol (π₁.unionComplToSubordinate π hπU r)) (integral I l f vol) ≤ ε₁ :=
  h.dist_integralSum_integral_le_of_memBaseSet hpos₁
    (h₁.unionComplToSubordinate (fun _ _ => min_le_left _ _) hπU hπc₁)
    (isPartition_unionComplToSubordinate _ _ _ _)
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
r : (ι → ℝ) → ↑(Set.Ioi 0) := fun x => min (convergenceR h ε₁ c₁ x) (convergenceR h ε₂ c₂ x)
hr : RCond l r
πr : TaggedPrepartition I := Prepartition.toSubordinate π r
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: rw [HU] at hπU
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
r : (ι → ℝ) → ↑(Set.Ioi 0) := fun x => min (convergenceR h ε₁ c₁ x) (convergenceR h ε₂ c₂ x)
hr : RCond l r
πr : TaggedPrepartition I := Prepartition.toSubordinate π r
H₁ : dist (integralSum f vol (unionComplToSubordinate π₁ π hπU r)) (integral I l f vol) ≤ ε₁
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: have H₂ :
  dist (integralSum f vol (π₂.unionComplToSubordinate π hπU r)) (integral I l f vol) ≤ ε₂ :=
  h.dist_integralSum_integral_le_of_memBaseSet hpos₂
    (h₂.unionComplToSubordinate (fun _ _ => min_le_right _ _) hπU hπc₂)
    (isPartition_unionComplToSubordinate _ _ _ _)
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU✝ : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₂
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
r : (ι → ℝ) → ↑(Set.Ioi 0) := fun x => min (convergenceR h ε₁ c₁ x) (convergenceR h ε₂ c₂ x)
hr : RCond l r
πr : TaggedPrepartition I := Prepartition.toSubordinate π r
H₁ : dist (integralSum f vol (unionComplToSubordinate π₁ π hπU✝ r)) (integral I l f vol) ≤ ε₁
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂

tactic: simpa [unionComplToSubordinate] using (dist_triangle_right _ _ _).trans (add_le_add H₁ H₂)
state_before: case intro.intro.intro
ι : Type u
E : Type v
F : Type w
inst✝⁴ : NormedAddCommGroup E
inst✝³ : NormedSpace ℝ E
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
I J : Box ι
π✝ : TaggedPrepartition I
inst✝ : Fintype ι
l : IntegrationParams
f g : (ι → ℝ) → E
vol : ι →ᵇᵃ[⊤] E →L[ℝ] F
y y' : F
c c₁ c₂ : ℝ≥0
ε ε₁ ε₂ : ℝ
π₁ π₂ : TaggedPrepartition I
h : Integrable I l f vol
hpos₁ : 0 < ε₁
hpos₂ : 0 < ε₂
h₁ : MemBaseSet l I c₁ (convergenceR h ε₁ c₁) π₁
h₂ : MemBaseSet l I c₂ (convergenceR h ε₂ c₂) π₂
HU : TaggedPrepartition.iUnion π₁ = TaggedPrepartition.iUnion π₂
π : Prepartition I
hπU✝ : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₁
hπU : Prepartition.iUnion π = ↑I \ TaggedPrepartition.iUnion π₂
hπc₁ : l.bDistortion = true → Prepartition.distortion π ≤ c₁
hπc₂ : l.bDistortion = true → Prepartition.distortion π ≤ c₂
r : (ι → ℝ) → ↑(Set.Ioi 0) := fun x => min (convergenceR h ε₁ c₁ x) (convergenceR h ε₂ c₂ x)
hr : RCond l r
πr : TaggedPrepartition I := Prepartition.toSubordinate π r
H₁ : dist (integralSum f vol (unionComplToSubordinate π₁ π hπU✝ r)) (integral I l f vol) ≤ ε₁
H₂ : dist (integralSum f vol (unionComplToSubordinate π₂ π hπU r)) (integral I l f vol) ≤ ε₂
⊢ dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε₁ + ε₂