Stat.CLT
Central limit theory: iid and triangular-array CLTs, Lindeberg conditions, and vector-valued versions used by the estimation layer.
AsymptoticLinearity 6 core · 4 supporting This file provides the scalar asymptotic-linearity interface used by the estimation and inference layers. ★ IsAsymLinear★ clt_normalized_sum★ tendsto_normal
Scalar Asymptotic Linearity
This file provides the scalar asymptotic-linearity interface used by the
estimation and inference layers. gaussianMeasure is the project's real-valued
Gaussian wrapper, and IsAsymLinear records a mean-zero influence function,
finite second moment, and an o_p(1) linearization remainder along a chosen
finite index family.
The namespace also exposes IsAsymLinear.normalizedSum and
IsAsymLinear.rescaledEstimator. The main limit results are
IIDSample.clt_normalized_sum, the CLT contact point for normalized i.i.d.
sums, Tendsto_dist.add_isLittleOp_one and related Slutsky/congruence
wrappers, and IsAsymLinear.tendsto_normal, which turns full-sample scalar
asymptotic linearity into asymptotic normality.
Gaussian measure on ℝ with mean m and variance v. Real-typed wrapper around ProbabilityTheory.gaussianReal; if v < 0 the variance is clipped to 0 and the measure degenerates to Measure.dirac m.
Definition (Lean source)
An estimator is asymptotically linear when its scaled estimation error equals the normalized empirical average of an influence function that is mean zero and square-integrable under the population law, up to a term that is negligible in probability.
Definition (Lean source)
The normalised partial sum (1/√|I n|) Σ_{i ∈ I n} ψ(Z_i).
The rescaled estimator √|I n| (θn n − θ₀).
Central limit theorem for normalised sample sums. Along the i.i.d. sample S, if the transform ψ of the observations is measurable, has population mean zero, and is square-integrable, then the normalised partial sum — the sum of the transformed observations over the first n indices, divided by — converges in distribution to the centred normal law with variance equal to the population second moment .
Formal statement
Proof (Lean source)
Given that θn is asymptotically linear at θ₀ with influence function ψ along the i.i.d. sample S, where ψ is measurable and the rescaled estimator is a.e. measurable at every sample size, then the rescaled estimator converges in distribution to the centred normal law with variance .
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
instIsProbabilityMeasureGaussianMeasureinstance — gaussianMeasure m v is a probability measure for every real m, v.instance instIsProbabilityMeasureGaussianMeasure (m v : ℝ) : IsProbabilityMeasure (gaussianMeasure m v) := by unfold gaussianMeasure infer_instance -
add_isLittleOp_onetheorem — If Xn ⇒ Q in distribution and Yn − Xn = o_p(1), then Yn ⇒ Q.hypothesesΩ :Xn Yn :ℕ → Ω → ℝQ :hXn :∀ n, AEMeasurable (Xn n) μhYn :∀ n, AEMeasurable (Yn n) μhX :Tendsto_dist Xn Q μ hXnhRem :IsLittleOp (fun n ω => Yn n ω - Xn n ω) (fun _ => (1 : ℝ)) μconclusionTendsto_dist Yn Q μ hYnProof (Lean source)
theorem Tendsto_dist.add_isLittleOp_one {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {Xn Yn : ℕ → Ω → ℝ} {Q : Measure ℝ} [IsProbabilityMeasure Q] (hXn : ∀ n, AEMeasurable (Xn n) μ) (hYn : ∀ n, AEMeasurable (Yn n) μ) (hX : Tendsto_dist Xn Q μ hXn) (hRem : IsLittleOp (fun n ω => Yn n ω - Xn n ω) (fun _ => (1 : ℝ)) μ) : Tendsto_dist Yn Q μ hYn := by have hXY : TendstoInMeasure μ (fun n ω => Yn n ω - Xn n ω) atTop (0 : Ω → ℝ) := by rw [tendstoInMeasure_iff_norm] intro ε hε have hhalf : 0 < ε / 2 := by positivity have hrem : Tendsto (fun n => μ {ω | ε / 2 < |Yn n ω - Xn n ω|}) atTop (𝓝 0) := by simpa using hRem (ε / 2) hhalf rw [ENNReal.tendsto_nhds_zero] at hrem ⊢ intro δ hδ filter_upwards [hrem δ hδ] with n hn have hsubset : {x | ε ≤ ‖Yn n x - Xn n x - (0 : Ω → ℝ) x‖} ⊆ {ω | ε / 2 < |Yn n ω - Xn n ω|} := by intro ω hω have hω' : ε ≤ |Yn n ω - Xn n ω| := by simpa [Real.norm_eq_abs] using hω exact lt_of_lt_of_le (by linarith) hω' exact le_trans (measure_mono hsubset) hn unfold Tendsto_dist at hX ⊢ suffices ∀ (F : ℝ → ℝ) (hF_bounded : ∃ (C : ℝ), ∀ x y, dist (F x) (F y) ≤ C) (hF_lip : ∃ L, LipschitzWith L F), Tendsto (fun n ↦ ∫ y, F y ∂(μ.map (Yn n))) atTop (𝓝 (∫ y, F y ∂Q)) by rwa [tendsto_iff_forall_lipschitz_integral_tendsto] rintro F ⟨M, hF_bounded⟩ ⟨L, hF_lip⟩ have hF_cont : Continuous F := hF_lip.continuous obtain rfl | hL := eq_zero_or_pos L · simp only [LipschitzWith.zero_iff] at hF_lip specialize hF_lip (0 : ℝ) simp only [← hF_lip, integral_const, smul_eq_mul] have h_prob n : IsProbabilityMeasure (μ.map (Yn n)) := Measure.isProbabilityMeasure_map (hYn n) simp simp_rw [Metric.tendsto_nhds, Real.dist_eq] suffices ∀ ε > 0, ∀ᶠ n in atTop, |∫ y, F y ∂(μ.map (Yn n)) - ∫ y, F y ∂Q| < L * ε by intro ε hε convert this (ε / L) (by positivity) field_simp intro ε hε have h_le n : |∫ y, F y ∂(μ.map (Yn n)) - ∫ y, F y ∂Q| ≤ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Yn n ω - Xn n ω‖} + |∫ y, F y ∂(μ.map (Xn n)) - ∫ y, F y ∂Q| := by refine (abs_sub_le (∫ y, F y ∂(μ.map (Yn n))) (∫ y, F y ∂(μ.map (Xn n))) (∫ y, F y ∂Q)).trans ?_ gcongr have h_int_Y : Integrable (fun x ↦ F (Yn n x)) μ := by refine Integrable.of_bound (by fun_prop) (‖F (0 : ℝ)‖ + M) (ae_of_all _ fun a ↦ ?_) specialize hF_bounded (Yn n a) 0 rw [← sub_le_iff_le_add'] exact (abs_sub_abs_le_abs_sub (F (Yn n a)) (F 0)).trans hF_bounded have h_int_X : Integrable (fun x ↦ F (Xn n x)) μ := by refine Integrable.of_bound (by fun_prop) (‖F (0 : ℝ)‖ + M) (ae_of_all _ fun a ↦ ?_) specialize hF_bounded (Xn n a) 0 rw [← sub_le_iff_le_add'] exact (abs_sub_abs_le_abs_sub (F (Xn n a)) (F 0)).trans hF_bounded have h_int_sub : Integrable (fun a ↦ ‖F (Yn n a) - F (Xn n a)‖) μ := by rw [integrable_norm_iff (by fun_prop)] exact h_int_Y.sub h_int_X rw [integral_map (by fun_prop) (by fun_prop), integral_map (by fun_prop) (by fun_prop), ← integral_sub h_int_Y h_int_X, ← Real.norm_eq_abs] calc ‖∫ a, F (Yn n a) - F (Xn n a) ∂μ‖ _ ≤ ∫ a, ‖F (Yn n a) - F (Xn n a)‖ ∂μ := norm_integral_le_integral_norm _ _ = ∫ a in {x | ‖Yn n x - Xn n x‖ < ε / 2}, ‖F (Yn n a) - F (Xn n a)‖ ∂μ + ∫ a in {x | ε / 2 ≤ ‖Yn n x - Xn n x‖}, ‖F (Yn n a) - F (Xn n a)‖ ∂μ := by symm simp_rw [← not_lt] refine integral_add_compl₀ ?_ h_int_sub exact nullMeasurableSet_lt (by fun_prop) (by fun_prop) _ ≤ ∫ a in {x | ‖Yn n x - Xn n x‖ < ε / 2}, L * (ε / 2) ∂μ + ∫ a in {x | ε / 2 ≤ ‖Yn n x - Xn n x‖}, M ∂μ := by gcongr ?_ + ?_ · refine setIntegral_mono_on₀ h_int_sub.integrableOn integrableOn_const ?_ ?_ · exact nullMeasurableSet_lt (by fun_prop) (by fun_prop) · exact fun x hx ↦ hF_lip.norm_sub_le_of_le hx.le · refine setIntegral_mono h_int_sub.integrableOn integrableOn_const fun a ↦ ?_ rw [← dist_eq_norm] convert hF_bounded _ _ _ = L * (ε / 2) * μ.real {x | ‖Yn n x - Xn n x‖ < ε / 2} + M * μ.real {ω | ε / 2 ≤ ‖Yn n ω - Xn n ω‖} := by simp only [integral_const, MeasurableSet.univ, measureReal_restrict_apply, Set.univ_inter, smul_eq_mul] ring _ ≤ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Yn n ω - Xn n ω‖} := by rw [mul_assoc] gcongr grw [measureReal_le_one, mul_one] have h_tendsto : Tendsto (fun n ↦ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Yn n ω - Xn n ω‖} + |∫ y, F y ∂(μ.map (Xn n)) - ∫ y, F y ∂Q|) atTop (𝓝 (L * ε / 2)) := by suffices Tendsto (fun n ↦ L * (ε / 2) + M * μ.real {ω | ε / 2 ≤ ‖Yn n ω - Xn n ω‖} + |∫ y, F y ∂(μ.map (Xn n)) - ∫ y, F y ∂Q|) atTop (𝓝 (L * ε / 2 + M * 0 + 0)) by simpa refine (Tendsto.add ?_ (Tendsto.const_mul _ ?_)).add ?_ · rw [mul_div_assoc] exact tendsto_const_nhds · simp only [tendstoInMeasure_iff_measureReal_norm, Pi.zero_apply, sub_zero] at hXY exact hXY (ε / 2) (by positivity) · simp_rw [tendsto_iff_forall_lipschitz_integral_tendsto] at hX simpa [tendsto_iff_dist_tendsto_zero, Real.dist_eq] using hX F ⟨M, hF_bounded⟩ ⟨L, hF_lip⟩ have h_lt : L * ε / 2 < L * ε := half_lt_self (by positivity) filter_upwards [h_tendsto.eventually_lt_const h_lt] with n hn using (h_le n).trans_lt hn -
congr_aetheorem — Convergence in distribution is invariant under eventual a.e. equality of the random variables.hypothesesΩ :Xn Yn :ℕ → Ω → ℝQ :hXn :∀ n, AEMeasurable (Xn n) μhYn :∀ n, AEMeasurable (Yn n) μhX :Tendsto_dist Xn Q μ hXnhXY :∀ᶠ n in atTop, Xn n =ᵐ[μ] Yn nconclusionTendsto_dist Yn Q μ hYnProof (Lean source)
theorem Tendsto_dist.congr_ae {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {Xn Yn : ℕ → Ω → ℝ} {Q : Measure ℝ} [IsProbabilityMeasure Q] (hXn : ∀ n, AEMeasurable (Xn n) μ) (hYn : ∀ n, AEMeasurable (Yn n) μ) (hX : Tendsto_dist Xn Q μ hXn) (hXY : ∀ᶠ n in atTop, Xn n =ᵐ[μ] Yn n) : Tendsto_dist Yn Q μ hYn := by unfold Tendsto_dist at hX ⊢ refine hX.congr' ?_ filter_upwards [hXY] with n hn apply Subtype.ext exact Measure.map_congr hn -
const_mul_tendsto_gaussiantheorem — Deterministic-scalar Slutsky for Gaussian limits, phrased for the project's measure-level Tendsto_dist wrapper.hypothesesΩ :Xn :ℕ → Ω → ℝa :ℕ → ℝa₀ v :ℝhXn :∀ n, AEMeasurable (Xn n) μhX :Tendsto_dist Xn (gaussianMeasure 0 v) μ hXnconclusionTendsto_dist (fun n ω => a n * Xn n ω) (gaussianMeasure 0 (a₀ ^ 2 * v)) μ (fun n => (measurable_const.mul measurable_id).aemeasurable.comp_aemeasurable (hXn n))Proof (Lean source)
theorem Tendsto_dist.const_mul_tendsto_gaussian {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {Xn : ℕ → Ω → ℝ} {a : ℕ → ℝ} {a₀ v : ℝ} (hXn : ∀ n, AEMeasurable (Xn n) μ) (hX : Tendsto_dist Xn (gaussianMeasure 0 v) μ hXn) (ha : Tendsto a atTop (𝓝 a₀)) : Tendsto_dist (fun n ω => a n * Xn n ω) (gaussianMeasure 0 (a₀ ^ 2 * v)) μ (fun n => (measurable_const.mul measurable_id).aemeasurable.comp_aemeasurable (hXn n)) := by have hScaled : ∀ n, AEMeasurable (fun ω => a n * Xn n ω) μ := fun n => (measurable_const.mul measurable_id).aemeasurable.comp_aemeasurable (hXn n) letI : IsProbabilityMeasure ((gaussianMeasure 0 v).map (fun x : ℝ => a₀ * x)) := Measure.isProbabilityMeasure_map (by fun_prop) have hscaled_dist : Tendsto_dist (fun n ω => a n * Xn n ω) ((gaussianMeasure 0 v).map (fun x : ℝ => a₀ * x)) μ hScaled := Tendsto_dist.const_mul_tendsto hXn hX ha have hmap : (gaussianMeasure 0 v).map (fun x : ℝ => a₀ * x) = gaussianMeasure 0 (a₀ ^ 2 * v) := by simp [gaussianMeasure, gaussianReal_map_const_mul, mul_zero, Real.toNNReal_mul (sq_nonneg a₀), Real.toNNReal_of_nonneg (sq_nonneg a₀)] simpa [hmap] using hscaled_dist
AsymptoticLinearityVec 4 core · 2 supporting This file extends scalar asymptotic linearity to finite-dimensional vector-valued estimators. ★ IsAsymLinearVec★ tendsto_normal_vec
Vector Asymptotic Linearity
This file extends scalar asymptotic linearity to finite-dimensional
vector-valued estimators. IsAsymLinearVec records the vector influence
function, finite second moment, and vector o_p(1) remainder along a finite
index family, with IsAsymLinearVec.normalizedSum and
IsAsymLinearVec.rescaledEstimator giving the associated partial sum and scaled
estimator.
The scalar bridge theorems IsAsymLinearVec.toScalar and IsAsymLinear.toVec
identify the E = ℝ specialization with the scalar predicate. The headline
result IsAsymLinearVec.tendsto_normal_vec absorbs the vector remainder into a
caller-supplied multivariate CLT contact.
A vector-valued estimator sequence is asymptotically linear at a target value when its scaled estimation error equals the normalized empirical average of an influence function that has Bochner mean zero and finite second moment under the population law, up to a remainder that is negligible in probability, along a chosen family of finite index sets selecting which observations enter each empirical average.
Definition (Lean source)
Vector normalised partial sum (1/√|I n|) Σ_{i ∈ I n} ψ(Z_i).
Vector rescaled estimator √|I n| · (θn n − θ₀).
Vector asymptotic normality. For a vector-valued estimator sequence θn targeting θ₀ with influence function ψ along the i.i.d. sample S, suppose the remainder between the rescaled estimator and the normalised partial sum is asymptotically negligible (little-o of 1 in norm), the rescaled estimator is a.e. measurable at every sample size, the normalised partial sum is a.e. measurable at every sample size, and the pushforward laws of the normalised partial sum converge to a target probability measure Q on E. Then the pushforward laws of the rescaled estimator likewise converge to Q.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
toScalartheorem — When the parameter space is ℝ, the vector predicate IsAsymLinearVec unfolds to the scalar IsAsymLinear. The forward direction is a direct field-by-field rewrite using ‖x‖ = |x| on ℝ and scalar • = *.hypothesesθn :ℕ → Ω → ℝθ₀ :ℝψ :X → ℝS :IIDSample Ω X μ PI :ℕ → Finset ℕh :IsAsymLinearVec θn θ₀ ψ S IconclusionIsAsymLinear θn θ₀ ψ S IProof (Lean source)
theorem IsAsymLinearVec.toScalar {θn : ℕ → Ω → ℝ} {θ₀ : ℝ} {ψ : X → ℝ} {S : IIDSample Ω X μ P} {I : ℕ → Finset ℕ} (h : IsAsymLinearVec θn θ₀ ψ S I) : IsAsymLinear θn θ₀ ψ S I := by refine ⟨h.mean_zero, ?_, ?_⟩ · simpa [Real.norm_eq_abs, sq_abs] using h.finite_var · intro ε hε have hrem := h.remainder ε hε refine hrem.congr fun n => ?_ congr 1 ext ω simp [Real.norm_eq_abs, smul_eq_mul, abs_abs] -
toVectheorem — Conversely, scalar asymptotic linearity lifts to the vector predicate.hypothesesconclusionIsAsymLinearVec θn θ₀ ψ S IProof (Lean source)
theorem IsAsymLinear.toVec {θn : ℕ → Ω → ℝ} {θ₀ : ℝ} {ψ : X → ℝ} {S : IIDSample Ω X μ P} {I : ℕ → Finset ℕ} (h : IsAsymLinear θn θ₀ ψ S I) : IsAsymLinearVec θn θ₀ ψ S I := by refine ⟨h.mean_zero, ?_, ?_⟩ · simpa [Real.norm_eq_abs, sq_abs] using h.finite_var · intro ε hε have hrem := h.remainder ε hε refine hrem.congr fun n => ?_ congr 1 ext ω simp [Real.norm_eq_abs, smul_eq_mul, abs_abs]
ChiSquared 2 core · 4 supporting This file defines the chi-squared distribution with $d$ degrees of freedom as the law of the squared norm of a standard $d$-dimensional Gaussian vector. ★ stdGaussian_map_normSq
Chi-Squared Distribution
This file defines the chi-squared distribution with degrees of freedom as the law of the squared norm of a standard -dimensional Gaussian vector. It establishes invariance and no-atom facts needed for Wald limit distributions.
The main declarations are chiSqDist, the probability-measure instance for
that law, stdGaussian_map_linearIsometryEquiv, the dimension-only identity
stdGaussian_map_normSq, and the no-atom theorems noAtoms_pi_normSq and
noAtoms_chiSqDist.
The chi-squared distribution with d degrees of freedom: the law of the squared norm of the standard d-dimensional Gaussian.
Definition (Lean source)
The law of the squared norm under the standard Gaussian distribution on a finite-dimensional real inner product space equals the chi-squared distribution whose degrees of freedom is the space's dimension.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
instIsProbabilityMeasureRealChiSqDistinstance — The chi-squared distribution is a probability law.instance (d : ℕ) : IsProbabilityMeasure (chiSqDist d) := by unfold chiSqDist exact Measure.isProbabilityMeasure_map (by fun_prop) -
stdGaussian_map_linearIsometryEquivtheorem — stdGaussian is invariant under linear isometry equivalences. Pushing the standard Gaussian forward along an inner-product isometry yields the standard Gaussian on the target. Proved by matching characteristic functions: both sides are centered Gaussians whose covariance form is the inner product (preserved by the isometry).hypothesesF :ι :E ≃ₗᵢ[ℝ] FconclusionProof (Lean source)
theorem stdGaussian_map_linearIsometryEquiv {F : Type*} [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] (ι : E ≃ₗᵢ[ℝ] F) : (stdGaussian E).map ι = stdGaussian F := by set L : E →L[ℝ] F := (ι : E →L[ℝ] F) with hL have hmapL : (stdGaussian E).map ι = (stdGaussian E).map L := rfl haveI : IsGaussian ((stdGaussian E).map L) := by rw [← hmapL]; exact isGaussian_map_equiv ι.toContinuousLinearEquiv -- mean of the pushforward is `0` have hmean_map : ∫ x, x ∂((stdGaussian E).map L) = 0 := by have hstep : ∫ x, x ∂((stdGaussian E).map L) = L (∫ x, x ∂(stdGaussian E)) := by rw [integral_map (by fun_prop) (by fun_prop)] exact ContinuousLinearMap.integral_comp_comm L IsGaussian.integrable_id rw [hstep, stdGaussian_mean, map_zero] refine Measure.ext_of_charFun ?_ funext t have hmemLp : MemLp id 2 (stdGaussian E) := IsGaussian.memLp_two_id have hcoveq : covarianceBilin ((stdGaussian E).map L) t t = covarianceBilin (stdGaussian F) t t := by rw [covarianceBilin_map hmemLp, ι.adjoint_eq_symm, covarianceBilin_stdGaussian, covarianceBilin_stdGaussian] exact ι.symm.inner_map_map t t rw [hmapL, charFun_isGaussian_centered _ hmean_map t, charFun_isGaussian_centered _ stdGaussian_mean t, hcoveq] -
noAtoms_pi_normSqtheorem — The law of the sum of n ≥ 1 squared independent standard normals has no atoms. The squared first coordinate already has an atomless law (its preimage under squaring is finite, and gaussianReal is atomless), and adding the independent remainder preserves atomlessness via Fubini.hypothesesn :ℕhn :1 ≤ nconclusionProof (Lean source)
theorem noAtoms_pi_normSq {n : ℕ} (hn : 1 ≤ n) : NullSingletonClass ((Measure.pi (fun _ : Fin n => gaussianReal 0 1)).map (fun w => ∑ i, (w i) ^ 2)) := by classical haveI hG : NullSingletonClass (gaussianReal 0 1) := nullSingletonClass_gaussianReal (by norm_num) refine ⟨fun c => ?_⟩ rw [Measure.map_apply (by fun_prop) (measurableSet_singleton c)] obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : n ≠ 0) -- Split off coordinate `0` via the measure-preserving equiv. have hmp := measurePreserving_piFinSuccAbove (fun _ : Fin (m + 1) => gaussianReal 0 1) 0 -- The squared-norm level set is the preimage of a product level set. have hset : (fun w : Fin (m + 1) → ℝ => ∑ i, w i ^ 2) ⁻¹' {c} = (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (m + 1) => ℝ) 0) ⁻¹' {p : ℝ × (Fin m → ℝ) | p.1 ^ 2 + ∑ j, (p.2 j) ^ 2 = c} := by ext w simp only [Set.mem_preimage, Set.mem_singleton_iff, Set.mem_setOf_eq, MeasurableEquiv.piFinSuccAbove_apply] rw [Fin.sum_univ_succAbove (fun i => w i ^ 2) 0] rfl rw [hset, hmp.measure_preimage_equiv] -- Integrate the atomless first coordinate; the inner fibre is finite. have hms : MeasurableSet {p : ℝ × (Fin m → ℝ) | p.1 ^ 2 + ∑ j, (p.2 j) ^ 2 = c} := by apply measurableSet_eq_fun <;> fun_prop rw [Measure.prod_apply_symm hms] -- Each fibre `{a | a^2 + s = c}` is finite, hence null under the atomless Gaussian. have hfib : ∀ y : Fin m → ℝ, (gaussianReal 0 1) ((fun a : ℝ => (a, y)) ⁻¹' {p : ℝ × (Fin m → ℝ) | p.1 ^ 2 + ∑ j, (p.2 j) ^ 2 = c}) = 0 := by intro y have hfin : {a : ℝ | a ^ 2 + ∑ j, (y j) ^ 2 = c}.Finite := by apply Set.Finite.subset ((Set.finite_singleton (-sqrt (c - ∑ j, (y j) ^ 2))).insert (sqrt (c - ∑ j, (y j) ^ 2))) intro a ha simp only [Set.mem_setOf_eq] at ha have hsq : a ^ 2 = c - ∑ j, (y j) ^ 2 := by linarith have hnn : 0 ≤ c - ∑ j, (y j) ^ 2 := by rw [← hsq]; positivity have : a = sqrt (c - ∑ j, (y j) ^ 2) ∨ a = -sqrt (c - ∑ j, (y j) ^ 2) := by rcases le_or_gt 0 a with h | h · left rw [← hsq, Real.sqrt_sq h] · right rw [← hsq, Real.sqrt_sq_eq_abs, abs_of_neg h, neg_neg] simpa [Set.mem_insert_iff] using this have hset_eq : (fun a : ℝ => (a, y)) ⁻¹' {p : ℝ × (Fin m → ℝ) | p.1 ^ 2 + ∑ j, (p.2 j) ^ 2 = c} = {a : ℝ | a ^ 2 + ∑ j, (y j) ^ 2 = c} := by ext a; simp rw [hset_eq] exact hfin.measure_zero _ simp_rw [hfib, lintegral_zero] -
noAtoms_chiSqDisttheorem — χ²_d has no atoms for d ≥ 1.Proof (Lean source)
theorem noAtoms_chiSqDist {d : ℕ} (hd : 1 ≤ d) : NullSingletonClass (chiSqDist d) := by rw [chiSqDist, stdGaussian_map_normSq_eq_pi] exact noAtoms_pi_normSq (by rwa [finrank_euclideanSpace_fin])
ChiSquaredProjection 1 core · 0 supporting This file proves that the squared norm of an orthogonal projection of a standard finite-dimensional Gaussian vector has a chi-squared distribution. ★ stdGaussian_map_normSq_orthogonalProjection
Chi-Squared Law for Projected Gaussians
This file proves that the squared norm of an orthogonal projection of a standard finite-dimensional Gaussian vector has a chi-squared distribution. The degrees of freedom are the dimension of the projection range.
The public theorem is stdGaussian_map_normSq_orthogonalProjection: if a
continuous linear map P is self-adjoint and idempotent, then the law of
‖P z‖² under stdGaussian is chiSqDist with degrees of freedom
finrank ℝ (range P).
For a continuous linear self-map P of a finite-dimensional real inner-product space that is self-adjoint and idempotent, i.e. P composed with itself equals P — so that P is an orthogonal projection — the law of under the standard Gaussian on the space equals the chi-squared distribution with degrees of freedom equal to the dimension of the range of P.
Formal statement
Proof (Lean source)
GaussianCharFunBridge 2 core · 0 supporting This file connects concrete centered Gaussian measures with the characteristic function form used by the library's multivariate central-limit theorems. ★ charFun_isGaussian_centered★ charFun_isGaussian_of_cov_eq
Gaussian Characteristic-Function Bridge
This file connects concrete centered Gaussian measures with the characteristic function form used by the library's multivariate central-limit theorems. It identifies the Gaussian covariance with the second moment of an influence function so that abstract limit-law hypotheses can be discharged.
charFun_isGaussian_centered specializes the Mathlib Gaussian characteristic
function formula to centered Gaussian measures. charFun_isGaussian_of_cov_eq
then rewrites the covariance form into the influence-function integral
∫ ⟪t, ψ x⟫² ∂P, matching the abstract target used by the multivariate CLT
theorems.
Centered-Gaussian characteristic function. For a Gaussian measure Q on E with mean zero, its characteristic function at any point t equals .
Formal statement
Proof (Lean source)
Bridge to the abstract CLT target hQ. For a centered Gaussian measure Q on E with mean zero whose covariance bilinear form at every t equals the influence-function second moment , its characteristic function at t equals — the exact target shape consumed as the hypothesis hQ by IIDSample.clt_normalizedSum_vec_of_charFun and friends.
Formal statement
Proof (Lean source)
GaussianLimit 2 core · 4 supporting This file constructs the concrete centered Gaussian law that appears in the multivariate central limit theorem for vector-valued influence functions. ★ gaussianLimit★ clt_normalizedSum_vec
Gaussian Limit Law
This file constructs the concrete centered Gaussian law that appears in the multivariate central limit theorem for vector-valued influence functions. The covariance is the second-moment operator of the influence function, so the abstract characteristic-function target from the Cramér-Wold argument becomes an explicit probability law.
The construction is gaussianLimit, with instances showing it is Gaussian and
probabilistic. Theorems gaussianLimit_mean,
gaussianLimit_covarianceBilin, and gaussianLimit_charFun identify its mean,
covariance, and characteristic function. The final theorem
IIDSample.clt_normalizedSum_vec gives the multivariate CLT against this
concrete Gaussian limit.
The limiting Gaussian law of the multivariate CLT: the centered Gaussian on E with covariance the second-moment operator of ψ, realised as (stdGaussian E).map √Σ.
Definition (Lean source)
Multivariate CLT against the concrete Gaussian limit. Along the i.i.d. sample S, with ψ measurable and square-integrable, if ψ has population mean zero, , then the vector normalised sum converges in distribution to gaussianLimit ψ, the centered Gaussian on E with covariance equal to the second-moment operator of ψ; no abstract target or characteristic-function hypothesis remains.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
instIsGaussianGaussianLimitinstance — The limiting law is Gaussian. -
gaussianLimit_meantheorem — The limiting Gaussian is centered.conclusion∫ x, x ∂(gaussianLimit hψ hvar) = 0Proof (Lean source)
theorem gaussianLimit_mean : ∫ x, x ∂(gaussianLimit hψ hvar) = 0 := by have hL : ∫ x, x ∂(gaussianLimit hψ hvar) = (secondMomentLM_isPositive hψ hvar).posSqrtCLM (∫ x, x ∂(stdGaussian E)) := by rw [gaussianLimit, integral_map (by fun_prop) (by fun_prop)] exact ContinuousLinearMap.integral_comp_comm _ IsGaussian.integrable_id rw [hL, stdGaussian_mean, map_zero] -
gaussianLimit_covarianceBilintheorem — The covariance form of the limiting Gaussian recovers the asymptotic-variance integral ∫⟪s,ψ⟫⟪t,ψ⟫ dP.hypothesess t :EconclusioncovarianceBilin (gaussianLimit hψ hvar) s t = ∫ x, ⟪s, ψ x⟫ * ⟪t, ψ x⟫ ∂PProof (Lean source)
theorem gaussianLimit_covarianceBilin (s t : E) : covarianceBilin (gaussianLimit hψ hvar) s t = ∫ x, ⟪s, ψ x⟫ * ⟪t, ψ x⟫ ∂P := by set hpos := secondMomentLM_isPositive hψ hvar with hposdef -- `√Σ ∘ √Σ = Σ` at the point `t` have hcomp : hpos.posSqrtCLM (hpos.posSqrtCLM t) = secondMomentLM hψ hvar t := by have h := hpos.posSqrtCLM_comp_self calc hpos.posSqrtCLM (hpos.posSqrtCLM t) = (hpos.posSqrtCLM ∘L hpos.posSqrtCLM) t := rfl _ = ((secondMomentLM hψ hvar).toContinuousLinearMap) t := by rw [h] _ = secondMomentLM hψ hvar t := rfl -- self-adjointness turns `⟪√Σ s, √Σ t⟫` into `⟪s, Σ t⟫` have hsa : (⟪hpos.posSqrtCLM s, hpos.posSqrtCLM t⟫ : ℝ) = ⟪s, secondMomentLM hψ hvar t⟫ := by rw [(ContinuousLinearMap.adjoint_inner_right hpos.posSqrtCLM s (hpos.posSqrtCLM t)).symm, hpos.posSqrtCLM_adjoint, hcomp] rw [gaussianLimit, covarianceBilin_map IsGaussian.memLp_two_id hpos.posSqrtCLM, hpos.posSqrtCLM_adjoint, covarianceBilin_stdGaussian, hsa, show (⟪s, secondMomentLM hψ hvar t⟫ : ℝ) = ⟪secondMomentLM hψ hvar t, s⟫ from real_inner_comm _ _, secondMomentLM_inner hψ hvar t s] exact integral_congr_ae (ae_of_all _ fun x => mul_comm _ _) -
gaussianLimit_charFuntheorem — The characteristic function of the limiting Gaussian is exactly the abstract target exp(−½ ∫⟪t,ψ⟫² dP) of MultivariateCLT.hypothesest :EconclusioncharFun (gaussianLimit hψ hvar) t= exp (-(((∫ x, (⟪t, ψ x⟫) ^ 2 ∂P : ℝ)) : ℂ) / 2)Proof (Lean source)
theorem gaussianLimit_charFun (t : E) : charFun (gaussianLimit hψ hvar) t = exp (-(((∫ x, (⟪t, ψ x⟫) ^ 2 ∂P : ℝ)) : ℂ) / 2) := by refine charFun_isGaussian_of_cov_eq (ψ := ψ) (gaussianLimit hψ hvar) (gaussianLimit_mean hψ hvar) (fun s => ?_) t rw [gaussianLimit_covarianceBilin] exact integral_congr_ae (ae_of_all _ fun x => (pow_two (⟪s, ψ x⟫)).symm)
GaussianTail 1 core · 2 supporting This file proves that both one-sided tails of a centered Gaussian distribution can be made arbitrarily small by choosing a sufficiently large cutoff. ★ finite_measure_halfline_tails_small
Gaussian Tail Control
This file proves that both one-sided tails of a centered Gaussian distribution can be made arbitrarily small by choosing a sufficiently large cutoff. The result is a reusable tightness ingredient for quantile and partial-identification asymptotic arguments.
The exported lemma finite_measure_halfline_tails_small applies to every finite measure on
the real line. Its Gaussian corollary gaussian_tail_small_gaussian applies to
the project's gaussianMeasure m v, including the clipped degenerate case for
nonpositive variance parameters. Both return one positive cutoff controlling the
lower and upper half-line tails.
Finite-measure half-line tail control. For a finite measure Q on the real line and a positive tolerance ε, there is a positive cutoff R such that both the lower half-line tail and the upper half-line tail are at most ε.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
gaussian_tail_smalllemma — Compatibility alias for probability-measure half-line tail control.hypothesesProof (Lean source)
@[deprecated finite_measure_halfline_tails_small (since := "2026-08-04")] lemma gaussian_tail_small (Q : Measure ℝ) [IsProbabilityMeasure Q] {ε : ℝ} (hε : 0 < ε) : ∃ R : ℝ, 0 < R ∧ Q (Iic (-R)) ≤ ofReal ε ∧ Q (Ici R) ≤ ofReal ε := finite_measure_halfline_tails_small Q hε -
gaussian_tail_small_gaussianlemma — Both symmetric half-line tails of a Gaussian distribution can be made smaller than any positive tolerance by choosing a sufficiently large positive cutoff.hypothesesm v ε :ℝhε :0 < εconclusionProof (Lean source)
lemma gaussian_tail_small_gaussian {m v ε : ℝ} (hε : 0 < ε) : ∃ R : ℝ, 0 < R ∧ gaussianMeasure m v (Iic (-R)) ≤ ofReal ε ∧ gaussianMeasure m v (Ici R) ≤ ofReal ε := finite_measure_halfline_tails_small (gaussianMeasure m v) hε
MultivariateCLT 3 core · 3 supporting This file proves the Cramér-Wold reduction for normalized sums of finite-dimensional vector-valued functions of an i.i.d. ★ of_charFun_tendsto★ clt_normalizedSum_vec_of_charFun★ tendsto_normal_vec_clt
Multivariate Central Limit Theorem
This file proves the Cramér-Wold reduction for normalized sums of finite-dimensional vector-valued functions of an i.i.d. sample. It provides the abstract multivariate central limit theorem used by vector asymptotic linearity and the delta method, with the concrete Gaussian law supplied in the Gaussian limit module.
Important declarations include inner_normalizedSum, which identifies each
projection of the vector normalized sum with a scalar normalized sum,
IIDSample.normalizedSum_vec_charFun_tendsto for the per-direction
characteristic-function limit, Tendsto_dist_vec.of_charFun_tendsto for the
Cramér-Wold wrapper, IIDSample.clt_normalizedSum_vec_of_charFun for the
abstract Gaussian-target CLT, and IsAsymLinearVec.tendsto_normal_vec_clt for
end-to-end vector asymptotic normality.
Cramér–Wold / Lévy continuity wrapper. For an E-valued sequence Xn, if each Xn n is a.e. measurable and the characteristic functions of Xn n converge pointwise, at every point t, to the characteristic function of a probability measure Q, then the sequence Xn converges in distribution to Q.
Formal statement
Proof (Lean source)
Multivariate CLT contact. Along the i.i.d. sample S, for an influence function ψ that is measurable, has population mean zero, and is square-integrable, and a target probability measure Q on E whose characteristic function is the Gaussian one at every point t, then the vector normalised sum converges in distribution to Q.
Formal statement
Proof (Lean source)
Vector asymptotic normality from asymptotic linearity (no CLT hypothesis). Given that θn is vector-asymptotically-linear at θ₀ with influence function ψ along the i.i.d. sample S, where ψ is measurable, a target probability measure Q on E whose characteristic function is the Gaussian one at every point t, and the rescaled estimator is a.e. measurable at every sample size, then the pushforward laws of the rescaled estimator converge to Q.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
inner_normalizedSumtheorem — The inner product of t with the vector normalised sum is the scalar normalised sum of the projected influence function x ↦ ⟪t, ψ x⟫.hypothesesconclusion⟪t, IsAsymLinearVec.normalizedSum S ψ I n ω⟫= IsAsymLinear.normalizedSum S (fun x => ⟪t, ψ x⟫) I n ωProof (Lean source)
theorem inner_normalizedSum (S : IIDSample Ω X μ P) (ψ : X → E) (t : E) (I : ℕ → Finset ℕ) (n : ℕ) (ω : Ω) : ⟪t, IsAsymLinearVec.normalizedSum S ψ I n ω⟫ = IsAsymLinear.normalizedSum S (fun x => ⟪t, ψ x⟫) I n ω := by simp only [IsAsymLinearVec.normalizedSum, IsAsymLinear.normalizedSum, real_inner_smul_right, inner_sum] -
normalizedSum_vec_charFun_tendsto_of_proj_integrabletheorem — Per-direction charFun limit (general core). Assuming only that the scalar projection ⟪t,ψ⟫ in the chosen direction t is square-integrable (weaker than requiring the whole vector ψ to be square-integrable) and mean-zero, the characteristic function of the vector normalised sum, evaluated at t, converges to exp(−½ ∫⟪t,ψ⟫² dP). The full-vector convenience form is normalizedSum_vec_charFun_tendsto below.hypothesesS :IIDSample Ω X μ Pψ :X → Ehψ_meas :t :Ehvar_t :Integrable (fun x => (⟪t, ψ x⟫) ^ 2) Phmean :∫ x, ⟪t, ψ x⟫ ∂P = 0Proof (Lean source)
theorem IIDSample.normalizedSum_vec_charFun_tendsto_of_proj_integrable (S : IIDSample Ω X μ P) {ψ : X → E} (hψ_meas : Measurable ψ) (t : E) (hvar_t : Integrable (fun x => (⟪t, ψ x⟫) ^ 2) P) (hmean : ∫ x, ⟪t, ψ x⟫ ∂P = 0) : Tendsto (fun n => charFun (μ.map (IsAsymLinearVec.normalizedSum S ψ rng n)) t) atTop (𝓝 (exp (-(((∫ x, (⟪t, ψ x⟫) ^ 2 ∂P : ℝ)) : ℂ) / 2))) := by haveI : IsProbabilityMeasure μ := S.indep.isProbabilityMeasure haveI : IsProbabilityMeasure P := by rw [← S.law] exact Measure.isProbabilityMeasure_map (S.meas 0).aemeasurable -- projected influence function and its regularity set ψt : X → ℝ := fun x => ⟪t, ψ x⟫ with hψt_def have hψt_meas : Measurable ψt := by have h : Measurable (fun x => (innerSL ℝ t) (ψ x)) := (innerSL ℝ t).continuous.measurable.comp hψ_meas simpa [innerSL_apply_apply, hψt_def] using h have hψt_mean : ∫ x, ψt x ∂P = 0 := by simpa [hψt_def] using hmean have hψt_var : Integrable (fun x => (ψt x) ^ 2) P := by simpa [hψt_def] using hvar_t -- measurability of the partial sums (mirrors `IIDSample.measurable_sampleMean`) have hSumScalar_meas : ∀ n, AEMeasurable (IsAsymLinear.normalizedSum S ψt rng n) μ := by intro n unfold IsAsymLinear.normalizedSum exact ((measurable_sum _ (fun i _ => hψt_meas.comp (S.meas i))).const_mul _).aemeasurable have hSumVec_meas : ∀ n, AEMeasurable (IsAsymLinearVec.normalizedSum S ψ rng n) μ := by intro n unfold IsAsymLinearVec.normalizedSum exact ((measurable_sum _ (fun i _ => hψ_meas.comp (S.meas i))).const_smul _).aemeasurable -- scalar CLT for the projected influence function have h_scalar := S.clt_normalized_sum hψt_meas hψt_mean hψt_var unfold Tendsto_dist at h_scalar -- convert weak convergence to pointwise charFun convergence (Lévy, E = ℝ) have h_char1 : Tendsto (fun n => charFun (μ.map (IsAsymLinear.normalizedSum S ψt rng n)) (1 : ℝ)) atTop (𝓝 (charFun (gaussianMeasure 0 (∫ x, (ψt x) ^ 2 ∂P)) (1 : ℝ))) := by have h := (MeasureTheory.ProbabilityMeasure.tendsto_iff_tendsto_charFun.mp h_scalar) (1 : ℝ) simpa [ProbabilityMeasure.coe_mk] using h -- the scalar charFun limit equals the announced complex exponential have hv_nonneg : 0 ≤ ∫ x, (ψt x) ^ 2 ∂P := integral_nonneg fun x => sq_nonneg _ have h_gauss : charFun (gaussianMeasure 0 (∫ x, (ψt x) ^ 2 ∂P)) (1 : ℝ) = exp (-(((∫ x, (ψt x) ^ 2 ∂P : ℝ)) : ℂ) / 2) := by rw [gaussianMeasure, charFun_gaussianReal] push_cast [Real.coe_toNNReal _ hv_nonneg] ring_nf -- charFun of the vector sum at `t` equals the scalar charFun at `1` have h_bridge : ∀ n, charFun (μ.map (IsAsymLinearVec.normalizedSum S ψ rng n)) t = charFun (μ.map (IsAsymLinear.normalizedSum S ψt rng n)) (1 : ℝ) := by intro n rw [charFun_apply, charFun_apply_real, integral_map (hSumVec_meas n) (by fun_prop), integral_map (hSumScalar_meas n) (by fun_prop)] refine integral_congr_ae (ae_of_all _ fun ω => ?_) have hval : (⟪IsAsymLinearVec.normalizedSum S ψ rng n ω, t⟫ : ℝ) = IsAsymLinear.normalizedSum S ψt rng n ω := by rw [real_inner_comm]; exact inner_normalizedSum S ψ t rng n ω simp only [hval, Complex.ofReal_one, one_mul] -- assemble have hfun : (fun n => charFun (μ.map (IsAsymLinearVec.normalizedSum S ψ rng n)) t) = (fun n => charFun (μ.map (IsAsymLinear.normalizedSum S ψt rng n)) (1 : ℝ)) := funext h_bridge rw [hfun] rw [h_gauss] at h_char1 exact h_char1 -
normalizedSum_vec_charFun_tendstotheorem — Per-direction charFun limit (full-vector form). Convenience wrapper of normalizedSum_vec_charFun_tendsto_of_proj_integrable for the common case where the whole vector ψ is square-integrable: the projection ⟪t,ψ⟫ is then square-integrable by Cauchy–Schwarz, so callers holding the standard full-vector L² condition need not re-establish the per-direction one.hypothesesS :IIDSample Ω X μ Pψ :X → Ehψ_meas :hvar :Integrable (fun x => ‖ψ x‖ ^ 2) Pt :Ehmean :∫ x, ⟪t, ψ x⟫ ∂P = 0Proof (Lean source)
theorem IIDSample.normalizedSum_vec_charFun_tendsto (S : IIDSample Ω X μ P) {ψ : X → E} (hψ_meas : Measurable ψ) (hvar : Integrable (fun x => ‖ψ x‖ ^ 2) P) (t : E) (hmean : ∫ x, ⟪t, ψ x⟫ ∂P = 0) : Tendsto (fun n => charFun (μ.map (IsAsymLinearVec.normalizedSum S ψ rng n)) t) atTop (𝓝 (exp (-(((∫ x, (⟪t, ψ x⟫) ^ 2 ∂P : ℝ)) : ℂ) / 2))) := by have hψt_meas : Measurable (fun x => (⟪t, ψ x⟫ : ℝ)) := by have h : Measurable (fun x => (innerSL ℝ t) (ψ x)) := (innerSL ℝ t).continuous.measurable.comp hψ_meas simpa [innerSL_apply_apply] using h have hvar_t : Integrable (fun x => (⟪t, ψ x⟫) ^ 2) P := by have hbd : Integrable (fun x => ‖t‖ ^ 2 * ‖ψ x‖ ^ 2) P := hvar.const_mul _ refine hbd.mono' (hψt_meas.pow_const 2).aestronglyMeasurable (ae_of_all _ fun x => ?_) rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] have hsq : (⟪t, ψ x⟫) ^ 2 ≤ (‖t‖ * ‖ψ x‖) ^ 2 := by nlinarith [abs_real_inner_le_norm t (ψ x), abs_nonneg (⟪t, ψ x⟫ : ℝ), sq_abs (⟪t, ψ x⟫ : ℝ), norm_nonneg t, norm_nonneg (ψ x)] calc (⟪t, ψ x⟫) ^ 2 ≤ (‖t‖ * ‖ψ x‖) ^ 2 := hsq _ = ‖t‖ ^ 2 * ‖ψ x‖ ^ 2 := by ring exact S.normalizedSum_vec_charFun_tendsto_of_proj_integrable hψ_meas t hvar_t hmean
SecondMomentOperator 3 core · 1 supporting This file constructs the second-moment operator associated with a vector-valued influence function. ★ secondMomentLM_inner★ secondMomentLM_isPositive
Second-Moment Operator
This file constructs the second-moment operator associated with a vector-valued influence function. The operator supplies the covariance object whose positive square root is used in vector central limit theorems.
The helper theorem integrable_inner_smul proves integrability of the operator
integrand. The main API is secondMomentLM, the bilinear-form identity
secondMomentLM_inner, and secondMomentLM_isPositive, which supplies the
positivity needed to take the operator square root used by the concrete Gaussian
limit.
The second-moment operator Σ t = ∫ ⟪t, ψ x⟫ • ψ x ∂P, as a linear map.
Definition (Lean source)
For vectors t and s, the inner product of the second-moment operator applied to t with s equals the expectation under P of the product of the inner products ⟪t, ψ⟩ and ⟪s, ψ⟩.
Formal statement
Proof (Lean source)
The second-moment operator is a positive linear operator, hence symmetric and self-adjoint.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
integrable_inner_smultheorem — The integrand x ↦ ⟪t, ψ x⟫ • ψ x is integrable when ‖ψ‖² is, by the Cauchy–Schwarz bound ‖⟪t,ψ⟫ • ψ‖ ≤ ‖t‖ ‖ψ‖².hypothesesconclusionIntegrable (fun x => ⟪t, ψ x⟫ • ψ x) PProof (Lean source)
theorem integrable_inner_smul (hψ : Measurable ψ) (hvar : Integrable (fun x => ‖ψ x‖ ^ 2) P) (t : E) : Integrable (fun x => ⟪t, ψ x⟫ • ψ x) P := by have hmeas : AEStronglyMeasurable (fun x => ⟪t, ψ x⟫ • ψ x) P := ((hψ.const_inner (c := t)).smul hψ).aestronglyMeasurable refine Integrable.mono' (hvar.const_mul ‖t‖) hmeas (ae_of_all _ fun x => ?_) rw [norm_smul, Real.norm_eq_abs] calc |⟪t, ψ x⟫| * ‖ψ x‖ ≤ (‖t‖ * ‖ψ x‖) * ‖ψ x‖ := by gcongr; exact abs_real_inner_le_norm t (ψ x) _ = ‖t‖ * ‖ψ x‖ ^ 2 := by ring