Skip to main content

Section 5.1 The Weierstrass Approximation Theorem

The following is one of the statements that we want to prove in this chapter.
Figure 5.1. Consider the function \(f \in C^0([-1,1])\) defined by \(f(x)=\abs x\) for \(x \in [-1,1]\text{.}\) Since \(f\) is not differentiable at \(0\text{,}\) it does not have a Taylor series there. Nevertheless, in Lemma 5.16 below, we find an explicit sequence of polynomials \(p_n \in C^0([-1,1])\) such that \(\n{p_n - f}_{\sup} \to 0\) as \(n \to \infty\text{.}\) Theorem 5.1 guarantees that such a sequence \((p_n)_{n \in \N}\) exists for any \(f \in C^0([-1,1])\text{,}\) although it does not tell us how to actually compute this sequence.
One consequence of the theorem is the following.
A related result makes a similar statement about the approximation of continuous \(2\pi\)-periodic functions with trigonometric polynomials.

Definition 5.3.

Let \(T \gt 0\text{.}\) A function \(f \maps \R \to \R\) is called \(T\)-periodic if \(f(x + T) = f(x)\) for all \(x \in \R\text{.}\)

Definition 5.4.

A trigonometric polynomial of degree \(n\) is an expression of the form
\begin{equation*} a_0 + \sum_{k = 1}^n \big(a_k \cos(kx) + b_k \sin(kx)\big) \end{equation*}
with \(a_0, \dotsc, a_n, b_1, \dotsc, b_n \in \R\) where \(a_n\) and \(b_n\) are not both zero.
We will prove not only these results, but also an elegant and powerful generalisation due to M. H. Stone, which is given in the next section.

Exercises Exercises

1. (PS10) \(C^0([a,b])\) is separable.

Let \(P=P([a,b]) \subset C^0([a,b])\) be the subset of polynomials with real coefficients, and let \(Q \subset P\) be the analogous set of polynomials with rational coefficients.
(a)
Show that \(Q\) is a dense subset of \(P\) when the latter set is equipped with the \(\n\blank_{C^0([a,b])}\) norm.
Hint.
This is relatively big hint. Let \(p \in P\text{,}\) say
\begin{equation*} p(x) = \alpha_0 + \alpha_1 x + \cdots + \alpha_M x^M \end{equation*}
for some \(M \in \N\) and coefficients \(\alpha_0,\ldots,\alpha_M \in \R\text{.}\) Argue that we can find a sequence \(\seq qn\) in \(Q\) of polynomials of the form
\begin{gather*} q_n(x) = \beta_0^{(n)} + \beta_1^{(n)} x + \cdots + \beta_M^{(n)} x^M \end{gather*}
whose coefficients converge to the coefficients of \(p\text{,}\) i.e. \(\beta_m^{(n)} \to \alpha_m\) as \(n \to \infty\) for all \(m \in \{1,\ldots,M\}\text{.}\) Then show that this implies \(q_n \to p\) in \(C^0([a,b])\text{.}\)
(c)
Show that \(Q\) is countable. Conclude that \(C^0([a,b])\) is separable.
Hint 1.
This is probably the most sophisticated cardinality argument in the entire unit, and so if you are pressed for time you may just want to skip it and wait for the solutions. On the other hand it is doable with only the tools in Section 1.8; see the next hint.
Hint 2.
Let \(Q_n\) denote the set of polynomials in \(Q\) of degree \(\le n\text{.}\) First argue that \(Q_n\) is countable by appealing to Lemma 1.70. Then notice that \(Q = \bigcup_{n\in\N} Q_n\) and appeal to Lemma 1.72.

2. Trigonometric polynomials dense in \(L^2([a,b])\).

Let \(A \subset C^0([0, 2\pi])\) denote the subset of all continuous functions \(f \maps [0, 2\pi] \to \R\) with \(f(0) = f(2\pi)\text{.}\) Let \(T \subset A\) denote the further subset of all trigonometric polynomials (Definition 5.4).
(a)
Show that \(A\) is dense in \(\big(C^0([0,2\pi]),\scp\blank\blank_{L^2(0, 2\pi)}\big)\text{.}\) Conclude that \(A\) is dense in \(L^2(0,2\pi)\text{.}\)
Hint.
Fix \(f \in C^0([0,2\pi])\text{.}\) Now let \(f_n\) be a continuous function obtained by replacing the graph of \(f\) for \(x \in [0,1/n]\) with a straight line segment in such a way that \(f_n \in A\text{.}\) Estimate \(\n{f-f_n}_{L^2(0,2\pi)}^2\text{,}\) and show that it tends to \(0\) as \(n \to \infty\text{.}\)
(b)
Show that \(T\) is dense in \(\big(A,\scp\blank\blank_{L^2(0,2\pi)}\big)\text{.}\) Conclude that \(T\) is dense in \(L^2(0,2\pi)\text{.}\)
Hint.
Given \(f \in A\text{,}\) extend it to \(2\pi\)-periodic continuous function \(\tilde f \maps \R \to \R\) and apply Theorem 5.5 to find a trigonometric polynomial \(p \in T\) which is close to \(f\) in terms of \(\n\blank_{\sup}\text{.}\) Now use this to estimate \(\n{f-p}_{L^2(0,2\pi)}\text{.}\) Finally, tie things together by applying the previous part.