l3lab/ntp-mathlib huggingface dataset:
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    

Proof state:
case intro.intro
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
x : α
ε : ℝ
εpos : ε > 0
a : Set α
ha : a ∈ setsAt v x
h'a : a ⊆ closedBall x ε
⊢ ∃ y ∈ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x,
    y ⊆ closedBall x ε

Next tactic:
exact ⟨a, mem_union_left _ ha, h'a⟩
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
⊢ ∀ (s : Set α) (f : α → Set (Set α)),
    (∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x) →
      (∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε) →
        ∃ t,
          (∀ p ∈ t, p.1 ∈ s) ∧ (PairwiseDisjoint t fun p => p.2) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧ ↑↑μ (s \ ⋃ p ∈ t, p.2) = 0

Next tactic:
intro s f fset ffine
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
⊢ ∃ t, (∀ p ∈ t, p.1 ∈ s) ∧ (PairwiseDisjoint t fun p => p.2) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧ ↑↑μ (s \ ⋃ p ∈ t, p.2) = 0

Next tactic:
let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
⊢ ∃ t, (∀ p ∈ t, p.1 ∈ s) ∧ (PairwiseDisjoint t fun p => p.2) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧ ↑↑μ (s \ ⋃ p ∈ t, p.2) = 0

Next tactic:
have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      rcases fset x hx af with (h'a | h'a)
      · exact ⟨a, ⟨af, h'a⟩, ha.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
      · refine' False.elim (h'a.2.2 _)
        exact ha.trans (closedBall_subset_closedBall (min_le_right _ _))
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
⊢ ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ g x, a ⊆ closedBall x ε

Next tactic:
intro x hx ε εpos
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
⊢ ∃ a ∈ g x, a ⊆ closedBall x ε

Next tactic:
obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
⊢ ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
case intro.intro
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
a : Set α
af : a ∈ f x
ha : a ⊆ closedBall x (min ε δ)
⊢ ∃ a ∈ g x, a ⊆ closedBall x ε

Next tactic:
exact ffine x hx (min ε δ) (lt_min εpos δpos)
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      

Proof state:
case intro.intro
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
a : Set α
af : a ∈ f x
ha : a ⊆ closedBall x (min ε δ)
⊢ ∃ a ∈ g x, a ⊆ closedBall x ε

Next tactic:
rcases fset x hx af with (h'a | h'a)
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      rcases fset x hx af with (h'a | h'a)
      · 

Proof state:
case intro.intro.inl
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
a : Set α
af : a ∈ f x
ha : a ⊆ closedBall x (min ε δ)
h'a : a ∈ setsAt v x
⊢ ∃ a ∈ g x, a ⊆ closedBall x ε

Next tactic:
exact ⟨a, ⟨af, h'a⟩, ha.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      rcases fset x hx af with (h'a | h'a)
      · exact ⟨a, ⟨af, h'a⟩, ha.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
      · 

Proof state:
case intro.intro.inr
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
a : Set α
af : a ∈ f x
ha : a ⊆ closedBall x (min ε δ)
h'a : a ∈ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}
⊢ ∃ a ∈ g x, a ⊆ closedBall x ε

Next tactic:
refine' False.elim (h'a.2.2 _)
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      rcases fset x hx af with (h'a | h'a)
      · exact ⟨a, ⟨af, h'a⟩, ha.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
      · refine' False.elim (h'a.2.2 _)
        

Proof state:
case intro.intro.inr
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
x : α
hx : x ∈ s
ε : ℝ
εpos : ε > 0
a : Set α
af : a ∈ f x
ha : a ⊆ closedBall x (min ε δ)
h'a : a ∈ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}
⊢ a ⊆ closedBall x δ

Next tactic:
exact ha.trans (closedBall_subset_closedBall (min_le_right _ _))
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      rcases fset x hx af with (h'a | h'a)
      · exact ⟨a, ⟨af, h'a⟩, ha.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
      · refine' False.elim (h'a.2.2 _)
        exact ha.trans (closedBall_subset_closedBall (min_le_right _ _))
    

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
this : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ g x, a ⊆ closedBall x ε
⊢ ∃ t, (∀ p ∈ t, p.1 ∈ s) ∧ (PairwiseDisjoint t fun p => p.2) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧ ↑↑μ (s \ ⋃ p ∈ t, p.2) = 0

Next tactic:
rcases v.covering s g (fun x _ => inter_subset_right _ _) this with ⟨t, ts, tdisj, tg, μt⟩
/-- One can enlarge a Vitali family by adding to the sets `f x` at `x` all sets which are not
contained in a `δ`-neighborhood on `x`. This does not change the local filter at a point, but it
can be convenient to get a nicer global behavior. -/
def enlarge (v : VitaliFamily μ) (δ : ℝ) (δpos : 0 < δ) : VitaliFamily μ where
  setsAt x := v.setsAt x ∪ { a | MeasurableSet a ∧ (interior a).Nonempty ∧ ¬a ⊆ closedBall x δ }
  MeasurableSet' x a ha := by
    cases' ha with ha ha
    exacts [v.MeasurableSet' _ _ ha, ha.1]
  nonempty_interior x a ha := by
    cases' ha with ha ha
    exacts [v.nonempty_interior _ _ ha, ha.2.1]
  Nontrivial := by
    intro x ε εpos
    rcases v.Nontrivial x ε εpos with ⟨a, ha, h'a⟩
    exact ⟨a, mem_union_left _ ha, h'a⟩
  covering := by
    intro s f fset ffine
    let g : α → Set (Set α) := fun x => f x ∩ v.setsAt x
    have : ∀ x ∈ s, ∀ ε : ℝ, ε > 0 → ∃ (a : Set α), a ∈ g x ∧ a ⊆ closedBall x ε := by
      intro x hx ε εpos
      obtain ⟨a, af, ha⟩ : ∃ a ∈ f x, a ⊆ closedBall x (min ε δ)
      exact ffine x hx (min ε δ) (lt_min εpos δpos)
      rcases fset x hx af with (h'a | h'a)
      · exact ⟨a, ⟨af, h'a⟩, ha.trans (closedBall_subset_closedBall (min_le_left _ _))⟩
      · refine' False.elim (h'a.2.2 _)
        exact ha.trans (closedBall_subset_closedBall (min_le_right _ _))
    rcases v.covering s g (fun x _ => inter_subset_right _ _) this with ⟨t, ts, tdisj, tg, μt⟩
    

