Stat.Nonparametric.Approximation
Deterministic approximation-theory primitives for nonparametric bias analysis, including Hölder–Taylor remainder bounds and kernel smoothing bias estimates.
HolderTaylor 3 core · 6 supporting Hölder–Taylor remainder bounds for approximating a smooth regression function near a target point by its degree-⌊β⌋ Taylor polynomial. ★ holder_taylor_remainder
Hölder–Taylor remainder bound
Hölder–Taylor remainder bounds for approximating a smooth regression function near a target point
by its degree-⌊β⌋ Taylor polynomial.
This file proves the standard nonparametric Hölder–Taylor remainder estimate
(Tsybakov, Introduction to Nonparametric Estimation, 2009, Chapter 1): if a
scalar function f is ⌊β⌋-times continuously differentiable and its top
derivative is (β − ⌊β⌋)-Hölder with constant M, then f is approximated near
t by its degree-⌊β⌋ Taylor polynomial with error O(|a − t|^β):
|f a − T_p(a; t)| ≤ (M / p!) · |a − t|^β.
For noninteger β, p = ⌊β⌋. For positive integer β, p = β − 1 and the
Hölder exponent is 1, matching the usual Tsybakov-style convention.
This is the bias-controlling lemma behind interior local-polynomial / kernel
regression: a kernel of order at least p annihilates the Taylor polynomial, leaving
only this remainder, which is the source of the O(h^β) smoothing bias.
The standard Hölder derivative order for smoothness β: the largest natural number strictly below β. For positive noninteger β this is ⌊β⌋; for a positive integer β = m this is m - 1.
Definition (Lean source)
Degree-p Taylor polynomial of f at base point t, evaluated at a: ∑_{k ≤ p} f⁽ᵏ⁾(t)/k! · (a − t)^k.
Definition (Lean source)
Hölder–Taylor remainder bound under the standard Hölder convention. Let p denote the largest natural number strictly below the smoothness index β. If β is positive, the Hölder constant M is nonnegative, the expansion point t lies in a window [lo,hi], the evaluation point a lies in the same window, f is p times continuously differentiable, and its p-th derivative is (β − p)-Hölder with constant M on the window, then the error of the degree-p Taylor approximation of f at t, evaluated at a, is bounded by (M / p!) · |a − t|^β. For positive integer β = m, this uses derivative order m - 1 and Hölder exponent 1.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
holderDerivOrder_ltlemmahypothesesβ :ℝhβ :0 < βconclusion(holderDerivOrder β : ℝ) < βProof (Lean source)
lemma holderDerivOrder_lt {β : ℝ} (hβ : 0 < β) : (holderDerivOrder β : ℝ) < β := by have hceil_one : 1 ≤ ⌈β⌉₊ := Nat.one_le_ceil_iff.mpr hβ have hcast : ((⌈β⌉₊ - 1 : ℕ) : ℝ) = (⌈β⌉₊ : ℝ) - 1 := by rw [Nat.cast_sub hceil_one, cast_one] rw [holderDerivOrder, hcast] linarith [Nat.ceil_lt_add_one hβ.le] -
taylorPoly_eval_basetheorem — The Taylor polynomial of f at base point t, evaluated at t itself, is f t (every positive-degree term carries a (t − t)^k = 0 factor).Proof (Lean source)
theorem taylorPoly_eval_base (p : ℕ) (f : ℝ → ℝ) (t : ℝ) : taylorPoly p f t t = f t := by have h : taylorPoly p f t t = iteratedDeriv 0 f t / (factorial 0 : ℝ) * (t - t) ^ 0 := by unfold taylorPoly refine Finset.sum_eq_single 0 (fun k _ hk => ?_) (fun h => ?_) · rw [sub_self, zero_pow hk, mul_zero] · exact absurd (Finset.mem_range.mpr p.succ_pos) h simpa [iteratedDeriv_zero] using h -
taylorWithinEval_eq_taylorPolylemma — On an interval with distinct endpoints, the Taylor polynomial computed from derivatives restricted to the interval equals the usual Taylor polynomial computed from ordinary derivatives.hypothesesconclusionProof (Lean source)
lemma taylorWithinEval_eq_taylorPoly {f : ℝ → ℝ} {p n : ℕ} {x₀ x : ℝ} (hf : ContDiff ℝ p f) (hn : n ≤ p) (hx : x₀ < x) : taylorWithinEval f n (Icc x₀ x) x₀ x = taylorPoly n f x₀ x := by rw [taylor_within_apply] unfold taylorPoly refine Finset.sum_congr rfl ?_ intro k hk have hk_le_n : k ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) have hk_le_p : k ≤ p := hk_le_n.trans hn have hwithin : iteratedDerivWithin k f (Icc x₀ x) x₀ = iteratedDeriv k f x₀ := by exact iteratedDerivWithin_eq_iteratedDeriv (uniqueDiffOn_Icc hx) ((hf.of_le (WithTop.coe_le_coe.mpr (ENat.coe_le_coe.mpr hk_le_p))).contDiffAt) (Set.left_mem_Icc.mpr hx.le) rw [hwithin] simp [smul_eq_mul, div_eq_mul_inv, mul_comm, mul_left_comm] -
taylorPoly_succlemma — Split the last term off the Taylor polynomial.hypothesesn :ℕf :ℝ → ℝt a :ℝconclusiontaylorPoly (n + 1) f t a= taylorPoly n f t a+ iteratedDeriv (n + 1) f t / ((n + 1).factorial : ℝ) * (a - t) ^ (n + 1)Proof (Lean source)
lemma taylorPoly_succ (n : ℕ) (f : ℝ → ℝ) (t a : ℝ) : taylorPoly (n + 1) f t a = taylorPoly n f t a + iteratedDeriv (n + 1) f t / ((n + 1).factorial : ℝ) * (a - t) ^ (n + 1) := by unfold taylorPoly rw [Finset.sum_range_succ] -
taylorPoly_reflectlemma — Reflecting across the base point preserves the Taylor polynomial value at the reflected evaluation point.hypothesesp :ℕf :ℝ → ℝt a :ℝconclusiontaylorPoly p (fun x => f (2 * t - x)) t (2 * t - a) = taylorPoly p f t aProof (Lean source)
lemma taylorPoly_reflect (p : ℕ) (f : ℝ → ℝ) (t a : ℝ) : taylorPoly p (fun x => f (2 * t - x)) t (2 * t - a) = taylorPoly p f t a := by unfold taylorPoly refine Finset.sum_congr rfl ?_ intro k hk have hder := congrFun (iteratedDeriv_comp_const_sub (n := k) (f := f) (s := 2 * t)) t rw [hder] simp only [smul_eq_mul] have hbase : 2 * t - t = t := by ring have harg : 2 * t - a - t = t - a := by ring have hpow : (-1 : ℝ) ^ k * (t - a) ^ k = (a - t) ^ k := by rw [← mul_pow] congr 1 ring rw [hbase, harg, div_eq_mul_inv] calc ((-1 : ℝ) ^ k * iteratedDeriv k f t) * (↑k.factorial)⁻¹ * (t - a) ^ k = iteratedDeriv k f t * (↑k.factorial)⁻¹ * ((-1 : ℝ) ^ k * (t - a) ^ k) := by ring _ = iteratedDeriv k f t * (↑k.factorial)⁻¹ * (a - t) ^ k := by rw [hpow] -
holder_taylor_remainder_of_ltlemma — Hölder-Taylor remainder when the evaluation point lies to the right of the base.hypothesesf :ℝ → ℝM β lo hi t a :ℝp :ℕhM :0 ≤ Mht :t ∈ Icc lo hiha :a ∈ Icc lo hihf :ContDiff ℝ p fhb :∀ x ∈ Icc lo hi,∀ y ∈ Icc lo hi,|iteratedDeriv p f x - iteratedDeriv p f y| ≤ M * |x - y| ^ (β - (p : ℝ))hp_pos :0 < php_le_beta :(p : ℝ) ≤ βhlt :t < aconclusion|f a - taylorPoly p f t a| ≤ M / (p.factorial : ℝ) * |a - t| ^ βProof (Lean source)
lemma holder_taylor_remainder_of_lt {f : ℝ → ℝ} {M β lo hi t a : ℝ} {p : ℕ} (hM : 0 ≤ M) (ht : t ∈ Icc lo hi) (ha : a ∈ Icc lo hi) (hf : ContDiff ℝ p f) (hb : ∀ x ∈ Icc lo hi, ∀ y ∈ Icc lo hi, |iteratedDeriv p f x - iteratedDeriv p f y| ≤ M * |x - y| ^ (β - (p : ℝ))) (hp_pos : 0 < p) (hp_le_beta : (p : ℝ) ≤ β) (hlt : t < a) : |f a - taylorPoly p f t a| ≤ M / (p.factorial : ℝ) * |a - t| ^ β := by have hexp_nonneg : 0 ≤ β - (p : ℝ) := sub_nonneg.mpr hp_le_beta have habs_pos : 0 < |a - t| := abs_pos.mpr (sub_ne_zero.mpr hlt.ne') set n : ℕ := p - 1 with hn have hn_succ : n + 1 = p := by simpa [hn] using Nat.succ_pred_eq_of_pos hp_pos have hcont : ContDiffOn ℝ (n + 1) f (uIcc t a) := by change ContDiffOn ℝ (((n + 1 : ℕ) : WithTop ℕ∞)) f (uIcc t a) rw [hn_succ] exact hf.contDiffOn rcases taylor_mean_remainder_lagrange_iteratedDeriv (f := f) (x := a) (x₀ := t) (n := n) hlt.ne hcont with ⟨ξ, hξ, hrem⟩ rw [Set.uIcc_of_le hlt.le] at hrem rw [Set.uIoo_of_le hlt.le] at hξ have hwithin_eq : taylorWithinEval f n (Icc t a) t a = taylorPoly n f t a := taylorWithinEval_eq_taylorPoly hf (by rw [← hn_succ] exact Nat.le_succ n) hlt have hrem_poly : f a - taylorPoly n f t a = iteratedDeriv p f ξ * (a - t) ^ p / (p.factorial : ℝ) := by rw [← hwithin_eq] simpa [hn_succ] using hrem have hpoly_succ : taylorPoly p f t a = taylorPoly n f t a + iteratedDeriv p f t / (p.factorial : ℝ) * (a - t) ^ p := by rw [← hn_succ] exact taylorPoly_succ n f t a have hdiff : f a - taylorPoly p f t a = (iteratedDeriv p f ξ - iteratedDeriv p f t) / (p.factorial : ℝ) * (a - t) ^ p := by rw [hpoly_succ] rw [sub_add_eq_sub_sub, hrem_poly] have hfac : (p.factorial : ℝ) ≠ 0 := by positivity field_simp [hfac] have hξ_window : ξ ∈ Icc lo hi := ⟨ht.1.trans hξ.1.le, hξ.2.le.trans ha.2⟩ have hdist : |ξ - t| ≤ |a - t| := by rw [abs_of_nonneg (sub_nonneg.mpr hξ.1.le), abs_of_nonneg (sub_nonneg.mpr hlt.le)] exact sub_le_sub_right hξ.2.le t have hpow_le : |ξ - t| ^ (β - (p : ℝ)) ≤ |a - t| ^ (β - (p : ℝ)) := Real.rpow_le_rpow (abs_nonneg _) hdist hexp_nonneg have htop : |iteratedDeriv p f ξ - iteratedDeriv p f t| ≤ M * |a - t| ^ (β - (p : ℝ)) := (hb ξ hξ_window t ht).trans (mul_le_mul_of_nonneg_left hpow_le hM) rw [hdiff] calc |(iteratedDeriv p f ξ - iteratedDeriv p f t) / (p.factorial : ℝ) * (a - t) ^ p| = |iteratedDeriv p f ξ - iteratedDeriv p f t| / (p.factorial : ℝ) * |a - t| ^ p := by rw [abs_mul, abs_div, abs_pow, abs_of_nonneg (by positivity : 0 ≤ (p.factorial : ℝ))] _ ≤ (M * |a - t| ^ (β - (p : ℝ))) / (p.factorial : ℝ) * |a - t| ^ p := by gcongr _ = M / (p.factorial : ℝ) * |a - t| ^ β := by have hcombine : |a - t| ^ (β - (p : ℝ)) * |a - t| ^ p = |a - t| ^ β := by rw [← Real.rpow_natCast] rw [← Real.rpow_add habs_pos] ring_nf rw [← hcombine] ring
HolderTaylorMonomial 1 core · 0 supporting This module converts the diagonal Fréchet Taylor polynomial supplied by a multivariate Hölder condition into an explicitly indexed monomial polynomial. ★ holder_taylor_monomial_approx
Monomial approximation of multivariate Hölder functions
This module converts the diagonal Fréchet Taylor polynomial supplied by a multivariate Hölder condition into an explicitly indexed monomial polynomial. The resulting remainder constant is uniform over the Hölder ball.
Local monomial approximation in a Hölder ball. Fix a centre x0 in d-dimensional Euclidean space and a finite family expo of exponent multi-indices. If the smoothness index β is positive, the Hölder constant L is positive, the neighbourhood radius r is positive, the closed sup-norm cube of radius r around x0 is contained in the domain S, and expo lists every exponent multi-index of total degree up to the Taylor order, then there is a constant C_b ≥ 0, depending only on β and d, such that every function f in the standard Hölder ball of exponent β, constant L, and domain S is approximated near x0, at any bandwidth h ∈ (0, r), by a monomial combination in the expo basis with error at most C_b · L · h^β, uniformly over the unit cube of rescaled directions.
Formal statement
Proof (Lean source)
Kernel 3 core · 2 supporting Kernel smoothing bias bounds for Hölder regression functions using finite-order kernels with vanishing moments. ★ kernelSmoothingBias_bound
Kernel smoothing bias for Hölder regression
Kernel smoothing bias bounds for Hölder regression functions using finite-order kernels with vanishing moments.
This file defines a finite-order kernel (KernelOrder) and the population
kernel-smoothing bias kernelSmoothingBias, and proves the classical interior
bias estimate (Fan–Gijbels 1996 §3; Tsybakov 2009 Ch. 1): a kernel of order
p = holderDerivOrder β applied to a β-Hölder regression function has smoothing bias O(h^β).
The mechanism: substitute u = t + h v; the kernel's vanishing moments
∫ vʲ K = 0 (1 ≤ j ≤ p) annihilate the degree-p Taylor polynomial of f
at t, leaving only the Hölder–Taylor remainder `|f(t+hv) − T_p(t+hv)| ≤
(M/p!)·(h|v|)^β (holder_taylor_remainder), which integrates against |K|`
(supported in [-1,1]) to O(h^β).
A kernel of order at least p: supported in [-1,1], integrable, with unit mass ∫ K = 1 and vanishing moments ∫ uʲ K(u) du = 0 for 1 ≤ j ≤ p. These are the inputs of the classical interior local-polynomial / kernel bias theorem.
Definition (Lean source)
Population kernel smoothing bias of estimating the value f t of a regression function f at point t with bandwidth h and kernel K: ∫ h⁻¹ K((u−t)/h) (f u − f t) du.
Definition (Lean source)
Interior kernel smoothing bias is O(h^β). Let p denote the largest natural number strictly below the smoothness index β. If β is positive, the Hölder constant M is nonnegative, the bandwidth h is positive, the kernel K has order p, the regression function f is p times continuously differentiable, and its p-th derivative is (β−p)-Hölder with constant M on the window [t−h, t+h], then the kernel smoothing bias of f at t with bandwidth h is bounded by (M/p! · ∫|K|)·h^β. For positive integer β = m, p = m - 1 and the Hölder exponent is 1. (Fan–Gijbels 1996 §3.1–3.3; Tsybakov 2009 Ch. 1.)
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
integrable_of_abs_le_const_mul_kerneltheorem — If a function F is dominated in absolute value by a constant multiple C·|K| of an integrable kernel K, then F is itself integrable. This is the integrability workhorse for kernel-smoothing arguments: every factor multiplying K (a monomial, a Taylor remainder) is bounded by |K| on the kernel's support and vanishes off it.hypothesesconclusionProof (Lean source)
theorem integrable_of_abs_le_const_mul_kernel {K F : ℝ → ℝ} {C : ℝ} (hKi : Integrable K) (hF : AEStronglyMeasurable F) (hbd : ∀ v, |F v| ≤ C * |K v|) : Integrable F := by refine Integrable.mono' (hKi.abs.const_mul C) hF ?_ filter_upwards with v simpa only [Real.norm_eq_abs] using hbd v -
kernelSmoothingBias_changeOfVartheorem — Change of variables for the kernel smoothing bias. Substituting u = t + h v (h > 0) turns the bias integral into ∫ K(v) (f(t+hv) − f t) dv: the h⁻¹ prefactor cancels the Jacobian h, and (u−t)/h = v.hypothesesf K :ℝ → ℝt h :ℝhh :0 < hconclusionkernelSmoothingBias f K t h = ∫ v, K v * (f (t + h * v) - f t)Proof (Lean source)
theorem kernelSmoothingBias_changeOfVar (f K : ℝ → ℝ) (t h : ℝ) (hh : 0 < h) : kernelSmoothingBias f K t h = ∫ v, K v * (f (t + h * v) - f t) := by unfold kernelSmoothingBias set ψ : ℝ → ℝ := fun u => K ((u - t) / h) * (f u - f t) with hψ have hL : (∫ u, h⁻¹ * K ((u - t) / h) * (f u - f t)) = h⁻¹ * ∫ u, ψ u := by rw [← integral_const_mul] refine integral_congr_ae (Filter.Eventually.of_forall (fun u => ?_)) simp only [hψ]; ring have hR : (∫ v, K v * (f (t + h * v) - f t)) = ∫ v, ψ (t + h * v) := by refine integral_congr_ae (Filter.Eventually.of_forall (fun v => ?_)) have harg : (t + h * v - t) / h = v := by rw [add_sub_cancel_left]; field_simp simp only [hψ, harg] rw [hL, hR]; symm calc (∫ v, ψ (t + h * v)) = ∫ v, (fun w => ψ (t + w)) (h * v) := rfl _ = |h⁻¹| • ∫ w, (fun w => ψ (t + w)) w := by simpa using Measure.integral_comp_mul_left (fun w : ℝ => ψ (t + w)) h _ = |h⁻¹| • ∫ w, ψ (t + w) := rfl _ = |h⁻¹| • ∫ u, ψ u := by rw [integral_add_left_eq_self ψ t] _ = h⁻¹ * ∫ u, ψ u := by rw [smul_eq_mul, abs_of_pos (inv_pos.mpr hh)]