Projection
This section is optional. It is a prerequisite only for the final two sections of Chapter Five, and some Topics.
We have described projection from into its -plane subspace as a shadow map. This shows why but it also shows that some shadows fall upward.
So perhaps a better description is: the projection of is the vector in the plane with the property that someone standing on and looking straight up or down—that is, looking orthogonally to the plane— sees the tip of . In this section we will generalize this to other projections, orthogonal and non-orthogonal.
Orthogonal Projection Into a Line
We first consider orthogonal projection of a vector into a line . This shows a figure walking out on the line to a point such that the tip of is directly above them, where “above” does not mean parallel to the -axis but instead means orthogonal to the line.
Since the line is the span of some vector , we have a coefficient with the property that is orthogonal to .
To solve for this coefficient, observe that because is orthogonal to a scalar multiple of , it must be orthogonal to itself. Then gives that .
Definition 1.1 The orthogonal projection of into the line spanned by a nonzero is this vector.
(That says ‘spanned by ’ instead the more formal ‘span of the set ’. This more casual phrase is common.)
Example 1.2 To orthogonally project the vector into the line , first pick a direction vector for the line.
The calculation is easy.
Example 1.3 In , the orthogonal projection of a general vector
into the -axis is
which matches our intuitive expectation.
The picture above showing the figure walking out on the line until ’s tip is overhead is one way to think of the orthogonal projection of a vector into a line. We finish this subsection with two other ways.
Example 1.4 A railroad car left on an east-west track without its brake is pushed by a wind blowing toward the northeast at fifteen miles per hour; what speed will the car reach?
For the wind we use a vector of length that points toward the northeast.
The car is only affected by the part of the wind blowing in the east-west direction—the part of in the direction of the -axis is this (the picture has the same perspective as the railroad car picture above).
So the car will reach a velocity of miles per hour toward the east.
Thus, another way to think of the picture that precedes the definition is that it shows as decomposed into two parts, the part with the line, and the part that is orthogonal to the line (shown above on the north-south axis). These two are non-interacting in the sense that the east-west car is not at all affected by the north-south part of the wind (see Exercise 1.10). So we can think of the orthogonal projection of into the line spanned by as the part of that lies in the direction of .
Still another useful way to think of orthogonal projection into a line is to have the person stand on the vector, not the line. This person holds a rope looped over the line. As they pull, the loop slides on the line.
When it is tight, the rope is orthogonal to the line. That is, we can think of the projection as being the vector in the line that is closest to (see Exercise 1.17).
Example 1.5 A submarine is tracking a ship moving along the line . Torpedo range is one-half mile. If the sub stays where it is, at the origin on the chart below, will the ship pass within range?
The formula for projection into a line does not immediately apply because the line doesn’t pass through the origin, and so isn’t the span of any . To adjust for this, we start by shifting the entire map down two units. Now the line is , a subspace. We project to get the point on the line closest to
the sub’s shifted position.
The distance between and is about miles. The ship will never be in range.
Exercises
Exercise 1.6 Worked answer
Recommended. Project the first vector orthogonally into the line spanned by the second vector.
,
,
,
,
Exercise 1.8 Worked answer
Although pictures guided our development of Definition 1.1, we are not restricted to spaces that we can draw. In project this vector into this line.
Answer.
Exercise 1.9 Worked answer
Recommended. Definition 1.1 uses two vectors and . Consider the transformation of resulting from fixing
and projecting into the line that is the span of . Apply it to these vectors.
Show that in general the projection transformation is this.
Express the action of this transformation with a matrix.
Exercise 1.10 Worked answer
Example 1.4 suggests that projection breaks into two parts, and , that are non-interacting. Recall that the two are orthogonal. Show that any two nonzero orthogonal vectors make up a linearly independent set.
Answer. Suppose that and are nonzero and orthogonal. Consider the linear relationship . Take the dot product of both sides of the equation with to get that
is equal to . With the assumption that is nonzero, this gives that is zero. Showing that is zero is similar.
Exercise 1.11 Worked answer
What is the orthogonal projection of into a line if is a member of that line?
Show that if is not a member of the line then the set is linearly independent.
Answer.
If the vector is in the line then the orthogonal projection is . To verify this by calculation, note that since is in the line we have that for some scalar .
(Remark. If we assume that is nonzero then we can simplify the above by taking to be .)
Write for the projection . Note that, by the assumption that is not in the line, both and are nonzero. Note also that if is zero then we are actually considering the one-element set , and with nonzero, this set is necessarily linearly independent. Therefore, we are left considering the case that is nonzero.
Setting up a linear relationship
leads to the equation . Because isn’t in the line, the scalars and must both be zero. We handled the case above, so the remaining case is that , and this gives that also. Hence the set is linearly independent.
Exercise 1.12 Worked answer
Definition 1.1 requires that be nonzero. Why? What is the right definition of the orthogonal projection of a vector into the (degenerate) line spanned by the zero vector?
Answer. If is the zero vector then the expression
contains a division by zero, and so is undefined. As for the right definition, for the projection to lie in the span of the zero vector, it must be defined to be .
Exercise 1.13 Worked answer
Are all vectors the projection of some other vector into some line?
Answer. Any vector in is the projection of some other into a line, provided that the dimension is greater than one. (Clearly, any vector is the projection of itself into a line containing itself; the question is to produce some vector other than that projects to .)
Suppose that with . If then we consider the line and if we take to be any (non-degenerate) line at all (actually, we needn’t distinguish between these two cases—see the prior exercise). Let be the components of ; since , there are at least two. If some is zero then the vector is perpendicular to . If none of the components is zero then the vector whose components are is perpendicular to . In either case, observe that does not equal , and that is the projection of into .
We can dispose of the remaining and cases. The dimension case is the trivial vector space, here there is only one vector and so it cannot be expressed as the projection of a different vector. In the dimension case there is only one (non-degenerate) line, and every vector is in it, hence every vector is the projection only of itself.
Exercise 1.14 Worked answer
Show that the projection of into the line spanned by has length equal to the absolute value of the number divided by the length of the vector .
Answer. The proof is a calculation. Recall that for any vector , the length is determined by . So this is the square of the length.
Exercise 1.15 Worked answer
Find the formula for the distance from a point to a line.
Answer. Because the projection of into the line spanned by is this,
the distance squared from the point to the line is this.
Exercise 1.16 Worked answer
Find the scalar such that the point is a minimum distance from the point by using Calculus (i.e., consider the distance function, set the first derivative equal to zero, and solve). Generalize to .
Answer. Because square root is a strictly increasing function, we can minimize instead of the square root of . The derivative is . Setting it equal to zero gives the only critical point.
Now the second derivative with respect to
is strictly positive (as long as neither nor is zero, in which case the question is trivial) and so the critical point is a minimum.
The generalization to is straightforward. Consider , take the derivative, etc.
Exercise 1.17 Worked answer
Recommended. Let be the orthogonal projection of onto a line . Show that is the point in the line closest to .
Answer. Suppose . Because this is orthogonal projection, the two vectors and are at a right angle. The Triangle Inequality applies and the hypotenuse is therefore at least as long as .
Exercise 1.18 Worked answer
Prove that the orthogonal projection of a vector into a line has length less than or equal to that of the vector.
Answer. For any vector , the length squared is given by . So this is the square of the projection’s length.
Thus the length is , the absolute value of divided by the length of . The Cauchy-Schwarz inequality, , gives that .
Exercise 1.19 Worked answer
Recommended. Show that the definition of orthogonal projection into a line does not depend on the spanning vector: if is a nonzero multiple of then equals .
Answer. Write for , and calculate: .
Exercise 1.20 Worked answer
Consider the function mapping the plane to itself that takes a vector to its projection into the line . These two each show that the map is linear, the first one in a way that is coordinate-bound (that is, it fixes a basis and then computes) and the second in a way that is more conceptual.
Produce a matrix that describes the function’s action.
Show that we can obtain this map by first rotating everything in the plane radians clockwise, then projecting into the -axis, and then rotating radians counterclockwise.
Answer.
Fixing
as the vector whose span is the line, the formula gives this action,
which is the effect of this matrix.
Rotating the entire plane radians clockwise brings the line to lie on the -axis. Now projecting and then rotating back has the desired effect.
Exercise 1.21 Worked answer
For let be the projection of into the line spanned by , let be the projection of into the line spanned by , let be the projection of into the line spanned by , etc., back and forth between the spans of and . That is, is the projection of into the span of if is even, and into the span of if is odd. Must that sequence of vectors eventually settle down—must there be a sufficiently large such that equals and equals ? If so, what is the earliest such ?
Answer. The sequence need not settle down. With
the projections are these.
This sequence doesn’t repeat.
Gram-Schmidt Orthogonalization
The prior subsection suggests that projecting into the line spanned by decomposes that vector into two parts
that are orthogonal and so are “non-interacting.” We now develop that suggestion.
Definition 2.1 Vectors are mutually orthogonal when any two are orthogonal: if then the dot product is zero.
Theorem 2.2 If the vectors in a set are mutually orthogonal and nonzero then that set is linearly independent.
Proof Consider . For , taking the dot product of with both sides of the equation , which gives , shows that since .
QED
Corollary 2.3 In a dimensional vector space, if the vectors in a size set are mutually orthogonal and nonzero then that set is a basis for the space.
Proof Any linearly independent size subset of a dimensional space is a basis.
QED
Of course, the converse of Corollary 2.3 does not hold—not every basis of every subspace of has mutually orthogonal vectors. However, we can get the partial converse that for every subspace of there is at least one basis consisting of mutually orthogonal vectors.
Example 2.4 The members and of this basis for are not orthogonal.
We will derive from a new basis for the space consisting of mutually orthogonal vectors. The first member of the new basis is just .
For the second member of the new basis, we subtract from the part in the direction of . This leaves the part of that is orthogonal to .
By the corollary is a basis for .
Definition 2.5 An orthogonal basis for a vector space is a basis of mutually orthogonal vectors.
Example 2.6 To produce from this basis for
an orthogonal basis, start by taking the first vector unchanged.
Get by subtracting from its part in the direction of .
Find by subtracting from the part in the direction of and also the part in the direction of .
As above, the corollary gives that the result is a basis for .
Theorem 2.7 (Gram-Schmidt orthogonalization) If is a basis for a subspace of then the vectors
form an orthogonal basis for the same subspace.
Remark 2.8 This is restricted to only because we have not given a definition of orthogonality for other spaces.
Proof We will use induction to check that each is nonzero, is in the span of , and is orthogonal to all preceding vectors . Then Corollary 2.3 gives that is a basis for the same space as is the starting basis.
We shall only cover the cases up to , to give the sense of the argument. The full argument is Exercise 2.28.
The case is trivial; taking to be makes it a nonzero vector since is a member of a basis, it is obviously in the span of , and the ‘orthogonal to all preceding vectors’ condition is satisfied vacuously.
In the case the expansion
shows that or else this would be a non-trivial linear dependence among the ’s (it is nontrivial because the coefficient of is ). It also shows that is in the span of . And, is orthogonal to the only preceding vector
because this projection is orthogonal.
The case is the same as the case except for one detail. As in the case, expand the definition.
By the first line , since isn’t in the span and therefore by the inductive hypothesis it isn’t in the span . By the second line is in the span of the first three ’s. Finally, the calculation below shows that is orthogonal to .
(Here is the difference with the case: as happened for the first term is because this projection is orthogonal, but here the second term in the second line is because is orthogonal to and so is orthogonal to any vector in the line spanned by .) A similar check shows that is also orthogonal to .
QED
In addition to having the vectors in the basis be orthogonal, we can also normalize each vector by dividing by its length, to end with an orthonormal basis. .
Example 2.9 From the orthogonal basis of Example 2.6, normalizing produces this orthonormal basis.
Besides its intuitive appeal, and its analogy with the standard basis for , an orthonormal basis also simplifies some computations. Exercise 2.22 is an example.
Exercises
Exercise 2.11 Worked answer
Recommended. Perform Gram-Schmidt on this basis for .
Check that the resulting vectors are orthogonal.
Answer. Call the given basis . First, . For the other, .
To check that they are orthogonal, just note that their dot product is zero.
Exercise 2.12 Worked answer
Recommended. Perform the Gram-Schmidt process on this basis for .
Answer. Call the given basis . First, .
Next, .
For the third, this is the formula
and here is the calculation.
Exercise 2.13 Worked answer
Recommended. Perform Gram-Schmidt on each of these bases for .
Then turn those orthogonal bases into orthonormal bases.
Answer.
This is the corresponding orthonormal basis.
Here is the orthonormal basis.
This is the associated orthonormal basis.
Exercise 2.14 Worked answer
Perform the Gram-Schmidt process on each of these bases for .
Then turn those orthogonal bases into orthonormal bases.
Answer.
The first basis vector is unchanged.
The second one comes from this calculation.
For the third the arithmetic is uglier but it is a straightforward calculation.
This is the orthonormal basis.
The first basis vector is what was given.
The second is here.
Here is the third.
Here is the associated orthonormal basis.
Exercise 2.15 Worked answer
Recommended. Find an orthonormal basis for this subspace of : the plane .
Answer. We can parametrize the given space can in this way.
So we take the basis
apply the Gram-Schmidt process to get this first basis vector
and this second one.
and then normalize.
Exercise 2.16 Worked answer
Find an orthonormal basis for this subspace of .
Answer. Reducing the linear system
and parametrizing gives this description of the subspace.
So we take the basis,
go through the Gram-Schmidt process with the first
and second basis vectors
and finish by normalizing.
Exercise 2.17 Worked answer
Show that any linearly independent subset of can be orthogonalized without changing its span.
Answer. A linearly independent subset of is a basis for its own span. Apply Theorem 2.7.
Remark. Here’s why the phrase ‘linearly independent’ is in the question. Dropping the phrase would require us to worry about two things. The first thing to worry about is that when we do the Gram-Schmidt process on a linearly dependent set then we get some zero vectors. For instance, with
we would get this.
This first thing is not so bad because the zero vector is by definition orthogonal to every other vector, so we could accept this situation as yielding an orthogonal set (although it of course can’t be normalized), or we just could modify the Gram-Schmidt procedure to throw out any zero vectors. The second thing to worry about if we drop the phrase ‘linearly independent’ from the question is that the set might be infinite. Of course, any subspace of the finite-dimensional must also be finite-dimensional so only finitely many of its members are linearly independent, but nonetheless, a “process” that examines the vectors in an infinite set one at a time would at least require some more elaboration in this question. A linearly independent subset of is automatically finite—in fact, of size or less—so the ‘linearly independent’ phrase obviates these concerns.
Exercise 2.18 Worked answer
What happens if we try to apply the Gram-Schmidt process to a finite set that is not a basis?
Answer. If that set is not linearly independent, then we get a zero vector. Otherwise (if our set is linearly independent but does not span the space), we are doing Gram-Schmidt on a set that is a basis for a subspace and so we get an orthogonal basis for a subspace.
Exercise 2.19 Worked answer
Recommended. What happens if we apply the Gram-Schmidt process to a basis that is already orthogonal?
Answer. The process leaves the basis unchanged.
Exercise 2.20 Worked answer
Let be a set of mutually orthogonal vectors in .
Prove that for any in the space, the vector is orthogonal to each of , …, .
Illustrate the prior item in by using as , using as , and taking to have components , , and .
Show that is the vector in the span of the set of ’s that is closest to . Hint. To the illustration done for the prior part, add a vector and apply the Pythagorean Theorem to the resulting triangle.
Answer.
The argument is as in the case of the proof of Theorem 2.7. The dot product
can be written as the sum of terms of the form with , and the term . The first kind of term equals zero because the ’s are mutually orthogonal. The other term is zero because this projection is orthogonal (that is, the projection definition makes it zero: equals, after all of the cancellation is done, zero).
The vector is in black and the vector is in gray.
The vector lies on the dotted line connecting the black vector to the gray one, that is, it is orthogonal to the -plane.
We get this diagram by following the hint.
The dashed triangle has a right angle where the gray vector meets the vertical dashed line ; this is what first item of this question proved. The Pythagorean theorem then gives that the hypotenuse—the segment from to any other vector—is longer than the vertical dashed line.
More formally, writing as , consider any other vector in the span . Note that
and that (because the first item shows the is orthogonal to each and so it is orthogonal to this linear combination of the ’s). Now apply the Pythagorean Theorem (i.e., the Triangle Inequality).
Exercise 2.21 Worked answer
Find a nonzero vector in that is orthogonal to both of these.
Answer. One way to proceed is to find a third vector so that the three together make a basis for , e.g.,
(the second vector is not dependent on the third because it has a nonzero second component, and the first is not dependent on the second and third because of its nonzero third component), and then apply the Gram-Schmidt process. The first element of the new basis is this.
And this is the second element.
Here is the final element.
The result is orthogonal to both and . It is therefore orthogonal to every vector in the span of the set , including the two vectors given in the question.
Exercise 2.22 Worked answer
Recommended. One advantage of orthogonal bases is that they simplify finding the representation of a vector with respect to that basis.
For this vector and this non-orthogonal basis for
first represent the vector with respect to the basis. Then project the vector into the span of each basis vector and .
With this orthogonal basis for
represent the same vector with respect to the basis. Then project the vector into the span of each basis vector. Note that the coefficients in the representation and the projection are the same.
Let be an orthogonal basis for some subspace of . Prove that for any in the subspace, the -th component of the representation is the scalar coefficient from .
Prove that .
Answer.
We can do the representation by eye.
The two projections are also easy.
As above, we can do the representation by eye
and the two projections are easy.
Note the recurrence of the and the .
Represent with respect to the basis
so that . To determine , take the dot product of both sides with .
Solving for yields the desired coefficient.
This is a restatement of the prior item.
Exercise 2.23 Worked answer
Bessel’s Inequality. Consider these orthonormal sets
along with the vector whose components are , , , and .
Find the coefficient for the projection of into the span of the vector in . Check that .
Find the coefficients and for the projection of into the spans of the two vectors in . Check that .
Find , , and associated with the vectors in , and , , , and for the vectors in . Check that and that .
Show that this holds in general: where is an orthonormal set and is coefficient of the projection of a vector from the space then . Hint. One way is to look at the inequality and expand the ’s.
Answer. First, .
,
, , ,
For the proof, we will do only the case because the completely general case is messier but no more enlightening. We follow the hint (recall that for any vector we have ).
(The two mixed terms in the third part of the third line are zero because and are orthogonal.) The result now follows on gathering like terms and on recognizing that and because these vectors are members of an orthonormal set.
Exercise 2.24 Worked answer
Prove or disprove: every vector in is in some orthogonal basis.
Answer. It is true, except for the zero vector. Every vector in except the zero vector is in a basis, and that basis can be orthogonalized.
Exercise 2.25 Worked answer
Show that the columns of an matrix form an orthonormal set if and only if the inverse of the matrix is its transpose. Produce such a matrix.
Answer. The case gives the idea. The set
is orthonormal if and only if these nine conditions all hold
(the three conditions in the lower left are redundant but nonetheless correct). Those, in turn, hold if and only if
as required.
This is an example, the inverse of this matrix is its transpose.
Exercise 2.26 Worked answer
Does the proof of Theorem 2.2 fail to consider the possibility that the set of vectors is empty (i.e., that )?
Answer. If the set is empty then the summation on the left side is the linear combination of the empty set of vectors, which by definition adds to the zero vector. In the second sentence, there is not such , so the ‘if …then …’ implication is vacuously true.
Exercise 2.27 Worked answer
Theorem 2.7 describes a change of basis from any basis to one that is orthogonal . Consider the change of basis matrix .
Prove that the matrix changing bases in the direction opposite to that of the theorem has an upper triangular shape—all of its entries below the main diagonal are zeros.
Prove that the inverse of an upper triangular matrix is also upper triangular (if the matrix is invertible, that is). This shows that the matrix changing bases in the direction described in the theorem is upper triangular.
Answer.
Part of the induction argument proving Theorem 2.7 checks that is in the span of . (The case in the proof illustrates.) Thus, in the change of basis matrix , the -th column has components through that are zero.
One way to see this is to recall the computational procedure that we use to find the inverse. We write the matrix, write the identity matrix next to it, and then we do Gauss-Jordan reduction. If the matrix starts out upper triangular then the Gauss-Jordan reduction involves only the Jordan half and these steps, when performed on the identity, will result in an upper triangular inverse matrix.
Exercise 2.28 Worked answer
Complete the induction argument in the proof of Theorem 2.7.
Answer. For the inductive step, we assume that for all in , these three conditions are true of each : (i) each is nonzero, (ii) each is a linear combination of the vectors , and (iii) each is orthogonal to all of the ’s prior to it (that is, with ). With those inductive hypotheses, consider .
By the inductive assumption (ii) we can expand each into a linear combination of
The fractions are scalars so this is a linear combination of linear combinations of . It is therefore just a linear combination of . Now, (i) it cannot sum to the zero vector because the equation would then describe a nontrivial linear relationship among the ’s that are given as members of a basis (the relationship is nontrivial because the coefficient of is ). Also, (ii) the equation gives as a combination of . Finally, for (iii), consider ; as in the case, the dot product of with can be rewritten to give two kinds of terms, (which is zero because the projection is orthogonal) and with and (which is zero because by the hypothesis (iii) the vectors and are orthogonal).
Projection Into a Subspace
This subsection uses material from the optional earlier subsection on Combining Subspaces.
The prior subsections project a vector into a line by decomposing it into two parts: the part in the line and the rest . To generalize projection to arbitrary subspaces we will follow this decomposition idea.
Definition 3.1 Let a vector space be a direct sum . Then for any with where , the projection of into along is .
This definition applies in spaces where we don’t have a ready definition of orthogonal. (Definitions of orthogonality for spaces other than the are perfectly possible but we haven’t seen any in this book.)
Example 3.2 The space of matrices is the direct sum of these two.
To project
into along , we first fix bases for the two subspaces.
Their concatenation
is a basis for the entire space because is the direct sum. So we can use it to represent .
The projection of into along keeps the part and drops the part.
Example 3.3 Both subscripts on are significant. The first subscript matters because the result of the projection is a member of . For an example showing that the second one matters, fix this plane subspace of and its basis.
We will compare the projections of this element of
into along these two subspaces (verification that and is routine).
Here are natural bases for and .
To project into along , represent with respect to the concatenation
and drop the term.
To project into along represent with respect to
and omit the part.
So projecting along different subspaces can give different results.
These pictures compare the two maps. Both show that the projection is indeed ‘into’ the plane and ‘along’ the line.
Notice that the projection along is not orthogonal since there are members of the plane that are not orthogonal to the dotted line. But the projection along is orthogonal.
We have seen two projection operations, orthogonal projection into a line as well as this subsections’s projection into an and along an , and we naturally ask whether they are related. The right-hand picture above suggests the answer—orthogonal projection into a line is a special case of this subsection’s projection; it is projection along a subspace perpendicular to the line.
Definition 3.4 The orthogonal complement of a subspace of is
(read “ perp”). The orthogonal projection of a vector is its projection into along .
Example 3.5 In , to find the orthogonal complement of the plane
we start with a basis for .
Any perpendicular to every vector in is perpendicular to every vector in the span of (the proof of this is Exercise 3.22). Therefore, the subspace consists of the vectors that satisfy these two conditions.
Those conditions give a linear system.
We are thus left with finding the null space of the map represented by the matrix, that is, with calculating the solution set of the homogeneous linear system.
Example 3.6 Where is the -plane subspace of , what is ? A common first reaction is that is the -plane but that’s not right because some vectors from the -plane are not perpendicular to every vector in the -plane.
Instead is the -axis, since proceeding as in the prior example and taking the natural basis for the -plane gives this.
Lemma 3.7 If is a subspace of then its orthogonal complement is also a subspace. The space is the direct sum of the two . For any the vector is perpendicular to every vector in .
Proof First, the orthogonal complement is a subspace of because it is a null space, namely the null space of the orthogonal projection map.
To show that the space is the direct sum of the two, start with any basis for . Expand it to a basis for the entire space and then apply the Gram-Schmidt process to get an orthogonal basis for . This is the concatenation of two bases: with the same number of members, , as , and . The first is a basis for so if we show that the second is a basis for then we will have that the entire space is the direct sum.
Exercise 2.22 from the prior subsection proves this about any orthogonal basis: each vector in the space is the sum of its orthogonal projections into the lines spanned by the basis vectors.
To check this, represent the vector as , apply to both sides , and solve to get , as desired.
Any member of the span of is orthogonal to any vector in so the span of is a subset of . To show that is a basis for we need only show the other containment, that any is an element of the span of . The prior paragraph works for this. Any gives this on projections into basis vectors from : . Therefore equation () gives that is a linear combination of . Thus is a basis for and is the direct sum of the two.
The final sentence of the lemma is proved in much the same way. Write . Then keeps only the part and drops the part: . Therefore consists of a linear combination of elements of and so is perpendicular to every vector in .
QED
Given a subspace, we could compute the orthogonal projection into that subspace by following the steps of that proof: finding a basis, expanding it to a basis for the entire space, applying Gram-Schmidt to get an orthogonal basis, and projecting into each linear subspace. However we will instead use a convenient formula.
Theorem 3.8 Let be a subspace of with basis and let be the matrix whose columns are the ’s. Then for any the orthogonal projection is , where the coefficients are the entries of the vector . That is, .
Proof The vector is a member of and so is a linear combination of basis vectors . Since ’s columns are the ’s, there is a such that . To find note that the vector is perpendicular to each member of the basis so
and solving gives this (showing that is invertible is an exercise).
Therefore , as required.
QED
Example 3.9 To orthogonally project this vector into this subspace
first make a matrix whose columns are a basis for the subspace
and then compute.
With the matrix, calculating the orthogonal projection of any vector into is easy.
Note, as a check, that this result is indeed in .
Exercises
Exercise 3.10 Worked answer
Recommended. Project the vectors into along .
Answer.
When bases for the subspaces
are concatenated
and the given vector is represented
then the answer comes from retaining the part and dropping the part.
When the bases
are concatenated, and the vector is represented,
then retaining only the part gives this answer.
With these bases
the representation with respect to the concatenation is this.
and so the projection is this.
Exercise 3.11 Worked answer
Recommended. Find .
Answer. As in Example 3.5, we can simplify the calculation by just finding the space of vectors perpendicular to all the the vectors in ’s basis.
Parametrizing to get
gives that
Parametrizing the one-equation linear system gives this description.
As in the answer to the prior part, we can describe as a span
and then is the set of vectors perpendicular to the one vector in this basis.
Parametrizing the linear requirement in the description of gives this basis.
Now, is the set of vectors perpendicular to (the one vector in) .
(By the way, this answer checks with the first item in this question.)
Every vector in the space is perpendicular to the zero vector so .
The appropriate description and basis for are routine.
Then
and so .
The description of is easy to find by parametrizing.
Finding here just requires solving a linear system with two equations
and parametrizing.
Here, is one-dimensional
and as a result, is two-dimensional.
Exercise 3.12 Worked answer
Recommended. Find the orthogonal projection of the vector into the subspace.
Answer. Where
straightforward, although tedious, calculation gives this.
When applied to the vector we get the projection.
Exercise 3.13 Worked answer
Recommended. With the same subspace as in the prior problem, find the orthogonal projection of this vector.
Answer. Using the matrix calculation from the prior answer, this
shows the vector is in the subspace .
Exercise 3.14 Worked answer
Recommended. Let be the orthogonal projection of onto a subspace . Show that is the point in the subspace closest to .
Answer. Suppose . Because this is orthogonal projection, the two vectors and are at a right angle. The Triangle Inequality applies and the hypotenuse is therefore at least as long as .
Exercise 3.15 Worked answer
This subsection shows how to project orthogonally in two ways, the method of Example 3.2 and 3.3, and the method of Theorem 3.8. To compare them, consider the plane specified by in .
Find a basis for .
Find and a basis for .
Represent this vector with respect to the concatenation of the two bases from the prior item.
Find the orthogonal projection of into by keeping only the part from the prior item.
Check that against the result from applying Theorem 3.8.
Answer.
Parametrizing the equation leads to this basis for .
Because is three-dimensional and is two-dimensional, the complement must be a line. Anyway, the calculation as in Example 3.5
gives this basis for .
The matrix of the projection
when applied to the vector, yields the expected result.
Exercise 3.16 Worked answer
We have three ways to find the orthogonal projection of a vector into a line, the Definition 1.1 way from the first subsection of this section, the Example 3.2 and 3.3 way of representing the vector with respect to a basis for the space and then keeping the part, and the way of Theorem 3.8. For these cases, do all three ways.
Answer.
Parametrizing gives this.
For the first way, we take the vector spanning the line to be
and the Definition 1.1 formula gives this.
For the second way, we fix
and so (as in Example 3.5 and 3.6, we can just find the vectors perpendicular to all of the members of the basis)
and representing the vector with respect to the concatenation gives this.
Keeping the part yields the answer.
The third part is also a simple calculation (there is a matrix in the middle, and the inverse of it is also )
which of course gives the same answer.
Parametrization gives this.
With that, the formula for the first way gives this.
To proceed by the second method we find ,
find the representation of the given vector with respect to the concatenation of the bases and
and retain only the part.
Finally, for the third method, the matrix calculation
followed by matrix-vector multiplication
gives the answer.
Exercise 3.17 Worked answer
Check that the operation of Definition 3.1 is well-defined. That is, in Example 3.2 and 3.3, doesn’t the answer depend on the choice of bases?
Answer. No, a decomposition of vectors into and does not depend on the bases chosen for the subspaces, as we showed in the Direct Sum subsection.
Exercise 3.18 Worked answer
What is the orthogonal projection into the trivial subspace?
Answer. The orthogonal projection of a vector into a subspace is a member of that subspace. Since a trivial subspace has only one member, , the projection of any vector must equal .
Exercise 3.19 Worked answer
What is the projection of into along if ?
Answer. The projection into along of a is . Decomposing gives and , and dropping the part but retaining the part results in a projection of .
Exercise 3.20 Worked answer
Show that if is a subspace with orthonormal basis then the orthogonal projection of into is this.
Answer. The proof of Lemma 3.7 shows that each vector is the sum of its orthogonal projections into the lines spanned by the basis vectors.
Since the basis is orthonormal, the bottom of each fraction has .
Exercise 3.21 Worked answer
Recommended. Prove that the map is the projection into along if and only if the map is the projection into along . (Recall the definition of the difference of two maps: .)
Answer. If then every vector decomposes uniquely as . For all the map gives if and only if , as required.
Exercise 3.22 Worked answer
Show that if a vector is perpendicular to every vector in a set then it is perpendicular to every vector in the span of that set.
Answer. Let be perpendicular to every . Then .
Exercise 3.23 Worked answer
True or false: the intersection of a subspace and its orthogonal complement is trivial.
Answer. True; the only vector orthogonal to itself is the zero vector.
Exercise 3.24 Worked answer
Show that the dimensions of orthogonal complements add to the dimension of the entire space.
Answer. This is immediate from the statement in Lemma 3.7 that the space is the direct sum of the two.
Exercise 3.25 Worked answer
Suppose that are such that for all complements , the projections of and into along are equal. Must equal ? (If so, what if we relax the condition to: all orthogonal projections of the two are equal?)
Answer. The two must be equal, even only under the seemingly weaker condition that they yield the same result on all orthogonal projections. Consider the subspace spanned by the set . Since each is in , the orthogonal projection of into is and the orthogonal projection of into is . For their projections into to be equal, they must be equal.
Exercise 3.26 Worked answer
Recommended. Let be subspaces of . The perp operator acts on subspaces; we can ask how it interacts with other such operations.
Show that two perps cancel: .
Prove that implies that .
Show that .
Answer.
We will show that the sets are mutually inclusive, and . For the first, if then by the definition of the perp operation, is perpendicular to every , and therefore (again by the definition of the perp operation) . For the other direction, consider . Lemma 3.7’s proof shows that and that we can give an orthogonal basis for the space such that the first half is a basis for and the second half is a basis for . The proof also checks that each vector in the space is the sum of its orthogonal projections into the lines spanned by these basis vectors.
Because , it is perpendicular to every vector in , and so the projections in the second half are all zero. Thus , which is a linear combination of vectors from , and so . (Remark. Here is a slicker way to do the second half: write the space both as and as . Because the first half showed that and the prior sentence shows that the dimension of the two subspaces and are equal, we can conclude that equals .)
Because , any that is perpendicular to every vector in is also perpendicular to every vector in . But that sentence simply says that .
We will again show that the sets are equal by mutual inclusion. The first direction is easy; any perpendicular to every vector in is perpendicular to every vector of the form (that is, every vector in ) and every vector of the form (every vector in ), and so . The second direction is also routine; any vector is perpendicular to any vector of the form because .
Exercise 3.27 Worked answer
Recommended. The material in this subsection allows us to express a geometric relationship that we have not yet seen between the range space and the null space of a linear map.
Represent given by
with respect to the standard bases and show that
is a member of the perp of the null space. Prove that is equal to the span of this vector.
Generalize that to apply to any .
Represent
with respect to the standard bases and show that
are both members of the perp of the null space. Prove that is the span of these two. (Hint. See the third item of Exercise 3.26.)
Generalize that to apply to any .
In [Strang 93] this is called the Fundamental Theorem of Linear Algebra
Answer.
The representation of
is this.
By the definition of
and this second description exactly says this.
The generalization is that for any there is a vector so that
and . We can prove this by, as in the prior item, representing with respect to the standard bases and taking to be the column vector gotten by transposing the one row of that matrix representation.
Of course,
and so the null space is this set.
That description makes clear that
and since is a subspace of , the span of the two vectors is a subspace of the perp of the null space. To see that this containment is an equality, take
in the third item of Exercise 3.26, as suggested in the hint.
As above, generalizing from the specific case is easy: for any the matrix representing the map with respect to the standard bases describes the action
and the description of the null space gives that on transposing the rows of
we have . ([Strang 93] describes this space as the transpose of the row space of .)
Exercise 3.28 Worked answer
Define a projection to be a linear transformation with the property that repeating the projection does nothing more than does the projection alone: for all .
Show that orthogonal projection into a line has that property.
Show that projection along a subspace has that property.
Show that for any such there is a basis for such that
where is the rank of .
Conclude that every projection is a projection along a subspace.
Also conclude that every projection has a representation
in block partial-identity form.
Answer.
First note that if a vector is already in the line then the orthogonal projection gives itself. One way to verify this is to apply the formula for projection into the line spanned by a vector , namely . Taking the line as (the case is separate but easy) gives , which simplifies to , as required.
Now, that answers the question because after once projecting into the line, the result is in that line. The prior paragraph says that projecting into the same line again will have no effect.
The argument here is similar to the one in the prior item. With , the projection of is . Now repeating the projection will give , as required, because the decomposition of a member of into the sum of a member of and a member of is . Thus, projecting twice into along has the same effect as projecting once.
As suggested by the prior items, the condition gives that leaves vectors in the range space unchanged, and hints that we should take , …, to be basis vectors for the range, that is, that we should take the range space of for (so that ). As for the complement, we write for the null space of and we will show that .
To show this, we can show that their intersection is trivial and that they sum to the entire space . For the first, if a vector is in the range space then there is a with , and the condition on gives that , while if that same vector is also in the null space then and so the intersection of the range space and null space is trivial. For the second, to write an arbitrary as the sum of a vector from the range space and a vector from the null space, the fact that the condition can be rewritten as suggests taking .
To finish we taking a basis for where is a basis for the range space and is a basis for the null space .
Every projection (as defined in this exercise) is a projection into its range space and along its null space.
This also follows immediately from the third item.
Exercise 3.29 Worked answer
A square matrix is symmetric if each entry equals the entry (i.e., if the matrix equals its transpose). Show that the projection matrix is symmetric. [Strang 80] Hint. Find properties of transposes by looking in the index under ‘transpose’.
Answer. For any matrix we have that , and for any two matrices , we have that (provided, of course, that the inverse and product are defined). Applying these two gives that the matrix equals its transpose.
References cited in this section
Strang 93
Gilbert Strang The Fundamental Theorem of Linear Algebra, American Mathematical Monthly, Nov. 1993, p. 848–855.
Strang 80
Gilbert Strang, Linear Algebra and its Applications, second edition, Harcourt Brace Jovanovich, 1980.