Stat.Nonparametric.Local­Poly.Estimator­Risk

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

Density­Constants 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.

def weightMomentMatrix reviewed
Causalean.Stat.Nonparametric

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-jj, column-kk entry is the Lebesgue integral ∫W(u)ujuk du\int W(u)u^j u^k\,du for j,k=0,…,pj,k=0,\ldots,p.

Definition (Lean source)
p :
ℕ
W :
ℝ → ℝ
weightMomentMatrix p W :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
of (fun j k => ∫ u, W u * (u ^ (j : ℕ) * u ^ (k : ℕ)))
theorem weightMomentMatrix_quadForm_sandwich reviewed
Causalean.Stat.Nonparametric

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
p :
ℕ
shared
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, c * WG u ≤ WT u
v :
Fin (p + 1) → ℝ
c * (v ⬝ᵥ (weightMomentMatrix p WG *ᵥ v)) ≤ v ⬝ᵥ (weightMomentMatrix p WT *ᵥ v)
Proof (Lean source)
theorem weightMomentMatrix_quadForm_sandwich {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, c * WG u ≤ WT u) (v : Fin (p + 1) → ℝ) : c * (v ⬝ᵥ (weightMomentMatrix p WG *ᵥ v)) ≤ v ⬝ᵥ (weightMomentMatrix p WT *ᵥ v) := by have _hc := hc let s : ℝ → ℝ := fun u => ∑ j : Fin (p + 1), v j * u ^ (j : ℕ) 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))) 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))) rw [weightMomentMatrix_quadForm hintG v, weightMomentMatrix_quadForm hintT v] change c * (∫ u, WG u * (s u) ^ 2) ≤ ∫ u, WT u * (s u) ^ 2 rw [← MeasureTheory.integral_const_mul c (fun u => WG u * (s u) ^ 2)] exact MeasureTheory.integral_mono (hsqG.const_mul c) hsqT (fun u => by calc c * (WG u * (s u) ^ 2) = (c * WG u) * (s u) ^ 2 := by ring _ ≤ WT u * (s u) ^ 2 := mul_le_mul_of_nonneg_right (hdom u) (sq_nonneg _))
Causalean.Stat.Nonparametric.weightMomentMatrix_quadForm_sandwich · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityConstants.lean:118 · uses weightMomentMatrix
5 supporting declarations (lemmas, instances)
  • weightMomentMatrix_quadForm theorem — Gram quadratic form of the weight moment matrix. vᵀ (weightMomentMatrix p W) v = ∫ W(u) (∑ⱼ vⱼ uʲ)² du.
    p :
    ℕ
    shared
    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
    Proof (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))
    Causalean.Stat.Nonparametric.weightMomentMatrix_quadForm · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityConstants.lean:53
  • weightMomentMatrix_isHermitian theorem — The weight moment matrix is symmetric.
    p :
    ℕ
    shared
    W :
    ℝ → ℝ
    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))
    Causalean.Stat.Nonparametric.weightMomentMatrix_isHermitian · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityConstants.lean:111
  • weightMomentMatrix_quadForm_sandwich_upper theorem — 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.
    p :
    ℕ
    shared
    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))
    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)
    Causalean.Stat.Nonparametric.weightMomentMatrix_quadForm_sandwich_upper · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityConstants.lean:175
  • kernelDensity_lower_dom theorem — 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.
    K pdens :
    ℝ → ℝ
    t h cDesign :
    ℝ
    hh :
    0 < h
    hKnn :
    ∀ u, 0 ≤ K u
    hKsupp :
    ∀ u
    if
    1 < |u|
    then
    K u = 0
    hlo :
    ∀ a
    if
    |a - t| ≤ h
    then
    cDesign ≤ pdens a
    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]
    Causalean.Stat.Nonparametric.kernelDensity_lower_dom · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityConstants.lean:229
  • kernelDensity_upper_dom theorem — 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.
    K pdens :
    ℝ → ℝ
    t h CDesign :
    ℝ
    hh :
    0 < h
    hKnn :
    ∀ u, 0 ≤ K u
    hKsupp :
    ∀ u
    if
    1 < |u|
    then
    K u = 0
    hhi :
    ∀ a
    if
    |a - t| ≤ h
    then
    pdens a ≤ CDesign
    u :
    K u * pdens (t + h * u) ≤ CDesign * K u
    Proof (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]
    Causalean.Stat.Nonparametric.kernelDensity_upper_dom · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityConstants.lean:252
Density­Leverage 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.

