Skip to content

Commit e82ee27

Browse files
committed
feat: countable filtration in a countably generated measurable space (#10945)
In a countably generated measurable space `α`, we can build a sequence of finer and finer finite measurable partitions of the space such that the measurable space is generated by the union of all partitions. This sequence of partitions (`countablePartition α n`) is defined in `MeasureTheory.MeasurableSpace.CountablyGenerated`. This is a new file in which we put the definition of `CountablyGenerated` (which was previously in MeasurableSpace.Basic). In `Probability.Process.CountablyGenerated`, we build the filtration generated by `countablePartition α n` for all `n : ℕ`, which we call `countableFiltration α`. Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
1 parent 46c190e commit e82ee27

File tree

6 files changed

+576
-68
lines changed

6 files changed

+576
-68
lines changed

Mathlib.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,6 +2092,7 @@ import Mathlib.Data.Set.Intervals.UnorderedInterval
20922092
import Mathlib.Data.Set.Intervals.WithBotTop
20932093
import Mathlib.Data.Set.Lattice
20942094
import Mathlib.Data.Set.List
2095+
import Mathlib.Data.Set.MemPartition
20952096
import Mathlib.Data.Set.MulAntidiagonal
20962097
import Mathlib.Data.Set.NAry
20972098
import Mathlib.Data.Set.Opposite
@@ -2826,6 +2827,7 @@ import Mathlib.MeasureTheory.Integral.TorusIntegral
28262827
import Mathlib.MeasureTheory.Integral.VitaliCaratheodory
28272828
import Mathlib.MeasureTheory.MeasurableSpace.Basic
28282829
import Mathlib.MeasureTheory.MeasurableSpace.Card
2830+
import Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated
28292831
import Mathlib.MeasureTheory.MeasurableSpace.Defs
28302832
import Mathlib.MeasureTheory.MeasurableSpace.Invariants
28312833
import Mathlib.MeasureTheory.Measure.AEDisjoint
@@ -3206,6 +3208,7 @@ import Mathlib.Probability.ProbabilityMassFunction.Monad
32063208
import Mathlib.Probability.Process.Adapted
32073209
import Mathlib.Probability.Process.Filtration
32083210
import Mathlib.Probability.Process.HittingTime
3211+
import Mathlib.Probability.Process.PartitionFiltration
32093212
import Mathlib.Probability.Process.Stopping
32103213
import Mathlib.Probability.StrongLaw
32113214
import Mathlib.Probability.Variance

Mathlib/Data/Set/MemPartition.lean

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
/-
2+
Copyright (c) 2024 Rémy Degenne. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Rémy Degenne
5+
-/
6+
import Mathlib.Data.Set.Finite
7+
8+
/-!
9+
# Partitions based on membership of a sequence of sets
10+
11+
Let `f : ℕ → Set α` be a sequence of sets. For `n : ℕ`, we can form the set of points that are in
12+
`f 0 ∪ f 1 ∪ ... ∪ f (n-1)`; then the set of points in `(f 0)ᶜ ∪ f 1 ∪ ... ∪ f (n-1)` and so on for
13+
all 2^n choices of a set or its complement. The at most 2^n sets we obtain form a partition
14+
of `univ : Set α`. We call that partition `memPartition f n` (the membership partition of `f`).
15+
For `n = 0` we set `memPartition f 0 = {univ}`.
16+
17+
The partition `memPartition f (n + 1)` is finer than `memPartition f n`.
18+
19+
## Main definitions
20+
21+
* `memPartition f n`: the membership partition of the first `n` sets in `f`.
22+
* `memPartitionSet`: `memPartitionSet f n x` is the set in the partition `memPartition f n` to
23+
which `x` belongs.
24+
25+
## Main statements
26+
27+
* `disjoint_memPartition`: the sets in `memPartition f n` are disjoint
28+
* `sUnion_memPartition`: the union of the sets in `memPartition f n` is `univ`
29+
* `finite_memPartition`: `memPartition f n` is finite
30+
31+
-/
32+
33+
open Set
34+
35+
variable {α : Type*}
36+
37+
/-- `memPartition f n` is the partition containing at most `2^(n+1)` sets, where each set contains
38+
the points that for all `i` belong to one of `f i` or its complement. -/
39+
def memPartition (f : ℕ → Set α) : ℕ → Set (Set α)
40+
| 0 => {univ}
41+
| n + 1 => {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n}
42+
43+
@[simp]
44+
lemma memPartition_zero (f : ℕ → Set α) : memPartition f 0 = {univ} := rfl
45+
46+
lemma memPartition_succ (f : ℕ → Set α) (n : ℕ) :
47+
memPartition f (n + 1) = {s | ∃ u ∈ memPartition f n, s = u ∩ f n ∨ s = u \ f n} :=
48+
rfl
49+
50+
lemma disjoint_memPartition (f : ℕ → Set α) (n : ℕ) {u v : Set α}
51+
(hu : u ∈ memPartition f n) (hv : v ∈ memPartition f n) (huv : u ≠ v) :
52+
Disjoint u v := by
53+
revert u v
54+
induction n with
55+
| zero =>
56+
intro u v hu hv huv
57+
simp only [Nat.zero_eq, memPartition_zero, mem_insert_iff, mem_singleton_iff] at hu hv
58+
rw [hu, hv] at huv
59+
exact absurd rfl huv
60+
| succ n ih =>
61+
intro u v hu hv huv
62+
rw [memPartition_succ] at hu hv
63+
obtain ⟨u', hu', hu'_eq⟩ := hu
64+
obtain ⟨v', hv', hv'_eq⟩ := hv
65+
rcases hu'_eq with rfl | rfl <;> rcases hv'_eq with rfl | rfl
66+
· refine Disjoint.mono (inter_subset_left _ _) (inter_subset_left _ _) (ih hu' hv' ?_)
67+
exact fun huv' ↦ huv (huv' ▸ rfl)
68+
· exact Disjoint.mono_left (inter_subset_right _ _) Set.disjoint_sdiff_right
69+
· exact Disjoint.mono_right (inter_subset_right _ _) Set.disjoint_sdiff_left
70+
· refine Disjoint.mono (diff_subset _ _) (diff_subset _ _) (ih hu' hv' ?_)
71+
exact fun huv' ↦ huv (huv' ▸ rfl)
72+
73+
@[simp]
74+
lemma sUnion_memPartition (f : ℕ → Set α) (n : ℕ) : ⋃₀ memPartition f n = univ := by
75+
induction n with
76+
| zero => simp
77+
| succ n ih =>
78+
rw [memPartition_succ]
79+
ext x
80+
have : x ∈ ⋃₀ memPartition f n := by simp [ih]
81+
simp only [mem_sUnion, mem_iUnion, mem_insert_iff, mem_singleton_iff, exists_prop, mem_univ,
82+
iff_true] at this ⊢
83+
obtain ⟨t, ht, hxt⟩ := this
84+
by_cases hxf : x ∈ f n
85+
· exact ⟨t ∩ f n, ⟨t, ht, Or.inl rfl⟩, hxt, hxf⟩
86+
· exact ⟨t \ f n, ⟨t, ht, Or.inr rfl⟩, hxt, hxf⟩
87+
88+
lemma finite_memPartition (f : ℕ → Set α) (n : ℕ) : Set.Finite (memPartition f n) := by
89+
induction n with
90+
| zero => simp
91+
| succ n ih =>
92+
rw [memPartition_succ]
93+
have : Finite (memPartition f n) := Set.finite_coe_iff.mp ih
94+
rw [← Set.finite_coe_iff]
95+
simp_rw [setOf_exists, ← exists_prop, setOf_exists, setOf_or]
96+
refine Finite.Set.finite_biUnion (memPartition f n) _ (fun u _ ↦ ?_)
97+
rw [Set.finite_coe_iff]
98+
simp
99+
100+
instance instFinite_memPartition (f : ℕ → Set α) (n : ℕ) : Finite (memPartition f n) :=
101+
Set.finite_coe_iff.mp (finite_memPartition _ _)
102+
103+
open Classical in
104+
/-- The set in `memPartition f n` to which `a : α` belongs. -/
105+
def memPartitionSet (f : ℕ → Set α) : ℕ → α → Set α
106+
| 0 => fun _ ↦ univ
107+
| n + 1 => fun a ↦ if a ∈ f n then memPartitionSet f n a ∩ f n else memPartitionSet f n a \ f n
108+
109+
@[simp]
110+
lemma memPartitionSet_zero (f : ℕ → Set α) (a : α) : memPartitionSet f 0 a = univ := by
111+
simp [memPartitionSet]
112+
113+
lemma memPartitionSet_succ (f : ℕ → Set α) (n : ℕ) (a : α) [Decidable (a ∈ f n)] :
114+
memPartitionSet f (n + 1) a
115+
= if a ∈ f n then memPartitionSet f n a ∩ f n else memPartitionSet f n a \ f n := by
116+
simp [memPartitionSet]
117+
118+
lemma memPartitionSet_mem (f : ℕ → Set α) (n : ℕ) (a : α) :
119+
memPartitionSet f n a ∈ memPartition f n := by
120+
induction n with
121+
| zero => simp [memPartitionSet]
122+
| succ n ih =>
123+
classical
124+
rw [memPartitionSet_succ, memPartition_succ]
125+
refine ⟨memPartitionSet f n a, ?_⟩
126+
split_ifs <;> simp [ih]
127+
128+
lemma mem_memPartitionSet (f : ℕ → Set α) (n : ℕ) (a : α) : a ∈ memPartitionSet f n a := by
129+
induction n with
130+
| zero => simp [memPartitionSet]
131+
| succ n ih =>
132+
classical
133+
rw [memPartitionSet_succ]
134+
split_ifs with h <;> exact ⟨ih, h⟩
135+
136+
lemma memPartitionSet_eq_iff {f : ℕ → Set α} {n : ℕ} (a : α) {s : Set α}
137+
(hs : s ∈ memPartition f n) :
138+
memPartitionSet f n a = s ↔ a ∈ s := by
139+
refine ⟨fun h ↦ h ▸ mem_memPartitionSet f n a, fun h ↦ ?_⟩
140+
by_contra h_ne
141+
have h_disj : Disjoint s (memPartitionSet f n a) :=
142+
disjoint_memPartition f n hs (memPartitionSet_mem f n a) (Ne.symm h_ne)
143+
refine absurd h_disj ?_
144+
rw [not_disjoint_iff_nonempty_inter]
145+
exact ⟨a, h, mem_memPartitionSet f n a⟩
146+
147+
lemma memPartitionSet_of_mem {f : ℕ → Set α} {n : ℕ} {a : α} {s : Set α}
148+
(hs : s ∈ memPartition f n) (ha : a ∈ s) :
149+
memPartitionSet f n a = s :=
150+
(memPartitionSet_eq_iff a hs).mpr ha

