Theorem: VitaliFamily.measure_le_of_frequently_le
File: Mathlib/MeasureTheory/Covering/Differentiation.lean

tactic: apply ENNReal.le_of_forall_pos_le_add fun ε εpos _ => ?_
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
⊢ ↑↑ρ s ≤ ↑↑ν s

tactic: obtain ⟨U, sU, U_open, νU⟩ : ∃ (U : Set α), s ⊆ U ∧ IsOpen U ∧ ν U ≤ ν s + ε :=
  exists_isOpen_le_add s ν (ENNReal.coe_pos.2 εpos).ne'
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
⊢ ↑↑ρ s ≤ ↑↑ν s + ↑ε

tactic: let f : α → Set (Set α) := fun _ => {a | ρ a ≤ ν a ∧ a ⊆ U}
state_before: case intro.intro.intro
α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
⊢ ↑↑ρ s ≤ ↑↑ν s + ↑ε

tactic: have h : v.FineSubfamilyOn f s := by
  apply v.fineSubfamilyOn_of_frequently f s fun x hx => ?_
  have :=
    (hs x hx).and_eventually
      ((v.eventually_filterAt_mem_sets x).and
        (v.eventually_filterAt_subset_of_nhds (U_open.mem_nhds (sU hx))))
  apply Frequently.mono this
  rintro a ⟨ρa, _, aU⟩
  exact ⟨ρa, aU⟩
state_before: case intro.intro.intro
α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
⊢ ↑↑ρ s ≤ ↑↑ν s + ↑ε

tactic: haveI : Encodable h.index := h.index_countable.toEncodable
state_before: case intro.intro.intro
α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
h : FineSubfamilyOn v f s
⊢ ↑↑ρ s ≤ ↑↑ν s + ↑ε

tactic: calc
  ρ s ≤ ∑' x : h.index, ρ (h.covering x) := h.measure_le_tsum_of_absolutelyContinuous hρ
  _ ≤ ∑' x : h.index, ν (h.covering x) := (ENNReal.tsum_le_tsum fun x => (h.covering_mem x.2).1)
  _ = ν (⋃ x : h.index, h.covering x) := by
    rw [measure_iUnion h.covering_disjoint_subtype fun i => h.measurableSet_u i.2]
  _ ≤ ν U := (measure_mono (iUnion_subset fun i => (h.covering_mem i.2).2))
  _ ≤ ν s + ε := νU
state_before: case intro.intro.intro
α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
h : FineSubfamilyOn v f s
this : Encodable ↑(FineSubfamilyOn.index h)
⊢ ↑↑ρ s ≤ ↑↑ν s + ↑ε

tactic: apply v.fineSubfamilyOn_of_frequently f s fun x hx => ?_
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
⊢ FineSubfamilyOn v f s

tactic: have :=
  (hs x hx).and_eventually
    ((v.eventually_filterAt_mem_sets x).and
      (v.eventually_filterAt_subset_of_nhds (U_open.mem_nhds (sU hx))))
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
x : α
hx : x ∈ s
⊢ ∃ᶠ (a : Set α) in filterAt v x, a ∈ f x

tactic: apply Frequently.mono this
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
x : α
hx : x ∈ s
this : ∃ᶠ (x_1 : Set α) in filterAt v x, ↑↑ρ x_1 ≤ ↑↑ν x_1 ∧ x_1 ∈ setsAt v x ∧ x_1 ⊆ U
⊢ ∃ᶠ (a : Set α) in filterAt v x, a ∈ f x

tactic: rintro a ⟨ρa, _, aU⟩
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
x : α
hx : x ∈ s
this : ∃ᶠ (x_1 : Set α) in filterAt v x, ↑↑ρ x_1 ≤ ↑↑ν x_1 ∧ x_1 ∈ setsAt v x ∧ x_1 ⊆ U
⊢ ∀ (x_1 : Set α), ↑↑ρ x_1 ≤ ↑↑ν x_1 ∧ x_1 ∈ setsAt v x ∧ x_1 ⊆ U → x_1 ∈ f x

tactic: exact ⟨ρa, aU⟩
state_before: case intro.intro
α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
x : α
hx : x ∈ s
this : ∃ᶠ (x_1 : Set α) in filterAt v x, ↑↑ρ x_1 ≤ ↑↑ν x_1 ∧ x_1 ∈ setsAt v x ∧ x_1 ⊆ U
a : Set α
ρa : ↑↑ρ a ≤ ↑↑ν a
left✝ : a ∈ setsAt v x
aU : a ⊆ U
⊢ a ∈ f x

tactic: rw [measure_iUnion h.covering_disjoint_subtype fun i => h.measurableSet_u i.2]
state_before: α : Type u_1
inst✝⁴ : MetricSpace α
m0 : MeasurableSpace α
μ : MeasureTheory.Measure α
v : VitaliFamily μ
E : Type ?u.713372
inst✝³ : NormedAddCommGroup E
inst✝² : SecondCountableTopology α
inst✝¹ : BorelSpace α
ρ ν : MeasureTheory.Measure α
inst✝ : IsLocallyFiniteMeasure ν
hρ : ρ ≪ μ
s : Set α
hs : ∀ (x : α), x ∈ s → ∃ᶠ (a : Set α) in filterAt v x, ↑↑ρ a ≤ ↑↑ν a
ε : ℝ≥0
εpos : 0 < ε
x✝ : ↑↑ν s < ⊤
U : Set α
sU : s ⊆ U
U_open : IsOpen U
νU : ↑↑ν U ≤ ↑↑ν s + ↑ε
f : α → Set (Set α) := fun x => {a | ↑↑ρ a ≤ ↑↑ν a ∧ a ⊆ U}
h : FineSubfamilyOn v f s
this : Encodable ↑(FineSubfamilyOn.index h)
⊢ (∑' (x : ↑(FineSubfamilyOn.index h)), ↑↑ν (FineSubfamilyOn.covering h ↑x)) =
    ↑↑ν (⋃ (x : ↑(FineSubfamilyOn.index h)), FineSubfamilyOn.covering h ↑x)