Skip to content
Draft
68 changes: 23 additions & 45 deletions Mathlib/MeasureTheory/Covering/Besicovitch.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1018,56 +1018,34 @@ theorem exists_closedBall_covering_tsum_measure_le (μ : Measure α) [SFinite μ
/-- In a space with the Besicovitch covering property, the set of closed balls with positive radius
forms a Vitali family. This is essentially a restatement of the measurable Besicovitch theorem. -/
protected def vitaliFamily (μ : Measure α) [SFinite μ] : VitaliFamily μ where
setsAt x := (fun r : ℝ => closedBall x r) '' Ioi (0 : ℝ)
measurableSet _ := forall_mem_image.2 fun _ _ ↦ isClosed_closedBall.measurableSet
nonempty_interior _ := forall_mem_image.2 fun _ rpos ↦
(nonempty_ball.2 rpos).mono ball_subset_interior_closedBall
nontrivial x ε εpos := ⟨closedBall x ε, mem_image_of_mem _ εpos, Subset.rfl⟩
covering := by
intro s f fsubset ffine
let g : α → Set ℝ := fun x => {r | 0 < r ∧ closedBall x r ∈ f x}
have A : ∀ x ∈ s, ∀ δ > 0, (g x ∩ Ioo 0 δ).Nonempty := by
intro x xs δ δpos
obtain ⟨t, tf, ht⟩ : ∃ (t : Set α), t ∈ f x ∧ t ⊆ closedBall x (δ / 2) :=
ffine x xs (δ / 2) (half_pos δpos)
obtain ⟨r, rpos, rfl⟩ : ∃ r : ℝ, 0 < r ∧ closedBall x r = t := by simpa using fsubset x xs tf
rcases le_total r (δ / 2) with (H | H)
· exact ⟨r, ⟨rpos, tf⟩, ⟨rpos, H.trans_lt (half_lt_self δpos)⟩⟩
· have : closedBall x r = closedBall x (δ / 2) := Subset.antisymm ht (by gcongr)
rw [this] at tf
exact ⟨δ / 2, ⟨half_pos δpos, tf⟩, ⟨half_pos δpos, half_lt_self δpos⟩⟩
obtain ⟨t, r, _, ts, tg, μt, tdisj⟩ :
∃ (t : Set α) (r : α → ℝ),
t.Countable ∧
t ⊆ s ∧
(∀ x ∈ t, r x ∈ g x ∩ Ioo 0 1) ∧
μ (s \ ⋃ x ∈ t, closedBall x (r x)) = 0 ∧
t.PairwiseDisjoint fun x => closedBall x (r x) :=
exists_disjoint_closedBall_covering_ae μ g s A (fun _ => 1) fun _ _ => zero_lt_one
let F : α → α × Set α := fun x => (x, closedBall x (r x))
refine ⟨F '' t, ?_, ?_, ?_, ?_⟩
filterAt x := (𝓝[>] (0 : ℝ)).map (closedBall x)
filterAt_le_smallSets_nhds x := (tendsto_closedBall_smallSets x).mono_left nhdsWithin_le_nhds
eventually_measurableSet _ := eventually_map.2 <| .of_forall fun _ ↦ measurableSet_closedBall
filterAt_neBot _ := inferInstance
exists_covering s P hP := by
have A : ∀ x ∈ s, ∀ δ > 0, ({r | P x (closedBall x r)} ∩ Ioo 0 δ).Nonempty := fun x hx δ hδ ↦
((frequently_map.1 (hP x hx)).and_eventually (Ioo_mem_nhdsGT hδ)).exists
obtain ⟨t, r, htc, ts, htP, μt, tdisj⟩ :=
exists_disjoint_closedBall_covering_ae μ _ s A (fun _ ↦ 1) fun _ _ ↦ zero_lt_one
refine ⟨(fun x ↦ (x, closedBall x (r x))) '' t, htc.image _, ?_, ?_, ?_, ?_⟩
· rintro - ⟨x, hx, rfl⟩; exact ts hx
· rintro p ⟨x, hx, rfl⟩ q ⟨y, hy, rfl⟩ hxy
exact tdisj hx hy (ne_of_apply_ne F hxy)
· rintro - ⟨x, hx, rfl⟩; exact (tg x hx).1.2
· rwa [biUnion_image]
exact tdisj hx hy fun h ↦ hxy (h ▸ rfl)
· rintro - ⟨x, hx, rfl⟩; exact (htP x hx).1
· rw [biUnion_image]
exact ae_subset.2 μt

/-- The main feature of the Besicovitch Vitali family is that its filter at a point `x` corresponds
to convergence along closed balls. We record one of the two implications here, which will enable us
to deduce specific statements on differentiation of measures in this context from the general
versions. -/
to convergence along closed balls. -/
theorem filterAt_vitaliFamily (μ : Measure α) [SFinite μ] (x : α) :
(Besicovitch.vitaliFamily μ).filterAt x = (𝓝[>] (0 : ℝ)).map (closedBall x) :=
rfl

/-- Closed balls centered at `x` tend to the Besicovitch Vitali family filter at `x`
as the radius tends to `0⁺`. -/
theorem tendsto_filterAt (μ : Measure α) [SFinite μ] (x : α) :
Tendsto (fun r => closedBall x r) (𝓝[>] 0) ((Besicovitch.vitaliFamily μ).filterAt x) := by
intro s hs
simp only [mem_map]
obtain ⟨ε, εpos, hε⟩ :
∃ (ε : ℝ), ε > 0 ∧
∀ a : Set α, a ∈ (Besicovitch.vitaliFamily μ).setsAt x → a ⊆ closedBall x ε → a ∈ s :=
(VitaliFamily.mem_filterAt_iff _).1 hs
filter_upwards [Ioc_mem_nhdsGT εpos] with _r hr
apply hε
· exact mem_image_of_mem _ hr.1
· exact closedBall_subset_closedBall hr.2
Tendsto (fun r => closedBall x r) (𝓝[>] 0) ((Besicovitch.vitaliFamily μ).filterAt x) :=
tendsto_map

variable [MetricSpace β] [MeasurableSpace β] [BorelSpace β] [SecondCountableTopology β]
[HasBesicovitchCovering β]
Expand Down
100 changes: 42 additions & 58 deletions Mathlib/MeasureTheory/Covering/DensityTheorem.lean
Original file line number Diff line number Diff line change
Expand Up @@ -47,84 +47,68 @@ variable [SecondCountableTopology α] [BorelSpace α] [IsLocallyFiniteMeasure μ
open scoped Topology

/-- A Vitali family in a space with a uniformly locally doubling measure, designed so that the sets
at `x` contain all `closedBall y r` when `dist x y ≤ K * r`. -/
def vitaliFamily (K : ℝ) : VitaliFamily μ := by
/- the Vitali covering theorem gives a family that works well at small scales, thanks to the
doubling property. We enlarge this family to add large sets, to make sure that all balls and not
only small ones belong to the family, for convenience. -/
let R := scalingScaleOf μ (max (4 * K + 3) 3)
have Rpos : 0 < R := scalingScaleOf_pos _ _
have A : ∀ x : α, ∃ᶠ r in 𝓝[>] (0 : ℝ),
μ (closedBall x (3 * r)) ≤ scalingConstantOf μ (max (4 * K + 3) 3) * μ (closedBall x r) := by
intro x
at `x` contain all small enough balls `closedBall y r` when `dist x y ≤ K * r`. -/
def vitaliFamily (K : ℝ) : VitaliFamily μ :=
Vitali.vitaliFamily μ (fun _ ↦ scalingConstantOf μ (max (4 * K + 3) 3)) fun x ↦ by
apply frequently_iff.2 fun {U} hU => ?_
obtain ⟨ε, εpos, hε⟩ := mem_nhdsGT_iff_exists_Ioc_subset.1 hU
refine ⟨min ε R, hε ⟨lt_min εpos Rpos, min_le_left _ _⟩, ?_⟩
have Rpos : 0 < scalingScaleOf μ (max (4 * K + 3) 3) := scalingScaleOf_pos _ _
refine ⟨min ε (scalingScaleOf μ (max (4 * K + 3) 3)),
hε ⟨lt_min εpos Rpos, min_le_left _ _⟩, ?_⟩
exact measure_mul_le_scalingConstantOf_mul μ
⟨zero_lt_three, le_max_right _ _⟩ (min_le_right _ _)
exact (Vitali.vitaliFamily μ (scalingConstantOf μ (max (4 * K + 3) 3)) A).enlarge (R / 4)
(by linarith)

/-- In the Vitali family `IsUnifLocDoublingMeasure.vitaliFamily K`, the sets based at `x`
contain all balls `closedBall y r` when `dist x y ≤ K * r`. -/
theorem closedBall_mem_vitaliFamily_of_dist_le_mul {K : ℝ} {x y : α} {r : ℝ} (h : dist x y ≤ K * r)
(rpos : 0 < r) : closedBall y r ∈ (vitaliFamily μ K).setsAt x := by
let R := scalingScaleOf μ (max (4 * K + 3) 3)
simp only [vitaliFamily, VitaliFamily.enlarge, Vitali.vitaliFamily, mem_union, mem_ofPred_eq,
isClosed_closedBall, true_and, (nonempty_ball.2 rpos).mono ball_subset_interior_closedBall,
measurableSet_closedBall]
/- The measure is doubling on scales smaller than `R`. Therefore, we treat differently small
and large balls. For large balls, this follows directly from the enlargement we used in the
definition. -/
by_cases H : closedBall y r ⊆ closedBall x (R / 4)
swap; · exact Or.inr H
left
/- For small balls, there is the difficulty that `r` could be large but still the ball could be
small, if the annulus `{y | ε ≤ dist y x ≤ R/4}` is empty. We split between the cases `r ≤ R`
and `r > R`, and use the doubling for the former and rough estimates for the latter. -/
rcases le_or_gt r R with (hr | hr)
· refine ⟨(K + 1) * r, ?_⟩
constructor
· apply closedBall_subset_closedBall'
rw [dist_comm]
linarith
· have I1 : closedBall x (3 * ((K + 1) * r)) ⊆ closedBall y ((4 * K + 3) * r) := by
apply closedBall_subset_closedBall'
linarith
have I2 : closedBall y ((4 * K + 3) * r) ⊆ closedBall y (max (4 * K + 3) 3 * r) := by
gcongr
exact le_max_left ..
apply (measure_mono (I1.trans I2)).trans
exact measure_mul_le_scalingConstantOf_mul _
⟨zero_lt_three.trans_le (le_max_right _ _), le_rfl⟩ hr
· refine ⟨_, H, ?_⟩
grw [scalingConstantOf, ← le_max_right, ENNReal.coe_one, one_mul,
closedBall_subset_closedBall' (y := y)]
have A : y ∈ closedBall y r := mem_closedBall_self rpos.le
have B := mem_closedBall'.1 (H A)
linarith

omit [SecondCountableTopology α] [BorelSpace α] [IsLocallyFiniteMeasure μ] in
/-- Auxiliary lemma for `tendsto_closedBall_filterAt`: in the Vitali family
`IsUnifLocDoublingMeasure.vitaliFamily K`, the sets based at `x`
contain all balls `closedBall y r` when `dist x y ≤ K * r` and `r` is small enough. -/
private theorem closedBall_mem_of_dist_le_mul {K : ℝ} {x y : α} {r : ℝ}
(h : dist x y ≤ K * r) (rpos : 0 < r) (hr : r ≤ scalingScaleOf μ (max (4 * K + 3) 3)) :
IsClosed (closedBall y r) ∧ (interior (closedBall y r)).Nonempty ∧
∃ r', closedBall y r ⊆ closedBall x r' ∧
μ (closedBall x (3 * r')) ≤
scalingConstantOf μ (max (4 * K + 3) 3) * μ (closedBall y r) := by
refine ⟨isClosed_closedBall, (nonempty_ball.2 rpos).mono ball_subset_interior_closedBall,
(K + 1) * r, ?_, ?_⟩
· apply closedBall_subset_closedBall'
rw [dist_comm]
linarith
· have I1 : closedBall x (3 * ((K + 1) * r)) ⊆ closedBall y ((4 * K + 3) * r) := by
apply closedBall_subset_closedBall'
linarith
have I2 : closedBall y ((4 * K + 3) * r) ⊆ closedBall y (max (4 * K + 3) 3 * r) := by
gcongr
exact le_max_left ..
apply (measure_mono (I1.trans I2)).trans
exact measure_mul_le_scalingConstantOf_mul _
⟨zero_lt_three.trans_le (le_max_right _ _), le_rfl⟩ hr

/-- The closed balls `closedBall (w j) (δ j)` tend to `(vitaliFamily μ K).filterAt x`
whenever `δ j → 0⁺` and eventually `x ∈ closedBall (w j) (K * δ j)`. -/
theorem tendsto_closedBall_filterAt {K : ℝ} {x : α} {ι : Type*} {l : Filter ι} (w : ι → α)
(δ : ι → ℝ) (δlim : Tendsto δ l (𝓝[>] 0)) (xmem : ∀ᶠ j in l, x ∈ closedBall (w j) (K * δ j)) :
Tendsto (fun j => closedBall (w j) (δ j)) l ((vitaliFamily μ K).filterAt x) := by
refine (vitaliFamily μ K).tendsto_filterAt_iff.mpr ⟨?_, fun ε hε => ?_⟩
· filter_upwards [xmem, δlim self_mem_nhdsWithin] with j hj h'j
exact closedBall_mem_vitaliFamily_of_dist_le_mul μ hj h'j
rw [vitaliFamily, Vitali.filterAt_vitaliFamily, tendsto_inf, tendsto_principal,
nhds_basis_closedBall.smallSets.tendsto_right_iff]
have δpos := eventually_mem_of_tendsto_nhdsWithin δlim
replace δlim := tendsto_nhds_of_tendsto_nhdsWithin δlim
refine ⟨fun ε hε => ?_, ?_⟩
· rcases l.eq_or_neBot with rfl | h
· simp
have hK : 0 ≤ K := by
rcases (xmem.and (δlim self_mem_nhdsWithin)).exists with ⟨j, hj, h'j⟩
rcases (xmem.and δpos).exists with ⟨j, hj, h'j⟩
have : 0 ≤ K * δ j := nonempty_closedBall.1 ⟨x, hj⟩
exact (mul_nonneg_iff_left_nonneg_of_pos (mem_Ioi.1 h'j)).1 this
have δpos := eventually_mem_of_tendsto_nhdsWithin δlim
replace δlim := tendsto_nhds_of_tendsto_nhdsWithin δlim
replace hK : 0 < K + 1 := by linarith
apply (((Metric.tendsto_nhds.mp δlim _ (div_pos hε hK)).and δpos).and xmem).mono
rintro j ⟨⟨hjε, hj₀ : 0 < δ j⟩, hx⟩ y hy
replace hjε : (K + 1) * δ j < ε := by
simpa [abs_eq_self.mpr hj₀.le] using (lt_div_iff₀' hK).mp hjε
simp only [mem_closedBall] at hx hy ⊢
linarith [dist_triangle_right y x (w j)]
· filter_upwards [xmem, δpos, δlim.eventually (gt_mem_nhds (scalingScaleOf_pos μ _))]
with j hj h'j h''j
exact closedBall_mem_of_dist_le_mul μ hj h'j h''j.le

end

Expand Down
Loading