Stat.Nonparametric.Approximation

Approximation-theoretic estimates behind the bias analysis of nonparametric estimators; nothing here is random.

Holder 10 core · 15 supporting · 5 submodules Hölder-class approximation and interpolation tools.
Holder­Taylor­Monomial 2 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_uniform_center★ 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.

theorem holder_taylor_monomial_approx_uniform_center reviewed
Causalean.Stat.Nonparametric

For a dimension and a finite monomial family, positive smoothness and Hölder parameters, a neighbourhood radius, and an exponent enumeration containing every multi-index through the Taylor order, there is one nonnegative constant such that, for every centre, every domain containing the closed coordinatewise box of half-width r around the centre, every function f in the standard Hölder ball of smoothness β and radius L on that domain, and every bandwidth h strictly between zero and r, some coefficient vector makes the monomial polynomial with the enumerated exponents approximate f(x0 + h u) within the constant times L h^β, uniformly over rescaled points u with all coordinates in [-1,1].

Formal statement
d p :
ℕ
β L r :
ℝ
hβ :
0 < β
hL :
0 < L
expo :
Fin p → (Fin d → ℕ)
hcover :
∀ e : Fin d → ℕ
if
(∑ j, e j) ≤ ⌈β⌉₊ - 1
then
∃ k, expo k = e
∃ Cb : ℝ,
0 ≤ Cb
conclusion 1
x0 :
Fin d → ℝ
S :
Set (Fin d → ℝ)
{x : Fin d → ℝ | ∀ i, |x i - x0 i| ≤ r} ⊆ S
f :
(Fin d → ℝ) → ℝ
HolderBallStd f β L S
h :
ℝ
0 < h
h < r
∃ θ : Fin p → ℝ,
∀ u : Fin d → ℝ,
(∀ j, |u j| ≤ 1) → |f (x0 + h • u) - ∑ k, θ k * ∏ j, (u j) ^ (expo k j)| ≤ Cb * L * h ^ β
Proof (Lean source)
theorem holder_taylor_monomial_approx_uniform_center {d p : ℕ} {β L r : ℝ} (hβ : 0 < β) (hL : 0 < L) (expo : Fin p → (Fin d → ℕ)) (hcover : ∀ e : Fin d → ℕ, (∑ j, e j) ≤ ⌈β⌉₊ - 1 → ∃ k, expo k = e) : ∃ Cb : ℝ, 0 ≤ Cb ∧ ∀ (x0 : Fin d → ℝ) (S : Set (Fin d → ℝ)), {x : Fin d → ℝ | ∀ i, |x i - x0 i| ≤ r} ⊆ S → ∀ f : (Fin d → ℝ) → ℝ, HolderBallStd f β L S → ∀ h : ℝ, 0 < h → h < r → ∃ θ : Fin p → ℝ, ∀ u : Fin d → ℝ, (∀ j, |u j| ≤ 1) → |f (x0 + h • u) - ∑ k, θ k * ∏ j, (u j) ^ (expo k j)| ≤ Cb * L * h ^ β := by classical let m := ⌈β⌉₊ - 1 refine ⟨1 / (Nat.factorial m : ℝ), by positivity, ?_⟩ intro x0 S hS f hf h hh hhr let pick : ∀ (j : Fin (m + 1)) (ι : Fin j → Fin d), Fin p := fun j ι => choose (hcover (indexCount ι) (by rw [sum_indexCount]; omega)) have hpick : ∀ (j : Fin (m + 1)) (ι : Fin j → Fin d), expo (pick j ι) = indexCount ι := fun j ι => Classical.choose_spec (hcover (indexCount ι) (by rw [sum_indexCount]; omega)) let θ : Fin p → ℝ := fun k => ∑ j : Fin (m + 1), ∑ ι : Fin j → Fin d, if pick j ι = k then (1 / (Nat.factorial j : ℝ)) * h ^ (j : ℕ) * iteratedFDeriv ℝ (j : ℕ) f x0 (fun l => single (ι l) 1) else 0 refine ⟨θ, ?_⟩ intro u hu have hpoly : (∑ k, θ k * ∏ i, u i ^ expo k i) = ∑ j : Fin (m + 1), (1 / (Nat.factorial (j : ℕ) : ℝ)) * iteratedFDeriv ℝ (j : ℕ) f x0 (fun _ => h • u) := by simp only [θ, Finset.sum_mul] rw [Finset.sum_comm] apply Finset.sum_congr rfl intro j hj rw [Finset.sum_comm, diagonal_expansion, Finset.mul_sum] apply Finset.sum_congr rfl intro ι hι rw [Finset.sum_eq_single (pick j ι)] · simp [hpick] ring · intro k hk hne simp [hne.symm] · simp have hpoly' : (∑ j ∈ range (m + 1), (1 / (Nat.factorial j : ℝ)) * iteratedFDeriv ℝ j f x0 (fun _ => h • u)) = ∑ k, θ k * ∏ i, u i ^ expo k i := by rw [hpoly] exact (Fin.sum_univ_eq_sum_range _ (m + 1)).symm set U : Set (Fin d → ℝ) := {x | ∀ i, |x i - x0 i| < r} have hU : IsOpen U := by rw [show U = ⋂ i, {x : Fin d → ℝ | |x i - x0 i| < r} by ext x; simp [U]] exact isOpen_iInter_of_finite (fun i => isOpen_lt (by fun_prop) continuous_const) have hUS : U ⊆ S := fun x hx => hS (fun i => le_of_lt (hx i)) have hseg : ∀ t ∈ Icc (0 : ℝ) 1, x0 + t • (h • u) ∈ U := by intro t ht i have he : (x0 + t • (h • u)) i - x0 i = t * (h * u i) := by simp [Pi.add_apply, Pi.smul_apply, smul_eq_mul] rw [he, abs_mul, abs_mul, abs_of_nonneg ht.1, abs_of_pos hh] calc t * (h * |u i|) ≤ 1 * (h * |u i|) := mul_le_mul_of_nonneg_right ht.2 (mul_nonneg hh.le (abs_nonneg _)) _ ≤ h := by simpa using mul_le_mul_of_nonneg_left (hu i) hh.le _ < r := hhr have hb := holder_line_taylor hβ hf hU hUS x0 (h • u) hseg rw [show ⌈β⌉₊ - 1 = m from rfl, hpoly'] at hb have hunorm : ‖u‖ ≤ 1 := by rw [pi_norm_le_iff_of_nonneg (by norm_num)] intro i simpa using hu i have hy : ‖h • u‖ ≤ h := by rw [norm_smul, Real.norm_eq_abs, abs_of_pos hh] calc h * ‖u‖ ≤ h * 1 := mul_le_mul_of_nonneg_left hunorm hh.le _ = h := mul_one h calc _ ≤ (L / (Nat.factorial m : ℝ)) * ‖h • u‖ ^ β := hb _ ≤ (L / (Nat.factorial m : ℝ)) * h ^ β := by gcongr _ = (1 / (Nat.factorial m : ℝ)) * L * h ^ β := by ring
Causalean.Stat.Nonparametric.holder_taylor_monomial_approx_uniform_center · Causalean/Stat/Nonparametric/Approximation/HolderTaylorMonomial.lean:72 · uses HolderBallStd
theorem holder_taylor_monomial_approx reviewed
Causalean.Stat.Nonparametric

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
d p :
ℕ
β L r :
ℝ
x0 :
Fin d → ℝ
S :
Set (Fin d → ℝ)
hβ :
0 < β
hL :
0 < L
_hr :
0 < r
hS :
{x : Fin d → ℝ | ∀ i, |x i - x0 i| ≤ r} ⊆ S
expo :
Fin p → (Fin d → ℕ)
hcover :
∀ e : Fin d → ℕ
if
(∑ j, e j) ≤ ⌈β⌉₊ - 1
then
∃ k, expo k = e
∃ Cb : ℝ,
0 ≤ Cb
conclusion 1
f :
(Fin d → ℝ) → ℝ
HolderBallStd f β L S
h :
ℝ
0 < h
h < r
∃ θ : Fin p → ℝ,
∀ u : Fin d → ℝ,
(∀ j, |u j| ≤ 1) → |f (x0 + h • u) - ∑ k, θ k * ∏ j, (u j) ^ (expo k j)| ≤ Cb * L * h ^ β
Proof (Lean source)
theorem holder_taylor_monomial_approx {d p : ℕ} {β L r : ℝ} {x0 : Fin d → ℝ} {S : Set (Fin d → ℝ)} (hβ : 0 < β) (hL : 0 < L) (_hr : 0 < r) (hS : {x : Fin d → ℝ | ∀ i, |x i - x0 i| ≤ r} ⊆ S) (expo : Fin p → (Fin d → ℕ)) (hcover : ∀ e : Fin d → ℕ, (∑ j, e j) ≤ ⌈β⌉₊ - 1 → ∃ k, expo k = e) : ∃ Cb : ℝ, 0 ≤ Cb ∧ ∀ f : (Fin d → ℝ) → ℝ, HolderBallStd f β L S → ∀ h : ℝ, 0 < h → h < r → ∃ θ : Fin p → ℝ, ∀ u : Fin d → ℝ, (∀ j, |u j| ≤ 1) → |f (x0 + h • u) - ∑ k, θ k * ∏ j, (u j) ^ (expo k j)| ≤ Cb * L * h ^ β := by obtain ⟨Cb, hCb, happrox⟩ := holder_taylor_monomial_approx_uniform_center (r := r) hβ hL expo hcover exact ⟨Cb, hCb, happrox x0 S hS⟩
Causalean.Stat.Nonparametric.holder_taylor_monomial_approx · Causalean/Stat/Nonparametric/Approximation/HolderTaylorMonomial.lean:162 · uses HolderBallStd
Kernel 3 core · 2 supporting Convolution approximation bounds for Hölder functions using finite-order kernels with vanishing moments. ★ kernelSmoothingBias_bound

