Stat.Nonparametric.Local­Poly.Random­Design­Rate

One-dimensional random-design local-polynomial rates: kernel-moment Bernstein concentration, a deterministic design-event bridge, and unconditional clipped-intercept pointwise MSE and balancing-bandwidth bounds.

Basic 19 core · 6 supporting The setting is one-dimensional local-polynomial regression at an interior point x₀. ★ of_contDiff

Random-design local-polynomial regression in dimension one: model, constants, estimator

The setting is one-dimensional local-polynomial regression at an interior point x₀. The design points are independent draws from a law with a Lebesgue density that is bounded above and below by positive constants on a window [x₀ − r, x₀ + r]; the kernel is measurable, nonnegative, bounded, supported on [−1, 1], and bounded below on a subinterval [−Δ, Δ].

This file defines the two bundles of assumptions (KernelDesign with the upper bounds only, and InteriorDesign adding the lower bounds), the kernel-weighted empirical and population moment matrices and the event on which they are entrywise close, the explicit constants that enter the risk bound, the local Hölder class of regression functions, and the estimator: the weighted least-squares intercept (zero by convention when the weighted design matrix is singular) and its clipped version.

References: Tsybakov (2009), Introduction to Nonparametric Estimation, §1.6 (https://doi.org/10.1007/b13794); Fan and Gijbels (1996), Local Polynomial Modelling and Its Applications, Theorem 3.1; Stone (1982), Optimal global rates of convergence for nonparametric regression. Tsybakov's Theorem 1.7 is stated for a fixed design; the concentration step of this directory supplies the random-design argument.

structure KernelDesign reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Design law and kernel for kernel-weighted moments in dimension one. The design points are drawn from a probability law on the real line with a measurable nonnegative Lebesgue density f. Around the evaluation point x₀ there is a window [x₀ − r, x₀ + r] of positive radius on which f ≤ f_max. The kernel K is measurable, nonnegative, zero outside [−1, 1] and at most K_max.

Definition (Lean source)
The law of one design point.
law :
The design law is a probability measure.
probability :
The design density `f`.
density :
ℝ → ℝ
The design density is measurable.
density_measurable :
Measurable density
The design density is nonnegative.
density_nonneg :
∀ x, 0 ≤ density x
The design law has density `f` with respect to Lebesgue measure.
law_density :
law = volume.withDensity (fun x => ofReal (density x))
The evaluation point `x₀`.
center :
ℝ
The radius `r` of the window `[x₀ − r, x₀ + r]` on which the density bounds hold.
radius :
ℝ
The window has positive radius.
radius_pos :
0 < radius
The upper density bound `f_max`.
upper :
ℝ
The density is at most `f_max` on the window.
density_upper :
∀ x
if
|x - center| ≤ radius
then
density x ≤ upper
The kernel `K`.
kernel :
ℝ → ℝ
The kernel is measurable.
kernel_measurable :
Measurable kernel
The kernel is nonnegative.
kernel_nonneg :
∀ u, 0 ≤ kernel u
The kernel vanishes outside `[−1, 1]`.
kernel_support :
∀ u
if
1 < |u|
then
kernel u = 0
The upper kernel bound `K_max`.
kernelMax :
ℝ
The kernel is at most `K_max`.
kernel_upper :
∀ u, kernel u ≤ kernelMax
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.KernelDesign · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:44
structure InteriorDesign reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Design, kernel and evaluation point for one-dimensional local-polynomial regression at an interior point. In addition to a design law whose density f is at most f_max on a window [x₀ − r, x₀ + r] around the evaluation point, and a measurable nonnegative kernel K ≤ K_max vanishing outside [−1, 1], the density satisfies f ≥ f_min on the window with f_min > 0, and the kernel is at least K_min with K_min > 0 on an interval [−Δ, Δ] with Δ > 0.

Definition (Lean source)
extends :
The lower density bound `f_min`.
lower :
ℝ
The lower density bound is positive.
lower_pos :
0 < lower
The density is at least `f_min` on the window.
density_lower :
∀ x
if
|x - center| ≤ radius
then
lower ≤ density x
The half-width `Δ` of the interval on which the kernel is bounded below.
subradius :
ℝ
The interval `[−Δ, Δ]` has positive length.
subradius_pos :
0 < subradius
The lower kernel bound `K_min`.
kernelMin :
ℝ
The lower kernel bound is positive.
kernelMin_pos :
0 < kernelMin
The kernel is at least `K_min` on `[−Δ, Δ]`.
kernel_lower :
∀ u
if
|u| ≤ subradius
then
kernelMin ≤ kernel u
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.InteriorDesign · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:92
def momentSummand reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a kernel K and an evaluation point x₀, as carried by a design, a bandwidth h, two exponents j and k and a design point x, the kernel-weighted monomial is K(u) · u^j · u^k with u = (x − x₀)/h.

Definition (Lean source)
h :
ℝ
j k :
ℕ
x :
ℝ
momentSummand D h j k x :
ℝ
D.kernel ((x - D.center) / h) * (((x - D.center) / h) ^ j * ((x - D.center) / h) ^ k)
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:156 · uses KernelDesign
def populationMoment reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design law with kernel K and evaluation point x₀, a polynomial degree p and a bandwidth h, the population moment matrix is the (p+1) × (p+1) matrix whose (j,k) entry is E[K(u) u^(j+k)] / h, where u = (X − x₀)/h and X is one draw from the design law.

Definition (Lean source)
p :
ℕ
h :
ℝ
populationMoment D p h :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
fun j k => (∫ x, momentSummand D h j k x ∂D.law) / h
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.populationMoment · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:163 · uses KernelDesign
def empiricalMoment reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a kernel K and evaluation point x₀, as carried by a design, a polynomial degree p, a bandwidth h and design points x_1, …, x_N, the empirical moment matrix is the (p+1) × (p+1) matrix whose (j,k) entry is (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), where u_i = (x_i − x₀)/h.

Definition (Lean source)
p :
ℕ
h :
ℝ
N :
ℕ
x :
Fin N → ℝ
empiricalMoment D p h x :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
fun j k => (∑ i, momentSummand D h j k (x i)) / ((N : ℝ) * h)
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.empiricalMoment · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:171 · uses KernelDesign
def momentEvent reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design law with kernel K and evaluation point x₀, a polynomial degree p, a bandwidth h, a sample size N and a tolerance t, the moment event is the set of design vectors (x_1, …, x_N) for which every entry (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i = (x_i − x₀)/h, 0 ≤ j, k ≤ p, of the empirical moment matrix is within t of its expectation E[K(u) u^(j+k)] / h.

Definition (Lean source)
p :
ℕ
h :
ℝ
N :
ℕ
t :
ℝ
momentEvent D p h N t :
Set (Fin N → ℝ)
{x | ∀ j k, |empiricalMoment D p h x j k - populationMoment D p h j k| ≤ t}
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentEvent · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:179 · uses KernelDesign
def referenceMoment reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a kernel that is at least K_min > 0 on an interval [−Δ, Δ], as carried by a design, and a polynomial degree p, the reference moment matrix is the (p+1) × (p+1) matrix with (j,k) entry ∫_{−Δ}^{Δ} u^(j+k) du.

Definition (Lean source)
p :
ℕ
referenceMoment D p :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
weightMomentMatrix p (Icc (-D.subradius) D.subradius |>.indicator (fun _ => 1))
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.referenceMoment · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:188 · uses InteriorDesign
def inverseRowConstant reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design whose density is at least f_min > 0 near the evaluation point and whose kernel is at least K_min > 0 on [−Δ, Δ], and a polynomial degree p, the inverse-row constant is c_row = (p+1) · tr(R⁻¹) / (f_min K_min), where R is the matrix of monomial moments ∫_{−Δ}^{Δ} u^(j+k) du.

Definition (Lean source)
p :
ℕ
inverseRowConstant D p :
ℝ
(p + 1 : ℝ) * (∑ j, (referenceMoment D p)⁻¹ j j) / (D.lower * D.kernelMin)
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.inverseRowConstant · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:195 · uses InteriorDesign
def inverseConstant reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design whose density is at least f_min > 0 near the evaluation point, with kernel K, and a polynomial degree p, the intercept inverse constant is c_inv = (G⁻¹)₀₀ / f_min, where G is the (p+1) × (p+1) kernel moment matrix with (j,k) entry ∫ K(u) u^(j+k) du.

Definition (Lean source)
p :
ℕ
inverseConstant D p :
ℝ
(weightMomentMatrix p D.kernel)⁻¹ 0 0 / D.lower
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.inverseConstant · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:205 · uses InteriorDesign
def topConstant reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design whose density is at most f_max near the evaluation point, with kernel K, the total-weight constant is c_top = f_max · ∫ K(u) du.

Definition (Lean source)
topConstant D :
ℝ
D.upper * ∫ u, D.kernel u
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.topConstant · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:212 · uses KernelDesign
def designTolerance reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design with density bounds f_min ≤ f_max near the evaluation point and a kernel bounded below on [−Δ, Δ], and a polynomial degree p, the design tolerance is t₀ = min(1, 1/(2 (p+1) c_row), c_inv/(2 (p+1) c_row²)), where c_row = (p+1) tr(R⁻¹)/(f_min K_min) and c_inv = (G⁻¹)₀₀/f_min are built from the monomial moment matrix R on [−Δ, Δ] and the kernel moment matrix G.

Definition (Lean source)
p :
ℕ
designTolerance D p :
ℝ
min 1 (min (1 / (2 * (p + 1 : ℝ) * inverseRowConstant D p)) (inverseConstant D p / (2 * (p + 1 : ℝ) * inverseRowConstant D p ^ 2)))
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.designTolerance · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:219 · uses InteriorDesign
def tailExponent reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design whose density is at most f_max near the evaluation point and whose kernel is at most K_max, and a tolerance t, the Bernstein exponent is t² / (4 (2 f_max K_max² + K_max t)).

Definition (Lean source)
t :
ℝ
tailExponent D t :
ℝ
t ^ 2 / (4 * (2 * D.upper * D.kernelMax ^ 2 + D.kernelMax * t))
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.tailExponent · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:232 · uses KernelDesign
def failureBound reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design whose density is at most f_max near the evaluation point and whose kernel is at most K_max, a polynomial degree p, a sample size N, a bandwidth h and a tolerance t, the failure bound is 2 (p+1)² exp(−N h t² / (4 (2 f_max K_max² + K_max t))).

Definition (Lean source)
p N :
ℕ
h t :
ℝ
failureBound D p N h t :
ℝ
2 * (p + 1 : ℝ) ^ 2 * exp (-(N : ℝ) * h * tailExponent D t)
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.failureBound · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:238 · uses KernelDesign
def HolderRegression reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

A regression function m belongs to the local Hölder class with smoothness β and constant H on the window [x₀ − r, x₀ + r] when β > 0, H ≥ 0, m is p times continuously differentiable on the window, where p = ⌈β⌉ − 1 is the largest integer strictly below β, and its p-th derivative within the window satisfies |m⁽ᵖ⁾(x) − m⁽ᵖ⁾(y)| ≤ H |x − y|^(β − p) for all x, y in the window.

Definition (Lean source)
x₀ r β H :
ℝ
m :
ℝ → ℝ
HolderRegression x₀ r β H m :
Prop
clause 1
0 < β
clause 2
0 ≤ H
clause 3
ContDiffOn ℝ (holderDerivOrder β) m (Icc (x₀ - r) (x₀ + r))
clause 4
x ∈ Set.Icc (x₀ - r) (x₀ + r) :
y ∈ Set.Icc (x₀ - r) (x₀ + r) :
|iteratedDerivWithin (holderDerivOrder β) m (Icc (x₀ - r) (x₀ + r)) x
- iteratedDerivWithin (holderDerivOrder β) m (Icc (x₀ - r) (x₀ + r)) y|
≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.HolderRegression · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:245
theorem of_contDiff reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.HolderRegression

Global smoothness implies membership in the local Hölder class. For a window [x₀ − r, x₀ + r] of positive radius, if β > 0, H ≥ 0, m is p = ⌈β⌉ − 1 times continuously differentiable on the whole real line, and its p-th derivative satisfies |m⁽ᵖ⁾(x) − m⁽ᵖ⁾(y)| ≤ H |x − y|^(β − p) for all x, y in the window, then m belongs to the local Hölder class of smoothness β and constant H on the window.

Formal statement
x₀ r :
ℝ
hr :
0 < r
β H :
ℝ
m :
ℝ → ℝ
hβ :
0 < β
hH :
0 ≤ H
hm :
ContDiff ℝ (holderDerivOrder β) m
hb :
∀ x ∈ Icc (x₀ - r) (x₀ + r),
∀ y ∈ Icc (x₀ - r) (x₀ + r),
|iteratedDeriv (holderDerivOrder β) m x - iteratedDeriv (holderDerivOrder β) m y|
≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))
HolderRegression x₀ r β H m
Proof (Lean source)
theorem HolderRegression.of_contDiff (x₀ r : ℝ) (hr : 0 < r) {β H : ℝ} {m : ℝ → ℝ} (hβ : 0 < β) (hH : 0 ≤ H) (hm : ContDiff ℝ (holderDerivOrder β) m) (hb : ∀ x ∈ Icc (x₀ - r) (x₀ + r), ∀ y ∈ Icc (x₀ - r) (x₀ + r), |iteratedDeriv (holderDerivOrder β) m x - iteratedDeriv (holderDerivOrder β) m y| ≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))) : HolderRegression x₀ r β H m := by have hu : UniqueDiffOn ℝ (Icc (x₀ - r) (x₀ + r)) := uniqueDiffOn_Icc (by linarith) refine ⟨hβ, hH, hm.contDiffOn, fun x hx y hy => ?_⟩ rw [iteratedDerivWithin_eq_iteratedDeriv hu hm.contDiffAt hx, iteratedDerivWithin_eq_iteratedDeriv hu hm.contDiffAt hy] exact hb x hx y hy
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.HolderRegression.of_contDiff · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:268 · uses holderDerivOrder , HolderRegression
def biasConstant reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design with density bounds f_min ≤ f_max near the evaluation point and kernel K, a smoothness β and a Hölder constant H, the bias constant is C_bias = (H / p!) · √(2 c_inv (c_top + 1)), where p = ⌈β⌉ − 1, c_inv = (G⁻¹)₀₀ / f_min, c_top = f_max ∫ K(u) du, and G is the (p+1) × (p+1) kernel moment matrix.

Definition (Lean source)
β H :
ℝ
biasConstant D β H :
ℝ
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.biasConstant · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:288 · uses InteriorDesign
def varianceConstant reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design with density lower bound f_min near the evaluation point and a kernel at most K_max, a polynomial degree p and a noise scale σ, the variance constant is C_var = 2 σ² K_max c_inv, where c_inv = (G⁻¹)₀₀ / f_min and G is the (p+1) × (p+1) kernel moment matrix.

Definition (Lean source)
p :
ℕ
σ :
ℝ
varianceConstant D p σ :
ℝ
2 * σ ^ 2 * D.kernelMax * inverseConstant D p
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.varianceConstant · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:298 · uses InteriorDesign
def rawIntercept reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a kernel K and evaluation point x₀, as carried by a design, a polynomial degree p, a bandwidth h, design points x_1, …, x_N and responses y_1, …, y_N, the local-polynomial intercept is ∑_i S_i y_i with weights S_i = ∑_k (M⁻¹)_{0k} K(u_i) (x_i − x₀)^k, where u_i = (x_i − x₀)/h and M is the weighted design matrix with (j,k) entry ∑_i K(u_i) (x_i − x₀)^(j+k).

Definition (Lean source)
p :
ℕ
h :
ℝ
N :
ℕ
x y :
Fin N → ℝ
rawIntercept D p h x y :
ℝ
∑ i, equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i * y i
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rawIntercept · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:305 · uses KernelDesign
def clippedIntercept reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a kernel K and evaluation point x₀, as carried by a design, a polynomial degree p, a bandwidth h, a clipping level M, design points x_1, …, x_N and responses y_1, …, y_N, the clipped local-polynomial intercept is the weighted least-squares intercept of the degree-p fit at x₀ (zero by convention when the weighted design matrix is singular), moved to the nearest point of [−M, M].

