Theorem: BoxIntegral.IntegrationParams.MemBaseSet.filter
File: Mathlib/Analysis/BoxIntegral/Partition/Filter.lean

tactic: refine' ⟨fun J hJ => hπ.1 J (π.mem_filter.1 hJ).1, fun hH J hJ => hπ.2 hH J (π.mem_filter.1 hJ).1,
  fun hD => (distortion_filter_le _ _).trans (hπ.3 hD), fun hD => _⟩
state_before: ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁ π₂ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
⊢ MemBaseSet l I c r (TaggedPrepartition.filter π p)

tactic: rcases hπ.4 hD with ⟨π₁, hπ₁U, hc⟩
state_before: ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁ π₂ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
⊢ ∃ π',
    Prepartition.iUnion π' = ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ∧
      Prepartition.distortion π' ≤ c

tactic: set π₂ := π.filter fun J => ¬p J
state_before: case intro.intro
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
⊢ ∃ π',
    Prepartition.iUnion π' = ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ∧
      Prepartition.distortion π' ≤ c

tactic: have : Disjoint π₁.iUnion π₂.iUnion := by
  simpa [hπ₁U] using disjoint_sdiff_self_left.mono_right sdiff_le
state_before: case intro.intro
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
⊢ ∃ π',
    Prepartition.iUnion π' = ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ∧
      Prepartition.distortion π' ≤ c

tactic: refine' ⟨π₁.disjUnion π₂.toPrepartition this, _, _⟩
state_before: case intro.intro
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
⊢ ∃ π',
    Prepartition.iUnion π' = ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ∧
      Prepartition.distortion π' ≤ c

tactic: simpa [hπ₁U] using disjoint_sdiff_self_left.mono_right sdiff_le
state_before: ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
⊢ Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)

tactic: suffices ↑I \ π.iUnion ∪ π.iUnion \ (π.filter p).iUnion = ↑I \ (π.filter p).iUnion by simp [*]
state_before: case intro.intro.refine'_1
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
⊢ Prepartition.iUnion (Prepartition.disjUnion π₁ π₂.toPrepartition this) =
    ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: have h : (π.filter p).iUnion ⊆ π.iUnion :=
  biUnion_subset_biUnion_left (Finset.filter_subset _ _)
state_before: case intro.intro.refine'_1
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
⊢ ↑I \ TaggedPrepartition.iUnion π ∪
      TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) =
    ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: ext x
state_before: case intro.intro.refine'_1
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
⊢ ↑I \ TaggedPrepartition.iUnion π ∪
      TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) =
    ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: fconstructor
state_before: case intro.intro.refine'_1.h
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
⊢ x ∈
      ↑I \ TaggedPrepartition.iUnion π ∪
        TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ↔
    x ∈ ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: simp [*]
state_before: ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this✝ : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
this :
  ↑I \ TaggedPrepartition.iUnion π ∪
      TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) =
    ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)
⊢ Prepartition.iUnion (Prepartition.disjUnion π₁ π₂.toPrepartition this✝) =
    ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: rintro (⟨hxI, hxπ⟩ | ⟨hxπ, hxp⟩)
state_before: case intro.intro.refine'_1.h.mp
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
⊢ x ∈
      ↑I \ TaggedPrepartition.iUnion π ∪
        TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) →
    x ∈ ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: exacts [⟨hxI, mt (@h x) hxπ⟩, ⟨π.iUnion_subset hxπ, hxp⟩]
state_before: case intro.intro.refine'_1.h.mp.inl.intro
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
hxI : x ∈ ↑I
hxπ : ¬x ∈ TaggedPrepartition.iUnion π
⊢ x ∈ ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

case intro.intro.refine'_1.h.mp.inr.intro
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
hxπ : x ∈ TaggedPrepartition.iUnion π
hxp : ¬x ∈ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)
⊢ x ∈ ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: rintro ⟨hxI, hxp⟩
state_before: case intro.intro.refine'_1.h.mpr
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
⊢ x ∈ ↑I \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) →
    x ∈
      ↑I \ TaggedPrepartition.iUnion π ∪
        TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: by_cases hxπ : x ∈ π.iUnion
state_before: case intro.intro.refine'_1.h.mpr.intro
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
hxI : x ∈ ↑I
hxp : ¬x ∈ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)
⊢ x ∈
    ↑I \ TaggedPrepartition.iUnion π ∪
      TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: exacts [Or.inr ⟨hxπ, hxp⟩, Or.inl ⟨hxI, hxπ⟩]
state_before: case pos
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
hxI : x ∈ ↑I
hxp : ¬x ∈ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)
hxπ : x ∈ TaggedPrepartition.iUnion π
⊢ x ∈
    ↑I \ TaggedPrepartition.iUnion π ∪
      TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

case neg
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
h : TaggedPrepartition.iUnion (TaggedPrepartition.filter π p) ⊆ TaggedPrepartition.iUnion π
x : ι → ℝ
hxI : x ∈ ↑I
hxp : ¬x ∈ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)
hxπ : ¬x ∈ TaggedPrepartition.iUnion π
⊢ x ∈
    ↑I \ TaggedPrepartition.iUnion π ∪
      TaggedPrepartition.iUnion π \ TaggedPrepartition.iUnion (TaggedPrepartition.filter π p)

tactic: have : (π.filter fun J => ¬p J).distortion ≤ c := (distortion_filter_le _ _).trans (hπ.3 hD)
state_before: case intro.intro.refine'_2
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
⊢ Prepartition.distortion (Prepartition.disjUnion π₁ π₂.toPrepartition this) ≤ c

tactic: simpa [hc]
state_before: case intro.intro.refine'_2
ι : Type u_1
inst✝ : Fintype ι
I J : Box ι
c c₁ c₂ : ℝ≥0
r r₁ r₂ : (ι → ℝ) → ↑(Set.Ioi 0)
π π₁✝ π₂✝ : TaggedPrepartition I
l l₁ l₂ : IntegrationParams
hπ : MemBaseSet l I c r π
p : Box ι → Prop
hD : l.bDistortion = true
π₁ : Prepartition I
hπ₁U : Prepartition.iUnion π₁ = ↑I \ TaggedPrepartition.iUnion π
hc : Prepartition.distortion π₁ ≤ c
π₂ : TaggedPrepartition I := TaggedPrepartition.filter π fun J => ¬p J
this✝ : Disjoint (Prepartition.iUnion π₁) (TaggedPrepartition.iUnion π₂)
this : distortion (TaggedPrepartition.filter π fun J => ¬p J) ≤ c
⊢ Prepartition.distortion (Prepartition.disjUnion π₁ π₂.toPrepartition this✝) ≤ c