Skip to content

Commit c881294

Browse files
committed
feat: strong law of large numbers for vector-valued random variables (#7218)
We already have the strong law of large numbers for real-valued integrable random variables. We generalize it to general vector-valued integrable random variables. This does not require any second-countability assumptions as integrable functions can by definition be approximated by simple functions, for which the result is deduced from the one-dimensional one. Along the way, we extend a few lemmas in the library from the real case to the vector case, and remove unneeded second-countability assumptions.
1 parent 4d91cd8 commit c881294

File tree

6 files changed

+343
-49
lines changed

6 files changed

+343
-49
lines changed

Mathlib/MeasureTheory/Function/SimpleFunc.lean

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,56 @@ protected theorem induction {α γ} [MeasurableSpace α] [AddMonoid γ] {P : Sim
13181318
· simp [piecewise_eq_of_not_mem _ _ _ hy, -piecewise_eq_indicator]
13191319
#align measure_theory.simple_func.induction MeasureTheory.SimpleFunc.induction
13201320

1321+
/-- In a topological vector space, the addition of a measurable function and a simple function is
1322+
measurable. -/
1323+
theorem _root_.Measurable.add_simpleFunc
1324+
{E : Type*} {_ : MeasurableSpace α} [MeasurableSpace E] [AddGroup E] [MeasurableAdd E]
1325+
{g : α → E} (hg : Measurable g) (f : SimpleFunc α E) :
1326+
Measurable (g + (f : α → E)) := by
1327+
classical
1328+
induction' f using SimpleFunc.induction with c s hs f f' hff' hf hf'
1329+
· simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const,
1330+
SimpleFunc.coe_zero]
1331+
change Measurable (g + s.piecewise (Function.const α c) (0 : α → E))
1332+
rw [← piecewise_same s g, ← piecewise_add]
1333+
exact Measurable.piecewise hs (hg.add_const _) (hg.add_const _)
1334+
· have : (g + ↑(f + f'))
1335+
= (Function.support f).piecewise (g + (f : α → E)) (g + f') := by
1336+
ext x
1337+
by_cases hx : x ∈ Function.support f
1338+
· simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
1339+
Set.piecewise_eq_of_mem _ _ _ hx, _root_.add_right_inj, add_right_eq_self]
1340+
using Set.disjoint_left.1 hff' hx
1341+
· simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
1342+
Set.piecewise_eq_of_not_mem _ _ _ hx, _root_.add_right_inj, add_left_eq_self] using hx
1343+
rw [this]
1344+
exact Measurable.piecewise f.measurableSet_support hf hf'
1345+
1346+
/-- In a topological vector space, the addition of a simple function and a measurable function is
1347+
measurable. -/
1348+
theorem _root_.Measurable.simpleFunc_add
1349+
{E : Type*} {_ : MeasurableSpace α} [MeasurableSpace E] [AddGroup E] [MeasurableAdd E]
1350+
{g : α → E} (hg : Measurable g) (f : SimpleFunc α E) :
1351+
Measurable ((f : α → E) + g) := by
1352+
classical
1353+
induction' f using SimpleFunc.induction with c s hs f f' hff' hf hf'
1354+
· simp only [SimpleFunc.const_zero, SimpleFunc.coe_piecewise, SimpleFunc.coe_const,
1355+
SimpleFunc.coe_zero]
1356+
change Measurable (s.piecewise (Function.const α c) (0 : α → E) + g)
1357+
rw [← piecewise_same s g, ← piecewise_add]
1358+
exact Measurable.piecewise hs (hg.const_add _) (hg.const_add _)
1359+
· have : (↑(f + f') + g)
1360+
= (Function.support f).piecewise ((f : α → E) + g) (f' + g) := by
1361+
ext x
1362+
by_cases hx : x ∈ Function.support f
1363+
· simpa only [coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
1364+
Set.piecewise_eq_of_mem _ _ _ hx, _root_.add_left_inj, add_right_eq_self]
1365+
using Set.disjoint_left.1 hff' hx
1366+
· simpa only [SimpleFunc.coe_add, Pi.add_apply, Function.mem_support, ne_eq, not_not,
1367+
Set.piecewise_eq_of_not_mem _ _ _ hx, _root_.add_left_inj, add_left_eq_self] using hx
1368+
rw [this]
1369+
exact Measurable.piecewise f.measurableSet_support hf hf'
1370+
13211371
end SimpleFunc
13221372

13231373
end MeasureTheory

Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,45 @@ protected theorem smul_const {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [Cont
467467
#align measure_theory.strongly_measurable.smul_const MeasureTheory.StronglyMeasurable.smul_const
468468
#align measure_theory.strongly_measurable.vadd_const MeasureTheory.StronglyMeasurable.vadd_const
469469

470+
/-- In a normed vector space, the addition of a measurable function and a strongly measurable
471+
function is measurable. Note that this is not true without further second-countability assumptions
472+
for the addition of two measurable functions. -/
473+
theorem _root_.Measurable.add_stronglyMeasurable
474+
{α E : Type*} {_ : MeasurableSpace α} [AddGroup E] [TopologicalSpace E]
475+
[MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [PseudoMetrizableSpace E]
476+
{g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
477+
Measurable (g + f) := by
478+
rcases hf with ⟨φ, hφ⟩
479+
have : Tendsto (fun n x ↦ g x + φ n x) atTop (𝓝 (g + f)) :=
480+
tendsto_pi_nhds.2 (fun x ↦ tendsto_const_nhds.add (hφ x))
481+
apply measurable_of_tendsto_metrizable (fun n ↦ ?_) this
482+
exact hg.add_simpleFunc _
483+
484+
/-- In a normed vector space, the subtraction of a measurable function and a strongly measurable
485+
function is measurable. Note that this is not true without further second-countability assumptions
486+
for the subtraction of two measurable functions. -/
487+
theorem _root_.Measurable.sub_stronglyMeasurable
488+
{α E : Type*} {_ : MeasurableSpace α} [AddCommGroup E] [TopologicalSpace E]
489+
[MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [ContinuousNeg E] [PseudoMetrizableSpace E]
490+
{g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
491+
Measurable (g - f) := by
492+
rw [sub_eq_add_neg]
493+
exact hg.add_stronglyMeasurable hf.neg
494+
495+
/-- In a normed vector space, the addition of a strongly measurable function and a measurable
496+
function is measurable. Note that this is not true without further second-countability assumptions
497+
for the addition of two measurable functions. -/
498+
theorem _root_.Measurable.stronglyMeasurable_add
499+
{α E : Type*} {_ : MeasurableSpace α} [AddGroup E] [TopologicalSpace E]
500+
[MeasurableSpace E] [BorelSpace E] [ContinuousAdd E] [PseudoMetrizableSpace E]
501+
{g f : α → E} (hg : Measurable g) (hf : StronglyMeasurable f) :
502+
Measurable (f + g) := by
503+
rcases hf with ⟨φ, hφ⟩
504+
have : Tendsto (fun n x ↦ φ n x + g x) atTop (𝓝 (f + g)) :=
505+
tendsto_pi_nhds.2 (fun x ↦ (hφ x).add tendsto_const_nhds)
506+
apply measurable_of_tendsto_metrizable (fun n ↦ ?_) this
507+
exact hg.simpleFunc_add _
508+
470509
end Arithmetic
471510

472511
section MulAction

Mathlib/MeasureTheory/Function/UniformIntegrable.lean

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -917,23 +917,19 @@ theorem uniformIntegrable_iff [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠
917917
#align measure_theory.uniform_integrable_iff MeasureTheory.uniformIntegrable_iff
918918

919919
/-- The averaging of a uniformly integrable sequence is also uniformly integrable. -/
920-
theorem uniformIntegrable_average (hp : 1 ≤ p) {f : ℕ → α → ℝ} (hf : UniformIntegrable f p μ) :
921-
UniformIntegrable (fun n => (∑ i in Finset.range n, f i) / (n : α → ℝ)) p μ := by
920+
theorem uniformIntegrable_average
921+
{E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
922+
(hp : 1 ≤ p) {f : ℕ → α → E} (hf : UniformIntegrable f p μ) :
923+
UniformIntegrable (fun (n : ℕ) => (n : ℝ)⁻¹ • (∑ i in Finset.range n, f i)) p μ := by
922924
obtain ⟨hf₁, hf₂, hf₃⟩ := hf
923925
refine' ⟨fun n => _, fun ε hε => _, _⟩
924-
· simp_rw [div_eq_mul_inv]
925-
exact (Finset.aestronglyMeasurable_sum' _ fun i _ => hf₁ i).mul
926-
(aestronglyMeasurable_const : AEStronglyMeasurable (fun _ => (↑n : ℝ)⁻¹) μ)
926+
· exact (Finset.aestronglyMeasurable_sum' _ fun i _ => hf₁ i).const_smul _
927927
· obtain ⟨δ, hδ₁, hδ₂⟩ := hf₂ hε
928928
refine' ⟨δ, hδ₁, fun n s hs hle => _⟩
929-
simp_rw [div_eq_mul_inv, Finset.sum_mul, Set.indicator_finset_sum]
930-
refine' le_trans (snorm_sum_le (fun i _ => ((hf₁ i).mul_const (↑n)⁻¹).indicator hs) hp) _
931-
have : ∀ i, s.indicator (f i * (n : α → ℝ)⁻¹) = (↑n : ℝ)⁻¹ • s.indicator (f i) := by
932-
intro i
933-
rw [mul_comm, (_ : (↑n)⁻¹ * f i = fun ω => (↑n : ℝ)⁻¹ • f i ω)]
934-
· rw [Set.indicator_const_smul s (↑n : ℝ)⁻¹ (f i)]
935-
rfl
936-
· rfl
929+
simp_rw [Finset.smul_sum, Set.indicator_finset_sum]
930+
refine' le_trans (snorm_sum_le (fun i _ => ((hf₁ i).const_smul _).indicator hs) hp) _
931+
have : ∀ i, s.indicator ((n : ℝ) ⁻¹ • f i) = (↑n : ℝ)⁻¹ • s.indicator (f i) :=
932+
fun i ↦ indicator_const_smul _ _ _
937933
simp_rw [this, snorm_const_smul, ← Finset.mul_sum, nnnorm_inv, Real.nnnorm_coe_nat]
938934
by_cases hn : (↑(↑n : ℝ≥0)⁻¹ : ℝ≥0∞) = 0
939935
· simp only [hn, zero_mul, zero_le]
@@ -946,13 +942,9 @@ theorem uniformIntegrable_average (hp : 1 ≤ p) {f : ℕ → α → ℝ} (hf :
946942
ENNReal.inv_mul_cancel _ (ENNReal.nat_ne_top _), one_mul]
947943
all_goals simpa only [Ne.def, Nat.cast_eq_zero]
948944
· obtain ⟨C, hC⟩ := hf₃
949-
simp_rw [div_eq_mul_inv, Finset.sum_mul]
950-
refine' ⟨C, fun n => (snorm_sum_le (fun i _ => (hf₁ i).mul_const (↑n)⁻¹) hp).trans _⟩
951-
have : ∀ i, (fun ω => f i ω * (↑n)⁻¹) = (↑n : ℝ)⁻¹ • fun ω => f i ω := by
952-
intro i
953-
ext ω
954-
simp only [mul_comm, Pi.smul_apply, Algebra.id.smul_eq_mul]
955-
simp_rw [this, snorm_const_smul, ← Finset.mul_sum, nnnorm_inv, Real.nnnorm_coe_nat]
945+
simp_rw [Finset.smul_sum]
946+
refine' ⟨C, fun n => (snorm_sum_le (fun i _ => (hf₁ i).const_smul _) hp).trans _⟩
947+
simp_rw [snorm_const_smul, ← Finset.mul_sum, nnnorm_inv, Real.nnnorm_coe_nat]
956948
by_cases hn : (↑(↑n : ℝ≥0)⁻¹ : ℝ≥0∞) = 0
957949
· simp only [hn, zero_mul, zero_le]
958950
refine' le_trans _ (_ : ↑(↑n : ℝ≥0)⁻¹ * (n • C : ℝ≥0∞) ≤ C)
@@ -965,7 +957,14 @@ theorem uniformIntegrable_average (hp : 1 ≤ p) {f : ℕ → α → ℝ} (hf :
965957
rw [ENNReal.coe_smul, nsmul_eq_mul, ← mul_assoc, ENNReal.coe_inv, ENNReal.coe_nat,
966958
ENNReal.inv_mul_cancel _ (ENNReal.nat_ne_top _), one_mul]
967959
all_goals simpa only [Ne.def, Nat.cast_eq_zero]
968-
#align measure_theory.uniform_integrable_average MeasureTheory.uniformIntegrable_average
960+
961+
/-- The averaging of a uniformly integrable real-valued sequence is also uniformly integrable. -/
962+
theorem uniformIntegrable_average_real (hp : 1 ≤ p) {f : ℕ → α → ℝ} (hf : UniformIntegrable f p μ) :
963+
UniformIntegrable (fun n => (∑ i in Finset.range n, f i) / (n : α → ℝ)) p μ := by
964+
convert uniformIntegrable_average hp hf using 2 with n
965+
ext x
966+
simp [div_eq_inv_mul]
967+
#align measure_theory.uniform_integrable_average MeasureTheory.uniformIntegrable_average_real
969968

970969
end UniformIntegrable
971970

Mathlib/MeasureTheory/Integral/Bochner.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,17 @@ theorem tendsto_integral_approxOn_of_measurable_of_range_subset [MeasurableSpace
14451445
exact eventually_of_forall fun x => subset_closure (hs (Set.mem_union_left _ (mem_range_self _)))
14461446
#align measure_theory.tendsto_integral_approx_on_of_measurable_of_range_subset MeasureTheory.tendsto_integral_approxOn_of_measurable_of_range_subset
14471447

1448+
theorem tendsto_integral_norm_approxOn_sub [MeasurableSpace E] [BorelSpace E] {f : α → E}
1449+
(fmeas : Measurable f) (hf : Integrable f μ) [SeparableSpace (range f ∪ {0} : Set E)] :
1450+
Tendsto (fun n ↦ ∫ x, ‖SimpleFunc.approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖ ∂μ)
1451+
atTop (𝓝 0) := by
1452+
convert (tendsto_toReal zero_ne_top).comp (tendsto_approxOn_range_L1_nnnorm fmeas hf) with n
1453+
rw [integral_norm_eq_lintegral_nnnorm]
1454+
· simp
1455+
· apply (SimpleFunc.aestronglyMeasurable _).sub
1456+
apply (stronglyMeasurable_iff_measurable_separable.2 ⟨fmeas, ?_⟩ ).aestronglyMeasurable
1457+
exact (isSeparable_of_separableSpace_subtype (range f ∪ {0})).mono (subset_union_left _ _)
1458+
14481459
variable {ν : Measure α}
14491460

14501461
theorem integral_add_measure {f : α → G} (hμ : Integrable f μ) (hν : Integrable f ν) :

Mathlib/Probability/IdentDistrib.lean

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ protected theorem of_ae_eq {g : α → γ} (hf : AEMeasurable f μ) (heq : f =
120120
map_eq := Measure.map_congr heq }
121121
#align probability_theory.ident_distrib.of_ae_eq ProbabilityTheory.IdentDistrib.of_ae_eq
122122

123+
lemma _root_.MeasureTheory.AEMeasurable.identDistrib_mk
124+
(hf : AEMeasurable f μ) : IdentDistrib f (hf.mk f) μ μ :=
125+
IdentDistrib.of_ae_eq hf hf.ae_eq_mk
126+
127+
lemma _root_.MeasureTheory.AEStronglyMeasurable.identDistrib_mk
128+
[TopologicalSpace γ] [PseudoMetrizableSpace γ] [BorelSpace γ]
129+
(hf : AEStronglyMeasurable f μ) : IdentDistrib f (hf.mk f) μ μ :=
130+
IdentDistrib.of_ae_eq hf.aemeasurable hf.ae_eq_mk
131+
123132
theorem measure_mem_eq (h : IdentDistrib f g μ ν) {s : Set γ} (hs : MeasurableSet s) :
124133
μ (f ⁻¹' s) = ν (g ⁻¹' s) := by
125134
rw [← Measure.map_apply_of_aemeasurable h.aemeasurable_fst hs, ←
@@ -306,7 +315,7 @@ section UniformIntegrable
306315
open TopologicalSpace
307316

308317
variable {E : Type*} [MeasurableSpace E] [NormedAddCommGroup E] [BorelSpace E]
309-
[SecondCountableTopology E] {μ : Measure α} [IsFiniteMeasure μ]
318+
{μ : Measure α} [IsFiniteMeasure μ]
310319

311320
/-- This lemma is superseded by `Memℒp.uniformIntegrable_of_identDistrib` which only requires
312321
`AEStronglyMeasurable`. -/
@@ -318,17 +327,21 @@ theorem Memℒp.uniformIntegrable_of_identDistrib_aux {ι : Type*} {f : ι →
318327
swap; · exact ⟨0, fun i => False.elim (hι <| Nonempty.intro i)⟩
319328
obtain ⟨C, hC₁, hC₂⟩ := hℒp.snorm_indicator_norm_ge_pos_le μ (hfmeas _) hε
320329
refine' ⟨⟨C, hC₁.le⟩, fun i => le_trans (le_of_eq _) hC₂⟩
321-
have : {x : α | (⟨C, hC₁.le⟩ : ℝ≥0) ≤ ‖f i x‖₊}.indicator (f i) =
322-
(fun x : E => if (⟨C, hC₁.le⟩ : ℝ≥0) ≤ ‖x‖₊ then x else 0) ∘ f i := by
330+
have : {x | (⟨C, hC₁.le⟩ : ℝ≥0) ≤ ‖f i x‖₊} = {x | C ≤ ‖f i x‖} := by
331+
ext x
332+
simp_rw [← norm_toNNReal]
333+
exact Real.le_toNNReal_iff_coe_le (norm_nonneg _)
334+
rw [this, ← snorm_norm, ← snorm_norm (Set.indicator _ _)]
335+
simp_rw [norm_indicator_eq_indicator_norm, coe_nnnorm]
336+
let F : E → ℝ := (fun x : E => if (⟨C, hC₁.le⟩ : ℝ≥0) ≤ ‖x‖₊ then ‖x‖ else 0)
337+
have F_meas : Measurable F := by
338+
apply measurable_norm.indicator (measurableSet_le measurable_const measurable_nnnorm)
339+
have : ∀ k, (fun x ↦ Set.indicator {x | C ≤ ‖f k x‖} (fun a ↦ ‖f k a‖) x) = F ∘ f k := by
340+
intro k
323341
ext x
324342
simp only [Set.indicator, Set.mem_setOf_eq]; norm_cast
325-
simp_rw [coe_nnnorm, this]
326-
rw [← snorm_map_measure _ (hf i).aemeasurable_fst, (hf i).map_eq,
327-
snorm_map_measure _ (hf j).aemeasurable_fst]
328-
· rfl
329-
all_goals
330-
exact_mod_cast aestronglyMeasurable_id.indicator
331-
(measurableSet_le measurable_const measurable_nnnorm)
343+
rw [this, this, ← snorm_map_measure F_meas.aestronglyMeasurable (hf i).aemeasurable_fst,
344+
(hf i).map_eq, snorm_map_measure F_meas.aestronglyMeasurable (hf j).aemeasurable_fst]
332345
#align probability_theory.mem_ℒp.uniform_integrable_of_ident_distrib_aux ProbabilityTheory.Memℒp.uniformIntegrable_of_identDistrib_aux
333346

334347
/-- A sequence of identically distributed Lᵖ functions is p-uniformly integrable. -/

0 commit comments

Comments
 (0)