Skip to content

Commit 3534d84

Browse files
Ruben-VandeVeldeScott Morrison
andcommitted
feat: port MeasureTheory.Function.ConditionalExpectation.Unique (#5008)
Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>
1 parent e6f9a50 commit 3534d84

File tree

2 files changed

+220
-0
lines changed

2 files changed

+220
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,6 +2094,7 @@ import Mathlib.MeasureTheory.Function.AEEqOfIntegral
20942094
import Mathlib.MeasureTheory.Function.AEMeasurableOrder
20952095
import Mathlib.MeasureTheory.Function.AEMeasurableSequence
20962096
import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable
2097+
import Mathlib.MeasureTheory.Function.ConditionalExpectation.Unique
20972098
import Mathlib.MeasureTheory.Function.ContinuousMapDense
20982099
import Mathlib.MeasureTheory.Function.ConvergenceInMeasure
20992100
import Mathlib.MeasureTheory.Function.Egorov
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
/-
2+
Copyright (c) 2021 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+
! This file was ported from Lean 3 source module measure_theory.function.conditional_expectation.unique
7+
! leanprover-community/mathlib commit d8bbb04e2d2a44596798a9207ceefc0fb236e41e
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.MeasureTheory.Function.AEEqOfIntegral
12+
import Mathlib.MeasureTheory.Function.ConditionalExpectation.AEMeasurable
13+
14+
/-!
15+
# Uniqueness of the conditional expectation
16+
17+
Two Lp functions `f, g` which are almost everywhere strongly measurable with respect to a σ-algebra
18+
`m` and verify `∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ` for all `m`-measurable sets `s` are equal
19+
almost everywhere. This proves the uniqueness of the conditional expectation, which is not yet
20+
defined in this file but is introduced in
21+
`Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic`.
22+
23+
## Main statements
24+
25+
* `Lp.ae_eq_of_forall_set_integral_eq'`: two `Lp` functions verifying the equality of integrals
26+
defining the conditional expectation are equal.
27+
* `ae_eq_of_forall_set_integral_eq_of_sigma_finite'`: two functions verifying the equality of
28+
integrals defining the conditional expectation are equal almost everywhere.
29+
Requires `[SigmaFinite (μ.trim hm)]`.
30+
31+
-/
32+
33+
set_option linter.uppercaseLean3 false
34+
35+
open scoped ENNReal MeasureTheory
36+
37+
namespace MeasureTheory
38+
39+
variable {α E' F' 𝕜 : Type _} {p : ℝ≥0∞} {m m0 : MeasurableSpace α} {μ : Measure α} [IsROrC 𝕜]
40+
-- 𝕜 for ℝ or ℂ
41+
-- E' for an inner product space on which we compute integrals
42+
[NormedAddCommGroup E']
43+
[InnerProductSpace 𝕜 E'] [CompleteSpace E'] [NormedSpace ℝ E']
44+
-- F' for integrals on a Lp submodule
45+
[NormedAddCommGroup F']
46+
[NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F']
47+
48+
section UniquenessOfConditionalExpectation
49+
50+
/-! ## Uniqueness of the conditional expectation -/
51+
52+
theorem lpMeas.ae_eq_zero_of_forall_set_integral_eq_zero (hm : m ≤ m0) (f : lpMeas E' 𝕜 m p μ)
53+
(hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
54+
-- Porting note: needed to add explicit casts in the next two hypotheses
55+
(hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn (f : Lp E' p μ) s μ)
56+
(hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, (f : Lp E' p μ) x ∂μ = 0) :
57+
f =ᵐ[μ] (0 : α → E') := by
58+
obtain ⟨g, hg_sm, hfg⟩ := lpMeas.ae_fin_strongly_measurable' hm f hp_ne_zero hp_ne_top
59+
refine' hfg.trans _
60+
-- Porting note: added
61+
unfold Filter.EventuallyEq at hfg
62+
refine' ae_eq_zero_of_forall_set_integral_eq_of_finStronglyMeasurable_trim hm _ _ hg_sm
63+
· intro s hs hμs
64+
have hfg_restrict : f =ᵐ[μ.restrict s] g := ae_restrict_of_ae hfg
65+
rw [IntegrableOn, integrable_congr hfg_restrict.symm]
66+
exact hf_int_finite s hs hμs
67+
· intro s hs hμs
68+
have hfg_restrict : f =ᵐ[μ.restrict s] g := ae_restrict_of_ae hfg
69+
rw [integral_congr_ae hfg_restrict.symm]
70+
exact hf_zero s hs hμs
71+
#align measure_theory.Lp_meas.ae_eq_zero_of_forall_set_integral_eq_zero MeasureTheory.lpMeas.ae_eq_zero_of_forall_set_integral_eq_zero
72+
73+
variable (𝕜)
74+
75+
theorem Lp.ae_eq_zero_of_forall_set_integral_eq_zero' (hm : m ≤ m0) (f : Lp E' p μ)
76+
(hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
77+
(hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
78+
(hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → (∫ x in s, f x ∂μ) = 0)
79+
(hf_meas : AEStronglyMeasurable' m f μ) : f =ᵐ[μ] 0 := by
80+
let f_meas : lpMeas E' 𝕜 m p μ := ⟨f, hf_meas⟩
81+
-- Porting note: `simp only` does not call `rfl` to try to close the goal. See https://github.com/leanprover-community/mathlib4/issues/5025
82+
have hf_f_meas : f =ᵐ[μ] f_meas := by simp only [Subtype.coe_mk]; rfl
83+
refine' hf_f_meas.trans _
84+
refine' lpMeas.ae_eq_zero_of_forall_set_integral_eq_zero hm f_meas hp_ne_zero hp_ne_top _ _
85+
· intro s hs hμs
86+
have hfg_restrict : f =ᵐ[μ.restrict s] f_meas := ae_restrict_of_ae hf_f_meas
87+
rw [IntegrableOn, integrable_congr hfg_restrict.symm]
88+
exact hf_int_finite s hs hμs
89+
· intro s hs hμs
90+
have hfg_restrict : f =ᵐ[μ.restrict s] f_meas := ae_restrict_of_ae hf_f_meas
91+
rw [integral_congr_ae hfg_restrict.symm]
92+
exact hf_zero s hs hμs
93+
#align measure_theory.Lp.ae_eq_zero_of_forall_set_integral_eq_zero' MeasureTheory.Lp.ae_eq_zero_of_forall_set_integral_eq_zero'
94+
95+
/-- **Uniqueness of the conditional expectation** -/
96+
theorem Lp.ae_eq_of_forall_set_integral_eq' (hm : m ≤ m0) (f g : Lp E' p μ) (hp_ne_zero : p ≠ 0)
97+
(hp_ne_top : p ≠ ∞) (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
98+
(hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
99+
(hfg : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → (∫ x in s, f x ∂μ) = ∫ x in s, g x ∂μ)
100+
(hf_meas : AEStronglyMeasurable' m f μ) (hg_meas : AEStronglyMeasurable' m g μ) :
101+
f =ᵐ[μ] g := by
102+
suffices h_sub : ⇑(f - g) =ᵐ[μ] 0
103+
· rw [← sub_ae_eq_zero]; exact (Lp.coeFn_sub f g).symm.trans h_sub
104+
have hfg' : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → (∫ x in s, (f - g) x ∂μ) = 0 := by
105+
intro s hs hμs
106+
rw [integral_congr_ae (ae_restrict_of_ae (Lp.coeFn_sub f g))]
107+
rw [integral_sub' (hf_int_finite s hs hμs) (hg_int_finite s hs hμs)]
108+
exact sub_eq_zero.mpr (hfg s hs hμs)
109+
have hfg_int : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn (⇑(f - g)) s μ := by
110+
intro s hs hμs
111+
rw [IntegrableOn, integrable_congr (ae_restrict_of_ae (Lp.coeFn_sub f g))]
112+
exact (hf_int_finite s hs hμs).sub (hg_int_finite s hs hμs)
113+
have hfg_meas : AEStronglyMeasurable' m (⇑(f - g)) μ :=
114+
AEStronglyMeasurable'.congr (hf_meas.sub hg_meas) (Lp.coeFn_sub f g).symm
115+
exact
116+
Lp.ae_eq_zero_of_forall_set_integral_eq_zero' 𝕜 hm (f - g) hp_ne_zero hp_ne_top hfg_int hfg'
117+
hfg_meas
118+
#align measure_theory.Lp.ae_eq_of_forall_set_integral_eq' MeasureTheory.Lp.ae_eq_of_forall_set_integral_eq'
119+
120+
variable {𝕜}
121+
122+
theorem ae_eq_of_forall_set_integral_eq_of_sigmaFinite' (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
123+
{f g : α → F'} (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
124+
(hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
125+
(hfg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → (∫ x in s, f x ∂μ) = ∫ x in s, g x ∂μ)
126+
(hfm : AEStronglyMeasurable' m f μ) (hgm : AEStronglyMeasurable' m g μ) : f =ᵐ[μ] g := by
127+
rw [← ae_eq_trim_iff_of_aeStronglyMeasurable' hm hfm hgm]
128+
have hf_mk_int_finite :
129+
∀ s, MeasurableSet[m] s → μ.trim hm s < ∞ → @IntegrableOn _ _ m _ (hfm.mk f) s (μ.trim hm) := by
130+
intro s hs hμs
131+
rw [trim_measurableSet_eq hm hs] at hμs
132+
-- Porting note: `rw [IntegrableOn]` fails with
133+
-- synthesized type class instance is not definitionally equal to expression inferred by typing
134+
-- rules, synthesized m0 inferred m
135+
unfold IntegrableOn
136+
rw [restrict_trim hm _ hs]
137+
refine' Integrable.trim hm _ hfm.stronglyMeasurable_mk
138+
exact Integrable.congr (hf_int_finite s hs hμs) (ae_restrict_of_ae hfm.ae_eq_mk)
139+
have hg_mk_int_finite :
140+
∀ s, MeasurableSet[m] s → μ.trim hm s < ∞ → @IntegrableOn _ _ m _ (hgm.mk g) s (μ.trim hm) := by
141+
intro s hs hμs
142+
rw [trim_measurableSet_eq hm hs] at hμs
143+
-- Porting note: `rw [IntegrableOn]` fails with
144+
-- synthesized type class instance is not definitionally equal to expression inferred by typing
145+
-- rules, synthesized m0 inferred m
146+
unfold IntegrableOn
147+
rw [restrict_trim hm _ hs]
148+
refine' Integrable.trim hm _ hgm.stronglyMeasurable_mk
149+
exact Integrable.congr (hg_int_finite s hs hμs) (ae_restrict_of_ae hgm.ae_eq_mk)
150+
have hfg_mk_eq :
151+
∀ s : Set α,
152+
MeasurableSet[m] s →
153+
μ.trim hm s < ∞ → (∫ x in s, hfm.mk f x ∂μ.trim hm) = ∫ x in s, hgm.mk g x ∂μ.trim hm := by
154+
intro s hs hμs
155+
rw [trim_measurableSet_eq hm hs] at hμs
156+
rw [restrict_trim hm _ hs, ← integral_trim hm hfm.stronglyMeasurable_mk, ←
157+
integral_trim hm hgm.stronglyMeasurable_mk,
158+
integral_congr_ae (ae_restrict_of_ae hfm.ae_eq_mk.symm),
159+
integral_congr_ae (ae_restrict_of_ae hgm.ae_eq_mk.symm)]
160+
exact hfg_eq s hs hμs
161+
exact ae_eq_of_forall_set_integral_eq_of_sigmaFinite hf_mk_int_finite hg_mk_int_finite hfg_mk_eq
162+
#align measure_theory.ae_eq_of_forall_set_integral_eq_of_sigma_finite' MeasureTheory.ae_eq_of_forall_set_integral_eq_of_sigmaFinite'
163+
164+
end UniquenessOfConditionalExpectation
165+
166+
section IntegralNormLE
167+
168+
variable {s : Set α}
169+
170+
/-- Let `m` be a sub-σ-algebra of `m0`, `f` a `m0`-measurable function and `g` a `m`-measurable
171+
function, such that their integrals coincide on `m`-measurable sets with finite measure.
172+
Then `∫ x in s, ‖g x‖ ∂μ ≤ ∫ x in s, ‖f x‖ ∂μ` on all `m`-measurable sets with finite measure. -/
173+
theorem integral_norm_le_of_forall_fin_meas_integral_eq (hm : m ≤ m0) {f g : α → ℝ}
174+
(hf : StronglyMeasurable f) (hfi : IntegrableOn f s μ) (hg : StronglyMeasurable[m] g)
175+
(hgi : IntegrableOn g s μ)
176+
(hgf : ∀ t, MeasurableSet[m] t → μ t < ∞ → (∫ x in t, g x ∂μ) = ∫ x in t, f x ∂μ)
177+
(hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) : (∫ x in s, ‖g x‖ ∂μ) ≤ ∫ x in s, ‖f x‖ ∂μ := by
178+
rw [integral_norm_eq_pos_sub_neg hgi, integral_norm_eq_pos_sub_neg hfi]
179+
have h_meas_nonneg_g : MeasurableSet[m] {x | 0 ≤ g x} :=
180+
(@stronglyMeasurable_const _ _ m _ _).measurableSet_le hg
181+
have h_meas_nonneg_f : MeasurableSet {x | 0 ≤ f x} :=
182+
stronglyMeasurable_const.measurableSet_le hf
183+
have h_meas_nonpos_g : MeasurableSet[m] {x | g x ≤ 0} :=
184+
hg.measurableSet_le (@stronglyMeasurable_const _ _ m _ _)
185+
have h_meas_nonpos_f : MeasurableSet {x | f x ≤ 0} :=
186+
hf.measurableSet_le stronglyMeasurable_const
187+
refine' sub_le_sub _ _
188+
· rw [Measure.restrict_restrict (hm _ h_meas_nonneg_g), Measure.restrict_restrict h_meas_nonneg_f,
189+
hgf _ (@MeasurableSet.inter α m _ _ h_meas_nonneg_g hs)
190+
((measure_mono (Set.inter_subset_right _ _)).trans_lt (lt_top_iff_ne_top.mpr hμs)),
191+
← Measure.restrict_restrict (hm _ h_meas_nonneg_g), ←
192+
Measure.restrict_restrict h_meas_nonneg_f]
193+
exact set_integral_le_nonneg (hm _ h_meas_nonneg_g) hf hfi
194+
· rw [Measure.restrict_restrict (hm _ h_meas_nonpos_g), Measure.restrict_restrict h_meas_nonpos_f,
195+
hgf _ (@MeasurableSet.inter α m _ _ h_meas_nonpos_g hs)
196+
((measure_mono (Set.inter_subset_right _ _)).trans_lt (lt_top_iff_ne_top.mpr hμs)),
197+
← Measure.restrict_restrict (hm _ h_meas_nonpos_g), ←
198+
Measure.restrict_restrict h_meas_nonpos_f]
199+
exact set_integral_nonpos_le (hm _ h_meas_nonpos_g) hf hfi
200+
#align measure_theory.integral_norm_le_of_forall_fin_meas_integral_eq MeasureTheory.integral_norm_le_of_forall_fin_meas_integral_eq
201+
202+
/-- Let `m` be a sub-σ-algebra of `m0`, `f` a `m0`-measurable function and `g` a `m`-measurable
203+
function, such that their integrals coincide on `m`-measurable sets with finite measure.
204+
Then `∫⁻ x in s, ‖g x‖₊ ∂μ ≤ ∫⁻ x in s, ‖f x‖₊ ∂μ` on all `m`-measurable sets with finite
205+
measure. -/
206+
theorem lintegral_nnnorm_le_of_forall_fin_meas_integral_eq (hm : m ≤ m0) {f g : α → ℝ}
207+
(hf : StronglyMeasurable f) (hfi : IntegrableOn f s μ) (hg : StronglyMeasurable[m] g)
208+
(hgi : IntegrableOn g s μ)
209+
(hgf : ∀ t, MeasurableSet[m] t → μ t < ∞ → (∫ x in t, g x ∂μ) = ∫ x in t, f x ∂μ)
210+
(hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) : (∫⁻ x in s, ‖g x‖₊ ∂μ) ≤ ∫⁻ x in s, ‖f x‖₊ ∂μ := by
211+
rw [← ofReal_integral_norm_eq_lintegral_nnnorm hfi, ←
212+
ofReal_integral_norm_eq_lintegral_nnnorm hgi, ENNReal.ofReal_le_ofReal_iff]
213+
· exact integral_norm_le_of_forall_fin_meas_integral_eq hm hf hfi hg hgi hgf hs hμs
214+
· exact integral_nonneg fun x => norm_nonneg _
215+
#align measure_theory.lintegral_nnnorm_le_of_forall_fin_meas_integral_eq MeasureTheory.lintegral_nnnorm_le_of_forall_fin_meas_integral_eq
216+
217+
end IntegralNormLE
218+
219+
end MeasureTheory

0 commit comments

Comments
 (0)