Definition (Lean source)
p :
ℕ
h M :
ℝ
N :
ℕ
x y :
Fin N → ℝ
clippedIntercept D p h M x y :
ℝ
clipIcc (-M) M (rawIntercept D p h x y)
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.clippedIntercept · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:320 · uses KernelDesign
6 supporting declarations (lemmas, instances)
  • instCoeInteriorDesignKernelDesign instance — An interior design is read as its underlying design law and kernel wherever only the upper bounds on the density and the kernel are needed.
    instCoeInteriorDesignKernelDesign :
    ⟨InteriorDesign.toKernelDesign⟩
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.instCoeInteriorDesignKernelDesign · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:121
  • upper_nonneg theorem — For a design whose nonnegative density is at most f_max on a window around the evaluation point, f_max ≥ 0.
    0 ≤ D.upper
    Proof (Lean source)
    theorem KernelDesign.upper_nonneg (D : KernelDesign) : 0 ≤ D.upper := (D.density_nonneg D.center).trans (D.density_upper D.center (by simpa using D.radius_pos.le))
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.KernelDesign.upper_nonneg · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:125
  • kernelMax_nonneg theorem — For a nonnegative kernel that is at most K_max, K_max ≥ 0.
    0 ≤ D.kernelMax
    Proof (Lean source)
    theorem KernelDesign.kernelMax_nonneg (D : KernelDesign) : 0 ≤ D.kernelMax := (D.kernel_nonneg 0).trans (D.kernel_upper 0)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.KernelDesign.kernelMax_nonneg · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:131
  • lower_le_upper theorem — For a design whose density lies between f_min and f_max on a window around the evaluation point, f_min ≤ f_max.
    D.lower ≤ D.upper
    Proof (Lean source)
    theorem InteriorDesign.lower_le_upper (D : InteriorDesign) : D.lower ≤ D.upper := (D.density_lower D.center (by simpa using D.radius_pos.le)).trans (D.density_upper D.center (by simpa using D.radius_pos.le))
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.InteriorDesign.lower_le_upper · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:135
  • kernelMax_pos theorem — For a kernel that is at most K_max and at least K_min > 0 on an interval around zero, K_max > 0.
    0 < D.kernelMax
    Proof (Lean source)
    theorem InteriorDesign.kernelMax_pos (D : InteriorDesign) : 0 < D.kernelMax := D.kernelMin_pos.trans_le ((D.kernel_lower 0 (by simpa using D.subradius_pos.le)).trans (D.kernel_upper 0))
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.InteriorDesign.kernelMax_pos · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:141
  • subradius_le_one theorem — For a kernel that vanishes outside [−1, 1] and is at least K_min > 0 on [−Δ, Δ], Δ ≤ 1.
    D.subradius ≤ 1
    Proof (Lean source)
    theorem InteriorDesign.subradius_le_one (D : InteriorDesign) : D.subradius ≤ 1 := by by_contra hlt have hpos := D.subradius_pos have hlow := D.kernel_lower D.subradius (by rw [abs_of_pos hpos]) rw [D.kernel_support D.subradius (by rw [abs_of_pos hpos]; exact lt_of_not_ge hlt)] at hlow exact absurd D.kernelMin_pos (not_lt.mpr hlow)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.InteriorDesign.subradius_le_one · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Basic.lean:147
Conditional­Risk 2 core · 7 supporting For fixed design points and independent responses with conditional means m(x_i) and conditional variances at most σ², the mean-squared error of the local-polynomial intercept is at most its squared noise-free bias plus σ ★ windowed_localPoly_bias★ localPoly_fibre_mse_of_designBounds

Conditional risk of the clipped local-polynomial intercept on a fixed design, dimension one

For fixed design points and independent responses with conditional means m(x_i) and conditional variances at most σ², the mean-squared error of the local-polynomial intercept is at most its squared noise-free bias plus σ² times the sum of squared equivalent-kernel weights (rawIntercept_fibre_mse_le). The bias is at most (H / p!) L h^β for a Hölder regression function when the leverage product of the design is at most L² (windowed_localPoly_bias); design points outside the kernel window carry zero weight and are unrestricted.

localPoly_fibre_mse_of_designBounds combines the two: on a design whose inverse intercept entry is of order 1/(N h) and whose leverage product is bounded, the intercept clipped to [−M, M] has conditional mean-squared error at most C_bias² h^(2β) + C_var/(N h), because clipping cannot increase the squared distance to a target inside [−M, M]. The responses need only finite conditional second moments.

theorem windowed_localPoly_bias reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Bias of the local-polynomial intercept on a fixed design. Let the kernel K be nonnegative and zero outside [−1, 1], with evaluation point x₀ and window radius r, and let the regression function m be, on the window [x₀ − r, x₀ + r], p = ⌈β⌉ − 1 times continuously differentiable with p-th derivative Hölder of order β − p and constant H. For a positive bandwidth h not exceeding r and design points x_1, …, x_N whose weighted design matrix M is invertible with √(M₀₀ (M⁻¹)₀₀) ≤ L, the intercept computed from the noise-free responses m(x_i) satisfies |∑_i S_i m(x_i) − m(x₀)| ≤ (H / p!) · L · h^β.

Formal statement
β H h L :
ℝ
N :
ℕ
m :
ℝ → ℝ
hm :
HolderRegression D.center D.radius β H m
hh :
0 < h
hwindow :
h ≤ D.radius
x :
Fin N → ℝ
hdet :
IsUnit (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))).det
hlev :
sqrt ((designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))) 0 0 * (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)))⁻¹ 0 0)
≤ L
|rawIntercept D (holderDerivOrder β) h x (fun i => m (x i)) - m D.center|
≤ (H / (holderDerivOrder β).factorial) * L * h ^ β
Proof (Lean source)
theorem windowed_localPoly_bias (D : KernelDesign) {β H h L : ℝ} {N : ℕ} {m : ℝ → ℝ} (hm : HolderRegression D.center D.radius β H m) (hh : 0 < h) (hwindow : h ≤ D.radius) (x : Fin N → ℝ) (hdet : IsUnit (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))).det) (hlev : sqrt ((designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))) 0 0 * (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)))⁻¹ 0 0) ≤ L) : |rawIntercept D (holderDerivOrder β) h x (fun i => m (x i)) - m D.center| ≤ (H / (holderDerivOrder β).factorial) * L * h ^ β := by classical let p := holderDerivOrder β let w : Fin N → ℝ := fun i => D.kernel ((x i - D.center) / h) let S : Fin N → ℝ := equivKernelWeight p (fun i => x i - D.center) w let a : Fin N → ℝ := fun i => if |x i - D.center| ≤ h then x i else D.center have hzero (i : Fin N) (hi : ¬ |x i - D.center| ≤ h) : S i = 0 := equivKernelWeight_eq_zero_of_outside D p hh x hi have hwin (i : Fin N) : |a i - D.center| ≤ h := by by_cases hi : |x i - D.center| ≤ h · simp only [a, if_pos hi] exact hi · simp [a, hi, hh.le] have ha (i : Fin N) : a i ∈ Icc (D.center - D.radius) (D.center + D.radius) := by have hi := (abs_le.mp ((hwin i).trans hwindow)) constructor <;> linarith [hi.1, hi.2] have ht : D.center ∈ Icc (D.center - D.radius) (D.center + D.radius) := by constructor <;> linarith [D.radius_pos] have hrep : ∀ k : ℕ, k ≤ p → (∑ i, S i * (a i - D.center) ^ k) = if k = 0 then 1 else 0 := by intro k hk calc (∑ i, S i * (a i - D.center) ^ k) = ∑ i, S i * (x i - D.center) ^ k := by apply Finset.sum_congr rfl intro i _ by_cases hi : |x i - D.center| ≤ h · simp [a, hi] · simp [hzero i hi] _ = if k = 0 then 1 else 0 := equivKernelWeight_reproduces hdet k hk have hsmooth : (∑ i, S i * m (a i)) = rawIntercept D p h x (fun i => m (x i)) := by unfold rawIntercept apply Finset.sum_congr rfl intro i _ change S i * m (a i) = S i * m (x i) by_cases hi : |x i - D.center| ≤ h · simp [a, hi] · simp [hzero i hi] have hbias := linearSmoother_bias_window_within hm.1 hm.2.1 ht ha hwin hm.2.2.1 hm.2.2.2 hrep rw [hsmooth] at hbias have hsq : (∑ i, |S i|) ^ 2 ≤ (designMatrix p (fun i => x i - D.center) w) 0 0 * (designMatrix p (fun i => x i - D.center) w)⁻¹ 0 0 := equivKernelWeight_abs_sum_sq_le hdet (fun i => D.kernel_nonneg _) have hsL : (∑ i, |S i|) ≤ L := (Real.le_sqrt_of_sq_le hsq).trans hlev exact hbias.trans (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hsL (div_nonneg hm.2.1 (by positivity))) (Real.rpow_nonneg hh.le β))
theorem localPoly_fibre_mse_of_designBounds reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Conditional mean-squared error on a design with bounded leverage, dimension one. Let the kernel K be nonnegative, at most K_max and zero outside [−1, 1], with evaluation point x₀ and window radius r, and let the regression function m be, on the window [x₀ − r, x₀ + r], p = ⌈β⌉ − 1 times continuously differentiable with p-th derivative Hölder of order β − p and constant H. Take a positive bandwidth h not exceeding r, a clipping level M with |m(x₀)| ≤ M, and design points x_1, …, x_N, and let the responses be independent with Y_i drawn from a conditional outcome distribution that at each x_i in the window [x₀ − r, x₀ + r] has a finite second moment, mean m(x_i) and variance at most σ². If the weighted design matrix M_x is invertible, (M_x⁻¹)₀₀ ≤ 2 c_inv/(N h) and √((M_x)₀₀ (M_x⁻¹)₀₀) ≤ √(2 c_inv (c_top + 1)), then the degree-p intercept clipped to [−M, M] satisfies E[(m̂ − m(x₀))²] ≤ C_bias² h^(2β) + C_var/(N h), the expectation being over the responses.

