Contents / Linear Algebra / Inner Product Spaces
Chapter 10
Inner Product Spaces
Abstract inner products, norms, orthogonal polynomials, Fourier approximation, and complex Hermitian and unitary matrices.
Introduction
A vector space knows about addition and scaling, and nothing else. It cannot tell you how long a vector is, whether two vectors are perpendicular, or which vector in a subspace is closest to a given point. Those are metric questions, and in they are all answered by one gadget: the dot product.
The subject of this chapter is what happens when you take the algebraic properties of the dot product, promote them to axioms, and impose them on an arbitrary vector space. The payoff is enormous and slightly unreasonable. Length, angle, perpendicularity, projection and the Pythagorean theorem all survive the move — and they survive into spaces whose "vectors" are polynomials, matrices, or continuous functions. Fourier series, least-squares curve fitting, Legendre and Chebyshev polynomials and the quantum-mechanical notion of a state all turn out to be the same geometry, done in a space where you cannot draw a picture.
The plan: the axioms and a catalogue of examples; the norm they induce; Cauchy–Schwarz and the triangle inequality, proved once and for all; angles and orthogonality; orthonormal sets and Gram–Schmidt; orthogonal complements; orthogonal projection and best approximation; Bessel and Parseval; Fourier series as a projection; and finally the complex case, where conjugation enters, together with the adjoint of an operator — the doorway to the spectral theorem.
10.1Inner products: the axioms
Take the dot product on and ask what it actually does, forgetting the formula. It is symmetric, it is linear in each slot, and is a sum of squares, hence positive unless . That short list is enough to rebuild all of Euclidean geometry, so we make it the definition.
Definition 10.1 (Real inner product space). Let be a vector space over . An inner product on is a function such that for all and all :
- Symmetry: .
- Additivity in the first slot: .
- Homogeneity in the first slot: .
- Positive definiteness: , with only when .
A vector space carrying an inner product is an inner product space.
Three remarks on the fine print, because each axiom is doing work.
Symmetry plus linearity in the first slot gives linearity in the second slot for free: . So a real inner product is bilinear, and we never have to state the second-slot rules separately. (Over this breaks, and the repair occupies the last two sections of the chapter.)
Positive definiteness is the axiom with teeth. Without the strictness — if we allowed for some — we would have a semi-inner product, in which a nonzero vector has length zero, and nothing about distance or approximation would work. Note also that axioms 2 and 3 already force , so the zero vector is orthogonal to everything, including itself.
Finally, notice what is not assumed: nothing about coordinates, nothing about dimension, no basis. That is why the definition transplants into spaces of functions.
Intuition. Think of as a machine that measures agreement. Feed it two vectors pointing the same way and it returns a large positive number; feed it two opposed vectors and it returns a large negative one; feed it two perpendicular vectors and it returns zero. Feeding it the same vector twice asks "how much does agree with itself?", and the answer had better be positive — that is axiom 4, and it is what makes deserve the name length.
Here is the catalogue. Each of these is an inner product space you will meet again.
Example 10.2 (The standard inner product on ). Verify that satisfies the axioms.
Solution. Symmetry is clear since . Additivity and homogeneity in the first slot follow term by term from the distributive law in . For positivity,
a sum of squares, and it vanishes only when every , i.e. when . In matrix notation , which is the form we use whenever matrices are nearby.□
Example 10.3 (A weighted inner product). Fix constants and define on . For which weights is this an inner product?
Solution. Symmetry and bilinearity hold for any real weights, since each term is symmetric and linear in . Everything depends on axiom 4:
If every this is a sum of nonnegative terms, zero only when all ; so the axioms hold. If some , take : then with , and positive definiteness fails.
So is an inner product exactly when all weights are strictly positive. Weighted inner products are how statistics encodes "these measurements are more reliable than those": a large makes discrepancies in coordinate expensive.□
Example 10.4 (The integral inner product on ). Let be the space of continuous real functions on and set
Show this is an inner product.
Solution. Symmetry holds because pointwise. Linearity in the first slot is linearity of the integral. For positivity,
since the integrand is nonnegative. The only delicate point is strictness. Suppose is continuous and but for some . By continuity on some interval of positive length around , so
a contradiction. Hence . Continuity is essential here: on a space of merely integrable functions, a function that is at a single point and elsewhere is nonzero yet has integral zero, and we would have only a semi-inner product.□
Example 10.5 (The trace inner product on matrices). On define . Show this is an inner product, and compute for
Solution. Write out the trace. The entry of is , so
That is exactly the dot product of and regarded as vectors of length . All four axioms therefore transfer from the standard inner product on ; in particular with equality only for .
For the given matrices, . Sanity check by the trace route:
whose trace is . The associated norm is the Frobenius norm.□
Example 10.6 (An evaluation inner product on polynomials). Let be the polynomials of degree at most , fix distinct reals , and define
Why is positive definiteness true here, and why does it fail if you use only points?
Solution. Symmetry and bilinearity are immediate. For positivity, , and it is zero only if for all — that is, only if has distinct roots. A nonzero polynomial of degree at most has at most roots, so must be the zero polynomial. The axioms hold.
With only sample points , the nonzero polynomial , of degree , satisfies . Positive definiteness collapses. The moral: sampling is an inner product precisely when you sample often enough to determine the polynomial.□
Pitfall. Positive definiteness is the axiom that fails in practice, and it fails quietly. A symmetric bilinear form such as on looks harmless, but with — this is the Minkowski form of special relativity, and it is not an inner product. Always test axiom 4 before assuming the geometry of this chapter applies.
Remark. A symmetric bilinear form on can always be written for a symmetric matrix , and it is an inner product exactly when is positive definite, i.e. for all . The weighted inner products are the case where is diagonal with positive entries. The chapter on eigenvalues gives a test: is positive definite precisely when all its eigenvalues are positive.
10.2Norms, distance, and the norm axioms
Once you can measure agreement you can measure size: a vector's length is how much it agrees with itself.
Definition 10.7 (Induced norm and distance). In an inner product space , the norm of is
which is well defined because . The distance between and is . A vector with is a unit vector, and for the vector is the normalisation of .
Two immediate consequences, both used constantly. First, , since ; note the absolute value, which appears because the square root is nonnegative. Second, if and only if , directly from axiom 4. The normalisation really is a unit vector: its norm is .
Expanding a norm of a sum is the single most used computation in the chapter, so record it:
Proposition 10.8 (Expansion of ). For all in a real inner product space,
Proof. By bilinearity and symmetry,
Replacing by and using gives the second identity.∎
Example 10.9 (Norm and distance in function space). In with , compute for , and the distance from to the constant function .
Solution. First the norm:
For the distance, , so
giving . Sanity check: and agree at and differ by at most anywhere, so the distance should be comfortably below , and is.□
Example 10.10 (Normalising a polynomial). In with , normalise .
Solution.
so and the normalisation is
Check: .□
The word norm has a life independent of inner products, and it is worth knowing which properties are which.
Definition 10.11 (Norm axioms). A norm on a real vector space is a function with
- , and only for ;
- for all scalars ;
- the triangle inequality .
The first two we have already verified for the induced norm. The third takes work, and the work is Cauchy–Schwarz, which is the next section. Meanwhile, not every norm comes from an inner product: on the taxicab norm and the max norm satisfy all three axioms but, as the parallelogram law will show, are not induced by any inner product.
Pitfall. in general, and the failure is the whole point. Equality holds only when and point the same way. Students who "distribute" a norm over a sum — or, worse, write without checking orthogonality — are committing the same error twice.
10.3Cauchy–Schwarz and the triangle inequality
Everything metric in this chapter rests on one inequality, and it has a one-line proof once you see the right vector to square.
Theorem 10.12 (Cauchy–Schwarz inequality). For all in a real inner product space,
with equality if and only if and are linearly dependent.
Proof. If both sides are and are dependent, so assume and set
The vector is with its -component removed, and it is orthogonal to : indeed . Now expand using the expansion proposition, whose cross term vanishes:
Since this gives , and taking square roots yields the inequality.
Equality forces , hence by positive definiteness, hence : the vectors are dependent. Conversely if then .∎
The proof is worth rereading, because it is the chapter in miniature: split into a piece along and a piece orthogonal to , then observe that the orthogonal piece only ever adds to the length. That decomposition reappears as orthogonal projection, as Bessel's inequality, and as the best-approximation theorem.
Corollary 10.13 (Triangle inequality). for all , so the induced norm really is a norm.
Proof. Expand and apply Cauchy–Schwarz to the cross term:
Both sides are nonnegative, so taking square roots preserves the inequality.∎
Corollary 10.14 (Reverse triangle inequality).
Proof. Write and apply the triangle inequality: , so . Swapping and gives . Together these bound the absolute value.∎
Intuition. Cauchy–Schwarz says that the "agreement" between two vectors can never exceed the product of their sizes — you cannot get more overlap out of two arrows than their lengths allow. In the function space it says something far less obvious: for any two continuous functions,
That is a genuine theorem about integrals, and we got it for free from four axioms about arrows.
Example 10.15 (Cauchy–Schwarz on a concrete pair). Verify Cauchy–Schwarz for and in , and report the ratio .
Solution. . Also and . So , as promised, and the ratio is . The vectors are not parallel, so strict inequality is expected.□
Example 10.16 (An integral inequality from the axioms). Show that for every continuous on ,
Solution. Apply Cauchy–Schwarz in with . Then , , and . The inequality reads exactly as claimed.
Equality holds iff and are dependent, i.e. iff is constant — which matches intuition: averaging destroys information unless there was no variation to destroy.□
Example 10.17 (A sharp numerical bound). Among all with , how large can be?
Solution. Write . By Cauchy–Schwarz this is at most .
Equality requires parallel to and of unit norm, so , which indeed gives . The maximum is . This is the standard trick for bounding a linear expression on a sphere, and it works verbatim in function space.□
Pitfall. Cauchy–Schwarz bounds the absolute value of the inner product. Forgetting the bars loses the lower bound , which is the half you need when you are minimising rather than maximising.
10.4Angles, orthogonality and the Pythagorean theorem
Cauchy–Schwarz has a consequence that is easy to overlook: for nonzero the quotient
always lies in . Every number in that range is the cosine of exactly one angle in , so the quotient defines an angle — in any inner product space whatsoever.
Definition 10.18 (Angle between vectors). For nonzero in a real inner product space, the angle between them is the unique solution of
In and this agrees with the angle you would measure with a protractor — that is the content of the law of cosines. In it is a definition with no prior meaning, and it is none the worse for that: it is how one says that two signals are "nearly aligned" or "in quadrature".
Definition 10.19 (Orthogonality). Vectors and are orthogonal, written , if . A set is orthogonal if its vectors are pairwise orthogonal.
Orthogonality, not angle, is what gets used. The angle is a convenience; the vanishing of an inner product is a structural fact, and the rest of the chapter is a study of its consequences.
Theorem 10.20 (Pythagorean theorem). If then . More generally, if are pairwise orthogonal then
Proof. Expand the square: , and the cross term is zero by hypothesis. For vectors, bilinearity gives
and every term with vanishes, leaving .∎
Over the converse holds too: if then , so . (This converse fails over , as we note later.)
Orthogonality also buys independence, which is why orthogonal sets are such convenient bases.
Theorem 10.21 (Orthogonal sets are independent). An orthogonal set of nonzero vectors is linearly independent.
Proof. Suppose are pairwise orthogonal, all nonzero, and . Take the inner product of both sides with :
because every term with dies. Since we have , so . This holds for each , so the only relation is the trivial one.∎
That proof also reveals the trick that makes orthogonal bases so pleasant: to extract the coefficient of , pair with and everything else disappears. We exploit this systematically two sections from now.
Theorem 10.22 (Parallelogram law). In any inner product space,
Proof. Add the two expansions from the expansion proposition: the cross terms and cancel, leaving .∎
Geometrically: the sum of the squares of a parallelogram's diagonals equals the sum of the squares of its four sides. Its real use, though, is as a test. Any norm induced by an inner product must satisfy it, so a norm that violates it cannot come from one.
Example 10.23 (The taxicab norm has no inner product behind it). Show that on is not induced by any inner product.
Solution. Take and . Then and , so
while
The parallelogram law fails, so by the theorem above no inner product can induce . The same pair kills the max norm: there , giving .□
Remark. The converse is also true and is a classical theorem (Jordan–von Neumann): a norm satisfying the parallelogram law is induced by an inner product, and the inner product can be recovered from the norm by the polarisation identity
which follows by subtracting the two expansions. So "inner product" and "norm obeying the parallelogram law" are the same information packaged two ways.
Example 10.24 (An angle in function space). In with the integral inner product, find the angle between and .
Solution. Compute the three quantities:
Hence
so . The constant function and the identity function "agree" strongly, which is why fitting data with a line rather than a constant often changes the intercept so much: the two basis functions are far from perpendicular.□
Example 10.25 (Making two functions orthogonal). Find the constant for which is orthogonal to in .
Solution. Require
so . The function is the "mean-zero part" of ; subtracting the average is exactly the act of making something orthogonal to the constants. This is the first step of Gram–Schmidt, performed by hand.□
Example 10.26 (Orthogonality in the trace inner product). For which are and orthogonal in ?
Solution. . This vanishes exactly when .□
Pitfall. The Pythagorean theorem needs pairwise orthogonality, not just "the vectors look spread out". For three vectors, requires all three cross terms to vanish. Two orthogonal pairs and one non-orthogonal pair is not enough.
10.5Orthonormal sets and coordinates
Normalising an orthogonal set costs nothing and simplifies every formula that follows.
Definition 10.27 (Orthonormal set). A set is orthonormal if
An orthonormal basis of is an orthonormal set that is also a basis.
Since orthonormal vectors are nonzero and pairwise orthogonal, they are automatically independent. So in an -dimensional space, any orthonormal set of vectors is already a basis — no further checking required.
The reason to want such a basis is that coordinates become inner products, computed one at a time, with no linear system to solve.
Theorem 10.28 (Coordinates in an orthonormal basis). Let be an orthonormal basis of . Then for every ,
More generally, for , .
Proof. Since the form a basis, for some scalars. Pair with :
which is the first formula. For the norm, apply the Pythagorean theorem to the pairwise orthogonal vectors : since . For the last identity, write and pair with using bilinearity.∎
The third formula deserves a name: it says that the coordinate map carries the inner product of to the standard dot product on . Every -dimensional real inner product space is, in this precise sense, a copy of with the dot product. The abstraction costs nothing in finite dimensions and buys everything in infinite ones, where no finite basis exists.
Intuition. An orthonormal basis is a set of independent measuring instruments. To know a vector you interrogate it once per instrument — "how much are you?", "how much ? " — and the answers never interfere. With a skewed basis, by contrast, the coefficient of depends on all the other basis vectors at once, and you must solve a system to get it. That is the whole practical difference.
Example 10.29 (Coordinates against an orthonormal basis of ). Let and . Check orthonormality and express in this basis.
Solution. , and , likewise . So the set is orthonormal, hence a basis of .
So . Check with the norm formula: . Correct.□
Example 10.30 (An orthonormal basis of a matrix space). In with the trace inner product, show that the four matrix units form an orthonormal basis and find the coordinates of .
Solution. Since , we get if and otherwise — exactly orthonormality. Four orthonormal vectors in a -dimensional space form a basis.
The coordinates are the entries themselves: . Then , so , matching the Frobenius norm.□
Example 10.31 (Orthonormal functions). Show that is orthonormal in with .
Solution. Three norms and three cross terms. First , so . Next, using ,
so the other two are unit vectors. For the cross terms: and (both integrands integrate to zero over a full period), and , the integrand being odd. All three pairs are orthogonal, so the set is orthonormal.□
Pitfall. The formula is only valid for an orthonormal basis. For a merely orthogonal basis you must divide by the squared norms:
Dropping those denominators is the most common arithmetic slip in this chapter.
10.6Gram–Schmidt in a general inner product space
Orthonormal bases are so useful that one wants to know they always exist. They do, and the proof is an algorithm.
Theorem 10.32 (Gram–Schmidt). Let be linearly independent vectors in an inner product space . Define recursively
Then are nonzero, pairwise orthogonal, and
Normalising, gives an orthonormal set with the same spans. In particular, every finite-dimensional inner product space has an orthonormal basis.
Proof. Induct on . For the claims are trivial: and the spans agree.
Suppose are nonzero, pairwise orthogonal, and span the same subspace as — so all the denominators in the formula for are nonzero and the recursion is legal. Fix and pair with :
since only the term survives the sum. So is orthogonal to all earlier .
Next, . If were , then would equal a combination of , which by the inductive hypothesis lie in — contradicting the independence of the .
Finally the spans. By construction , and conversely . Combined with the inductive hypothesis, the two spans coincide.
For the last sentence, apply the process to any basis of a finite-dimensional ; the result is an orthogonal basis, and normalising gives an orthonormal one.∎
The subtracted sum is the projection of onto everything built so far; is what is left over, the genuinely new direction in . Nothing in the argument mentions , which is why the same three lines produce orthogonal polynomials, orthogonal wavelets, and the factorisation.
Intuition. Gram–Schmidt is the act of un-tilting a basis, one vector at a time, without changing what you can reach. Vector is kept as-is. Vector has its shadow along vector removed, so only its perpendicular part survives. Vector has its shadows along both previous directions removed. At every stage you can still build exactly the same subspaces as before — you have only replaced a leaning scaffold with a square one.
Method 10.33 (Running Gram–Schmidt by hand).
- Set and compute once; you will reuse it.
- For each new , compute against every previous .
- Subtract for each .
- Check orthogonality of the new against one earlier before moving on — an error here poisons everything after it.
- Normalise only at the end, to keep the arithmetic in fractions rather than surds.
Example 10.34 (Gram–Schmidt in ). Orthogonalise , , .
Solution. Take , with .
For : , so
with .
For : and . Hence
which is .
Check: and . Good. Normalising, .□
Example 10.35 (Gram–Schmidt with a weighted inner product). In with , orthogonalise , .
Solution. and . Then , so
Check: , as required. Here the answer happens to coincide with the standard one, but the norms do not: and , so the orthonormal basis is and .□
Example 10.36 (Orthogonalising polynomials on ). In with , orthogonalise and normalise.
Solution. , . Then , so , and
Normalising, the orthonormal basis is and . Check: .□
Pitfall. Gram–Schmidt's output depends on the order of the input vectors. Feeding gives a genuinely different orthogonal basis of the same space. There is no "the" orthonormal basis, which is why exam questions ask for a normalised vector with a stated sign convention, or for something order-independent like a projection.
10.7Orthogonal polynomials: Legendre and Chebyshev
Run Gram–Schmidt on the monomials inside and you manufacture a family of polynomials, orthogonal by construction, one of each degree. Different intervals and different weights produce the classical families, and these are among the most used objects in applied mathematics.
Definition 10.37 (Legendre polynomials). The Legendre polynomials are the polynomials obtained by applying Gram–Schmidt to in with
and then rescaling each so that .
The rescaling at the end is a convention that fixes the arbitrary constant Gram–Schmidt leaves behind; the directions are what matter, and those are forced.
Before computing, note a symmetry that halves the work. On the symmetric interval , the integral of an odd function is zero. Since is odd exactly when is odd, whenever is odd. Consequently an even monomial is automatically orthogonal to every odd one, and Gram–Schmidt need only subtract terms of matching parity.
Example 10.38 (Legendre polynomials from ). Apply Gram–Schmidt to in , and identify .
Solution. Step 1. , with .
Step 2. (odd integrand), so nothing is subtracted:
Step 3. For : and (odd). So
Check orthogonality: . Also
Normalisation to the Legendre convention. We need . Here , , and , so multiply the last by :
These are the standard Legendre polynomials. Continuing the process gives .□
Theorem 10.39 (Orthogonal polynomials have distinct real roots in the interval). Let be a nonzero polynomial of degree that is orthogonal in to every polynomial of degree less than . Then has distinct roots, all lying in the open interval .
Proof. Let be the points of at which changes sign, and set , with if . The product does not change sign anywhere on — at each both factors flip — and it is not identically zero, so
If then , and orthogonality forces , a contradiction. Hence . But has degree , so it has at most roots; therefore , the sign changes account for all the roots, and each is simple and lies in .∎
That theorem is why Gaussian quadrature works: the roots of are the sample points that integrate polynomials of degree up to exactly. The roots of are , and the two-point rule is exact for every cubic.
Definition 10.40 (Chebyshev polynomials). The Chebyshev polynomials are orthogonal in with respect to the weighted inner product
and satisfy , so , , , .
Example 10.41 (Chebyshev orthogonality by substitution). Verify that and are orthogonal in the Chebyshev inner product.
Solution. Substitute , so and for . The weight and the Jacobian cancel exactly:
For use :
So . The same computation gives for all , and , for .□
Remark. Changing the weight changes the geometry, and therefore changes which polynomials count as perpendicular. Weight on gives Legendre; weight gives Chebyshev; weight on gives Laguerre; weight on gives Hermite. Each family is the "right" basis for a different approximation problem, and all four come out of the same three lines of Gram–Schmidt.
10.8Orthogonal complements
Definition 10.42 (Orthogonal complement). Let be any subset of an inner product space . Its orthogonal complement is
Note that need not be a subspace — it can be a single vector or a random collection — but always is.
Proposition 10.43 ( is a subspace, and only the span matters). For any , the set is a subspace of , and .
Proof. The zero vector is orthogonal to everything, so . If and is a scalar, then for every ,
so : it is a subspace.
For the second claim, gives . Conversely if for all and is any combination, then , so .∎
The practical content of that last sentence: to check membership in you only test against a spanning set — a basis, or the rows of a matrix — never against all of .
Proposition 10.44 (Trivial intersection). If is a subspace then .
Proof. If lies in both, then is orthogonal to itself: . Positive definiteness forces .∎
Example 10.45 (A complement in ). Let . Find and a basis for it.
Solution. A vector lies in exactly when it is orthogonal to both spanning vectors:
This is a homogeneous system with matrix , of rank , so the solution space has dimension . Taking and as free variables gives and , so
A basis is , and . Note , which the next theorem explains.□
Theorem 10.46 (Orthogonal decomposition). Let be a finite-dimensional subspace of an inner product space . Then
meaning every can be written uniquely as with and . If itself is finite-dimensional, .
Proof. Existence. By Gram–Schmidt, has an orthonormal basis . Given , set
To see , pair with each :
So is orthogonal to a basis of , hence to all of by the previous proposition. Thus as required.
Uniqueness. If with and , then lies in , so and .
Dimensions. Concatenating a basis of with a basis of gives a spanning set of by existence, and it is independent because a dependence would produce a nonzero vector of . Counting gives .∎
Corollary 10.47 (Double complement). If is a finite-dimensional subspace of , then .
Proof. If then is orthogonal to every element of by definition, so .
Conversely take . By the decomposition theorem write with , . Then is a difference of two vectors of (using ), so . But as well, so lies in . Hence .∎
Pitfall. can fail in infinite dimensions if is not closed. In the subspace of polynomials has orthogonal complement — a continuous function orthogonal to every polynomial is zero, by the Weierstrass approximation theorem — so is all of , strictly larger than . The finite-dimensionality hypothesis is not decoration.
Intuition. Picture a plane through the origin in . Its complement is the single line perpendicular to it. Every vector in space splits, in exactly one way, into "the part lying in the plane" plus "the part sticking straight out of it" — a shadow and a height. The decomposition theorem says this happens in every inner product space, with subspaces of any dimension, including spaces of functions where "sticking out" has no visual meaning at all.
Example 10.48 (The four fundamental subspaces, in one line). For a real matrix , show that and .
Solution. A vector satisfies exactly when every row of dots to zero with — that is, exactly when is orthogonal to every row, hence to their span. So .
Applying this to , whose rows are the columns of , gives .
Combining with the decomposition theorem recovers the rank–nullity theorem in geometric form: , because .□
Example 10.49 (Complement of a line in function space). In with , find a basis of where .
Solution. A polynomial lies in iff
i.e. iff . So , and a basis is — the Legendre directions and , as expected. Here .□
10.9Orthogonal projection and best approximation
The produced by the decomposition theorem deserves its own name, because it answers an optimisation problem.
Definition 10.50 (Orthogonal projection onto a subspace). Let be a finite-dimensional subspace with orthonormal basis . The orthogonal projection of onto is
With a merely orthogonal basis the formula reads .
The definition looks basis-dependent, but it is not: by the uniqueness half of the decomposition theorem, is the component of in , and any orthonormal basis of produces it. That is worth remembering when a question asks for a projection but not for a basis — the answer is order-independent even though Gram–Schmidt's output is not.
Theorem 10.51 (Best approximation). Let be a finite-dimensional subspace of and . Then for every with ,
So is the unique closest point of to .
Proof. Write and let . Split
The first summand lies in and the second lies in , so they are orthogonal, and the Pythagorean theorem gives
The last term is strictly positive unless . Hence for every other , and taking square roots finishes the proof.∎
That single computation is the reason projections matter in every applied field: least squares, regression, filtering, data compression and numerical approximation are all "project onto the subspace of things you can build". The error is orthogonal to the model space — the residual contains nothing the model could have captured.
Intuition. Stand a lamp directly above a table. A pencil held in the air casts a shadow on the tabletop, and of all the points on the table, the tip of the shadow is the one nearest the pencil tip. Why? Because the line from pencil tip to shadow tip is vertical — orthogonal to the table — and any other route to the table is the hypotenuse of a right triangle with that vertical as one leg. The best-approximation theorem is this observation, with "table" replaced by any subspace.
Example 10.52 (Projection onto a plane in ). Project onto and find the distance from to .
Solution. The spanning vectors are not orthogonal, so orthogonalise first. Take , ; then , so
Now project: and . So
The residual is , with norm
Sanity check: the residual should be orthogonal to both spanning vectors. and . Correct.□
Example 10.53 (Least-squares line fit to a function). Find the polynomial of degree at most that best approximates on in the least-squares sense, i.e. minimising .
Solution. The subspace is , and on these two are already orthogonal: . Their squared norms are and .
Two integrals are needed. First
Second, by parts with , :
Therefore
Numerically that is . Sanity check: the constant term is the average value of over , namely , which is what a mean-square fit should give for the constant when the basis is orthogonal. Note that the fitted line is not the tangent line at , which would be : least squares balances error across the whole interval rather than matching perfectly at one point.□
Example 10.54 (Best linear approximation to a cubic). Find the best approximation to in on , and compute the resulting minimum error .
Solution. Again use the orthogonal basis . By parity, , and
So
For the error, use the Pythagorean split . Here and , so
giving . Sanity check: the error must be smaller than , and it is.□
Pitfall. Project onto an orthogonal basis or not at all. Writing for a basis that has not been orthogonalised gives a vector in , but not the nearest one, and the residual will not be orthogonal to . If in doubt, verify at the end that is orthogonal to every basis vector of — that check is both necessary and sufficient.
10.10Bessel's inequality and Parseval's identity
Projecting onto a subspace can only shorten a vector, and saying so quantitatively gives an inequality that controls every approximation scheme built on orthonormal sets.
Theorem 10.55 (Bessel's inequality). Let be an orthonormal set in an inner product space (not necessarily a basis). Then for every ,
Proof. Let and . Then with the two pieces orthogonal, so by the Pythagorean theorem
By the coordinate formula, , which gives the inequality. Equality holds precisely when , i.e. when .∎
The proof also shows the deficit exactly: is the squared distance from to the span. So Bessel is a bookkeeping statement — the coefficients account for part of the energy of , never more.
Corollary 10.56 (Parseval's identity). If is an orthonormal basis of , then for all
Proof. When the orthonormal set is a basis, , so and Bessel's inequality becomes an equality — that is the first formula (already obtained in the coordinates theorem). The second follows by expanding and pairing with .∎
Intuition. Think of as the energy that carries in channel . Bessel says you can never extract more energy than the signal contains: a partial set of channels captures part of it. Parseval says that a complete set of channels loses nothing — every bit of the signal shows up somewhere. That is exactly the claim an audio engineer makes when asserting that a spectrum contains the same information as the waveform.
Example 10.57 (Bessel with an incomplete set). In let and . Verify Bessel's inequality for and identify the deficit.
Solution. and . So the coefficient sum is , while . Indeed .
The deficit is , which is the squared distance from to the -plane spanned by — namely . Adding contributes and turns Bessel into Parseval.□
Example 10.58 (Parseval in a rotated basis). Let , and . Confirm Parseval's identity.
Solution. , . Then
Parseval holds, as it must for an orthonormal basis: the norm does not care which orthonormal ruler you measure with.□
Example 10.59 (Bessel in function space). In with , take the orthonormal set , . Compute the Bessel sum for and compare with .
Solution. First normalise correctly: so ; so .
Now , and by parity.
So the Bessel sum is , while . Since , the inequality holds. The deficit is exactly computed earlier — the missing energy of is its Legendre- component, as it should be.□
Pitfall. Bessel's inequality does not need the orthonormal set to be a basis, but it does need it to be orthonormal. With a merely orthogonal set the correct statement is . Forgetting the denominators can make the left side exceed the right and look like a counterexample to a true theorem.
10.11Fourier series as orthogonal projection
Everything in the last three sections applies verbatim when the subspace is spanned by sines and cosines, and what comes out is the classical Fourier series. This is the single best advertisement for the abstract point of view: an entire branch of analysis is the best-approximation theorem in a particular inner product space.
Work in with
Proposition 10.60 (The trigonometric system is orthogonal). The functions are pairwise orthogonal in , with
Proof. Use the product-to-sum identities. For ,
since for every nonzero integer . The same identity with gives orthogonality of distinct sines. For a sine against a cosine,
because the integrand is odd. Orthogonality to the constant is the case . For the norms, integrates to over , and likewise .∎
Definition 10.61 (Fourier coefficients and the -th partial sum). Let . For , the Fourier coefficients are
and the -th Fourier partial sum is
Theorem 10.62 (Fourier partial sums are orthogonal projections). . Consequently is the unique element of minimising over .
Proof. The trigonometric system is an orthogonal basis of , so the projection formula gives
Substituting the norms from the previous proposition, the constant term is — which is why the definition carries that awkward factor of one half — and the -th coefficients are and . That is exactly . The minimising property is the best-approximation theorem.∎
Intuition. A Fourier coefficient is the answer to one question: "how much pure tone of frequency is in this signal?" You get the answer by multiplying the signal against that tone and integrating — the tone resonates with its own component and averages to nothing against every other. Truncating at is not an approximation you chose for convenience; it is provably the closest that any combination of the first harmonics can come.
Example 10.63 (The Fourier series of ). Compute the Fourier coefficients of on .
Solution. Parity does most of the work. is odd and is even, so every product is odd and
For the sine coefficients, is even, so integrate over half the range and double. Integrating by parts with , :
Since , this is . Therefore
and
Sanity check at : every even harmonic vanishes there, and the odd ones alternate, so the series collapses to
which is , as it should be.□
Example 10.64 (A Fourier coefficient of a step function). Let for and for . Compute and .
Solution. is odd, so all vanish and . Now
which is for odd and for even . Hence
The square wave contains only odd harmonics — a fact audible in the timbre of a square-wave synthesiser.□
Example 10.65 (Parseval, and the value of ). Use Parseval's identity for on to evaluate .
Solution. For the trigonometric system, Parseval in its classical form reads
which is the orthogonal-basis identity written out with .
Here and , so . The left side is
Equating,
Euler's celebrated sum, obtained from the norm of the identity function. Sanity check: , and is already climbing towards it.□
Pitfall. The in the partial sum is not a typo and not a convention you may drop. It arises because while — the constant function is "twice as long" as the harmonics. Defining by the same formula as the other and then writing rather than doubles the mean of your approximation.
10.12Complex inner product spaces
Over the naive definition collapses. If we demanded symmetry and bilinearity, then for ,
so and could not both have positive "length". Positive definiteness and bilinearity are incompatible over , and the fix — forced, not chosen — is to conjugate.
Definition 10.66 (Complex inner product space). Let be a vector space over . A complex inner product is a map such that for all and :
- Conjugate symmetry: .
- Linearity in the first slot: .
- Positive definiteness: is real and , with equality only for .
Conjugate symmetry makes axiom 3 sensible: forces to be real before we can ask it to be positive. The price is that the second slot is only conjugate-linear:
A map with these properties is called sesquilinear — "one and a half times linear". Everything else in the chapter survives with replaced by at the appropriate places.
Example 10.67 (The standard inner product on ). Define . Verify the axioms and compute and for , .
Solution. Conjugate symmetry: . Linearity in the first slot is clear. Positivity:
zero only if every . Note how the conjugate rescues this: without it we would get , which for is .
For the numbers: . And
Check conjugate symmetry numerically: . Correct.□
Theorem 10.68 (Complex Cauchy–Schwarz). In a complex inner product space, , with equality iff are linearly dependent.
Proof. Assume and put , . Then
so , and also . Expanding with the sesquilinear rules, the cross terms and both vanish, leaving
Drop and rearrange. Equality forces , i.e. .∎
The triangle inequality follows as before, using in the cross term of
That expansion also shows why the converse of Pythagoras fails over : only forces the real part of to vanish. In , the vectors and satisfy it without being orthogonal.
Definition 10.69 (Conjugate transpose). For a complex matrix , the conjugate transpose (or adjoint) is , so .
A matrix is Hermitian (self-adjoint) if , skew-Hermitian if , and unitary if .
Proposition 10.70 (The defining property of ). For all and , and any complex matrix ,
Moreover and .
Proof. Writing the standard inner product as (a matrix),
using . The product rule follows from and ; the involution rule from .∎
Example 10.71 (Computing a conjugate transpose). Find for , and determine whether is Hermitian.
Solution. Transpose and conjugate every entry:
Since , the matrix is not Hermitian. In fact no Hermitian matrix can have a non-real diagonal entry: is forced.□
Proposition 10.72 (Hermitian matrices have real diagonal and real quadratic form). If is Hermitian then every diagonal entry is real, and is real for every .
Proof. Setting in gives , so . For the quadratic form,
using conjugate symmetry and then . A complex number equal to its own conjugate is real.∎
That proposition is the engine behind one of the headline facts of the next chapter: the eigenvalues of a Hermitian matrix are real, because if with then is real and .
Theorem 10.73 (Characterisations of unitary matrices). For a square complex matrix the following are equivalent:
- (that is, is unitary);
- the columns of form an orthonormal basis of ;
- for every ;
- for all .
Proof. : the entry of is where is the -th column. So says precisely that the columns are orthonormal; orthonormal vectors in form a basis.
: .
: take and square-root.
: and , so for all . The matrix is Hermitian, and a Hermitian matrix with is zero: taking gives , and taking and then gives and (sign) , whence . So .∎
Unitary matrices are the complex rotations: they move vectors without changing any length or any angle. Their real counterparts, with , are the orthogonal matrices.
Example 10.74 (Testing a matrix for unitarity). Is unitary?
Solution. Compute : conjugate and transpose gives . Then
So yes. Equivalently, the columns and each have norm and inner product .□
Pitfall. In the quantity — no conjugate — is a perfectly good bilinear form but it is not the inner product, and it can be zero for a nonzero vector: satisfies . Whenever complex entries appear, conjugate the second argument, and remember that pulls scalars out of the second slot conjugated.
10.13The adjoint of a linear operator
The conjugate transpose was defined by a formula. The right definition is coordinate-free, and it makes sense in any finite-dimensional inner product space, real or complex.
Definition 10.75 (Adjoint). Let be linear, with finite-dimensional inner product spaces. The adjoint of is the map satisfying
Theorem 10.76 (Existence and uniqueness of the adjoint). Every linear between finite-dimensional inner product spaces has exactly one adjoint, and is linear.
Proof. Uniqueness. If and both satisfy the defining identity, then for every . Taking gives , so for every .
Existence. Choose an orthonormal basis of (Gram–Schmidt supplies one) and define
This is a well-defined element of . To check the identity it suffices to verify it for , since both sides are linear in (over ; over , both sides are linear in as well, the conjugation sitting in the second slot). Using the coordinate formula,
because pairing against the sum picks out the -th coefficient conjugated. Linearity of follows from uniqueness applied to rearranged, or directly from the displayed formula.∎
Theorem 10.77 (Matrix of the adjoint). Let be an orthonormal basis of and an orthonormal basis of . Then
the conjugate transpose of the matrix of .
Proof. Because is orthonormal, the entry of is the -th coordinate of , namely . Likewise the entry of is
So .∎
Orthonormality is essential: in a skewed basis the coordinates are not inner products, and the matrix of is for the Gram matrix of the basis, not itself.
Definition 10.78 (Self-adjoint operator). An operator is self-adjoint (Hermitian) if , i.e. for all .
Example 10.79 (The adjoint of a projection). Let be the orthogonal projection of onto a finite-dimensional subspace . Show is self-adjoint and .
Solution. Write and with . Then
since is orthogonal to . By exactly the same argument . The two agree, so .
For idempotence: already lies in , and the closest point of to a point of is itself, so .□
Example 10.80 (Adjoint of a differentiation-type operator). On with the standard inner product, let (the shift). Find .
Solution. The matrix of in the standard (orthonormal) basis is
so (real entries, so conjugation does nothing), giving — the backward shift. Check directly: and . They agree.□
Example 10.81 (A self-adjoint operator on a matrix space). On with the trace inner product, let . Show is self-adjoint.
Solution. We must check , i.e. . Using the entrywise description ,
The two sums contain the same terms, relabelled by swapping the names of and . Hence . (It also satisfies , so is both self-adjoint and an involution; its eigenvalues are , with eigenspaces the symmetric and antisymmetric matrices.)□
Proposition 10.82 (Kernel and image of the adjoint). For linear between finite-dimensional inner product spaces,
Proof. For the first: means , which implies for all , i.e. . Conversely if then for all ; taking gives .
The second follows by applying the first to (using ) and taking complements: , so by the double-complement corollary.∎
Taking to be multiplication by a real matrix , this is the four-fundamental-subspaces statement again, now proved without ever writing a row.
Remark. Self-adjointness is the hypothesis of the spectral theorem, the summit of the subject: every self-adjoint operator on a finite-dimensional inner product space has an orthonormal basis of eigenvectors, and all its eigenvalues are real. In matrix form: a real symmetric factors as with orthogonal and diagonal; a Hermitian factors as with unitary. The two ingredients of the proof are already in this chapter — the reality of for Hermitian , and the fact that the orthogonal complement of an eigenvector is invariant under — and the chapter on eigenvalues and diagonalisation assembles them.
Summary. An inner product is a positive definite, symmetric (conjugate-symmetric) bilinear (sesquilinear) form. It induces a norm and a distance. Cauchy–Schwarz, , gives the triangle inequality and defines angles. Orthogonal sets are independent and obey Pythagoras; Gram–Schmidt turns any independent set into an orthogonal one with the same spans, producing orthonormal bases, Legendre and Chebyshev polynomials. Every finite-dimensional subspace gives , with the unique nearest point of — the engine of least squares and of Fourier series. Bessel bounds the captured energy; Parseval says a full orthonormal basis captures all of it. Over one conjugates the second slot, transposition becomes , and the operators worth studying are the self-adjoint and the unitary ones.
- Assuming a symmetric bilinear form is an inner product. Positive definiteness is a separate requirement and the one that usually fails. Test on a suspicious vector before using any geometry.
- Using weights that are not all positive. is an inner product only when every ; a single zero or negative weight destroys axiom 4.
- Forgetting the denominators in the projection formula. For an orthogonal (not orthonormal) basis, . Dropping is the most common arithmetic error in the chapter.
- Projecting onto a non-orthogonal spanning set. Gram–Schmidt first, always — otherwise the "projection" is some vector in , but not the nearest one, and the residual will not be orthogonal to .
- **Writing without checking orthogonality.** The cross term vanishes only when , and for three or more vectors *every* pair must be orthogonal.
- Treating Gram–Schmidt output as canonical. Reordering the inputs gives a different orthonormal basis. Projections, distances and dimensions are order-independent; individual basis vectors are not.
- **Assuming in infinite dimensions.** It needs finite-dimensional (or closed). The polynomials inside are the standard counterexample.
- Dropping the absolute value in Cauchy–Schwarz. The inequality bounds ; the lower bound is the half you need when minimising.
- **Forgetting to conjugate in . ** , not ; the second slot is conjugate-linear, so ; and .
- **Expecting the converse of Pythagoras over . ** There only says .
- **Using in a non-orthonormal basis.** The identity is a theorem *about orthonormal bases*; in a skewed basis the Gram matrix intervenes.
- **Mishandling in a Fourier series.** The constant term is , because while .