RKHS & Kernel Methods

Point Evaluation & The Need for RKHS Reproducing Kernel Hilbert Spaces Mercer's Theorem RKHS Norm & Function Complexity The Representer Theorem & Grand Synthesis

Point Evaluation & The Need for RKHS

Throughout the Functional Analysis series we have treated functions as "points" in abstract infinite-dimensional spaces. We measured their "length" via norms, their "angle" via inner products, and their "spectrum" via eigenvalue decomposition. But there is one seemingly innocent operation we have not yet examined: evaluating a function at a point.

Convention. Our focus is the standard machine-learning setting, in which kernels and the corresponding Hilbert space \(\mathcal{H}_K\) are real-valued (RBF, polynomial, Laplacian, and Matérn kernels are all real). The inner product is therefore symmetric, \(\langle u, v\rangle_{\mathcal{H}_K} = \langle v, u\rangle_{\mathcal{H}_K}\), so the first-slot-linear convention adopted in Dual Spaces trivially restricts here.

The complex Hermitian theory developed in Spectral Theory specializes cleanly to this real-symmetric case. The conjugation in the Hermitian inner product becomes a no-op when all quantities are real-valued. We state this reduction explicitly where it matters (notably for positive definite kernels below).

Given a function \(f\) in some Hilbert space \(\mathcal{H}\), define the point evaluation functional at \(x \in \mathcal{X}\): \[ \delta_x : \mathcal{H} \to \mathbb{R}, \quad \delta_x(f) = f(x). \] This is clearly linear: \(\delta_x(\alpha f + \beta g) = \alpha f(x) + \beta g(x)\). The critical question is: is it continuous?

In \(L^2([a,b])\), the answer is no. Functions in \(L^2\) are equivalence classes defined up to sets of measure zero. Changing a function at a single point does not change its \(L^2\) norm. Consequently, point evaluation is not a bounded linear functional on \(L^2\), and \(\delta_x \notin (L^2)^*\). We cannot meaningfully "evaluate" an \(L^2\) function at a point.

This is a serious problem for machine learning. In supervised learning, we must evaluate our model \(f\) at data points \(x_1, \ldots, x_N\) to compute the loss: \[ \mathcal{L}(f) = \sum_{i=1}^{N} \ell\bigl(y_i,\, f(x_i)\bigr) + \lambda \|f\|_{\mathcal{H}}^2. \] In \(L^2\) this expression is not even well-defined, and in a Hilbert space of functions where point evaluation is not continuous it is defined, but the data-fit term is in general not continuous in \(f\). We need a Hilbert space where point evaluation is always bounded.

A Reproducing Kernel Hilbert Space (RKHS) is precisely a Hilbert space of functions in which point evaluation is a continuous linear functional for every point in the domain. The single requirement that \(\delta_x \in \mathcal{H}^*\) for all \(x\) has extraordinary consequences, connecting the Riesz Representation Theorem, Spectral Theory, and regularized optimization into a single coherent framework.

Reproducing Kernel Hilbert Spaces

By the standing assumption on \(\mathcal{H}\), the evaluation functional \(\delta_x(f) = f(x)\) belongs to \(\mathcal{H}^*\) for every \(x \in \mathcal{X}\). The Riesz Representation Theorem then gives a unique element \(K_x \in \mathcal{H}\), the Riesz representative of \(\delta_x\), such that \[ f(x) = \delta_x(f) = \langle f,\, K_x \rangle_{\mathcal{H}} \quad \text{for all } f \in \mathcal{H}. \]

Definition: Reproducing Kernel