Formal statement
β H h M σ :
ℝ
N :
ℕ
m :
ℝ → ℝ
hm :
HolderRegression D.center D.radius β H m
hh :
0 < h
hwindow :
h ≤ D.radius
hM :
|m D.center| ≤ M
κ :
x :
Fin N → ℝ
hnoise :
∀ i
if
|x i - D.center| ≤ D.radius
then
MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧
(∫ y, y ∂κ (x i)) = m (x i) ∧
Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2
hdet :
IsUnit (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))).det
hinv :
(designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)))⁻¹ 0 0
≤ 2 * inverseConstant D (holderDerivOrder β) / ((N : ℝ) * h)
hlev :
sqrt ((designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))) 0 0 * (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)))⁻¹ 0 0)
(∫ y, (clippedIntercept D (holderDerivOrder β) h M x y - m D.center) ^ 2 ∂Measure.pi (fun i => κ (x i)))
≤ biasConstant D β H ^ 2 * h ^ (2 * β)
+ varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h)
Proof (Lean source)
theorem localPoly_fibre_mse_of_designBounds (D : InteriorDesign) {β H h M σ : ℝ} {N : ℕ} {m : ℝ → ℝ} (hm : HolderRegression D.center D.radius β H m) (hh : 0 < h) (hwindow : h ≤ D.radius) (hM : |m D.center| ≤ M) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (x : Fin N → ℝ) (hnoise : ∀ i, |x i - D.center| ≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧ (∫ y, y ∂κ (x i)) = m (x i) ∧ Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2) (hdet : IsUnit (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))).det) (hinv : (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)))⁻¹ 0 0 ≤ 2 * inverseConstant D (holderDerivOrder β) / ((N : ℝ) * h)) (hlev : sqrt ((designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))) 0 0 * (designMatrix (holderDerivOrder β) (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)))⁻¹ 0 0) ≤ sqrt (2 * inverseConstant D (holderDerivOrder β) * (topConstant D + 1))) : (∫ y, (clippedIntercept D (holderDerivOrder β) h M x y - m D.center) ^ 2 ∂Measure.pi (fun i => κ (x i))) ≤ biasConstant D β H ^ 2 * h ^ (2 * β) + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h) := by classical let p := holderDerivOrder β let μ := Measure.pi (fun i => κ (x i)) let S := equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) have hnoise' : ∀ i, |x i - D.center| ≤ h → MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧ (∫ y, y ∂κ (x i)) = m (x i) ∧ Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2 := fun i hi => hnoise i (hi.trans hwindow) have hfit : MemLp (fun y => rawIntercept D p h x y) 2 μ := rawIntercept_fibre_memLp D p hh κ x (fun i hi => (hnoise' i hi).1) have hraw : Integrable (fun y => (rawIntercept D p h x y - m D.center) ^ 2) μ := (hfit.sub (memLp_const _)).integrable_sq have hmeas : Measurable (fun y => (clippedIntercept D p h M x y - m D.center) ^ 2) := (((clippedIntercept_measurable D p N h M).comp (measurable_const.prodMk measurable_id)).sub_const _).pow_const 2 have hle : ∀ y, (clippedIntercept D p h M x y - m D.center) ^ 2 ≤ (rawIntercept D p h x y - m D.center) ^ 2 := fun y => clipIcc_sub_sq_le (Set.mem_Icc.mpr (abs_le.mp hM)) _ have hclip : Integrable (fun y => (clippedIntercept D p h M x y - m D.center) ^ 2) μ := hraw.mono' hmeas.aestronglyMeasurable (Filter.Eventually.of_forall fun y => by rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] exact hle y) have hcompare := integral_mono hclip hraw hle have hbias : |rawIntercept D p h x (fun i => m (x i)) - m D.center| ≤ biasConstant D β H * h ^ β := windowed_localPoly_bias D hm hh hwindow x hdet hlev have hB : 0 ≤ biasConstant D β H * h ^ β := by unfold biasConstant exact mul_nonneg (mul_nonneg (div_nonneg hm.2.1 (by positivity)) (Real.sqrt_nonneg _)) (Real.rpow_nonneg hh.le _) have hbias_sq : (rawIntercept D p h x (fun i => m (x i)) - m D.center) ^ 2 ≤ biasConstant D β H ^ 2 * h ^ (2 * β) := by have hb := (sq_le_sq₀ (abs_nonneg _) hB).2 hbias rw [sq_abs, mul_pow] at hb have hp : (h ^ β) ^ (2 : ℕ) = h ^ (2 * β) := by rw [mul_comm (2 : ℝ) β, Real.rpow_mul hh.le, Real.rpow_two] rwa [hp] at hb have hweights : (∑ i, S i ^ 2) ≤ D.kernelMax * (2 * inverseConstant D p / ((N : ℝ) * h)) := (equivKernelWeight_sq_sum_le hdet (fun i => D.kernel_nonneg _) (fun i => D.kernel_upper _)).trans (mul_le_mul_of_nonneg_left hinv D.kernelMax_pos.le) have hvariance : σ ^ 2 * ∑ i, S i ^ 2 ≤ varianceConstant D p σ / ((N : ℝ) * h) := by calc σ ^ 2 * ∑ i, S i ^ 2 ≤ σ ^ 2 * (D.kernelMax * (2 * inverseConstant D p / ((N : ℝ) * h))) := mul_le_mul_of_nonneg_left hweights (sq_nonneg σ) _ = varianceConstant D p σ / ((N : ℝ) * h) := by unfold varianceConstant ring exact hcompare.trans ((rawIntercept_fibre_mse_le D p hh κ m σ x hnoise').trans (add_le_add hbias_sq hvariance))
7 supporting declarations (lemmas, instances)
  • equivKernelWeight_eq_zero_of_outside theorem — For a kernel K that vanishes outside [−1, 1], with evaluation point x₀, a positive bandwidth h and design points x_1, …, x_N, if |x_i − x₀| > h then the equivalent-kernel weight S_i = ∑_k (M⁻¹)_{0k} K((x_i − x₀)/h) (x_i − x₀)^k of the i-th observation is zero.
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    x :
    Fin N → ℝ
    i :
    Fin N
    hi :
    ¬ |x i - D.center| ≤ h
    equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i
    = 0
    Proof (Lean source)
    theorem equivKernelWeight_eq_zero_of_outside (D : KernelDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hh : 0 < h) (x : Fin N → ℝ) {i : Fin N} (hi : ¬ |x i - D.center| ≤ h) : equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i = 0 := by have hw : D.kernel ((x i - D.center) / h) = 0 := by apply D.kernel_support rw [abs_div, abs_of_pos hh] exact (lt_div_iff₀ hh).2 (by simpa only [one_mul] using lt_of_not_ge hi) simp [equivKernelWeight, hw]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.equivKernelWeight_eq_zero_of_outside · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:37
  • rawIntercept_measurable theorem — For a measurable kernel and an evaluation point, as carried by a design, the local-polynomial intercept is a jointly measurable function of the design points and the responses, for every degree, sample size and bandwidth.
    p N :
    ℕ
    h :
    ℝ
    Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => rawIntercept D p h z.1 z.2)
    Proof (Lean source)
    @[fun_prop] theorem rawIntercept_measurable (D : KernelDesign) (p N : ℕ) (h : ℝ) : Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => rawIntercept D p h z.1 z.2) := by have hw : ∀ i, Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => D.kernel ((z.1 i - D.center) / h)) := fun i => D.kernel_measurable.comp (by fun_prop) have hA : ∀ j k : Fin (p + 1), Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => designMatrix p (fun i => z.1 i - D.center) (fun i => D.kernel ((z.1 i - D.center) / h)) j k) := by intro j k unfold designMatrix fun_prop have hInv := measurable_matrix_inv_apply _ hA unfold rawIntercept equivKernelWeight fun_prop
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rawIntercept_measurable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:126
  • clippedIntercept_measurable theorem — For a measurable kernel and an evaluation point, as carried by a design, the clipped local-polynomial intercept is a jointly measurable function of the design points and the responses, for every degree, sample size, bandwidth and clipping level.
    p N :
    ℕ
    h M :
    ℝ
    Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => clippedIntercept D p h M z.1 z.2)
    Proof (Lean source)
    @[fun_prop] theorem clippedIntercept_measurable (D : KernelDesign) (p N : ℕ) (h M : ℝ) : Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => clippedIntercept D p h M z.1 z.2) := (measurable_clipIcc (-M) M).comp (rawIntercept_measurable D p N h)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.clippedIntercept_measurable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:145
  • fibre_response_moments theorem — Fix design points x_1, …, x_N and a set A of indices, and let the responses Y_1, …, Y_N be independent with Y_i drawn from a conditional outcome distribution at x_i. If for each i in A this distribution has a finite second moment, mean m(x_i) and variance at most σ², then the masked responses Z_i, equal to Y_i for i in A and to zero otherwise, are square integrable, have variance at most σ², are pairwise uncorrelated, and have mean m(x_i) for i in A and zero otherwise.
    N :
    ℕ
    κ :
    m :
    ℝ → ℝ
    σ :
    ℝ
    x :
    Fin N → ℝ
    A :
    Set (Fin N)
    hx :
    ∀ i ∈ A,
    MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧
    (∫ y, y ∂κ (x i)) = m (x i) ∧
    Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2
    μ :
    Measure.pi (fun i => κ (x i))
    i :
    Fin N
    MemLp (fun y : Fin N → ℝ => A.indicator y i) 2 μ
    UncorrelatedVarianceFamily (fun i (y : Fin N → ℝ) => A.indicator y i) μ σ
    i :
    Fin N
    (∫ y : Fin N → ℝ, A.indicator y i ∂μ) = A.indicator (fun i => m (x i)) i
    Proof (Lean source)
    theorem fibre_response_moments {N : ℕ} (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (m : ℝ → ℝ) (σ : ℝ) (x : Fin N → ℝ) (A : Set (Fin N)) (hx : ∀ i ∈ A, MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧ (∫ y, y ∂κ (x i)) = m (x i) ∧ Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2) : let μ := Measure.pi (fun i => κ (x i)) (∀ i : Fin N, MemLp (fun y : Fin N → ℝ => A.indicator y i) 2 μ) ∧ UncorrelatedVarianceFamily (fun i (y : Fin N → ℝ) => A.indicator y i) μ σ ∧ (∀ i : Fin N, (∫ y : Fin N → ℝ, A.indicator y i ∂μ) = A.indicator (fun i => m (x i)) i) := by dsimp only have hin : ∀ i ∈ A, (fun y : Fin N → ℝ => A.indicator y i) = fun y => y i := fun i hi => by funext y exact Set.indicator_of_mem hi y have hout : ∀ i ∉ A, (fun y : Fin N → ℝ => A.indicator y i) = fun _ => 0 := fun i hi => by funext y exact Set.indicator_of_notMem hi y have hYin : ∀ i ∈ A, MemLp (fun y : Fin N → ℝ => y i) 2 (Measure.pi (fun i => κ (x i))) := fun i hi => (hx i hi).1.comp_measurePreserving (measurePreserving_eval _ i) have hY : ∀ i : Fin N, MemLp (fun y : Fin N → ℝ => A.indicator y i) 2 (Measure.pi (fun i => κ (x i))) := by intro i by_cases hi : i ∈ A · rw [hin i hi] exact hYin i hi · rw [hout i hi] exact memLp_const 0 refine ⟨hY, ⟨?_, ?_⟩, ?_⟩ · intro i dsimp only by_cases hi : i ∈ A · rw [hin i hi] exact ((measurePreserving_eval (fun i => κ (x i)) i).variance_fun_comp (f := fun y : ℝ => y) measurable_id.aemeasurable).le.trans (hx i hi).2.2 · rw [hout i hi] rw [show (fun _ : Fin N → ℝ => (0 : ℝ)) = 0 from rfl, variance_zero] exact sq_nonneg σ · intro i j hij dsimp only by_cases hi : i ∈ A · by_cases hj : j ∈ A · rw [hin i hi, hin j hj] exact ((iIndepFun_pi (fun i => measurable_id.aemeasurable)).indepFun hij).covariance_eq_zero (hYin i hi) (hYin j hj) · rw [hout j hj] exact covariance_const_right 0 · rw [hout i hi] exact covariance_const_left 0 · intro i by_cases hi : i ∈ A · rw [hin i hi, Set.indicator_of_mem hi, integral_eval] exact (hx i hi).2.1 · rw [hout i hi, Set.indicator_of_notMem hi] simp
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.fibre_response_moments · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:153
  • rawIntercept_eq_sum_indicator theorem — For a kernel K that vanishes outside [−1, 1], with evaluation point x₀, and a positive bandwidth h, the local-polynomial intercept ∑_i S_i y_i is unchanged when every response y_i with |x_i − x₀| > h is replaced by zero.
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    x y :
    Fin N → ℝ
    rawIntercept D p h x y
    = ∑ i, equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i * {i | |x i - D.center| ≤ h}.indicator y i
    Proof (Lean source)
    theorem rawIntercept_eq_sum_indicator (D : KernelDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hh : 0 < h) (x y : Fin N → ℝ) : rawIntercept D p h x y = ∑ i, equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i * {i | |x i - D.center| ≤ h}.indicator y i := by unfold rawIntercept refine Finset.sum_congr rfl (fun i _ => ?_) by_cases hi : |x i - D.center| ≤ h · rw [Set.indicator_of_mem (by exact hi)] · rw [equivKernelWeight_eq_zero_of_outside D p hh x hi, zero_mul, zero_mul]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rawIntercept_eq_sum_indicator · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:216
  • rawIntercept_fibre_memLp theorem — Fix a kernel K that vanishes outside [−1, 1], with evaluation point x₀, a positive bandwidth h and design points x_1, …, x_N, and let the responses be independent with Y_i drawn from a conditional outcome distribution at x_i. If this distribution has a finite second moment at every x_i with |x_i − x₀| ≤ h, then the local-polynomial intercept ∑_i S_i Y_i is square integrable.
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    κ :
    x :
    Fin N → ℝ
    hx :
    ∀ i
    if
    |x i - D.center| ≤ h
    then
    MemLp (fun y : ℝ => y) 2 (κ (x i))
    MemLp (fun y => rawIntercept D p h x y) 2 (Measure.pi (fun i => κ (x i)))
    Proof (Lean source)
    theorem rawIntercept_fibre_memLp (D : KernelDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hh : 0 < h) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (x : Fin N → ℝ) (hx : ∀ i, |x i - D.center| ≤ h → MemLp (fun y : ℝ => y) 2 (κ (x i))) : MemLp (fun y => rawIntercept D p h x y) 2 (Measure.pi (fun i => κ (x i))) := by have hfun : (fun y => rawIntercept D p h x y) = fun y => ∑ i, equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i * {i | |x i - D.center| ≤ h}.indicator y i := funext (rawIntercept_eq_sum_indicator D p hh x) rw [hfun] refine memLp_finsetSum _ (fun i _ => MemLp.const_mul ?_ _) by_cases hi : |x i - D.center| ≤ h · have he : (fun y : Fin N → ℝ => {i | |x i - D.center| ≤ h}.indicator y i) = fun y => y i := funext fun y => Set.indicator_of_mem (by exact hi) y rw [he] exact (hx i hi).comp_measurePreserving (measurePreserving_eval _ i) · have he : (fun y : Fin N → ℝ => {i | |x i - D.center| ≤ h}.indicator y i) = fun _ => 0 := funext fun y => Set.indicator_of_notMem (by exact hi) y rw [he] exact memLp_const 0
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rawIntercept_fibre_memLp · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:234
  • rawIntercept_fibre_mse_le theorem — Bias–variance bound on a fixed design. Fix a kernel K that vanishes outside [−1, 1], with evaluation point x₀, a positive bandwidth h and design points x_1, …, x_N, and let the responses be independent with Y_i drawn from a conditional outcome distribution at x_i. If at every x_i with |x_i − x₀| ≤ h this distribution has a finite second moment, mean m(x_i) and variance at most σ², then the local-polynomial intercept m̂ = ∑_i S_i Y_i satisfies E[(m̂ − m(x₀))²] ≤ (∑_i S_i m(x_i) − m(x₀))² + σ² ∑_i S_i².
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    κ :
    m :
    ℝ → ℝ
    σ :
    ℝ
    x :
    Fin N → ℝ
    hx :
    ∀ i
    if
    |x i - D.center| ≤ h
    then
    MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧
    (∫ y, y ∂κ (x i)) = m (x i) ∧
    Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2
    (∫ y, (rawIntercept D p h x y - m D.center) ^ 2 ∂Measure.pi (fun i => κ (x i)))
    ≤ (rawIntercept D p h x (fun i => m (x i)) - m D.center) ^ 2
    + σ ^ 2 * ∑ i, (equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i) ^ 2
    Proof (Lean source)
    theorem rawIntercept_fibre_mse_le (D : KernelDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hh : 0 < h) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (m : ℝ → ℝ) (σ : ℝ) (x : Fin N → ℝ) (hx : ∀ i, |x i - D.center| ≤ h → MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧ (∫ y, y ∂κ (x i)) = m (x i) ∧ Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2) : (∫ y, (rawIntercept D p h x y - m D.center) ^ 2 ∂Measure.pi (fun i => κ (x i))) ≤ (rawIntercept D p h x (fun i => m (x i)) - m D.center) ^ 2 + σ ^ 2 * ∑ i, (equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) i) ^ 2 := by classical let μ := Measure.pi (fun i => κ (x i)) let A : Set (Fin N) := {i | |x i - D.center| ≤ h} let S : Fin N → ℝ := equivKernelWeight p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) let F : (Fin N → ℝ) → ℝ := fun y => ∑ i, S i * A.indicator y i obtain ⟨hY, hnoise, hmean⟩ := fibre_response_moments κ m σ x A hx have hraw : ∀ y, rawIntercept D p h x y = F y := rawIntercept_eq_sum_indicator D p hh x have hfit : MemLp F 2 μ := memLp_finsetSum _ (fun i _ => (hY i).const_mul (S i)) have hμfit : (∫ y, F y ∂μ) = F (fun i => m (x i)) := by change (∫ y, ∑ i, S i * A.indicator y i ∂μ) = ∑ i, S i * A.indicator (fun i => m (x i)) i rw [integral_finsetSum _ (fun i _ => ((hY i).integrable (by simp)).const_mul _)] simp_rw [integral_const_mul, hmean] have hvar := linearSmoother_variance_le hY hnoise (S := S) (V := ∑ i, S i ^ 2) le_rfl have herr : MemLp (fun y => F y - m D.center) 2 μ := hfit.sub (memLp_const _) have hid := variance_eq_sub herr rw [variance_sub_const hfit.aestronglyMeasurable, integral_sub (hfit.integrable (by simp)) (integrable_const _), integral_const, probReal_univ, one_smul, hμfit] at hid simp_rw [hraw] change (∫ y, (F y - m D.center) ^ 2 ∂μ) ≤ _ change Var[F; μ] ≤ _ at hvar change Var[F; μ] = (∫ y, (F y - m D.center) ^ 2 ∂μ) - (F (fun i => m (x i)) - m D.center) ^ 2 at hid dsimp only [S] at hvar linarith
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rawIntercept_fibre_mse_le · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/ConditionalRisk.lean:260
Good­Design 1 core · 4 supporting On the event that every normalized empirical kernel moment is within the explicit tolerance of its expectation, the weighted design matrix M of the local-polynomial fit is invertible, its intercept inverse entry is of or ★ localPoly_leverage_on_momentEvent

The moment event implies a well-conditioned local-polynomial design

On the event that every normalized empirical kernel moment is within the explicit tolerance of its expectation, the weighted design matrix M of the local-polynomial fit is invertible, its intercept inverse entry is of order 1/(N h), and the leverage product M₀₀ (M⁻¹)₀₀ is bounded by a constant (localPoly_leverage_on_momentEvent). The proof rewrites M in the rescaled basis as D_h B D_h, with B = N h · (empirical moment matrix) and D_h the diagonal matrix of bandwidth powers, and applies the deterministic inverse-perturbation and leverage bounds for density-weighted designs.

rawIntercept_eq_wls_intercept adds that on this event the estimator is the intercept of the weighted least-squares polynomial fit.

theorem localPoly_leverage_on_momentEvent reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

