In mathematical analysis, the **Weierstrass approximation theorem** states that every continuous function defined on an interval [*a*,*b*] can be uniformly approximated as closely as desired by a polynomial function. Because polynomials are the simplest functions, and computers can directly evaluate polynomials, this theorem has both practical and theoretical relevance.

Marshall H. Stone considerably generalized the theorem and simplified the proof; his result is known as the **Stone-Weierstrass theorem**. The Stone-Weierstrass theorem generalizes the Weierstrass approximation theorem in two directions: instead of the compact interval [*a*,*b*], an arbitrary compact Hausdorff space *K* is considered, and instead of the algebra of polynomial functions, approximation with elements from more general subalgebras of C(*K*) is investigated.

Table of contents |

2 Stone-Weierstrass theorem, real version 3 Stone-Weierstrass theorem, complex version 4 Stone-Weierstrass theorem, lattice version |

The statement of Weierstrass's theorem is as follows:

- Suppose
*f*is a continuous real-valued function defined on the interval [*a*,*b*]. For every ε>0, there exists a polynomial function*p*with real coefficients such that for all*x*in [*a*,*b*], we have |*f*(*x*) -*p*(*x*)| < ε.

As a consequence of the Weierstrass approximation theorem, one can show that the space C[*a*,*b*] is separable: the polynomial functions are dense, and each polynomial function can be uniformly approximated by one with rational coefficients; there are only countably many polynomials with rational coefficients.

The set C[*a*,*b*] of continuous real-valued functions on [*a*,*b*], together with the supremum norm ||*f*|| = sup_{x in [a,b]} |*f*(*x*)|, is a Banach algebra, (i.e. an associative algebra and a Banach space such that ||*fg*|| ≤ ||*f*|| ||*g*|| for all *f*, *g*). The set of all polynomial functions forms a subalgebra of C[*a*,*b*], and the content of the Weierstrass approximation theorem is that this subalgebra is dense in C[*a*,*b*].

Stone starts with an arbitrary compact Hausdorff space *K* and considers the algebra C(*K*,**R**) of real-valued continuous functions on *K*, with the topology of uniform convergence. He wants to find subalgebras of C(*K*,**R**) which are dense.
It turns out that the crucial property that a subalgebra must satisfy is that it *separates points*: A set *A* of functions defined on *K* is said to separate points if, for every two different points *x* and *y* in *X* there exists a function *p* in *A* with *p*(*x*) not equal to *p*(*y*).

The statement of Stone-Weierstrass is:

- Suppose
*K*is a compact Hausdorff space and*A*is a subalgebra of C(*K*,**R**) which contains a non-zero constant function. Then*A*is dense in C(*K*,**R**) if and only if it separates points.

- If
*f*is a continuous real-valued function defined on the set [*a*,*b*] x [*c*,*d*] and ε>0, then there exists a polynomial function*p*in two variables such that |*f*(*x*,*y*) -*p*(*x*,*y*)| < ε for all*x*in [*a*,*b*] and*y*in [*c*,*d*]. - If
*X*and*Y*are two compact Hausdorff spaces and*f*:*X*x*Y*`->`**R**is a continuous function, then for every ε>0 there exist*n*>0 and continuous functions*f*,_{1}*f*, ...,_{2}*f*on_{n}*X*and continuous functions*g*,_{1}*g*, ...,_{2}*g*on_{n}*Y*such that ||*f*- ∑*f*|| < ε_{i}g_{i}

Slightly more general is the following theorem, where we consider the algebra C(*K*,**C**) of complex-valued continuous functions on the compact space *K*, again with the topology of uniform convergence. This is a C*-algebra with the *-operation given by pointwise complex conjugation.

- Let
*K*be a compact Hausdorff space and let*S*be a subset of C(*K*,**C**) which separates points. Then the complex unital *-algebra generated by*S*is dense in C(*K*,**C**).

This theorem implies the real version, because if a sequence of complex-valued functions uniformly approximate a given function *f*, then the real parts of those functions uniformly approximate the real part of *f*.

Let *K* be a compact Hausdorff space. A subset *L* of C(*K*,**R**) is called a lattice if for any two elements *f*, *g* in *L*, the functions max(*f*,*g*) and min(*f*,*g*) also belong to *L*. The lattice version of the Stone-Weierstrass theorem states:

- Suppose
*K*is a compact Hausdorff space with at least two points and*L*is a lattice in C(*K*,**R**) with the property that for any two distinct elements*x*and*y*of*K*and any two real numbers*a*and*b*there exists an element*f*in*L*with*f*(*x*) =*a*and*f*(*y*) =*b*. Then*L*is dense in C(*X*).

More precise information is available: