Skip to content
Date: Oct 2, 2026
Builds on Chapter 5 and Chapter 6.

Which straight line \(a+bx\) best approximates \(e^x\) on \([0,1]\) ? The answer depends on how error is measured. If it is the largest deviation, the problem lives in \(C[0,1]\) with the supremum norm, and Chapter 3 showed how such problems are solved: guess an approximant, then certify it with a cleverly chosen functional. If instead the error is the mean square \(\int_0^1\lvert e^x-a-bx\rvert^2\,dx\) , the problem can be solved by a formula. One computes two integrals, and the best line is \((4e-10)+(18-6e)x\) . No guessing and no certificate are required.

The difference is that the mean-square norm comes from an inner product, and an inner product brings with it the notion of perpendicularity. The best approximation from a subspace is the foot of the perpendicular, exactly as in Euclidean geometry, and perpendicularity is a linear condition that can be solved. This chapter develops that geometry in infinite dimensions. Its central result, the projection theorem, gives every closed convex set a unique nearest point and every closed subspace a complement, two things that Chapters 5 and 6 showed to be false or delicate in general Banach spaces. Its proof needs neither the Hahn–Banach theorem nor weak compactness, only one identity satisfied by the norm.

7.1 Inner products and the parallelogram law

Definition 7.1 (inner product, Hilbert space). An inner product on a vector space \(H\) over \(\mathbb K\) is a function \(\langle\cdot,\cdot\rangle:H\times H\to\mathbb K\) such that for all \(x,y,z\in H\) and \(\alpha,\beta\in\mathbb K\) :

\[ \langle\alpha x+\beta y,z\rangle=\alpha\langle x,z\rangle+\beta\langle y,z\rangle,\qquad\langle y,x\rangle=\overline{\langle x,y\rangle},\qquad\langle x,x\rangle>0\ \text{for}\ x\ne 0 . \]

The associated norm is \(\lVert x\rVert=\sqrt{\langle x,x\rangle}\) . A Hilbert space is an inner product space that is complete for this norm.

The first two conditions make the inner product conjugate-linear in its second argument: \(\langle x,\alpha y\rangle=\overline\alpha\langle x,y\rangle\) . The standard examples are \(\mathbb K^n\) and \(\ell^2\) with \(\langle x,y\rangle=\sum_kx_k\overline{y_k}\) , and \(L^2\) of a measure space with \(\langle f,g\rangle=\int f\,\overline g\) ; these are complete by Theorem 1.3 and by the completeness of \(L^p\) quoted there. The same integral makes \(C[0,1]\) an inner product space, but not a Hilbert space, since the norm is then \(\lVert\cdot\rVert_2\) and the space is incomplete by the argument of Example 1.2. That \(\lVert\cdot\rVert\) is in fact a norm follows from the first theorem.

Theorem 7.2 (Cauchy–Schwarz inequality). In an inner product space, \(\lvert\langle x,y\rangle\rvert\le\lVert x\rVert\lVert y\rVert\) for all \(x,y\) , and consequently \(\lVert x+y\rVert\le\lVert x\rVert+\lVert y\rVert\) .

Proof. If \(y=0\) both sides vanish. Otherwise put \(t=\langle x,y\rangle/\lVert y\rVert^2\) and expand:

\[ 0\le\lVert x-ty\rVert^2=\lVert x\rVert^2-2\operatorname{Re}\bigl(\overline t\langle x,y\rangle\bigr)+\lvert t\rvert^2\lVert y\rVert^2=\lVert x\rVert^2-\frac{\lvert\langle x,y\rangle\rvert^2}{\lVert y\rVert^2} . \]

For the triangle inequality, \(\lVert x+y\rVert^2=\lVert x\rVert^2+2\operatorname{Re}\langle x,y\rangle+\lVert y\rVert^2\le(\lVert x\rVert+\lVert y\rVert)^2\) .

The inequality shows that the inner product is continuous in both variables: if \(x_n\to x\) and \(y_n\to y\) then \(\langle x_n,y_n\rangle\to\langle x,y\rangle\) . The choice of \(t\) in the proof is not a trick. The vector \(ty\) is the point of the line through \(y\) nearest to \(x\) , and the inequality says that the distance from \(x\) to that line is real.

Expanding \(\lVert x\pm y\rVert^2\) and adding gives the parallelogram law

\[ \lVert x+y\rVert^2+\lVert x-y\rVert^2=2\lVert x\rVert^2+2\lVert y\rVert^2 , \]

the sum of the squares of the diagonals of a parallelogram equals the sum of the squares of its sides. Subtracting instead recovers the inner product from the norm, the polarization identity: \(\langle x,y\rangle=\tfrac14(\lVert x+y\rVert^2-\lVert x-y\rVert^2)\) in a real space, with the additional term \(\tfrac i4(\lVert x+iy\rVert^2-\lVert x-iy\rVert^2)\) in a complex one. A theorem of Jordan and von Neumann, which we shall not need, states that conversely a norm satisfying the parallelogram law arises from an inner product. So the law is a test for whether a given Banach space is secretly a Hilbert space.

Example 7.1: Norms that fail the parallelogram law

In \(\mathbb R^2\) with the norm \(\lVert\cdot\rVert_p\) take \(x=e_1\) and \(y=e_2\) . Then \(\lVert x+y\rVert_p=\lVert x-y\rVert_p=2^{1/p}\) , so the left side of the parallelogram law is \(2\cdot 2^{2/p}\) , while the right side is \(2+2=4\) . They agree only if \(2^{2/p}=2\) , that is, \(p=2\) . For \(p=1\) the left side is \(8\) ; for \(p=\infty\) it is \(2\) . The same two vectors, placed in the first two coordinates, show that \(\ell^p\) is not an inner product space for \(p\ne 2\) .

In \(C[0,1]\) with the supremum norm take \(f=1\) and \(g(x)=x\) . Then \(\lVert f+g\rVert_\infty=2\) and \(\lVert f-g\rVert_\infty=1\) , so the left side is \(4+1=5\) , and the right side is \(2\cdot 1+2\cdot 1=4\) . None of these norms comes from an inner product. In each case what fails is the roundness of the unit ball that Figure 1.1 displayed: the ball for \(p=1\) is too pointed and the ball for \(p=\infty\) too square.

7.2 The nearest point of a closed convex set

Theorem 7.3 (projection onto a closed convex set). Let \(K\) be a nonempty closed convex subset of a Hilbert space \(H\) and let \(x\in H\) . Then there is exactly one point \(P_Kx\in K\) with

\[ \lVert x-P_Kx\rVert=\operatorname{dist}(x,K)=\inf_{k\in K}\lVert x-k\rVert . \]

A point \(z\in K\) equals \(P_Kx\) if and only if \(\operatorname{Re}\langle x-z,k-z\rangle\le 0\) for every \(k\in K\) . The map \(P_K\) satisfies \(\lVert P_Kx-P_Ky\rVert\le\lVert x-y\rVert\) .

Proof. Existence. Let \(d=\operatorname{dist}(x,K)\) and choose \(k_n\in K\) with \(\lVert x-k_n\rVert\to d\) . Apply the parallelogram law to the vectors \(k_n-x\) and \(k_m-x\) :

\[ \lVert k_n-k_m\rVert^2=2\lVert k_n-x\rVert^2+2\lVert k_m-x\rVert^2-4\Bigl\lVert\frac{k_n+k_m}{2}-x\Bigr\rVert^2 . \]

By convexity the midpoint \(\tfrac12(k_n+k_m)\) lies in \(K\) , so the last norm is at least \(d\) , and

\[ \lVert k_n-k_m\rVert^2\le 2\lVert k_n-x\rVert^2+2\lVert k_m-x\rVert^2-4d^2\longrightarrow 0 . \]

Thus \((k_n)\) is Cauchy. It converges because \(H\) is complete, its limit \(z\) lies in \(K\) because \(K\) is closed, and \(\lVert x-z\rVert=d\) by continuity of the norm.

Uniqueness. If \(z\) and \(z'\) both attain the distance, the same identity with \(k_n=z\) and \(k_m=z'\) gives \(\lVert z-z'\rVert^2\le 2d^2+2d^2-4d^2=0\) .

Characterisation. Let \(z=P_Kx\) and \(k\in K\) . For \(0<t\le 1\) the point \(z+t(k-z)\) is in \(K\) , so \(\lVert x-z-t(k-z)\rVert^2\ge\lVert x-z\rVert^2\) , which expands to \(-2t\operatorname{Re}\langle x-z,k-z\rangle+t^2\lVert k-z\rVert^2\ge 0\) . Divide by \(t\) and let \(t\to 0\) . Conversely, if \(z\in K\) satisfies the inequality, then for every \(k\in K\) ,

\[ \lVert x-k\rVert^2=\lVert x-z\rVert^2-2\operatorname{Re}\langle x-z,k-z\rangle+\lVert k-z\rVert^2\ge\lVert x-z\rVert^2 . \]

Nonexpansiveness. Write \(u=P_Kx\) , \(v=P_Ky\) . The characterisation gives \(\operatorname{Re}\langle x-u,v-u\rangle\le 0\) and \(\operatorname{Re}\langle y-v,u-v\rangle\le 0\) . Adding, \(\operatorname{Re}\langle(x-y)-(u-v),v-u\rangle\le 0\) , that is, \(\lVert u-v\rVert^2\le\operatorname{Re}\langle x-y,u-v\rangle\le\lVert x-y\rVert\lVert u-v\rVert\) .

The inequality \(\operatorname{Re}\langle x-z,k-z\rangle\le 0\) says that, seen from the nearest point \(z\) , the direction to \(x\) makes an obtuse angle with the direction to every other point of \(K\) . It is called the variational inequality for the projection. The proof should be compared with that of Theorem 6.11, which gave existence of a nearest point in any reflexive space through weak compactness. Here the parallelogram law does more with less: it makes a minimizing sequence converge in norm, and it gives uniqueness in the same stroke.

Example 7.2: Projecting onto a ball and onto a cone

In \(\mathbb R^3\) with the Euclidean inner product let \(x=(3,-4,12)\) , so \(\lVert x\rVert=13\) .

The closed unit ball. The nearest point is \(z=x/\lVert x\rVert=\tfrac1{13}(3,-4,12)\) , at distance \(13-1=12\) . To confirm it with the variational inequality, note \(x-z=12z\) , and for \(\lVert k\rVert\le 1\) we have \(\langle 12z,k-z\rangle=12(\langle z,k\rangle-1)\le 12(\lVert k\rVert-1)\le 0\) .

The cone of vectors with nonnegative coordinates. This set \(K_+\) is closed and convex. The candidate is obtained by replacing each negative coordinate by \(0\) : \(z=(3,0,12)\) . Then \(x-z=(0,-4,0)\) , and for \(k\in K_+\) ,

\[ \langle x-z,k-z\rangle=-4(k_2-0)=-4k_2\le 0 . \]

So \(P_{K_+}x=(3,0,12)\) and the distance is \(4\) . The same recipe works in real \(\ell^2\) : the projection onto the cone of nonnegative sequences takes positive parts coordinate by coordinate. In neither case was a minimization carried out; a candidate was proposed and the inequality verified it.

Example 7.3: What fails outside Hilbert space

Each hypothesis of Theorem 7.3 can be tested by removing it. Keep closedness and convexity but replace the Euclidean norm on \(\mathbb R^2\) by \(\lVert\cdot\rVert_\infty\) , and let \(K\) be the closed half-plane \(\{x:x_1\le 0\}\) and \(x=(1,0)\) . Every point of \(K\) is at distance at least \(1\) from \(x\) in the first coordinate, and the points \((0,t)\) with \(\lvert t\rvert\le 1\) are all at distance exactly \(\max\{1,\lvert t\rvert\}=1\) . The nearest point exists and is far from unique: a whole segment of length \(2\) consists of nearest points. Uniqueness used the parallelogram law, which this norm does not satisfy.

Existence can fail too. In \(C[0,1]\) , Example 6.6 produced a closed convex set with no point nearest to the origin. And in a Hilbert space, a convex set that is not closed need not contain a nearest point: in \(\ell^2\) the subspace \(c_{00}\) has distance \(0\) from \(a=(1/k)\) and does not contain \(a\) .

7.3 Orthogonal complements

Vectors \(x,y\) in an inner product space are orthogonal, written \(x\perp y\) , if \(\langle x,y\rangle=0\) . For orthogonal vectors the expansion of \(\lVert x+y\rVert^2\) reduces to the Pythagorean identity \(\lVert x+y\rVert^2=\lVert x\rVert^2+\lVert y\rVert^2\) . The orthogonal complement of a set \(A\subseteq H\) is

\[ A^\perp=\{x\in H:\langle x,a\rangle=0\ \text{for all}\ a\in A\}. \]

It is always a closed subspace, being an intersection of kernels of the continuous functionals \(x\mapsto\langle x,a\rangle\) .

Theorem 7.4 (projection theorem). Let \(M\) be a closed subspace of a Hilbert space \(H\) . Every \(x\in H\) can be written in exactly one way as

\[ x=m+n,\qquad m\in M,\quad n\in M^\perp . \]

The component \(m=P_Mx\) is the point of \(M\) nearest to \(x\) . The map \(P_M\) is linear, \(P_M^2=P_M\) , \(\langle P_Mx,y\rangle=\langle x,P_My\rangle\) for all \(x,y\) , and \(\lVert x\rVert^2=\lVert P_Mx\rVert^2+\lVert x-P_Mx\rVert^2\) ; in particular \(\lVert P_M\rVert=1\) unless \(M=\{0\}\) .

Proof. A subspace is convex, so Theorem 7.3 gives the nearest point \(z=P_Mx\) , characterised by \(\operatorname{Re}\langle x-z,k-z\rangle\le 0\) for all \(k\in M\) . For any \(m\in M\) the points \(k=z\pm m\) lie in \(M\) , so \(\pm\operatorname{Re}\langle x-z,m\rangle\le 0\) , whence \(\operatorname{Re}\langle x-z,m\rangle=0\) . In the complex case, replacing \(m\) by \(im\) gives \(\operatorname{Im}\langle x-z,m\rangle=0\) as well. Thus \(n=x-z\in M^\perp\) and \(x=z+n\) is a decomposition of the required kind. If \(x=m'+n'\) is another, then \(z-m'=n'-n\) lies in \(M\cap M^\perp\) ; a vector orthogonal to itself is \(0\) , so the decomposition is unique.

Uniqueness makes \(P_M\) linear: if \(x=m+n\) and \(x'=m'+n'\) then \(\alpha x+\beta x'=(\alpha m+\beta m')+(\alpha n+\beta n')\) is the decomposition of \(\alpha x+\beta x'\) . Clearly \(P_Mm=m\) for \(m\in M\) , so \(P_M^2=P_M\) . With \(y=m'+n'\) , \(\langle P_Mx,y\rangle=\langle m,m'+n'\rangle=\langle m,m'\rangle=\langle m+n,m'\rangle=\langle x,P_My\rangle\) . The norm identity is Pythagoras, and it shows \(\lVert P_Mx\rVert\le\lVert x\rVert\) with equality on \(M\) .

The operator \(P_M\) is the orthogonal projection onto \(M\) , and \(I-P_M\) is the orthogonal projection onto \(M^\perp\) . In \(\mathbb R^n\) this is the familiar projection that solves least-squares problems (math.linear-algebra.projection-as-best-approximation); what is new is that it exists for every closed subspace of an infinite-dimensional space.

Corollary 7.5 (double complement). For any subspace \(M\) of a Hilbert space, \((M^\perp)^\perp\) is the closure of \(M\) . In particular \(M\) is dense in \(H\) if and only if \(M^\perp=\{0\}\) .

Proof. Let \(N\) be the closure of \(M\) . By continuity of the inner product \(N^\perp=M^\perp\) . Clearly \(N\subseteq(N^\perp)^\perp\) . Conversely let \(x\in(N^\perp)^\perp\) and decompose \(x=m+n\) with \(m\in N\) , \(n\in N^\perp\) . Then \(n=x-m\) lies in \((N^\perp)^\perp\) as well as in \(N^\perp\) , so \(n\perp n\) and \(n=0\) . Hence \(x\in N\) .

Compare Theorem 7.4 with the situation in Banach spaces. There a closed subspace need not have any closed complement, and when it has one the projection can have large norm (Example 5.5). In a Hilbert space every closed subspace has a canonical complement, at a right angle, with a projection of norm \(1\) . Closedness is still indispensable: for the dense subspace \(c_{00}\) of \(\ell^2\) the complement \(c_{00}^\perp\) is \(\{0\}\) , and \(c_{00}\oplus c_{00}^\perp\) is not all of \(\ell^2\) .

Example 7.4: Projection onto a hyperplane

In \(\ell^2\) let \(a=(\tfrac12,\tfrac14,\tfrac18,\dots)\) and \(M=\{x:\langle x,a\rangle=0\}\) , a closed hyperplane. Its orthogonal complement is the line spanned by \(a\) , by Corollary 7.5. The projection onto that line is \(x\mapsto\frac{\langle x,a\rangle}{\lVert a\rVert^2}a\) , the vector \(ty\) from the proof of Theorem 7.2, so

\[ P_Mx=x-\frac{\langle x,a\rangle}{\lVert a\rVert^2}\,a,\qquad\operatorname{dist}(x,M)=\frac{\lvert\langle x,a\rangle\rvert}{\lVert a\rVert} . \]

For \(x=e_1\) we have \(\langle e_1,a\rangle=\tfrac12\) and \(\lVert a\rVert^2=\sum_k4^{-k}=\tfrac13\) , so

\[ P_Me_1=e_1-\tfrac32a=\bigl(\tfrac14,-\tfrac38,-\tfrac3{16},-\tfrac3{32},\dots\bigr),\qquad\operatorname{dist}(e_1,M)=\tfrac12\sqrt3\approx 0.866 . \]

Check by Pythagoras: \(\lVert P_Me_1\rVert^2=1-\tfrac34=\tfrac14\) , and \(\tfrac14+\tfrac34=1=\lVert e_1\rVert^2\) . The distance agrees with the value that Corollary 3.8 gives for a hyperplane in any normed space; what the Hilbert structure adds is the nearest point itself, by a formula.

7.4 Orthonormal sequences and expansions

A family of vectors is orthonormal if its members have norm \(1\) and are pairwise orthogonal. Projection onto the span of finitely many orthonormal vectors is explicit.

Proposition 7.6 (best approximation and Bessel’s inequality). Let \(e_1,\dots,e_n\) be orthonormal in an inner product space \(H\) and \(x\in H\) . For any scalars \(c_1,\dots,c_n\) ,

\[ \Bigl\lVert x-\sum_{k=1}^nc_ke_k\Bigr\rVert^2=\lVert x\rVert^2-\sum_{k=1}^n\lvert\langle x,e_k\rangle\rvert^2+\sum_{k=1}^n\lvert c_k-\langle x,e_k\rangle\rvert^2 . \]

Hence the best approximation to \(x\) from the span is \(\sum_k\langle x,e_k\rangle e_k\) , and \(\sum_{k=1}^n\lvert\langle x,e_k\rangle\rvert^2\le\lVert x\rVert^2\) . For an orthonormal sequence \((e_k)_{k\ge 1}\) the inequality \(\sum_{k=1}^\infty\lvert\langle x,e_k\rangle\rvert^2\le\lVert x\rVert^2\) holds, and in particular \(\langle x,e_k\rangle\to 0\) .

Proof. Expand the left side using orthonormality: it equals \(\lVert x\rVert^2-2\operatorname{Re}\sum_k\overline{c_k}\langle x,e_k\rangle+\sum_k\lvert c_k\rvert^2\) , and completing the square in each \(c_k\) gives the right side. The last sum is nonnegative and vanishes exactly when \(c_k=\langle x,e_k\rangle\) ; with that choice the left side is nonnegative, which is Bessel’s inequality. Let \(n\to\infty\) for a sequence.

The numbers \(\langle x,e_k\rangle\) are the Fourier coefficients of \(x\) with respect to the orthonormal family. Any linearly independent sequence \(v_1,v_2,\dots\) can be converted into an orthonormal one with the same successive spans by the Gram–Schmidt process: put \(u_1=v_1\) , \(u_n=v_n-\sum_{k<n}\langle v_n,e_k\rangle e_k\) , and \(e_n=u_n/\lVert u_n\rVert\) . Each step subtracts from \(v_n\) its projection onto the span of the earlier vectors, which by the proposition is the nearest point of that span, and what remains is nonzero by independence.

Example 7.5: The best line and the best parabola for the exponential

In \(L^2[0,1]\) apply Gram–Schmidt to \(1,x,x^2\) . First \(q_0=1\) . Then \(x-\langle x,q_0\rangle q_0=x-\tfrac12\) , with \(\lVert x-\tfrac12\rVert^2=\tfrac1{12}\) , so \(q_1=\sqrt3\,(2x-1)\) . The next step, subtracting from \(x^2\) its components \(\tfrac13\) along \(q_0\) and \(\tfrac1{2\sqrt3}\) along \(q_1\) , leaves \(x^2-x+\tfrac16\) , whose norm is \(1/(6\sqrt5)\) , so \(q_2=\sqrt5\,(6x^2-6x+1)\) .

Now take \(f(x)=e^x\) . Its Fourier coefficients are

\[ \langle f,q_0\rangle=e-1,\qquad\langle f,q_1\rangle=\sqrt3\int_0^1e^x(2x-1)\,dx=\sqrt3\,(3-e),\qquad\langle f,q_2\rangle=\sqrt5\,(7e-19), \]

numerically \(1.7183\) , \(0.4880\) , and \(0.0625\) . By Proposition 7.6 the best approximation by a polynomial of degree at most \(1\) is

\[ p_1(x)=(e-1)+3(3-e)(2x-1)=(4e-10)+(18-6e)x\approx 0.8731+1.6903x , \]

which is the line announced at the start of the chapter. The squared error is \(\lVert f\rVert^2-(e-1)^2-3(3-e)^2\) with \(\lVert f\rVert^2=\tfrac12(e^2-1)\) , giving \(\lVert f-p_1\rVert_2\approx 0.0628\) . Adding the term \(\langle f,q_2\rangle q_2\) gives the best parabola, and the error drops to \(\lVert f-p_2\rVert_2\approx 0.0053\) , because the squared error decreases by exactly \(\langle f,q_2\rangle^2\) . The first two coefficients did not change when the third basis function was added. That is the practical advantage of an orthonormal basis: approximations of increasing order are nested.

Left panel: the exponential function on the unit interval together with its best mean-square straight-line approximation, the line crossing the curve twice. Right panel: the residual of the linear approximation, positive near both ends and negative in the middle, and the much smaller residual of the quadratic approximation, magnified ten times, with three sign changes.
Figure 7.1. The residual of the best line is orthogonal to 1 and to x: its positive and negative parts cancel in area and in first moment, which forces two sign changes. The residual of the best parabola is orthogonal to the squared term as well and changes sign three times. Orthogonality of the error, not smallness at any particular point, is what characterises the projection.

Theorem 7.7 (orthonormal bases). Let \((e_k)_{k\ge 1}\) be an orthonormal sequence in a Hilbert space \(H\) . For every \((c_k)\in\ell^2\) the series \(\sum_kc_ke_k\) converges in \(H\) , and \(\lVert\sum_kc_ke_k\rVert^2=\sum_k\lvert c_k\rvert^2\) . Moreover the following are equivalent: (a) the linear span of the \(e_k\) is dense in \(H\) ; (b) \(x=\sum_{k=1}^\infty\langle x,e_k\rangle e_k\) for every \(x\in H\) ; (c) \(\lVert x\rVert^2=\sum_{k=1}^\infty\lvert\langle x,e_k\rangle\rvert^2\) for every \(x\in H\) (Parseval’s identity); (d) the only vector orthogonal to every \(e_k\) is \(0\) . An orthonormal sequence with these properties is an orthonormal basis of \(H\) .

Proof. By Pythagoras, \(\lVert\sum_{k=m+1}^nc_ke_k\rVert^2=\sum_{k=m+1}^n\lvert c_k\rvert^2\) , so the partial sums are Cauchy when \((c_k)\in\ell^2\) ; they converge because \(H\) is complete, and the norm identity passes to the limit. Now fix \(x\) and let \(s_n=\sum_{k\le n}\langle x,e_k\rangle e_k\) , which converges to some \(s\) by Bessel’s inequality and what was just proved. By Proposition 7.6, \(\lVert x-s_n\rVert^2=\lVert x\rVert^2-\sum_{k\le n}\lvert\langle x,e_k\rangle\rvert^2\) , and this is the squared distance from \(x\) to the span of \(e_1,\dots,e_n\) . So (b) and (c) each say that this distance tends to \(0\) for every \(x\) , which is (a). For each fixed \(k\) , \(\langle x-s,e_k\rangle=\lim_n\langle x-s_n,e_k\rangle=0\) . If (d) holds this forces \(x=s\) , which is (b). Finally if (b) holds and \(x\perp e_k\) for all \(k\) , then \(x=\sum_k0\cdot e_k=0\) , which is (d).

Theorem 7.8 (separable Hilbert spaces). Every infinite-dimensional separable Hilbert space \(H\) has an orthonormal basis \((e_k)_{k\ge 1}\) , and the map \(x\mapsto(\langle x,e_k\rangle)_{k\ge 1}\) is a linear isometry of \(H\) onto \(\ell^2\) that preserves inner products.

Proof. Take a dense sequence in \(H\) , discard each member that is a linear combination of earlier ones, and apply Gram–Schmidt to what remains. The resulting orthonormal sequence has the same span as the dense sequence, so it is a basis by criterion (a). The coefficient map is linear, isometric by Parseval’s identity, and onto \(\ell^2\) by the first statement of Theorem 7.7; it preserves inner products by polarization.

All infinite-dimensional separable Hilbert spaces are therefore the same space in different coordinates. The interest of \(L^2[0,1]\) is not that it differs from \(\ell^2\) but that it carries several useful orthonormal bases at once.

Example 7.6: A sine expansion and what Parseval’s identity computes

In \(L^2[0,1]\) the functions \(s_k(x)=\sqrt2\sin(k\pi x)\) , \(k\ge 1\) , are orthonormal (Example 6.2 computed the integrals). They form an orthonormal basis; this completeness is a theorem of Fourier analysis, a consequence of the Weierstrass approximation theorem, and we take it as known. For \(f(x)=x\) , integration by parts gives

\[ \langle f,s_k\rangle=\sqrt2\int_0^1x\sin(k\pi x)\,dx=\frac{\sqrt2\,(-1)^{k+1}}{k\pi} . \]

Parseval’s identity reads \(\lVert f\rVert^2=\tfrac13=\sum_k\frac{2}{k^2\pi^2}\) , which rearranges to

\[ \sum_{k=1}^\infty\frac1{k^2}=\frac{\pi^2}{6} . \]

The identity that entered Example 1.3 as a quoted fact is here a consequence of the geometry of \(L^2\) . The partial sums converge in mean square but slowly: by Proposition 7.6, \(\lVert f-\sum_{k\le 10}\langle f,s_k\rangle s_k\rVert_2^2=\tfrac13-\sum_{k\le 10}\frac{2}{k^2\pi^2}\approx 0.0193\) , so the error after ten terms is still about \(0.139\) . The slowness reflects a mismatch at the endpoint \(x=1\) , where every \(s_k\) vanishes and \(f\) does not.

Bessel’s inequality also explains Example 6.2 without any appeal to step functions: for every \(g\in L^2[0,1]\) the coefficients \(\langle g,s_k\rangle\) are square-summable, hence tend to \(0\) . An orthonormal sequence always tends weakly to zero, in the sense that its inner product with each fixed vector does; the next chapter shows that these inner products are all the bounded functionals there are.

Common mistake. Using the expansion formula with vectors that are not orthonormal. For the basis \(v_1=(1,0)\) , \(v_2=(1,1)/\sqrt2\) of \(\mathbb R^2\) , both of norm \(1\) , the sum \(\langle x,v_1\rangle v_1+\langle x,v_2\rangle v_2\) at \(x=(0,1)\) is \(0+\tfrac1{\sqrt2}v_2=(\tfrac12,\tfrac12)\) , which is not \(x\) . The formula \(x=\sum_k\langle x,e_k\rangle e_k\) and Parseval’s identity require the \(e_k\) to be mutually orthogonal, and in infinite dimensions also complete. Before expanding, check both; if the vectors are merely independent, apply Gram–Schmidt first or solve the normal equations.

The projection theorem describes a Hilbert space from the inside. The next chapter uses it to describe the dual: every bounded functional is an inner product with a fixed vector, and from that fact follow the adjoint of an operator and the solvability theorem of Lax and Milgram.

Exercises

  1. For \(x=(1,2)\) and \(y=(3,-1)\) in \(\mathbb R^2\) compute \(\lVert x+y\rVert_2^2\) and \(\lVert x-y\rVert_2^2\) , verify the parallelogram law, and recover \(\langle x,y\rangle\) from the polarization identity.

    Answer

    \(x+y=(4,1)\) and \(x-y=(-2,3)\) , so \(\lVert x+y\rVert_2^2=17\) and \(\lVert x-y\rVert_2^2=13\) . Their sum is \(30=2\cdot 5+2\cdot 10\) , as the parallelogram law requires. Polarization gives \(\langle x,y\rangle=\tfrac14(17-13)=1\) , in agreement with \(1\cdot 3+2\cdot(-1)=1\) .

  2. Prove the polarization identity \(\langle x,y\rangle=\tfrac14\sum_{j=0}^{3}i^j\lVert x+i^jy\rVert^2\) in a complex inner product space.

    Hint

    Expand \(\lVert x+i^jy\rVert^2=\lVert x\rVert^2+\lVert y\rVert^2+2\operatorname{Re}\bigl(\overline{i^j}\langle x,y\rangle\bigr)\) , multiply by \(i^j\) , and sum over \(j=0,1,2,3\) . The terms with \(\lVert x\rVert^2+\lVert y\rVert^2\) cancel because \(1+i-1-i=0\) ; writing \(\langle x,y\rangle=a+ib\) , the remaining terms give \(2(a+a)+2i(b+b)=4\langle x,y\rangle\) .

  3. Prove that equality holds in the Cauchy–Schwarz inequality if and only if \(x\) and \(y\) are linearly dependent, by examining the proof of Theorem 7.2.

    Hint

    If \(y\ne 0\) , equality means \(\lVert x-ty\rVert^2=0\) for \(t=\langle x,y\rangle/\lVert y\rVert^2\) , so \(x=ty\) . Conversely if \(x=ty\) both sides equal \(\lvert t\rvert\lVert y\rVert^2\) .

  4. Show that \(L^p[0,1]\) with \(1\le p<\infty\) and \(p\ne 2\) fails the parallelogram law, by testing it on the indicator functions of \([0,\tfrac12]\) and \([\tfrac12,1]\) .

    Answer

    With \(f=\mathbf 1_{[0,1/2]}\) and \(g=\mathbf 1_{[1/2,1]}\) : \(\lVert f\rVert_p=\lVert g\rVert_p=2^{-1/p}\) and \(\lVert f\pm g\rVert_p=1\) . The law would require \(1+1=4\cdot 2^{-2/p}\) , that is \(2^{2/p}=2\) , which holds only for \(p=2\) .

  5. In \(\ell^2\) let \(x=(2,-1,3,0,0,\dots)\) . Find the nearest point to \(x\) in the closed ball of radius \(2\) about the origin and in the cone of sequences with nonnegative coordinates, with the two distances.

    Answer

    \(\lVert x\rVert_2=\sqrt{14}\approx 3.742\) . Ball of radius \(2\) : nearest point \(2x/\sqrt{14}\) , distance \(\sqrt{14}-2\approx 1.742\) . Cone: nearest point \((2,0,3,0,\dots)\) , distance \(1\) .

  6. In \(\mathbb R^2\) with the Euclidean inner product let \(K=\{x:x_1+x_2\le 1\}\) . Find \(P_K(2,2)\) and verify the variational inequality of Theorem 7.3 for it.

    Solution

    The point \(x=(2,2)\) is not in \(K\) , since \(2+2>1\) . The boundary of \(K\) is the line \(x_1+x_2=1\) with normal direction \((1,1)\) , so the candidate is the foot of the perpendicular from \(x\) to that line: \(z=x-t(1,1)\) with \((2-t)+(2-t)=1\) , giving \(t=\tfrac32\) and

    \[ z=\bigl(\tfrac12,\tfrac12\bigr),\qquad x-z=\bigl(\tfrac32,\tfrac32\bigr),\qquad\lVert x-z\rVert_2=\tfrac32\sqrt2\approx 2.121 . \]

    To verify that \(z=P_Kx\) by Theorem 7.3, take any \(k\in K\) :

    \[ \langle x-z,k-z\rangle=\tfrac32\bigl((k_1-\tfrac12)+(k_2-\tfrac12)\bigr)=\tfrac32(k_1+k_2-1)\le 0 , \]

    because \(k_1+k_2\le 1\) on \(K\) . Since \(z\in K\) and the variational inequality holds for all \(k\in K\) , the theorem gives \(P_K(2,2)=(\tfrac12,\tfrac12)\) . Equality in the variational inequality occurs exactly for \(k\) on the boundary line, which is the geometric statement that \(x-z\) is perpendicular to the face of \(K\) on which \(z\) lies.

  7. Let \(M\) be the set of even functions in \(L^2[-1,1]\) . Show that \(M\) is a closed subspace, identify \(M^\perp\) and the projection \(P_M\) , and compute \(P_Mf\) and \(\operatorname{dist}(f,M)\) for \(f(x)=e^x\) .

    Solution

    Define the reflection \((Rf)(x)=f(-x)\) . The substitution \(x\mapsto-x\) shows \(\lVert Rf\rVert_2=\lVert f\rVert_2\) , so \(R\) is a bounded linear operator on \(L^2[-1,1]\) , and \(M=\{f:Rf=f\}=\ker(I-R)\) is a closed subspace.

    Let \(N\) be the odd functions, \(N=\ker(I+R)\) . If \(f\) is even and \(g\) odd, then \(f\overline g\) is odd and \(\langle f,g\rangle=\int_{-1}^1f\overline g=0\) ; so \(N\subseteq M^\perp\) . Every \(f\) decomposes as

    \[ f=\tfrac12(f+Rf)+\tfrac12(f-Rf), \]

    with the first term even and the second odd. This is a decomposition \(f=m+n\) with \(m\in M\) and \(n\in M^\perp\) , and by the uniqueness in Theorem 7.4 it is the orthogonal decomposition. Hence \(P_M=\tfrac12(I+R)\) and \(M^\perp=N\) exactly.

    For \(f(x)=e^x\) : \(P_Mf=\tfrac12(e^x+e^{-x})=\cosh x\) , and \(f-P_Mf=\sinh x\) . The distance is

    \[ \operatorname{dist}(f,M)=\lVert\sinh\rVert_2=\Bigl(\int_{-1}^1\sinh^2x\,dx\Bigr)^{1/2}=\Bigl(\tfrac12\sinh 2-1\Bigr)^{1/2}\approx 0.9019 , \]

    using \(\sinh^2x=\tfrac12(\cosh 2x-1)\) . As a check, \(\lVert e^x\rVert_2^2=\sinh 2\approx 3.627\) and \(\lVert\cosh\rVert_2^2=\tfrac12\sinh 2+1\approx 2.813\) ; the two squared norms \(2.813\) and \(0.813\) add to \(3.627\) , as Pythagoras requires.

  8. Prove that \(c_{00}^\perp=\{0\}\) in \(\ell^2\) , and explain why this shows that the hypothesis “closed” cannot be dropped from Theorem 7.4.

    Solution

    Let \(x\in\ell^2\) be orthogonal to \(c_{00}\) . Each \(e_k\) belongs to \(c_{00}\) , so \(x_k=\langle x,e_k\rangle=0\) for every \(k\) , and \(x=0\) . Hence \(c_{00}^\perp=\{0\}\) .

    If Theorem 7.4 held for the subspace \(M=c_{00}\) , every \(x\in\ell^2\) would decompose as \(x=m+n\) with \(m\in c_{00}\) and \(n\in c_{00}^\perp=\{0\}\) , which would mean \(\ell^2=c_{00}\) . That is false: \(a=(1/k)\) is in \(\ell^2\) and not in \(c_{00}\) . What goes wrong in the proof is the existence step of Theorem 7.3. A minimizing sequence for the distance from \(a\) to \(c_{00}\) , for instance the truncations \(a^{(n)}\) , is Cauchy and converges in \(\ell^2\) , but its limit \(a\) is not in \(c_{00}\) because \(c_{00}\) is not closed. The infimum \(\operatorname{dist}(a,c_{00})=0\) is not attained. By Corollary 7.5, \((c_{00}^\perp)^\perp=\ell^2\) is the closure of \(c_{00}\) , consistent with density.

  9. Apply the Gram–Schmidt process to \((1,1,0)\) , \((1,0,1)\) , \((0,1,1)\) in \(\mathbb R^3\) .

    Answer

    \(e_1=(1,1,0)/\sqrt2\) . Then \((1,0,1)-\tfrac12(1,1,0)=\tfrac12(1,-1,2)\) , so \(e_2=(1,-1,2)/\sqrt6\) . Then \((0,1,1)-\tfrac12(1,1,0)-\tfrac16(1,-1,2)=\tfrac23(-1,1,1)\) , so \(e_3=(-1,1,1)/\sqrt3\) .

  10. Find the polynomial of degree at most \(1\) nearest to \(x^2\) in \(L^2[0,1]\) and the distance, using \(q_0\) and \(q_1\) from Example 7.5; compare with the best line for the supremum norm found in Example 3.4.

    Solution

    With \(q_0=1\) and \(q_1=\sqrt3(2x-1)\) ,

    \[ \langle x^2,q_0\rangle=\int_0^1x^2\,dx=\tfrac13,\qquad\langle x^2,q_1\rangle=\sqrt3\int_0^1(2x^3-x^2)\,dx=\sqrt3\bigl(\tfrac12-\tfrac13\bigr)=\tfrac{\sqrt3}{6} . \]

    By Proposition 7.6 the nearest polynomial of degree at most \(1\) is

    \[ p(x)=\tfrac13+\tfrac{\sqrt3}{6}\cdot\sqrt3(2x-1)=\tfrac13+x-\tfrac12=x-\tfrac16 , \]

    and the squared distance is \(\lVert x^2\rVert^2-\tfrac19-\tfrac1{12}=\tfrac15-\tfrac7{36}=\tfrac1{180}\) . So the distance is \(1/\sqrt{180}=1/(6\sqrt5)\approx 0.0745\) . The error \(x^2-x+\tfrac16\) is the unnormalised third Gram–Schmidt vector of Example 7.5, as it must be: it is what remains of \(x^2\) after its projection onto the span of \(1\) and \(x\) is removed.

    For the supremum norm, Example 3.4 found the best line \(x-\tfrac18\) with error \(\tfrac18=0.125\) . The two best lines are parallel and differ by the constant \(\tfrac16-\tfrac18=\tfrac1{24}\) . The mean-square line sits lower because it balances areas, tolerating a larger error at the endpoints, where \(x^2-x+\tfrac16\) equals \(\tfrac16\) , in exchange for a smaller error over most of the interval. “Best approximation” has no meaning until the norm is fixed.

  11. Expand \(f(x)=x(1-x)\) in the orthonormal basis \(s_k(x)=\sqrt2\sin(k\pi x)\) of \(L^2[0,1]\) and use Parseval’s identity to evaluate \(\sum_{k\text{ odd}}k^{-6}\) .

    Solution

    Integrating by parts twice, or differentiating under the known integrals of Example 6.2,

    \[ \langle f,s_k\rangle=\sqrt2\int_0^1x(1-x)\sin(k\pi x)\,dx=\frac{2\sqrt2\,\bigl(1-(-1)^k\bigr)}{k^3\pi^3} , \]

    which is \(4\sqrt2/(k^3\pi^3)\) for odd \(k\) and \(0\) for even \(k\) . The vanishing for even \(k\) reflects symmetry: \(f\) is symmetric about \(x=\tfrac12\) and \(\sin(k\pi x)\) is antisymmetric about it when \(k\) is even.

    The norm is \(\lVert f\rVert^2=\int_0^1x^2(1-x)^2\,dx=\tfrac13-\tfrac12+\tfrac15=\tfrac1{30}\) . Parseval’s identity (Theorem 7.7) gives

    \[ \frac1{30}=\sum_{k\text{ odd}}\frac{32}{k^6\pi^6},\qquad\text{hence}\qquad\sum_{k\text{ odd}}\frac1{k^6}=\frac{\pi^6}{960}\approx 1.00145 . \]

    The coefficients decay like \(k^{-3}\) , much faster than the \(k^{-1}\) of Example 7.6, because \(x(1-x)\) vanishes at both endpoints, as every \(s_k\) does. The first term alone carries almost all of the norm: \(32/\pi^6\approx 0.03329\) against \(\tfrac1{30}\approx 0.03333\) , so the single function \(\tfrac{8}{\pi^3}\sin(\pi x)\) approximates \(x(1-x)\) with relative mean-square error below four percent.

  12. Let \((e_k)\) be an orthonormal sequence in a Hilbert space. Show that \(\langle x,e_k\rangle\to 0\) for every \(x\) , that \((e_k)\) has no norm-convergent subsequence, and that \(\lVert e_k-e_j\rVert=\sqrt2\) for \(k\ne j\) .

    Answer

    \(\langle x,e_k\rangle\to 0\) because Bessel’s inequality makes \(\sum_k\lvert\langle x,e_k\rangle\rvert^2\) convergent. By Pythagoras \(\lVert e_k-e_j\rVert^2=1+1=2\) for \(k\ne j\) , so no subsequence is Cauchy.

  13. For \(v_1=(1,0)\) and \(v_2=(1,1)/\sqrt2\) in \(\mathbb R^2\) compute \(\langle x,v_1\rangle v_1+\langle x,v_2\rangle v_2\) at \(x=(0,1)\) , explain why the result differs from \(x\) , and find the correct coefficients \(c_1,c_2\) with \(x=c_1v_1+c_2v_2\) .

    Answer

    \(\langle x,v_1\rangle=0\) and \(\langle x,v_2\rangle=1/\sqrt2\) , so the sum is \((\tfrac12,\tfrac12)\ne x\) . The vectors have norm \(1\) but \(\langle v_1,v_2\rangle=1/\sqrt2\ne 0\) , so they are not orthonormal. Solving \(c_1(1,0)+c_2(1,1)/\sqrt2=(0,1)\) gives \(c_2=\sqrt2\) and \(c_1=-1\) .

  14. Let \(H_0\) be \(c_{00}\) with the inner product of \(\ell^2\) , and \(M=\{x\in c_{00}:\sum_kx_k/2^k=0\}\) . Show that \(M\) is a closed proper subspace of \(H_0\) whose orthogonal complement in \(H_0\) is \(\{0\}\) , so that the projection theorem fails in an incomplete inner product space.

    Solution

    Let \(\varphi(x)=\sum_kx_k/2^k=\langle x,a\rangle\) with \(a=(2^{-k})\in\ell^2\) . On \(H_0\) this is a bounded functional, by the Cauchy–Schwarz inequality, so \(M=\ker\varphi\) is closed in \(H_0\) . It is proper because \(\varphi(e_1)=\tfrac12\ne 0\) .

    Let \(z\in H_0\) be orthogonal to \(M\) . Since \(z\in c_{00}\) , there is \(n\) with \(z_k=0\) for \(k>n\) . Fix \(j\le n\) and choose any \(m>n\) . The vector

    \[ u=e_j-2^{m-j}e_m \]

    is in \(c_{00}\) and satisfies \(\varphi(u)=2^{-j}-2^{m-j}2^{-m}=0\) , so \(u\in M\) . Then \(0=\langle z,u\rangle=z_j-2^{m-j}z_m=z_j\) , because \(z_m=0\) . Hence every coordinate of \(z\) vanishes and \(M^\perp=\{0\}\) in \(H_0\) .

    So \(M\oplus M^\perp=M\ne H_0\) , and the conclusion of Theorem 7.4 fails although \(M\) is closed. The vector \(e_1\) , for example, has no nearest point in \(M\) . In the completion \(\ell^2\) the closure of \(M\) is the hyperplane of Example 7.4, whose complement is spanned by \(a\) ; but \(a\) has infinitely many nonzero coordinates and is not available in \(c_{00}\) . Completeness is what guarantees that the normal direction to a closed hyperplane exists as a vector of the space.

  15. Let \((e_k)\) be an orthonormal sequence in a Hilbert space. Decide whether \(\sum_ke_k/k\) and \(\sum_ke_k/\sqrt k\) converge, and compute the norm of the sum when it exists.

    Answer

    \(\sum_ke_k/k\) converges, since \((1/k)\in\ell^2\) , and the norm of its sum is \((\sum_kk^{-2})^{1/2}=\pi/\sqrt6\approx 1.2825\) . \(\sum_ke_k/\sqrt k\) does not converge: its partial sums have squared norms \(\sum_{k\le n}1/k\to\infty\) .

  16. In \(\mathbb R^2\) with the norm \(\lVert\cdot\rVert_\infty\) find all points of the closed unit ball nearest to \(x=(2,0)\) , and say which step of the proof of Theorem 7.3 is unavailable.

    Answer

    The distance is \(1\) and the nearest points are \((1,t)\) with \(\lvert t\rvert\le 1\) . The uniqueness step, and the proof that a minimizing sequence is Cauchy, both use the parallelogram law, which \(\lVert\cdot\rVert_\infty\) does not satisfy.

  17. Let \(P\) and \(Q\) be the orthogonal projections onto closed subspaces \(M\) and \(N\) of a Hilbert space. Prove that \(PQ=0\) if and only if \(M\perp N\) , and that in this case \(P+Q\) is the orthogonal projection onto \(M+N\) , which is closed.

    Solution

    Suppose \(PQ=0\) . For \(n\in N\) we have \(n=Qn\) , so \(Pn=PQn=0\) , which means \(n\in\ker P=M^\perp\) . Thus \(N\perp M\) . Conversely if \(M\perp N\) , then for every \(x\) the vector \(Qx\in N\subseteq M^\perp=\ker P\) , so \(PQx=0\) . By the symmetry of the relation \(M\perp N\) , also \(QP=0\) .

    Assume now \(M\perp N\) and put \(E=P+Q\) . First, \(M+N=\{x:Ex=x\}\) . If \(x=m+n\) then \(Ex=Pm+Pn+Qm+Qn=m+0+0+n=x\) . If \(Ex=x\) then \(x=Px+Qx\in M+N\) . So \(M+N=\ker(I-E)\) is closed.

    Second, for any \(x\) the vector \(x-Ex\) is orthogonal to \(M+N\) . For \(m\in M\) , using \(\langle Pu,v\rangle=\langle u,Pv\rangle\) from Theorem 7.4,

    \[ \langle x-Px-Qx,m\rangle=\langle x-Px,m\rangle-\langle Qx,m\rangle=0-0 , \]

    since \(x-Px\in M^\perp\) and \(Qx\in N\subseteq M^\perp\) . The same holds with \(N\) in place of \(M\) . So \(x=Ex+(x-Ex)\) with \(Ex\in M+N\) and \(x-Ex\in(M+N)^\perp\) . By the uniqueness of the orthogonal decomposition for the closed subspace \(M+N\) , \(Ex\) is the orthogonal projection of \(x\) onto \(M+N\) . Orthogonality of \(M\) and \(N\) is what makes the sum closed; Example 5.6 showed that without it the sum of two closed subspaces of \(\ell^2\) can fail to be closed.

  18. Find the minimum of \(\int_{-1}^{1}\lvert x^3-a-bx-cx^2\rvert^2\,dx\) over real \(a,b,c\) and the minimizing coefficients, by projecting \(x^3\) onto the orthogonal polynomials \(1\) , \(x\) , \(x^2-\tfrac13\) .

    Answer

    On \([-1,1]\) , \(x^3\) is orthogonal to \(1\) and to \(x^2-\tfrac13\) by oddness, and \(\langle x^3,x\rangle/\langle x,x\rangle=\tfrac25\big/\tfrac23=\tfrac35\) . The minimizer is \(a=0\) , \(b=\tfrac35\) , \(c=0\) , and the minimum is \(\int_{-1}^1(x^3-\tfrac35x)^2\,dx=\tfrac27-\tfrac6{25}=\tfrac8{175}\approx 0.0457\) .

Search knowledge base

Explore

On this page

Note