On the moment event the design is good. Let the design density lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Take a positive sample size N, a positive bandwidth h not exceeding r, and design points x_1, …, x_N for which every empirical moment (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i = (x_i − x₀)/h, 0 ≤ j, k ≤ p, is within the design tolerance t₀ of its expectation. Then the weighted design matrix M with entries ∑_i K(u_i) (x_i − x₀)^(j+k) is invertible, (M⁻¹)₀₀ ≤ 2 c_inv/(N h), and √(M₀₀ (M⁻¹)₀₀) ≤ √(2 c_inv (c_top + 1)).

Formal statement
p :
ℕ
N :
ℕ
h :
ℝ
hN :
0 < N
hh :
0 < h
hwindow :
h ≤ D.radius
x :
Fin N → ℝ
hx :
x ∈ momentEvent D p h N (designTolerance D p)
M :
designMatrix p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))
IsUnit M.det
M⁻¹ 0 0 ≤ 2 * inverseConstant D p / ((N : ℝ) * h)
sqrt (M 0 0 * M⁻¹ 0 0) ≤ sqrt (2 * inverseConstant D p * (topConstant D + 1))
Proof (Lean source)
theorem localPoly_leverage_on_momentEvent (D : InteriorDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (x : Fin N → ℝ) (hx : x ∈ momentEvent D p h N (designTolerance D p)) : let M := designMatrix p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) IsUnit M.det ∧ M⁻¹ 0 0 ≤ 2 * inverseConstant D p / ((N : ℝ) * h) ∧ sqrt (M 0 0 * M⁻¹ 0 0) ≤ sqrt (2 * inverseConstant D p * (topConstant D + 1)) := by dsimp only have hNreal : 0 < (N : ℝ) := by exact_mod_cast hN have hNh : 0 < (N : ℝ) * h := mul_pos hNreal hh obtain ⟨hrow, _, _⟩ := designConstants_positive D p obtain ⟨htol, htol_one, _, _⟩ := designTolerance_spec D p obtain ⟨hrows, hclose, hsmall, hpert⟩ := localPoly_goodDesign_of_momentEvent D p hN hh hwindow x hx have hc : 0 ≤ inverseRowConstant D p / ((N : ℝ) * h) := (div_pos hrow hNh).le have hη : 0 ≤ (N : ℝ) * h * designTolerance D p := (mul_pos hNh htol).le have hlo : ∀ a, |a - D.center| ≤ h → D.lower ≤ D.density a := fun a ha => D.density_lower a (ha.trans hwindow) have hhi : ∀ a, |a - D.center| ≤ h → D.density a ≤ D.upper := fun a ha => D.density_upper a (ha.trans hwindow) have hfactor := unscaled_designMatrix_factor D p hh x have hsmall' : (inverseRowConstant D p / ((N : ℝ) * h)) * ((p + 1 : ℕ) * ((N : ℝ) * h * designTolerance D p)) ≤ 1 / 2 := by simpa only [Nat.cast_add, Nat.cast_one] using hsmall have hpert' : 2 * (inverseRowConstant D p / ((N : ℝ) * h)) ^ 2 * ((p + 1 : ℕ) * ((N : ℝ) * h * designTolerance D p)) ≤ ((weightMomentMatrix p D.kernel)⁻¹ 0 0 / D.lower) / ((N : ℝ) * h) := by simpa only [Nat.cast_add, Nat.cast_one, inverseConstant] using hpert obtain ⟨hdet, hinv⟩ := localPoly_density_inv00_rate hh hNreal D.lower_pos D.kernel_nonneg D.kernel_support (shape_moments_integrable D p hh hwindow) (kernel_moments_integrable D p) (kernelMoment_posDef D p) (shapeMoment_posDef D p hh hwindow) hlo hfactor hc hη hrows hclose hsmall' hpert' have hηle : (N : ℝ) * h * designTolerance D p ≤ (N : ℝ) * h := by simpa only [mul_one] using mul_le_mul_of_nonneg_left htol_one hNh.le have hBpsd := designMatrix_posSemidef (p := p) (x := fun i => (x i - D.center) / h) (fun i => D.kernel_nonneg ((x i - D.center) / h)) have hlev := localPoly_density_leverage_bound hh hNreal D.lower_pos D.lower_le_upper D.kernel_nonneg D.kernel_support (shape_moments_integrable D p hh hwindow) (kernel_moments_integrable D p) (kernelMoment_posDef D p) (shapeMoment_posDef D p hh hwindow) hlo hhi hfactor hc hη hrows hclose hsmall' hpert' hηle hBpsd.diag_nonneg hBpsd.inv.diag_nonneg refine ⟨hdet, ?_, ?_⟩ · simpa only [inverseConstant, mul_div_assoc] using hinv · simpa [inverseConstant, topConstant, weightMomentMatrix] using hlev
4 supporting declarations (lemmas, instances)
  • rescaled_designMatrix_eq theorem — For a kernel K and evaluation point x₀, as carried by a design, a positive sample size N, a positive bandwidth h and design points x_1, …, x_N, the weighted Gram matrix ∑_i K(u_i) u_i^(j+k) in the rescaled basis, u_i = (x_i − x₀)/h, equals N h times the empirical moment matrix.
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hN :
    0 < N
    hh :
    0 < h
    x :
    Fin N → ℝ
    designMatrix p (fun i => (x i - D.center) / h) (fun i => D.kernel ((x i - D.center) / h))
    = ((N : ℝ) * h) • empiricalMoment D p h x
    Proof (Lean source)
    theorem rescaled_designMatrix_eq (D : KernelDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hN : 0 < N) (hh : 0 < h) (x : Fin N → ℝ) : designMatrix p (fun i => (x i - D.center) / h) (fun i => D.kernel ((x i - D.center) / h)) = ((N : ℝ) * h) • empiricalMoment D p h x := by have hNh : (N : ℝ) * h ≠ 0 := mul_ne_zero (by exact_mod_cast hN.ne') hh.ne' ext j k simp only [designMatrix, empiricalMoment, momentSummand, Matrix.smul_apply, smul_eq_mul] field_simp
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rescaled_designMatrix_eq · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/GoodDesign.lean:33
  • unscaled_designMatrix_factor theorem — For a kernel K and evaluation point x₀, as carried by a design, a positive bandwidth h and design points x_1, …, x_N, the weighted design matrix ∑_i K(u_i) (x_i − x₀)^(j+k) equals D_h B D_h, where B has entries ∑_i K(u_i) u_i^(j+k), u_i = (x_i − x₀)/h, and D_h is the diagonal matrix of powers 1, h, …, h^p.
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    x :
    Fin N → ℝ
    designMatrix p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))
    = diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * designMatrix p (fun i => (x i - D.center) / h) (fun i => D.kernel ((x i - D.center) / h)) * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ))
    Proof (Lean source)
    theorem unscaled_designMatrix_factor (D : KernelDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hh : 0 < h) (x : Fin N → ℝ) : designMatrix p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h)) = diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) * designMatrix p (fun i => (x i - D.center) / h) (fun i => D.kernel ((x i - D.center) / h)) * diagonal (fun j : Fin (p + 1) => h ^ (j : ℕ)) := by ext j k simp only [Matrix.diagonal_mul, Matrix.mul_diagonal, designMatrix] rw [Finset.mul_sum, Finset.sum_mul] apply Finset.sum_congr rfl intro i _ rw [div_pow, div_pow] field_simp [hh.ne']
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.unscaled_designMatrix_factor · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/GoodDesign.lean:48
  • localPoly_goodDesign_of_momentEvent theorem — The moment event supplies the deterministic perturbation conditions. Let the design density f lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Take a positive sample size N, a positive bandwidth h not exceeding r, and design points x_1, …, x_N for which every empirical moment (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i = (x_i − x₀)/h, 0 ≤ j, k ≤ p, is within the design tolerance t₀ of its expectation. Write B for the Gram matrix ∑_i K(u_i) u_i^(j+k), T for the population matrix ∫ K(u) f(x₀ + h u) u^(j+k) du, η = N h t₀ and c = c_row/(N h). Then every row of (N h T)⁻¹ has absolute sum at most c, every entry of B − N h T is at most η in absolute value, c (p+1) η ≤ 1/2, and 2 c² (p+1) η ≤ c_inv/(N h).
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hN :
    0 < N
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    x :
    Fin N → ℝ
    hx :
    x ∈ momentEvent D p h N (designTolerance D p)
    B :
    designMatrix p (fun i => (x i - D.center) / h) (fun i => D.kernel ((x i - D.center) / h))
    T :
    weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u))
    η :
    (N : ℝ) * h * designTolerance D p
    c :
    inverseRowConstant D p / ((N : ℝ) * h)
    i :
    (∑ j, |(((N : ℝ) * h) • T)⁻¹ i j|) ≤ c
    j k :
    |B j k - (N : ℝ) * h * T j k| ≤ η
    c * ((p + 1 : ℝ) * η) ≤ 1 / 2
    2 * c ^ 2 * ((p + 1 : ℝ) * η) ≤ inverseConstant D p / ((N : ℝ) * h)
    Proof (Lean source)
    theorem localPoly_goodDesign_of_momentEvent (D : InteriorDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (x : Fin N → ℝ) (hx : x ∈ momentEvent D p h N (designTolerance D p)) : let B := designMatrix p (fun i => (x i - D.center) / h) (fun i => D.kernel ((x i - D.center) / h)) let T := weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)) let η := (N : ℝ) * h * designTolerance D p let c := inverseRowConstant D p / ((N : ℝ) * h) (∀ i, (∑ j, |(((N : ℝ) * h) • T)⁻¹ i j|) ≤ c) ∧ (∀ j k, |B j k - (N : ℝ) * h * T j k| ≤ η) ∧ c * ((p + 1 : ℝ) * η) ≤ 1 / 2 ∧ 2 * c ^ 2 * ((p + 1 : ℝ) * η) ≤ inverseConstant D p / ((N : ℝ) * h) := by classical dsimp only have hNh : 0 < (N : ℝ) * h := mul_pos (by exact_mod_cast hN) hh let := invertibleOfNonzero hNh.ne' obtain ⟨_, _, hsmall, hpert⟩ := designTolerance_spec D p refine ⟨?_, ?_, ?_, ?_⟩ · intro i rw [Matrix.inv_smul _ _ ((Matrix.isUnit_iff_isUnit_det _).mp (shapeMoment_posDef D p hh hwindow).isUnit)] simp only [Matrix.smul_apply, smul_eq_mul, invOf_eq_inv, abs_mul, abs_of_pos (inv_pos.mpr hNh), ← Finset.mul_sum] simpa only [div_eq_mul_inv, mul_comm] using mul_le_mul_of_nonneg_left (shape_inverse_rows D p hh hwindow i) (inv_nonneg.mpr hNh.le) · intro j k have hclose := hx j k rw [populationMoment_eq_shape D p hh] at hclose rw [rescaled_designMatrix_eq D p hN hh x] simp only [Matrix.smul_apply, smul_eq_mul, ← mul_sub, abs_mul, abs_of_pos hNh] exact mul_le_mul_of_nonneg_left hclose hNh.le · convert hsmall using 1 field_simp · apply (le_div_iff₀ hNh).mpr convert hpert using 1 <;> first | rfl | field_simp
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.localPoly_goodDesign_of_momentEvent · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/GoodDesign.lean:68
  • rawIntercept_eq_wls_intercept theorem — On the moment event the estimator is the weighted least-squares intercept. Let the design density lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Take a positive sample size N, a positive bandwidth h not exceeding r, design points x_1, …, x_N for which every empirical moment (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i = (x_i − x₀)/h, 0 ≤ j, k ≤ p, is within the design tolerance of its expectation, and responses y_1, …, y_N. If coefficients c_0, …, c_p minimize the weighted sum of squares ∑_i K(u_i) (y_i − ∑_j c_j (x_i − x₀)^j)², then the weighted design matrix is invertible and the local-polynomial intercept ∑_i S_i y_i equals c_0.
    p :
    ℕ
    N :
    ℕ
    h :
    ℝ
    hN :
    0 < N
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    x :
    Fin N → ℝ
    hx :
    x ∈ momentEvent D p h N (designTolerance D p)
    y :
    Fin N → ℝ
    c :
    Fin (p + 1) → ℝ
    hmin :
    ∀ c' : Fin (p + 1) → ℝ,
    (∑ i, D.kernel ((x i - D.center) / h) * (y i - ∑ j, c j * (x i - D.center) ^ (j : ℕ)) ^ 2)
    ≤ ∑ i, D.kernel ((x i - D.center) / h) * (y i - ∑ j, c' j * (x i - D.center) ^ (j : ℕ)) ^ 2
    conclusion 1
    IsUnit (designMatrix p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))).det
    conclusion 2
    rawIntercept D p h x y = c 0
    Proof (Lean source)
    theorem rawIntercept_eq_wls_intercept (D : InteriorDesign) (p : ℕ) {N : ℕ} {h : ℝ} (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (x : Fin N → ℝ) (hx : x ∈ momentEvent D p h N (designTolerance D p)) (y : Fin N → ℝ) {c : Fin (p + 1) → ℝ} (hmin : ∀ c' : Fin (p + 1) → ℝ, (∑ i, D.kernel ((x i - D.center) / h) * (y i - ∑ j, c j * (x i - D.center) ^ (j : ℕ)) ^ 2) ≤ ∑ i, D.kernel ((x i - D.center) / h) * (y i - ∑ j, c' j * (x i - D.center) ^ (j : ℕ)) ^ 2) : IsUnit (designMatrix p (fun i => x i - D.center) (fun i => D.kernel ((x i - D.center) / h))).det ∧ rawIntercept D p h x y = c 0 := by have hdet := (localPoly_leverage_on_momentEvent D p hN hh hwindow x hx).1 exact ⟨hdet, (wls_intercept_eq_equivKernelSmoother (fun i => D.kernel_nonneg _) hdet hmin).symm⟩
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rawIntercept_eq_wls_intercept · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/GoodDesign.lean:181
Moment­Concentration 1 core · 8 supporting For independent design points with a density at most f_max near the evaluation point and a nonnegative kernel bounded by K_max and supported on [−1, 1], each normalized empirical moment (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i ★ localPoly_moment_simultaneous_probability

Concentration of kernel-weighted design moments in dimension one

For independent design points with a density at most f_max near the evaluation point and a nonnegative kernel bounded by K_max and supported on [−1, 1], each normalized empirical moment (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i = (X_i − x₀)/h, is close to its expectation.

Each summand is bounded by K_max and has second moment at most 2 h f_max K_max², so Bernstein's inequality gives localPoly_moment_entrywise_bernstein: a deviation larger than t has probability at most 2 exp(−N h t² / (4 (2 f_max K_max² + K_max t))). A union bound over the (p+1)² entries gives localPoly_moment_simultaneous_probability. Only upper bounds on the density and the kernel are used.

theorem localPoly_moment_simultaneous_probability reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

All kernel-weighted design moments are close at once, dimension one. Let the design points X_1, …, X_N be independent draws from a density that is at most f_max on an interval [x₀ − r, x₀ + r], and let the kernel K be measurable, nonnegative, at most K_max, and zero outside [−1, 1]. For a polynomial degree p, a positive sample size N, a positive bandwidth h not exceeding r and a positive tolerance t, consider the (p+1) × (p+1) matrix of empirical moments (N h)⁻¹ ∑_i K(u_i) u_i^(j+k), u_i = (X_i − x₀)/h. Then the probability that some entry differs from its expectation by more than t is at most 2 (p+1)² exp(−N h t² / (4 (2 f_max K_max² + K_max t))).

Formal statement
p N :
ℕ
h t :
ℝ
hN :
0 < N
hh :
0 < h
hwindow :
h ≤ D.radius
ht :
0 < t
(Measure.pi (fun _ : Fin N => D.law)).real (momentEvent D p h N t)ᶜ
≤ failureBound D p N h t
Proof (Lean source)
theorem localPoly_moment_simultaneous_probability (D : KernelDesign) (p N : ℕ) {h t : ℝ} (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (ht : 0 < t) : (Measure.pi (fun _ : Fin N => D.law)).real (momentEvent D p h N t)ᶜ ≤ failureBound D p N h t := by classical let _ := D.probability let E : Fin (p + 1) × Fin (p + 1) → Set (Fin N → ℝ) := fun a => {x | t < |empiricalMoment D p h x a.1 a.2 - populationMoment D p h a.1 a.2|} have heq : (momentEvent D p h N t)ᶜ = ⋃ a, E a := by ext x simp [momentEvent, E, not_forall, not_le, Prod.exists] rw [heq] calc (Measure.pi (fun _ : Fin N => D.law)).real (⋃ a, E a) ≤ ∑ a, (Measure.pi (fun _ : Fin N => D.law)).real (E a) := measureReal_iUnion_fintype_le E _ ≤ ∑ _a : Fin (p + 1) × Fin (p + 1), 2 * exp (-(N : ℝ) * h * tailExponent D t) := by apply Finset.sum_le_sum intro a _ exact localPoly_moment_entrywise_bernstein D p N hN hh hwindow ht a.1 a.2 _ = failureBound D p N h t := by simp [failureBound, Fintype.card_prod, pow_two] ring
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.localPoly_moment_simultaneous_probability · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:249 · uses KernelDesign , failureBound , momentEvent
8 supporting declarations (lemmas, instances)
  • momentSummand_measurable theorem — For a measurable kernel K and an evaluation point x₀, as carried by a design, the map x ↦ K(u) u^j u^k, u = (x − x₀)/h, is measurable for every bandwidth h and exponents j, k.
    h :
    ℝ
    j k :
    ℕ
    Proof (Lean source)
    @[fun_prop] theorem momentSummand_measurable (D : KernelDesign) (h : ℝ) (j k : ℕ) : Measurable (momentSummand D h j k) := by unfold momentSummand exact (D.kernel_measurable.comp ((measurable_id.sub_const D.center).div_const h)).mul ((((measurable_id.sub_const D.center).div_const h).pow_const j).mul (((measurable_id.sub_const D.center).div_const h).pow_const k))
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand_measurable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:31
  • momentSummand_abs_le theorem — For a nonnegative kernel K that is at most K_max and vanishes outside [−1, 1], with an evaluation point x₀, |K(u) u^j u^k| ≤ K_max for every bandwidth, pair of exponents and point x, where u = (x − x₀)/h.
    h :
    ℝ
    j k :
    ℕ
    x :
    ℝ
    |momentSummand D h j k x| ≤ D.kernelMax
    Proof (Lean source)
    theorem momentSummand_abs_le (D : KernelDesign) (h : ℝ) (j k : ℕ) (x : ℝ) : |momentSummand D h j k x| ≤ D.kernelMax := by unfold momentSummand let u := (x - D.center) / h change |D.kernel u * (u ^ j * u ^ k)| ≤ D.kernelMax by_cases hu : |u| ≤ 1 · rw [abs_mul, abs_mul, abs_pow, abs_pow, abs_of_nonneg (D.kernel_nonneg u)] have hj : |u| ^ j ≤ 1 := pow_le_one₀ (abs_nonneg u) hu have hk : |u| ^ k ≤ 1 := pow_le_one₀ (abs_nonneg u) hu calc D.kernel u * (|u| ^ j * |u| ^ k) ≤ D.kernel u * (1 * 1) := by gcongr exact D.kernel_nonneg u _ ≤ D.kernelMax := by simpa using D.kernel_upper u · rw [D.kernel_support u (lt_of_not_ge hu)] simpa using D.kernelMax_nonneg
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand_abs_le · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:41
  • momentSummand_integrable theorem — For a design law with a measurable nonnegative kernel K ≤ K_max vanishing outside [−1, 1], the kernel-weighted monomial K(u) u^j u^k, u = (X − x₀)/h, has a finite expectation under the design law for every bandwidth and pair of exponents.
    h :
    ℝ
    j k :
    ℕ
    Integrable (momentSummand D h j k) D.law
    Proof (Lean source)
    theorem momentSummand_integrable (D : KernelDesign) (h : ℝ) (j k : ℕ) : Integrable (momentSummand D h j k) D.law := by let _ := D.probability exact (integrable_const D.kernelMax).mono' (momentSummand_measurable D h j k).aestronglyMeasurable (Filter.Eventually.of_forall fun x => by simpa [Real.norm_eq_abs] using momentSummand_abs_le D h j k x)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand_integrable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:61
  • momentSummand_secondMoment theorem — Let the design density be at most f_max on [x₀ − r, x₀ + r] and the kernel K be measurable, nonnegative, at most K_max and zero outside [−1, 1]. For a positive bandwidth h not exceeding r, the second moment E[(K(u) u^j u^k)²], u = (X − x₀)/h, is at most 2 h f_max K_max² for all exponents j, k.
    h :
    ℝ
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    j k :
    ℕ
    (∫ x, momentSummand D h j k x ^ 2 ∂D.law) ≤ 2 * h * D.upper * D.kernelMax ^ 2
    Proof (Lean source)
    theorem momentSummand_secondMoment (D : KernelDesign) {h : ℝ} (hh : 0 < h) (hwindow : h ≤ D.radius) (j k : ℕ) : (∫ x, momentSummand D h j k x ^ 2 ∂D.law) ≤ 2 * h * D.upper * D.kernelMax ^ 2 := by classical have hu : 0 ≤ D.upper := D.upper_nonneg let W := Icc (D.center - h) (D.center + h) have hW : MeasurableSet W := measurableSet_Icc have hsq : ∀ x, momentSummand D h j k x ^ 2 ≤ D.kernelMax ^ 2 := by intro x have hb := momentSummand_abs_le D h j k x nlinarith [sq_abs (momentSummand D h j k x), abs_nonneg (momentSummand D h j k x)] have hout : ∀ x, x ∉ W → momentSummand D h j k x = 0 := by intro x hx have hx' : h < |x - D.center| := by by_contra hn have ha := abs_le.mp (le_of_not_gt hn) apply hx constructor <;> linarith [ha.1, ha.2] unfold momentSummand rw [D.kernel_support _ (by rw [abs_div, abs_of_pos hh] exact (lt_div_iff₀ hh).mpr (by simpa using hx'))] simp rw [D.law_density, integral_withDensity_eq_integral_toReal_smul D.density_measurable.ennreal_ofReal (Filter.Eventually.of_forall fun x => ENNReal.ofReal_lt_top)] simp only [ENNReal.toReal_ofReal (D.density_nonneg _), smul_eq_mul] calc (∫ x, D.density x * momentSummand D h j k x ^ 2) ≤ ∫ x, W.indicator (fun _ => D.upper * D.kernelMax ^ 2) x := by apply integral_mono_of_nonneg · exact Filter.Eventually.of_forall fun x => mul_nonneg (D.density_nonneg x) (sq_nonneg _) · exact (integrableOn_const (isCompact_Icc.measure_ne_top (μ := volume))).integrable_indicator hW · apply Filter.Eventually.of_forall intro x by_cases hx : x ∈ W · rw [Set.indicator_of_mem hx] have hxrad : |x - D.center| ≤ D.radius := by apply le_trans _ hwindow apply abs_le.mpr have hx' : D.center - h ≤ x ∧ x ≤ D.center + h := hx constructor <;> linarith [hx'.1, hx'.2] exact mul_le_mul (D.density_upper x hxrad) (hsq x) (sq_nonneg _) hu · simp [Set.indicator_of_notMem hx, hout x hx] _ = 2 * h * D.upper * D.kernelMax ^ 2 := by rw [integral_indicator hW, setIntegral_const] simp [W, hh.le] ring
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand_secondMoment · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:72
  • momentSummand_centered_bound theorem — For a design law with a measurable nonnegative kernel K ≤ K_max vanishing outside [−1, 1], the kernel-weighted monomial K(u) u^j u^k, u = (x − x₀)/h, differs from its expectation under the design law by at most 2 K_max at every point x.
    h :
    ℝ
    j k :
    ℕ
    x :
    |momentSummand D h j k x - ∫ y, momentSummand D h j k y ∂D.law| ≤ 2 * D.kernelMax
    Proof (Lean source)
    theorem momentSummand_centered_bound (D : KernelDesign) (h : ℝ) (j k : ℕ) : ∀ x, |momentSummand D h j k x - ∫ y, momentSummand D h j k y ∂D.law| ≤ 2 * D.kernelMax := by let _ := D.probability have hm : |∫ y, momentSummand D h j k y ∂D.law| ≤ D.kernelMax := by simpa [Real.norm_eq_abs] using (norm_integral_le_of_norm_le_const (μ := D.law) (f := momentSummand D h j k) (C := D.kernelMax) (Filter.Eventually.of_forall fun y => by simpa [Real.norm_eq_abs] using momentSummand_abs_le D h j k y)) intro x calc |momentSummand D h j k x - ∫ y, momentSummand D h j k y ∂D.law| ≤ |momentSummand D h j k x| + |∫ y, momentSummand D h j k y ∂D.law| := abs_sub _ _ _ ≤ D.kernelMax + D.kernelMax := add_le_add (momentSummand_abs_le D h j k x) hm _ = 2 * D.kernelMax := by ring
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand_centered_bound · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:128
  • momentSummand_variance theorem — Let the design density be at most f_max on [x₀ − r, x₀ + r] and the kernel K be measurable, nonnegative, at most K_max and zero outside [−1, 1]. For a positive bandwidth h not exceeding r, the variance of K(u) u^j u^k, u = (X − x₀)/h, under the design law is at most 2 h f_max K_max² for all exponents j, k.
    h :
    ℝ
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    j k :
    ℕ
    (∫ x, (momentSummand D h j k x - ∫ y, momentSummand D h j k y ∂D.law) ^ 2 ∂D.law)
    ≤ 2 * h * D.upper * D.kernelMax ^ 2
    Proof (Lean source)
    theorem momentSummand_variance (D : KernelDesign) {h : ℝ} (hh : 0 < h) (hwindow : h ≤ D.radius) (j k : ℕ) : (∫ x, (momentSummand D h j k x - ∫ y, momentSummand D h j k y ∂D.law) ^ 2 ∂D.law) ≤ 2 * h * D.upper * D.kernelMax ^ 2 := by let _ := D.probability rw [← ProbabilityTheory.variance_eq_integral (momentSummand_measurable D h j k).aemeasurable] exact (ProbabilityTheory.variance_le_expectation_sq (momentSummand_measurable D h j k).aestronglyMeasurable).trans (momentSummand_secondMoment D hh hwindow j k)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentSummand_variance · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:149
  • localPoly_moment_entrywise_bernstein theorem — Bernstein bound for one kernel-weighted design moment, dimension one. Let the design points X_1, …, X_N be independent draws from a density that is at most f_max on an interval [x₀ − r, x₀ + r], and let the kernel K be measurable, nonnegative, at most K_max, and zero outside [−1, 1]. For a polynomial degree p, a positive sample size N, a positive bandwidth h not exceeding r, a positive tolerance t and any two exponents j, k between 0 and p, write u_i = (X_i − x₀)/h and compare the empirical moment (N h)⁻¹ ∑_i K(u_i) u_i^(j+k) with its expectation. Then the probability that the two differ by more than t is at most 2 exp(−N h t² / (4 (2 f_max K_max² + K_max t))).
    p N :
    ℕ
    h t :
    ℝ
    hN :
    0 < N
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    ht :
    0 < t
    j k :
    Fin (p + 1)
    (Measure.pi (fun _ : Fin N => D.law)).real {x | t < |empiricalMoment D p h x j k - populationMoment D p h j k|}
    ≤ 2 * exp (-(N : ℝ) * h * tailExponent D t)
    Proof (Lean source)
    theorem localPoly_moment_entrywise_bernstein (D : KernelDesign) (p N : ℕ) {h t : ℝ} (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (ht : 0 < t) (j k : Fin (p + 1)) : (Measure.pi (fun _ : Fin N => D.law)).real {x | t < |empiricalMoment D p h x j k - populationMoment D p h j k|} ≤ 2 * exp (-(N : ℝ) * h * tailExponent D t) := by let _ := D.probability have hn : (0 : ℝ) < N := by exact_mod_cast hN have hK0 := D.kernelMax_nonneg by_cases hKz : D.kernelMax = 0 · have hz : ∀ x, momentSummand D h j k x = 0 := fun x => abs_eq_zero.mp (le_antisymm (hKz ▸ momentSummand_abs_le D h j k x) (abs_nonneg _)) have hempty : {x : Fin N → ℝ | t < |empiricalMoment D p h x j k - populationMoment D p h j k|} = ∅ := by ext x simp [empiricalMoment, populationMoment, hz, ht.le] rw [hempty, measureReal_empty] positivity have hK : 0 < D.kernelMax := lt_of_le_of_ne hK0 (Ne.symm hKz) have hu : 0 ≤ D.upper := D.upper_nonneg have htail := iid_sum_bernstein_union_bound (N := N) D.law (fun _ : Unit => momentSummand D h j k) (fun _ => momentSummand_measurable D h j k) (fun _ => momentSummand_integrable D h j k) (fun _ => 2 * D.kernelMax) (fun _ => 2 * h * D.upper * D.kernelMax ^ 2) (fun _ => (N : ℝ) * h * t) (fun _ => by positivity) (fun _ => by positivity) (fun _ => by positivity) hN (fun _ => Filter.Eventually.of_forall (momentSummand_centered_bound D h j k)) (fun _ => momentSummand_variance D hh hwindow j k) simp only [Finset.univ_unique, Finset.sum_singleton] at htail have hsub : {x : Fin N → ℝ | t < |empiricalMoment D p h x j k - populationMoment D p h j k|} ⊆ {x : Fin N → ℝ | ∃ _ : Unit, (N : ℝ) * h * t ≤ |(∑ i, momentSummand D h j k (x i)) - (N : ℝ) * ∫ y, momentSummand D h j k y ∂D.law|} := by intro x hx refine ⟨(), ?_⟩ have heq : empiricalMoment D p h x j k - populationMoment D p h j k = ((∑ i, momentSummand D h j k (x i)) - (N : ℝ) * ∫ y, momentSummand D h j k y ∂D.law) / ((N : ℝ) * h) := by unfold empiricalMoment populationMoment field_simp change t < |empiricalMoment D p h x j k - populationMoment D p h j k| at hx rw [heq, abs_div, abs_of_pos (mul_pos hn hh)] at hx have := (lt_div_iff₀ (mul_pos hn hh)).mp hx exact le_of_lt (by simpa [mul_comm, mul_left_comm, mul_assoc] using this) refine (measureReal_mono hsub).trans (htail.trans (le_of_eq ?_)) congr 2 unfold tailExponent field_simp ring
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.localPoly_moment_entrywise_bernstein · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:165
  • momentEvent_measurable theorem — For a design law with a measurable kernel, the set of design vectors (x_1, …, x_N) on which every empirical kernel moment of order up to 2p is within t of its expectation is measurable, for every degree p, sample size N, bandwidth h and tolerance t.
    p N :
    ℕ
    h t :
    ℝ
    Proof (Lean source)
    theorem momentEvent_measurable (D : KernelDesign) (p N : ℕ) (h t : ℝ) : MeasurableSet (momentEvent D p h N t) := by classical unfold momentEvent simp only [Set.ofPred_forall] apply MeasurableSet.iInter intro j apply MeasurableSet.iInter intro k apply measurableSet_le _ measurable_const apply Measurable.abs apply Measurable.sub_const unfold empiricalMoment exact (Finset.measurable_sum _ (fun i _ => (momentSummand_measurable D h j k).comp (measurable_pi_apply i))).div_const _
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.momentEvent_measurable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/MomentConcentration.lean:229
Population­Moment 2 core · 10 supporting The population counterpart of the normalized empirical moment matrix is, after the change of variables x = x₀ + h u, the matrix T with entries ∫ K(u) f(x₀ + h u) u^(j+k) du (populationMoment_eq_shape). ★ shapeMoment_posDef★ shape_inverse_rows

Population moment matrices of one-dimensional local-polynomial regression

The population counterpart of the normalized empirical moment matrix is, after the change of variables x = x₀ + h u, the matrix T with entries ∫ K(u) f(x₀ + h u) u^(j+k) du (populationMoment_eq_shape). Under density bounds f_min ≤ f ≤ f_max on the window and a kernel bounded below by K_min on [−Δ, Δ], the quadratic form of T dominates f_min K_min times that of the monomial moment matrix on [−Δ, Δ], which is positive definite because a nonzero polynomial cannot vanish on an interval. Hence T and the kernel moment matrix are positive definite (shapeMoment_posDef, kernelMoment_posDef), and every row of T⁻¹ has absolute sum at most an explicit constant that does not depend on the bandwidth (shape_inverse_rows).

designTolerance_spec records that the explicit tolerance is small enough for the deterministic inverse-perturbation bounds. Continuity of the kernel is not assumed.

theorem shapeMoment_posDef reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Let the design density f lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. For a positive bandwidth h not exceeding r, the population moment matrix with (j,k) entry ∫ K(u) f(x₀ + h u) u^(j+k) du, 0 ≤ j, k ≤ p, is positive definite.

Formal statement
p :
ℕ
h :
ℝ
hh :
0 < h
hwindow :
h ≤ D.radius
(weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u))).PosDef
Proof (Lean source)
theorem shapeMoment_posDef (D : InteriorDesign) (p : ℕ) {h : ℝ} (hh : 0 < h) (hwindow : h ≤ D.radius) : (weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u))).PosDef := by apply Matrix.PosDef.of_dotProduct_mulVec_pos weightMomentMatrix_isHermitian intro v hv simp only [star_trivial] have href : 0 < v ⬝ᵥ (referenceMoment D p *ᵥ v) := by simpa only [star_trivial] using (referenceMoment_posDef D p).dotProduct_mulVec_pos hv exact lt_of_lt_of_le (mul_pos (mul_pos D.lower_pos D.kernelMin_pos) href) (shape_dominates_reference D p hh hwindow v)
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.shapeMoment_posDef · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:256 · uses InteriorDesign , weightMomentMatrix
theorem shape_inverse_rows reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Let the design density f lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. For a positive bandwidth h not exceeding r, let T be the population moment matrix with (j,k) entry ∫ K(u) f(x₀ + h u) u^(j+k) du. Then every row of T⁻¹ has absolute sum at most c_row = (p+1) tr(R⁻¹)/(f_min K_min), where R is the monomial moment matrix on [−Δ, Δ].

