From Local Patches to a Uniform Approximation
The previous tutorial developed the ingredients behind the Stone-Weierstrass argument. A unital algebra that separates points can interpolate a continuous target at two chosen points, and its uniform closure is closed under maxima and minima. Compactness then gives a one-sided patch at a fixed point. The remaining task is to combine patches based at different points so that the resulting function is close to the target everywhere.
Throughout, let \(K\) be a nonempty compact subset of \(\mathbb{R}\), and let \(A\) be a unital subalgebra of \(C(K)\) that separates points. Write \(\overline{A}\) for its closure in the supremum norm. We use the One-Sided Patching at a Fixed Point Theorem from the previous tutorial: for \(f\in C(K)\), \(x\in K\), and \(\delta>0\), there is an \(h_x\in\overline{A}\) such that \(h_x(x)=f(x)\) and \(h_x(z)<f(z)+\delta\) for every \(z\in K\).
Proof. Fix \(f\in C(K)\) and \(\varepsilon>0\), and put \(\delta=\varepsilon/3\). For each \(x\in K\), apply the one-sided patching theorem to obtain \(h_x\in\overline{A}\) with \(h_x(x)=f(x)\) and \(h_x(z)<f(z)+\delta\) for every \(z\in K\).
The function \(h_x-f\) is continuous and has value zero at \(x\). Therefore the set
is open relative to \(K\) and contains \(x\). The sets \(U_x\), as \(x\) varies over \(K\), form an open cover. Compactness supplies a finite subcover \(U_{x_1},\ldots,U_{x_m}\). Define
Each \(h_{x_i}\) belongs to \(\overline{A}\), and the uniform closure is closed under finite maxima by the Absolute Values in the Uniform Closure Theorem from the previous tutorial. Hence \(g\in\overline{A}\). For any \(z\in K\), the upper bound for each patch gives
Because the sets \(U_{x_i}\) cover \(K\), there is at least one index \(i\) for which \(z\in U_{x_i}\). For that index, \(h_{x_i}(z)>f(z)-\delta\), so
Together these inequalities show \(|g(z)-f(z)|<\delta\) at every \(z\in K\), and therefore \(\|g-f\|_\infty\leq\delta\). Since \(g\in\overline{A}\), choose \(a\in A\) with \(\|a-g\|_\infty<\delta\). The triangle inequality now yields
Thus every continuous \(f\) can be approximated uniformly to any prescribed positive accuracy by an element of \(A\). This is exactly density of \(A\) in \(C(K)\). \(\square\)
Polynomial Restrictions on Compact Sets
The theorem immediately gives a useful conclusion beyond approximation on an interval. If \(K\) is any nonempty compact subset of the real line, a polynomial can be restricted to \(K\), even when \(K\) has gaps or consists of isolated points. These restrictions still have enough algebraic flexibility to approximate every continuous function on \(K\).
Proof. Let \(A\) be the set of restrictions to \(K\) of real polynomials. Sums, scalar multiples, and products of polynomial restrictions are again polynomial restrictions, so \(A\) is a subalgebra of \(C(K)\). Constant polynomials show that \(A\) is unital. If \(x,y\in K\) and \(x\neq y\), the polynomial \(p(t)=t\) satisfies \(p(x)=x\neq y=p(y)\); thus \(A\) separates points. The Real Stone-Weierstrass Theorem applies and gives the claimed density. \(\square\)
Worked Example: Approximating on a Set with a Gap
Let \(K=[-2,-1]\cup[1,3]\), and define \(f:K\to\mathbb{R}\) by \(f(x)=|x|\). The two intervals are separated, but their union is compact, and \(f\) is continuous on \(K\). Polynomial restrictions form a unital algebra that separates any distinct points of \(K\). The corollary therefore guarantees that for every \(\varepsilon>0\), a polynomial \(p\) exists with
This conclusion concerns both components at once: one polynomial works uniformly on the entire union. The theorem guarantees existence, but does not identify its coefficients or provide an estimate for the degree needed to achieve a given error.
Other Algebras Can Be Dense Too
Polynomials are a familiar example, but the theorem is about algebraic structure rather than a particular formula. A smaller-looking collection of functions can still be dense if it contains constants and can distinguish every pair of points. The next example uses polynomials in the square of the coordinate function.
Worked Example: An Algebra Generated by the Square Function
On \(K=[0,1]\), consider the algebra \(A=\{x\mapsto q(x^2):q\text{ is a real polynomial}\}\). It contains the constant functions and is closed under addition, scalar multiplication, and multiplication. If \(x,y\in[0,1]\) and \(x\neq y\), then
because \(x+y>0\) when \(x\neq y\) in this interval. Thus \(A\) separates points, so Stone-Weierstrass says it is dense in \(C[0,1]\). In particular, the continuous function \(f(x)=\sqrt{x}\) can be uniformly approximated by functions \(q(x^2)\). For every \(\varepsilon>0\), some polynomial \(q\) satisfies
The crucial fact is that squaring is one-to-one on \([0,1]\). The same expression \(q(x^2)\) would not distinguish \(x\) from \(-x\) on a symmetric interval.
Why Point Separation Matters
The hypotheses are sufficient conditions, not decoration. In particular, if two different points always receive the same value from every member of an algebra, then no uniform limit of its members can distinguish those points either. A continuous target that does distinguish them cannot be uniformly approximated arbitrarily well. The next example quantifies this obstruction.
Worked Example: A Nonseparating Algebra Cannot Approximate the Coordinate Function
On \(K=[-1,1]\), let \(A=\{x\mapsto q(x^2):q\text{ is a real polynomial}\}\). This is a unital subalgebra, but each \(g\in A\) satisfies \(g(-1)=g(1)\), so it does not separate the points \(-1\) and \(1\). Consider the target \(f(x)=x\). If \(c=g(-1)=g(1)\), then
At least one of the two terms must consequently be at least \(1\), and therefore
No element of this algebra can approximate the coordinate function with uniform error less than \(1\). The failure is not a shortage of polynomial degrees; every function in the algebra identifies the two endpoints, while the target assigns them different values.
What the Theorem Does—and Does Not—Promise
The proof separates the roles of the assumptions. Point separation enables two-point interpolation. The algebra operations and the Weierstrass Approximation Theorem supply maxima and minima in the uniform closure. Continuity turns equality at a point into a useful local inequality, and compactness reduces the resulting neighborhoods to a finite collection. The finite maximum combines the lower bounds from those neighborhoods without losing the upper bound that each patch already satisfies everywhere.
The conclusion is qualitative: for each target and each positive error, at least one algebra element achieves that error. It does not give an explicit approximant, a degree bound, or a rate of convergence. Those questions require additional information about the target and the algebra. Also, the result here concerns real-valued continuous functions and real subalgebras; hypotheses for approximation by complex-valued algebras require separate care.
Check Your Understanding
Use the theorem and its proof to answer the following questions.
- Where does point separation enter the hypotheses of the one-sided patching result used in the proof?
- Why does the proof take a finite subcover before forming the maximum of the patches?
- How does the finite maximum preserve both the lower and upper estimates for the target?
- Why do polynomial restrictions separate points of every subset of the real line?
- Why can no function in the even algebra on \([-1,1]\) approximate \(f(x)=x\) with error less than \(1\)?