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

Commit 56065f7

Browse files
mzinkevisgouezel
andcommitted
feat(measure_theory/pi_system) lemmas for pi_system, useful for independence. (#6353)
The goal here is to prove that the expectation of a product of an finite number of independent random variables equals the production of the expectations. See https://github.com/leanprover-community/mathlib/tree/mzinkevi_independent_finite_alt Co-authored-by: mzinkevi <41597957+mzinkevi@users.noreply.github.com> Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
1 parent 925ea07 commit 56065f7

File tree

3 files changed

+383
-203
lines changed

3 files changed

+383
-203
lines changed

src/measure_theory/measurable_space.lean

Lines changed: 0 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ the equivalence are measurable functions.
3535
We say that a filter `f` is measurably generated if every set `s ∈ f` includes a measurable
3636
set `t ∈ f`. This property is useful, e.g., to extract a measurable witness of `filter.eventually`.
3737
38-
## Main statements
39-
40-
The main theorem of this file is Dynkin's π-λ theorem, which appears
41-
here as an induction principle `induction_on_inter`. Suppose `s` is a
42-
collection of subsets of `α` such that the intersection of two members
43-
of `s` belongs to `s` whenever it is nonempty. Let `m` be the σ-algebra
44-
generated by `s`. In order to check that a predicate `C` holds on every
45-
member of `m`, it suffices to check that `C` holds on the members of `s` and
46-
that `C` is preserved by complementation and *disjoint* countable
47-
unions.
48-
4938
## Notation
5039
5140
* We write `α ≃ᵐ β` for measurable equivalences between the measurable spaces `α` and `β`.
@@ -1137,198 +1126,6 @@ noncomputable def pi_measurable_equiv_tprod {l : list δ'} (hnd : l.nodup) (h :
11371126

11381127
end measurable_equiv
11391128

1140-
/-- A pi-system is a collection of subsets of `α` that is closed under intersections of sets that
1141-
are not disjoint. Usually it is also required that the collection is nonempty, but we don't do
1142-
that here. -/
1143-
def is_pi_system {α} (C : set (set α)) : Prop :=
1144-
∀ s t ∈ C, (s ∩ t : set α).nonempty → s ∩ t ∈ C
1145-
1146-
namespace measurable_space
1147-
1148-
lemma is_pi_system_measurable_set [measurable_space α] :
1149-
is_pi_system {s : set α | measurable_set s} :=
1150-
λ s t hs ht _, hs.inter ht
1151-
1152-
/-- A Dynkin system is a collection of subsets of a type `α` that contains the empty set,
1153-
is closed under complementation and under countable union of pairwise disjoint sets.
1154-
The disjointness condition is the only difference with `σ`-algebras.
1155-
1156-
The main purpose of Dynkin systems is to provide a powerful induction rule for σ-algebras
1157-
generated by intersection stable set systems.
1158-
1159-
A Dynkin system is also known as a "λ-system" or a "d-system".
1160-
-/
1161-
structure dynkin_system (α : Type*) :=
1162-
(has : set α → Prop)
1163-
(has_empty : has ∅)
1164-
(has_compl : ∀ {a}, has a → has aᶜ)
1165-
(has_Union_nat : ∀ {f : ℕ → set α}, pairwise (disjoint on f) → (∀ i, has (f i)) → has (⋃ i, f i))
1166-
1167-
namespace dynkin_system
1168-
1169-
@[ext] lemma ext : ∀ {d₁ d₂ : dynkin_system α}, (∀ s : set α, d₁.has s ↔ d₂.has s) → d₁ = d₂
1170-
| ⟨s₁, _, _, _⟩ ⟨s₂, _, _, _⟩ h := have s₁ = s₂, from funext $ assume x, propext $ h x,
1171-
by subst this
1172-
1173-
variable (d : dynkin_system α)
1174-
1175-
lemma has_compl_iff {a} : d.has aᶜ ↔ d.has a :=
1176-
⟨λ h, by simpa using d.has_compl h, λ h, d.has_compl h⟩
1177-
1178-
lemma has_univ : d.has univ :=
1179-
by simpa using d.has_compl d.has_empty
1180-
1181-
theorem has_Union {β} [encodable β] {f : β → set α}
1182-
(hd : pairwise (disjoint on f)) (h : ∀ i, d.has (f i)) : d.has (⋃ i, f i) :=
1183-
by { rw ← encodable.Union_decode2, exact
1184-
d.has_Union_nat (Union_decode2_disjoint_on hd)
1185-
(λ n, encodable.Union_decode2_cases d.has_empty h) }
1186-
1187-
theorem has_union {s₁ s₂ : set α}
1188-
(h₁ : d.has s₁) (h₂ : d.has s₂) (h : s₁ ∩ s₂ ⊆ ∅) : d.has (s₁ ∪ s₂) :=
1189-
by { rw union_eq_Union, exact
1190-
d.has_Union (pairwise_disjoint_on_bool.2 h) (bool.forall_bool.2 ⟨h₂, h₁⟩) }
1191-
1192-
lemma has_diff {s₁ s₂ : set α} (h₁ : d.has s₁) (h₂ : d.has s₂) (h : s₂ ⊆ s₁) : d.has (s₁ \ s₂) :=
1193-
begin
1194-
apply d.has_compl_iff.1,
1195-
simp [diff_eq, compl_inter],
1196-
exact d.has_union (d.has_compl h₁) h₂ (λ x ⟨h₁, h₂⟩, h₁ (h h₂)),
1197-
end
1198-
1199-
instance : partial_order (dynkin_system α) :=
1200-
{ le := λ m₁ m₂, m₁.has ≤ m₂.has,
1201-
le_refl := assume a b, le_refl _,
1202-
le_trans := assume a b c, le_trans,
1203-
le_antisymm := assume a b h₁ h₂, ext $ assume s, ⟨h₁ s, h₂ s⟩ }
1204-
1205-
/-- Every measurable space (σ-algebra) forms a Dynkin system -/
1206-
def of_measurable_space (m : measurable_space α) : dynkin_system α :=
1207-
{ has := m.measurable_set',
1208-
has_empty := m.measurable_set_empty,
1209-
has_compl := m.measurable_set_compl,
1210-
has_Union_nat := assume f _ hf, m.measurable_set_Union f hf }
1211-
1212-
lemma of_measurable_space_le_of_measurable_space_iff {m₁ m₂ : measurable_space α} :
1213-
of_measurable_space m₁ ≤ of_measurable_space m₂ ↔ m₁ ≤ m₂ :=
1214-
iff.rfl
1215-
1216-
/-- The least Dynkin system containing a collection of basic sets.
1217-
This inductive type gives the underlying collection of sets. -/
1218-
inductive generate_has (s : set (set α)) : set α → Prop
1219-
| basic : ∀ t ∈ s, generate_has t
1220-
| empty : generate_has ∅
1221-
| compl : ∀ {a}, generate_has a → generate_has aᶜ
1222-
| Union : ∀ {f : ℕ → set α}, pairwise (disjoint on f) →
1223-
(∀ i, generate_has (f i)) → generate_has (⋃ i, f i)
1224-
1225-
lemma generate_has_compl {C : set (set α)} {s : set α} : generate_has C sᶜ ↔ generate_has C s :=
1226-
by { refine ⟨_, generate_has.compl⟩, intro h, convert generate_has.compl h, simp }
1227-
1228-
/-- The least Dynkin system containing a collection of basic sets. -/
1229-
def generate (s : set (set α)) : dynkin_system α :=
1230-
{ has := generate_has s,
1231-
has_empty := generate_has.empty,
1232-
has_compl := assume a, generate_has.compl,
1233-
has_Union_nat := assume f, generate_has.Union }
1234-
1235-
lemma generate_has_def {C : set (set α)} : (generate C).has = generate_has C := rfl
1236-
1237-
instance : inhabited (dynkin_system α) := ⟨generate univ⟩
1238-
1239-
/-- If a Dynkin system is closed under binary intersection, then it forms a `σ`-algebra. -/
1240-
def to_measurable_space (h_inter : ∀ s₁ s₂, d.has s₁ → d.has s₂ → d.has (s₁ ∩ s₂)) :=
1241-
{ measurable_space .
1242-
measurable_set' := d.has,
1243-
measurable_set_empty := d.has_empty,
1244-
measurable_set_compl := assume s h, d.has_compl h,
1245-
measurable_set_Union := assume f hf,
1246-
have ∀ n, d.has (disjointed f n),
1247-
from assume n, disjointed_induct (hf n)
1248-
(assume t i h, h_inter _ _ h $ d.has_compl $ hf i),
1249-
have d.has (⋃ n, disjointed f n), from d.has_Union disjoint_disjointed this,
1250-
by rwa [Union_disjointed] at this }
1251-
1252-
lemma of_measurable_space_to_measurable_space
1253-
(h_inter : ∀ s₁ s₂, d.has s₁ → d.has s₂ → d.has (s₁ ∩ s₂)) :
1254-
of_measurable_space (d.to_measurable_space h_inter) = d :=
1255-
ext $ assume s, iff.rfl
1256-
1257-
/-- If `s` is in a Dynkin system `d`, we can form the new Dynkin system `{s ∩ t | t ∈ d}`. -/
1258-
def restrict_on {s : set α} (h : d.has s) : dynkin_system α :=
1259-
{ has := λ t, d.has (t ∩ s),
1260-
has_empty := by simp [d.has_empty],
1261-
has_compl := assume t hts,
1262-
have tᶜ ∩ s = ((t ∩ s)ᶜ) \ sᶜ,
1263-
from set.ext $ assume x, by { by_cases x ∈ s; simp [h] },
1264-
by { rw [this], exact d.has_diff (d.has_compl hts) (d.has_compl h)
1265-
(compl_subset_compl.mpr $ inter_subset_right _ _) },
1266-
has_Union_nat := assume f hd hf,
1267-
begin
1268-
rw [inter_comm, inter_Union],
1269-
apply d.has_Union_nat,
1270-
{ exact λ i j h x ⟨⟨_, h₁⟩, _, h₂⟩, hd i j h ⟨h₁, h₂⟩ },
1271-
{ simpa [inter_comm] using hf },
1272-
end }
1273-
1274-
lemma generate_le {s : set (set α)} (h : ∀ t ∈ s, d.has t) : generate s ≤ d :=
1275-
λ t ht, ht.rec_on h d.has_empty
1276-
(assume a _ h, d.has_compl h)
1277-
(assume f hd _ hf, d.has_Union hd hf)
1278-
1279-
lemma generate_has_subset_generate_measurable {C : set (set α)} {s : set α}
1280-
(hs : (generate C).has s) : (generate_from C).measurable_set' s :=
1281-
generate_le (of_measurable_space (generate_from C)) (λ t, measurable_set_generate_from) s hs
1282-
1283-
lemma generate_inter {s : set (set α)}
1284-
(hs : is_pi_system s) {t₁ t₂ : set α}
1285-
(ht₁ : (generate s).has t₁) (ht₂ : (generate s).has t₂) : (generate s).has (t₁ ∩ t₂) :=
1286-
have generate s ≤ (generate s).restrict_on ht₂,
1287-
from generate_le _ $ assume s₁ hs₁,
1288-
have (generate s).has s₁, from generate_has.basic s₁ hs₁,
1289-
have generate s ≤ (generate s).restrict_on this,
1290-
from generate_le _ $ assume s₂ hs₂,
1291-
show (generate s).has (s₂ ∩ s₁), from
1292-
(s₂ ∩ s₁).eq_empty_or_nonempty.elim
1293-
(λ h, h.symm ▸ generate_has.empty)
1294-
(λ h, generate_has.basic _ (hs _ _ hs₂ hs₁ h)),
1295-
have (generate s).has (t₂ ∩ s₁), from this _ ht₂,
1296-
show (generate s).has (s₁ ∩ t₂), by rwa [inter_comm],
1297-
this _ ht₁
1298-
1299-
/--
1300-
If we have a collection of sets closed under binary intersections, then the Dynkin system it
1301-
generates is equal to the σ-algebra it generates.
1302-
This result is known as the π-λ theorem.
1303-
A collection of sets closed under binary intersection is called a "π-system" if it is non-empty.
1304-
-/
1305-
lemma generate_from_eq {s : set (set α)} (hs : is_pi_system s) :
1306-
generate_from s = (generate s).to_measurable_space (assume t₁ t₂, generate_inter hs) :=
1307-
le_antisymm
1308-
(generate_from_le $ assume t ht, generate_has.basic t ht)
1309-
(of_measurable_space_le_of_measurable_space_iff.mp $
1310-
by { rw [of_measurable_space_to_measurable_space],
1311-
exact (generate_le _ $ assume t ht, measurable_set_generate_from ht) })
1312-
1313-
end dynkin_system
1314-
1315-
lemma induction_on_inter {C : set α → Prop} {s : set (set α)} [m : measurable_space α]
1316-
(h_eq : m = generate_from s)
1317-
(h_inter : is_pi_system s)
1318-
(h_empty : C ∅) (h_basic : ∀ t ∈ s, C t) (h_compl : ∀ t, measurable_set t → C t → C tᶜ)
1319-
(h_union : ∀ f : ℕ → set α, pairwise (disjoint on f) →
1320-
(∀ i, measurable_set (f i)) → (∀ i, C (f i)) → C (⋃ i, f i)) :
1321-
∀ ⦃t⦄, measurable_set t → C t :=
1322-
have eq : measurable_set = dynkin_system.generate_has s,
1323-
by { rw [h_eq, dynkin_system.generate_from_eq h_inter], refl },
1324-
assume t ht,
1325-
have dynkin_system.generate_has s t, by rwa [eq] at ht,
1326-
this.rec_on h_basic h_empty
1327-
(assume t ht, h_compl t $ by { rw [eq], exact ht })
1328-
(assume f hf ht, h_union f hf $ assume i, by { rw [eq], exact ht _ })
1329-
1330-
end measurable_space
1331-
13321129
namespace filter
13331130

13341131
variables [measurable_space α]

src/measure_theory/outer_measure.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Mario Carneiro
55
-/
66
import analysis.specific_limits
77
import measure_theory.measurable_space
8+
import measure_theory.pi_system
89
import topology.algebra.infinite_sum
910

1011
/-!

0 commit comments

Comments
 (0)