Approximate x by least squares and watch the theorem decide: the dense basis {1,x,…,xN} (λn=n, ∑n1=∞) shrinks its error 0.1003→0.0708→0.0544, while the sparse basis {1,x,x4,…,xN2} (∑n21=6π2<∞) stays stuck near 0.16.
span{1,xλ1,xλ2,…} dense in C[0,1]⟺n∑λn1=∞
N=4,6,8:∥pdense−⋅∥∞=0.1003→0.0708→0.0544
Examples & Exercises
Prove ∑n≥1n21=6π2<∞, and deduce from the necessity direction of the Müntz–Szász theorem that span{1,x,x4,x9,…} is not dense in C[0,1]. The proof of the necessity direction itself is marked as an idea-level sketch.
π1∫−ππx2dx=k=1∑∞2bk2,bk=k2(−1)k+1
n=1∑∞n21=6π2<∞⇒span{1,xn2} not dense
N=6: the sparse-basis error ≈0.1676 stays stuck near 0.16 — the proof below is why this stall was inevitable.Show proof
First compute ∑1/n2=π2/6 (complete proof). Take f(x)=x as an odd function on (−π,π); integration by parts gives its sine coefficients bk=π1∫−ππxsin(kx)dx=k2(−1)k+1. Parseval's identity says π1∫−ππx2dx=∑k=1∞2bk2; the left side is 32π2, so 32π2=2∑k=1∞k21, i.e. ∑k=1∞k21=6π2≈1.6449<∞.
Now quote the necessity direction of the Müntz–Szász theorem: if ∑λn1<∞ then span{1,xλ1,xλ2,…} is not dense in C[0,1]. [Sketch marker: the full proof of this direction needs complex analysis — convergence of ∑1/λn makes a Blaschke-type infinite product converge, producing a nonzero analytic function orthogonal (in a weighted L2 inner product) to every xλn; Hahn–Banach then separates a continuous function at fixed positive distance from the span. We use only the conclusion here.] For λn=n2 we have ∑λn1=6π2<∞, so span{1,x,x4,x9,…} is not dense in C[0,1] — which is why the sparse basis in the scene stays stuck at error ≈0.16.
Prove that every uniform limit of even polynomials on [−1,1] is an even function (complete proof), and conclude that span{1,x2,x4,…} is not dense in C[−1,1] — a warm-up done directly, without quoting Müntz–Szász.
f(x)=n→∞limpn(x)=n→∞limpn(−x)=f(−x)
g(x)=x∈C[−1,1] is not even⇒span{x2k} not dense
N=6: the dense basis closes in on x to error ≈0.0708 — with all polynomials available (unlike even degrees only), every continuous function is reachable.Show proof
Let pn be even polynomials with pn→f uniformly on [−1,1]. Uniform convergence implies pointwise convergence, so f(x)=limn→∞pn(x) for each x∈[−1,1]. Each pn is even, so pn(x)=pn(−x), and hence f(x)=limn→∞pn(x)=limn→∞pn(−x)=f(−x). So f is even — a uniform limit of even polynomials is always even. (End of proof.)
g(x)=x is continuous on [−1,1] but not even. If span{1,x2,x4,…} were dense in C[−1,1], some sequence of even polynomials would converge uniformly to g, and by what we just proved the limit g would have to be even — a contradiction. Hence span{1,x2,x4,…} is not dense in C[−1,1]. (Note: this is a C[−1,1] statement, distinct from the scene's sparse basis {1,x,x4,…} on C[0,1] — the non-density of the latter is the job of the Müntz–Szász necessity direction in the first problem.)
For λn=n, show ∑n1=∞ and prove directly — via the Weierstrass approximation theorem, without quoting the sufficiency direction of Müntz–Szász — that span{1,x,x2,…} is dense in C[0,1]. Concretely, check x2∈span{1,x,…,xN} for N≥2, and read off the numbers with which the scene's dense basis closes in on x.
Hn=k=1∑nk1>∫1n+1xdx=ln(n+1)→∞
span{1,x,x2,…}=all polynomials
all polynomialsWeierstrassdense in C[0,1]
N=8: dense-basis error ≈0.0544 — down from 0.1003 at N=4 and 0.0708 at N=6. A basis with ∑n1=∞ never stalls.Show proof
The harmonic series diverges: for Hn=∑k=1nk1, each term satisfies k1≥∫kk+1xdx, so Hn≥∫1n+1xdx=ln(n+1)→∞. Hence for λn=n we have ∑λn1=∞. (Numerical witness: H1000≈7.4855>ln(1001)≈6.9088.)
For λn=n, span{1,x,x2,…} is exactly the set of all (real-coefficient) polynomials — xk is itself the k-th basis element, so every polynomial of degree at most d is a linear combination of the first d+1 basis elements. By the Weierstrass approximation theorem, polynomials are uniformly dense in C[0,1], so this span is dense too. No need to quote the sufficiency direction of Müntz–Szász at all — Weierstrass handles this case directly.
Concrete check: for N≥2, x2 is itself a basis element, so it trivially lies in span{1,x,…,xN} — exact membership, not approximation. The scene shows this density working in practice even on a function with a cusp like x: the dense basis's least-squares error shrinks 0.1003→0.0708→0.0544 for N=4,6,8. (End of proof.)