Stat.Nonparametric.LocalPoly.EstimatorRisk
Given the design, the degree-p local-polynomial intercept of a β-Hölder regression function has bias at most Cbias · h^β and stochastic L² error at most Cvar · (Nh)^(−1/2), with the leverage constants expressed through l
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.
For a nonnegative integer degree and a real-valued weight function on the real line, the weight moment matrix is the square matrix whose row-, column- entry is the Lebesgue integral for .
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.hypothesesp :sharedℕW :ℝ → ℝ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.hypothesesp :sharedℕWT 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 au :conclusioncDesign * 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 ≤ CDesignu :conclusionK 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]
DensityLeverage 2 core · 0 supporting Derives explicit leverage constants from density and kernel moments, conditional on a positive definite density-weighted shape matrix. ★ localPoly_density_inv00_rate★ localPoly_density_leverage_bound
Density-based local-polynomial leverage bounds under shape positive definiteness
Derives explicit leverage constants from density and kernel moments, conditional on a positive definite density-weighted shape matrix.
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. In addition to density-window
bounds and positive definiteness of G, both headline theorems assume positive definiteness of the
density-weighted shape matrix T; this module does not derive that condition. 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 formulate the
good design event in the rescaled polynomial basis. Writing D = diag(1,h,...,h^p) and
M = D B D, the empirical matrix B = D⁻¹ M D⁻¹ is compared directly with (Nh) • T.
This is the nonvacuous local-polynomial normalization: the intercept leverage is unchanged because
D₀₀ = 1.
Conditional O(1/(Nh)) leverage bound with explicit density constants. Fix a bandwidth h > 0, a sample size N with N > 0, and a 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. Write the unscaled empirical moment matrix as M = D B D, where B is the empirical Gram matrix in the rescaled polynomial basis. On the good design event where the inverse row sums of (Nh)T are bounded by a nonnegative constant c, the rescaled empirical matrix B lies entrywise within a nonnegative scale η of (Nh)T, 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 and kernel-moment constant. The positive definiteness of T remains an assumption.
Formal statement
Proof (Lean source)
Conditional bandwidth-free density bound on the 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. Write the unscaled empirical moment matrix as M = D B D, with B in the rescaled polynomial basis. On the good design event — the inverse row sums of (Nh)T bounded by a nonnegative c, the rescaled empirical matrix B entrywise within a nonnegative scale η of (Nh)T, 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 rescaled total weight B₀₀ is nonnegative and the rescaled inverse leverage (B⁻¹)₀₀ 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 · 1 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 for any fixed design satisfying their explicit leverage hypotheses. This file
does not define a random-design good event or derive those hypotheses from a concentration
theorem. 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 whose distinct coordinates are uncorrelated and variances are bounded by σbar², 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, 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)
1 supporting declaration (lemmas, instances)
-
localPoly_estimatorBias_window_withintheorem — Interior local-polynomial estimator bias for a regression function smooth only on a window. Let ĉ₀ be the intercept of the degree-p weighted least-squares fit, p the largest integer strictly below β, where the coefficient vector c minimizes the weighted sum of squared residuals at the noise-free responses of a function f that, for some β > 0, is p times continuously differentiable on a window [lo, hi] with p-th within-window derivative (β − p)-Hölder there with constant MH ≥ 0. Suppose the weights are nonnegative, the target point t and every design point lie in the window, every design point is within bandwidth h ≥ 0 of t, and the design moment matrix M is invertible. If √(M₀₀·(M⁻¹)₀₀) ≤ L, then |ĉ₀ − f(t)| ≤ (MH/p!) · L · h^β.hypothesesN :ℕβ MH lo hi t h L :ℝa w :Fin N → ℝf :ℝ → ℝc :Fin ((holderDerivOrder β) + 1) → ℝhβ :0 < βhMH :0 ≤ MHhh :0 ≤ hhw :∀ i, 0 ≤ w iht :t ∈ Icc lo hiha :∀ i, a i ∈ Icc lo hihwin :∀ i, |a i - t| ≤ hhf :hb :hMdet :hmin :∀ c' : Fin ((holderDerivOrder β) + 1) → ℝ,(∑ i, w i * (f (a i) - ∑ j, c j * (a i - t) ^ (j : ℕ)) ^ 2)≤ ∑ i, w i * (f (a i) - ∑ j, c' j * (a i - t) ^ (j : ℕ)) ^ 2hlev :sqrt ((designMatrix (holderDerivOrder β) (fun i => a i - t) w) 0 0 * (designMatrix (holderDerivOrder β) (fun i => a i - t) w)⁻¹ 0 0)≤ Lconclusion|c 0 - f t| ≤ (MH / ((holderDerivOrder β)).factorial) * L * h ^ βProof (Lean source)
theorem localPoly_estimatorBias_window_within {N : ℕ} {β MH lo hi t h L : ℝ} {a w : Fin N → ℝ} {f : ℝ → ℝ} {c : Fin ((holderDerivOrder β) + 1) → ℝ} (hβ : 0 < β) (hMH : 0 ≤ MH) (hh : 0 ≤ h) (hw : ∀ i, 0 ≤ w i) (ht : t ∈ Icc lo hi) (ha : ∀ i, a i ∈ Icc lo hi) (hwin : ∀ i, |a i - t| ≤ h) (hf : ContDiffOn ℝ (holderDerivOrder β) f (Icc lo hi)) (hb : ∀ x ∈ Icc lo hi, ∀ y ∈ Icc lo hi, |iteratedDerivWithin (holderDerivOrder β) f (Icc lo hi) x - iteratedDerivWithin (holderDerivOrder β) f (Icc lo hi) y| ≤ MH * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))) (hMdet : IsUnit (designMatrix (holderDerivOrder β) (fun i => a i - t) w).det) (hmin : ∀ c' : Fin ((holderDerivOrder β) + 1) → ℝ, (∑ i, w i * (f (a i) - ∑ j, c j * (a i - t) ^ (j : ℕ)) ^ 2) ≤ ∑ i, w i * (f (a i) - ∑ j, c' j * (a i - t) ^ (j : ℕ)) ^ 2) (hlev : sqrt ((designMatrix (holderDerivOrder β) (fun i => a i - t) w) 0 0 * (designMatrix (holderDerivOrder β) (fun i => a i - t) w)⁻¹ 0 0) ≤ L) : |c 0 - f t| ≤ (MH / ((holderDerivOrder β)).factorial) * L * h ^ β := by have hbias := localPoly_intercept_bias_within hβ hMH hw ht ha hwin hf hb hMdet hmin set s := ∑ i, |equivKernelWeight (holderDerivOrder β) (fun i => a i - t) w i| with hs have hs_nn : 0 ≤ s := Finset.sum_nonneg (fun i _ => abs_nonneg _) have hsq : s ^ 2 ≤ (designMatrix (holderDerivOrder β) (fun i => a i - t) w) 0 0 * (designMatrix (holderDerivOrder β) (fun i => a i - t) w)⁻¹ 0 0 := equivKernelWeight_abs_sum_sq_le hMdet hw have hsL : s ≤ L := by rw [(Real.sqrt_sq hs_nn).symm] exact le_trans (Real.sqrt_le_sqrt hsq) hlev have hcoef_nn : 0 ≤ MH / ((holderDerivOrder β)).factorial := div_nonneg hMH (by positivity) have hhb : 0 ≤ h ^ β := Real.rpow_nonneg hh β calc |c 0 - f t| ≤ (MH / ((holderDerivOrder β)).factorial) * s * h ^ β := hbias _ ≤ (MH / ((holderDerivOrder β)).factorial) * L * h ^ β := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hsL hcoef_nn) hhb
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
scalar factor 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.
Given a nonnegative polynomial degree, a nonnegative sample size, a real-valued kernel function, a real-valued design-weight function, a real target point, and a real bandwidth, the population design moment matrix is the matrix whose entry is .
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
SquareCompletion 1 core · 5 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)
5 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] -
inv_diag_le_of_quadForm_sandwichtheorem — Loewner sandwich bound on a diagonal entry of the inverse. If A and B are positive definite real matrices and, for a constant c > 0, c · wᵀ B w ≤ wᵀ A w for every vector w, then for every index j, (A⁻¹)_{jj} ≤ (B⁻¹)_{jj} / c.hypotheseshA :A.PosDefhB :B.PosDefc :ℝhc :0 < chsand :∀ w : Fin (p + 1) → ℝ, c * (w ⬝ᵥ (B *ᵥ w)) ≤ w ⬝ᵥ (A *ᵥ w)j :Fin (p + 1)conclusionA⁻¹ j j ≤ B⁻¹ j j / cProof (Lean source)
theorem inv_diag_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)) (j : Fin (p + 1)) : A⁻¹ j j ≤ B⁻¹ j j / c := by let e : Fin (p + 1) → ℝ := single j 1 let w : Fin (p + 1) → ℝ := A⁻¹ *ᵥ e have hdet : IsUnit A.det := (Matrix.isUnit_iff_isUnit_det A).mp hA.isUnit have hAw : A *ᵥ w = e := by simpa [w] using congr_arg (fun M => M *ᵥ e) (Matrix.mul_nonsing_inv A hdet) have hew : e ⬝ᵥ w = A⁻¹ j j := by simp [e, w] have hquadA : w ⬝ᵥ (A *ᵥ w) = e ⬝ᵥ w := by rw [hAw, dotProduct_comm] have hoptA : A⁻¹ j j = 2 * (e ⬝ᵥ w) - w ⬝ᵥ (A *ᵥ w) := by rw [hquadA, hew] ring have hAB : 2 * (e ⬝ᵥ w) - w ⬝ᵥ (A *ᵥ w) ≤ 2 * (e ⬝ᵥ w) - c * (w ⬝ᵥ (B *ᵥ w)) := by linarith [hsand w] have hBvar := two_dotProduct_sub_quadForm_le_inv hB e (c • w) have hscale : 2 * (e ⬝ᵥ (c • w)) - (c • w) ⬝ᵥ (B *ᵥ (c • w)) = c * (2 * (e ⬝ᵥ w) - c * (w ⬝ᵥ (B *ᵥ w))) := by simp [Matrix.mulVec_smul] ring have hBscaled : c * (2 * (e ⬝ᵥ w) - c * (w ⬝ᵥ (B *ᵥ w))) ≤ B⁻¹ j j := by rw [hscale] at hBvar simpa [e] using hBvar have hBdiv : 2 * (e ⬝ᵥ w) - c * (w ⬝ᵥ (B *ᵥ w)) ≤ B⁻¹ j j / c := by rw [le_div_iff₀ hc] linarith rw [hoptA] exact hAB.trans hBdiv -
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 := inv_diag_le_of_quadForm_sandwich hA hB hc hsand 0 -
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 Generic unconditional risk bounds for a truncated estimator, lifting assumed conditional bias and variance estimates through a measurable good event. ★ estimatorBias_unconditional★ estimatorVariance_unconditional★ estimatorStochL2_unconditional
Generic full-sample-law bias / variance lifts for a truncated estimator
Generic unconditional risk bounds for a truncated estimator, lifting assumed conditional bias and variance estimates through a measurable good event.
The results take a sub-σ-algebra, a measurable good event, and the relevant conditional bias and variance bounds as hypotheses. They do not construct a random local-polynomial estimator or show that a design-concentration event supplies those hypotheses.
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. The caller must bound that probability and establish the
conditional hypotheses for the same estimator and event. The lift 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ᶜ)). Any specialization to local-polynomial rates requires the caller to prove the displayed choices of Vrate, Bsq, and the bad-event probability for one common random estimator and event.