Kernel convolution approximation for Hölder functions

Convolution approximation bounds for Hölder functions using finite-order kernels with vanishing moments.

The definition kernelSmoothingBias records an unnormalised Lebesgue convolution difference. The main theorem bounds this difference by O(h^β) when a kernel of order p = holderDerivOrder β is applied to a β-Hölder function. No design density or normalising denominator is present, so the object is not by itself the population bias of a general random-design regression smoother.

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^β).

structure KernelOrder reviewed
Causalean.Stat.Nonparametric

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 kernel assumptions used by the convolution approximation bound below.

Definition (Lean source)
K :
ℝ → ℝ
p :
ℕ
supp :
∀ u : ℝ
if
1 < |u|
then
K u = 0

K is supported in [-1,1].

integrable :

K is (Lebesgue) integrable.

mass :
∫ u, K u = 1

K has unit mass.

moments :
∀ j : ℕ
if
1 ≤ j
and
j ≤ p
then
∫ u, u ^ j * K u = 0

The moments 1,…,p of K vanish.

Causalean.Stat.Nonparametric.KernelOrder · Causalean/Stat/Nonparametric/Approximation/Kernel.lean:42
def kernelSmoothingBias reviewed
Causalean.Stat.Nonparametric

Given a real-valued function, a kernel function, a target point, and a bandwidth, the unnormalised Lebesgue convolution difference averages f(u) - f(t) using the rescaled kernel h⁻¹ K((u-t)/h). It contains neither a design density nor a normalising denominator.

