Skip to content

Commit fa98765

Browse files
committed
feat(MeasuredSets): measure is 1-lipschitz (leanprover-community#34665)
1 parent dd7678a commit fa98765

1 file changed

Lines changed: 23 additions & 38 deletions

File tree

Mathlib/MeasureTheory/Measure/MeasuredSets.lean

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module
77

88
public import Mathlib.MeasureTheory.Measure.Typeclasses.Finite
99
public import Mathlib.MeasureTheory.SetSemiring
10+
import Mathlib.Topology.MetricSpace.Lipschitz
1011

1112
/-!
1213
# Measured sets
@@ -51,41 +52,16 @@ instance : PseudoEMetricSpace (MeasuredSets μ) where
5152

5253
lemma MeasuredSets.edist_def (s t : MeasuredSets μ) : edist s t = μ ((s : Set α) ∆ t) := rfl
5354

55+
/-- Measure on `MeasuredSets` is a 1-lipschitz function.
56+
57+
We cannot state this in terms of `LipschitzWith`, because `ℝ≥0∞` is not a `PseudoEMetricSpace`. -/
58+
lemma MeasuredSets.sub_le_edist (s t : MeasuredSets μ) : μ s - μ t ≤ edist s t :=
59+
le_measure_diff.trans <| measure_mono subset_union_left
60+
5461
lemma MeasuredSets.continuous_measure : Continuous (fun (s : MeasuredSets μ) ↦ μ s) := by
55-
apply continuous_iff_continuousAt.2 (fun x ↦ ?_)
56-
simp only [ContinuousAt]
57-
rcases eq_top_or_lt_top (μ x) with hx | hx
58-
· simp only [hx]
59-
apply tendsto_const_nhds.congr'
60-
filter_upwards [Metric.eball_mem_nhds _ zero_lt_one] with y hy
61-
simp only [Metric.mem_eball, edist_def] at hy
62-
contrapose! hy
63-
simp [measure_symmDiff_eq_top hy.symm hx]
64-
· apply (ENNReal.hasBasis_nhds_of_ne_top hx.ne).tendsto_right_iff.2 (fun ε εpos ↦ ?_)
65-
filter_upwards [Metric.eball_mem_nhds _ εpos] with a ha
66-
simp only [Metric.mem_eball, edist_def] at ha
67-
refine ⟨?_, ?_⟩
68-
· apply tsub_le_iff_right.mpr
69-
calc μ x
70-
_ ≤ μ a + μ (x \ a) := by
71-
rw [← measure_union Set.disjoint_sdiff_right (by exact x.2.diff a.2)]
72-
apply measure_mono
73-
exact Set.diff_subset_iff.mp fun ⦃a_1⦄ a ↦ a
74-
_ ≤ μ a + μ (a ∆ x) := by
75-
gcongr
76-
simp [symmDiff]
77-
_ ≤ μ a + ε := by
78-
gcongr
79-
· calc μ a
80-
_ ≤ μ x + μ (a \ x) := by
81-
rw [← measure_union Set.disjoint_sdiff_right (by exact a.2.diff x.2)]
82-
apply measure_mono
83-
exact Set.diff_subset_iff.mp fun ⦃a_1⦄ a ↦ a
84-
_ ≤ μ x + μ (a ∆ x) := by
85-
gcongr
86-
simp [symmDiff]
87-
_ ≤ μ x + ε := by
88-
gcongr
62+
refine continuous_of_le_add_edist 1 ENNReal.one_ne_top fun s t ↦ ?_
63+
rw [one_mul, ← tsub_le_iff_left]
64+
exact sub_le_edist s t
8965

9066
instance [IsFiniteMeasure μ] : PseudoMetricSpace (MeasuredSets μ) :=
9167
PseudoEMetricSpace.toPseudoMetricSpaceOfDist
@@ -95,7 +71,16 @@ instance [IsFiniteMeasure μ] : PseudoMetricSpace (MeasuredSets μ) :=
9571
lemma MeasuredSets.dist_def [IsFiniteMeasure μ] (s t : MeasuredSets μ) :
9672
dist s t = μ.real ((s : Set α) ∆ t) := rfl
9773

98-
/- Given a ring of sets `C` covering the space modulo `0` and generating the measurable space
74+
lemma MeasuredSets.real_sub_real_le_dist [IsFiniteMeasure μ] (s t : MeasuredSets μ) :
75+
μ.real s - μ.real t ≤ dist s t := by
76+
grw [dist_edist, ← sub_le_edist]
77+
exacts [ENNReal.le_toReal_sub (measure_ne_top _ _), edist_ne_top _ _]
78+
79+
lemma MeasuredSets.lipschitzWith_measureReal [IsFiniteMeasure μ] :
80+
LipschitzWith 1 (fun s : MeasuredSets μ ↦ μ.real s) :=
81+
.of_le_add fun s t ↦ sub_le_iff_le_add'.mp <| real_sub_real_le_dist s t
82+
83+
/-- Given a ring of sets `C` covering the space modulo `0` and generating the measurable space
9984
structure, any measurable set can be approximated by elements of `C`. -/
10085
lemma exists_measure_symmDiff_lt_of_generateFrom_isSetRing [IsFiniteMeasure μ]
10186
{C : Set (Set α)} (hC : IsSetRing C)
@@ -176,7 +161,7 @@ lemma exists_measure_symmDiff_lt_of_generateFrom_isSetRing [IsFiniteMeasure μ]
176161
_ < ε / 2 + ε / 2 := by gcongr
177162
_ = ε := ENNReal.add_halves ε
178163

179-
/- Given a semiring of sets `C` covering the space modulo `0` and generating the measurable space
164+
/-- Given a semiring of sets `C` covering the space modulo `0` and generating the measurable space
180165
structure, any measurable set can be approximated by finite unions of elements of `C`. -/
181166
lemma exists_measure_symmDiff_lt_of_generateFrom_isSetSemiring [IsFiniteMeasure μ]
182167
{C : Set (Set α)} (hC : IsSetSemiring C)
@@ -191,7 +176,7 @@ lemma exists_measure_symmDiff_lt_of_generateFrom_isSetSemiring [IsFiniteMeasure
191176
apply generateFrom_le (fun t ht ↦ ?_)
192177
apply measurableSet_generateFrom_of_mem_supClosure ht
193178

194-
/- A ring of sets covering the space modulo `0` and generating the measurable space
179+
/-- A ring of sets covering the space modulo `0` and generating the measurable space
195180
structure is dense among measurable sets. -/
196181
lemma dense_of_generateFrom_isSetRing [IsFiniteMeasure μ]
197182
{C : Set (Set α)} (hC : IsSetRing C)
@@ -204,7 +189,7 @@ lemma dense_of_generateFrom_isSetRing [IsFiniteMeasure μ]
204189
refine ⟨⟨t, t_meas⟩, ?_, tC⟩
205190
simpa [MeasuredSets.edist_def] using ht
206191

207-
/- Given a semiring of sets `C` covering the space modulo `0` and generating the measurable space
192+
/-- Given a semiring of sets `C` covering the space modulo `0` and generating the measurable space
208193
structure, finite unions of elements of `C` are dense among measurable sets. -/
209194
lemma dense_of_generateFrom_isSetSemiring [IsFiniteMeasure μ]
210195
{C : Set (Set α)} (hC : IsSetSemiring C)

0 commit comments

Comments
 (0)