Stat.EmpiricalProcess
Empirical-process theory: Rademacher complexities, maximal inequalities, moduli of continuity, and uniform laws for function classes.
Basic 5 core · 0 supporting This file introduces the empirical-process vocabulary for uniform laws of large numbers over indexed classes of real-valued functions. ★ WeakGlivenkoCantelli★ HasL1Bracketing
Empirical Process Basics
This file introduces the empirical-process vocabulary for uniform laws of large
numbers over indexed classes of real-valued functions. It defines
IIDSample.empiricalProcess, IIDSample.supDeviation, the weak uniform law
predicate WeakGlivenkoCantelli, the finite-bracketing structure L1Bracketing,
and the arbitrary-small-bracketing hypothesis HasL1Bracketing consumed by the
Glivenko-Cantelli and M-estimator consistency files. The unqualified name
GlivenkoCantelli is reserved for the almost-sure version, which has not yet
been formalized.
The empirical process is the root-sample-size-scaled difference between the empirical and population means of one function from an indexed class, evaluated on an i.i.d. sample of size. Its ambient spaces and measures determine the sample law and the population integral.
The supremum deviation statistic records the largest absolute gap between empirical and population means across a real-valued function class, using the first n observations of an i.i.d. sample. The ambient spaces and measures fix the sampling and population laws.
The weak Glivenko--Cantelli property says that the probability of any member of a real-valued function class having a fixed-size empirical-mean error along an i.i.d. sample tends to zero. The ambient spaces and measures specify the sample and population laws.
Definition (Lean source)
A finite L¹(P) ε-bracketing of a real-valued function class consists of finitely many integrable lower and upper endpoints, a common full-measure support on which every class member is sandwiched by its assigned bracket, and an integrated absolute bracket width at most ε.
Definition (Lean source)
The arbitrarily fine finite L¹-bracketing property says that a real-valued function class on an indexed measurable space admits finite brackets of every positive width under the population measure, with all sandwiches valid on one common full-measure set.
Definition (Lean source)
CrossFitRate 2 core · 12 supporting This file provides reusable stochastic-order algebra and centered empirical-mean rate bounds. ★ isBigOp_centered_crossFit_sum★ sampleMean_sub_isBigOp
This file provides reusable stochastic-order algebra and centered empirical-mean
rate bounds. It extends IsBigOp with monotonicity, scaling, sum, finite-sum,
and product rules; proves IsBigOp.of_sq_lintegral_le, a Markov/Chebyshev
primitive from deterministic second-moment envelopes; proves the cross-fit fold
rate isBigOp_centered_crossFit_sum; and gives the i.i.d. sample-mean
corollaries IIDSample.sampleMean_sub_sq_lintegral_le,
IIDSample.sampleMean_sub_meas_ge_le, and IIDSample.sampleMean_sub_isBigOp.
Cross-fit empirical-increment rate. Given observations W i, each of which is measurable, grouped into evaluation folds s n, each nonempty, and training σ-algebras m_A n, each contained in the ambient σ-algebra on the sample space such that the training σ-algebra m_A n is independent of the observations indexed by the fold s n and those fold observations are, conditionally, i.i.d. draws from P: for a score g n that viewed jointly in the sample point and its argument is measurable with respect to the training σ-algebra m_A n (the cross-fitting case of a fixed integrand evaluated at a nuisance estimated on the other folds) and is square-integrable under P at every sample point, and for any deterministic sequence Vn that is nonnegative everywhere and eventually positive that dominates the average, over the training draw, of the squared L²(P)-norm of g n, the centered and rescaled evaluation-fold average of g n is stochastically bounded at the rate .
Formal statement
Proof (Lean source)
Unconditional O_p rate (Lemma A). For an i.i.d. sample S and a statistic f that is measurable and square-integrable under the sampling distribution P, with strictly positive second moment, the sample mean over the first n observations, centered at the population mean , is stochastically bounded at the rate : it is :
Formal statement
Proof (Lean source)
12 supporting declarations (lemmas, instances)
-
const_rate_collapsetheorem — Collapse a constant rate to 1. For a *fixed* nonnegative N, O_p(fun _ => N) is O_p(fun _ => 1): a constant scale only changes the witness M. Used to normalize the fold-sum O_p bounds to the canonical unit rate consumed by the cross-fitted DML proofs.hypothesesconclusionIsBigOp Xn (fun _ => (1 : ℝ)) μProof (Lean source)
theorem IsBigOp.const_rate_collapse {N : ℝ} (hN : 0 ≤ N) (h : IsBigOp Xn (fun _ => N) μ) : IsBigOp Xn (fun _ => (1 : ℝ)) μ := by intro δ hδ obtain ⟨M, hM, htail⟩ := h δ hδ refine ⟨M * N + 1, by positivity, ?_⟩ filter_upwards [htail] with n hn refine (measure_mono fun ω hω => ?_).trans hn change M * N ≤ ‖Xn n ω‖ exact (by simpa using hω : M * N + 1 ≤ ‖Xn n ω‖).trans' (by linarith) -
const_multheorem — Constant multiple. If Xₙ = O_p(rₙ) then c · Xₙ = O_p(rₙ) for any fixed scalar c.hypothesesconclusionIsBigOp (fun n ω => c * Xn n ω) rn μProof (Lean source)
theorem IsBigOp.const_mul (c : ℝ) (h : IsBigOp Xn rn μ) : IsBigOp (fun n ω => c * Xn n ω) rn μ := by intro δ hδ obtain ⟨M, hM, htail⟩ := h δ hδ by_cases hc : c = 0 · refine ⟨M, hM, ?_⟩ filter_upwards [htail] with n hn refine (measure_mono fun ω hω => ?_).trans hn have hω' : M * rn n ≤ 0 := by simpa [hc] using hω exact hω'.trans (norm_nonneg (Xn n ω)) · refine ⟨|c| * M, mul_pos (abs_pos.mpr hc) hM, ?_⟩ filter_upwards [htail] with n hn have hset : {ω | (|c| * M) * rn n ≤ ‖c * Xn n ω‖} = {ω | M * rn n ≤ ‖Xn n ω‖} := by ext ω simp only [Set.mem_setOf_eq, Real.norm_eq_abs, abs_mul] constructor <;> intro hω · nlinarith [abs_pos.mpr hc] · simpa only [mul_assoc] using mul_le_mul_of_nonneg_left hω (abs_nonneg c) rw [hset] exact hn -
add'theorem — Additivity at the sum rate. O_p(rₙ) + O_p(sₙ) = O_p(rₙ + sₙ), for nonnegative rates. (IsBigOp.add is the special case rₙ = sₙ.)hypothesesrn :sharedℕ → ℝsn :sharedℕ → ℝhrn :∀ n, 0 ≤ rn nhsn :∀ n, 0 ≤ sn nhX :IsBigOp Xn rn μhY :IsBigOp Yn sn μconclusionIsBigOp (fun n ω => Xn n ω + Yn n ω) (fun n => rn n + sn n) μProof (Lean source)
theorem IsBigOp.add' (hrn : ∀ n, 0 ≤ rn n) (hsn : ∀ n, 0 ≤ sn n) (hX : IsBigOp Xn rn μ) (hY : IsBigOp Yn sn μ) : IsBigOp (fun n ω => Xn n ω + Yn n ω) (fun n => rn n + sn n) μ := by apply Modes.BoundedInProbability.add · exact IsBigOp.mono_rate (fun n => by linarith [hsn n]) hX · exact IsBigOp.mono_rate (fun n => by linarith [hrn n]) hY -
zerotheorem — The constant-zero sequence is O_p(rₙ) for an eventually positive rate.hypothesesconclusionIsBigOp (fun (_ : ℕ) (_ : Ω) => (0 : ℝ)) rn μ -
finset_sumtheorem — A finite sum of O_p(rₙ) sequences is O_p(rₙ) (same rate; constants absorb).hypothesesrn :sharedℕ → ℝι :Type*s :Finset ιX :ι → ℕ → Ω → ℝhrn :∀ᶠ n in atTop, 0 < rn nh :∀ i ∈ s, IsBigOp (X i) rn μconclusionIsBigOp (fun n ω => ∑ i ∈ s, X i n ω) rn μProof (Lean source)
theorem IsBigOp.finset_sum {ι : Type*} (s : Finset ι) {X : ι → ℕ → Ω → ℝ} (hrn : ∀ᶠ n in atTop, 0 < rn n) (h : ∀ i ∈ s, IsBigOp (X i) rn μ) : IsBigOp (fun n ω => ∑ i ∈ s, X i n ω) rn μ := by classical induction s using Finset.induction with | empty => have hcast : (fun (n : ℕ) (ω : Ω) => ∑ i ∈ (∅ : Finset ι), X i n ω) = fun _ _ => (0 : ℝ) := by ext n ω; simp rw [hcast] exact IsBigOp.zero hrn | insert i s hi ih => have hisum : IsBigOp (fun n ω => X i n ω + ∑ j ∈ s, X j n ω) rn μ := IsBigOp.add (h i (Finset.mem_insert_self i s)) (ih (fun j hj => h j (Finset.mem_insert_of_mem hj))) refine IsBigOp.of_abs_le (Yn := fun n ω => X i n ω + ∑ j ∈ s, X j n ω) ?_ hisum intro n ω rw [Finset.sum_insert hi] -
multheorem — Product rule for stochastic big-O. If Xₙ = O_p(rₙ) and Yₙ = O_p(sₙ), then XₙYₙ = O_p(rₙsₙ).hypothesesconclusionIsBigOp (fun n ω => Xn n ω * Yn n ω) (fun n => rn n * sn n) μProof (Lean source)
theorem IsBigOp.mul (hX : IsBigOp Xn rn μ) (hY : IsBigOp Yn sn μ) : IsBigOp (fun n ω => Xn n ω * Yn n ω) (fun n => rn n * sn n) μ := by intro δ hδ by_cases hδtop : δ = ⊤ · exact ⟨1, one_pos, by simp [hδtop]⟩ have hhalf : 0 < δ / 2 := ENNReal.div_pos hδ.ne' (by norm_num) obtain ⟨M, hM, hXM⟩ := hX (δ / 2) hhalf obtain ⟨N, hN, hYN⟩ := hY (δ / 2) hhalf refine ⟨M * N, mul_pos hM hN, ?_⟩ filter_upwards [hXM, hYN] with n hXn hYn calc μ {ω | (M * N) * (rn n * sn n) ≤ ‖Xn n ω * Yn n ω‖} ≤ μ ({ω | M * rn n ≤ ‖Xn n ω‖} ∪ {ω | N * sn n ≤ ‖Yn n ω‖}) := by refine measure_mono fun ω hω => ?_ by_contra hnot have hnotX : ¬M * rn n ≤ ‖Xn n ω‖ := fun h => hnot (inl h) have hnotY : ¬N * sn n ≤ ‖Yn n ω‖ := fun h => hnot (inr h) have hprod : ‖Xn n ω * Yn n ω‖ < (M * N) * (rn n * sn n) := calc ‖Xn n ω * Yn n ω‖ ≤ ‖Xn n ω‖ * ‖Yn n ω‖ := norm_mul_le _ _ _ < (M * rn n) * (N * sn n) := mul_lt_mul'' (lt_of_not_ge hnotX) (lt_of_not_ge hnotY) (norm_nonneg _) (norm_nonneg _) _ = (M * N) * (rn n * sn n) := by ring exact (not_lt_of_ge hω) hprod _ ≤ μ {ω | M * rn n ≤ ‖Xn n ω‖} + μ {ω | N * sn n ≤ ‖Yn n ω‖} := measure_union_le _ _ _ ≤ δ / 2 + δ / 2 := add_le_add hXn hYn _ = δ := ENNReal.add_halves δ -
of_sq_lintegral_letheorem — Markov second-moment ⇒ O_p. If each Xₙ is μ-a.e.-measurable and its second moment is bounded by a deterministic envelope, ∫⁻ (Xₙ ω)² dμ ≤ Vₙ with 0 ≤ Vₙ and Vₙ > 0 eventually, then Xₙ = O_p(√Vₙ).hypothesesProof (Lean source)
theorem IsBigOp.of_sq_lintegral_le {Vn : ℕ → ℝ} (hX : ∀ n, AEMeasurable (Xn n) μ) (hVn : ∀ n, 0 ≤ Vn n) (hVn_pos : ∀ᶠ n in atTop, 0 < Vn n) (hbound : ∀ n, ∫⁻ ω, ofReal ((Xn n ω) ^ 2) ∂μ ≤ ofReal (Vn n)) : IsBigOp Xn (fun n => sqrt (Vn n)) μ := by intro δ hδ by_cases hδtop : δ = ⊤ · exact ⟨1, one_pos, by simp [hδtop]⟩ let ε : ℝ := δ.toReal have hε : 0 < ε := ENNReal.toReal_pos hδ.ne' hδtop set Mε : ℝ := sqrt (1 / ε) with hMε_def have hMε_pos : 0 < Mε := by rw [hMε_def] exact Real.sqrt_pos.mpr (by positivity) have hMε_sq_pos : 0 < Mε ^ 2 := pow_pos hMε_pos 2 have hMε_sq : Mε ^ 2 = 1 / ε := by rw [hMε_def, Real.sq_sqrt] positivity have hMε_inv_sq : 1 / (Mε ^ 2) = ε := by rw [hMε_sq] field_simp [hε.ne'] refine ⟨Mε, hMε_pos, ?_⟩ have hper_n : ∀ᶠ n in atTop, μ {ω | Mε * sqrt (Vn n) ≤ |Xn n ω|} ≤ ofReal ε := by filter_upwards [hVn_pos] with n hVpos set Y : Ω → ℝ := Xn n with hY_def have hY_aemeas : AEMeasurable Y μ := by simpa [Y] using hX n have hY_sq_aemeas : AEMeasurable (fun ω => ofReal ((Y ω) ^ 2)) μ := by fun_prop have hden_pos : 0 < Mε ^ 2 * Vn n := mul_pos hMε_sq_pos hVpos have hden_ne_zero : ofReal (Mε ^ 2 * Vn n) ≠ 0 := by rw [ENNReal.ofReal_ne_zero_iff] exact hden_pos have hden_ne_top : ofReal (Mε ^ 2 * Vn n) ≠ ⊤ := ENNReal.ofReal_ne_top have hsubset : {ω | Mε * sqrt (Vn n) ≤ |Y ω|} ⊆ {ω | ofReal (Mε ^ 2 * Vn n) ≤ ofReal ((Y ω) ^ 2)} := by intro ω hω have hleft_nonneg : 0 ≤ Mε * sqrt (Vn n) := mul_nonneg hMε_pos.le (Real.sqrt_nonneg _) have hsq' : (Mε * sqrt (Vn n)) ^ 2 ≤ |Y ω| ^ 2 := by rw [sq_le_sq] simpa [abs_of_nonneg hleft_nonneg] using hω have hsq : Mε ^ 2 * Vn n ≤ (Y ω) ^ 2 := by simpa [mul_pow, Real.sq_sqrt (hVn n), sq_abs, mul_assoc, mul_comm, mul_left_comm] using hsq' exact ENNReal.ofReal_le_ofReal hsq have hmarkov := MeasureTheory.meas_ge_le_lintegral_div hY_sq_aemeas hden_ne_zero hden_ne_top have hdiv_le : ofReal (Vn n) / ofReal (Mε ^ 2 * Vn n) ≤ ofReal ε := by calc ofReal (Vn n) / ofReal (Mε ^ 2 * Vn n) = ofReal (Vn n / (Mε ^ 2 * Vn n)) := by rw [ENNReal.ofReal_div_of_pos hden_pos] _ = ofReal (1 / (Mε ^ 2)) := by congr 1 field_simp [hVpos.ne', hMε_sq_pos.ne'] _ = ofReal ε := by rw [hMε_inv_sq] _ ≤ ofReal ε := le_rfl rw [hY_def] calc μ {ω | Mε * sqrt (Vn n) ≤ |Xn n ω|} = μ {ω | Mε * sqrt (Vn n) ≤ |Y ω|} := by simp [Y] _ ≤ μ {ω | ofReal (Mε ^ 2 * Vn n) ≤ ofReal ((Y ω) ^ 2)} := measure_mono hsubset _ ≤ (∫⁻ ω, ofReal ((Y ω) ^ 2) ∂μ) / ofReal (Mε ^ 2 * Vn n) := hmarkov _ ≤ ofReal (Vn n) / ofReal (Mε ^ 2 * Vn n) := by gcongr simpa [Y] using hbound n _ ≤ ofReal ε := hdiv_le simpa only [Real.norm_eq_abs, ε, ENNReal.ofReal_toReal hδtop] using hper_n -
sampleMean_sub_sq_lintegral_letheorem — Centered sample-mean second moment. For an i.i.d. sample and a square-integrable statistic f, the centered sample mean over the first n points has second moment bounded by E_P[f²]/n:Proof (Lean source)
theorem sampleMean_sub_sq_lintegral_le (S : IIDSample Ω X μ P) [IsProbabilityMeasure μ] [IsProbabilityMeasure P] {f : X → ℝ} (hf_meas : Measurable f) (hf : MemLp f 2 P) {n : ℕ} (hn : 0 < n) : ∫⁻ ω, ofReal ((S.sampleMean f n ω - ∫ x, f x ∂P) ^ 2) ∂μ ≤ ofReal ((∫ x, (f x) ^ 2 ∂P) / n) := by classical have hnR : 0 < (n : ℝ) := by exact_mod_cast hn have hiid : μ.map (fun ω (i : range n) => S.Z i.val ω) = Measure.pi (fun _ : range n => P) := by have hindep_s : iIndepFun (fun i : range n => S.Z i) μ := by exact S.indep.precomp val_injective have hmap := (ProbabilityTheory.iIndepFun_iff_map_fun_eq_pi_map (fun i : range n => (S.meas i).aemeasurable)).mp hindep_s calc μ.map (fun ω (i : range n) => S.Z i.val ω) = Measure.pi (fun i : range n => μ.map (S.Z i)) := hmap _ = Measure.pi (fun _ : range n => P) := by congr with i rw [← (S.identDist i).map_eq, S.law] have hindep : Indep (⊥ : MeasurableSpace Ω) (comap (fun ω (i : range n) => S.Z i.val ω) inferInstance) μ := by exact ProbabilityTheory.indep_bot_left _ have hraw := iid_centered_sum_sq_lintegral_le (s := range n) (by simpa [Finset.card_range] using hn) (W := S.Z) (fun i _ => S.meas i) (⊥ : MeasurableSpace Ω) bot_le hindep hiid (fun _ x => f x) (by change Measurable[(⊥ : MeasurableSpace Ω).prod (inferInstance : MeasurableSpace X)] (fun p : Ω × X => f p.2) exact hf_meas.comp measurable_snd) (fun _ => hf) have heLp_sq : ofReal ((eLpNorm f 2 P).toReal ^ 2) = ofReal (∫ x, (f x) ^ 2 ∂P) := by have h_eLp := hf.eLpNorm_eq_integral_rpow_norm (by norm_num : (2 : ENNReal) ≠ 0) (by norm_num : (2 : ENNReal) ≠ ⊤) rw [h_eLp] simp only [ENNReal.toReal_ofNat] have hroot_nonneg : 0 ≤ (∫ a, ‖f a‖ ^ (2 : ℝ) ∂P) ^ (2 : ℝ)⁻¹ := by exact Real.rpow_nonneg (integral_nonneg fun x => by positivity) _ rw [ENNReal.toReal_ofReal hroot_nonneg] have hsq : ((∫ a, ‖f a‖ ^ (2 : ℝ) ∂P) ^ (2 : ℝ)⁻¹) ^ 2 = ∫ x, f x ^ 2 ∂P := by have hint_eq : (∫ a, ‖f a‖ ^ (2 : ℝ) ∂P) = ∫ x, f x ^ 2 ∂P := by congr with x norm_num [sq_abs] rw [hint_eq] rw [show ((∫ x, f x ^ 2 ∂P) ^ (2 : ℝ)⁻¹) ^ 2 = ((∫ x, f x ^ 2 ∂P) ^ (1 / 2 : ℝ)) ^ 2 by norm_num] rw [show ((∫ x, f x ^ 2 ∂P) ^ (1 / 2 : ℝ)) ^ 2 = ((∫ x, f x ^ 2 ∂P) ^ (1 / 2 : ℝ)) ^ (2 : ℝ) by norm_num [Real.rpow_two]] rw [← Real.rpow_mul] · norm_num · exact integral_nonneg fun x => sq_nonneg _ rw [hsq] have hscaled_bound : ∫⁻ ω, ofReal (((sqrt (n : ℝ))⁻¹ * ∑ i ∈ range n, (f (S.Z i ω) - ∫ x, f x ∂P)) ^ 2) ∂μ ≤ ofReal (∫ x, (f x) ^ 2 ∂P) := by have hraw' : ∫⁻ ω, ofReal (((sqrt ((range n).card : ℝ))⁻¹ * ∑ i ∈ range n, ((fun _ x => f x) ω (S.Z i ω) - ∫ x, (fun _ x => f x) ω x ∂P)) ^ 2) ∂μ ≤ ofReal (∫ x, (f x) ^ 2 ∂P) := by calc ∫⁻ ω, ofReal (((sqrt ((range n).card : ℝ))⁻¹ * ∑ i ∈ range n, ((fun _ x => f x) ω (S.Z i ω) - ∫ x, (fun _ x => f x) ω x ∂P)) ^ 2) ∂μ ≤ ∫⁻ ω, ofReal ((eLpNorm ((fun _ x => f x) ω) 2 P).toReal ^ 2) ∂μ := hraw _ = ofReal (∫ x, (f x) ^ 2 ∂P) := by simp [heLp_sq] simpa [Finset.card_range] using hraw' let Z : Ω → ℝ := fun ω => (sqrt (n : ℝ))⁻¹ * ∑ i ∈ range n, (f (S.Z i ω) - ∫ x, f x ∂P) let D : Ω → ℝ := fun ω => S.sampleMean f n ω - ∫ x, f x ∂P have hZ_eq : ∀ ω, Z ω = sqrt (n : ℝ) * D ω := by intro ω have hsum_sub : (∑ i ∈ range n, (f (S.Z i ω) - ∫ x, f x ∂P)) = (∑ i ∈ range n, f (S.Z i ω)) - (n : ℝ) * (∫ x, f x ∂P) := by rw [Finset.sum_sub_distrib] simp [Finset.card_range, nsmul_eq_mul] dsimp [Z, D, IIDSample.sampleMean] rw [hsum_sub] have hsqrt_ne : sqrt (n : ℝ) ≠ 0 := ne_of_gt (Real.sqrt_pos.mpr hnR) field_simp [hsqrt_ne, hnR.ne'] rw [Real.sq_sqrt hnR.le] have hD_sq : ∀ ω, D ω ^ 2 = (n : ℝ)⁻¹ * Z ω ^ 2 := by intro ω rw [hZ_eq ω, mul_pow, Real.sq_sqrt hnR.le] field_simp [hnR.ne'] have hn_inv_nonneg : 0 ≤ (n : ℝ)⁻¹ := inv_nonneg.mpr hnR.le calc ∫⁻ ω, ofReal ((S.sampleMean f n ω - ∫ x, f x ∂P) ^ 2) ∂μ = ∫⁻ ω, ofReal (D ω ^ 2) ∂μ := by rfl _ = ∫⁻ ω, ofReal ((n : ℝ)⁻¹ * Z ω ^ 2) ∂μ := by simp_rw [hD_sq] _ = ∫⁻ ω, ofReal ((n : ℝ)⁻¹) * ofReal (Z ω ^ 2) ∂μ := by simp_rw [ENNReal.ofReal_mul hn_inv_nonneg] _ = ofReal ((n : ℝ)⁻¹) * ∫⁻ ω, ofReal (Z ω ^ 2) ∂μ := by rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] _ ≤ ofReal ((n : ℝ)⁻¹) * ofReal (∫ x, (f x) ^ 2 ∂P) := by exact mul_le_mul_right (by simpa [Z] using hscaled_bound) _ _ = ofReal ((∫ x, (f x) ^ 2 ∂P) / n) := by rw [← ENNReal.ofReal_mul hn_inv_nonneg] congr 1 field_simp [hnR.ne'] -
sampleMean_sub_meas_ge_letheorem — Chebyshev tail for the centered sample mean. For t > 0,hypothesesconclusionμ {ω | t ≤ |S.sampleMean f n ω - ∫ x, f x ∂P|}≤ ofReal ((∫ x, (f x) ^ 2 ∂P) / (n * t ^ 2))Proof (Lean source)
theorem sampleMean_sub_meas_ge_le (S : IIDSample Ω X μ P) [IsProbabilityMeasure μ] [IsProbabilityMeasure P] {f : X → ℝ} (hf_meas : Measurable f) (hf : MemLp f 2 P) {n : ℕ} (hn : 0 < n) {t : ℝ} (ht : 0 < t) : μ {ω | t ≤ |S.sampleMean f n ω - ∫ x, f x ∂P|} ≤ ofReal ((∫ x, (f x) ^ 2 ∂P) / (n * t ^ 2)) := by classical let D : Ω → ℝ := fun ω => S.sampleMean f n ω - ∫ x, f x ∂P have hD_meas : Measurable D := by dsimp [D, IIDSample.sampleMean] exact (measurable_const.mul (Finset.measurable_sum _ fun i _ => hf_meas.comp (S.meas i))).sub measurable_const have hD_sq_aemeas : AEMeasurable (fun ω => ofReal ((D ω) ^ 2)) μ := by fun_prop have ht_sq_pos : 0 < t ^ 2 := pow_pos ht 2 have ht_sq_ne_zero : ofReal (t ^ 2) ≠ 0 := by rw [ENNReal.ofReal_ne_zero_iff] exact ht_sq_pos have ht_sq_ne_top : ofReal (t ^ 2) ≠ ⊤ := ENNReal.ofReal_ne_top have hsubset : {ω | t ≤ |D ω|} ⊆ {ω | ofReal (t ^ 2) ≤ ofReal ((D ω) ^ 2)} := by intro ω hω apply ENNReal.ofReal_le_ofReal have hs : t ^ 2 ≤ (D ω) ^ 2 := by rw [sq_le_sq] simpa [abs_of_pos ht] using hω exact hs have hmarkov := MeasureTheory.meas_ge_le_lintegral_div hD_sq_aemeas ht_sq_ne_zero ht_sq_ne_top have hsecond := sampleMean_sub_sq_lintegral_le S hf_meas hf hn have hnR : 0 < (n : ℝ) := by exact_mod_cast hn calc μ {ω | t ≤ |S.sampleMean f n ω - ∫ x, f x ∂P|} = μ {ω | t ≤ |D ω|} := by rfl _ ≤ μ {ω | ofReal (t ^ 2) ≤ ofReal ((D ω) ^ 2)} := measure_mono hsubset _ ≤ (∫⁻ ω, ofReal ((D ω) ^ 2) ∂μ) / ofReal (t ^ 2) := hmarkov _ ≤ ofReal ((∫ x, (f x) ^ 2 ∂P) / n) / ofReal (t ^ 2) := by gcongr _ = ofReal (((∫ x, (f x) ^ 2 ∂P) / n) / (t ^ 2)) := by rw [ENNReal.ofReal_div_of_pos ht_sq_pos] _ = ofReal ((∫ x, (f x) ^ 2 ∂P) / (n * t ^ 2)) := by congr 1 field_simp [hnR.ne', ht.ne']
GlivenkoCantelli 2 core · 0 supporting This file proves two weak Glivenko-Cantelli uniform laws for the predicate defined in EmpiricalProcess/Basic.lean. ★ glivenkoCantelli_of_fintype★ glivenkoCantelli_of_hasL1Bracketing
This file proves two weak Glivenko-Cantelli uniform laws for the predicate defined in
EmpiricalProcess/Basic.lean. The theorem glivenkoCantelli_of_fintype
handles finite integrable classes by a union bound and the weak law of large
numbers, while glivenkoCantelli_of_hasL1Bracketing upgrades finite
L¹(P)-bracketing numbers into a uniform law over an arbitrary indexed class.
The unqualified name Glivenko–Cantelli is reserved for the almost-sure property,
which is not yet formalized here.
A finite class of integrable functions is Glivenko–Cantelli. Consider a finite family of real-valued functions f i on the sample space, observed along an i.i.d. sample S drawn from a probability distribution P. If every f i is measurable and every f i is integrable with respect to P, then the worst-case gap between the empirical mean and the population mean of f i, taken over all indices i, converges to zero in probability as the sample size grows.
Formal statement
Proof (Lean source)
A class with finite L¹(P) brackets of arbitrarily small width is Glivenko-Cantelli. Consider a family of real-valued functions f i on the sample space, observed along an i.i.d. sample S drawn from a probability distribution P. If every f i is measurable and for every target width the family can be covered by finitely many upper/lower bracket pairs, each integrable and each sandwiching its assigned member almost everywhere with L¹(P)-gap between the bracket endpoints at most that width, then the worst-case gap between the empirical mean and the population mean of f i, taken over all indices i, converges to zero in probability as the sample size grows.
Formal statement
Proof (Lean source)
MEstimatorConsistency 2 core · 0 supporting This file proves consistency for extremum estimators from uniform convergence of the sample criterion and a well-separated population maximum. ★ mEstimator_consistent_of_glivenkoCantelli★ mEstimator_consistent_of_bracketing
M-Estimator Consistency
This file proves consistency for extremum estimators from uniform convergence of the
sample criterion and a well-separated population maximum. It is the empirical-process
bridge from Glivenko-Cantelli classes to econometric consistency theorems. The
theorem mEstimator_consistent_of_glivenkoCantelli consumes an abstract uniform
law, while mEstimator_consistent_of_bracketing supplies that law from finite
L¹(P) bracketing.
Separated-maximum consistency of extremum estimators (van der Vaart 1998, Theorem 5.7). Let m be a criterion function of a parameter ranging over a pseudo-metric space Θ, with population objective M(θ) equal to the expectation of m(θ,·) under P and sample objective the empirical mean of m(θ,·) along an i.i.d. sample S. If the criterion class {m(θ,·) : θ ∈ Θ} obeys the Glivenko–Cantelli uniform law, so the worst-case gap between the sample and population objectives vanishes in probability, the estimator sequence thetaHat attains the sample objective at θ₀ up to an error that vanishes in probability, and the population objective has a well-separated maximum at θ₀, meaning that for every ε>0 there is a gap η>0 such that the objective at any θ at distance at least ε from θ₀ falls short of the objective at θ₀ by at least η, then thetaHat is consistent for θ₀: for every ε>0 the probability that thetaHat n lies at distance at least ε from θ₀ tends to zero as the sample size n grows.
Formal statement
Proof (Lean source)
Bracketing corollary (the econometrician's headline). Let m be a criterion function of a parameter ranging over a pseudo-metric space Θ, observed along an i.i.d. sample S drawn from P. If each m(θ,·) is measurable, the criterion class has, for every target width, a finite collection of integrable upper/lower bracket functions sandwiching the class members almost everywhere with L¹(P)-gap at most that width, the estimator sequence thetaHat attains a sample-objective value at every sample size and outcome that is at least as large as the sample objective at θ₀ up to an error vanishing in probability, and the population objective has a well-separated maximum at θ₀, meaning that for every ε>0 there is a gap η>0 such that the objective at any θ at distance at least ε from θ₀ falls short of the objective at θ₀ by at least η, then thetaHat is consistent for θ₀: for every ε>0 the probability that thetaHat n lies at distance at least ε from θ₀ tends to zero as the sample size n grows.