Skip to content

Commit 886c740

Browse files
committed
feat(Probability/Kernel/Condexp): some properties of condexpKernel (#6109)
`condexpKernel` is a Markov kernel, is strongly measurable and is a.e. equal to the conditional expectation. Co-authored-by: RemyDegenne <Remydegenne@gmail.com>
1 parent 86bb3de commit 886c740

File tree

4 files changed

+99
-46
lines changed

4 files changed

+99
-46
lines changed

Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ theorem congr (hf : AEStronglyMeasurable' m f μ) (hfg : f =ᵐ[μ] g) : AEStron
6060
by obtain ⟨f', hf'_meas, hff'⟩ := hf; exact ⟨f', hf'_meas, hfg.symm.trans hff'⟩
6161
#align measure_theory.ae_strongly_measurable'.congr MeasureTheory.AEStronglyMeasurable'.congr
6262

63+
theorem mono (hf : AEStronglyMeasurable' m f μ) (hm : m ≤ m') : AEStronglyMeasurable' m' f μ := by
64+
obtain ⟨f', hf'_meas, hff'⟩ := hf; exact ⟨f', hf'_meas.mono hm, hff'⟩
65+
6366
theorem add [Add β] [ContinuousAdd β] (hf : AEStronglyMeasurable' m f μ)
6467
(hg : AEStronglyMeasurable' m g μ) : AEStronglyMeasurable' m (f + g) μ := by
6568
rcases hf with ⟨f', h_f'_meas, hff'⟩

Mathlib/MeasureTheory/MeasurableSpace.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ theorem Measurable.mono {ma ma' : MeasurableSpace α} {mb mb' : MeasurableSpace
225225
fun _t ht => ha _ <| hf <| hb _ ht
226226
#align measurable.mono Measurable.mono
227227

228+
theorem measurable_id'' {m mα : MeasurableSpace α} (hm : m ≤ mα) : @Measurable α α mα m id :=
229+
measurable_id.mono le_rfl hm
230+
#align probability_theory.measurable_id'' measurable_id''
231+
228232
-- porting note: todo: add TC `DiscreteMeasurable` + instances
229233

230234
@[measurability]

Mathlib/MeasureTheory/Measure/AEMeasurable.lean

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ We discuss several of its properties that are analogous to properties of measura
1616
-/
1717

1818

19-
open MeasureTheory MeasureTheory.Measure Filter Set Function
20-
21-
open MeasureTheory Filter Classical ENNReal Interval
19+
open MeasureTheory MeasureTheory.Measure Filter Set Function Classical ENNReal
2220

2321
variable {ι α β γ δ R : Type*} {m0 : MeasurableSpace α} [MeasurableSpace β] [MeasurableSpace γ]
2422
[MeasurableSpace δ] {f g : α → β} {μ ν : Measure α}
@@ -41,6 +39,11 @@ theorem aemeasurable_zero_measure : AEMeasurable f (0 : Measure α) := by
4139
exact ⟨fun _ => f default, measurable_const, rfl⟩
4240
#align ae_measurable_zero_measure aemeasurable_zero_measure
4341

42+
theorem aemeasurable_id'' (μ : Measure α) {m : MeasurableSpace α} (hm : m ≤ m0) :
43+
@AEMeasurable α α m m0 id μ :=
44+
@Measurable.aemeasurable α α m0 m id μ (measurable_id'' hm)
45+
#align probability_theory.ae_measurable_id'' aemeasurable_id''
46+
4447
namespace AEMeasurable
4548

4649
theorem mono_measure (h : AEMeasurable f μ) (h' : ν ≤ μ) : AEMeasurable f ν :=

Mathlib/Probability/Kernel/Condexp.lean

Lines changed: 86 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ section AuxLemmas
4141

4242
variable {Ω F : Type*} {m mΩ : MeasurableSpace Ω} {μ : Measure Ω} {f : Ω → F}
4343

44-
-- Porting note: todo: move to `MeasureTheory/MeasurableSpace`, after `Measurable.mono`
45-
theorem measurable_id'' (hm : m ≤ mΩ) : @Measurable Ω Ω mΩ m id :=
46-
measurable_id.mono le_rfl hm
47-
#align probability_theory.measurable_id'' ProbabilityTheory.measurable_id''
48-
49-
-- Porting note: todo: move to `MeasureTheory/MeasurableSpace`, after `Measurable.mono`
50-
theorem aemeasurable_id'' (μ : Measure Ω) (hm : m ≤ mΩ) : @AEMeasurable Ω Ω m mΩ id μ :=
51-
@Measurable.aemeasurable Ω Ω mΩ m id μ (measurable_id'' hm)
52-
#align probability_theory.ae_measurable_id'' ProbabilityTheory.aemeasurable_id''
53-
5444
theorem _root_.MeasureTheory.AEStronglyMeasurable.comp_snd_map_prod_id [TopologicalSpace F]
5545
(hm : m ≤ mΩ) (hf : AEStronglyMeasurable f μ) : AEStronglyMeasurable (fun x : Ω × Ω => f x.2)
5646
(@Measure.map Ω (Ω × Ω) (m.prod mΩ) mΩ (fun ω => (id ω, id ω)) μ) := by
@@ -71,91 +61,144 @@ end AuxLemmas
7161

7262
variable {Ω F : Type*} [TopologicalSpace Ω] {m : MeasurableSpace Ω} [mΩ : MeasurableSpace Ω]
7363
[PolishSpace Ω] [BorelSpace Ω] [Nonempty Ω] {μ : Measure Ω} [IsFiniteMeasure μ]
74-
[NormedAddCommGroup F] {f : Ω → F}
7564

7665
/-- Kernel associated with the conditional expectation with respect to a σ-algebra. It satisfies
7766
`μ[f | m] =ᵐ[μ] fun ω => ∫ y, f y ∂(condexpKernel μ m ω)`.
7867
It is defined as the conditional distribution of the identity given the identity, where the second
79-
identity is understood as a map from `Ω` with the σ-algebra `mΩ` to `Ω` with σ-algebra `m`. -/
68+
identity is understood as a map from `Ω` with the σ-algebra `mΩ` to `Ω` with σ-algebra `m ⊓ mΩ`.
69+
We use `m ⊓ mΩ` instead of `m` to ensure that it is a sub-σ-algebra of `mΩ`. We then use
70+
`kernel.comap` to get a kernel from `m` to `mΩ` instead of from `m ⊓ mΩ` to `mΩ`. -/
8071
noncomputable irreducible_def condexpKernel (μ : Measure Ω) [IsFiniteMeasure μ]
8172
(m : MeasurableSpace Ω) : @kernel Ω Ω m mΩ :=
82-
@condDistrib Ω Ω Ω _ mΩ _ _ _ mΩ m id id μ _
73+
kernel.comap (@condDistrib Ω Ω Ω _ mΩ _ _ _ mΩ (m ⊓ mΩ) id id μ _) id
74+
(measurable_id'' (inf_le_left : m ⊓ mΩ ≤ m))
8375
#align probability_theory.condexp_kernel ProbabilityTheory.condexpKernel
8476

77+
lemma condexpKernel_apply_eq_condDistrib :
78+
condexpKernel μ m ω = @condDistrib Ω Ω Ω _ mΩ _ _ _ mΩ (m ⊓ mΩ) id id μ _ (id ω) := by
79+
simp_rw [condexpKernel, kernel.comap_apply]
80+
81+
instance : IsMarkovKernel (condexpKernel μ m) := by simp only [condexpKernel]; infer_instance
82+
8583
section Measurability
8684

85+
variable [NormedAddCommGroup F] {f : Ω → F}
86+
8787
theorem measurable_condexpKernel {s : Set Ω} (hs : MeasurableSet s) :
8888
Measurable[m] fun ω => condexpKernel μ m ω s := by
89-
rw [condexpKernel]; convert measurable_condDistrib (μ := μ) hs; rw [MeasurableSpace.comap_id]
89+
simp_rw [condexpKernel_apply_eq_condDistrib]
90+
refine Measurable.mono ?_ (inf_le_left : m ⊓ mΩ ≤ m) le_rfl
91+
convert measurable_condDistrib (μ := μ) hs
92+
rw [MeasurableSpace.comap_id]
9093
#align probability_theory.measurable_condexp_kernel ProbabilityTheory.measurable_condexpKernel
9194

95+
theorem stronglyMeasurable_condexpKernel {s : Set Ω} (hs : MeasurableSet s) :
96+
StronglyMeasurable[m] fun ω => condexpKernel μ m ω s :=
97+
Measurable.stronglyMeasurable (measurable_condexpKernel hs)
98+
9299
theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_condexpKernel [NormedSpace ℝ F]
93-
[CompleteSpace F] (hm : m ≤ mΩ) (hf : AEStronglyMeasurable f μ) :
100+
[CompleteSpace F] (hf : AEStronglyMeasurable f μ) :
94101
AEStronglyMeasurable (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ := by
95-
rw [condexpKernel]
96-
exact AEStronglyMeasurable.integral_condDistrib (aemeasurable_id'' μ hm) aemeasurable_id
97-
(hf.comp_snd_map_prod_id hm)
102+
simp_rw [condexpKernel_apply_eq_condDistrib]
103+
exact AEStronglyMeasurable.integral_condDistrib
104+
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
105+
(hf.comp_snd_map_prod_id inf_le_right)
98106
#align measure_theory.ae_strongly_measurable.integral_condexp_kernel MeasureTheory.AEStronglyMeasurable.integral_condexpKernel
99107

100108
theorem aestronglyMeasurable'_integral_condexpKernel [NormedSpace ℝ F] [CompleteSpace F]
101-
(hm : m ≤ mΩ) (hf : AEStronglyMeasurable f μ) :
109+
(hf : AEStronglyMeasurable f μ) :
102110
AEStronglyMeasurable' m (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ := by
103111
rw [condexpKernel]
104-
have h := aestronglyMeasurable'_integral_condDistrib (aemeasurable_id'' μ hm) aemeasurable_id
105-
(hf.comp_snd_map_prod_id hm)
106-
rwa [MeasurableSpace.comap_id] at h
112+
have h := aestronglyMeasurable'_integral_condDistrib
113+
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
114+
(hf.comp_snd_map_prod_id (inf_le_right : m ⊓ mΩ ≤ mΩ))
115+
rw [MeasurableSpace.comap_id] at h
116+
exact AEStronglyMeasurable'.mono h inf_le_left
107117
#align probability_theory.ae_strongly_measurable'_integral_condexp_kernel ProbabilityTheory.aestronglyMeasurable'_integral_condexpKernel
108118

109119
end Measurability
110120

111121
section Integrability
112122

113-
theorem _root_.MeasureTheory.Integrable.condexpKernel_ae (hm : m ≤ mΩ) (hf_int : Integrable f μ) :
123+
variable [NormedAddCommGroup F] {f : Ω → F}
124+
125+
theorem _root_.MeasureTheory.Integrable.condexpKernel_ae (hf_int : Integrable f μ) :
114126
∀ᵐ ω ∂μ, Integrable f (condexpKernel μ m ω) := by
115127
rw [condexpKernel]
116-
exact Integrable.condDistrib_ae (aemeasurable_id'' μ hm) aemeasurable_id
117-
(hf_int.comp_snd_map_prod_id hm)
128+
exact Integrable.condDistrib_ae
129+
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
130+
(hf_int.comp_snd_map_prod_id (inf_le_right : m ⊓ mΩ ≤ mΩ))
118131
#align measure_theory.integrable.condexp_kernel_ae MeasureTheory.Integrable.condexpKernel_ae
119132

120-
theorem _root_.MeasureTheory.Integrable.integral_norm_condexpKernel (hm : m ≤ mΩ)
121-
(hf_int : Integrable f μ) : Integrable (fun ω => ∫ y, ‖f y‖ ∂condexpKernel μ m ω) μ := by
133+
theorem _root_.MeasureTheory.Integrable.integral_norm_condexpKernel (hf_int : Integrable f μ) :
134+
Integrable (fun ω => ∫ y, ‖f y‖ ∂condexpKernel μ m ω) μ := by
122135
rw [condexpKernel]
123-
exact Integrable.integral_norm_condDistrib (aemeasurable_id'' μ hm) aemeasurable_id
124-
(hf_int.comp_snd_map_prod_id hm)
136+
exact Integrable.integral_norm_condDistrib
137+
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
138+
(hf_int.comp_snd_map_prod_id (inf_le_right : m ⊓ mΩ ≤ mΩ))
125139
#align measure_theory.integrable.integral_norm_condexp_kernel MeasureTheory.Integrable.integral_norm_condexpKernel
126140

127141
theorem _root_.MeasureTheory.Integrable.norm_integral_condexpKernel [NormedSpace ℝ F]
128-
[CompleteSpace F] (hm : m ≤ mΩ) (hf_int : Integrable f μ) :
142+
[CompleteSpace F] (hf_int : Integrable f μ) :
129143
Integrable (fun ω => ‖∫ y, f y ∂condexpKernel μ m ω‖) μ := by
130144
rw [condexpKernel]
131-
exact Integrable.norm_integral_condDistrib (aemeasurable_id'' μ hm) aemeasurable_id
132-
(hf_int.comp_snd_map_prod_id hm)
145+
exact Integrable.norm_integral_condDistrib
146+
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
147+
(hf_int.comp_snd_map_prod_id (inf_le_right : m ⊓ mΩ ≤ mΩ))
133148
#align measure_theory.integrable.norm_integral_condexp_kernel MeasureTheory.Integrable.norm_integral_condexpKernel
134149

135150
theorem _root_.MeasureTheory.Integrable.integral_condexpKernel [NormedSpace ℝ F] [CompleteSpace F]
136-
(hm : m ≤ mΩ) (hf_int : Integrable f μ) :
151+
(hf_int : Integrable f μ) :
137152
Integrable (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ := by
138153
rw [condexpKernel]
139-
exact Integrable.integral_condDistrib (aemeasurable_id'' μ hm) aemeasurable_id
140-
(hf_int.comp_snd_map_prod_id hm)
154+
exact Integrable.integral_condDistrib
155+
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
156+
(hf_int.comp_snd_map_prod_id (inf_le_right : m ⊓ mΩ ≤ mΩ))
141157
#align measure_theory.integrable.integral_condexp_kernel MeasureTheory.Integrable.integral_condexpKernel
142158

143-
theorem integrable_toReal_condexpKernel (hm : m ≤ mΩ) {s : Set Ω} (hs : MeasurableSet s) :
159+
theorem integrable_toReal_condexpKernel {s : Set Ω} (hs : MeasurableSet s) :
144160
Integrable (fun ω => (condexpKernel μ m ω s).toReal) μ := by
145161
rw [condexpKernel]
146-
exact integrable_toReal_condDistrib (aemeasurable_id'' μ hm) hs
162+
exact integrable_toReal_condDistrib (aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) hs
147163
#align probability_theory.integrable_to_real_condexp_kernel ProbabilityTheory.integrable_toReal_condexpKernel
148164

149165
end Integrability
150166

167+
lemma condexpKernel_ae_eq_condexp' [IsFiniteMeasure μ] {s : Set Ω} (hs : MeasurableSet s) :
168+
(fun ω ↦ (condexpKernel μ m ω s).toReal) =ᵐ[μ] μ⟦s | m ⊓ mΩ⟧ := by
169+
have h := condDistrib_ae_eq_condexp (μ := μ)
170+
(measurable_id'' (inf_le_right : m ⊓ mΩ ≤ mΩ)) measurable_id hs
171+
simp only [id_eq, ge_iff_le, MeasurableSpace.comap_id, preimage_id_eq] at h
172+
simp_rw [condexpKernel_apply_eq_condDistrib]
173+
exact h
174+
175+
lemma condexpKernel_ae_eq_condexp [IsFiniteMeasure μ]
176+
(hm : m ≤ mΩ) {s : Set Ω} (hs : MeasurableSet s) :
177+
(fun ω ↦ (condexpKernel μ m ω s).toReal) =ᵐ[μ] μ⟦s | m⟧ :=
178+
(condexpKernel_ae_eq_condexp' hs).trans (by rw [inf_of_le_left hm])
179+
180+
lemma condexpKernel_ae_eq_trim_condexp [IsFiniteMeasure μ]
181+
(hm : m ≤ mΩ) {s : Set Ω} (hs : MeasurableSet s) :
182+
(fun ω ↦ (condexpKernel μ m ω s).toReal) =ᵐ[μ.trim hm] μ⟦s | m⟧ := by
183+
rw [ae_eq_trim_iff hm _ stronglyMeasurable_condexp]
184+
· exact condexpKernel_ae_eq_condexp hm hs
185+
· refine Measurable.stronglyMeasurable ?_
186+
exact @Measurable.ennreal_toReal _ m _ (measurable_condexpKernel hs)
187+
188+
theorem condexp_ae_eq_integral_condexpKernel' [NormedAddCommGroup F] {f : Ω → F}
189+
[NormedSpace ℝ F] [CompleteSpace F] (hf_int : Integrable f μ) :
190+
μ[f|m ⊓ mΩ] =ᵐ[μ] fun ω => ∫ y, f y ∂condexpKernel μ m ω := by
191+
have hX : @Measurable Ω Ω mΩ (m ⊓ mΩ) id := measurable_id.mono le_rfl (inf_le_right : m ⊓ mΩ ≤ mΩ)
192+
simp_rw [condexpKernel_apply_eq_condDistrib]
193+
have h := condexp_ae_eq_integral_condDistrib_id hX hf_int
194+
simpa only [MeasurableSpace.comap_id, id_eq] using h
195+
151196
/-- The conditional expectation of `f` with respect to a σ-algebra `m` is almost everywhere equal to
152197
the integral `∫ y, f y ∂(condexpKernel μ m ω)`. -/
153-
theorem condexp_ae_eq_integral_condexpKernel [NormedSpace ℝ F] [CompleteSpace F] (hm : m ≤ mΩ)
154-
(hf_int : Integrable f μ) : μ[f|m] =ᵐ[μ] fun ω => ∫ y, f y ∂condexpKernel μ m ω := by
155-
have hX : @Measurable Ω Ω mΩ m id := measurable_id.mono le_rfl hm
156-
rw [condexpKernel]
157-
refine' EventuallyEq.trans _ (condexp_ae_eq_integral_condDistrib_id hX hf_int)
158-
simp only [MeasurableSpace.comap_id, id.def]; rfl
198+
theorem condexp_ae_eq_integral_condexpKernel [NormedAddCommGroup F] {f : Ω → F}
199+
[NormedSpace ℝ F] [CompleteSpace F] (hm : m ≤ mΩ) (hf_int : Integrable f μ) :
200+
μ[f|m] =ᵐ[μ] fun ω => ∫ y, f y ∂condexpKernel μ m ω :=
201+
((condexp_ae_eq_integral_condexpKernel' hf_int).symm.trans (by rw [inf_of_le_left hm])).symm
159202
#align probability_theory.condexp_ae_eq_integral_condexp_kernel ProbabilityTheory.condexp_ae_eq_integral_condexpKernel
160203

161204
end ProbabilityTheory

0 commit comments

Comments
 (0)