theorem localPoly_density_inv00_rate reviewed
Causalean.Stat.Nonparametric

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
p :
ℕ
shared
N :
ℕ
h cDesign η c t :
ℝ
K pdens :
ℝ → ℝ
M B :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
hh :
0 < h
hN :
0 < (N : ℝ)
hcD :
0 < cDesign
hKnn :
∀ u, 0 ≤ K u
hKsupp :
∀ u
if
1 < |u|
then
K u = 0
hintT :
∀ j k : Fin (p + 1),
Integrable (fun u => (K u * pdens (t + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)))
hintG :
∀ j k : Fin (p + 1), Integrable (fun u => K u * (u ^ (j : ℕ) * u ^ (k : ℕ)))
hGpd :
hTpd :
(weightMomentMatrix p (fun u => K u * pdens (t + h * u))).PosDef
hlo :
∀ a
if
|a - t| ≤ h
then
cDesign ≤ pdens a
hMfactor :
M
= diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * B * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))
hc :
0 ≤ c
hη :
0 ≤ η
hBrow :
∀ i,
(∑ j, |(((N : ℝ) * h) • weightMomentMatrix p (fun u => K u * pdens (t + h * u)))⁻¹ i j|)
≤ c
hclose :
∀ j k,
|B j k - ((N : ℝ) * h) * weightMomentMatrix p (fun u => K u * pdens (t + h * u)) j k| ≤ η
hsmall :
c * ((p + 1 : ℕ) * η) ≤ 1 / 2
hpert :
2 * c ^ 2 * ((p + 1 : ℕ) * η) ≤ ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h)
conclusion 1
IsUnit M.det
conclusion 2
M⁻¹ 0 0 ≤ 2 * (((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h))
Proof (Lean source)
theorem localPoly_density_inv00_rate {N : ℕ} {h cDesign η c t : ℝ} {K pdens : ℝ → ℝ} {M B : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ} (hh : 0 < h) (hN : 0 < (N : ℝ)) (hcD : 0 < cDesign) (hKnn : ∀ u, 0 ≤ K u) (hKsupp : ∀ u, 1 < |u| → K u = 0) (hintT : ∀ j k : Fin (p + 1), Integrable (fun u => (K u * pdens (t + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (hintG : ∀ j k : Fin (p + 1), Integrable (fun u => K u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (hGpd : (weightMomentMatrix p K).PosDef) (hTpd : (weightMomentMatrix p (fun u => K u * pdens (t + h * u))).PosDef) (hlo : ∀ a, |a - t| ≤ h → cDesign ≤ pdens a) (hMfactor : M = diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * B * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))) (hc : 0 ≤ c) (hη : 0 ≤ η) (hBrow : ∀ i, (∑ j, |(((N : ℝ) * h) • weightMomentMatrix p (fun u => K u * pdens (t + h * u)))⁻¹ i j|) ≤ c) (hclose : ∀ j k, |B j k - ((N : ℝ) * h) * weightMomentMatrix p (fun u => K u * pdens (t + h * u)) j k| ≤ η) (hsmall : c * ((p + 1 : ℕ) * η) ≤ 1 / 2) (hpert : 2 * c ^ 2 * ((p + 1 : ℕ) * η) ≤ ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h)) : IsUnit M.det ∧ M⁻¹ 0 0 ≤ 2 * (((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h)) := by set G := weightMomentMatrix p K with hG set T := weightMomentMatrix p (fun u => K u * pdens (t + h * u)) with hT set R : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := ((N : ℝ) * h) • T with hRdef -- Loewner sandwich (lower): `cDesign · (wᵀ G w) ≤ wᵀ T w`. have hsand_lower : ∀ w : Fin (p + 1) → ℝ, cDesign * (w ⬝ᵥ (G *ᵥ w)) ≤ w ⬝ᵥ (T *ᵥ w) := fun w => weightMomentMatrix_quadForm_sandwich hcD.le hintT hintG (kernelDensity_lower_dom hh hKnn hKsupp hlo) w have hTinv00 : T⁻¹ 0 0 ≤ (weightMomentMatrix p K)⁻¹ 0 0 / cDesign := inv00_le_of_quadForm_sandwich hTpd hGpd hcD hsand_lower have hTunit : IsUnit T.det := (Matrix.isUnit_iff_isUnit_det T).mp hTpd.isUnit let κ : ℝ := (N : ℝ) * h have hκ : κ ≠ 0 := (mul_pos hN hh).ne' have hone : ∀ _i : Fin (p + 1), (1 : ℝ) ≠ 0 := fun _ => one_ne_zero have hone0 : (fun _j : Fin (p + 1) => (1 : ℝ)) 0 = 1 := rfl have hRfactor : R = κ • (diagonal (fun _j : Fin (p + 1) => (1 : ℝ)) * T * diagonal (fun _j : Fin (p + 1) => (1 : ℝ))) := by simp [R, κ] obtain ⟨hRunit, hRinv00_eq⟩ := inv00_diag_conj (κ := κ) hκ hone hone0 hTunit hRfactor have hRinv00 : R⁻¹ 0 0 ≤ ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h) := by rw [hRinv00_eq] have hκnonneg : 0 ≤ κ⁻¹ := inv_nonneg.mpr (mul_pos hN hh).le calc κ⁻¹ * T⁻¹ 0 0 ≤ κ⁻¹ * ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) := mul_le_mul_of_nonneg_left hTinv00 hκnonneg _ = ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h) := by simp [κ, div_eq_mul_inv, mul_comm] have hcloseR : ∀ j k, |B j k - R j k| ≤ η := by intro j k simpa [R, T, Matrix.smul_apply, smul_eq_mul] using hclose j k obtain ⟨hBunit, hBinv00⟩ := localPoly_inv00_rate hRunit hBrow hcloseR hsmall hRinv00 hpert have hd : ∀ i : Fin (p + 1), h ^ (i : ℕ) ≠ 0 := fun i => pow_ne_zero _ hh.ne' have hd0 : (fun j : Fin (p + 1) => h ^ (j : ℕ)) 0 = 1 := by simp have hMfactor' : M = (1 : ℝ) • (diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * B * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))) := by simpa using hMfactor obtain ⟨hMunit, hMinv00_eq⟩ := inv00_diag_conj (κ := (1 : ℝ)) one_ne_zero hd hd0 hBunit hMfactor' refine ⟨hMunit, ?_⟩ rw [hMinv00_eq] simpa [G] using hBinv00
Causalean.Stat.Nonparametric.localPoly_density_inv00_rate · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityLeverage.lean:51 · uses weightMomentMatrix
theorem localPoly_density_leverage_bound reviewed
Causalean.Stat.Nonparametric

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
p :
ℕ
shared
N :
ℕ
h cDesign CDesign η c t :
ℝ
K pdens :
ℝ → ℝ
M B :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
hh :
0 < h
hN :
0 < (N : ℝ)
hcD :
0 < cDesign
hcCD :
cDesign ≤ CDesign
hKnn :
∀ u, 0 ≤ K u
hKsupp :
∀ u
if
1 < |u|
then
K u = 0
hintT :
∀ j k : Fin (p + 1),
Integrable (fun u => (K u * pdens (t + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)))
hintG :
∀ j k : Fin (p + 1), Integrable (fun u => K u * (u ^ (j : ℕ) * u ^ (k : ℕ)))
hGpd :
hTpd :
(weightMomentMatrix p (fun u => K u * pdens (t + h * u))).PosDef
hlo :
∀ a
if
|a - t| ≤ h
then
cDesign ≤ pdens a
hhi :
∀ a
if
|a - t| ≤ h
then
pdens a ≤ CDesign
hMfactor :
M
= diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * B * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))
hc :
0 ≤ c
hη :
0 ≤ η
hBrow :
∀ i,
(∑ j, |(((N : ℝ) * h) • weightMomentMatrix p (fun u => K u * pdens (t + h * u)))⁻¹ i j|)
≤ c
hclose :
∀ j k,
|B j k - ((N : ℝ) * h) * weightMomentMatrix p (fun u => K u * pdens (t + h * u)) j k| ≤ η
hsmall :
c * ((p + 1 : ℕ) * η) ≤ 1 / 2
hpert :
2 * c ^ 2 * ((p + 1 : ℕ) * η) ≤ ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h)
hηle :
η ≤ (N : ℝ) * h
hB00 :
0 ≤ B 0 0
hBinv00 :
0 ≤ B⁻¹ 0 0
sqrt (M 0 0 * M⁻¹ 0 0)
≤ sqrt (2 * ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) * (CDesign * (weightMomentMatrix p K) 0 0 + 1))
Proof (Lean source)
theorem localPoly_density_leverage_bound {N : ℕ} {h cDesign CDesign η c t : ℝ} {K pdens : ℝ → ℝ} {M B : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ} (hh : 0 < h) (hN : 0 < (N : ℝ)) (hcD : 0 < cDesign) (hcCD : cDesign ≤ CDesign) (hKnn : ∀ u, 0 ≤ K u) (hKsupp : ∀ u, 1 < |u| → K u = 0) (hintT : ∀ j k : Fin (p + 1), Integrable (fun u => (K u * pdens (t + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (hintG : ∀ j k : Fin (p + 1), Integrable (fun u => K u * (u ^ (j : ℕ) * u ^ (k : ℕ)))) (hGpd : (weightMomentMatrix p K).PosDef) (hTpd : (weightMomentMatrix p (fun u => K u * pdens (t + h * u))).PosDef) (hlo : ∀ a, |a - t| ≤ h → cDesign ≤ pdens a) (hhi : ∀ a, |a - t| ≤ h → pdens a ≤ CDesign) (hMfactor : M = diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * B * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))) (hc : 0 ≤ c) (hη : 0 ≤ η) (hBrow : ∀ i, (∑ j, |(((N : ℝ) * h) • weightMomentMatrix p (fun u => K u * pdens (t + h * u)))⁻¹ i j|) ≤ c) (hclose : ∀ j k, |B j k - ((N : ℝ) * h) * weightMomentMatrix p (fun u => K u * pdens (t + h * u)) j k| ≤ η) (hsmall : c * ((p + 1 : ℕ) * η) ≤ 1 / 2) (hpert : 2 * c ^ 2 * ((p + 1 : ℕ) * η) ≤ ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) / ((N : ℝ) * h)) (hηle : η ≤ (N : ℝ) * h) (hB00 : 0 ≤ B 0 0) (hBinv00 : 0 ≤ B⁻¹ 0 0) : sqrt (M 0 0 * M⁻¹ 0 0) ≤ sqrt (2 * ((weightMomentMatrix p K)⁻¹ 0 0 / cDesign) * (CDesign * (weightMomentMatrix p K) 0 0 + 1)) := by set G := weightMomentMatrix p K with hG set T := weightMomentMatrix p (fun u => K u * pdens (t + h * u)) with hT set R : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ := ((N : ℝ) * h) • T with hRdef have hsand_lower : ∀ w : Fin (p + 1) → ℝ, cDesign * (w ⬝ᵥ (G *ᵥ w)) ≤ w ⬝ᵥ (T *ᵥ w) := fun w => weightMomentMatrix_quadForm_sandwich hcD.le hintT hintG (kernelDensity_lower_dom hh hKnn hKsupp hlo) w have hsand_upper : ∀ w : Fin (p + 1) → ℝ, w ⬝ᵥ (T *ᵥ w) ≤ CDesign * (w ⬝ᵥ (G *ᵥ w)) := fun w => weightMomentMatrix_quadForm_sandwich_upper (hcD.le.trans hcCD) hintT hintG (kernelDensity_upper_dom hh hKnn hKsupp hhi) w have hTinv00 : T⁻¹ 0 0 ≤ G⁻¹ 0 0 / cDesign := inv00_le_of_quadForm_sandwich hTpd hGpd hcD hsand_lower have hT00 : T 0 0 ≤ CDesign * G 0 0 := entry00_le_of_quadForm_sandwich hsand_upper have hTunit : IsUnit T.det := (Matrix.isUnit_iff_isUnit_det T).mp hTpd.isUnit let κ : ℝ := (N : ℝ) * h have hκ : κ ≠ 0 := (mul_pos hN hh).ne' have hone : ∀ _i : Fin (p + 1), (1 : ℝ) ≠ 0 := fun _ => one_ne_zero have hone0 : (fun _j : Fin (p + 1) => (1 : ℝ)) 0 = 1 := rfl have hRfactor : R = κ • (diagonal (fun _j : Fin (p + 1) => (1 : ℝ)) * T * diagonal (fun _j : Fin (p + 1) => (1 : ℝ))) := by simp [R, κ] obtain ⟨hRunit, hRinv00eq⟩ := inv00_diag_conj (κ := κ) hκ hone hone0 hTunit hRfactor have hR00eq := top00_diag_conj (κ := κ) hone0 hRfactor have hRinv00 : R⁻¹ 0 0 ≤ (G⁻¹ 0 0 / cDesign) / ((N : ℝ) * h) := by rw [hRinv00eq] have hκnonneg : 0 ≤ κ⁻¹ := inv_nonneg.mpr (mul_pos hN hh).le calc κ⁻¹ * T⁻¹ 0 0 ≤ κ⁻¹ * (G⁻¹ 0 0 / cDesign) := mul_le_mul_of_nonneg_left hTinv00 hκnonneg _ = (G⁻¹ 0 0 / cDesign) / ((N : ℝ) * h) := by simp [κ, div_eq_mul_inv, mul_comm] have hR00 : R 0 0 ≤ (CDesign * G 0 0) * ((N : ℝ) * h) := by rw [hR00eq] exact mul_le_mul_of_nonneg_left hT00 (mul_pos hN hh).le |>.trans_eq (by ring) have hGinv00_nn : 0 ≤ G⁻¹ 0 0 := by have h := hGpd.posSemidef.inv.dotProduct_mulVec_nonneg (single (0 : Fin (p + 1)) (1 : ℝ)) rw [inv00_eq_quadForm G]; simpa using h have hcInv_nn : 0 ≤ G⁻¹ 0 0 / cDesign := div_nonneg hGinv00_nn hcD.le have hcloseR : ∀ j k, |B j k - R j k| ≤ η := by intro j k simpa [R, T, Matrix.smul_apply, smul_eq_mul] using hclose j k have hBlev := localPoly_leverage_bound (mul_pos hN hh) hRunit hBrow hcloseR hsmall hRinv00 hpert hR00 hηle hB00 hBinv00 have hd : ∀ i : Fin (p + 1), h ^ (i : ℕ) ≠ 0 := fun i => pow_ne_zero _ hh.ne' have hd0 : (fun j : Fin (p + 1) => h ^ (j : ℕ)) 0 = 1 := by simp obtain ⟨hBunit, _⟩ := localPoly_inv00_rate hRunit hBrow hcloseR hsmall hRinv00 hpert have hMfactor' : M = (1 : ℝ) • (diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * B * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))) := by simpa using hMfactor obtain ⟨_hMunit, hMinv00eq⟩ := inv00_diag_conj (κ := (1 : ℝ)) one_ne_zero hd hd0 hBunit hMfactor' have hM00eq := top00_diag_conj (κ := (1 : ℝ)) hd0 hMfactor' rw [hMinv00eq, hM00eq] simpa using hBlev
Causalean.Stat.Nonparametric.localPoly_density_leverage_bound · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/DensityLeverage.lean:137 · uses weightMomentMatrix
Estimator­Risk 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.

theorem localPoly_estimatorBias_window reviewed
Causalean.Stat.Nonparametric

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
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 :
hb :
∀ x ∈ Icc lo hi,
∀ y ∈ Icc lo hi,
≤ 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 ^ β
Proof (Lean source)
theorem localPoly_estimatorBias_window {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 : ContDiff ℝ (holderDerivOrder β) f) (hb : ∀ x ∈ Icc lo hi, ∀ y ∈ Icc lo hi, |iteratedDeriv (holderDerivOrder β) f x - iteratedDeriv (holderDerivOrder β) f 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 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
theorem localPoly_estimatorStochL2 reviewed
Causalean.Stat.Nonparametric

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
Ω :
Type*
N p :
ℕ
x w :
Fin N → ℝ
Y :
Fin N → Ω → ℝ
σbar W cInv Nh :
ℝ
hY :
∀ i, MemLp (Y i) 2 μ
hnoise :
hMdet :
IsUnit (designMatrix p x w).det
hw :
∀ i, 0 ≤ w i
hwW :
∀ i, w i ≤ W
hW :
0 ≤ W
hcInv :
0 ≤ cInv
hrate :
(designMatrix p x w)⁻¹ 0 0 ≤ 2 * (cInv / Nh)
sqrt (Var[fun ω => ∑ i, equivKernelWeight p x w i * Y i ω; μ])
≤ sqrt (2 * σbar ^ 2 * W * cInv) * sqrt Nh⁻¹
Proof (Lean source)
theorem localPoly_estimatorStochL2 {Ω : Type*} {N p : ℕ} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] {x w : Fin N → ℝ} {Y : Fin N → Ω → ℝ} {σbar W cInv Nh : ℝ} (hY : ∀ i, MemLp (Y i) 2 μ) (hnoise : UncorrelatedVarianceFamily Y μ σbar) (hMdet : IsUnit (designMatrix p x w).det) (hw : ∀ i, 0 ≤ w i) (hwW : ∀ i, w i ≤ W) (hW : 0 ≤ W) (hcInv : 0 ≤ cInv) (hrate : (designMatrix p x w)⁻¹ 0 0 ≤ 2 * (cInv / Nh)) : sqrt (Var[fun ω => ∑ i, equivKernelWeight p x w i * Y i ω; μ]) ≤ sqrt (2 * σbar ^ 2 * W * cInv) * sqrt Nh⁻¹ := by have hvar := localPoly_intercept_variance_le hY hnoise hMdet hw hwW have hσ2 : 0 ≤ σbar ^ 2 := sq_nonneg σbar have hVarbd : Var[fun ω => ∑ i, equivKernelWeight p x w i * Y i ω; μ] ≤ 2 * σbar ^ 2 * W * cInv * Nh⁻¹ := by refine le_trans hvar ?_ have hWm : W * (designMatrix p x w)⁻¹ 0 0 ≤ W * (2 * (cInv / Nh)) := mul_le_mul_of_nonneg_left hrate hW calc σbar ^ 2 * (W * (designMatrix p x w)⁻¹ 0 0) ≤ σbar ^ 2 * (W * (2 * (cInv / Nh))) := mul_le_mul_of_nonneg_left hWm hσ2 _ = 2 * σbar ^ 2 * W * cInv * Nh⁻¹ := by rw [div_eq_mul_inv]; ring have hCvar_nn : 0 ≤ 2 * σbar ^ 2 * W * cInv := mul_nonneg (mul_nonneg (mul_nonneg (by norm_num) hσ2) hW) hcInv calc sqrt (Var[fun ω => ∑ i, equivKernelWeight p x w i * Y i ω; μ]) ≤ sqrt (2 * σbar ^ 2 * W * cInv * Nh⁻¹) := Real.sqrt_le_sqrt hVarbd _ = sqrt (2 * σbar ^ 2 * W * cInv) * sqrt Nh⁻¹ := Real.sqrt_mul hCvar_nn _
1 supporting declaration (lemmas, instances)
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.

def popDesignMatrix reviewed
Causalean.Stat.Nonparametric

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 (j,k)(j,k) entry is N∫K((a−t)/h)(a−t)j+kp(a) daN\int K((a-t)/h)(a-t)^{j+k}p(a)\,da.

Definition (Lean source)
p N :
ℕ
K pdens :
ℝ → ℝ
t h :
ℝ
popDesignMatrix p N K pdens t h :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
of (fun j k => (N : ℝ) * ∫ a, K ((a - t) / h) * (a - t) ^ ((j : ℕ) + (k : ℕ)) * pdens a)
theorem popDesignMatrix_factor reviewed
Causalean.Stat.Nonparametric

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
p :
ℕ
shared
N :
ℕ
K pdens :
ℝ → ℝ
t h :
ℝ
hh :
0 < h
popDesignMatrix p N K pdens t h
= ((N : ℝ) * h) • (diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * weightMomentMatrix p (fun u => K u * pdens (t + h * u)) * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)))
Proof (Lean source)
theorem popDesignMatrix_factor (N : ℕ) (K pdens : ℝ → ℝ) (t h : ℝ) (hh : 0 < h) : popDesignMatrix p N K pdens t h = ((N : ℝ) * h) • (diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * weightMomentMatrix p (fun u => K u * pdens (t + h * u)) * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))) := by ext j k simp only [popDesignMatrix, Matrix.of_apply, Matrix.smul_apply, smul_eq_mul, Matrix.diagonal_mul, Matrix.mul_diagonal, weightMomentMatrix] rw [popMomentEntry_changeOfVar K pdens t h hh ((j : ℕ) + (k : ℕ))] have hint : (∫ u, K u * u ^ ((j : ℕ) + (k : ℕ)) * pdens (t + h * u)) = ∫ u, (K u * pdens (t + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)) := by refine integral_congr_ae (Filter.Eventually.of_forall (fun u => ?_)) ring rw [hint] ring
1 supporting declaration (lemmas, instances)
  • popMomentEntry_changeOfVar theorem — 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.
    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)
    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
    Causalean.Stat.Nonparametric.popMomentEntry_changeOfVar · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/Factorization.lean:42
