Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 3689655

Browse files
committed
feat(measure_theory/stieltjes_measure): Stieltjes measures associated to monotone functions (#8266)
Given a monotone right-continuous real function `f`, there exists a measure giving mass `f b - f a` to the interval `(a, b]`. These measures are called Stieltjes measures, and are especially important in probability theory. The real Lebesgue measure is a particular case of this construction, for `f x = x`. This PR extends the already existing construction of the Lebesgue measure to cover all Stieltjes measures.
1 parent 7b27f46 commit 3689655

File tree

5 files changed

+416
-234
lines changed

5 files changed

+416
-234
lines changed

docs/overview.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ Analysis:
286286
the category of measurable spaces: 'Meas'
287287
Borel sigma-algebra: 'borel_space'
288288
positive measure: 'measure_theory.measure'
289-
Lebesgue measure: 'measure_theory.real.measure_space'
289+
Stieltjes measure: 'stieltjes_function.measure'
290+
Lebesgue measure: 'real.measure_space'
290291
Hausdorff measure: 'measure_theory.measure.hausdorff_measure'
291292
Hausdorff dimension: 'measure_theory.dimH'
292293
Giry monad: 'measure_theory.measure.measurable_space'

src/data/set/intervals/basic.lean

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,10 @@ lemma Ico_subset_Ico_iff (h₁ : a₁ < b₁) :
600600
⟨this.1, le_of_not_lt $ λ h', lt_irrefl b₂ (h ⟨this.2.le, h'⟩).2⟩,
601601
λ ⟨h₁, h₂⟩, Ico_subset_Ico h₁ h₂⟩
602602

603+
lemma Ioc_subset_Ioc_iff (h₁ : a₁ < b₁) :
604+
Ioc a₁ b₁ ⊆ Ioc a₂ b₂ ↔ b₁ ≤ b₂ ∧ a₂ ≤ a₁ :=
605+
by { convert @Ico_subset_Ico_iff (order_dual α) _ b₁ b₂ a₁ a₂ h₁; exact (@dual_Ico α _ _ _).symm }
606+
603607
lemma Ioo_subset_Ioo_iff [densely_ordered α] (h₁ : a₁ < b₁) :
604608
Ioo a₁ b₁ ⊆ Ioo a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂ :=
605609
⟨λ h, begin
@@ -1123,6 +1127,10 @@ by { ext x, simp [Ici] }
11231127
@[simp] lemma Ioi_inter_Ioi [is_total α (≤)] {a b : α} : Ioi a ∩ Ioi b = Ioi (a ⊔ b) :=
11241128
by { ext x, simp [Ioi] }
11251129

1130+
@[simp] lemma Ioc_inter_Ioi [is_total α (≤)] {a b c : α} : Ioc a b ∩ Ioi c = Ioc (a ⊔ c) b :=
1131+
by rw [← Ioi_inter_Iic, inter_assoc, inter_comm, inter_assoc, Ioi_inter_Ioi, inter_comm,
1132+
Ioi_inter_Iic, sup_comm]
1133+
11261134
end sup
11271135

11281136
section both
@@ -1174,10 +1182,13 @@ lemma Iic_inter_Ioc_of_le (h : a₂ ≤ a) : Iic a₂ ∩ Ioc a₁ a = Ioc a₁
11741182
ext $ λ x, ⟨λ H, ⟨H.2.1, H.1⟩, λ H, ⟨H.2, H.1, H.2.trans h⟩⟩
11751183

11761184
@[simp] lemma Ico_diff_Iio : Ico a b \ Iio c = Ico (max a c) b :=
1177-
ext $ by simp [Ico, Iio, iff_def, max_le_iff] {contextual:=tt}
1185+
ext $ by simp [iff_def] {contextual:=tt}
1186+
1187+
@[simp] lemma Ioc_diff_Ioi : Ioc a b \ Ioi c = Ioc a (min b c) :=
1188+
ext $ by simp [iff_def] {contextual:=tt}
11781189