Formal statement
p :
ℕ
h :
ℝ
hh :
0 < h
hwindow :
h ≤ D.radius
i :
(∑ j, |(weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)))⁻¹ i j|)
Proof (Lean source)
theorem shape_inverse_rows (D : InteriorDesign) (p : ℕ) {h : ℝ} (hh : 0 < h) (hwindow : h ≤ D.radius) : ∀ i, (∑ j, |(weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)))⁻¹ i j|) ≤ inverseRowConstant D p := by have hc : 0 < D.lower * D.kernelMin := mul_pos D.lower_pos D.kernelMin_pos have hshape := shapeMoment_posDef D p hh hwindow have hdiag := inv_diag_le_of_quadForm_sandwich hshape (referenceMoment_posDef D p) hc (shape_dominates_reference D p hh hwindow) have htrace : (∑ j, (weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)))⁻¹ j j) ≤ (∑ j, (referenceMoment D p)⁻¹ j j) / (D.lower * D.kernelMin) := by rw [Finset.sum_div] exact Finset.sum_le_sum (fun j _ => hdiag j) intro i calc _ ≤ ∑ _j : Fin (p + 1), (∑ k, (referenceMoment D p)⁻¹ k k) / (D.lower * D.kernelMin) := Finset.sum_le_sum (fun j _ => (posSemidef_abs_entry_le_trace hshape.inv.posSemidef i j).trans htrace) _ = inverseRowConstant D p := by simp [inverseRowConstant, mul_div_assoc]
10 supporting declarations (lemmas, instances)
  • populationMoment_eq_shape theorem — Change of variables for the population moments. Let the design law have a density f, and let K be the kernel and x₀ the evaluation point. For a positive bandwidth h, E[K(u) u^(j+k)] / h = ∫ K(v) f(x₀ + h v) v^(j+k) dv for all 0 ≤ j, k ≤ p, where u = (X − x₀)/h.
    p :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    = weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u))
    Proof (Lean source)
    theorem populationMoment_eq_shape (D : KernelDesign) (p : ℕ) {h : ℝ} (hh : 0 < h) : populationMoment D p h = weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)) := by ext j k change (∫ x, momentSummand D h j k x ∂D.law) / h = ∫ u, (D.kernel u * D.density (D.center + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)) have hdensity : (∫ x, momentSummand D h j k x ∂D.law) = ∫ x, D.density x * momentSummand D h j k x := by rw [D.law_density] simpa only [ENNReal.toReal_ofReal (D.density_nonneg _), smul_eq_mul] using integral_withDensity_eq_integral_toReal_smul (μ := volume) D.density_measurable.ennreal_ofReal (Filter.Eventually.of_forall (fun x => ENNReal.ofReal_lt_top)) (momentSummand D h j k) have hcv : (∫ x, D.density x * momentSummand D h j k x) = h * ∫ u, (D.kernel u * D.density (D.center + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)) := by calc (∫ x, D.density x * momentSummand D h j k x) = ∫ x, (fun u => D.kernel u * (u ^ (j : ℕ) * u ^ (k : ℕ))) ((x - D.center) / h) * (x - D.center) ^ 0 * D.density x := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun x => by simp only [momentSummand, pow_zero]; ring) _ = h ^ (0 + 1) * ∫ u, (D.kernel u * (u ^ (j : ℕ) * u ^ (k : ℕ))) * u ^ 0 * D.density (D.center + h * u) := popMomentEntry_changeOfVar (fun u => D.kernel u * (u ^ (j : ℕ) * u ^ (k : ℕ))) D.density D.center h hh 0 _ = h * ∫ u, (D.kernel u * D.density (D.center + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)) := by simp only [Nat.zero_add, pow_one, pow_zero, mul_one] congr 1 apply integral_congr_ae exact Filter.Eventually.of_forall (fun u => by ring) rw [hdensity, hcv] field_simp
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.populationMoment_eq_shape · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:35
  • referenceMoment_posDef theorem — For a kernel bounded below on an interval [−Δ, Δ] with Δ > 0, as carried by a design, the matrix with (j,k) entry ∫_{−Δ}^{Δ} u^(j+k) du, 0 ≤ j, k ≤ p, is positive definite for every degree p.
    p :
    ℕ
    Proof (Lean source)
    theorem referenceMoment_posDef (D : InteriorDesign) (p : ℕ) : (referenceMoment D p).PosDef := by classical change (weightMomentMatrix p ((Icc (-D.subradius) D.subradius).indicator (fun _ => (1 : ℝ)))).PosDef apply Matrix.PosDef.of_dotProduct_mulVec_pos weightMomentMatrix_isHermitian intro v hv simp only [star_trivial] rw [weightMomentMatrix_quadForm (reference_moments_integrable D p) v] let f : ℝ → ℝ := fun u => (∑ i, v i * u ^ (i : ℕ)) ^ 2 have hc : Continuous f := by fun_prop have he : (fun u => (Icc (-D.subradius) D.subradius).indicator (fun _ => (1 : ℝ)) u * (∑ i, v i * u ^ (i : ℕ)) ^ 2) = (Icc (-D.subradius) D.subradius).indicator f := by funext u by_cases hu : u ∈ Icc (-D.subradius) D.subradius <;> simp [hu, f] rw [he, integral_indicator measurableSet_Icc] apply (setIntegral_pos_iff_support_of_nonneg_ae (Filter.Eventually.of_forall (fun u => sq_nonneg _)) hc.integrableOn_Icc).2 have hpoly : LocalPolynomial.localPolynomial p v ≠ 0 := by simpa [LocalPolynomial.localPolynomial_eq_zero_iff] using hv have hroots : Finite {u : ℝ | Polynomial.IsRoot (LocalPolynomial.localPolynomial p v) u} := (Polynomial.roots (LocalPolynomial.localPolynomial p v)).toFinset.finite_toSet.subset (by intro u hu simpa [Polynomial.mem_roots hpoly] using hu) have hinterval : Set.Infinite (Ioo (-D.subradius) D.subradius) := Set.Ioo_infinite (by linarith [D.subradius_pos]) obtain ⟨u, hu, hroot⟩ := (hinterval.sdiff hroots).nonempty have hne : (∑ i, v i * u ^ (i : ℕ)) ≠ 0 := by rw [← LocalPolynomial.localPolynomial_eval] intro hz exact hroot (by simpa [Polynomial.IsRoot] using hz) have hopen : IsOpen (support f ∩ Ioo (-D.subradius) D.subradius) := hc.isOpen_support.inter isOpen_Ioo have hnonempty : (support f ∩ Ioo (-D.subradius) D.subradius).Nonempty := ⟨u, pow_ne_zero 2 hne, hu⟩ exact lt_of_lt_of_le (hopen.measure_pos volume hnonempty) (measure_mono (by intro x hx exact ⟨hx.1, hx.2.1.le, hx.2.2.le⟩))
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.referenceMoment_posDef · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:134
  • kernel_moments_integrable theorem — For a measurable nonnegative kernel K that is at most K_max and vanishes outside [−1, 1], as carried by a design, u ↦ K(u) u^j u^k is integrable for all 0 ≤ j, k ≤ p.
    p :
    ℕ
    j k :
    Fin (p + 1)
    Integrable (fun u => D.kernel u * (u ^ (j : ℕ) * u ^ (k : ℕ)))
    Proof (Lean source)
    theorem kernel_moments_integrable (D : KernelDesign) (p : ℕ) : ∀ j k : Fin (p + 1), Integrable (fun u => D.kernel u * (u ^ (j : ℕ) * u ^ (k : ℕ))) := by apply unit_moments_integrable (C := D.kernelMax) D.kernel_measurable _ D.kernel_support p intro u hu simpa [Real.norm_eq_abs, abs_of_nonneg (D.kernel_nonneg u)] using D.kernel_upper u
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.kernel_moments_integrable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:180
  • shape_moments_integrable theorem — Let the design density f be measurable and at most f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, at most K_max and zero outside [−1, 1]. For a positive bandwidth h not exceeding r, v ↦ K(v) f(x₀ + h v) v^j v^k is integrable for all 0 ≤ j, k ≤ p.
    p :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    j k :
    Fin (p + 1)
    Integrable (fun u => (D.kernel u * D.density (D.center + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ)))
    Proof (Lean source)
    theorem shape_moments_integrable (D : KernelDesign) (p : ℕ) {h : ℝ} (hh : 0 < h) (hwindow : h ≤ D.radius) : ∀ j k : Fin (p + 1), Integrable (fun u => (D.kernel u * D.density (D.center + h * u)) * (u ^ (j : ℕ) * u ^ (k : ℕ))) := by apply unit_moments_integrable (C := D.kernelMax * D.upper) (D.kernel_measurable.mul (D.density_measurable.comp (measurable_const.add (measurable_const.mul measurable_id)))) _ _ p · intro u hu change ‖D.kernel u * D.density (D.center + h * u)‖ ≤ D.kernelMax * D.upper rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (D.kernel_nonneg u) (D.density_nonneg _))] exact (kernelDensity_upper_dom hh D.kernel_nonneg D.kernel_support (fun a ha => D.density_upper a (ha.trans hwindow)) u).trans ((mul_comm _ _).le.trans (mul_le_mul_of_nonneg_right (D.kernel_upper u) D.upper_nonneg)) · intro u hu simp [D.kernel_support u hu]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.shape_moments_integrable · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:190
  • kernelMoment_posDef theorem — For a measurable nonnegative bounded kernel K that vanishes outside [−1, 1] and is at least K_min > 0 on [−Δ, Δ], as carried by a design, the kernel moment matrix with (j,k) entry ∫ K(u) u^(j+k) du, 0 ≤ j, k ≤ p, is positive definite for every degree p.
    p :
    ℕ
    Proof (Lean source)
    theorem kernelMoment_posDef (D : InteriorDesign) (p : ℕ) : (weightMomentMatrix p D.kernel).PosDef := by apply Matrix.PosDef.of_dotProduct_mulVec_pos weightMomentMatrix_isHermitian intro v hv simp only [star_trivial] have href : 0 < v ⬝ᵥ (referenceMoment D p *ᵥ v) := by simpa only [star_trivial] using (referenceMoment_posDef D p).dotProduct_mulVec_pos hv apply lt_of_lt_of_le (mul_pos D.kernelMin_pos href) apply weightMomentMatrix_quadForm_sandwich D.kernelMin_pos.le (kernel_moments_integrable D p) (reference_moments_integrable D p) intro u by_cases hu : u ∈ Icc (-D.subradius) D.subradius · simpa [hu] using D.kernel_lower u (abs_le.mpr hu) · simpa [hu] using D.kernel_nonneg u
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.kernelMoment_posDef · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:212
  • shape_dominates_reference theorem — Let the design density f lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. For a positive bandwidth h not exceeding r, every vector v satisfies f_min K_min · vᵀ R v ≤ vᵀ T v, where T has (j,k) entry ∫ K(u) f(x₀ + h u) u^(j+k) du and R has (j,k) entry ∫_{−Δ}^{Δ} u^(j+k) du.
    p :
    ℕ
    h :
    ℝ
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    v :
    Fin (p + 1) → ℝ
    (D.lower * D.kernelMin) * (v ⬝ᵥ (referenceMoment D p *ᵥ v))
    ≤ v ⬝ᵥ (weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)) *ᵥ v)
    Proof (Lean source)
    theorem shape_dominates_reference (D : InteriorDesign) (p : ℕ) {h : ℝ} (hh : 0 < h) (hwindow : h ≤ D.radius) : ∀ v : Fin (p + 1) → ℝ, (D.lower * D.kernelMin) * (v ⬝ᵥ (referenceMoment D p *ᵥ v)) ≤ v ⬝ᵥ (weightMomentMatrix p (fun u => D.kernel u * D.density (D.center + h * u)) *ᵥ v) := by apply weightMomentMatrix_quadForm_sandwich (mul_pos D.lower_pos D.kernelMin_pos).le (shape_moments_integrable D p hh hwindow) (reference_moments_integrable D p) intro u have hdom := kernelDensity_lower_dom hh D.kernel_nonneg D.kernel_support (fun a ha => D.density_lower a (ha.trans hwindow)) u refine le_trans ?_ hdom rw [mul_assoc] refine mul_le_mul_of_nonneg_left ?_ D.lower_pos.le by_cases hu : u ∈ Icc (-D.subradius) D.subradius · simpa [hu] using D.kernel_lower u (abs_le.mpr hu) · simpa [hu] using D.kernel_nonneg u
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.shape_dominates_reference · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:231
  • posSemidef_abs_entry_le_trace theorem — If a real square matrix A is positive semidefinite, then every entry satisfies |A_{ij}| ≤ tr A.
    p :
    ℕ
    Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
    hA :
    A.PosSemidef
    i j :
    Fin (p + 1)
    |A i j| ≤ ∑ k, A k k
    Proof (Lean source)
    theorem posSemidef_abs_entry_le_trace {p : ℕ} {A : Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ} (hA : A.PosSemidef) (i j : Fin (p + 1)) : |A i j| ≤ ∑ k, A k k := by have hdiag : ∀ k, 0 ≤ A k k := fun _ => hA.diag_nonneg by_cases hij : i = j · subst j rw [abs_of_nonneg (hdiag i)] exact Finset.single_le_sum (fun k _ => hdiag k) (Finset.mem_univ i) have hsym : A j i = A i j := by have h := congr_fun₂ hA.isHermitian.eq i j simpa [conjTranspose] using h have hplus := hA.dotProduct_mulVec_nonneg (single i 1 + single j 1) have hminus := hA.dotProduct_mulVec_nonneg (single i 1 - single j 1) have hp : 0 ≤ A i i + A i j + A j i + A j j := by simpa [Matrix.mulVec_add, dotProduct_add, add_dotProduct, add_assoc, hsym] using hplus have hm : 0 ≤ A i i - A i j - (A j i - A j j) := by simpa [Matrix.mulVec_sub, dotProduct_sub, sub_dotProduct, hsym] using hminus have hpair : A i i + A j j ≤ ∑ k, A k k := by have h := Finset.sum_le_univ_sum_of_nonneg (s := {i, j}) hdiag simpa [hij] using h have habs : |A i j| ≤ (A i i + A j j) / 2 := by rw [abs_le] constructor <;> linarith [hsym] linarith [hdiag i, hdiag j]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.posSemidef_abs_entry_le_trace · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:273
  • designConstants_positive theorem — Let the design density lie between f_min > 0 and f_max near the evaluation point, and the kernel K be measurable, nonnegative, bounded, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Then for every polynomial degree p, the constants c_row = (p+1) tr(R⁻¹)/(f_min K_min) and c_inv = (G⁻¹)₀₀/f_min are positive and c_top = f_max ∫ K(u) du is nonnegative, where R is the monomial moment matrix on [−Δ, Δ] and G the kernel moment matrix.
    p :
    ℕ
    conclusion 1
    conclusion 2
    conclusion 3
    0 ≤ topConstant D
    Proof (Lean source)
    theorem designConstants_positive (D : InteriorDesign) (p : ℕ) : 0 < inverseRowConstant D p ∧ 0 < inverseConstant D p ∧ 0 ≤ topConstant D := by have htrace : 0 < ∑ j, (referenceMoment D p)⁻¹ j j := (referenceMoment_posDef D p).inv.trace_pos have hdim : 0 < (p + 1 : ℝ) := by positivity refine ⟨?_, ?_, ?_⟩ · exact div_pos (mul_pos hdim htrace) (mul_pos D.lower_pos D.kernelMin_pos) · exact div_pos (kernelMoment_posDef D p).inv.diag_pos D.lower_pos · rw [topConstant] exact mul_nonneg (D.lower_pos.le.trans D.lower_le_upper) (integral_nonneg fun u => D.kernel_nonneg u)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.designConstants_positive · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:302
  • designTolerance_spec theorem — Let the design density lie between f_min > 0 and f_max near the evaluation point, and the kernel be measurable, nonnegative, bounded, zero outside [−1, 1] and bounded below on [−Δ, Δ]. Then for every polynomial degree p, the tolerance t₀ = min(1, 1/(2 (p+1) c_row), c_inv/(2 (p+1) c_row²)) satisfies 0 < t₀ ≤ 1, c_row (p+1) t₀ ≤ 1/2 and 2 c_row² (p+1) t₀ ≤ c_inv.
    p :
    ℕ
    conclusion 1
    conclusion 2
    designTolerance D p ≤ 1
    conclusion 3
    inverseRowConstant D p * ((p + 1 : ℝ) * designTolerance D p) ≤ 1 / 2
    conclusion 4
    2 * inverseRowConstant D p ^ 2 * ((p + 1 : ℝ) * designTolerance D p) ≤ inverseConstant D p
    Proof (Lean source)
    theorem designTolerance_spec (D : InteriorDesign) (p : ℕ) : 0 < designTolerance D p ∧ designTolerance D p ≤ 1 ∧ inverseRowConstant D p * ((p + 1 : ℝ) * designTolerance D p) ≤ 1 / 2 ∧ 2 * inverseRowConstant D p ^ 2 * ((p + 1 : ℝ) * designTolerance D p) ≤ inverseConstant D p := by obtain ⟨hrow, hinv, _⟩ := designConstants_positive D p have hdim : 0 < (p + 1 : ℝ) := by positivity have hden₁ : 0 < 2 * (p + 1 : ℝ) * inverseRowConstant D p := by positivity have hden₂ : 0 < 2 * (p + 1 : ℝ) * inverseRowConstant D p ^ 2 := by positivity have hfirst : designTolerance D p ≤ 1 / (2 * (p + 1 : ℝ) * inverseRowConstant D p) := (min_le_right _ _).trans (min_le_left _ _) have hsecond : designTolerance D p ≤ inverseConstant D p / (2 * (p + 1 : ℝ) * inverseRowConstant D p ^ 2) := (min_le_right _ _).trans (min_le_right _ _) refine ⟨?_, min_le_left _ _, ?_, ?_⟩ · exact lt_min (by norm_num) (lt_min (div_pos (by norm_num) hden₁) (div_pos hinv hden₂)) · have h := (le_div_iff₀ hden₁).mp hfirst nlinarith · have h := (le_div_iff₀ hden₂).mp hsecond nlinarith
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.designTolerance_spec · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:352
  • tailExponent_pos theorem — Let the design density lie between f_min > 0 and f_max near the evaluation point and the kernel be bounded by K_max and bounded below by K_min > 0 on [−Δ, Δ]. For a positive tolerance t, t² / (4 (2 f_max K_max² + K_max t)) > 0.
    t :
    ℝ
    ht :
    0 < t
    0 < tailExponent D t
    Proof (Lean source)
    theorem tailExponent_pos (D : InteriorDesign) {t : ℝ} (ht : 0 < t) : 0 < tailExponent D t := by unfold tailExponent have hu : 0 < D.upper := lt_of_lt_of_le D.lower_pos D.lower_le_upper have hw : 0 < D.kernelMax := D.kernelMax_pos positivity
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.tailExponent_pos · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/PopulationMoment.lean:380
Rate 4 core · 5 supporting With the bandwidth h = N^(−1/(2β+1)) the squared-bias term h^(2β) and the variance term 1/(N h) both equal N^(−2β/(2β+1)), and the exponentially small design-failure term is at most a constant times the same power. ★ localPoly_clipped_pointwise_rate

Pointwise rate of the clipped local-polynomial estimator, dimension one

With the bandwidth h = N^(−1/(2β+1)) the squared-bias term h^(2β) and the variance term 1/(N h) both equal N^(−2β/(2β+1)), and the exponentially small design-failure term is at most a constant times the same power. localPoly_clipped_pointwise_rate concludes that, once N ≥ max(1, ⌈r^(−(2β+1))⌉) so that the bandwidth fits inside the window on which the design density is bounded, the clipped local-polynomial intercept has mean-squared error at most an explicit constant times N^(−2β/(2β+1)).

This is an upper bound, for the clipped estimator, in dimension one, at exactly this bandwidth.

def balancingBandwidth reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a smoothness β and a sample size N, the balancing bandwidth in dimension one is h = N^(−1/(2β+1)), the bandwidth at which the squared-bias term h^(2β) and the variance term 1/(N h) are equal.

Definition (Lean source)
β :
ℝ
N :
ℕ
balancingBandwidth β N :
ℝ
HistogramRegression.optimizedBandwidth 1 β N
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.balancingBandwidth · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:32
def rateThreshold reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design whose density bounds hold on [x₀ − r, x₀ + r] and a smoothness β, the sample-size threshold is max(1, ⌈r^(−(2β+1))⌉), the smallest sample size from which the bandwidth N^(−1/(2β+1)) is at most r.

Definition (Lean source)
β :
ℝ
rateThreshold D β :
ℕ
max 1 ⌈D.radius ^ (-(2 * β + 1))⌉₊
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.rateThreshold · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:38 · uses InteriorDesign
def pointwiseRateConstant reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

For a design with density bounds f_min ≤ f_max near the evaluation point and a kernel bounded above and, on [−Δ, Δ], below, a smoothness β, a Hölder constant H, a clipping level M and a noise scale σ, the pointwise rate constant is C = C_bias² + C_var + 16 M² (p+1)² / c₀, where p = ⌈β⌉ − 1, C_bias and C_var are the bias and variance constants, and c₀ is the Bernstein exponent at the design tolerance.

Definition (Lean source)
β H M σ :
ℝ
pointwiseRateConstant D β H M σ :
ℝ
biasConstant D β H ^ 2
+ 16 * M ^ 2 * (holderDerivOrder β + 1 : ℝ) ^ 2 / tailExponent D (designTolerance D (holderDerivOrder β))
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.pointwiseRateConstant · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:128 · uses InteriorDesign
theorem localPoly_clipped_pointwise_rate reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Pointwise rate N^(−2β/(2β+1)) for the clipped local-polynomial estimator at an interior point, dimension one. Let the design density lie between positive constants f_min ≤ f_max on an interval [x₀ − r, x₀ + r], and let the kernel K be measurable, nonnegative, at most K_max, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Suppose for some β > 0 and p = ⌈β⌉ − 1 the regression function m is, on that interval, p times continuously differentiable with p-th derivative Hölder of order β − p and constant H, the sample size satisfies N ≥ max(1, ⌈r^(−(2β+1))⌉), and the clipping level M satisfies |m(x₀)| ≤ M. Let (X_i, Y_i), i = 1, …, N, be independent pairs with X_i drawn from the design density and Y_i drawn, given X_i, from a conditional outcome distribution that at almost every design point x in that interval has a finite second moment, mean m(x) and variance at most σ². Then the degree-p kernel-weighted least-squares intercept at x₀ with bandwidth h = N^(−1/(2β+1)) (taken to be zero when the weighted design matrix is singular), clipped to [−M, M], satisfies E[(m̂(x₀) − m(x₀))²] ≤ C · N^(−2β/(2β+1)) with C = C_bias² + C_var + 16 M² (p+1)² / c₀, an explicit function of f_min, f_max, K_min, K_max, Δ, the kernel moments, p, H, σ and M that does not depend on N.