Square­Completion 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.

theorem two_dotProduct_sub_quadForm_le_inv reviewed
Causalean.Stat.Nonparametric

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
p :
ℕ
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
shared
hA :
A.PosDef
e w :
Fin (p + 1) → ℝ
2 * (e ⬝ᵥ w) - w ⬝ᵥ (A *ᵥ w) ≤ e ⬝ᵥ (A⁻¹ *ᵥ e)
Proof (Lean source)
theorem two_dotProduct_sub_quadForm_le_inv {A : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ} (hA : A.PosDef) (e w : Fin (p + 1) → ℝ) : 2 * (e ⬝ᵥ w) - w ⬝ᵥ (A *ᵥ w) ≤ e ⬝ᵥ (A⁻¹ *ᵥ e) := by let u : Fin (p + 1) → ℝ := (A⁻¹ *ᵥ e) have hdet : IsUnit A.det := Matrix.isUnit_iff_isUnit_det A |>.mp hA.isUnit have hAu : A *ᵥ u = e := by simpa [u] using congr_arg (fun M => M *ᵥ e) (Matrix.mul_nonsing_inv A hdet) have hsym : ∀ x y : Fin (p + 1), A x y = A y x := by intro x y have h := congr_fun₂ hA.isHermitian.eq y x simpa [conjTranspose] using h have hcross : u ⬝ᵥ (A *ᵥ w) = e ⬝ᵥ w := by rw [Matrix.dotProduct_mulVec] have hvec : u ᵥ* A = A *ᵥ u := by ext i rw [vecMul, mulVec] simp only [hsym] exact dotProduct_comm _ _ rw [hvec, hAu] have hlast : u ⬝ᵥ e = e ⬝ᵥ (A⁻¹ *ᵥ e) := by dsimp [u] rw [dotProduct_comm] have h0 : 0 ≤ (w - u) ⬝ᵥ (A *ᵥ (w - u)) := by simpa using hA.posSemidef.dotProduct_mulVec_nonneg (w - u) have hexpand : (w - u) ⬝ᵥ (A *ᵥ (w - u)) = w ⬝ᵥ (A *ᵥ w) - 2 * (e ⬝ᵥ w) + e ⬝ᵥ (A⁻¹ *ᵥ e) := by rw [Matrix.mulVec_sub, dotProduct_sub, sub_dotProduct, sub_dotProduct] rw [hAu, hcross, hlast] rw [dotProduct_comm w e] ring rw [hexpand] at h0 linarith
Causalean.Stat.Nonparametric.two_dotProduct_sub_quadForm_le_inv · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/SquareCompletion.lean:42
5 supporting declarations (lemmas, instances)
  • inv00_eq_quadForm theorem — 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.
    p :
    ℕ
    shared
    A :
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    A⁻¹ 0 0 = (single (0 : Fin (p + 1)) (1 : ℝ)) ⬝ᵥ (A⁻¹ *ᵥ single 0 1)
    Proof (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_quadForm theorem — 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.
    p :
    ℕ
    shared
    A :
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    A 0 0 = (single (0 : Fin (p + 1)) (1 : ℝ)) ⬝ᵥ (A *ᵥ single 0 1)
    Proof (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_sandwich theorem — 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.
    p :
    ℕ
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    shared
    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
    Proof (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
    Causalean.Stat.Nonparametric.inv_diag_le_of_quadForm_sandwich · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/SquareCompletion.lean:92
  • inv00_le_of_quadForm_sandwich theorem — 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 satisfy
    p :
    ℕ
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    shared
    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
    Proof (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
    Causalean.Stat.Nonparametric.inv00_le_of_quadForm_sandwich · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/SquareCompletion.lean:134
  • entry00_le_of_quadForm_sandwich theorem — 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.)
    p :
    ℕ
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    shared
    C :
    ℝ
    hsand :
    ∀ w : Fin (p + 1) → ℝ, w ⬝ᵥ (A *ᵥ w) ≤ C * (w ⬝ᵥ (B *ᵥ w))
    A 0 0 ≤ C * B 0 0
    Proof (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 : ℝ))
    Causalean.Stat.Nonparametric.entry00_le_of_quadForm_sandwich · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/SquareCompletion.lean:147
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.

theorem estimatorBias_unconditional reviewed
Causalean.Stat.Nonparametric

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
Ω :
Type u_1
Ω → ℝ
shared
θ B M :
ℝ
G :
Set Ω
hm :
m ≤ m0
hest :
Integrable est μ
hM :
∀ ω, |est ω| ≤ M
hθ :
|θ| ≤ M
hB :
0 ≤ B
hG :
hcond :
∀ᵐ ω ∂μ, ω ∈ G → |(μ[est | m]) ω - θ| ≤ B
|(∫ ω, est ω ∂μ) - θ| ≤ B + 2 * M * (μ Gᶜ).toReal
Proof (Lean source)
theorem estimatorBias_unconditional {est : Ω → ℝ} {θ B M : ℝ} {G : Set Ω} (hm : m ≤ m0) (hest : Integrable est μ) (hM : ∀ ω, |est ω| ≤ M) (hθ : |θ| ≤ M) (hB : 0 ≤ B) (hG : MeasurableSet[m] G) (hcond : ∀ᵐ ω ∂μ, ω ∈ G → |(μ[est | m]) ω - θ| ≤ B) : |(∫ ω, est ω ∂μ) - θ| ≤ B + 2 * M * (μ Gᶜ).toReal := by have hGm0 : MeasurableSet[m0] G := hm _ hG have hcE_int : Integrable (μ[est | m]) μ := integrable_condExp have hg_int : Integrable (fun ω => (μ[est | m]) ω - θ) μ := hcE_int.sub (integrable_const θ) -- `∫ est = ∫ 𝔼[est | m]`, so the bias is the mean of `𝔼[est | m] − θ`. have hbias_eq : (∫ ω, est ω ∂μ) - θ = ∫ ω, ((μ[est | m]) ω - θ) ∂μ := by rw [integral_sub hcE_int (integrable_const θ), integral_const, integral_condExp hm, probReal_univ, one_smul] rw [hbias_eq] refine (abs_integral_le_integral_abs).trans ?_ -- bad-side global a.e. bound `|𝔼[est | m] − θ| ≤ 2M`. have habsM := abs_condExp_le_of_bound hm hest hM have hθ' := abs_le.1 hθ have hbad : ∀ᵐ ω ∂μ, ω ∈ Gᶜ → |(μ[est | m]) ω - θ| ≤ 2 * M := by filter_upwards [habsM] with ω hω _ have h1 := abs_le.1 hω rw [abs_le]; constructor <;> linarith [h1.1, h1.2, hθ'.1, hθ'.2] have hsplit := split_bound hg_int.abs hGm0 hcond hbad refine hsplit.trans ?_ have hμG : (μ G).toReal ≤ 1 := by rw [← ENNReal.toReal_one]; exact ENNReal.toReal_mono (by simp) prob_le_one have hBG : B * (μ G).toReal ≤ B := by nlinarith [hB, hμG, ENNReal.toReal_nonneg (a := μ G)] linarith
Causalean.Stat.Nonparametric.estimatorBias_unconditional · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/Unconditional.lean:82
theorem estimatorVariance_unconditional reviewed
Causalean.Stat.Nonparametric

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
Ω :
Type u_1
Ω → ℝ
shared
θ Bsq Vrate M :
ℝ
G :
Set Ω
hm :
m ≤ m0
hest :
MemLp est 2 μ
hM :
∀ ω, |est ω| ≤ M
hθ :
|θ| ≤ M
hVr :
0 ≤ Vrate
hBsq :
0 ≤ Bsq
hG :
hVcond :
∀ᵐ ω ∂μ, ω ∈ G → (Var[est; μ | m]) ω ≤ Vrate
hBcond :
∀ᵐ ω ∂μ, ω ∈ G → ((μ[est | m]) ω - θ) ^ 2 ≤ Bsq
Var[est; μ] ≤ Vrate + Bsq + 5 * M ^ 2 * (μ Gᶜ).toReal
Proof (Lean source)
theorem estimatorVariance_unconditional {est : Ω → ℝ} {θ Bsq Vrate M : ℝ} {G : Set Ω} (hm : m ≤ m0) (hest : MemLp est 2 μ) (hM : ∀ ω, |est ω| ≤ M) (hθ : |θ| ≤ M) (hVr : 0 ≤ Vrate) (hBsq : 0 ≤ Bsq) (hG : MeasurableSet[m] G) (hVcond : ∀ᵐ ω ∂μ, ω ∈ G → (Var[est; μ | m]) ω ≤ Vrate) (hBcond : ∀ᵐ ω ∂μ, ω ∈ G → ((μ[est | m]) ω - θ) ^ 2 ≤ Bsq) : Var[est; μ] ≤ Vrate + Bsq + 5 * M ^ 2 * (μ Gᶜ).toReal := by have hMnn : 0 ≤ M := le_trans (abs_nonneg θ) hθ have hM2nn : 0 ≤ M ^ 2 := sq_nonneg M have hGm0 : MeasurableSet[m0] G := hm _ hG have hest_int : Integrable est μ := hest.integrable one_le_two have hμG : (μ G).toReal ≤ 1 := by rw [← ENNReal.toReal_one]; exact ENNReal.toReal_mono (by simp) prob_le_one have hμGcnn : (0 : ℝ) ≤ (μ Gᶜ).toReal := ENNReal.toReal_nonneg -- Law of total variance: `Var(est) = 𝔼[Var(est | m)] + Var(𝔼[est | m])`. have htot := integral_condVar_add_variance_condExp hm hest have hθ' := abs_le.1 hθ -- ===== Term 1: `𝔼[Var(est | m)] ≤ Vrate + M²·μ(Gᶜ)` ===== have hcondVar_int : Integrable (Var[est; μ | m]) μ := integrable_condVar -- off-`G` bound on the conditional variance: `Var[est | m] ≤ 𝔼[est² | m] ≤ M²`. have hCV_le_sq : Var[est; μ | m] ≤ᵐ[μ] μ[fun ω => est ω ^ 2 | m] := condVar_ae_le_condExp_sq hm hest have hsq_le_M2 : μ[fun ω => est ω ^ 2 | m] ≤ᵐ[μ] (fun _ => M ^ 2) := by have h := condExp_mono (m := m) hest.integrable_sq (integrable_const (M ^ 2)) (Filter.Eventually.of_forall fun ω => by nlinarith [sq_abs (est ω), hM ω, abs_nonneg (est ω)]) rwa [condExp_const hm] at h have hCV_bad : ∀ᵐ ω ∂μ, ω ∈ Gᶜ → (Var[est; μ | m]) ω ≤ M ^ 2 := by filter_upwards [hCV_le_sq, hsq_le_M2] with ω h1 h2 _ using le_trans h1 h2 have hT1 : (∫ ω, (Var[est; μ | m]) ω ∂μ) ≤ Vrate + M ^ 2 * (μ Gᶜ).toReal := by refine (split_bound hcondVar_int hGm0 hVcond hCV_bad).trans ?_ have hVG : Vrate * (μ G).toReal ≤ Vrate := by nlinarith [hVr, hμG, ENNReal.toReal_nonneg (a := μ G)] linarith -- ===== Term 2: `Var(𝔼[est | m]) ≤ Bsq + 4M²·μ(Gᶜ)` ===== have hcE_memLp : MemLp (μ[est | m]) 2 μ := MemLp.condExp (by norm_num) hest have hZ_memLp : MemLp (fun ω => (μ[est | m]) ω - θ) 2 μ := hcE_memLp.sub (memLp_const θ) have hZsq_int : Integrable (fun ω => ((μ[est | m]) ω - θ) ^ 2) μ := hZ_memLp.integrable_sq have habsM := abs_condExp_le_of_bound hm hest_int hM -- `Var(𝔼[est | m]) = Var(𝔼[est | m] − θ) ≤ 𝔼[(𝔼[est | m] − θ)²]`. have hVarcE_le : Var[μ[est | m]; μ] ≤ ∫ ω, ((μ[est | m]) ω - θ) ^ 2 ∂μ := by have hveq : Var[μ[est | m]; μ] = Var[fun ω => (μ[est | m]) ω - θ; μ] := (variance_sub_const hcE_memLp.aestronglyMeasurable θ).symm rw [hveq] have h := variance_le_expectation_sq (μ := μ) hZ_memLp.aestronglyMeasurable simpa [pow_two, Pi.pow_apply] using h -- off-`G` bound on `(𝔼[est | m] − θ)²≤ (2M)² = 4M²`. have hZsq_bad : ∀ᵐ ω ∂μ, ω ∈ Gᶜ → ((μ[est | m]) ω - θ) ^ 2 ≤ 4 * M ^ 2 := by filter_upwards [habsM] with ω hω _ have h1 := abs_le.1 hω have hlo : -(2 * M) ≤ (μ[est | m]) ω - θ := by linarith [h1.1, hθ'.2] have hhi : (μ[est | m]) ω - θ ≤ 2 * M := by linarith [h1.2, hθ'.1] nlinarith [hlo, hhi] have hT2 : Var[μ[est | m]; μ] ≤ Bsq + 4 * M ^ 2 * (μ Gᶜ).toReal := by refine hVarcE_le.trans ?_ refine (split_bound hZsq_int hGm0 hBcond hZsq_bad).trans ?_ have hBG : Bsq * (μ G).toReal ≤ Bsq := by nlinarith [hBsq, hμG, ENNReal.toReal_nonneg (a := μ G)] linarith -- ===== Assemble via the law of total variance ===== rw [← htot] have heq : μ[Var[est; μ | m]] = ∫ ω, (Var[est; μ | m]) ω ∂μ := rfl rw [heq] exact (add_le_add hT1 hT2).trans_eq (by ring)
Causalean.Stat.Nonparametric.estimatorVariance_unconditional · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/Unconditional.lean:117
theorem estimatorStochL2_unconditional reviewed
Causalean.Stat.Nonparametric

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.

Formal statement
Ω :
Type u_1
Ω → ℝ
shared
θ Bsq Vrate M :
ℝ
G :
Set Ω
hm :
m ≤ m0
hest :
MemLp est 2 μ
hM :
∀ ω, |est ω| ≤ M
hθ :
|θ| ≤ M
hVr :
0 ≤ Vrate
hBsq :
0 ≤ Bsq
hG :
hVcond :
∀ᵐ ω ∂μ, ω ∈ G → (Var[est; μ | m]) ω ≤ Vrate
hBcond :
∀ᵐ ω ∂μ, ω ∈ G → ((μ[est | m]) ω - θ) ^ 2 ≤ Bsq
sqrt (Var[est; μ]) ≤ sqrt (Vrate + Bsq + 5 * M ^ 2 * (μ Gᶜ).toReal)
Proof (Lean source)
theorem estimatorStochL2_unconditional {est : Ω → ℝ} {θ Bsq Vrate M : ℝ} {G : Set Ω} (hm : m ≤ m0) (hest : MemLp est 2 μ) (hM : ∀ ω, |est ω| ≤ M) (hθ : |θ| ≤ M) (hVr : 0 ≤ Vrate) (hBsq : 0 ≤ Bsq) (hG : MeasurableSet[m] G) (hVcond : ∀ᵐ ω ∂μ, ω ∈ G → (Var[est; μ | m]) ω ≤ Vrate) (hBcond : ∀ᵐ ω ∂μ, ω ∈ G → ((μ[est | m]) ω - θ) ^ 2 ≤ Bsq) : sqrt (Var[est; μ]) ≤ sqrt (Vrate + Bsq + 5 * M ^ 2 * (μ Gᶜ).toReal) := Real.sqrt_le_sqrt (estimatorVariance_unconditional hm hest hM hθ hVr hBsq hG hVcond hBcond)
Causalean.Stat.Nonparametric.estimatorStochL2_unconditional · Causalean/Stat/Nonparametric/LocalPoly/EstimatorRisk/Unconditional.lean:189