Stat.Nonparametric.LocalPoly.EstimatorRisk
Pointwise-risk assembly for local-polynomial estimators, including density constants, leverage bounds, conditional MSE factorization, and unconditional risk lifts.
DensityConstants 2 core · 5 supporting The bandwidth-free kernel shape matrix T_{jk} = ∫ K(u) u^{j+k} p(t+hu) du is the positive-density-weighted Gram matrix of the centered monomials, and the pure kernel-moment matrix G_{jk} = ∫ K(u) u^{j+k} du is its unit-d ★ weightMomentMatrix_quadForm_sandwich
Density constants for the local-polynomial kernel shape matrix
The bandwidth-free kernel shape matrix T_{jk} = ∫ K(u) u^{j+k} p(t+hu) du is the
positive-density-weighted Gram matrix of the centered monomials, and the pure kernel-moment
matrix G_{jk} = ∫ K(u) u^{j+k} du is its unit-density analogue. This file:
* defines weightMomentMatrix p W — the moment matrix ∫ W(u) u^{j+k} du of an arbitrary weight
W : ℝ → ℝ, with its Gram quadratic form vᵀ (weightMomentMatrix p W) v = ∫ W(u) (∑ vⱼ uʲ)² du;
* proves the Loewner sandwich c·G ⪯ T ⪯ C·G (on quadratic forms) from a pointwise weight
domination c·W_G ≤ W_T ≤ C·W_G, which in turn follows from the design-density window bound
cDesign ≤ p ≤ CDesign (the kernel weight K ≥ 0 carries the densities);
* combines the sandwich with SquareCompletion.inv00_le_of_quadForm_sandwich to bound the shape
matrix's intercept leverage and top weight by the density constants:
(T⁻¹)₀₀ ≤ (G⁻¹)₀₀ / cDesign, T₀₀ ≤ CDesign · G₀₀.
These discharge the (T⁻¹)₀₀ ≤ cInv and T₀₀ ≤ cTop hypotheses fed to
population_scaling_of_conj, leaving no S-level invertibility/leverage assumption.
The weight-W moment matrix (weightMomentMatrix p W)_{jk} = ∫ W(u) · u^j · u^k du of the centered monomials against the Lebesgue weight W. With W = K · (p ∘ (t + h·)) this is the kernel shape matrix T; with W = K it is the pure kernel-moment matrix G.
Definition (Lean source)
Loewner sandwich on quadratic forms from pointwise weight domination. Let WT and WG be weight functions and c a nonnegative scalar. If every centered-monomial integrand built from WT is integrable and the same holds for WG, and if the weights obey the pointwise domination c · WG(u) ≤ WT(u) for every u, then for every coefficient vector v the shape-matrix quadratic form dominates c times the pure-matrix quadratic form: c · (vᵀ G v) ≤ vᵀ T v, where T = weightMomentMatrix p WT and G = weightMomentMatrix p WG.
Formal statement
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
weightMomentMatrix_quadFormtheorem — Gram quadratic form of the weight moment matrix. vᵀ (weightMomentMatrix p W) v = ∫ W(u) (∑ⱼ vⱼ uʲ)² du.hypothesesW :ℝ → ℝhint :∀ j k : Fin (p + 1), Integrable (fun u => W u * (u ^ (j : ℕ) * u ^ (k : ℕ)))v :Fin (p + 1) → ℝconclusionv ⬝ᵥ (weightMomentMatrix p W *ᵥ v) = ∫ u, W u * (∑ j, v j * u ^ (j : ℕ)) ^ 2Proof (Lean source)
theorem weightMomentMatrix_quadForm {W : ℝ → ℝ} (hint : ∀ j k : Fin (p + 1), Integrable (fun u => W u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (v : Fin (p + 1) → ℝ) : v ⬝ᵥ (weightMomentMatrix p W *ᵥ v) = ∫ u, W u * (∑ j, v j * u ^ (j : ℕ)) ^ 2 := by simp only [dotProduct, mulVec, weightMomentMatrix, Matrix.of_apply] calc ∑ j : Fin (p + 1), v j * ∑ k : Fin (p + 1), (∫ u, W u * (u ^ (j : ℕ) * u ^ (k : ℕ))) * v k = ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), (v j * v k) * ∫ u, W u * (u ^ (j : ℕ) * u ^ (k : ℕ)) := by refine Finset.sum_congr rfl ?_ intro j _ rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ ring _ = ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), ∫ u, (v j * v k) * (W u * (u ^ (j : ℕ) * u ^ (k : ℕ))) := by refine Finset.sum_congr rfl ?_ intro j _ refine Finset.sum_congr rfl ?_ intro k _ exact (MeasureTheory.integral_const_mul (v j * v k) (fun u => W u * (u ^ (j : ℕ) * u ^ (k : ℕ)))).symm _ = ∑ j : Fin (p + 1), ∫ u, ∑ k : Fin (p + 1), (v j * v k) * (W u * (u ^ (j : ℕ) * u ^ (k : ℕ))) := by refine Finset.sum_congr rfl ?_ intro j _ symm rw [MeasureTheory.integral_finset_sum] intro k _ exact (hint j k).const_mul (v j * v k) _ = ∫ u, ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), (v j * v k) * (W u * (u ^ (j : ℕ) * u ^ (k : ℕ))) := by symm rw [MeasureTheory.integral_finset_sum] intro j _ exact integrable_finset_sum _ (fun k _ => (hint j k).const_mul (v j * v k)) _ = ∫ u, W u * (∑ j, v j * u ^ (j : ℕ)) ^ 2 := by exact MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall (fun u => by change (∑ j : Fin (p + 1), ∑ k : Fin (p + 1), (v j * v k) * (W u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) = W u * (∑ j : Fin (p + 1), v j * u ^ (j : ℕ)) ^ 2 rw [pow_two, Finset.sum_mul_sum] rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro j _ rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ ring)) -
weightMomentMatrix_isHermitiantheorem — The weight moment matrix is symmetric.Proof (Lean source)
theorem weightMomentMatrix_isHermitian {W : ℝ → ℝ} : (weightMomentMatrix p W).IsHermitian := by ext j k simp only [Matrix.conjTranspose_apply, weightMomentMatrix, Matrix.of_apply, star_trivial] exact MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall (fun u => by ring)) -
weightMomentMatrix_quadForm_sandwich_uppertheorem — Loewner sandwich on quadratic forms, upper direction. If W_T(u) ≤ C · W_G(u) pointwise (C ≥ 0) and both monomial integrands are integrable, then vᵀ T v ≤ C · (vᵀ G v) for every v, where T = weightMomentMatrix p W_T, G = weightMomentMatrix p W_G.hypothesesWT WG :ℝ → ℝC :ℝhC :0 ≤ ChintT :∀ j k : Fin (p + 1), Integrable (fun u => WT u * (u ^ (j : ℕ) * u ^ (k : ℕ)))hintG :∀ j k : Fin (p + 1), Integrable (fun u => WG u * (u ^ (j : ℕ) * u ^ (k : ℕ)))hdom :∀ u, WT u ≤ C * WG uv :Fin (p + 1) → ℝconclusionv ⬝ᵥ (weightMomentMatrix p WT *ᵥ v) ≤ C * (v ⬝ᵥ (weightMomentMatrix p WG *ᵥ v))Proof (Lean source)
theorem weightMomentMatrix_quadForm_sandwich_upper {WT WG : ℝ → ℝ} {C : ℝ} (hC : 0 ≤ C) (hintT : ∀ j k : Fin (p + 1), Integrable (fun u => WT u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (hintG : ∀ j k : Fin (p + 1), Integrable (fun u => WG u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (hdom : ∀ u, WT u ≤ C * WG u) (v : Fin (p + 1) → ℝ) : v ⬝ᵥ (weightMomentMatrix p WT *ᵥ v) ≤ C * (v ⬝ᵥ (weightMomentMatrix p WG *ᵥ v)) := by have _hC := hC let s : ℝ → ℝ := fun u => ∑ j : Fin (p + 1), v j * u ^ (j : ℕ) have hsqT : Integrable (fun u => WT u * (s u) ^ 2) := by have e : (fun u => WT u * (s u) ^ 2) = (fun u => ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), (v j * v k) * (WT u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) := by funext u dsimp [s] rw [pow_two, Finset.sum_mul_sum] rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro j _ rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ ring rw [e] exact integrable_finset_sum _ (fun j _ => integrable_finset_sum _ (fun k _ => (hintT j k).const_mul (v j * v k))) have hsqG : Integrable (fun u => WG u * (s u) ^ 2) := by have e : (fun u => WG u * (s u) ^ 2) = (fun u => ∑ j : Fin (p + 1), ∑ k : Fin (p + 1), (v j * v k) * (WG u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) := by funext u dsimp [s] rw [pow_two, Finset.sum_mul_sum] rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro j _ rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ ring rw [e] exact integrable_finset_sum _ (fun j _ => integrable_finset_sum _ (fun k _ => (hintG j k).const_mul (v j * v k))) rw [weightMomentMatrix_quadForm hintT v, weightMomentMatrix_quadForm hintG v] change (∫ u, WT u * (s u) ^ 2) ≤ C * (∫ u, WG u * (s u) ^ 2) rw [← MeasureTheory.integral_const_mul C (fun u => WG u * (s u) ^ 2)] exact MeasureTheory.integral_mono hsqT (hsqG.const_mul C) (fun u => by calc WT u * (s u) ^ 2 ≤ (C * WG u) * (s u) ^ 2 := mul_le_mul_of_nonneg_right (hdom u) (sq_nonneg _) _ = C * (WG u * (s u) ^ 2) := by ring) -
kernelDensity_lower_domtheorem — Pointwise weight domination from the design-density window bound. If the kernel K is nonnegative and supported in [-1,1] and the design density p obeys cDesign ≤ p(a) for every a within bandwidth h of t, then cDesign · K(u) ≤ K(u) · p(t + h·u) for every u: on the support |u| ≤ 1 the argument t + h·u lies in the window, off the support both sides vanish.hypothesesK pdens :ℝ → ℝt h cDesign :ℝhh :0 < hhKnn :∀ u, 0 ≤ K uhKsupp :∀ uif1 < |u|thenK u = 0hlo :∀ aif|a - t| ≤ hthencDesign ≤ pdens aconclusion∀ u, cDesign * K u ≤ K u * pdens (t + h * u)Proof (Lean source)
theorem kernelDensity_lower_dom {K pdens : ℝ → ℝ} {t h cDesign : ℝ} (hh : 0 < h) (hKnn : ∀ u, 0 ≤ K u) (hKsupp : ∀ u, 1 < |u| → K u = 0) (hlo : ∀ a, |a - t| ≤ h → cDesign ≤ pdens a) : ∀ u, cDesign * K u ≤ K u * pdens (t + h * u) := by intro u by_cases hu : |u| ≤ 1 · have hwin : |(t + h * u) - t| ≤ h := by calc |(t + h * u) - t| = |h * u| := by ring_nf _ = h * |u| := by rw [abs_mul, abs_of_pos hh] _ ≤ h * 1 := mul_le_mul_of_nonneg_left hu hh.le _ = h := by ring have hp : cDesign ≤ pdens (t + h * u) := hlo (t + h * u) hwin have := mul_le_mul_of_nonneg_right hp (hKnn u) linarith · have hlt : 1 < |u| := lt_of_not_ge hu have hK : K u = 0 := hKsupp u hlt simp [hK] -
kernelDensity_upper_domtheorem — Pointwise weight domination, upper side. Same hypotheses with an upper density bound p(a) ≤ CDesign on the window give K(u) · p(t + h·u) ≤ CDesign · K(u) for every u.hypothesesK pdens :ℝ → ℝt h CDesign :ℝhh :0 < hhKnn :∀ u, 0 ≤ K uhKsupp :∀ uif1 < |u|thenK u = 0hhi :∀ aif|a - t| ≤ hthenpdens a ≤ CDesignconclusion∀ u, K u * pdens (t + h * u) ≤ CDesign * K uProof (Lean source)
theorem kernelDensity_upper_dom {K pdens : ℝ → ℝ} {t h CDesign : ℝ} (hh : 0 < h) (hKnn : ∀ u, 0 ≤ K u) (hKsupp : ∀ u, 1 < |u| → K u = 0) (hhi : ∀ a, |a - t| ≤ h → pdens a ≤ CDesign) : ∀ u, K u * pdens (t + h * u) ≤ CDesign * K u := by intro u by_cases hu : |u| ≤ 1 · have hwin : |(t + h * u) - t| ≤ h := by calc |(t + h * u) - t| = |h * u| := by ring_nf _ = h * |u| := by rw [abs_mul, abs_of_pos hh] _ ≤ h * 1 := mul_le_mul_of_nonneg_left hu hh.le _ = h := by ring have hp : pdens (t + h * u) ≤ CDesign := hhi (t + h * u) hwin have := mul_le_mul_of_nonneg_right hp (hKnn u) linarith · have hlt : 1 < |u| := lt_of_not_ge hu have hK : K u = 0 := hKsupp u hlt simp [hK]
Factorization 2 core · 1 supporting The population design moment matrix of the interior local-polynomial fit at bandwidth h and target t, against a design law with Lebesgue density p, has entries S_{jk} = N · ∫ K((a−t)/h) · (a−t)^{j+k} · p(a) da. ★ popDesignMatrix_factor
Change-of-variables factorization of the population design moment matrix
The population design moment matrix of the interior local-polynomial fit at bandwidth h and
target t, against a design law with Lebesgue density p, has entries
S_{jk} = N · ∫ K((a−t)/h) · (a−t)^{j+k} · p(a) da.
The substitution u = (a−t)/h (a = t + h·u, da = h·du) factors it as a diagonal conjugation
of the bandwidth-free shape matrix T_{jk} = ∫ K(u) u^{j+k} p(t+h·u) du:
S_{jk} = N · h^{j+k+1} · T_{jk} = (N·h) · (D · T · D)_{jk}, D = diagonal (fun j => h^j).
This is the literal factorization consumed by population_scaling_of_conj: it exposes the Θ(Nh)
scale and the bandwidth-free shape matrix T (whose density-constant leverage bounds come from
DensityConstants). The change of variables reuses the affine-rescaling pattern of
Approximation/Kernel.lean.
The population design moment matrix S_{jk} = N · ∫ K((a−t)/h) (a−t)^{j+k} p(a) da.
Definition (Lean source)
Diagonal-conjugation factorization of the population moment matrix. For a positive bandwidth h > 0, writing T for the kernel shape matrix weightMomentMatrix p (fun u => K u · p(t+h·u)) and D for the diagonal matrix diagonal (fun j => h^j), the population design moment matrix factors as popDesignMatrix p N K pdens t h = (N·h) • (D · T · D). This is the literal S = (Nh)·(D T D) hypothesis of population_scaling_of_conj, proved by the single-entry change of variables popMomentEntry_changeOfVar.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
popMomentEntry_changeOfVartheorem — Change of variables for a single moment entry. For h > 0, ∫ a, K((a−t)/h) · (a−t)^m · p(a) da = h^{m+1} · ∫ u, K(u) · u^m · p(t+h·u) du: the substitution a = t + h·u contributes the Jacobian h and turns (a−t)^m into (h·u)^m = h^m u^m.hypothesesK pdens :ℝ → ℝt h :ℝhh :0 < hm :ℕconclusion(∫ a, K ((a - t) / h) * (a - t) ^ m * pdens a)= h ^ (m + 1) * ∫ u, K u * u ^ m * pdens (t + h * u)Proof (Lean source)
theorem popMomentEntry_changeOfVar (K pdens : ℝ → ℝ) (t h : ℝ) (hh : 0 < h) (m : ℕ) : (∫ a, K ((a - t) / h) * (a - t) ^ m * pdens a) = h ^ (m + 1) * ∫ u, K u * u ^ m * pdens (t + h * u) := by set ψ : ℝ → ℝ := fun a => K ((a - t) / h) * (a - t) ^ m * pdens a with hψ have hrescale : (∫ a, ψ a) = h * ∫ u, ψ (t + h * u) := by have hcv : (∫ u, ψ (t + h * u)) = h⁻¹ * ∫ a, ψ a := by calc (∫ u, ψ (t + h * u)) = ∫ u, (fun w => ψ (t + w)) (h * u) := rfl _ = |h⁻¹| • ∫ w, (fun w => ψ (t + w)) w := by simpa using Measure.integral_comp_mul_left (fun w : ℝ => ψ (t + w)) h _ = |h⁻¹| • ∫ w, ψ (t + w) := rfl _ = |h⁻¹| • ∫ a, ψ a := by rw [integral_add_left_eq_self ψ t] _ = h⁻¹ * ∫ a, ψ a := by rw [smul_eq_mul, abs_of_pos (inv_pos.mpr hh)] calc (∫ a, ψ a) = h * (h⁻¹ * ∫ a, ψ a) := by field_simp [hh.ne'] _ = h * ∫ u, ψ (t + h * u) := by rw [hcv] have hinner : (∫ u, ψ (t + h * u)) = h ^ m * ∫ u, K u * u ^ m * pdens (t + h * u) := by calc (∫ u, ψ (t + h * u)) = ∫ u, h ^ m * (K u * u ^ m * pdens (t + h * u)) := by refine integral_congr_ae (Filter.Eventually.of_forall (fun u => ?_)) simp only [hψ] rw [show t + h * u - t = h * u from by ring] rw [show (h * u) / h = u from by rw [mul_comm, mul_div_assoc, div_self hh.ne', mul_one]] rw [mul_pow] ring _ = h ^ m * ∫ u, K u * u ^ m * pdens (t + h * u) := by rw [MeasureTheory.integral_const_mul] calc (∫ a, K ((a - t) / h) * (a - t) ^ m * pdens a) = ∫ a, ψ a := rfl _ = h * ∫ u, ψ (t + h * u) := hrescale _ = h * (h ^ m * ∫ u, K u * u ^ m * pdens (t + h * u)) := by rw [hinner] _ = h ^ (m + 1) * ∫ u, K u * u ^ m * pdens (t + h * u) := by rw [pow_succ] ring
DensityLeverage 2 core · 0 supporting Turns local-polynomial leverage hypotheses into explicit density and kernel-moment constants. ★ localPoly_density_inv00_rate★ localPoly_density_leverage_bound
Density-constant discharge of the local-polynomial leverage rate
Turns local-polynomial leverage hypotheses into explicit density and kernel-moment constants.
This module turns the abstract population-matrix leverage hypotheses for an interior
local-polynomial fit into explicit density and kernel-moment constants. The earlier
LocalPoly.Rate.population_scaling_of_conj reduced the leverage scaling to a bandwidth-free shape
matrix T with assumed (T⁻¹)₀₀ ≤ cInv and T₀₀ ≤ cTop; here those constants become
explicit density + kernel-moment quantities:
cInv = (G⁻¹)₀₀ / cDesign, cTop = CDesign · G₀₀,
with G = weightMomentMatrix p K the pure kernel-moment matrix and density-window bounds supplying
the needed lower bound for the inverse rate and both lower/upper bounds for the leverage product.
The chain is:
popDesignMatrix_factor (S = (Nh)·D T D, change of variables)
→ DensityConstants ((T⁻¹)₀₀ ≤ (G⁻¹)₀₀/cDesign, T₀₀ ≤ CDesign·G₀₀ via Loewner sandwich)
→ diagonal-conjugation scaling ((S⁻¹)₀₀ ≤ cInv/(Nh), S₀₀ ≤ cTop·(Nh))
→ localPoly_inv00_rate / localPoly_leverage_bound.
The resulting localPoly_density_inv00_rate and localPoly_density_leverage_bound carry no
hypothesis on the population matrix S other than the good design event (M entrywise within η
of S) and explicit small-perturbation scale constants.
Explicit Θ(1/(Nh)) leverage rate from density + kernel-moment constants. Fix a bandwidth h > 0, a sample size N with N > 0, and a design-density lower bound cDesign > 0. Let the kernel K be nonnegative and supported in [-1,1], with both centered-monomial integrands — against the shape weight K·p(t+h·) and against the pure kernel K — integrable, the pure kernel-moment matrix G positive definite, and the kernel shape matrix T positive definite; suppose the design density obeys cDesign ≤ p on the window |a − t| ≤ h. On the good design event where the population matrix's inverse row sums are bounded by a nonnegative constant c, the empirical moment matrix M lies entrywise within a nonnegative scale η of the population matrix S = popDesignMatrix p N K pdens t h, and where the regime constants are small enough (c·(p+1)·η ≤ 1/2 and 2c²(p+1)η is at most the explicit density + kernel-moment constant cInv/(Nh)), then the empirical moment matrix M is invertible and its intercept leverage obeys the explicit interior rate (M⁻¹)₀₀ ≤ 2·cInv/(Nh), with cInv = (G⁻¹)₀₀/cDesign an explicit density + kernel-moment constant — no S-level invertibility or leverage assumption remains.
Formal statement
Proof (Lean source)
Bandwidth-free density bound on the local-polynomial leverage product. Fix a bandwidth h > 0, a sample size N > 0, and density-window bounds 0 < cDesign with cDesign ≤ CDesign. Let the kernel K be nonnegative and supported in [-1,1], with both centered-monomial integrands integrable, the pure kernel-moment matrix G positive definite, and the kernel shape matrix T positive definite; suppose the design density obeys the lower window bound cDesign ≤ p and the upper window bound p ≤ CDesign on |a − t| ≤ h. On the good design event — the population matrix's inverse row sums bounded by a nonnegative c, the empirical moment matrix M entrywise within a nonnegative scale η of the population matrix, with the regime constants small (c·(p+1)·η ≤ 1/2), the perturbation bound 2c²(p+1)η ≤ cInv/(Nh), and η at most Nh — and given the total weight M₀₀ is nonnegative and the inverse leverage (M⁻¹)₀₀ is nonnegative, then the geometric mean of the total weight and the inverse leverage is bounded by the bandwidth-free density constant √(M₀₀·(M⁻¹)₀₀) ≤ √(2·cInv·(cTop+1)), with cInv = (G⁻¹)₀₀/cDesign and cTop = CDesign·G₀₀. Via equivKernelWeight_abs_sum_sq_le this controls the ℓ¹ bias leverage ∑ᵢ|Sᵢ| by a bandwidth-free constant.
Formal statement
Proof (Lean source)
EstimatorRisk 2 core · 0 supporting Conditional local-polynomial estimator risk bounds, assembling interior bias and stochastic L² estimates for the windowed pointwise estimator. ★ localPoly_estimatorBias_window★ localPoly_estimatorStochL2
Interior local-polynomial estimator risk: bias and stochastic-L² bounds
Conditional local-polynomial estimator risk bounds, assembling interior bias and stochastic L²
estimates for the windowed pointwise estimator.
This module assembles the conditional-on-design bias / variance bounds
(localPoly_intercept_bias, localPoly_intercept_variance_le) and the bandwidth-free
density-constant leverage facts produced by DensityLeverage:
* localPoly_estimatorBias_window — estimatorBias = |ĉ₀ − f(t)| ≤ Cbias · h^β with the explicit
constant Cbias = (MH/p!) · L, where p = holderDerivOrder β and
L = √(2·cInv·(cTop+1)) is the bandwidth-free leverage
bound (MH the Hölder constant). The ℓ¹ leverage ∑ᵢ|Sᵢ| is squeezed by
(∑ᵢ|Sᵢ|)² ≤ M₀₀·(M⁻¹)₀₀ ≤ L² (equivKernelWeight_abs_sum_sq_le).
* localPoly_estimatorStochL2 — estimatorStochL2 = √Var(ĉ₀) ≤ Cvar · (Nh)^{-1/2} with the
explicit constant Cvar = √(2σ²·W·cInv), from Var ≤ σ²·W·(M⁻¹)₀₀ and the leverage rate
(M⁻¹)₀₀ ≤ 2·cInv/(Nh).
Both bounds hold conditionally on the design (equivalently, on the high-probability good design
event of designMatrix_inv_concentration): once the leverage rate is supplied, the estimator risk
reduces to a deterministic bias bound plus a conditional variance bound. The leverage constants
cInv, cTop are the explicit density + kernel-moment quantities of
localPoly_density_inv00_rate / localPoly_density_leverage_bound, so no S-level matrix
hypothesis remains.
Interior local-polynomial estimator bias ≤ Cbias · h^β. Let ĉ₀ = c 0 be the degree- p = holderDerivOrder β weighted least-squares intercept fit — the coefficient vector c minimizing the weighted sum of squared residuals — of a β-Hölder function f (exponent β > 0) with Hölder constant MH ≥ 0 bounding the highest derivative's modulus of continuity at noise-free responses, where the weights are nonnegative, the target point t and every design point a i lie in a common interval [lo, hi], every design point is within bandwidth h ≥ 0 of t, and the design moment matrix is invertible. If the bandwidth-free leverage bound √(M₀₀·(M⁻¹)₀₀) ≤ L holds for some L ≥ 0 — supplied by localPoly_density_leverage_bound — then the conditional bias obeys |ĉ₀ − f(t)| ≤ (MH/p!) · L · h^β, the standard local-polynomial bias rate with constant Cbias = (MH/p!) · L.
Formal statement
Proof (Lean source)
Interior local-polynomial estimator stochastic L² error ≤ Cvar · (Nh)^{-1/2}. The degree-p local-polynomial equivalent-kernel smoother ĉ₀ = ∑ᵢ Sᵢ Yᵢ, applied to a family Y of square-integrable responses that is spherical with common scale σ, with an invertible design moment matrix and nonnegative weights bounded by a constant W ≥ 0, satisfies, on the good design event where the intercept leverage obeys the rate (M⁻¹)₀₀ ≤ 2·cInv/Nh for a nonnegative constant cInv and a positive scale Nh, the conditional stochastic L² error bound √Var(ĉ₀) ≤ √(2σ²·W·cInv) · (Nh)^{-1/2}, the standard interior stochastic rate with constant Cvar = √(2σ²·W·cInv).
Formal statement
Proof (Lean source)
SquareCompletion 1 core · 4 supporting Linear-algebra bounds for the top-left inverse entry under positive-definite quadratic-form sandwiches. ★ two_dotProduct_sub_quadForm_le_inv
Square-completion bound on the (0,0) inverse entry under a Loewner sandwich
Linear-algebra bounds for the top-left inverse entry under positive-definite quadratic-form sandwiches.
The interior local-polynomial leverage (T⁻¹)₀₀ of the bandwidth-free kernel shape matrix T
must be controlled by the density constants cDesign ≤ p ≤ CDesign together with the pure
kernel-moment Gram matrix G. The clean route avoids Loewner inverse-monotonicity (absent from
Mathlib): it uses only the elementary completing-the-square identity
(w − A⁻¹e)ᵀ A (w − A⁻¹e) ≥ 0 ⟺ 2 eᵀw − wᵀ A w ≤ eᵀ A⁻¹ e
valid for any positive definite A and vectors e, w. Evaluating it at the optimum w = A⁻¹e
turns the inequality into the variational identity eᵀ A⁻¹ e = max_w (2 eᵀw − wᵀ A w), and a
Loewner sandwich c·B ⪯ A (as quadratic forms) then transports the maximum:
(A⁻¹)₀₀ ≤ (B⁻¹)₀₀ / c.
This file proves that bound (and the trivial companion A₀₀ ≤ C·B₀₀ under A ⪯ C·B). It is the
pure-linear-algebra heart of the density-constant discharge of the local-polynomial leverage rate.
Completing-the-square inequality for a positive definite quadratic form. For a positive definite matrix A and any vectors e, w, the affine functional 2 eᵀw − wᵀ A w is bounded above by the inverse quadratic form eᵀ A⁻¹ e, with equality at w = A⁻¹ e. This is the elementary identity eᵀ A⁻¹ e − (2 eᵀw − wᵀ A w) = (w − A⁻¹ e)ᵀ A (w − A⁻¹ e) ≥ 0.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
inv00_eq_quadFormtheorem — The (0,0) entry of an inverse as an inverse quadratic form at the first basis vector: (A⁻¹)₀₀ = e₀ᵀ A⁻¹ e₀ with e₀ = Pi.single 0 1.hypothesesProof (Lean source)
theorem inv00_eq_quadForm (A : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) : A⁻¹ 0 0 = (single (0 : Fin (p + 1)) (1 : ℝ)) ⬝ᵥ (A⁻¹ *ᵥ single 0 1) := by simp [dotProduct, mulVec, Pi.single_apply] -
entry00_eq_quadFormtheorem — The (0,0) entry of a matrix as a quadratic form at the first basis vector: A₀₀ = e₀ᵀ A e₀ with e₀ = Pi.single 0 1.hypothesesProof (Lean source)
theorem entry00_eq_quadForm (A : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ) : A 0 0 = (single (0 : Fin (p + 1)) (1 : ℝ)) ⬝ᵥ (A *ᵥ single 0 1) := by simp [dotProduct, mulVec, Pi.single_apply] -
inv00_le_of_quadForm_sandwichtheorem — Loewner sandwich bound on the (0,0) inverse entry. If A and B are positive definite and A dominates c·B in the Loewner order on quadratic forms (c·(wᵀ B w) ≤ wᵀ A w for all w) with c > 0, then the intercept leverage entries satisfyhypotheseshA :A.PosDefhB :B.PosDefc :ℝhc :0 < chsand :∀ w : Fin (p + 1) → ℝ, c * (w ⬝ᵥ (B *ᵥ w)) ≤ w ⬝ᵥ (A *ᵥ w)conclusionA⁻¹ 0 0 ≤ B⁻¹ 0 0 / cProof (Lean source)
theorem inv00_le_of_quadForm_sandwich {A B : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ} (hA : A.PosDef) (hB : B.PosDef) {c : ℝ} (hc : 0 < c) (hsand : ∀ w : Fin (p + 1) → ℝ, c * (w ⬝ᵥ (B *ᵥ w)) ≤ w ⬝ᵥ (A *ᵥ w)) : A⁻¹ 0 0 ≤ B⁻¹ 0 0 / c := by let e0 : Fin (p + 1) → ℝ := single (0 : Fin (p + 1)) (1 : ℝ) let wstar : Fin (p + 1) → ℝ := (A⁻¹ *ᵥ e0) have hdetA : IsUnit A.det := Matrix.isUnit_iff_isUnit_det A |>.mp hA.isUnit have hAw : A *ᵥ wstar = e0 := by have hAA : (A * A⁻¹) *ᵥ e0 = e0 := by rw [Matrix.mul_nonsing_inv A hdetA] simp simpa [wstar] using hAA have hew : e0 ⬝ᵥ wstar = A⁻¹ 0 0 := by simp [e0, wstar] have hquadA : wstar ⬝ᵥ (A *ᵥ wstar) = e0 ⬝ᵥ wstar := by rw [hAw, dotProduct_comm] have hoptA : A⁻¹ 0 0 = 2 * (e0 ⬝ᵥ wstar) - wstar ⬝ᵥ (A *ᵥ wstar) := by rw [hquadA, hew] ring have hAB : 2 * (e0 ⬝ᵥ wstar) - wstar ⬝ᵥ (A *ᵥ wstar) ≤ 2 * (e0 ⬝ᵥ wstar) - c * (wstar ⬝ᵥ (B *ᵥ wstar)) := by linarith [hsand wstar] have hBvar := two_dotProduct_sub_quadForm_le_inv hB e0 (c • wstar) have hscale : 2 * (e0 ⬝ᵥ (c • wstar)) - (c • wstar) ⬝ᵥ (B *ᵥ (c • wstar)) = c * (2 * (e0 ⬝ᵥ wstar) - c * (wstar ⬝ᵥ (B *ᵥ wstar))) := by simp [Matrix.mulVec_smul] ring have hBscaled : c * (2 * (e0 ⬝ᵥ wstar) - c * (wstar ⬝ᵥ (B *ᵥ wstar))) ≤ B⁻¹ 0 0 := by rwa [hscale, ← inv00_eq_quadForm B] at hBvar have hBdiv : 2 * (e0 ⬝ᵥ wstar) - c * (wstar ⬝ᵥ (B *ᵥ wstar)) ≤ B⁻¹ 0 0 / c := by rw [le_div_iff₀ hc] linarith rw [hoptA] exact le_trans hAB hBdiv -
entry00_le_of_quadForm_sandwichtheorem — Loewner sandwich bound on the (0,0) entry. If A ⪯ C·B in the Loewner order on quadratic forms (wᵀ A w ≤ C·wᵀ B w for all w), then the top weight entries satisfy A₀₀ ≤ C·B₀₀. (Just evaluate the quadratic forms at the first basis vector.)hypothesesC :ℝhsand :∀ w : Fin (p + 1) → ℝ, w ⬝ᵥ (A *ᵥ w) ≤ C * (w ⬝ᵥ (B *ᵥ w))conclusionA 0 0 ≤ C * B 0 0Proof (Lean source)
theorem entry00_le_of_quadForm_sandwich {A B : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ} {C : ℝ} (hsand : ∀ w : Fin (p + 1) → ℝ, w ⬝ᵥ (A *ᵥ w) ≤ C * (w ⬝ᵥ (B *ᵥ w))) : A 0 0 ≤ C * B 0 0 := by rw [entry00_eq_quadForm A, entry00_eq_quadForm B] exact hsand (single (0 : Fin (p + 1)) (1 : ℝ))
Unconditional 3 core · 0 supporting Unconditional risk bounds for truncated local-polynomial estimators, lifting conditional-on-design bias and variance estimates through good-design events. ★ estimatorBias_unconditional★ estimatorVariance_unconditional★ estimatorStochL2_unconditional
Unconditional (full-sample-law) bias / variance of a truncated estimator
Unconditional risk bounds for truncated local-polynomial estimators, lifting conditional-on-design bias and variance estimates through good-design events.
The conditional-on-design capstones localPoly_estimatorBias_window and
localPoly_estimatorStochL2 bound the bias / variance of the interior local-polynomial estimator
given a non-degenerate design (equivalently, on the high-probability good-design event of
designMatrix_inv_concentration). A full risk bound for the random-design estimator also needs
bounds on the bias 𝔼[est] − f(t) and stochastic L² error √Var(est) under the full sample
law, where the design itself is random.
This module performs that high-probability-to-L² lift as a pair of generic probabilistic facts,
with no conditional-on-design caveat remaining:
* estimatorBias_unconditional — split 𝔼[est] = 𝔼[est·1_G] + 𝔼[est·1_{Gᶜ}] through the design
σ-algebra m: on the good design event G the conditional bias |𝔼[est | m] − θ| ≤ B holds,
while off G the truncation |est| ≤ M controls the contribution by 2M·μ(Gᶜ). Yields
|𝔼[est] − θ| ≤ B + 2M·μ(Gᶜ).
* estimatorVariance_unconditional — via the law of total variance
Var(est) = 𝔼[Var(est | m)] + Var(𝔼[est | m]): the first term is the within-design variance
(≤ Vrate on G, ≤ M² off it), the second is dominated by the squared conditional bias
(≤ Bsq on G, ≤ 4M² off it). Yields Var(est) ≤ Vrate + Bsq + 5M²·μ(Gᶜ).
* estimatorStochL2_unconditional — the √· form of the variance bound.
Each carries an explicit μ(Gᶜ) tail; designMatrix_inv_concentration makes that tail tiny (and a
regime hypothesis absorbs it into the leading rate). The lift takes the conditional bias /
variance bounds as hypotheses — exactly the output of the conditional capstones — and is otherwise
self-contained: the conditional-expectation and law-of-total-variance machinery is
MeasureTheory.condExp / ProbabilityTheory.condVar from Mathlib.
Unconditional bias of a truncated estimator. Let est be an integrable statistic bounded by M in absolute value estimating a target θ with |θ| ≤ M, relative to a sub-σ-algebra m of the ambient σ-algebra. If G is an m-measurable good-design event on which, almost everywhere, the conditional bias |𝔼[est | m] − θ| is at most a nonnegative constant B, then the full-sample-law bias obeys |𝔼[est] − θ| ≤ B + 2M·μ(Gᶜ), the conditional bias B plus a truncation tail proportional to the bad-design probability.
Formal statement
Proof (Lean source)
Unconditional variance of a truncated estimator (law of total variance). Let est be an L² statistic bounded by M in absolute value estimating a target θ with |θ| ≤ M, relative to a sub-σ-algebra m of the ambient σ-algebra. Let G be an m-measurable good-design event on which, almost everywhere, the conditional variance Var[est | m] is at most a nonnegative rate Vrate and the squared conditional bias (𝔼[est | m] − θ)² is at most a nonnegative constant Bsq. Then the full-sample-law variance obeys Var(est) ≤ Vrate + Bsq + 5M²·μ(Gᶜ), the within-design variance rate plus the squared bias plus a truncation tail.
Formal statement
Proof (Lean source)
Unconditional stochastic L² error of a truncated estimator. The √· form of estimatorVariance_unconditional: for an L² statistic est bounded by M in absolute value estimating θ with |θ| ≤ M relative to a sub-σ-algebra m of the ambient σ-algebra, and an m-measurable good-design event G on which, almost everywhere, the conditional variance is at most a nonnegative rate Vrate and the squared conditional bias is at most a nonnegative constant Bsq, the full-sample-law stochastic L² error obeys √Var(est) ≤ √(Vrate + Bsq + 5M²·μ(Gᶜ)). With Vrate = Cvar²·(Nh)⁻¹, Bsq = Cbias²·h^{2β} and a negligible truncation tail (5M²·μ(Gᶜ) driven to o((Nh)⁻¹) by designMatrix_inv_concentration), this gives the full-sample stochastic L² rate up to the bias and the negligible tail.