11791190
@[simp] lemma Ico_inter_Iio : Ico a b ∩ Iio c = Ico a (min b c) :=
1180-
ext $ by simp [Ico, Iio, iff_def, lt_min_iff] {contextual:=tt}
1191+
ext $ by simp [iff_def] {contextual:=tt}
11811192

11821193
@[simp] lemma Ioc_union_Ioc_right : Ioc a b ∪ Ioc a c = Ioc a (max b c) :=
11831194
by rw [Ioc_union_Ioc, min_self]; exact (min_le_left _ _).trans (le_max_left _ _)

src/measure_theory/measure/lebesgue.lean

Lines changed: 22 additions & 230 deletions
Original file line numberDiff line numberDiff line change
@@ -4,262 +4,54 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Johannes Hölzl, Yury Kudryashov
55
-/
66
import measure_theory.constructions.pi
7+
import measure_theory.measure.stieltjes
78

89
/-!
910
# Lebesgue measure on the real line and on `ℝⁿ`
11+
12+
We construct Lebesgue measure on the real line, as a particular case of Stieltjes measure associated
13+
to the function `x ↦ x`. We obtain as a consequence Lebesgue measure on `ℝⁿ`. We prove their
14+
basic properties.
1015
-/
1116

1217
noncomputable theory
13-
open classical set filter
18+
open classical set filter measure_theory
1419
open ennreal (of_real)
15-
open_locale big_operators ennreal nnreal
16-
17-
namespace measure_theory
18-
19-
/-!
20-
### Preliminary definitions
21-
-/
22-
23-
/-- Length of an interval. This is the largest monotonic function which correctly
24-
measures all intervals. -/
25-
def lebesgue_length (s : set ℝ) : ℝ≥0∞ := ⨅a b (h : s ⊆ Ico a b), of_real (b - a)
26-
27-
@[simp] lemma lebesgue_length_empty : lebesgue_length ∅ = 0 :=
28-
nonpos_iff_eq_zero.1 $ infi_le_of_le 0 $ infi_le_of_le 0 $ by simp
29-
30-
@[simp] lemma lebesgue_length_Ico (a b : ℝ) :
31-
lebesgue_length (Ico a b) = of_real (b - a) :=
32-
begin
33-
refine le_antisymm (infi_le_of_le a $ binfi_le b (subset.refl _))
34-
(le_infi $ λ a', le_infi $ λ b', le_infi $ λ h, ennreal.coe_le_coe.2 _),
35-
cases le_or_lt b a with ab ab,
36-
{ rw real.to_nnreal_of_nonpos (sub_nonpos.2 ab), apply zero_le },
37-
cases (Ico_subset_Ico_iff ab).1 h with h₁ h₂,
38-
exact real.to_nnreal_le_to_nnreal (sub_le_sub h₂ h₁)
39-
end
40-
41-
lemma lebesgue_length_mono {s₁ s₂ : set ℝ} (h : s₁ ⊆ s₂) :
42-
lebesgue_length s₁ ≤ lebesgue_length s₂ :=
43-
infi_le_infi $ λ a, infi_le_infi $ λ b, infi_le_infi2 $ λ h', ⟨subset.trans h h', le_refl _⟩
44-
45-
lemma lebesgue_length_eq_infi_Ioo (s) :
46-
lebesgue_length s = ⨅a b (h : s ⊆ Ioo a b), of_real (b - a) :=
47-
begin
48-
refine le_antisymm
49-
(infi_le_infi $ λ a, infi_le_infi $ λ b, infi_le_infi2 $ λ h,
50-
⟨subset.trans h Ioo_subset_Ico_self, le_refl _⟩) _,
51-
refine le_infi (λ a, le_infi $ λ b, le_infi $ λ h, _),
52-
refine ennreal.le_of_forall_pos_le_add (λ ε ε0 _, _),
53-
refine infi_le_of_le (a - ε) (infi_le_of_le b $ infi_le_of_le
54-
(subset.trans h $ Ico_subset_Ioo_left $ (sub_lt_self_iff _).2 ε0) _),
55-
rw ← sub_add,
56-
refine le_trans ennreal.of_real_add_le (add_le_add_left _ _),
57-
simp only [ennreal.of_real_coe_nnreal, le_refl]
58-
end
59-
60-
@[simp] lemma lebesgue_length_Ioo (a b : ℝ) :
61-
lebesgue_length (Ioo a b) = of_real (b - a) :=
62-
begin
63-
rw ← lebesgue_length_Ico,
64-
refine le_antisymm (lebesgue_length_mono Ioo_subset_Ico_self) _,
65-
rw lebesgue_length_eq_infi_Ioo (Ioo a b),
66-
refine (le_infi $ λ a', le_infi $ λ b', le_infi $ λ h, _),
67-
cases le_or_lt b a with ab ab, {simp [ab]},
68-
cases (Ioo_subset_Ioo_iff ab).1 h with h₁ h₂,
69-
rw [lebesgue_length_Ico],
70-
exact ennreal.of_real_le_of_real (sub_le_sub h₂ h₁)
71-
end
72-
73-
lemma lebesgue_length_eq_infi_Icc (s) :
74-
lebesgue_length s = ⨅a b (h : s ⊆ Icc a b), of_real (b - a) :=
75-
begin
76-
refine le_antisymm _
77-
(infi_le_infi $ λ a, infi_le_infi $ λ b, infi_le_infi2 $ λ h,
78-
⟨subset.trans h Ico_subset_Icc_self, le_refl _⟩),
79-
refine le_infi (λ a, le_infi $ λ b, le_infi $ λ h, _),
80-
refine ennreal.le_of_forall_pos_le_add (λ ε ε0 _, _),
81-
refine infi_le_of_le a (infi_le_of_le (b + ε) $ infi_le_of_le
82-
(subset.trans h $ Icc_subset_Ico_right $ (lt_add_iff_pos_right _).2 ε0) _),
83-
rw [← sub_add_eq_add_sub],
84-
refine le_trans ennreal.of_real_add_le (add_le_add_left _ _),
85-
simp only [ennreal.of_real_coe_nnreal, le_refl]
86-
end
87-
88-
@[simp] lemma lebesgue_length_Icc (a b : ℝ) :
89-
lebesgue_length (Icc a b) = of_real (b - a) :=
90-
begin
91-
rw ← lebesgue_length_Ico,
92-
refine le_antisymm _ (lebesgue_length_mono Ico_subset_Icc_self),
93-
rw lebesgue_length_eq_infi_Icc (Icc a b),
94-
exact infi_le_of_le a (infi_le_of_le b $ infi_le_of_le (by refl) (by simp [le_refl]))
95-
end
96-
97-
/-- The Lebesgue outer measure, as an outer measure of ℝ. -/
98-
def lebesgue_outer : outer_measure ℝ :=
99-
outer_measure.of_function lebesgue_length lebesgue_length_empty
100-
101-
lemma lebesgue_outer_le_length (s : set ℝ) : lebesgue_outer s ≤ lebesgue_length s :=
102-
outer_measure.of_function_le _
103-
104-
lemma lebesgue_length_subadditive {a b : ℝ} {c d : ℕ → ℝ}
105-
(ss : Icc a b ⊆ ⋃i, Ioo (c i) (d i)) :
106-
(of_real (b - a) : ℝ≥0∞) ≤ ∑' i, of_real (d i - c i) :=
107-
begin
108-
suffices : ∀ (s:finset ℕ) b
109-
(cv : Icc a b ⊆ ⋃ i ∈ (↑s:set ℕ), Ioo (c i) (d i)),
110-
(of_real (b - a) : ℝ≥0∞) ≤ ∑ i in s, of_real (d i - c i),
111-
{ rcases is_compact_Icc.elim_finite_subcover_image (λ (i : ℕ) (_ : i ∈ univ),
112-
@is_open_Ioo _ _ _ _ (c i) (d i)) (by simpa using ss) with ⟨s, su, hf, hs⟩,
113-
have e : (⋃ i ∈ (↑hf.to_finset:set ℕ),
114-
Ioo (c i) (d i)) = (⋃ i ∈ s, Ioo (c i) (d i)), {simp [set.ext_iff]},
115-
rw ennreal.tsum_eq_supr_sum,
116-
refine le_trans _ (le_supr _ hf.to_finset),
117-
exact this hf.to_finset _ (by simpa [e]) },
118-
clear ss b,
119-
refine λ s, finset.strong_induction_on s (λ s IH b cv, _),
120-
cases le_total b a with ab ab,
121-
{ rw ennreal.of_real_eq_zero.2 (sub_nonpos.2 ab), exact zero_le _ },
122-
have := cv ⟨ab, le_refl _⟩, simp at this,
123-
rcases this with ⟨i, is, cb, bd⟩,
124-
rw [← finset.insert_erase is] at cv ⊢,
125-
rw [finset.coe_insert, bUnion_insert] at cv,
126-
rw [finset.sum_insert (finset.not_mem_erase _ _)],
127-
refine le_trans _ (add_le_add_left (IH _ (finset.erase_ssubset is) (c i) _) _),
128-
{ refine le_trans (ennreal.of_real_le_of_real _) ennreal.of_real_add_le,
129-
rw sub_add_sub_cancel,
130-
exact sub_le_sub_right (le_of_lt bd) _ },
131-
{ rintro x ⟨h₁, h₂⟩,
132-
refine (cv ⟨h₁, le_trans h₂ (le_of_lt cb)⟩).resolve_left
133-
(mt and.left (not_lt_of_le h₂)) }
134-
end
135-
136-
@[simp] lemma lebesgue_outer_Icc (a b : ℝ) :
137-
lebesgue_outer (Icc a b) = of_real (b - a) :=
138-
begin
139-
refine le_antisymm (by rw ← lebesgue_length_Icc; apply lebesgue_outer_le_length)
140-
(le_binfi $ λ f hf, ennreal.le_of_forall_pos_le_add $ λ ε ε0 h, _),
141-
rcases ennreal.exists_pos_sum_of_encodable
142-
(ennreal.zero_lt_coe_iff.2 ε0) ℕ with ⟨ε', ε'0, hε⟩,
143-
refine le_trans _ (add_le_add_left (le_of_lt hε) _),
144-
rw ← ennreal.tsum_add,
145-
choose g hg using show
146-
∀ i, ∃ p:ℝ×ℝ, f i ⊆ Ioo p.1 p.2 ∧ (of_real (p.2 - p.1) : ℝ≥0∞) <
147-
lebesgue_length (f i) + ε' i,
148-
{ intro i,
149-
have := (ennreal.lt_add_right (lt_of_le_of_lt (ennreal.le_tsum i) h)
150-
(ennreal.zero_lt_coe_iff.2 (ε'0 i))),
151-
conv at this {to_lhs, rw lebesgue_length_eq_infi_Ioo},
152-
simpa [infi_lt_iff] },
153-
refine le_trans _ (ennreal.tsum_le_tsum $ λ i, le_of_lt (hg i).2),
154-
exact lebesgue_length_subadditive (subset.trans hf $
155-
Union_subset_Union $ λ i, (hg i).1)
156-
end
157-
158-
@[simp] lemma lebesgue_outer_singleton (a : ℝ) : lebesgue_outer {a} = 0 :=
159-
by simpa using lebesgue_outer_Icc a a
160-
161-
@[simp] lemma lebesgue_outer_Ico (a b : ℝ) :
162-
lebesgue_outer (Ico a b) = of_real (b - a) :=
163-
by rw [← Icc_diff_right, lebesgue_outer.diff_null _ (lebesgue_outer_singleton _),
164-
lebesgue_outer_Icc]
165-
166-
@[simp] lemma lebesgue_outer_Ioo (a b : ℝ) :
167-
lebesgue_outer (Ioo a b) = of_real (b - a) :=
168-
by rw [← Ico_diff_left, lebesgue_outer.diff_null _ (lebesgue_outer_singleton _), lebesgue_outer_Ico]
169-
170-
@[simp] lemma lebesgue_outer_Ioc (a b : ℝ) :
171-
lebesgue_outer (Ioc a b) = of_real (b - a) :=
172-
by rw [← Icc_diff_left, lebesgue_outer.diff_null _ (lebesgue_outer_singleton _), lebesgue_outer_Icc]
173-
174-
lemma is_lebesgue_measurable_Iio {c : ℝ} :
175-
lebesgue_outer.caratheodory.measurable_set' (Iio c) :=
176-
outer_measure.of_function_caratheodory $ λ t,
177-
le_infi $ λ a, le_infi $ λ b, le_infi $ λ h, begin
178-
refine le_trans (add_le_add
179-
(lebesgue_length_mono $ inter_subset_inter_left _ h)
180-
(lebesgue_length_mono $ diff_subset_diff_left h)) _,
181-
cases le_total a c with hac hca; cases le_total b c with hbc hcb;
182-
simp [*, -sub_eq_add_neg, sub_add_sub_cancel', le_refl],
183-
{ simp [*, ← ennreal.of_real_add, -sub_eq_add_neg, sub_add_sub_cancel', le_refl] },
184-
{ simp only [ennreal.of_real_eq_zero.2 (sub_nonpos.2 (le_trans hbc hca)), zero_add, le_refl] }
185-
end
186-
187-
theorem lebesgue_outer_trim : lebesgue_outer.trim = lebesgue_outer :=
188-
begin
189-
refine le_antisymm (λ s, _) (outer_measure.le_trim _),
190-
rw outer_measure.trim_eq_infi,
191-
refine le_infi (λ f, le_infi $ λ hf,
192-
ennreal.le_of_forall_pos_le_add $ λ ε ε0 h, _),
193-
rcases ennreal.exists_pos_sum_of_encodable
194-
(ennreal.zero_lt_coe_iff.2 ε0) ℕ with ⟨ε', ε'0, hε⟩,
195-
refine le_trans _ (add_le_add_left (le_of_lt hε) _),
196-
rw ← ennreal.tsum_add,
197-
choose g hg using show
198-
∀ i, ∃ s, f i ⊆ s ∧ measurable_set s ∧
199-
lebesgue_outer s ≤ lebesgue_length (f i) + of_real (ε' i),
200-
{ intro i,
201-
have := (ennreal.lt_add_right (lt_of_le_of_lt (ennreal.le_tsum i) h)
202-
(ennreal.zero_lt_coe_iff.2 (ε'0 i))),
203-
conv at this {to_lhs, rw lebesgue_length},
204-
simp only [infi_lt_iff] at this,
205-
rcases this with ⟨a, b, h₁, h₂⟩,
206-
rw ← lebesgue_outer_Ico at h₂,
207-
exact ⟨_, h₁, measurable_set_Ico, le_of_lt $ by simpa using h₂⟩ },
208-
simp at hg,
209-
apply infi_le_of_le (Union g) _,
210-
apply infi_le_of_le (subset.trans hf $ Union_subset_Union (λ i, (hg i).1)) _,
211-
apply infi_le_of_le (measurable_set.Union (λ i, (hg i).2.1)) _,
212-
exact le_trans (lebesgue_outer.Union _) (ennreal.tsum_le_tsum $ λ i, (hg i).2.2)
213-
end
214-
215-
lemma borel_le_lebesgue_measurable : borel ℝ ≤ lebesgue_outer.caratheodory :=
216-
begin
217-
rw real.borel_eq_generate_from_Iio_rat,
218-
refine measurable_space.generate_from_le _,
219-
simp [is_lebesgue_measurable_Iio] { contextual := tt }
220-
end
20+
open_locale big_operators ennreal nnreal topological_space
22121

22222
/-!
22323
### Definition of the Lebesgue measure and lengths of intervals
22424
-/
22525

226-
/-- Lebesgue measure on the Borel sets
227-
228-
The outer Lebesgue measure is the completion of this measure. (TODO: proof this)
229-
-/
26+
/-- Lebesgue measure on the Borel sigma algebra, giving measure `b - a` to the interval `[a, b]`. -/
23027
instance real.measure_space : measure_space ℝ :=
231-
⟨{to_outer_measure := lebesgue_outer,
232-
m_Union := λ f hf, lebesgue_outer.Union_eq_of_caratheodory $
233-
λ i, borel_le_lebesgue_measurable _ (hf i),
234-
trimmed := lebesgue_outer_trim }⟩
235-
236-
@[simp] theorem lebesgue_to_outer_measure :
237-
(volume : measure ℝ).to_outer_measure = lebesgue_outer := rfl
238-
239-
end measure_theory
240-
241-
open measure_theory
28+
⟨stieltjes_function.id.measure⟩
24229

24330
namespace real
24431

24532
variables {ι : Type*} [fintype ι]
24633

24734
open_locale topological_space
24835

249-
theorem volume_val (s) : volume s = lebesgue_outer s := rfl
36+
theorem volume_val (s) : volume s = stieltjes_function.id.measure s := rfl
25037

251-
instance has_no_atoms_volume : has_no_atoms (volume : measure ℝ) :=
252-
⟨lebesgue_outer_singleton⟩
38+
@[simp] lemma volume_Ico {a b : ℝ} : volume (Ico a b) = of_real (b - a) :=
39+
by simp [volume_val]
25340

254-
@[simp] lemma volume_Ico {a b : ℝ} : volume (Ico a b) = of_real (b - a) := lebesgue_outer_Ico a b
41+
@[simp] lemma volume_Icc {a b : ℝ} : volume (Icc a b) = of_real (b - a) :=
42+
by simp [volume_val]
25543

256-
@[simp] lemma volume_Icc {a b : ℝ} : volume (Icc a b) = of_real (b - a) := lebesgue_outer_Icc a b
44+
@[simp] lemma volume_Ioo {a b : ℝ} : volume (Ioo a b) = of_real (b - a) :=
45+
by simp [volume_val]
25746

258-
@[simp] lemma volume_Ioo {a b : ℝ} : volume (Ioo a b) = of_real (b - a) := lebesgue_outer_Ioo a b
47+
@[simp] lemma volume_Ioc {a b : ℝ} : volume (Ioc a b) = of_real (b - a) :=
48+
by simp [volume_val]
25949

260-
@[simp] lemma volume_Ioc {a b : ℝ} : volume (Ioc a b) = of_real (b - a) := lebesgue_outer_Ioc a b
50+
@[simp] lemma volume_singleton {a : ℝ} : volume ({a} : set ℝ) = 0 :=
51+
by simp [volume_val]
26152

262-
@[simp] lemma volume_singleton {a : ℝ} : volume ({a} : set ℝ) = 0 := lebesgue_outer_singleton a
53+
instance has_no_atoms_volume : has_no_atoms (volume : measure ℝ) :=
54+
⟨λ x, volume_singleton⟩
26355

26456
@[simp] lemma volume_interval {a b : ℝ} : volume (interval a b) = of_real (abs (b - a)) :=
26557
by rw [interval, volume_Icc, max_sub_min_eq_abs]

0 commit comments

Comments
 (0)