Formal statement
β H M σ :
ℝ
N :
ℕ
m :
ℝ → ℝ
hm :
HolderRegression D.center D.radius β H m
hN :
rateThreshold D β ≤ N
hM :
|m D.center| ≤ M
κ :
hnoise :
∀ᵐ x ∂D.law, |x - D.center|
≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ x) ∧
(∫ y, y ∂κ x) = m x ∧
Var[fun y : ℝ => y; κ x] ≤ σ ^ 2
(∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) (balancingBandwidth β N) M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ))
≤ pointwiseRateConstant D β H M σ * (N : ℝ) ^ (-(2 * β / (2 * β + 1)))
Proof (Lean source)
theorem localPoly_clipped_pointwise_rate (D : InteriorDesign) {β H M σ : ℝ} {N : ℕ} {m : ℝ → ℝ} (hm : HolderRegression D.center D.radius β H m) (hN : rateThreshold D β ≤ N) (hM : |m D.center| ≤ M) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (hnoise : ∀ᵐ x ∂D.law, |x - D.center| ≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ x) ∧ (∫ y, y ∂κ x) = m x ∧ Var[fun y : ℝ => y; κ x] ≤ σ ^ 2) : (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) (balancingBandwidth β N) M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ)) ≤ pointwiseRateConstant D β H M σ * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) := by obtain ⟨hNpos, hbandpos, hwindow⟩ := balancingBandwidth_spec D hm.1 hN obtain ⟨hbiasPower, hinvEffective⟩ := balancingBandwidth_power_identities hm.1 hNpos have hrisk := localPoly_clipped_mse_unconditional D hm hNpos hbandpos hwindow hM κ hnoise rw [hbiasPower, show varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * balancingBandwidth β N) = varianceConstant D (holderDerivOrder β) σ * (1 / ((N : ℝ) * balancingBandwidth β N)) by ring, hinvEffective] at hrisk have htail := mul_le_mul_of_nonneg_left (balancing_failureBound_le D hm.1 hNpos) (by positivity : 0 ≤ 8 * M ^ 2) calc _ ≤ biasConstant D β H ^ 2 * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) + varianceConstant D (holderDerivOrder β) σ * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) + 8 * M ^ 2 * failureBound D (holderDerivOrder β) N (balancingBandwidth β N) (designTolerance D (holderDerivOrder β)) := hrisk _ ≤ biasConstant D β H ^ 2 * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) + varianceConstant D (holderDerivOrder β) σ * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) + 8 * M ^ 2 * ((2 * (holderDerivOrder β + 1 : ℝ) ^ 2 / tailExponent D (designTolerance D (holderDerivOrder β))) * (N : ℝ) ^ (-(2 * β / (2 * β + 1)))) := add_le_add le_rfl htail _ = _ := by unfold pointwiseRateConstant; ring
5 supporting declarations (lemmas, instances)
  • balancingBandwidth_eq theorem — The balancing bandwidth for smoothness β and sample size N equals N^(−1/(2β+1)).
    β :
    ℝ
    N :
    ℕ
    balancingBandwidth β N = (N : ℝ) ^ (-(1 / (2 * β + 1)))
    Proof (Lean source)
    theorem balancingBandwidth_eq (β : ℝ) (N : ℕ) : balancingBandwidth β N = (N : ℝ) ^ (-(1 / (2 * β + 1))) := by simp [balancingBandwidth, HistogramRegression.optimizedBandwidth]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.balancingBandwidth_eq · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:44
  • balancingBandwidth_power_identities theorem — For a positive smoothness β and a positive sample size N, the bandwidth h = N^(−1/(2β+1)) satisfies h^(2β) = N^(−2β/(2β+1)) and 1/(N h) = N^(−2β/(2β+1)).
    β :
    ℝ
    hβ :
    0 < β
    N :
    ℕ
    hN :
    0 < N
    conclusion 1
    balancingBandwidth β N ^ (2 * β) = (N : ℝ) ^ (-(2 * β / (2 * β + 1)))
    conclusion 2
    1 / ((N : ℝ) * balancingBandwidth β N) = (N : ℝ) ^ (-(2 * β / (2 * β + 1)))
    Proof (Lean source)
    theorem balancingBandwidth_power_identities {β : ℝ} (hβ : 0 < β) {N : ℕ} (hN : 0 < N) : balancingBandwidth β N ^ (2 * β) = (N : ℝ) ^ (-(2 * β / (2 * β + 1))) ∧ 1 / ((N : ℝ) * balancingBandwidth β N) = (N : ℝ) ^ (-(2 * β / (2 * β + 1))) := by simpa [balancingBandwidth] using HistogramRegression.optimized_power_identities 1 β N hβ hN
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.balancingBandwidth_power_identities · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:50
  • balancingBandwidth_spec theorem — Let the design window be [x₀ − r, x₀ + r] with r > 0. For a positive smoothness β and a sample size N ≥ max(1, ⌈r^(−(2β+1))⌉), N is positive and the bandwidth h = N^(−1/(2β+1)) satisfies 0 < h ≤ r.
    β :
    ℝ
    hβ :
    0 < β
    N :
    ℕ
    hN :
    rateThreshold D β ≤ N
    conclusion 1
    0 < N
    conclusion 2
    conclusion 3
    balancingBandwidth β N ≤ D.radius
    Proof (Lean source)
    theorem balancingBandwidth_spec (D : InteriorDesign) {β : ℝ} (hβ : 0 < β) {N : ℕ} (hN : rateThreshold D β ≤ N) : 0 < N ∧ 0 < balancingBandwidth β N ∧ balancingBandwidth β N ≤ D.radius := by have hNpos : 0 < N := lt_of_lt_of_le Nat.zero_lt_one ((le_max_left _ _).trans hN) have hNreal : 0 < (N : ℝ) := by exact_mod_cast hNpos have hden : 0 < 2 * β + 1 := by linarith have hceil : ⌈D.radius ^ (-(2 * β + 1))⌉₊ ≤ N := (le_max_right _ _).trans hN have hrN : D.radius ^ (-(2 * β + 1)) ≤ (N : ℝ) := (Nat.le_ceil _).trans (by exact_mod_cast hceil) refine ⟨hNpos, ?_, ?_⟩ <;> rw [balancingBandwidth_eq] · exact Real.rpow_pos_of_pos hNreal _ · calc (N : ℝ) ^ (-(1 / (2 * β + 1))) ≤ (D.radius ^ (-(2 * β + 1))) ^ (-(1 / (2 * β + 1))) := Real.rpow_le_rpow_of_nonpos (Real.rpow_pos_of_pos D.radius_pos _) hrN (neg_nonpos.mpr (le_of_lt (one_div_pos.mpr hden))) _ = D.radius := by rw [← Real.rpow_mul D.radius_pos.le] have hexp : -(2 * β + 1) * -(1 / (2 * β + 1)) = 1 := by field_simp rw [hexp, Real.rpow_one]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.balancingBandwidth_spec · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:59
  • balancing_failureBound_le theorem — Let the design density lie between f_min > 0 and f_max near the evaluation point, and the kernel be measurable, nonnegative, bounded, zero outside [−1, 1] and bounded below on [−Δ, Δ]. For a positive smoothness β with p = ⌈β⌉ − 1, and a positive sample size N, at the bandwidth h = N^(−1/(2β+1)) the failure bound satisfies 2 (p+1)² exp(−c₀ N h) ≤ (2 (p+1)² / c₀) · N^(−2β/(2β+1)), where c₀ > 0 is the Bernstein exponent at the design tolerance.
    β :
    ℝ
    hβ :
    0 < β
    N :
    ℕ
    hN :
    0 < N
    ≤ (2 * (holderDerivOrder β + 1 : ℝ) ^ 2 / tailExponent D (designTolerance D (holderDerivOrder β))) * (N : ℝ) ^ (-(2 * β / (2 * β + 1)))
    Proof (Lean source)
    theorem balancing_failureBound_le (D : InteriorDesign) {β : ℝ} (hβ : 0 < β) {N : ℕ} (hN : 0 < N) : failureBound D (holderDerivOrder β) N (balancingBandwidth β N) (designTolerance D (holderDerivOrder β)) ≤ (2 * (holderDerivOrder β + 1 : ℝ) ^ 2 / tailExponent D (designTolerance D (holderDerivOrder β))) * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) := by have hNreal : 0 < (N : ℝ) := by exact_mod_cast hN let a := tailExponent D (designTolerance D (holderDerivOrder β)) have ha : 0 < a := tailExponent_pos D (designTolerance_spec D _).1 have hs : 0 < (N : ℝ) * balancingBandwidth β N := by rw [balancingBandwidth_eq] exact mul_pos hNreal (Real.rpow_pos_of_pos hNreal _) have hrecip := (balancingBandwidth_power_identities hβ hN).2 have hexp : exp (-((N : ℝ) * balancingBandwidth β N * a)) ≤ 1 / ((N : ℝ) * balancingBandwidth β N * a) := by rw [Real.exp_neg, ← one_div] apply one_div_le_one_div_of_le (mul_pos hs ha) linarith [Real.add_one_le_exp ((N : ℝ) * balancingBandwidth β N * a)] unfold failureBound change 2 * (holderDerivOrder β + 1 : ℝ) ^ 2 * exp (-(N : ℝ) * balancingBandwidth β N * a) ≤ (2 * (holderDerivOrder β + 1 : ℝ) ^ 2 / a) * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) rw [show -(N : ℝ) * balancingBandwidth β N * a = -((N : ℝ) * balancingBandwidth β N * a) by ring] calc _ ≤ 2 * (holderDerivOrder β + 1 : ℝ) ^ 2 * (1 / ((N : ℝ) * balancingBandwidth β N * a)) := mul_le_mul_of_nonneg_left hexp (by positivity) _ = (2 * (holderDerivOrder β + 1 : ℝ) ^ 2 / a) * (1 / ((N : ℝ) * balancingBandwidth β N)) := by ring _ = _ := by rw [hrecip]
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.balancing_failureBound_le · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:86
  • localPoly_clipped_pointwise_rate_of_contDiff theorem — Pointwise rate N^(−2β/(2β+1)) of the clipped local-polynomial estimator for a globally smooth regression function, dimension one. Let the design density lie between positive constants f_min ≤ f_max on an interval [x₀ − r, x₀ + r], and let the kernel K be measurable, nonnegative, at most K_max, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Suppose β > 0, H ≥ 0, the regression function m is p = ⌈β⌉ − 1 times continuously differentiable on the whole real line, and its p-th derivative satisfies |m⁽ᵖ⁾(x) − m⁽ᵖ⁾(y)| ≤ H |x − y|^(β − p) for all x, y in that interval. Suppose also the sample size satisfies N ≥ max(1, ⌈r^(−(2β+1))⌉) and the clipping level M satisfies |m(x₀)| ≤ M. Let (X_i, Y_i), i = 1, …, N, be independent pairs with X_i drawn from the design density and Y_i drawn, given X_i, from a conditional outcome distribution that at almost every design point x has a finite second moment, mean m(x) and variance at most σ². Then the degree-p kernel-weighted least-squares intercept at x₀ with bandwidth h = N^(−1/(2β+1)) (taken to be zero when the weighted design matrix is singular), clipped to [−M, M], satisfies E[(m̂(x₀) − m(x₀))²] ≤ C · N^(−2β/(2β+1)) with the same constant C = C_bias² + C_var + 16 M² (p+1)² / c₀ as in the version with assumptions on the interval only.
    β H M σ :
    ℝ
    N :
    ℕ
    m :
    ℝ → ℝ
    hβ :
    0 < β
    hH :
    0 ≤ H
    hm :
    ContDiff ℝ (holderDerivOrder β) m
    hb :
    ∀ x ∈ Icc (D.center - D.radius) (D.center + D.radius),
    ∀ y ∈ Icc (D.center - D.radius) (D.center + D.radius),
    |iteratedDeriv (holderDerivOrder β) m x - iteratedDeriv (holderDerivOrder β) m y|
    ≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))
    hN :
    rateThreshold D β ≤ N
    hM :
    |m D.center| ≤ M
    κ :
    hnoise :
    ∀ᵐ x ∂D.law, MemLp (fun y : ℝ => y) 2 (κ x) ∧ (∫ y, y ∂κ x)
    = m x ∧ Var[fun y : ℝ => y; κ x] ≤ σ ^ 2
    (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) (balancingBandwidth β N) M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ))
    ≤ pointwiseRateConstant D β H M σ * (N : ℝ) ^ (-(2 * β / (2 * β + 1)))
    Proof (Lean source)
    theorem localPoly_clipped_pointwise_rate_of_contDiff (D : InteriorDesign) {β H M σ : ℝ} {N : ℕ} {m : ℝ → ℝ} (hβ : 0 < β) (hH : 0 ≤ H) (hm : ContDiff ℝ (holderDerivOrder β) m) (hb : ∀ x ∈ Icc (D.center - D.radius) (D.center + D.radius), ∀ y ∈ Icc (D.center - D.radius) (D.center + D.radius), |iteratedDeriv (holderDerivOrder β) m x - iteratedDeriv (holderDerivOrder β) m y| ≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))) (hN : rateThreshold D β ≤ N) (hM : |m D.center| ≤ M) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (hnoise : ∀ᵐ x ∂D.law, MemLp (fun y : ℝ => y) 2 (κ x) ∧ (∫ y, y ∂κ x) = m x ∧ Var[fun y : ℝ => y; κ x] ≤ σ ^ 2) : (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) (balancingBandwidth β N) M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ)) ≤ pointwiseRateConstant D β H M σ * (N : ℝ) ^ (-(2 * β / (2 * β + 1))) := localPoly_clipped_pointwise_rate D (HolderRegression.of_contDiff D.center D.radius D.radius_pos hβ hH hm hb) hN hM κ (hnoise.mono fun _ hx _ => hx)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.localPoly_clipped_pointwise_rate_of_contDiff · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Rate.lean:200
Risk 1 core · 4 supporting localPoly_clipped_mse_unconditional: at an interior point x₀, for independent pairs (X_i, Y_i) whose design density is bounded above and below near x₀, a regression function in a local Hölder class of smoothness β, and r ★ localPoly_clipped_mse_unconditional

Unconditional mean-squared error of the clipped local-polynomial estimator, dimension one

localPoly_clipped_mse_unconditional: at an interior point x₀, for independent pairs (X_i, Y_i) whose design density is bounded above and below near x₀, a regression function in a local Hölder class of smoothness β, and responses with conditional variance at most σ², the degree-p local-polynomial intercept (p = ⌈β⌉ − 1) clipped to [−M, M], where |m(x₀)| ≤ M, has mean-squared error at most C_bias² h^(2β) + C_var/(N h) + 16 M² (p+1)² exp(−c₀ N h).

The event that the empirical kernel moments are close to their expectations is constructed, not assumed: on it the conditional mean-squared error is at most the first two terms, and its complement has probability at most 2 (p+1)² exp(−c₀ N h). A bounded estimator's squared loss is lifted from the event to the whole sample at the cost of 8 M² times the probability of the complement (bounded_fibre_mse_lift). The result is an upper bound for the clipped estimator; neither the responses nor the regression function need be bounded.

theorem localPoly_clipped_mse_unconditional reviewed
Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate

Unconditional mean-squared error of the clipped local-polynomial estimator at an interior point, dimension one. Let the design density lie between positive constants f_min ≤ f_max on an interval [x₀ − r, x₀ + r], and let the kernel K be measurable, nonnegative, at most K_max, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Suppose for some β > 0 and p = ⌈β⌉ − 1 the regression function m is, on that interval, p times continuously differentiable with p-th derivative Hölder of order β − p and constant H, the sample size N is positive, the bandwidth h is positive and at most r, and the clipping level M satisfies |m(x₀)| ≤ M. Let (X_i, Y_i), i = 1, …, N, be independent pairs with X_i drawn from the design density and Y_i drawn, given X_i, from a conditional outcome distribution that at almost every design point x in that interval has a finite second moment, mean m(x) and variance at most σ². Then the degree-p kernel-weighted least-squares intercept at x₀ (taken to be zero when the weighted design matrix is singular), clipped to [−M, M], satisfies E[(m̂(x₀) − m(x₀))²] ≤ C_bias² h^(2β) + C_var/(N h) + 16 M² (p+1)² exp(−c₀ N h), where C_bias, C_var and c₀ > 0 are explicit functions of f_min, f_max, K_min, K_max, Δ, the kernel moments, p, H and σ that do not depend on N or h.