Proof state:
case intro.intro.intro.intro
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
δ : ℝ
δpos : 0 < δ
s : Set α
f : α → Set (Set α)
fset : ∀ x ∈ s, f x ⊆ (fun x => setsAt v x ∪ {a | MeasurableSet a ∧ Set.Nonempty (interior a) ∧ ¬a ⊆ closedBall x δ}) x
ffine : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ f x, a ⊆ closedBall x ε
g : α → Set (Set α) := fun x => f x ∩ setsAt v x
this : ∀ x ∈ s, ∀ ε > 0, ∃ a ∈ g x, a ⊆ closedBall x ε
t : Set (α × Set α)
ts : ∀ p ∈ t, p.1 ∈ s
tdisj : PairwiseDisjoint t fun p => p.2
tg : ∀ p ∈ t, p.2 ∈ g p.1
μt : ↑↑μ (s \ ⋃ p ∈ t, p.2) = 0
⊢ ∃ t, (∀ p ∈ t, p.1 ∈ s) ∧ (PairwiseDisjoint t fun p => p.2) ∧ (∀ p ∈ t, p.2 ∈ f p.1) ∧ ↑↑μ (s \ ⋃ p ∈ t, p.2) = 0

Next tactic:
exact ⟨t, ts, tdisj, fun p hp => (tg p hp).1, μt⟩
theorem mem_filterAt_iff {x : α} {s : Set (Set α)} :
    s ∈ v.filterAt x ↔ ∃ ε > (0 : ℝ), ∀ a ∈ v.setsAt x, a ⊆ closedBall x ε → a ∈ s := by
  

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
x : α
s : Set (Set α)
⊢ s ∈ filterAt v x ↔ ∃ ε > 0, ∀ a ∈ setsAt v x, a ⊆ closedBall x ε → a ∈ s

Next tactic:
simp only [filterAt, exists_prop, gt_iff_lt]
theorem mem_filterAt_iff {x : α} {s : Set (Set α)} :
    s ∈ v.filterAt x ↔ ∃ ε > (0 : ℝ), ∀ a ∈ v.setsAt x, a ⊆ closedBall x ε → a ∈ s := by
  simp only [filterAt, exists_prop, gt_iff_lt]
  

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
x : α
s : Set (Set α)
⊢ s ∈ ⨅ ε ∈ Ioi 0, 𝓟 {a | a ∈ setsAt v x ∧ a ⊆ closedBall x ε} ↔
    ∃ ε, 0 < ε ∧ ∀ a ∈ setsAt v x, a ⊆ closedBall x ε → a ∈ s

Next tactic:
rw [mem_biInf_of_directed]
theorem mem_filterAt_iff {x : α} {s : Set (Set α)} :
    s ∈ v.filterAt x ↔ ∃ ε > (0 : ℝ), ∀ a ∈ v.setsAt x, a ⊆ closedBall x ε → a ∈ s := by
  simp only [filterAt, exists_prop, gt_iff_lt]
  rw [mem_biInf_of_directed]
  · 

Proof state:
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
x : α
s : Set (Set α)
⊢ (∃ i ∈ Ioi 0, s ∈ 𝓟 {a | a ∈ setsAt v x ∧ a ⊆ closedBall x i}) ↔
    ∃ ε, 0 < ε ∧ ∀ a ∈ setsAt v x, a ⊆ closedBall x ε → a ∈ s

Next tactic:
simp only [subset_def, and_imp, exists_prop, mem_sep_iff, mem_Ioi, mem_principal]
theorem mem_filterAt_iff {x : α} {s : Set (Set α)} :
    s ∈ v.filterAt x ↔ ∃ ε > (0 : ℝ), ∀ a ∈ v.setsAt x, a ⊆ closedBall x ε → a ∈ s := by
  simp only [filterAt, exists_prop, gt_iff_lt]
  rw [mem_biInf_of_directed]
  · simp only [subset_def, and_imp, exists_prop, mem_sep_iff, mem_Ioi, mem_principal]
  · 

Proof state:
case h
α : Type u_1
inst✝ : MetricSpace α
m0 : MeasurableSpace α
μ : Measure α
v : VitaliFamily μ
x : α
s : Set (Set α)
⊢ DirectedOn ((fun ε => 𝓟 {a | a ∈ setsAt v x ∧ a ⊆ closedBall x ε}) ⁻¹'o fun x x_1 => x ≥ x_1) (Ioi 0)

Next tactic:
simp only [DirectedOn, exists_prop, ge_iff_le, le_principal_iff, mem_Ioi, Order.Preimage,
      mem_principal]