Definition (Lean source)
f K :
ℝ → ℝ
t h :
ℝ
kernelSmoothingBias f K t h :
ℝ
∫ u, h⁻¹ * K ((u - t) / h) * (f u - f t)
Causalean.Stat.Nonparametric.kernelSmoothingBias · Causalean/Stat/Nonparametric/Approximation/Kernel.lean:56
theorem kernelSmoothingBias_bound reviewed
Causalean.Stat.Nonparametric

The kernel convolution approximation error is O(h^β). Let p be 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 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 absolute unnormalised convolution difference at t is bounded by (M/p! · ∫|K|)·h^β. For positive integer β = m, p = m - 1 and the Hölder exponent is 1.

Formal statement
f K :
ℝ → ℝ
β M t h :
ℝ
hβ :
0 < β
hM :
0 ≤ M
hh :
0 < h
hf :
hb :
∀ x ∈ Icc (t - h) (t + h),
∀ y ∈ Icc (t - h) (t + h),
≤ M * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))
≤ (M / ((holderDerivOrder β)).factorial * ∫ u, |K u|) * h ^ β
Proof (Lean source)
theorem kernelSmoothingBias_bound {f K : ℝ → ℝ} {β M t h : ℝ} (hβ : 0 < β) (hM : 0 ≤ M) (hh : 0 < h) (hK : KernelOrder K (holderDerivOrder β)) (hf : ContDiff ℝ ((holderDerivOrder β)) f) (hb : ∀ x ∈ Icc (t - h) (t + h), ∀ y ∈ Icc (t - h) (t + h), |iteratedDeriv (holderDerivOrder β) f x - iteratedDeriv (holderDerivOrder β) f y| ≤ M * |x - y| ^ (β - ((holderDerivOrder β) : ℝ))) : |kernelSmoothingBias f K t h| ≤ (M / ((holderDerivOrder β)).factorial * ∫ u, |K u|) * h ^ β := by have hKi : Integrable K := hK.integrable have hsupp : ∀ u : ℝ, 1 < |u| → K u = 0 := hK.supp set C : ℝ := M / (((holderDerivOrder β)).factorial : ℝ) * h ^ β with hCdef have hcoef : (0 : ℝ) ≤ M / (((holderDerivOrder β)).factorial : ℝ) := div_nonneg hM (by positivity) have hhb : (0 : ℝ) ≤ h ^ β := Real.rpow_nonneg hh.le β have hCnn : 0 ≤ C := by rw [hCdef]; exact mul_nonneg hcoef hhb -- Monomials `v^k K v` are integrable (bounded by `|K|` on `[-1,1]`, zero off it). have hmono_int : ∀ k : ℕ, Integrable (fun v => v ^ k * K v) := by intro k refine integrable_of_abs_le_const_mul_kernel hKi ((continuous_pow k).aestronglyMeasurable.mul hKi.aestronglyMeasurable) (C := 1) ?_ intro v by_cases hv : |v| ≤ 1 · rw [abs_mul, one_mul] refine mul_le_of_le_one_left (abs_nonneg _) ?_ rw [abs_pow]; exact pow_le_one₀ (abs_nonneg _) hv · exact le_of_eq (by simp [hsupp v (lt_of_not_ge hv)]) -- Pointwise: `K v · Taylor` is a finite sum of scaled monomials in `v K v`. have htay : ∀ v : ℝ, K v * taylorPoly (holderDerivOrder β) f t (t + h * v) = ∑ k ∈ range ((holderDerivOrder β) + 1), (iteratedDeriv k f t / (k.factorial : ℝ) * h ^ k) * (v ^ k * K v) := by intro v unfold taylorPoly rw [Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k _ have hsub : t + h * v - t = h * v := by ring rw [hsub, mul_pow]; ring have hKtaylor_int : Integrable (fun v => K v * taylorPoly (holderDerivOrder β) f t (t + h * v)) := by have e : (fun v => K v * taylorPoly (holderDerivOrder β) f t (t + h * v)) = (fun v => ∑ k ∈ range ((holderDerivOrder β) + 1), (iteratedDeriv k f t / (k.factorial : ℝ) * h ^ k) * (v ^ k * K v)) := funext htay rw [e] exact integrable_finset_sum _ (fun k _ => (hmono_int k).const_mul _) have hKtay_int : Integrable (fun v => K v * (taylorPoly (holderDerivOrder β) f t (t + h * v) - f t)) := by have e : (fun v => K v * (taylorPoly (holderDerivOrder β) f t (t + h * v) - f t)) = (fun v => K v * taylorPoly (holderDerivOrder β) f t (t + h * v) - K v * f t) := by funext v; rw [mul_sub] rw [e]; exact hKtaylor_int.sub (hKi.mul_const (f t)) -- Moment annihilation: `∫ K · Taylor = f t` (only the constant term survives). have hKtaylor_eq : (∫ v, K v * taylorPoly (holderDerivOrder β) f t (t + h * v)) = f t := by have e : (fun v => K v * taylorPoly (holderDerivOrder β) f t (t + h * v)) = (fun v => ∑ k ∈ range ((holderDerivOrder β) + 1), (iteratedDeriv k f t / (k.factorial : ℝ) * h ^ k) * (v ^ k * K v)) := funext htay rw [e, integral_finset_sum _ (fun k _ => (hmono_int k).const_mul _)] simp_rw [integral_const_mul] rw [Finset.sum_eq_single 0] · have h0 : (∫ v, v ^ (0 : ℕ) * K v) = 1 := by simp only [pow_zero, one_mul]; exact hK.mass rw [h0]; simp [iteratedDeriv_zero] · intro k hk hk0 have hkp : k ≤ (holderDerivOrder β) := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) have hk1 : 1 ≤ k := Nat.one_le_iff_ne_zero.mpr hk0 rw [hK.moments k hk1 hkp, mul_zero] · intro h0 exact absurd (Finset.mem_range.mpr (Nat.succ_pos _)) h0 have hmom : (∫ v, K v * (taylorPoly (holderDerivOrder β) f t (t + h * v) - f t)) = 0 := by have e : (fun v => K v * (taylorPoly (holderDerivOrder β) f t (t + h * v) - f t)) = (fun v => K v * taylorPoly (holderDerivOrder β) f t (t + h * v) - K v * f t) := by funext v; rw [mul_sub] rw [e, integral_sub hKtaylor_int (hKi.mul_const (f t)), hKtaylor_eq, integral_mul_const, hK.mass, one_mul, sub_self] -- Remainder: `|K v · (f(t+hv) − Taylor)| ≤ C |K v|` with `C = (M/p!) h^β`. have hRbd : ∀ v : ℝ, |K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))| ≤ C * |K v| := by intro v by_cases hv : |v| ≤ 1 · have hvb := abs_le.mp hv have hav : t + h * v ∈ Icc (t - h) (t + h) := by refine ⟨?_, ?_⟩ · nlinarith [hvb.1, hh.le] · nlinarith [hvb.2, hh.le] have htm : t ∈ Icc (t - h) (t + h) := by constructor <;> linarith [hh.le] have hrem := holder_taylor_remainder (lo := t - h) (hi := t + h) (t := t) (a := t + h * v) hβ hM htm hav hf hb have hRvC : |f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v)| ≤ C := by refine le_trans hrem ?_ have h1 : (t + h * v) - t = h * v := by ring rw [h1, abs_mul, abs_of_pos hh, Real.mul_rpow hh.le (abs_nonneg v), hCdef, ← mul_assoc] have h3 : |v| ^ β ≤ 1 := Real.rpow_le_one (abs_nonneg _) hv hβ.le nth_rewrite 2 [← mul_one (M / (((holderDerivOrder β)).factorial : ℝ) * h ^ β)] exact mul_le_mul_of_nonneg_left h3 (mul_nonneg hcoef hhb) calc |K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))| = |K v| * |f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v)| := by rw [abs_mul] _ ≤ |K v| * C := mul_le_mul_of_nonneg_left hRvC (abs_nonneg _) _ = C * |K v| := mul_comm _ _ · exact le_of_eq (by simp [hsupp v (lt_of_not_ge hv)]) have hKR_int : Integrable (fun v => K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))) := by refine integrable_of_abs_le_const_mul_kernel hKi ?_ hRbd refine hKi.aestronglyMeasurable.mul (Continuous.sub ?_ ?_).aestronglyMeasurable · exact hf.continuous.comp (by fun_prop) · have hcont : Continuous (fun v : ℝ => taylorPoly (holderDerivOrder β) f t (t + h * v)) := by unfold taylorPoly exact continuous_finset_sum _ (fun k _ => by fun_prop) exact hcont -- Assemble: change of variables, split off the annihilated polynomial, bound the rest. rw [kernelSmoothingBias_changeOfVar f K t h hh] have hsplit : (∫ v, K v * (f (t + h * v) - f t)) = (∫ v, K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))) + (∫ v, K v * (taylorPoly (holderDerivOrder β) f t (t + h * v) - f t)) := by rw [← integral_add hKR_int hKtay_int] refine integral_congr_ae (Filter.Eventually.of_forall (fun v => ?_)) ring rw [hsplit, hmom, add_zero] calc |∫ v, K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))| ≤ ∫ v, |K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))| := by have := MeasureTheory.norm_integral_le_integral_norm (μ := volume) (fun v : ℝ => K v * (f (t + h * v) - taylorPoly (holderDerivOrder β) f t (t + h * v))) simpa only [Real.norm_eq_abs] using this _ ≤ ∫ v, C * |K v| := integral_mono hKR_int.abs (hKi.abs.const_mul C) hRbd _ = C * ∫ v, |K v| := by rw [integral_const_mul] _ = (M / ((holderDerivOrder β)).factorial * ∫ u, |K u|) * h ^ β := by rw [hCdef]; ring
2 supporting declarations (lemmas, instances)
  • integrable_of_abs_le_const_mul_kernel theorem — 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.
    K F :
    ℝ → ℝ
    C :
    ℝ
    hKi :
    hbd :
    ∀ v, |F v| ≤ C * |K v|
    Proof (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
    Causalean.Stat.Nonparametric.integrable_of_abs_le_const_mul_kernel · Causalean/Stat/Nonparametric/Approximation/Kernel.lean:63
  • kernelSmoothingBias_changeOfVar theorem — 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.
    f K :
    ℝ → ℝ
    t h :
    ℝ
    hh :
    0 < h
    kernelSmoothingBias 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)]
    Causalean.Stat.Nonparametric.kernelSmoothingBias_changeOfVar · Causalean/Stat/Nonparametric/Approximation/Kernel.lean:74