Formal statement
β H h M σ :
ℝ
N :
ℕ
m :
ℝ → ℝ
hm :
HolderRegression D.center D.radius β H m
hN :
0 < N
hh :
0 < h
hwindow :
h ≤ D.radius
hM :
|m D.center| ≤ M
κ :
hnoise :
∀ᵐ x ∂D.law, |x - D.center|
≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ x) ∧
(∫ y, y ∂κ x) = m x ∧
Var[fun y : ℝ => y; κ x] ≤ σ ^ 2
(∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) h M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ))
≤ biasConstant D β H ^ 2 * h ^ (2 * β)
+ varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h)
Proof (Lean source)
theorem localPoly_clipped_mse_unconditional (D : InteriorDesign) {β H h M σ : ℝ} {N : ℕ} {m : ℝ → ℝ} (hm : HolderRegression D.center D.radius β H m) (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (hM : |m D.center| ≤ M) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (hnoise : ∀ᵐ x ∂D.law, |x - D.center| ≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ x) ∧ (∫ y, y ∂κ x) = m x ∧ Var[fun y : ℝ => y; κ x] ≤ σ ^ 2) : (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) h M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ)) ≤ biasConstant D β H ^ 2 * h ^ (2 * β) + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h) + 8 * M ^ 2 * failureBound D (holderDerivOrder β) N h (designTolerance D (holderDerivOrder β)) := by let := D.probability have hMnonneg : 0 ≤ M := (abs_nonneg _).trans hM have hinv : 0 < inverseConstant D (holderDerivOrder β) := (designConstants_positive D (holderDerivOrder β)).2.1 have hR : 0 ≤ biasConstant D β H ^ 2 * h ^ (2 * β) + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h) := by unfold varianceConstant have hNreal : 0 < (N : ℝ) := by exact_mod_cast hN have hkernel := D.kernelMax_pos positivity have hgood : ∀ᵐ x ∂Measure.pi (fun _ : Fin N => D.law), x ∈ momentEvent D (holderDerivOrder β) h N (designTolerance D (holderDerivOrder β)) → (∫ y, (clippedIntercept D (holderDerivOrder β) h M x y - m D.center) ^ 2 ∂Causalean.Stat.finProductKernel N κ x) ≤ biasConstant D β H ^ 2 * h ^ (2 * β) + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h) := by have hall : ∀ᵐ x ∂Measure.pi (fun _ : Fin N => D.law), ∀ i, |x i - D.center| ≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧ (∫ y, y ∂κ (x i)) = m (x i) ∧ Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2 := ae_all_iff.mpr (fun i => (measurePreserving_eval (fun _ : Fin N => D.law) i).quasiMeasurePreserving.ae hnoise) filter_upwards [hall] with x hx hxG rw [finProductKernel_apply] exact localPoly_fibre_mse_on_momentEvent D hm hN hh hwindow hM κ x hx hxG have hlift := bounded_fibre_mse_lift (Measure.pi (fun _ : Fin N => D.law)) (finProductKernel N κ) (fun z => clippedIntercept D (holderDerivOrder β) h M z.1 z.2) (clippedIntercept_measurable D (holderDerivOrder β) N h M) (momentEvent_measurable D (holderDerivOrder β) N h (designTolerance D (holderDerivOrder β))) hM hR (fun z => abs_clipIcc_neg_le hMnonneg _) hgood rw [clippedIntercept_iid_risk_eq D (holderDerivOrder β) N h M (m D.center) κ] exact hlift.trans (add_le_add le_rfl (mul_le_mul_of_nonneg_left (localPoly_moment_simultaneous_probability D (holderDerivOrder β) N hN hh hwindow (designTolerance_spec D (holderDerivOrder β)).1) (by positivity : 0 ≤ 8 * M ^ 2)))
4 supporting declarations (lemmas, instances)
  • bounded_fibre_mse_lift theorem — From a good-design event to the unconditional mean-squared error. Let the design X have a probability law and the response Y be drawn, given X, from a conditional distribution. Let a measurable estimator θ̂(X, Y) be bounded by M in absolute value, let the target θ satisfy |θ| ≤ M, and let R ≥ 0. If on a measurable set G of designs the conditional mean-squared error E[(θ̂ − θ)² | X] is at most R for almost every design in G, then E[(θ̂ − θ)²] ≤ R + 8 M² · P(X ∉ G).
    κ :
    est :
    A × B → ℝ
    hmeas :
    G :
    Set A
    hG :
    θ M R :
    ℝ
    hθ :
    |θ| ≤ M
    hR :
    0 ≤ R
    hbound :
    ∀ z, |est z| ≤ M
    hgood :
    ∀ᵐ x ∂P, x ∈ G → (∫ y, (est (x, y) - θ) ^ 2 ∂κ x) ≤ R
    (∫ z, (est z - θ) ^ 2 ∂(P ⊗ₘ κ)) ≤ R + 8 * M ^ 2 * P.real Gᶜ
    Proof (Lean source)
    theorem bounded_fibre_mse_lift {A B : Type*} [MeasurableSpace A] [MeasurableSpace B] (P : Measure A) [IsProbabilityMeasure P] (κ : Kernel A B) [IsMarkovKernel κ] (est : A × B → ℝ) (hmeas : Measurable est) {G : Set A} (hG : MeasurableSet G) {θ M R : ℝ} (hθ : |θ| ≤ M) (hR : 0 ≤ R) (hbound : ∀ z, |est z| ≤ M) (hgood : ∀ᵐ x ∂P, x ∈ G → (∫ y, (est (x, y) - θ) ^ 2 ∂κ x) ≤ R) : (∫ z, (est z - θ) ^ 2 ∂(P ⊗ₘ κ)) ≤ R + 8 * M ^ 2 * P.real Gᶜ := by let loss : A × B → ℝ := fun z => (est z - θ) ^ 2 have hloss : Measurable loss := (hmeas.sub_const θ).pow_const 2 have hloss_bound : ∀ z, |loss z| ≤ 4 * M ^ 2 := by intro z have he := abs_le.mp (hbound z) have ht := abs_le.mp hθ have hM : 0 ≤ M := (abs_nonneg θ).trans hθ dsimp only [loss] rw [abs_of_nonneg (sq_nonneg _)] nlinarith [sq_nonneg (est z - θ + 2 * M), sq_nonneg (2 * M - (est z - θ)), mul_nonneg (show 0 ≤ 2 * M - (est z - θ) by linarith) (show 0 ≤ 2 * M + (est z - θ) by linarith)] have hloss_int : Integrable loss (P ⊗ₘ κ) := (integrable_const (4 * M ^ 2)).mono' hloss.aestronglyMeasurable (Filter.Eventually.of_forall fun z => by simpa only [Real.norm_eq_abs] using hloss_bound z) let F : A → ℝ := fun x => ∫ y, loss (x, y) ∂κ x have hFmeas : StronglyMeasurable F := hloss.stronglyMeasurable.integral_kernel_prod_right' have hFnonneg : ∀ x, 0 ≤ F x := fun x => integral_nonneg (fun y => sq_nonneg _) have hFbound : ∀ x, |F x| ≤ 4 * M ^ 2 := by intro x have hb := norm_integral_le_of_norm_le_const (μ := κ x) (f := fun y => loss (x, y)) (C := 4 * M ^ 2) (Filter.Eventually.of_forall fun y => by simpa only [Real.norm_eq_abs] using hloss_bound (x, y)) simpa only [Real.norm_eq_abs, probReal_univ, mul_one] using hb have hFint : Integrable F P := (integrable_const (4 * M ^ 2)).mono' hFmeas.aestronglyMeasurable (Filter.Eventually.of_forall fun x => by simpa only [Real.norm_eq_abs] using hFbound x) have hcond : ∀ᵐ x ∂P, x ∈ G → |(P[F | ‹MeasurableSpace A›]) x - 0| ≤ R := by rw [condExp_of_stronglyMeasurable le_rfl hFmeas hFint] filter_upwards [hgood] with x hx hxG simpa only [sub_zero, abs_of_nonneg (hFnonneg x)] using hx hxG have hb := estimatorBias_unconditional (μ := P) (m := ‹MeasurableSpace A›) (est := F) (θ := 0) (B := R) (M := 4 * M ^ 2) le_rfl hFint hFbound (by simpa using mul_nonneg (by norm_num : (0 : ℝ) ≤ 4) (sq_nonneg M)) hR hG hcond rw [Measure.integral_compProd hloss_int] change (∫ x, F x ∂P) ≤ _ exact (le_abs_self _).trans (by simpa only [sub_zero, Measure.real, show (2 : ℝ) * (4 * M ^ 2) = 8 * M ^ 2 by ring] using hb)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.bounded_fibre_mse_lift · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Risk.lean:40
  • clippedIntercept_iid_risk_eq theorem — Let the design law, kernel and evaluation point be given and let the response be drawn, given the design point, from a conditional outcome distribution. Then for every degree, sample size, bandwidth, clipping level and target, the expected squared error of the clipped local-polynomial intercept over N independent pairs (X_i, Y_i) equals its expected squared error when the N design points are drawn first, independently, and the responses are then drawn independently given the design points.
    p N :
    ℕ
    h M θ :
    ℝ
    κ :
    (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D p h M (fun i => (z i).1) (fun i => (z i).2) - θ) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ))
    = ∫ z : (Fin N → ℝ) × (Fin N → ℝ), (clippedIntercept D p h M z.1 z.2 - θ) ^ 2 ∂(Measure.pi (fun _ : Fin N => D.law) ⊗ₘ finProductKernel N κ)
    Proof (Lean source)
    theorem clippedIntercept_iid_risk_eq (D : KernelDesign) (p N : ℕ) (h M θ : ℝ) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] : (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D p h M (fun i => (z i).1) (fun i => (z i).2) - θ) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ)) = ∫ z : (Fin N → ℝ) × (Fin N → ℝ), (clippedIntercept D p h M z.1 z.2 - θ) ^ 2 ∂(Measure.pi (fun _ : Fin N => D.law) ⊗ₘ finProductKernel N κ) := by let := D.probability let split : (Fin N → ℝ × ℝ) → (Fin N → ℝ) × (Fin N → ℝ) := fun z => (fun i => (z i).1, fun i => (z i).2) have hs : Measurable split := by fun_prop have hf : Measurable (fun z : (Fin N → ℝ) × (Fin N → ℝ) => (clippedIntercept D p h M z.1 z.2 - θ) ^ 2) := ((clippedIntercept_measurable D p N h M).sub_const θ).pow_const 2 rw [← iid_joint_map_split N D.law κ] exact (integral_map hs.aemeasurable hf.aestronglyMeasurable).symm
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.clippedIntercept_iid_risk_eq · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Risk.lean:97
  • localPoly_fibre_mse_on_momentEvent theorem — Conditional mean-squared error on the moment event, dimension one. Let the design density lie between f_min > 0 and f_max on [x₀ − r, x₀ + r], and the kernel K be measurable, nonnegative, at most K_max, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ], and let the regression function m be, on the window [x₀ − r, x₀ + r], p = ⌈β⌉ − 1 times continuously differentiable with p-th derivative Hölder of order β − p and constant H. Take a positive sample size N, a positive bandwidth h not exceeding r, a clipping level M with |m(x₀)| ≤ M, and design points x_1, …, x_N for which every empirical kernel moment is within the design tolerance of its expectation. Let the responses be independent with Y_i drawn from a conditional outcome distribution that at each x_i in the window [x₀ − r, x₀ + r] has a finite second moment, mean m(x_i) and variance at most σ². Then the degree-p intercept clipped to [−M, M] satisfies E[(m̂ − m(x₀))²] ≤ C_bias² h^(2β) + C_var/(N h), the expectation being over the responses.
    β H h M σ :
    ℝ
    N :
    ℕ
    m :
    ℝ → ℝ
    hm :
    HolderRegression D.center D.radius β H m
    hN :
    0 < N
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    hM :
    |m D.center| ≤ M
    κ :
    x :
    Fin N → ℝ
    hnoise :
    ∀ i
    if
    |x i - D.center| ≤ D.radius
    then
    MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧
    (∫ y, y ∂κ (x i)) = m (x i) ∧
    Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2
    (∫ y, (clippedIntercept D (holderDerivOrder β) h M x y - m D.center) ^ 2 ∂Measure.pi (fun i => κ (x i)))
    ≤ biasConstant D β H ^ 2 * h ^ (2 * β)
    + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h)
    Proof (Lean source)
    theorem localPoly_fibre_mse_on_momentEvent (D : InteriorDesign) {β H h M σ : ℝ} {N : ℕ} {m : ℝ → ℝ} (hm : HolderRegression D.center D.radius β H m) (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (hM : |m D.center| ≤ M) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (x : Fin N → ℝ) (hnoise : ∀ i, |x i - D.center| ≤ D.radius → MemLp (fun y : ℝ => y) 2 (κ (x i)) ∧ (∫ y, y ∂κ (x i)) = m (x i) ∧ Var[fun y : ℝ => y; κ (x i)] ≤ σ ^ 2) (hx : x ∈ momentEvent D (holderDerivOrder β) h N (designTolerance D (holderDerivOrder β))) : (∫ y, (clippedIntercept D (holderDerivOrder β) h M x y - m D.center) ^ 2 ∂Measure.pi (fun i => κ (x i))) ≤ biasConstant D β H ^ 2 * h ^ (2 * β) + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h) := by obtain ⟨hdet, hinv, hlev⟩ := localPoly_leverage_on_momentEvent D (holderDerivOrder β) hN hh hwindow x hx exact localPoly_fibre_mse_of_designBounds D hm hh hwindow hM κ x hnoise hdet hinv hlev
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.localPoly_fibre_mse_on_momentEvent · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Risk.lean:121
  • localPoly_clipped_mse_unconditional_of_contDiff theorem — Unconditional mean-squared error of the clipped local-polynomial estimator for a globally smooth regression function, dimension one. Let the design density lie between positive constants f_min ≤ f_max on an interval [x₀ − r, x₀ + r], and let the kernel K be measurable, nonnegative, at most K_max, zero outside [−1, 1] and at least K_min > 0 on [−Δ, Δ]. Suppose β > 0, H ≥ 0, the regression function m is p = ⌈β⌉ − 1 times continuously differentiable on the whole real line, and its p-th derivative satisfies |m⁽ᵖ⁾(x) − m⁽ᵖ⁾(y)| ≤ H |x − y|^(β − p) for all x, y in that interval. Suppose also the sample size N is positive, the bandwidth h is positive and at most r, and the clipping level M satisfies |m(x₀)| ≤ M. Let (X_i, Y_i), i = 1, …, N, be independent pairs with X_i drawn from the design density and Y_i drawn, given X_i, from a conditional outcome distribution that at almost every design point x has a finite second moment, mean m(x) and variance at most σ². Then the degree-p kernel-weighted least-squares intercept at x₀ (taken to be zero when the weighted design matrix is singular), clipped to [−M, M], satisfies E[(m̂(x₀) − m(x₀))²] ≤ C_bias² h^(2β) + C_var/(N h) + 16 M² (p+1)² exp(−c₀ N h), with the same explicit constants as in the version with assumptions on the interval only.
    β H h M σ :
    ℝ
    N :
    ℕ
    m :
    ℝ → ℝ
    hβ :
    0 < β
    hH :
    0 ≤ H
    hm :
    ContDiff ℝ (holderDerivOrder β) m
    hb :
    ∀ x ∈ Icc (D.center - D.radius) (D.center + D.radius),
    ∀ y ∈ Icc (D.center - D.radius) (D.center + D.radius),
    |iteratedDeriv (holderDerivOrder β) m x - iteratedDeriv (holderDerivOrder β) m y|
    ≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))
    hN :
    0 < N
    hh :
    0 < h
    hwindow :
    h ≤ D.radius
    hM :
    |m D.center| ≤ M
    κ :
    hnoise :
    ∀ᵐ x ∂D.law, MemLp (fun y : ℝ => y) 2 (κ x) ∧ (∫ y, y ∂κ x)
    = m x ∧ Var[fun y : ℝ => y; κ x] ≤ σ ^ 2
    (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) h M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ))
    ≤ biasConstant D β H ^ 2 * h ^ (2 * β)
    + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h)
    + 8 * M ^ 2 * failureBound D (holderDerivOrder β) N h (designTolerance D (holderDerivOrder β))
    Proof (Lean source)
    theorem localPoly_clipped_mse_unconditional_of_contDiff (D : InteriorDesign) {β H h M σ : ℝ} {N : ℕ} {m : ℝ → ℝ} (hβ : 0 < β) (hH : 0 ≤ H) (hm : ContDiff ℝ (holderDerivOrder β) m) (hb : ∀ x ∈ Icc (D.center - D.radius) (D.center + D.radius), ∀ y ∈ Icc (D.center - D.radius) (D.center + D.radius), |iteratedDeriv (holderDerivOrder β) m x - iteratedDeriv (holderDerivOrder β) m y| ≤ H * |x - y| ^ (β - (holderDerivOrder β : ℝ))) (hN : 0 < N) (hh : 0 < h) (hwindow : h ≤ D.radius) (hM : |m D.center| ≤ M) (κ : Kernel ℝ ℝ) [IsMarkovKernel κ] (hnoise : ∀ᵐ x ∂D.law, MemLp (fun y : ℝ => y) 2 (κ x) ∧ (∫ y, y ∂κ x) = m x ∧ Var[fun y : ℝ => y; κ x] ≤ σ ^ 2) : (∫ z : Fin N → ℝ × ℝ, (clippedIntercept D (holderDerivOrder β) h M (fun i => (z i).1) (fun i => (z i).2) - m D.center) ^ 2 ∂Measure.pi (fun _ : Fin N => D.law ⊗ₘ κ)) ≤ biasConstant D β H ^ 2 * h ^ (2 * β) + varianceConstant D (holderDerivOrder β) σ / ((N : ℝ) * h) + 8 * M ^ 2 * failureBound D (holderDerivOrder β) N h (designTolerance D (holderDerivOrder β)) := localPoly_clipped_mse_unconditional D (HolderRegression.of_contDiff D.center D.radius D.radius_pos hβ hH hm hb) hN hh hwindow hM κ (hnoise.mono fun _ hx _ => hx)
    Causalean.Stat.Nonparametric.LocalPoly.RandomDesignRate.localPoly_clipped_mse_unconditional_of_contDiff · Causalean/Stat/Nonparametric/LocalPoly/RandomDesignRate/Risk.lean:234