Let XX be a set. The set of bounded functions on X,X, written B(X),B(X), is the set of functions f:X→Rf:X\rightarrow\mathbb{R} with sup⁡x∈X∣f(x)∣<∞.\sup_{x\in X}\lvert f(x)\rvert<\infty. The set B(X)B(X) is a vector space under pointwise addition and scalar multiplication.

Let XX be a set and f∈B(X).f\in B(X). The supremum norm of ff is the supremum of its absolute values.

∥f∥∞:=sup⁡x∈X∣f(x)∣\lVert f\rVert_\infty:=\sup_{x\in X}\lvert f(x)\rvert

The supremum norm satisfies the norm axioms, so B(X)B(X) is a normed vector space with the induced metric d∞(f,g)=∥f−g∥∞.d_\infty(f,g)=\lVert f-g\rVert_\infty. A sequence in B(X)B(X) converges in this metric if and only if it converges uniformly on X,X, so convergence in the supremum norm is also called uniform convergence. The topology of uniform convergence is the metric topology induced by the supremum norm. Pointwise convergence is not induced by any metric on B(X)B(X) when XX is uncountable.

Let XX be a topological space. The set of continuous functions on X,X, written C(X),C(X), is the set of continuous functions f:X→R,f:X\rightarrow\mathbb{R}, which is a vector space. If XX is compact then every continuous function on XX is bounded, so C(X)⊆B(X)C(X)\subseteq B(X) is a normed vector space under the supremum norm. For a closed bounded interval this space is written C[a,b].C[a,b].

Let XX be a topological space. The set of bounded continuous functions on XX is Cb(X):=C(X)∩B(X),C_b(X):=C(X)\cap B(X), which is used in place of C(X)C(X) when XX is not compact.

Function spaces have the following properties:

  • B(X)B(X) is complete, since a Cauchy sequence in the supremum norm is a Cauchy sequence at every point and so converges pointwise to a function, which is bounded and is the uniform limit of the sequence;
  • Cb(X)C_b(X) is a closed subset of B(X),B(X), since the uniform limit of continuous functions is continuous, and is therefore complete;
  • C(X)C(X) is a Banach space for every compact space X,X, and in particular C[a,b]C[a,b] is a Banach space;
  • the supremum norm on C[a,b]C[a,b] is not induced by an inner product;
  • C[a,b]C[a,b] with the norm ∥f∥2:=(∫abf(x)2 dx)12,\lVert f\rVert_2:=\left(\int_a^b f(x)^2\,dx\right)^{\frac{1}{2}}, which is induced by the inner product ⟨f,g⟩:=∫abf(x) g(x) dx,\langle f,g\rangle:=\int_a^b f(x)\,g(x)\,dx, is not complete.

The Banach space C[a,b]C[a,b] is the setting in which the contraction mapping theorem produces solutions of equations whose unknown is a function.

Let f:[a,b]→Rf:\left[a,b\right]\rightarrow\mathbb{R} be continuous. The Weierstrass approximation theorem states that for every ε>0\varepsilon>0 there is a polynomial pp with ∥f−p∥∞≤ε.\lVert f-p\rVert_\infty\leq\varepsilon. Equivalently, the polynomials are dense in C[a,b].C[a,b].

Let f:[0,1]→Rf:\left[0,1\right]\rightarrow\mathbb{R} be continuous and n∈N.n\in\mathbb{N}. The Bernstein polynomial of degree nn of ff is the polynomial

Bnf(x):=∑k=0nf(kn)n!k!(n−k)!xk(1−x)n−k.B_n f(x):=\sum_{k=0}^{n}f\left(\frac{k}{n}\right)\frac{n!}{k!\left(n-k\right)!}x^k\left(1-x\right)^{n-k}.

The Bernstein polynomials of ff converge uniformly to ff on [0,1],\left[0,1\right], which proves the Weierstrass approximation theorem constructively. The approximating polynomials are not Taylor polynomials, and ff need not be differentiable. Since the polynomials with rational coefficients are countable and dense in the polynomials, C[a,b]C[a,b] has a countable dense subset.

Let XX be a compact Hausdorff space and A⊆C(X).\mathcal{A}\subseteq C(X). The set A\mathcal{A} is a subalgebra of C(X)C(X) if and only if it is a vector subspace that is closed under pointwise multiplication. The set A\mathcal{A} separates points if and only if for any two distinct points x,y∈Xx,y\in X there exists f∈Af\in\mathcal{A} with f(x)≠f(y).f(x)\neq f(y).

Let XX be a compact Hausdorff space and A\mathcal{A} be a subalgebra of C(X)C(X) that contains the constant functions and separates points. The Stone–Weierstrass theorem states that A\mathcal{A} is dense in C(X).C(X). The Stone–Weierstrass theorem has the following consequences:

  • the polynomials on [a,b]\left[a,b\right] form such a subalgebra, since x↦xx\mapsto x separates points, which recovers the Weierstrass approximation theorem;
  • the polynomials in nn variables are dense in C(K)C(K) for any compact K⊆Rn;K\subseteq\mathbb{R}^n;
  • the trigonometric polynomials x↦a0+∑k=1n(akcos⁡kx+bksin⁡kx)x\mapsto a_0+\sum_{k=1}^{n}\left(a_k\cos kx+b_k\sin kx\right) are dense in the continuous functions on [−π,π]\left[-\pi,\pi\right] with f(−π)=f(π),f\left(-\pi\right)=f\left(\pi\right), since they separate the points of the unit circle;
  • the theorem holds for complex-valued functions provided that the subalgebra is also closed under complex conjugation.