The orthogonal projection theorem
Statement
Let \(V\) be an inner product space over \(\mathbb{R}\) or \(\mathbb{C}\), with inner product \(\langle \cdot,\cdot\rangle\) and induced norm \(\|v\|=\sqrt{\langle v,v\rangle}\). Let \(W \subseteq V\) be a subspace which is complete in the norm induced by \(\langle\cdot,\cdot\rangle\) (in particular, any finite-dimensional subspace of any inner product space, or any closed subspace of a Hilbert space, qualifies). Then for every \(x \in V\) there exists a unique \(p \in W\) minimising the distance to \(x\), that is \[ \|x-p\| = \inf_{w \in W} \|x-w\|, \] and this minimiser \(p\) is characterised uniquely by the orthogonality condition \[ x-p \perp W, \quad \text{i.e.} \quad \langle x-p,\, w\rangle = 0 \ \ \forall w\in W. \] The map \(P_W:V\to W\), \(x\mapsto p\), is linear, satisfies \(P_W^2=P_W\), \(\|P_W x\|\le \|x\|\), and is called the orthogonal projection of \(V\) onto \(W\).
Why it matters
This theorem is the structural engine behind least-squares approximation, Fourier series, the Gram–Schmidt process, and the existence of orthogonal complements. It converts a metric optimisation problem — "find the closest point in \(W\) to \(x\)" — into an algebraic one — "find the point whose error is orthogonal to \(W\)" — which is exactly what makes projections computable via linear equations (the normal equations) rather than calculus of variations from scratch.
It is also the finite-dimensional/Hilbert-space engine of decomposition: it produces the direct sum \(V = W \oplus W^{\perp}\) whenever \(W\) is complete, which underlies spectral theory, orthogonal diagonalisation, and the projection-valued measures of functional analysis.
Hypotheses
Proof
Result
Reading. Among all vectors in \(W\), exactly one is closest to \(x\); it is found not by calculus over all of \(W\) but by demanding that the leftover error \(x-p\) have zero inner product with every direction in \(W\). "Closest" and "error orthogonal to \(W\)" are the same condition.
Scope. Applies to any inner product space \(V\) and any subspace \(W\) that is complete under the induced norm — automatically true when \(\dim W\lt\infty\) (even if \(V\) is infinite-dimensional), and true for closed subspaces of a complete space (Hilbert space). It fails for non-closed subspaces of infinite-dimensional spaces, and the clean orthogonality form fails if \(W\) is replaced by a non-linear convex set.
Corollaries & converses
- Orthogonal decomposition. \(V=W\oplus W^{\perp}\) whenever \(W\) is complete: every \(x\) splits uniquely as \(x=P_Wx+(x-P_Wx)\) with \(P_Wx\in W\), \(x-P_Wx\in W^\perp\).
- Bessel's inequality / best approximation by an orthonormal set. If \(\{e_1,\dots,e_n\}\) is orthonormal and \(W=\operatorname{span}\{e_i\}\), the theorem gives \(P_Wx=\sum_i\langle x,e_i\rangle e_i\) and \(\|x\|^2\ge\sum_i|\langle x,e_i\rangle|^2\), the computational engine of Fourier coefficients and least squares.
- \(P_W\) is self-adjoint and \(\|P_W\|\le1\) (an orthogonal projection operator). Follows from linearity (Step 12) plus \(\langle P_Wx,y\rangle=\langle P_Wx,P_Wy\rangle=\langle x,P_Wy\rangle\) using the orthogonality relation twice.
- Converse (of the characterisation, not the whole theorem) holds exactly: Step 11 shows any \(q\in W\) with \(x-q\perp W\) is automatically the minimiser — the orthogonality condition is an iff, not just a necessary condition.
- Converse of existence does NOT hold: completeness of \(W\) is sufficient but not necessary for a given single \(x\) to have a closest point in \(W\); it is necessary for every \(x\in V\) to have one. A specific \(x\) may happen to attain its distance to a non-complete \(W\) without \(W\) being complete.
Fails without
- Drop completeness of \(W\): \(V=\ell^2\), \(W=\{x\in\ell^2 : \text{finitely many nonzero terms}\}\) (finitely supported sequences), which is a subspace but not closed. Take \(x=(1,\tfrac12,\tfrac14,\dots)\in\ell^2\setminus W\); \(\inf_{w\in W}\|x-w\|=0\) (truncations of \(x\) approximate it arbitrarily well) but no \(w\in W\) achieves \(\|x-w\|=0\), so no minimiser exists at all.
- Drop linearity of \(W\) (replace with a general closed convex set, keeping existence/uniqueness but breaking the orthogonality form): \(V=\mathbb{R}^2\), \(W=\{(a,b):a^2+b^2\le1\}\) the closed unit disc, \(x=(2,0)\). The unique closest point is \(p=(1,0)\), but \(x-p=(1,0)\) is not orthogonal to the whole set \(W\) (e.g. \(\langle x-p,(0,1)\rangle=0\) but \(\langle x-p,(-1,0)\rangle=-1\ne0\)) — only the weaker variational inequality \(\langle x-p,w-p\rangle\le0\ \forall w\in W\) survives.
- Drop convexity entirely: \(V=\mathbb{R}^2\), \(W=\{(1,0),(-1,0)\}\) (not even a subspace, just two points), \(x=(0,0)\). Both points are equally close, so uniqueness fails outright — illustrating why linear (or at least strictly convex) structure is essential to the clean statement.
Common errors
- Asserting the theorem for an arbitrary subspace \(W\) of an infinite-dimensional \(V\) without checking closedness — students often forget that "subspace" alone is not enough once \(\dim V=\infty\).
- Confusing "\(x-p\perp W\)" with "\(x-p\perp p\)" — only the second is implied (\(p\in W\)); the orthogonality is to the entire subspace, a strictly stronger statement, which is what makes \(p\) unique.
- Trying to verify \(x-p\perp W\) by checking a single vector \(w\in W\) rather than all \(w\in W\) (or, in the finite-dimensional case, all vectors of a spanning/basis set — which is legitimate by linearity of the inner product, but checking one arbitrary vector is not).
- Using the real-variable derivative trick (Step 7) unmodified in a complex inner product space and getting the wrong sign or missing the conjugate, instead of the ray argument of Step 8.
- Believing \(P_W\) is an orthogonal projection merely because it is idempotent (\(P^2=P\)); idempotence alone only gives a (possibly oblique) linear projection. Self-adjointness (\(P=P^*\)) is the extra ingredient that makes it orthogonal, and this is a consequence of the theorem, not a separate assumption to check by hand each time.
Discussion
The proof's real engine is the parallelogram law in Step 2–3, which is exactly the property that fails in general normed spaces and is the reason "closest point" theorems in Banach space theory need extra hypotheses (uniform convexity) to recover uniqueness. Inner product spaces get it for free because the norm comes from a bilinear/sesquilinear form, and it is this same parallelogram identity that later characterises inner product norms among all norms (the Jordan–von Neumann theorem).
Historically the idea traces to Fourier's use of orthogonality to compute series coefficients and to Hilbert and Schmidt's early twentieth-century formalisation of \(L^2\) spaces, where the projection theorem becomes the abstract statement underlying "the best approximation of a function by a trigonometric polynomial is given by its Fourier coefficients."
The theorem is the base case of a much larger structural fact: every closed subspace of a Hilbert space has a topological complement (its orthogonal complement), which is false for general closed subspaces of general Banach spaces. This is part of why Hilbert spaces are so much more tractable than Banach spaces — orthogonal projections give canonical, norm-decreasing splittings, whereas Banach-space projections (when they exist) need not be norm non-increasing or canonical.
A subtlety often missed: the theorem does not require \(V\) itself to be complete, only \(W\). One can work inside an incomplete inner product space (e.g. the space of continuous functions with the \(L^2\) inner product, not complete) and still project onto any finite-dimensional subspace, because finite-dimensional subspaces of any normed space are automatically complete (a consequence of the equivalence of norms in finite dimensions). This is precisely why Gram–Schmidt and least-squares regression need no completeness hypothesis on the ambient space at all.
Worked examples
Problems
- In \(\mathbb{R}^3\) with the standard inner product, let \(W=\{(a,b,c):a+b+c=0\}\) and \(x=(1,1,1)\). Find \(P_Wx\) and \(\operatorname{dist}(x,W)\).
Solution
\(W\) is a plane through the origin (2-dimensional, hence complete), with normal vector \(n=(1,1,1)\). The projection onto \(W\) is \(x\) minus its projection onto \(\operatorname{span}\{n\}\): \(P_{\operatorname{span}\{n\}}x=\dfrac{\langle x,n\rangle}{\|n\|^2}n=\dfrac{3}{3}(1,1,1)=(1,1,1)=x\). So \(P_Wx=x-(1,1,1)=(0,0,0)\), and \(\operatorname{dist}(x,W)=\|x-P_Wx\|=\|(1,1,1)\|=\sqrt3\). (Sanity check: \(x\) itself is a multiple of the normal, so it is "purely orthogonal" to the plane, and its projection onto the plane is indeed the origin.) - Let \(V=\mathbb{R}^2\) with standard inner product, \(W=\operatorname{span}\{(1,2)\}\), \(x=(4,-2)\). Compute \(P_Wx\) and verify \(x-P_Wx\perp W\) explicitly.
Solution
\(u=(1,2)\), \(\|u\|^2=5\), \(\langle x,u\rangle=4-4=0\). So \(P_Wx=\dfrac{0}{5}(1,2)=(0,0)\). Check: \(x-P_Wx=(4,-2)\), and \(\langle(4,-2),(1,2)\rangle=4-4=0\). Confirmed orthogonal — in fact \(x\) was already orthogonal to \(W\), so its projection is \(0\), consistent with the theorem (the closest point in a subspace to a vector already orthogonal to it is the origin). - Prove directly from the orthogonality characterisation (not by recomputing from scratch) that if \(x\in W\) already, then \(P_Wx=x\).
Solution
If \(x\in W\), take \(p=x\). Then \(x-p=0\), and \(\langle 0,w\rangle=0\) for all \(w\in W\) trivially (by linearity of the inner product, \(\langle 0,w\rangle=\langle 0\cdot v,w\rangle=0\cdot\langle v,w\rangle=0\) for any \(v\)). So \(p=x\) satisfies the orthogonality characterisation of the theorem, and by the uniqueness proved in Step 10, \(x\) itself must be the unique minimiser: \(P_Wx=x\). This also reconfirms idempotence, \(P_W^2=P_W\), since \(P_Wx\in W\) always. - Let \(V=\ell^2\) (square-summable real sequences) and let \(W_0\) be the subspace of sequences with only finitely many nonzero terms (not closed, as in "Fails without"). Explain precisely which step of the proof breaks down for \(x=(1,\tfrac12,\tfrac14,\tfrac18,\dots)\) and \(W=W_0\), and what goes wrong numerically.
Solution
The minimising sequence construction (Step 1) still works: take \(w_n=(1,\tfrac12,\dots,\tfrac1{2^{n-1}},0,0,\dots)\in W_0\), and \(\|x-w_n\|^2=\sum_{k\ge n}4^{-k}\to0\), so \(d=\inf_{w\in W_0}\|x-w\|=0\) and \((w_n)\) is indeed Cauchy (Steps 2–3 go through unchanged, since they only use the parallelogram law and the value of \(d\)). The failure is exactly at Step 4: completeness of \(W_0\) is invoked to conclude the Cauchy sequence \((w_n)\) converges to a limit \(p\in W_0\). But \((w_n)\) converges in \(\ell^2\) to \(x\) itself, which has infinitely many nonzero terms, so the limit is not in \(W_0\). No \(p\in W_0\) exists with \(\|x-p\|=0\), since that would force \(p=x\notin W_0\). Existence fails purely because \(W_0\) is not closed/complete — every other step of the proof is unaffected. - Let \(P\) be a linear operator on an inner product space \(V\) with \(P^2=P\) and \(\operatorname{range}(P)=W\) finite-dimensional. Show that \(P=P_W\) (the orthogonal projection of the theorem) if and only if \(P\) is self-adjoint, i.e. \(\langle Pv,u\rangle=\langle v,Pu\rangle\) for all \(u,v\in V\).
Solution
(\(\Rightarrow\)) If \(P=P_W\), then for any \(u,v\): write \(v=Pv+(v-Pv)\) with \(v-Pv\perp W\) (orthogonality characterisation) and similarly for \(u\). Then \(\langle Pv,u\rangle=\langle Pv,Pu+(u-Pu)\rangle=\langle Pv,Pu\rangle+\langle Pv,u-Pu\rangle=\langle Pv,Pu\rangle+0\) since \(Pv\in W\) and \(u-Pu\perp W\). By symmetry \(\langle v,Pu\rangle=\langle Pv,Pu\rangle\) too (swap roles), so \(\langle Pv,u\rangle=\langle v,Pu\rangle\): \(P\) is self-adjoint. (\(\Leftarrow\)) Suppose \(P^2=P\), \(\operatorname{range}(P)=W\), and \(P\) is self-adjoint. For any \(v\in V\) and \(w\in W\), write \(w=Pw'\) for some \(w'\); then \(\langle v-Pv,w\rangle=\langle v-Pv,Pw'\rangle=\langle P(v-Pv),w'\rangle\) (self-adjointness) \(=\langle Pv-P^2v,w'\rangle=\langle Pv-Pv,w'\rangle=0\), using \(P^2=P\). So \(v-Pv\perp W\) for every \(v\), and since \(Pv\in W=\operatorname{range}(P)\), \(Pv\) satisfies exactly the orthogonality characterisation of \(P_Wv\); by the uniqueness in the theorem (Step 10), \(Pv=P_Wv\) for all \(v\), i.e. \(P=P_W\).