Let \(\mathcal{H}\) be a Hilbert space of functions on a set \(\mathcal{X}\) in which all point evaluations are continuous. The reproducing kernel is the function \(K : \mathcal{X} \times \mathcal{X} \to \mathbb{R}\) defined by \[ K(x, x') = \langle K_x,\, K_{x'} \rangle_{\mathcal{H}} = K_{x'}(x). \] The pair \((\mathcal{H}, K)\) is called a Reproducing Kernel Hilbert Space (RKHS).

Notation. The Riesz representative \(K_x \in \mathcal{H}\) and the partially-evaluated kernel \(K(\cdot, x) : \mathcal{X} \to \mathbb{R}\) denote the same function: \(K_x(\cdot) = K(\cdot, x)\). We use both notations interchangeably, favoring \(K(\cdot, x)\) when emphasizing the kernel structure and \(K_x\) when emphasizing the Riesz duality.

Two identities follow immediately from this definition and are so fundamental that they deserve explicit naming.

Theorem: The Reproducing Property

For every \(f \in \mathcal{H}\) and every \(x' \in \mathcal{X}\): \[ f(x') = \langle f,\, K(\cdot, x') \rangle_{\mathcal{H}}. \] In particular, setting \(f = K(\cdot, x)\): \[ K(x, x') = \langle K(\cdot, x),\, K(\cdot, x') \rangle_{\mathcal{H}}. \] That is, the kernel reproduces itself under the inner product, hence the name.

The reproducing property says that to evaluate a function \(f\) at a point \(x'\), we take the inner product of \(f\) with the kernel "centered at \(x'\)." The kernel function \(K(\cdot, x')\) acts as a "probe" that extracts the value of \(f\) at the point \(x'\).

Positive Definiteness: The Characterization

Not every symmetric function \(K(x, x')\) is a reproducing kernel. The kernel must be positive definite. This is the same condition that a Mercer kernel must satisfy to serve as a valid covariance function.

Definition: Positive Definite Kernel (Mercer Kernel)

A symmetric function \(K : \mathcal{X} \times \mathcal{X} \to \mathbb{R}\) is positive definite if for all \(N \in \mathbb{N}\), all \(x_1, \ldots, x_N \in \mathcal{X}\), and all \(c_1, \ldots, c_N \in \mathbb{R}\): \[ \sum_{i=1}^{N} \sum_{j=1}^{N} c_i c_j K(x_i, x_j) \geq 0. \] Equivalently, the Gram matrix \(\mathbf{K}_{ij} = K(x_i, x_j)\) is positive semi-definite for every finite collection of points.

Terminological note. The condition \(\geq 0\) makes the Gram matrix positive semi-definite in the matrix sense. The kernel literature nevertheless calls this "positive definite kernel" by convention, reserving "strictly positive definite" for the case where, at distinct points \(x_1, \ldots, x_N\), equality forces \(c_1 = \cdots = c_N = 0\). Distinctness is essential in that second clause, since repeating a point and taking \(c = (1, -1)\) produces equality for every kernel. We adopt this kernel convention on this page. It does not extend to matrices, for which "positive definite" keeps its \(\succ 0\) meaning throughout the curriculum.

The complex counterpart, in which the scalars \(c_i\) range over \(\mathbb{C}\) and the double sum carries a conjugate, is the positive semi-definite kernel of Spectral Theory, which names the condition by its matrix-sense term. For a real symmetric \(K\) the two conditions agree. Restricting to real \(c\) gives one direction. For the other, we write \(c = a + ib\) with \(a, b \in \mathbb{R}^N\). The imaginary part of \(\sum_{i,j} \overline{c_i}\, c_j\, K(x_i, x_j)\) then cancels by symmetry of \(K\), and the sum reduces to \(\sum_{i,j} a_i a_j K(x_i, x_j) + \sum_{i,j} b_i b_j K(x_i, x_j)\).

The deep connection between positive definite kernels and RKHS is captured by the following theorem, which establishes a perfect one-to-one correspondence.

Theorem: Moore-Aronszajn

For every positive definite kernel \(K\) on a set \(\mathcal{X}\), there exists a unique Hilbert space \(\mathcal{H}_K\) of functions on \(\mathcal{X}\) for which \(K\) is the reproducing kernel. Conversely, every RKHS has a unique reproducing kernel.

Proof:

We construct \(\mathcal{H}_K\) explicitly in four steps.

Step 1 (pre-Hilbert space). Let \(\mathcal{H}_0 = \operatorname{span}\{K(\cdot, x) : x \in \mathcal{X}\}\) and define a bilinear form on the generators by \(\langle K(\cdot, x), K(\cdot, x') \rangle := K(x, x')\). Symmetry of \(K\) makes this form symmetric. For any finite linear combination \(f = \sum_i a_i K(\cdot, x_i)\), bilinearity forces \(\langle f, f\rangle = \sum_{i,j} a_i a_j K(x_i, x_j) \geq 0\) by the Gram-matrix condition, so the form is positive semi-definite. Well-definedness of the bilinear extension to all of \(\mathcal{H}_0\) is established next. The point to check is that \(\langle f, g\rangle\) does not depend on the chosen finite-sum representations of \(f\) and \(g\).

Step 2 (reproducing property on \(\mathcal{H}_0\), well-definedness, positive definiteness). For \(f = \sum_i a_i K(\cdot, x_i)\), direct computation gives \(\langle f, K(\cdot, x)\rangle = \sum_i a_i K(x_i, x) = f(x)\). Consequently, for any \(g = \sum_j b_j K(\cdot, y_j) \in \mathcal{H}_0\), bilinearity yields \(\langle f, g\rangle = \sum_j b_j f(y_j)\), a value determined entirely by the function \(f\) (not its representation) and the data \((b_j, y_j)\). A symmetric argument in the first slot completes the verification that \(\langle\cdot,\cdot\rangle\) is well-defined on \(\mathcal{H}_0\). The Cauchy-Schwarz inequality then gives \(|f(x)|^2 = |\langle f, K(\cdot, x)\rangle|^2 \leq \langle f, f\rangle \cdot K(x, x)\), so \(\langle f, f\rangle = 0\) forces \(f \equiv 0\). The form is therefore a genuine inner product.

Step 3 (completion as a function space). This is the heart of the theorem. We build the completion of \(\mathcal{H}_0\) directly as a space of functions. Call a sequence \(\{f_n\} \subset \mathcal{H}_0\) that is Cauchy for the inner product of Step 2 an approximating sequence. For each \(x \in \mathcal{X}\), the Cauchy-Schwarz bound from Step 2 gives \(|f_n(x) - f_m(x)| \leq \|f_n - f_m\| \cdot \sqrt{K(x, x)}\), so \(\{f_n(x)\}\) is Cauchy in \(\mathbb{R}\) and converges. Let \(\mathcal{H}_K\) be the set of all pointwise limits \(f(x) = \lim_n f_n(x)\) of approximating sequences. It is a vector space of functions \(\mathcal{X} \to \mathbb{R}\) containing \(\mathcal{H}_0\) (constant sequences).

The key observation is that an approximating sequence \(\{h_n\}\) with \(h_n(x) \to 0\) for every \(x\) satisfies \(\|h_n\| \to 0\). Given \(\varepsilon \gt 0\), choose \(N\) with \(\|h_n - h_m\| \lt \varepsilon\) for \(n, m \geq N\), and fix \(m \geq N\). Writing \(h_m = \sum_i a_i K(\cdot, y_i)\), the reproducing property on \(\mathcal{H}_0\) gives \(\langle h_n, h_m\rangle = \sum_i a_i h_n(y_i) \to 0\) as \(n \to \infty\). Hence \[ \|h_m\|^2 = \langle h_m - h_n, h_m\rangle + \langle h_n, h_m\rangle \leq \varepsilon \|h_m\| + \langle h_n, h_m\rangle \] for every \(n \geq N\). Letting \(n \to \infty\) gives \(\|h_m\|^2 \leq \varepsilon \|h_m\|\), hence \(\|h_m\| \leq \varepsilon\) for every \(m \geq N\).

For \(f, g \in \mathcal{H}_K\) with approximating sequences \(\{f_n\}\) and \(\{g_n\}\), set \(\langle f, g\rangle := \lim_n \langle f_n, g_n\rangle\). The limit exists because Cauchy sequences are bounded and \[ \begin{align*} |\langle f_n, g_n\rangle - \langle f_m, g_m\rangle| &\leq |\langle f_n - f_m, g_n\rangle| + |\langle f_m, g_n - g_m\rangle| \\\\ &\leq \|f_n - f_m\| \|g_n\| + \|f_m\| \|g_n - g_m\|. \end{align*} \] It does not depend on the chosen sequences: two approximating sequences for the same \(f\) differ by an approximating sequence that tends to \(0\) pointwise, hence in norm by the key observation, and the same estimate shows the limit is unchanged. Bilinearity, symmetry, and \(\langle f, f\rangle \geq 0\) pass to the limit, and on \(\mathcal{H}_0\) the new form agrees with that of Step 2. If \(\langle f, f\rangle = 0\), then \(\|f_n\| \to 0\) and \(|f(x)| = \lim_n |f_n(x)| \leq \lim_n \|f_n\| \sqrt{K(x, x)} = 0\) for every \(x\). The form is therefore an inner product on \(\mathcal{H}_K\).

If \(\{f_n\}\) approximates \(f\), then \(\{f_n - f_m\}_n\) approximates \(f - f_m\), so \(\|f - f_m\| = \lim_n \|f_n - f_m\|\), which tends to \(0\) as \(m \to \infty\). Thus every approximating sequence converges in \(\mathcal{H}_K\) to its pointwise limit, and \(\mathcal{H}_0\) is dense in \(\mathcal{H}_K\). For completeness, let \(\{u_k\}\) be Cauchy in \(\mathcal{H}_K\) and choose \(h_k \in \mathcal{H}_0\) with \(\|u_k - h_k\| \lt 1/k\). Since \(\|h_k - h_l\| \leq 1/k + \|u_k - u_l\| + 1/l\), the sequence \(\{h_k\}\) is an approximating sequence, so it has a pointwise limit \(u \in \mathcal{H}_K\) with \(\|u - h_k\| \to 0\), and \(\|u - u_k\| \leq \|u - h_k\| + 1/k \to 0\). Hence \(\mathcal{H}_K\) is a Hilbert space whose elements are bona fide functions on \(\mathcal{X}\).

Step 4 (reproducing property on \(\mathcal{H}_K\), uniqueness). Each \(K(\cdot, x)\) lies in \(\mathcal{H}_0 \subseteq \mathcal{H}_K\). For \(f \in \mathcal{H}_K\) with approximating sequence \(\{f_n\}\), the definition of the inner product and Step 2 give \[ \begin{align*} \langle f, K(\cdot, x)\rangle &= \lim_{n \to \infty} \langle f_n, K(\cdot, x)\rangle \\\\ &= \lim_{n \to \infty} f_n(x) = f(x). \end{align*} \] Hence \(|f(x)| \leq \|f\| \sqrt{K(x, x)}\), so every point evaluation \(\delta_x\) is bounded, and \(K(\cdot, x)\) represents \(\delta_x\). Thus \(K_x = K(\cdot, x)\) and \(K\) is the reproducing kernel of \(\mathcal{H}_K\) in the sense of the Definition. Uniqueness of the reproducing kernel follows from the Riesz Representation Theorem. Each \(\delta_x\) determines its representative \(K_x\) uniquely.

For uniqueness of \(\mathcal{H}_K\) itself, let \(\tilde{\mathcal{H}}\) be any Hilbert space of functions on \(\mathcal{X}\) with reproducing kernel \(K\). It contains every \(K(\cdot, x)\), hence \(\mathcal{H}_0\), and the reproducing property forces its inner product to agree with that of Step 2 on \(\mathcal{H}_0\). Moreover \(\mathcal{H}_0\) is dense in \(\tilde{\mathcal{H}}\): a \(w \in \tilde{\mathcal{H}}\) orthogonal to \(\mathcal{H}_0\) satisfies \(w(x) = \langle w, K(\cdot, x)\rangle = 0\) for every \(x\), so the closure of \(\mathcal{H}_0\) has trivial orthogonal complement and, by the projection theorem, is all of \(\tilde{\mathcal{H}}\). Now let \(f \in \mathcal{H}_K\) be the pointwise limit of an approximating sequence \(\{f_n\}\). This sequence is Cauchy in \(\tilde{\mathcal{H}}\) as well, so it converges there to some \(\tilde{f}\), and norm convergence in \(\tilde{\mathcal{H}}\) implies pointwise convergence by the bound \(|f_n(x) - \tilde{f}(x)| \leq \|f_n - \tilde{f}\|_{\tilde{\mathcal{H}}} \sqrt{K(x, x)}\). Hence \(\tilde{f} = f\), so \(f \in \tilde{\mathcal{H}}\) and \(\|f\|_{\tilde{\mathcal{H}}} = \lim_n \|f_n\| = \|f\|_{\mathcal{H}_K}\). Thus \(\mathcal{H}_K \subseteq \tilde{\mathcal{H}}\) with the same norm, hence, by polarization, with the same inner products. Conversely, given \(v \in \tilde{\mathcal{H}}\), density provides \(f_n \in \mathcal{H}_0\) with \(f_n \to v\) in \(\tilde{\mathcal{H}}\). Then \(\{f_n\}\) is an approximating sequence whose pointwise limit is \(v\), so \(v \in \mathcal{H}_K\). So \(\tilde{\mathcal{H}} = \mathcal{H}_K\) as Hilbert spaces of functions.

Connection to the Kernel Trick

The kernel trick in SVMs replaces inner products \(\langle \phi(x), \phi(x') \rangle\) with kernel evaluations \(K(x, x')\). The Moore-Aronszajn theorem tells us exactly what is happening: \(K(x, x') = \langle K(\cdot, x), K(\cdot, x') \rangle_{\mathcal{H}_K}\), so one canonical feature map is \(\phi(x) = K(\cdot, x) \in \mathcal{H}_K\). The kernel trick is not merely a computational shortcut. It is the reproducing property of an RKHS.

Mercer's Theorem

In Spectral Theory, we saw that a compact, self-adjoint, positive operator on a Hilbert space admits a spectral decomposition into eigenfunctions. Mercer's Theorem applies this machinery to the integral operator defined by a positive definite kernel, providing an explicit eigenfunction expansion of the kernel itself.

Theorem: Mercer's Theorem

Let \(\mathcal{X}\) be a compact subset of \(\mathbb{R}^d\) equipped with a finite strictly positive Borel measure \(\mu\) (that is, every non-empty open set has positive measure), and let \(K : \mathcal{X} \times \mathcal{X} \to \mathbb{R}\) be a continuous, symmetric, positive definite kernel. Define the integral operator \(T_K : L^2(\mathcal{X}, \mu) \to L^2(\mathcal{X}, \mu)\) by \[ (T_K f)(x) = \int_{\mathcal{X}} K(x, x')\, f(x')\, d\mu(x'). \]

Then \(T_K\) is compact, self-adjoint, and positive, and there is a finite or countably infinite orthonormal sequence of eigenfunctions \(\{e_n\}\) in \(L^2(\mathcal{X}, \mu)\) whose eigenvalues \(\lambda_1 \geq \lambda_2 \geq \cdots \gt 0\) are exactly the nonzero eigenvalues of \(T_K\), with \(\lambda_n \to 0\) when the sequence is infinite, such that \[ K(x, x') = \sum_n \lambda_n \, e_n(x) \, e_n(x'). \] The convergence is absolute and uniform on \(\mathcal{X} \times \mathcal{X}\).

Proof sketch:

Continuity of \(K\) on the compact set \(\mathcal{X}\times\mathcal{X}\) and finiteness of \(\mu\) give \(K \in L^2(\mathcal{X}\times\mathcal{X}, \mu\otimes\mu)\), so \(T_K\) is a Hilbert-Schmidt operator and hence compact. Symmetry of \(K\) gives self-adjointness.

Positive definiteness of \(K\) is defined for finite point sets. It must be promoted to the integral statement \(\langle T_K f, f\rangle \geq 0\). Fix a continuous \(f \in C(\mathcal{X})\) and \(\eta \gt 0\). Intersecting \(\mathcal{X}\) with a grid of half-open cubes of side \(\eta / \sqrt{d}\) and discarding the empty intersections partitions it into finitely many nonempty Borel sets \(A_1, \ldots, A_m\) of diameter at most \(\eta\), and we pick sample points \(x_i \in A_i\). The discrete PD condition with \(c_i = f(x_i)\, \mu(A_i)\) gives \[ \sum_{i,j} K(x_i, x_j) f(x_i) f(x_j) \, \mu(A_i) \mu(A_j) \geq 0. \]

The function \(g(x, x') = K(x, x') f(x) f(x')\) is continuous on the compact set \(\mathcal{X} \times \mathcal{X}\), hence uniformly continuous by the Heine-Cantor theorem. Let \(\omega(\eta)\) be the supremum of \(|g(x, x') - g(y, y')|\) over points \((x, x'), (y, y') \in \mathcal{X} \times \mathcal{X}\) with \(|x - y|, |x' - y'| \leq \eta\), which tends to \(0\) as \(\eta \to 0\). Splitting the iterated integral \(\langle T_K f, f\rangle = \int \!\! \int g(x, x')\, d\mu(x')\, d\mu(x)\) over the sets \(A_i \times A_j\) shows that it differs from the left-hand side above by at most \(\mu(\mathcal{X})^2\, \omega(\eta)\). Letting \(\eta \to 0\) gives \(\langle T_K f, f\rangle \geq 0\) for all \(f \in C(\mathcal{X})\). The same argument is carried out in detail for \([a,b]\) with Lebesgue measure, and for complex Hermitian kernels, in Spectral Theory.

The density of \(C(\mathcal{X})\) in \(L^2(\mathcal{X}, \mu)\), a fact about finite Borel measures on compact metric spaces that we take for granted here, and continuity of \(f \mapsto \langle T_K f, f\rangle\) on \(L^2\) extend the inequality to all of \(L^2\). All eigenvalues of \(T_K\) are therefore nonnegative.

The Spectral Theorem for compact self-adjoint operators gives \(T_K f = \sum_n \lambda_n \langle f, e_n\rangle_{L^2} e_n\) with orthonormal eigenfunctions \(\{e_n\}\). Since the kernel \(K\) determines \(T_K\) uniquely as an integral operator (distinct kernels modulo a.e. equivalence define distinct integral operators), this lifts to the kernel decomposition \(K(x, x') = \sum_n \lambda_n e_n(x) e_n(x')\) with convergence in \(L^2(\mathcal{X}\times\mathcal{X}, \mu\otimes\mu)\).

The upgrade to absolute and uniform convergence on \(\mathcal{X}\times\mathcal{X}\) is the deep part. The right-hand side of \(T_K e_n = \lambda_n e_n\), namely \(x \mapsto \int K(x, x') e_n(x')\, d\mu(x')\), is continuous in \(x\) by continuity of \(K\) and dominated convergence.

Replacing \(e_n\) by \(\lambda_n^{-1} T_K e_n\) (valid for \(\lambda_n \gt 0\)) within its a.e. equivalence class therefore selects a continuous representative. Strict positivity of \(\mu\) ensures this representative is uniquely determined, because any two continuous functions agreeing a.e. with respect to a strictly positive measure must agree pointwise. The pointwise expansion is therefore well-defined.

The partial sums \(S_N(x, x') = \sum_{n=1}^N \lambda_n e_n(x) e_n(x')\) are continuous, and on the diagonal the nonnegative terms \(\lambda_n e_n(x)^2 \geq 0\) make \(S_N(x, x) \nearrow K(x, x)\) monotonically. Dini's theorem (continuous monotone sequence with continuous limit on a compact set converges uniformly) upgrades this to uniform convergence on the diagonal. For the off-diagonal terms, Cauchy-Schwarz applied to partial-sum tails gives, for \(M \gt N\), \[ |S_M(x, x') - S_N(x, x')|^2 = \left|\sum_{n=N+1}^M \lambda_n e_n(x) e_n(x')\right|^2 \leq R_N(x) \cdot R_N(x'), \] where \(R_N(x) = K(x, x) - S_N(x, x) \geq \sum_{n=N+1}^M \lambda_n e_n(x)^2\).

The diagonal uniform convergence \(R_N \to 0\) gives a uniform Cauchy criterion, yielding both absolute and uniform convergence on all of \(\mathcal{X}\times\mathcal{X}\).

Let us unpack why each ingredient is necessary:

  1. Continuity + symmetry of \(K\): Guarantees that \(T_K\) is a Hilbert-Schmidt operator, hence compact.
  2. Positive definiteness: Ensures all eigenvalues are nonnegative (so \(T_K\) is a positive operator).
  3. The Spectral Theorem: Provides the eigenfunction decomposition \(T_K f = \sum \lambda_n \langle f, e_n \rangle e_n\).
  4. Mercer's contribution: Lifts the eigenfunction expansion of the operator to a pointwise expansion of the kernel function, with uniform convergence.
  5. Strictly positive measure: Ensures that \(L^2\)-eigenfunctions have unique continuous representatives, so the pointwise equality \(K(x,x') = \sum \lambda_n e_n(x) e_n(x')\) is well-defined.

The Feature Map from Mercer's Theorem

The Mercer expansion immediately yields an explicit feature map into \(\ell^2\): \[ \Phi(x) = \bigl(\sqrt{\lambda_n}\, e_n(x)\bigr)_n \in \ell^2, \] and the kernel is recovered as the inner product: \[ K(x, x') = \langle \Phi(x),\, \Phi(x') \rangle_{\ell^2} = \sum_n \lambda_n \, e_n(x) \, e_n(x'). \]

Under Mercer's hypotheses, this gives a concrete \(\ell^2\) realization of the kernel trick, which is available for every positive definite kernel through the canonical feature map \(x \mapsto K(\cdot, x)\). The kernel evaluates an inner product in a possibly infinite-dimensional feature space without ever computing the feature map \(\Phi\) explicitly. To see that \(\Phi(x)\) indeed lands in \(\ell^2\), set \(x = x'\) in the Mercer expansion: \(\|\Phi(x)\|_{\ell^2}^2 = \sum_n \lambda_n\, e_n(x)^2 = K(x, x) \lt \infty\), which is finite since \(K\) is continuous on a compact set. The rate of decay of \(\lambda_n\) controls the "effective dimensionality" of the feature space.

Example: The RBF (Gaussian) Kernel

The radial basis function kernel \(K(x, x') = \exp\bigl(-\|x - x'\|^2 / (2\sigma^2)\bigr)\) is continuous, symmetric, and positive definite. For a Gaussian input measure on \(\mathbb{R}\), its eigenfunctions are Hermite-type functions and the eigenvalues decay exponentially: \(\lambda_n = C \cdot r^n\) with \(0 \lt r \lt 1\). (That measure is not supported on a compact set, so this example lies just outside the hypotheses of the theorem above.) This rapid decay explains why low-rank approximations of the Gram matrix, such as truncating the expansion after a few terms, work well in practice. Unless the bandwidth is small relative to the spread of the data, only the first few eigenfunctions carry significant weight. (Random Fourier Features rest on a different fact, Bochner's theorem, which represents a continuous positive-definite shift-invariant kernel normalized by \(K(x, x) = 1\) as the Fourier transform of a probability measure.)

Connection to Gaussian Processes

In a zero-mean Gaussian Process with covariance function \(K\), the Mercer expansion gives the Karhunen-Loève expansion: \[ f(x) = \sum_n Z_n \sqrt{\lambda_n}\, e_n(x), \quad Z_n \sim \mathcal{N}(0, 1) \text{ i.i.d.} \]

Each draw from the GP is a random function whose "complexity" is governed by the eigenvalue decay. Smooth kernels (fast decay) produce smooth sample paths. Rough kernels (slow decay) produce rough paths. The RKHS norm (introduced in the next section) measures the complexity of the mean function of the posterior GP.

RKHS Norm & Function Complexity

A central utility of the RKHS framework for machine learning is that the RKHS norm provides a mathematically precise notion of function "smoothness" or "complexity." This connects directly to regularization.

The RKHS Inner Product via Mercer Eigenfunctions

Suppose the kernel \(K\) has the Mercer expansion \(K(x, x') = \sum_n \lambda_n e_n(x) e_n(x')\). Any function \(f \in \mathcal{H}_K\) can be expanded as \(f(x) = \sum_n f_n \, e_n(x)\), where \(f_n = \langle f, e_n \rangle_{L^2}\) are the generalized Fourier coefficients.

The RKHS inner product is not the \(L^2\) inner product. Instead, it reweights each eigencomponent by the inverse of the eigenvalue:

Lemma: Aronszajn Factorization

Under the hypotheses of Mercer's Theorem, assume in addition that \(T_K\) is injective, so that \(\{e_n\}\) is an orthonormal basis of \(L^2(\mathcal{X}, \mu)\). Let \(T_K^{1/2}\) be the positive square root of \(T_K\), defined via spectral calculus by \(T_K^{1/2} g = \sum_n \sqrt{\lambda_n} \langle g, e_n\rangle_{L^2}\, e_n\). Then \(T_K^{1/2} : L^2(\mathcal{X}, \mu) \to \mathcal{H}_K\) is an isometric isomorphism: \[ \mathcal{H}_K = T_K^{1/2}\bigl(L^2(\mathcal{X}, \mu)\bigr), \quad \|T_K^{1/2} g\|_{\mathcal{H}_K} = \|g\|_{L^2(\mathcal{X}, \mu)}. \]

In particular, \(\{\phi_n := \sqrt{\lambda_n}\, e_n\}\) is an orthonormal basis of \(\mathcal{H}_K\).

Proof:

By Mercer's Theorem, \(K(x, y) = \sum_n \lambda_n e_n(x) e_n(y) = \sum_n \phi_n(x) \phi_n(y)\) with \(\phi_n := \sqrt{\lambda_n}\, e_n\) (continuous representatives). For a square-summable sequence \((c_n)\), the Cauchy-Schwarz inequality in \(\ell^2\) gives \[ \sum_{n \gt N} |c_n|\, |\phi_n(x)| \leq \Bigl(\sum_{n \gt N} c_n^2\Bigr)^{1/2} \sqrt{K(x, x)} \] (using \(\sum_n \phi_n(x)^2 = K(x, x)\), the Mercer expansion at \(x' = x\)), so \(\sum_n c_n \phi_n\) converges absolutely at every \(x\), and uniformly on \(\mathcal{X}\) because \(K\) is bounded on the compact \(\mathcal{X} \times \mathcal{X}\). Let \(\mathcal{H}'\) be the space of these functions with \(\langle \sum_n c_n \phi_n, \sum_n d_n \phi_n\rangle := \sum_n c_n d_n\). The coefficients are determined by the function: uniform convergence on the finite measure space implies convergence in \(L^2\), so \(\langle \sum_n c_n \phi_n, e_m\rangle_{L^2} = c_m \sqrt{\lambda_m}\) with \(\lambda_m \gt 0\). Hence \(\mathcal{H}'\) is a Hilbert space of functions, isometric to \(\ell^2\), with \(\{\phi_n\}\) as an orthonormal basis. Since \(\sum_n \phi_n(y)^2 = K(y, y)\), \(K(\cdot, y) = \sum_n \phi_n(y) \phi_n\) lies in \(\mathcal{H}'\), and \(\langle \sum_n c_n \phi_n, K(\cdot, y)\rangle = \sum_n c_n \phi_n(y)\), so \(K\) is the reproducing kernel of \(\mathcal{H}'\). By the uniqueness half of the Moore-Aronszajn Theorem, \(\mathcal{H}' = \mathcal{H}_K\) as Hilbert spaces of functions.

The spectral-calculus definition of \(T_K^{1/2}\) sends \(g = \sum_n g_n e_n \in L^2\) to \(T_K^{1/2} g = \sum_n \sqrt{\lambda_n}\, g_n\, e_n = \sum_n g_n \phi_n\) (the \(L^2\) sum and the uniformly convergent sum define the same class, and we take its continuous representative), whose \(\mathcal{H}_K\)-norm is \((\sum_n g_n^2)^{1/2} = \|g\|_{L^2}\). Thus \(T_K^{1/2} : L^2(\mathcal{X}, \mu) \to \mathcal{H}_K\) is norm-preserving, with image all of \(\mathcal{H}_K\) (every \(f = \sum_n c_n \phi_n \in \mathcal{H}_K\) is the image of \(g = \sum_n c_n e_n \in L^2\)).

Proposition: RKHS Norm via Mercer Coefficients

Assume \(T_K\) is injective, so that \(\{e_n\}\) is an orthonormal basis of \(L^2(\mathcal{X}, \mu)\). This standing assumption holds whenever \(\langle T_K u, u \rangle \gt 0\) for every nonzero \(u \in L^2(\mathcal{X}, \mu)\), an integral strengthening of positive definiteness under which \(T_K u = 0\) forces \(u = 0\). Otherwise \(\mathcal{H}_K\) sits inside the closed span of \(\{e_n\}\) in \(L^2(\mathcal{X}, \mu)\), the inner-product and norm formulas below hold verbatim, and the membership criterion holds for \(f\) in that closed span (equivalently, \(f \perp \ker T_K\)) rather than for all \(f \in L^2(\mathcal{X}, \mu)\).

For \(f = \sum_n f_n \, e_n\) and \(g = \sum_n g_n \, e_n\) in \(\mathcal{H}_K\): \[ \langle f, g \rangle_{\mathcal{H}_K} = \sum_n \frac{f_n \, g_n}{\lambda_n}. \] The RKHS norm is therefore \[ \|f\|_{\mathcal{H}_K}^2 = \sum_n \frac{f_n^2}{\lambda_n}. \] A function \(f \in L^2(\mathcal{X}, \mu)\) with Fourier expansion \(f = \sum_n f_n e_n\) belongs to \(\mathcal{H}_K\) if and only if \(\sum_n f_n^2 / \lambda_n \lt \infty\).

Proof sketch:

By the Aronszajn Factorization Lemma, every \(f \in \mathcal{H}_K\) can be written uniquely as \(f = T_K^{1/2} h\) for some \(h \in L^2(\mathcal{X}, \mu)\), and this correspondence is an isometry: \(\|f\|_{\mathcal{H}_K} = \|h\|_{L^2}\). Expanding \(h\) in the \(L^2\)-orthonormal basis \(\{e_n\}\) as \(h = \sum_n h_n e_n\), we have \[ f = T_K^{1/2} h = \sum_n h_n\, T_K^{1/2} e_n = \sum_n h_n \sqrt{\lambda_n}\, e_n. \]

Comparing with the \(L^2\)-Fourier expansion \(f = \sum_n f_n e_n\) gives \(f_n = h_n \sqrt{\lambda_n}\), that is, \(h_n = f_n / \sqrt{\lambda_n}\). The isometry \(\|f\|_{\mathcal{H}_K}^2 = \|h\|_{L^2}^2\) then reads \[ \|f\|_{\mathcal{H}_K}^2 = \sum_n h_n^2 = \sum_n \frac{f_n^2}{\lambda_n}. \] The polarization identity yields the inner-product formula. The membership characterization \(f \in \mathcal{H}_K \iff \sum_n f_n^2/\lambda_n \lt \infty\) follows from \(f \in \mathcal{H}_K \iff h \in L^2 \iff \sum_n h_n^2 \lt \infty\).

The division by \(\lambda_n\) is the key insight. Since the eigenvalues \(\lambda_n\) are nonincreasing, the higher-order eigenfunctions (those corresponding to small eigenvalues) are penalized more heavily in the RKHS norm. Relative to its \(L^2\) norm, a function concentrated on the first few eigenmodes has a small RKHS norm, while weight on small-\(\lambda_n\) modes (typically the high-frequency ones) inflates it.

Connection to Regularization: Why \(\|f\|_{\mathcal{H}_K}^2\) Controls Complexity

When we add \(\lambda \|f\|_{\mathcal{H}_K}^2\) to our loss function, we are penalizing functions that use high-frequency eigenfunctions. This is the infinite-dimensional analogue of Ridge regression. In finite dimensions, \(\|w\|^2 = \sum w_i^2\) penalizes large weights equally. In the RKHS, \(\|f\|_{\mathcal{H}_K}^2 = \sum f_n^2 / \lambda_n\) penalizes components in "hard" directions (small \(\lambda_n\)) more than "easy" ones (large \(\lambda_n\)).

RKHS Functions are "Smoother" than \(L^2\) Functions

The membership condition \(\sum f_n^2 / \lambda_n \lt \infty\) is strictly stronger than the \(L^2\) condition \(\sum f_n^2 \lt \infty\) whenever the eigenvalue sequence is infinite, since then \(\lambda_n \to 0\). For example, take \(f_n = \sqrt{\lambda_n}\). Then \(\sum f_n^2 = \sum \lambda_n \lt \infty\), which is finite because integrating the Mercer expansion on the diagonal gives \(\sum_n \lambda_n = \int_{\mathcal{X}} K(x, x)\, d\mu(x)\), and the right-hand side is finite by continuity of \(K\) on the compact \(\mathcal{X}\) and finiteness of \(\mu\). But \(\sum f_n^2 / \lambda_n = \infty\), so \(f \in L^2 \setminus \mathcal{H}_K\). Therefore: \[ \mathcal{H}_K \subsetneq L^2(\mathcal{X}, \mu). \]

The RKHS consists of "smoother" functions. These are the functions whose high-frequency components decay fast enough to compensate for the shrinking eigenvalues. For kernels with the same eigenfunctions, eigenvalues dominated mode by mode up to a constant (\(\lambda'_n \leq C \lambda_n\) for every \(n\)) give a smaller (and smoother) RKHS, \(\mathcal{H}_{K'} \subseteq \mathcal{H}_K\).

Point evaluation is continuous in every RKHS, by the bound \(|f(x)| \leq \|f\|_{\mathcal{H}_K} \sqrt{K(x, x)}\). In the Mercer setting (continuous \(K\)), RKHS membership also forces the functions themselves to be continuous. Generic \(L^2\) functions, by contrast, are only defined up to measure-zero modifications.

The Representer Theorem & Grand Synthesis

We now arrive at the theorem that ties the entire Functional Analysis series together: the Representer Theorem. It tells us that even though the RKHS \(\mathcal{H}_K\) may be infinite-dimensional, any minimizer of a regularized empirical risk minimization problem lies in a finite-dimensional subspace spanned by the kernel functions at the data points.

The Representer Theorem is a structural result. It describes the form of any minimizer that exists, without itself asserting existence. Existence depends on the loss function and is not automatic. In the kernel methods that use this theorem in practice, existence is nevertheless clear. Kernel Ridge Regression reduces to a finite-dimensional linear system with a unique closed-form solution, and the kernel SVM to a finite-dimensional convex quadratic program. The theorem below tells us the structure of any such minimizer:

Theorem: The Representer Theorem

Let \(\mathcal{H}_K\) be an RKHS on \(\mathcal{X}\) with kernel \(K\), let \(\{(x_i, y_i)\}_{i=1}^N\) be training data, and consider the regularized problem \[ \min_{f \in \mathcal{H}_K} \left[\sum_{i=1}^{N} \ell\bigl(y_i,\, f(x_i)\bigr) + \lambda \|f\|_{\mathcal{H}_K}^2\right], \] where \(\ell\) is any loss function and \(\lambda \gt 0\). Then any minimizer \(f^*\) of this objective has the form \[ f^*(x) = \sum_{i=1}^{N} \alpha_i \, K(x, x_i) \] for some coefficients \(\alpha_1, \ldots, \alpha_N \in \mathbb{R}\).

This is a remarkable dimension reduction. The optimization was posed over the entire (possibly infinite-dimensional) space \(\mathcal{H}_K\), yet the answer lies in the subspace \(\operatorname{span}\{K(\cdot, x_1), \ldots, K(\cdot, x_N)\}\), of dimension at most \(N\).

Proof Sketch:

Decompose any \(f \in \mathcal{H}_K\) as \(f = f_\parallel + f_\perp\), where \(f_\parallel \in \operatorname{span}\{K(\cdot, x_i)\}_{i=1}^N\) and \(f_\perp\) is orthogonal to this subspace. (The span is finite-dimensional, hence closed in \(\mathcal{H}_K\), so this orthogonal decomposition is guaranteed by the projection theorem.)

By the reproducing property, \(f(x_i) = \langle f, K(\cdot, x_i) \rangle_{\mathcal{H}_K}\). Since \(f_\perp\) is orthogonal to every \(K(\cdot, x_i)\): \[ f(x_i) = f_\parallel(x_i) + \underbrace{\langle f_\perp, K(\cdot, x_i) \rangle}_{= 0} = f_\parallel(x_i). \]

The component \(f_\perp\) therefore does not affect the data-fit term. However, by Pythagoras: \[ \|f\|_{\mathcal{H}_K}^2 = \|f_\parallel\|_{\mathcal{H}_K}^2 + \|f_\perp\|_{\mathcal{H}_K}^2 \geq \|f_\parallel\|_{\mathcal{H}_K}^2. \] Adding any nonzero \(f_\perp\) strictly increases the regularization penalty without improving the data fit. Hence any minimizer satisfies \(f_\perp = 0\).

From the Representer Theorem to Kernel Algorithms

With \(f^*(x) = \sum_{i=1}^N \alpha_i K(x, x_i)\), the (possibly infinite-dimensional) problem reduces to a finite-dimensional optimization over \(\boldsymbol{\alpha} \in \mathbb{R}^N\). The reproducing property gives \[ f^*(x_j) = \sum_{i=1}^N \alpha_i K(x_j, x_i) = (\mathbf{K}\boldsymbol{\alpha})_j \] where \(\mathbf{K}_{ij} = K(x_i, x_j)\) is the Gram matrix, and \[ \|f^*\|_{\mathcal{H}_K}^2 = \boldsymbol{\alpha}^\top \mathbf{K} \boldsymbol{\alpha}. \]

The regularized problem becomes \[ \min_{\boldsymbol{\alpha} \in \mathbb{R}^N} \left[\sum_{i=1}^N \ell\bigl(y_i,\, (\mathbf{K}\boldsymbol{\alpha})_i\bigr) + \lambda \, \boldsymbol{\alpha}^\top \mathbf{K} \boldsymbol{\alpha}\right]. \] For the squared loss \(\ell(y, \hat{y}) = (y - \hat{y})^2\), this is Kernel Ridge Regression, with closed-form solution \(\boldsymbol{\alpha} = (\mathbf{K} + \lambda I)^{-1} \mathbf{y}\). For the hinge loss, it is the kernel SVM without an offset term (the usual unpenalized offset \(b\) requires a mild extension of the theorem).

The Grand Synthesis

Every page in this Functional Analysis series has contributed a piece of the RKHS picture. Banach & Hilbert Spaces gave us the ambient structure of completeness, inner products, and \(L^2\) as the home of Mercer's integral operator. Bounded Operators gave us the equivalence of boundedness and continuity, which is exactly what point evaluation \(\delta_x\) must satisfy for the whole theory to begin. Dual Spaces and the Riesz Representation Theorem converted "\(\delta_x\) is bounded" into the concrete statement "\(\delta_x\) has a Riesz representative \(K_x = K(\cdot, x)\)", and these assemble into the reproducing kernel \(K(x, x') = \langle K_x, K_{x'} \rangle\).

Spectral Theory lifted Mercer's integral operator into an eigenfunction expansion, exposing the explicit feature map into \(\ell^2\) and the smoothness-controlling role of eigenvalue decay. And the Representer Theorem, proved here, collapses infinite-dimensional optimization onto a finite-dimensional kernel algebra. The Functional Analysis series reaches its culmination here. Each abstract tool introduced above now anchors a concrete machine-learning method: Hilbert structure, boundedness, Riesz duality, and spectral decomposition.