ML.Kernel
Roll-up: the abstract RKHS interface, the kernel-ridge representer theorem, effective dimension, and the RKHS-ball Rademacher-complexity bound.
EffectiveDimension 3 core · 6 supporting The effective dimension at regularization level λ > 0 of a positive operator with (summable, nonnegative) eigenvalue family μ : ι → ℝ is N(λ) = ∑ᵢ μᵢ / (μᵢ + λ) = tr(T (T + λ)⁻¹). ★ effectiveDimension★ effectiveDimension_le_trace_div★ effectiveDimension_antitone
Effective dimension of a trace-class operator
The effective dimension at regularization level λ > 0 of a positive operator with
(summable, nonnegative) eigenvalue family μ : ι → ℝ is
N(λ) = ∑ᵢ μᵢ / (μᵢ + λ) = tr(T (T + λ)⁻¹).
It is the quantity that governs the variance term of kernel ridge regression: the
Caponnetto–De Vito optimal-rate analysis expresses the minimax L²(ρ) rate of kernel ridge
through N(λ) and the eigenvalue-decay/source-condition exponents. This file provides the
definition and its basic structural properties for the trace-class (summable-eigenvalue)
regime — the infinite-dimensional RKHS setting.
* effectiveDimension_nonneg — 0 ≤ N(λ);
* summable_effectiveDimension_term — the summand family is summable (so N(λ) is a genuine
real number, not the fallback value of a non-summable tsum);
* effectiveDimension_le_trace_div — N(λ) ≤ (tr T)/λ (the crude dimension-free bound);
* effectiveDimension_le_card — over finitely many eigenvalues, N(λ) ≤ #ι;
* effectiveDimension_antitone — N is antitone in λ (more regularization ⇒ smaller
effective dimension).
The downstream rate theorem (N(λ)/eigenvalue-decay ⇒ the n^{-2rb/(2rb+1)} kernel-ridge
L² rate) additionally requires Hilbert-space operator-concentration machinery (an operator
Bernstein inequality for (T+λ)^{-1/2}(T − T̂ₙ)(T+λ)^{-1/2}) that is a separate substrate; this
file is the definitional foundation it would build on.
Effective dimension measures the spectral degrees of freedom retained by regularization through the regularized eigenvalue-ratio sum. It uses a real eigenvalue family over an arbitrary index set at a real regularization level. Without positivity, summability, and nonzero denominators, zero-denominator terms and nonsummable totals follow the ambient real-series convention and evaluate to zero.
Definition (Lean source)
Trace bound. Effective dimension is at most total spectral mass divided by the regularization level for a nonnegative, summable eigenvalue family over the index set at a positive regularization level. This gives only inverse-linear dependence on regularization; sharper decay-dependent rates require a separate argument.
Formal statement
Proof (Lean source)
If all eigenvalues are nonnegative, the first regularization level is positive, the first level is no larger than the second, and the eigenvalues are summable, then effective dimension is antitone in the regularization level.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
effectiveDimension_term_nonneglemma — Each summand μᵢ/(μᵢ+λ) is nonnegative (for nonnegative eigenvalues and λ > 0).hypothesesι :sharedType u_1ι → ℝlam :ℝhμ :∀ i, 0 ≤ μ ihlam :0 < lami :ιconclusion0 ≤ μ i / (μ i + lam)Proof (Lean source)
lemma effectiveDimension_term_nonneg {μ : ι → ℝ} {lam : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hlam : 0 < lam) (i : ι) : 0 ≤ μ i / (μ i + lam) := div_nonneg (hμ i) (add_nonneg (hμ i) hlam.le) -
effectiveDimension_term_le_divlemma — Each summand is dominated by μᵢ/λ.hypothesesι :sharedType u_1ι → ℝlam :ℝhμ :∀ i, 0 ≤ μ ihlam :0 < lami :ιconclusionμ i / (μ i + lam) ≤ μ i / lamProof (Lean source)
lemma effectiveDimension_term_le_div {μ : ι → ℝ} {lam : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hlam : 0 < lam) (i : ι) : μ i / (μ i + lam) ≤ μ i / lam := by gcongr <;> linarith [hμ i] -
effectiveDimension_term_le_onelemma — Each summand is at most 1.hypothesesι :sharedType u_1ι → ℝlam :ℝhμ :∀ i, 0 ≤ μ ihlam :0 < lami :ιconclusionμ i / (μ i + lam) ≤ 1Proof (Lean source)
lemma effectiveDimension_term_le_one {μ : ι → ℝ} {lam : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hlam : 0 < lam) (i : ι) : μ i / (μ i + lam) ≤ 1 := by rw [div_le_one (add_pos_of_nonneg_of_pos (hμ i) hlam)] linarith [hμ i] -
summable_effectiveDimension_termlemma — The effective-dimension summands form a summable family when the eigenvalues are nonnegative, the regularization level is positive, and the eigenvalue family is summable. Thus the indexed spectral sum is genuine rather than a nonsummable-series default.hypothesesconclusionSummable (fun i => μ i / (μ i + lam))Proof (Lean source)
lemma summable_effectiveDimension_term {μ : ι → ℝ} {lam : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hlam : 0 < lam) (hsum : Summable μ) : Summable (fun i => μ i / (μ i + lam)) := Summable.of_nonneg_of_le (fun i => effectiveDimension_term_nonneg hμ hlam i) (fun i => effectiveDimension_term_le_div hμ hlam i) (hsum.div_const lam) -
effectiveDimension_nonneglemma — The effective dimension is nonnegative.hypothesesι :sharedType u_1ι → ℝlam :ℝhμ :∀ i, 0 ≤ μ ihlam :0 < lamconclusion0 ≤ effectiveDimension μ lamProof (Lean source)
lemma effectiveDimension_nonneg {μ : ι → ℝ} {lam : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hlam : 0 < lam) : 0 ≤ effectiveDimension μ lam := tsum_nonneg (fun i => effectiveDimension_term_nonneg hμ hlam i) -
effectiveDimension_le_cardlemma — Over finitely many eigenvalues, N(λ) never exceeds the ambient dimension #ι.hypothesesconclusioneffectiveDimension μ lam ≤ (Fintype.card ι : ℝ)Proof (Lean source)
lemma effectiveDimension_le_card [Fintype ι] {μ : ι → ℝ} {lam : ℝ} (hμ : ∀ i, 0 ≤ μ i) (hlam : 0 < lam) : effectiveDimension μ lam ≤ (Fintype.card ι : ℝ) := by unfold effectiveDimension rw [tsum_fintype] calc ∑ i, μ i / (μ i + lam) ≤ ∑ _i : ι, (1 : ℝ) := Finset.sum_le_sum fun i _ => effectiveDimension_term_le_one hμ hlam i _ = (Fintype.card ι : ℝ) := by simp [Finset.card_univ]
Ridge 2 core · 0 supporting The file defines krrRisk on a real inner-product space with a supplied evaluation map and proves representer_theorem: under λ > 0, any global minimizer is a finite linear combination of the sample representers k(·, xᵢ) w ★ representer_theorem
Regularized least squares — the representer theorem
The file defines krrRisk on a real inner-product space with a supplied
evaluation map and proves representer_theorem: under λ > 0, any global
minimizer is a finite linear combination of the sample representers k(·, xᵢ)
when evaluation satisfies the reproducing identity.
Kernel-ridge empirical risk trades average squared error against a weighted squared function norm. It scores a candidate in a real inner-product space through its evaluation rule on covariates and responses from a sample of the specified size, with covariate space and regularization level.
A kernel-ridge minimizer lies in the sampled representer span, reducing an infinite-dimensional optimization problem to sample coefficients. The reduction applies to the sampled covariates and responses when evaluation has supplied Hilbert-space representers, the penalty is strictly positive, and the candidate globally minimizes.
Formal statement
Proof (Lean source)
RKHSRademacher 1 core · 1 supporting This file proves the canonical RKHS-ball empirical Rademacher bound Rhat_n({‖f‖_H ≤ r}) ≤ κ * r / sqrt n, where κ² = sup_x K(x,x). ★ rkhs_ball_empiricalRademacher_le
RKHS-ball Rademacher complexity
This file proves the canonical RKHS-ball empirical Rademacher bound
Rhat_n({‖f‖_H ≤ r}) ≤ κ * r / sqrt n, where κ² = sup_x K(x,x). The main
Hilbert-space theorem is empiricalRademacherComplexity_innerBall_le; the RKHS
specialization is rkhs_ball_empiricalRademacher_le, which uses the reproducing
identity to turn function evaluation into an inner product. This is the
standard worst-case O(1 / sqrt n) kernel learning rate associated with
Bartlett--Mendelson style Rademacher complexity bounds.
If evaluation on H has supplied reproducing representers, κ is a nonnegative bound, r is a nonnegative radius, and every sampled representer representer (xs k) has norm at most κ, then the empirical Rademacher complexity, on the sample xs, of the closed ball of radius r in H is at most κ·r/√n.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
empiricalRademacherComplexity_innerBall_letheorem — Hilbert-space linear complexity is radius product over square-root sample size. The bound uses nonnegative sample and weight radii, a vector sample bounded by its radius, and linear weights bounded by their radius.hypothesesE :ι :Type*n :ℕκ r :ℝhκ :0 ≤ κhr :0 ≤ rY :Fin n → EhY :∀ k, ‖Y k‖ ≤ κw :ι → Ehw :∀ i, ‖w i‖ ≤ rconclusionempiricalRademacherComplexity n (fun i a => inner ℝ (w i) a) Y ≤ κ * r / sqrt nProof (Lean source)
theorem empiricalRademacherComplexity_innerBall_le {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {ι : Type*} {n : ℕ} (κ r : ℝ) (hκ : 0 ≤ κ) (hr : 0 ≤ r) (Y : Fin n → E) (hY : ∀ k, ‖Y k‖ ≤ κ) (w : ι → E) (hw : ∀ i, ‖w i‖ ≤ r) : empiricalRademacherComplexity n (fun i a => inner ℝ (w i) a) Y ≤ κ * r / sqrt n := by classical by_cases hι : Nonempty ι · let : Nonempty ι := hι exact empiricalRademacherComplexity_innerBall_le_nonempty κ r hκ hr Y hY w hw · have : IsEmpty ι := not_nonempty_iff.mp hι unfold empiricalRademacherComplexity simp only [Signs.card, Nat.cast_pow, Nat.cast_ofNat, Int.reduceNeg, abs_mul, abs_inv, Nat.abs_cast, iSup_of_isEmpty, Finset.sum_const_zero, mul_zero, ge_iff_le] exact div_nonneg (mul_nonneg hκ hr) (Real.sqrt_nonneg _)