Canonical: https://knowlpedia.com/real-analysis/stone-weierstrass-theorem/

# Stone–Weierstrass theorem

A subalgebra of continuous functions on a compact space that separates points and contains constants is dense in the full algebra.

**Stone–Weierstrass theorem:** Let \(K\) be a compact Hausdorff [topological space](https://knowlpedia.com/topology/topological-space/) and let \(C(K,\mathbb{R})\) denote the real-valued continuous functions on \(K\). Let \(A\subseteq C(K,\mathbb{R})\) be a [subalgebra](https://knowlpedia.com/real-analysis/subalgebra-of-continuous-functions/) that contains the constant functions and [separates points](https://knowlpedia.com/real-analysis/separates-points/) of \(K\). Then \(A\) is dense in \(C(K,\mathbb{R})\) with respect to the [supremum norm](https://knowlpedia.com/real-analysis/supremum-norm/): for every \(f\in C(K,\mathbb{R})\) and every \(\varepsilon>0\) there exists \(g\in A\) such that
\[
\sup_{x\in K}|f(x)-g(x)|<\varepsilon.
\]

## Examples

This theorem explains many uniform approximation results as density statements in the [space of continuous functions](https://knowlpedia.com/real-analysis/space-of-continuous-functions/); for example, the [Weierstrass approximation theorem](https://knowlpedia.com/real-analysis/weierstrass-approximation-theorem/) arises from a suitable choice of \(K\) and \(A\).
