The Stone–Weierstrass theorem says given a compact Hausdorff space , one can uniformly approximate continuous functions by elements of any subalgebra that has enough elements to distinguish points. It is a far-reaching generalization of a classical theorem of Weierstrass, that real-valued continuous functions on a closed interval are uniformly approximable by polynomial functions.
Let be a compact Hausdorff topological space; for a constructive version take to be a compact regular locale (see compactum). Recall that the algebra of real-valued continuous functions is a commutative (real) Banach algebra with unit, under pointwise-defined addition and multiplication, and where the norm is the sup-norm
A subalgebra of is a vector subspace that is closed under the unit and algebra multiplication operations on . A Banach subalgebra is a subalgebra which is closed as a subspace of the metric space under the sup-norm metric. We say that separates points if, given distinct points , there exists such that .
A subalgebra inclusion is dense if and only if it separates points. Equivalently, a Banach subalgebra inclusion is the identity if and only if it separates points.
is polynomial (since by differentiating under the integral enough times, we eventually kill the convolving polynomial factor ), and one may verify that converges to in sup norm (i.e., uniformly) as , and in particular when restricted over the interval .
Now suppose given a Banach subalgebra .
Given , the values of are contained in some interval . If polynomials converge to the absolute value function in sup norm, then converges to in sup norm. Since is closed in with respect to the sup-norm, it follows that .
Next, is partially ordered by if for all , and we claim the poset is closed under binary meets and binary joins. For,
and , and we showed in the last step that is closed under the operation .
Finally, suppose the Banach subalgebra separates points. Given and , the last step is to show there exists such that .
Given , there exists such that and for all .
For each , we can choose such that , since separates points. Thus, given any , there exist and scalars and such that
Denote by (to indicate dependence on and ). For each , choose a neighborhood so that for all . Finitely many such neighborhoods cover ; let be the join of . Then for all .
Given a choice of for each , as in the preceding lemma, we may choose a neighborhood such that for all . Finitely many such neighborhoods cover ; let be the meet of . Then
for all , as was to be shown.
There is a complex-valued version of Stone–Weierstrass. Let denote the commutative -algebra of complex-valued functions , where the star operation is pointwise-defined conjugation. A -subalgebra is a subalgebra which is closed under the star operation.
A -subalgebra is dense if and only if it separates points.
There is also a locally compact version. Let be a locally compact Hausdorff space and let be the space of (say real-valued) functions which “vanish at infinity”: for every there exists a compact set such that for all outside . ( is no longer a Banach space, but it is locally convex and complete in its uniformity, and a Fréchet space if is second countable.) Under pointwise multiplication, is a commutative algebra without unit. As before, we have a notion of subalgebra .
is dense if and only if it separates points and for no is it true that every vanishes at .