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. ★ GlivenkoCantelli★ 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 GlivenkoCantelli, the finite-bracketing structure L1Bracketing,
and the arbitrary-small-bracketing hypothesis HasL1Bracketing consumed by the
Glivenko-Cantelli and M-estimator consistency files.
Empirical process of the class member f i at sample size n: √n · ((1/n) Σ_{k<n} f_i(Z_k) − ∫ f_i dP). The object whose weak limit (a Gaussian process) is the subject of Donsker theory.
Definition (Lean source)
Finite-class sup deviation: ⨆ i, |Pₙ f_i − P f_i|. Meaningful as a real-valued statistic when the class ι is finite (otherwise the ⨆ may collapse to 0 on an unbounded family, which is why GlivenkoCantelli is stated existentially instead).
Definition (Lean source)
(Weak) Glivenko–Cantelli property. The class f : ι → X → ℝ obeys a uniform law of large numbers for the sample S: for every ε > 0, the probability that some class member's empirical mean deviates from its population mean by at least ε tends to 0.
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)
A real-valued function class has finite L¹(P) brackets of arbitrarily small width.
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, nonnegative sequence Vn 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, the sample mean over the first n observations, centered at the population mean , is stochastically bounded at the rate : it is :
Proof (Lean source)
12 supporting declarations (lemmas, instances)
-
mono_ratetheorem — Weaken to a larger rate. O_p(rₙ) with 0 ≤ rₙ ≤ sₙ is O_p(sₙ): a larger envelope is a weaker statement.hypothesesconclusionIsBigOp Xn sn μProof (Lean source)
theorem IsBigOp.mono_rate (hrn : ∀ n, 0 ≤ rn n) (hle : ∀ n, rn n ≤ sn n) (h : IsBigOp Xn rn μ) : IsBigOp Xn sn μ := by intro ε hε rcases h ε hε with ⟨M0, hM0⟩ let M : ℝ := max M0 0 refine ⟨M, ?_⟩ refine le_trans (Filter.limsup_le_limsup (Eventually.of_forall ?_)) hM0 intro n apply measure_mono intro ω hω have hsn : 0 ≤ sn n := le_trans (hrn n) (hle n) have hMmul : M0 * rn n ≤ M * sn n := by by_cases hM0_nonneg : 0 ≤ M0 · have hM_eq : M = M0 := by simp [M, hM0_nonneg] rw [hM_eq] exact mul_le_mul_of_nonneg_left (hle n) hM0_nonneg · have hM_eq : M = 0 := by simp [M, le_of_lt (lt_of_not_ge hM0_nonneg)] rw [hM_eq, zero_mul] exact mul_nonpos_of_nonpos_of_nonneg (le_of_not_ge hM0_nonneg) (hrn n) exact lt_of_le_of_lt hMmul hω -
scale_ratetheorem — Absorb a positive constant rate factor. O_p(c · rₙ) with c > 0 is O_p(rₙ); the constant is absorbed into the witness M. -
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 : ℝ)) μ -
const_multheorem — Constant multiple. If Xₙ = O_p(rₙ) then c · Xₙ = O_p(rₙ) for any fixed scalar c.Proof (Lean source)
theorem IsBigOp.const_mul (c : ℝ) (h : IsBigOp Xn rn μ) : IsBigOp (fun n ω => c * Xn n ω) rn μ := by intro ε hε by_cases hc : c = 0 · refine ⟨0, ?_⟩ simp [hc] · rcases h ε hε with ⟨M, hM⟩ refine ⟨|c| * M, ?_⟩ have hcpos : 0 < |c| := abs_pos.mpr hc convert hM using 2 ext n congr 1 ext ω change |c| * M * rn n < |c * Xn n ω| ↔ M * rn n < |Xn n ω| rw [abs_mul] constructor · intro hω have hω' : |c| * (M * rn n) < |c| * |Xn n ω| := by simpa [mul_assoc] using hω nlinarith [hcpos] · intro hω have hω' : |c| * (M * rn n) < |c| * |Xn n ω| := by nlinarith [hcpos] simpa [mul_assoc] using hω' -
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ₙ.)hypothesesconclusionIsBigOp (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 intro ε hε rcases hX (ε / 4) (by linarith) with ⟨MX0, hMX0⟩ rcases hY (ε / 4) (by linarith) with ⟨MY0, hMY0⟩ let MX : ℝ := max MX0 0 let MY : ℝ := max MY0 0 have hMX_nonneg : 0 ≤ MX := by exact le_max_right MX0 0 have hMY_nonneg : 0 ≤ MY := by exact le_max_right MY0 0 have hMX0_le : MX0 ≤ MX := by exact le_max_left MX0 0 have hMY0_le : MY0 ≤ MY := by exact le_max_left MY0 0 let M : ℝ := max MX MY have hMX_le_M : MX ≤ M := le_max_left MX MY have hMY_le_M : MY ≤ M := le_max_right MX MY refine ⟨M, ?_⟩ let A : ℕ → Set Ω := fun n => {ω | MX0 * rn n < |Xn n ω|} let B : ℕ → Set Ω := fun n => {ω | MY0 * sn n < |Yn n ω|} let C : ℕ → Set Ω := fun n => {ω | M * (rn n + sn n) < |Xn n ω + Yn n ω|} have hpoint : ∀ n, μ (C n) ≤ μ (A n) + μ (B n) := by intro n have hsubset : C n ⊆ A n ∪ B n := by intro ω hω by_contra hnot have hnotA : ¬ MX0 * rn n < |Xn n ω| := by intro hx exact hnot (inl hx) have hnotB : ¬ MY0 * sn n < |Yn n ω| := by intro hy exact hnot (inr hy) have hXle0 : |Xn n ω| ≤ MX0 * rn n := le_of_not_gt hnotA have hYle0 : |Yn n ω| ≤ MY0 * sn n := le_of_not_gt hnotB have hXle : |Xn n ω| ≤ M * rn n := by calc |Xn n ω| ≤ MX0 * rn n := hXle0 _ ≤ MX * rn n := mul_le_mul_of_nonneg_right hMX0_le (hrn n) _ ≤ M * rn n := mul_le_mul_of_nonneg_right hMX_le_M (hrn n) have hYle : |Yn n ω| ≤ M * sn n := by calc |Yn n ω| ≤ MY0 * sn n := hYle0 _ ≤ MY * sn n := mul_le_mul_of_nonneg_right hMY0_le (hsn n) _ ≤ M * sn n := mul_le_mul_of_nonneg_right hMY_le_M (hsn n) have hsum : |Xn n ω + Yn n ω| ≤ M * (rn n + sn n) := by calc |Xn n ω + Yn n ω| ≤ |Xn n ω| + |Yn n ω| := abs_add_le (Xn n ω) (Yn n ω) _ ≤ M * rn n + M * sn n := add_le_add hXle hYle _ = M * (rn n + sn n) := by ring exact not_lt_of_ge hsum hω calc μ (C n) ≤ μ (A n ∪ B n) := measure_mono hsubset _ ≤ μ (A n) + μ (B n) := MeasureTheory.measure_union_le (A n) (B n) rw [Filter.limsup_le_iff] intro y hy have hquarter_half : ofReal (ε / 4) < ofReal (ε / 2) := by rw [ENNReal.ofReal_lt_ofReal_iff] <;> linarith have hAevent := Filter.eventually_lt_of_limsup_lt (lt_of_le_of_lt hMX0 hquarter_half) have hBevent := Filter.eventually_lt_of_limsup_lt (lt_of_le_of_lt hMY0 hquarter_half) filter_upwards [hAevent, hBevent] with n hAn hBn calc μ {ω | M * (fun n => rn n + sn n) n < |Xn n ω + Yn n ω|} = μ (C n) := by simp [C] _ ≤ μ (A n) + μ (B n) := hpoint n _ < ofReal (ε / 2) + ofReal (ε / 2) := ENNReal.add_lt_add hAn hBn _ = ofReal ε := by rw [← ENNReal.ofReal_add] · congr 1; ring · linarith · linarith _ < y := hy -
of_abs_letheorem — If |Xₙ| ≤ |Yₙ| pointwise and Yₙ = O_p(rₙ), then Xₙ = O_p(rₙ).Proof (Lean source)
theorem IsBigOp.of_abs_le (h : ∀ n ω, |Xn n ω| ≤ |Yn n ω|) (hY : IsBigOp Yn rn μ) : IsBigOp Xn rn μ := by intro ε hε rcases hY ε hε with ⟨M, hM⟩ refine ⟨M, le_trans (Filter.limsup_le_limsup (Filter.Eventually.of_forall ?_)) hM⟩ intro n exact measure_mono fun ω hω => lt_of_lt_of_le hω (h n ω) -
zerotheorem — The constant-zero sequence is O_p(rₙ) for any rate.conclusionIsBigOp (fun (_ : ℕ) (_ : Ω) => (0 : ℝ)) rn μ -
finset_sumtheorem — A finite sum of O_p(rₙ) sequences is O_p(rₙ) (same rate; constants absorb).hypothesesconclusionIsBigOp (fun n ω => ∑ i ∈ s, X i n ω) rn μProof (Lean source)
theorem IsBigOp.finset_sum {ι : Type*} (s : Finset ι) {X : ι → ℕ → Ω → ℝ} (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 | insert i s hi ih => have hisum : IsBigOp (fun n ω => X i n ω + ∑ j ∈ s, X j n ω) rn μ := IsBigOp.add (h i (mem_insert_self i s)) (ih (fun j hj => h j (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ₙ) for nonnegative rates, 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 (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 intro ε hε rcases hX (ε / 4) (by linarith) with ⟨Mx0, hMx0⟩ rcases hY (ε / 4) (by linarith) with ⟨My0, hMy0⟩ let Mx : ℝ := max Mx0 0 let My : ℝ := max My0 0 have hMx_nonneg : 0 ≤ Mx := le_max_right Mx0 0 have hMy_nonneg : 0 ≤ My := le_max_right My0 0 have hMx0_le : Mx0 ≤ Mx := le_max_left Mx0 0 have hMy0_le : My0 ≤ My := le_max_left My0 0 refine ⟨Mx * My, ?_⟩ let A : ℕ → Set Ω := fun n => {ω | Mx0 * rn n < |Xn n ω|} let B : ℕ → Set Ω := fun n => {ω | My0 * sn n < |Yn n ω|} let C : ℕ → Set Ω := fun n => {ω | (Mx * My) * (rn n * sn n) < |Xn n ω * Yn n ω|} have hpoint : ∀ n, μ (C n) ≤ μ (A n) + μ (B n) := by intro n have hsubset : C n ⊆ A n ∪ B n := by intro ω hω by_contra hnot have hnotA : ¬ Mx0 * rn n < |Xn n ω| := by intro hx exact hnot (inl hx) have hnotB : ¬ My0 * sn n < |Yn n ω| := by intro hy exact hnot (inr hy) have hXle0 : |Xn n ω| ≤ Mx0 * rn n := le_of_not_gt hnotA have hYle0 : |Yn n ω| ≤ My0 * sn n := le_of_not_gt hnotB have hXle : |Xn n ω| ≤ Mx * rn n := by exact le_trans hXle0 (mul_le_mul_of_nonneg_right hMx0_le (hrn n)) have hYle : |Yn n ω| ≤ My * sn n := by exact le_trans hYle0 (mul_le_mul_of_nonneg_right hMy0_le (hsn n)) have hprod : |Xn n ω * Yn n ω| ≤ (Mx * My) * (rn n * sn n) := by calc |Xn n ω * Yn n ω| = |Xn n ω| * |Yn n ω| := abs_mul (Xn n ω) (Yn n ω) _ ≤ (Mx * rn n) * (My * sn n) := mul_le_mul hXle hYle (abs_nonneg _) (mul_nonneg hMx_nonneg (hrn n)) _ = (Mx * My) * (rn n * sn n) := by ring exact not_lt_of_ge hprod hω calc μ (C n) ≤ μ (A n ∪ B n) := measure_mono hsubset _ ≤ μ (A n) + μ (B n) := MeasureTheory.measure_union_le (A n) (B n) rw [Filter.limsup_le_iff] intro y hy have hquarter_half : ofReal (ε / 4) < ofReal (ε / 2) := by rw [ENNReal.ofReal_lt_ofReal_iff] <;> linarith have hAevent := Filter.eventually_lt_of_limsup_lt (lt_of_le_of_lt hMx0 hquarter_half) have hBevent := Filter.eventually_lt_of_limsup_lt (lt_of_le_of_lt hMy0 hquarter_half) filter_upwards [hAevent, hBevent] with n hAn hBn calc μ {ω | (Mx * My) * (rn n * sn n) < |Xn n ω * Yn n ω|} = μ (C n) := by simp [C] _ ≤ μ (A n) + μ (B n) := hpoint n _ < ofReal (ε / 2) + ofReal (ε / 2) := ENNReal.add_lt_add hAn hBn _ = ofReal ε := by rw [← ENNReal.ofReal_add] · congr 1; ring · linarith · linarith _ < y := hy -
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ₙ, 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) (hbound : ∀ n, ∫⁻ ω, ofReal ((Xn n ω) ^ 2) ∂μ ≤ ofReal (Vn n)) : IsBigOp Xn (fun n => sqrt (Vn n)) μ := by intro ε hε 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ε, ?_⟩ have hper_n : ∀ n, μ {ω | Mε * sqrt (Vn n) < |Xn n ω|} ≤ ofReal ε := by intro n 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)) μ := (hY_aemeas.pow_const 2).ennreal_ofReal by_cases hVzero : Vn n = 0 · have hInt_zero : ∫⁻ ω, ofReal ((Y ω) ^ 2) ∂μ = 0 := by have hb := hbound n rw [hVzero, ENNReal.ofReal_zero] at hb exact le_antisymm (by simpa [Y] using hb) bot_le have hae_zero : (fun ω => ofReal ((Y ω) ^ 2)) =ᵐ[μ] 0 := (MeasureTheory.lintegral_eq_zero_iff' hY_sq_aemeas).mp hInt_zero have hnull : μ {ω | Mε * sqrt (Vn n) < |Y ω|} = 0 := by rw [MeasureTheory.measure_eq_zero_iff_ae_notMem] filter_upwards [hae_zero] with ω hω simp only [not_lt] rw [hVzero, Real.sqrt_zero, mul_zero] by_contra hpos_not have hpos : 0 < |Y ω| := lt_of_not_ge hpos_not have hsq_pos : 0 < (Y ω) ^ 2 := sq_pos_iff.mpr (by exact abs_pos.mp hpos) have hne : ofReal ((Y ω) ^ 2) ≠ 0 := ENNReal.ofReal_ne_zero_iff.mpr hsq_pos exact hne hω rw [hY_def] at hnull rw [show {ω | Mε * sqrt (Vn n) < |Xn n ω|} = {ω | Mε * sqrt (Vn n) < |Y ω|} by simp [Y]] rw [hnull] exact bot_le · have hVpos : 0 < Vn n := lt_of_le_of_ne (hVn n) (Ne.symm hVzero) 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 hsq : Mε ^ 2 * Vn n < (Y ω) ^ 2 := by have hω_lt : Mε * sqrt (Vn n) < |Y ω| := hω have hsq' : (Mε * sqrt (Vn n)) ^ 2 < |Y ω| ^ 2 := sq_lt_sq' (by have hleft_nonneg : 0 ≤ Mε * sqrt (Vn n) := mul_nonneg hMε_pos.le (Real.sqrt_nonneg _) linarith [abs_nonneg (Y ω), hω_lt]) hω_lt 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.le 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 exact Filter.limsup_le_of_le ⟨0, by intro _ _; exact bot_le⟩ (Eventually.of_forall 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 (measurable_sum _ fun i _ => hf_meas.comp (S.meas i))).sub measurable_const have hD_sq_aemeas : AEMeasurable (fun ω => ofReal ((D ω) ^ 2)) μ := (hD_meas.aemeasurable.pow_const 2).ennreal_ofReal 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 Glivenko-Cantelli uniform laws for the predicate defined in EmpiricalProcess/Basic.lean. ★ glivenkoCantelli_of_fintype★ glivenkoCantelli_of_hasL1Bracketing
This file proves two 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.
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.
Consistency of extremum estimators (Newey–McFadden 1994, Thm 2.1). 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 a sample-objective value at every sample size and outcome that is at least as large as the sample objective at θ₀, 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 admits, 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 θ₀, 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.