Mathlib/MeasureTheory/MeasurableSpace/Basic.lean

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import Mathlib.GroupTheory.Coset
99
import Mathlib.Logic.Equiv.Fin
1010
import Mathlib.MeasureTheory.MeasurableSpace.Defs
1111
import Mathlib.Order.Filter.SmallSets
12-
import Mathlib.Order.Filter.CountableSeparatingOn
1312
import Mathlib.Order.LiminfLimsup
1413
import Mathlib.Data.Set.UnionLift
1514

@@ -1949,73 +1948,6 @@ theorem MeasurableSpace.comap_compl {m' : MeasurableSpace β} [BooleanAlgebra β
19491948
MeasurableSpace.comap_compl (fun _ _ ↦ measurableSet_top) _
19501949
#align measurable_space.comap_not MeasurableSpace.comap_not
19511950

1952-
section CountablyGenerated
1953-
1954-
namespace MeasurableSpace
1955-
1956-
variable (α)
1957-
1958-
/-- We say a measurable space is countably generated
1959-
if it can be generated by a countable set of sets. -/
1960-
class CountablyGenerated [m : MeasurableSpace α] : Prop where
1961-
isCountablyGenerated : ∃ b : Set (Set α), b.Countable ∧ m = generateFrom b
1962-
#align measurable_space.countably_generated MeasurableSpace.CountablyGenerated
1963-
1964-
variable {α}
1965-
1966-
theorem CountablyGenerated.comap [m : MeasurableSpace β] [h : CountablyGenerated β] (f : α → β) :
1967-
@CountablyGenerated α (.comap f m) := by
1968-
rcases h with ⟨⟨b, hbc, rfl⟩⟩
1969-
rw [comap_generateFrom]
1970-
letI := generateFrom (preimage f '' b)
1971-
exact ⟨_, hbc.image _, rfl⟩
1972-
1973-
theorem CountablyGenerated.sup {m₁ m₂ : MeasurableSpace β} (h₁ : @CountablyGenerated β m₁)
1974-
(h₂ : @CountablyGenerated β m₂) : @CountablyGenerated β (m₁ ⊔ m₂) := by
1975-
rcases h₁ with ⟨⟨b₁, hb₁c, rfl⟩⟩
1976-
rcases h₂ with ⟨⟨b₂, hb₂c, rfl⟩⟩
1977-
exact @mk _ (_ ⊔ _) ⟨_, hb₁c.union hb₂c, generateFrom_sup_generateFrom⟩
1978-
1979-
instance (priority := 100) [MeasurableSpace α] [Finite α] : CountablyGenerated α where
1980-
isCountablyGenerated :=
1981-
⟨{s | MeasurableSet s}, Set.to_countable _, generateFrom_measurableSet.symm⟩
1982-
1983-
instance [MeasurableSpace α] [CountablyGenerated α] {p : α → Prop} :
1984-
CountablyGenerated { x // p x } := .comap _
1985-
1986-
instance [MeasurableSpace α] [CountablyGenerated α] [MeasurableSpace β] [CountablyGenerated β] :
1987-
CountablyGenerated (α × β) :=
1988-
.sup (.comap Prod.fst) (.comap Prod.snd)
1989-
1990-
instance [MeasurableSpace α] {s : Set α} [h : CountablyGenerated s] [MeasurableSingletonClass s] :
1991-
HasCountableSeparatingOn α MeasurableSet s := by
1992-
suffices HasCountableSeparatingOn s MeasurableSet univ from this.of_subtype fun _ ↦ id
1993-
rcases h.1 with ⟨b, hbc, hb⟩
1994-
refine ⟨⟨b, hbc, fun t ht ↦ hb.symm ▸ .basic t ht, fun x _ y _ h ↦ ?_⟩⟩
1995-
rw [← forall_generateFrom_mem_iff_mem_iff, ← hb] at h
1996-
simpa using h {y}
1997-
1998-
variable (α)
1999-
2000-
open scoped Classical
2001-
2002-
/-- If a measurable space is countably generated and separates points, it admits a measurable
2003-
injection into the Cantor space `ℕ → Bool` (equipped with the product sigma algebra). -/
2004-
theorem measurable_injection_nat_bool_of_countablyGenerated [MeasurableSpace α]
2005-
[HasCountableSeparatingOn α MeasurableSet univ] :
2006-
∃ f : α → ℕ → Bool, Measurable f ∧ Function.Injective f := by
2007-
rcases exists_seq_separating α MeasurableSet.empty univ with ⟨e, hem, he⟩
2008-
refine ⟨(· ∈ e ·), ?_, ?_⟩
2009-
· rw [measurable_pi_iff]
2010-
refine fun n ↦ measurable_to_bool ?_
2011-
simpa only [preimage, mem_singleton_iff, Bool.decide_iff, setOf_mem_eq] using hem n
2012-
· exact fun x y h ↦ he x trivial y trivial fun n ↦ decide_eq_decide.1 <| congr_fun h _
2013-
#align measurable_space.measurable_injection_nat_bool_of_countably_generated MeasurableSpace.measurable_injection_nat_bool_of_countablyGenerated
2014-
2015-
end MeasurableSpace
2016-
2017-
end CountablyGenerated
2018-
20191951
namespace Filter
20201952

20211953
variable [MeasurableSpace α]

0 commit comments

Comments
 (0)