Theorem: BoxIntegral.Prepartition.eventually_splitMany_inf_eq_filter
File: Mathlib/Analysis/BoxIntegral/Partition/Split.lean

tactic: refine (eventually_not_disjoint_imp_le_of_mem_splitMany π.boxes).mono fun t ht => ?_
state_before: ι : Type u_1
M : Type u_2
n : ℕ
I J : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
⊢ ∀ᶠ (t : Finset (ι × ℝ)) in atTop, π ⊓ splitMany I t = (splitMany I t).filter fun J => ↑J ⊆ π.iUnion
state_after: ι : Type u_1
M : Type u_2
n : ℕ
I J : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
⊢ π ⊓ splitMany I t = (splitMany I t).filter fun J => ↑J ⊆ π.iUnion

tactic: refine le_antisymm ((biUnion_le_iff _).2 fun J hJ => ?_) (le_inf (fun J hJ => ?_) (filter_le _ _))
state_before: ι : Type u_1
M : Type u_2
n : ℕ
I J : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
⊢ π ⊓ splitMany I t = (splitMany I t).filter fun J => ↑J ⊆ π.iUnion
state_after: case refine_1
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
⊢ (splitMany I t).restrict J ≤ ((splitMany I t).filter fun J => ↑J ⊆ π.iUnion).restrict J

case refine_2
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ (splitMany I t).filter fun J => ↑J ⊆ π.iUnion
⊢ ∃ I' ∈ π, J ≤ I'

tactic: refine ofWithBot_mono ?_
state_before: case refine_1
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
⊢ (splitMany I t).restrict J ≤ ((splitMany I t).filter fun J => ↑J ⊆ π.iUnion).restrict J
state_after: case refine_1
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
⊢ ∀ J_1 ∈ Finset.image (fun J' => ↑J ⊓ ↑J') (splitMany I t).boxes,
    J_1 ≠ ⊥ → ∃ J' ∈ Finset.image (fun J' => ↑J ⊓ ↑J') ((splitMany I t).filter fun J => ↑J ⊆ π.iUnion).boxes, J_1 ≤ J'

tactic: simp only [Finset.mem_image, exists_prop, mem_boxes, mem_filter]
state_before: case refine_1
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
⊢ ∀ J_1 ∈ Finset.image (fun J' => ↑J ⊓ ↑J') (splitMany I t).boxes,
    J_1 ≠ ⊥ → ∃ J' ∈ Finset.image (fun J' => ↑J ⊓ ↑J') ((splitMany I t).filter fun J => ↑J ⊆ π.iUnion).boxes, J_1 ≤ J'
state_after: case refine_1
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
⊢ ∀ (J_1 : WithBot (Box ι)),
    (∃ a ∈ splitMany I t, ↑J ⊓ ↑a = J_1) →
      J_1 ≠ ⊥ → ∃ J', (∃ a, (a ∈ splitMany I t ∧ ↑a ⊆ π.iUnion) ∧ ↑J ⊓ ↑a = J') ∧ J_1 ≤ J'

tactic: rintro _ ⟨J₁, h₁, rfl⟩ hne
state_before: case refine_1
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
⊢ ∀ (J_1 : WithBot (Box ι)),
    (∃ a ∈ splitMany I t, ↑J ⊓ ↑a = J_1) →
      J_1 ≠ ⊥ → ∃ J', (∃ a, (a ∈ splitMany I t ∧ ↑a ⊆ π.iUnion) ∧ ↑J ⊓ ↑a = J') ∧ J_1 ≤ J'
state_after: case refine_1.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
J₁ : Box ι
h₁ : J₁ ∈ splitMany I t
hne : ↑J ⊓ ↑J₁ ≠ ⊥
⊢ ∃ J', (∃ a, (a ∈ splitMany I t ∧ ↑a ⊆ π.iUnion) ∧ ↑J ⊓ ↑a = J') ∧ ↑J ⊓ ↑J₁ ≤ J'

tactic: refine ⟨_, ⟨J₁, ⟨h₁, Subset.trans ?_ (π.subset_iUnion hJ)⟩, rfl⟩, le_rfl⟩
state_before: case refine_1.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
J₁ : Box ι
h₁ : J₁ ∈ splitMany I t
hne : ↑J ⊓ ↑J₁ ≠ ⊥
⊢ ∃ J', (∃ a, (a ∈ splitMany I t ∧ ↑a ⊆ π.iUnion) ∧ ↑J ⊓ ↑a = J') ∧ ↑J ⊓ ↑J₁ ≤ J'
state_after: case refine_1.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
J₁ : Box ι
h₁ : J₁ ∈ splitMany I t
hne : ↑J ⊓ ↑J₁ ≠ ⊥
⊢ ↑J₁ ⊆ ↑J

tactic: exact ht I J hJ J₁ h₁ (mt disjoint_iff.1 hne)
state_before: case refine_1.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ π
J₁ : Box ι
h₁ : J₁ ∈ splitMany I t
hne : ↑J ⊓ ↑J₁ ≠ ⊥
⊢ ↑J₁ ⊆ ↑J
state_after: no goals

tactic: rw [mem_filter] at hJ
state_before: case refine_2
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ (splitMany I t).filter fun J => ↑J ⊆ π.iUnion
⊢ ∃ I' ∈ π, J ≤ I'
state_after: case refine_2
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ splitMany I t ∧ ↑J ⊆ π.iUnion
⊢ ∃ I' ∈ π, J ≤ I'

tactic: rcases Set.mem_iUnion₂.1 (hJ.2 J.upper_mem) with ⟨J', hJ', hmem⟩
state_before: case refine_2
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ splitMany I t ∧ ↑J ⊆ π.iUnion
⊢ ∃ I' ∈ π, J ≤ I'
state_after: case refine_2.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ splitMany I t ∧ ↑J ⊆ π.iUnion
J' : Box ι
hJ' : J' ∈ π
hmem : J.upper ∈ ↑J'
⊢ ∃ I' ∈ π, J ≤ I'

tactic: refine ⟨J', hJ', ht I _ hJ' _ hJ.1 <| Box.not_disjoint_coe_iff_nonempty_inter.2 ?_⟩
state_before: case refine_2.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ splitMany I t ∧ ↑J ⊆ π.iUnion
J' : Box ι
hJ' : J' ∈ π
hmem : J.upper ∈ ↑J'
⊢ ∃ I' ∈ π, J ≤ I'
state_after: case refine_2.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ splitMany I t ∧ ↑J ⊆ π.iUnion
J' : Box ι
hJ' : J' ∈ π
hmem : J.upper ∈ ↑J'
⊢ (↑J' ∩ ↑J).Nonempty

tactic: exact ⟨J.upper, hmem, J.upper_mem⟩
state_before: case refine_2.intro.intro
ι : Type u_1
M : Type u_2
n : ℕ
I J✝ : Box ι
i : ι
x : ℝ
inst✝ : Finite ι
π : Prepartition I
t : Finset (ι × ℝ)
ht : ∀ (I_1 J : Box ι), J ∈ π.boxes → ∀ J' ∈ splitMany I_1 t, ¬Disjoint ↑J ↑J' → J' ≤ J
J : Box ι
hJ : J ∈ splitMany I t ∧ ↑J ⊆ π.iUnion
J' : Box ι
hJ' : J' ∈ π
hmem : J.upper ∈ ↑J'
⊢ (↑J' ∩ ↑J).Nonempty
state_after: no goals