Books
Theme
Text size
Width

[ and ] go to the previous and next page.

Let 𝑊 be a subspace of an inner product space 𝑉, and let 𝐯∈𝑉. Which vector of 𝑊 is closest to 𝐯? When 𝑊 is a plane through 𝟎 in ℝ3, geometry gives the answer: drop the perpendicular from 𝐯 to 𝑊, and take its foot. This section turns that answer into a theorem about every inner product space, provided 𝑊 is finite-dimensional. The foot of the perpendicular is the orthogonal projection Pr𝑊(𝐯). If 𝑊 has an orthonormal basis, it is given by the formula from the proof of Bessel’s inequality (Theorem 6.3.24), and the Gram–Schmidt algorithm produces an orthonormal basis of every finite-dimensional subspace. The leftover vectors 𝐯−Pr𝑊(𝐯) make up the orthogonal complement 𝑊⟂, which turns out to be a complement of 𝑊 in the sense of Section 4.4. Since distances also make sense between functions, the same theorem answers questions such as: which quadratic polynomial is closest to 𝑒𝑡 on [−1,1]?

Throughout, 𝑉 is an inner product space over 𝔽, where 𝔽 is ℝ or ℂ (Notation 6.1.1). We do not assume that 𝑉 is finite-dimensional. The subspaces we project onto will be finite-dimensional, but the ambient space is often a space of functions.

6.4.1Projecting onto the span of an orthonormal list

Intuition (From a line to a plane). In Section 6.2.1 we split a vector 𝐱 against a nonzero vector 𝐲 as 𝐱=𝑐𝐲+𝐰, where 𝑐𝐲 lies on the line span(𝐲) and 𝐰⟂𝐲 (Figure 6.2.1). The vector 𝑐𝐲 is the foot of the perpendicular from 𝐱 to the line, and the requirement 𝐰⟂𝐲 forced 𝑐=⟨𝐱,𝐲⟩/‖𝐲‖2.

Now replace the line by a plane 𝑊 in ℝ3 spanned by orthonormal vectors 𝐮1,𝐮2, and look for the foot 𝐩 of the perpendicular from 𝐯 to 𝑊. That is, we want 𝐩∈𝑊 such that 𝐯−𝐩 is perpendicular to 𝑊. Write 𝐩=𝑎1𝐮1+𝑎2𝐮2. By Proposition 6.3.9(c), 𝐯−𝐩⟂𝑊 means that 𝐯−𝐩⟂𝐮𝑗 for 𝑗=1,2, and taking the inner product with 𝐮𝑗 isolates the coefficient 𝑎𝑗 (Technique 6.3.12):

0=⟨𝐯−𝐩,𝐮𝑗⟩=⟨𝐯,𝐮𝑗⟩−𝑎𝑗.

So 𝐩=⟨𝐯,𝐮1⟩𝐮1+⟨𝐯,𝐮2⟩𝐮2. Each term is the shadow of 𝐯 on one of the lines span(𝐮1) and span(𝐮2). So the foot of the perpendicular to the plane is the sum of the feet of the perpendiculars to the two lines (Figure 6.4.1).

The shadows can be computed separately and then added because 𝐮1⟂𝐮2. For a basis of 𝑊 that is not orthogonal, the sum of the shadows is not the foot; see the example after Corollary 6.3.21.

Figure 6.4.1. Projecting 𝐯 onto the shaded plane 𝑊=span(𝐮1,𝐮2), for orthonormal 𝐮1,𝐮2. The foot Pr𝒪︀(𝐯) of the perpendicular is the sum of the shadows ⟨𝐯,𝐮1⟩𝐮1 and ⟨𝐯,𝐮2⟩𝐮2 of 𝐯 on the two axes, and 𝐯−Pr𝒪︀(𝐯) is perpendicular to 𝑊.

Definition 6.4.1 (Projection onto the span of an orthonormal list). Let 𝒪︀=𝐮1,…,𝐮𝑘 be an orthonormal list in 𝑉. The projection onto span(𝒪︀) is the function Pr𝒪︀:𝑉→𝑉 given by

Pr𝒪︀(𝐯)=⟨𝐯,𝐮1⟩𝐮1+⋯+⟨𝐯,𝐮𝑘⟩𝐮𝑘.

If 𝑘=0, the sum is empty and Pr𝒪︀(𝐯)=𝟎.

This is the vector 𝐩 from the proof of Bessel’s inequality (Theorem 6.3.24). As with coordinates (Remark 6.3.19), 𝐯 goes in the first slot. For a single unit vector 𝐮, Pr𝐮(𝐯)=⟨𝐯,𝐮⟩𝐮 is the shadow of Technique 6.2.4, since there 𝑐=⟨𝐯,𝐮⟩/‖𝐮‖2=⟨𝐯,𝐮⟩.

Example 6.4.2 (A projection in ℝ3). Take the orthonormal list 𝒪︀=𝐮1,𝐮2 with 𝐮1=13(1,2,2) and 𝐮2=13(2,1,−2) from Example 6.3.16(c), and 𝐯=(1,2,3). In Example 6.3.20 we computed ⟨𝐯,𝐮1⟩=11/3 and ⟨𝐯,𝐮2⟩=−2/3. So

Pr𝒪︀(𝐯)=119(1,2,2)−29(2,1,−2)=19(7,20,26),

and 𝐯−Pr𝒪︀(𝐯)=19(2,−2,1). This vector is orthogonal to (1,2,2) and to (2,1,−2), as the intuition above predicts. Its squared length is 9/81=1/9, the deficit in Bessel’s inequality found in Example 6.3.25.

Example 6.4.3 (Projecting a function). Give 𝐶[−1,1] the inner product ⟨𝑓,𝑔⟩=∫−11𝑓(𝑡)𝑔(𝑡)d𝑡 (Proposition 6.1.13). By Example 6.3.17, 𝒪︀=1/2,3/2𝑡 is orthonormal. Since ∫−11𝑡2d𝑡=2/3 and ∫−11𝑡3d𝑡=0,

Pr𝒪︀(𝑡2)=⟨𝑡2,12⟩12+⟨𝑡2,32𝑡⟩32𝑡=12⋅23+0=13.

So 𝑡2−1/3 is orthogonal to 1 and to 𝑡. The polynomial 𝑥2−1/3 of Example 6.3.17 arises in exactly this way, and Section 6.4.2 turns the computation into an algorithm.

The next proposition collects what we know about Pr𝒪︀. Most of it was proved along the way to Bessel’s inequality.

Proposition 6.4.4 (Properties of Pr𝒪︀). Let 𝒪︀=𝐮1,…,𝐮𝑘 be an orthonormal list in 𝑉, let 𝑊=span(𝒪︀), and let 𝐯∈𝑉.

  1. (a)Pr𝒪︀(𝐯)∈𝑊.
  2. (b)𝐯−Pr𝒪︀(𝐯)∈𝑊⟂.
  3. (c)Pr𝒪︀(𝐯)=𝐯 if and only if 𝐯∈𝑊.
  4. (d)Pr𝒪︀ is linear.
  5. (e)‖𝐯‖2=‖Pr𝒪︀(𝐯)‖2+‖𝐯−Pr𝒪︀(𝐯)‖2, and ‖Pr𝒪︀(𝐯)‖2=∑𝑗=1𝑘|⟨𝐯,𝐮𝑗⟩|2. In particular ‖Pr𝒪︀(𝐯)‖≤‖𝐯‖, with equality if and only if 𝐯∈𝑊.

Proof.routine

Uses. Definition 6.4.1 (Projection onto the span of an orthonormal list), Definition 6.3.15 (Orthonormal list, orthonormal basis), Proposition 6.3.9 (Properties of 𝐴⟂), Proposition 6.3.18 (Coordinates in an orthonormal basis), Theorem 6.3.3 (Pythagorean theorem), Corollary 6.3.6 (Pythagoras for orthogonal lists), Proposition 6.1.27 (Basic properties of the norm)

Techniques. Take an inner product to isolate a coefficient (Technique 6.3.12)

Hint 1. For (b), compute ⟨𝐯−Pr𝒪︀(𝐯),𝐮𝑙⟩ for each 𝑙; then pass from the 𝐮𝑙 to all of 𝑊.
Hint 2. For (c), one direction is (a), and the other is Proposition 6.3.18(a). For (d), each coefficient ⟨𝐯,𝐮𝑗⟩ depends linearly on 𝐯.
Hint 3. For (e), apply the Pythagorean theorem to 𝐯=Pr𝒪︀(𝐯)+(𝐯−Pr𝒪︀(𝐯)), using (a) and (b).
Sketch. (a) Pr𝒪︀(𝐯) is a combination of the 𝐮𝑗. (b) ⟨𝐯−Pr𝒪︀(𝐯),𝐮𝑙⟩=⟨𝐯,𝐮𝑙⟩−∑𝑗⟨𝐯,𝐮𝑗⟩𝛿𝑗𝑙=0, and Proposition 6.3.9(c) upgrades orthogonality to each 𝐮𝑙 to orthogonality to 𝑊. (c) follows from (a) and Proposition 6.3.18(a). (d) follows from linearity of the inner product in the first slot. (e) is Pythagoras for the orthogonal pieces in (a) and (b), plus Corollary 6.3.6; equality means 𝐯−Pr𝒪︀(𝐯)=𝟎, which is (c).

(a) Pr𝒪︀(𝐯) is a linear combination of 𝐮1,…,𝐮𝑘.

(b) For each 𝑙, linearity in the first slot and orthonormality give

⟨𝐯−Pr𝒪︀(𝐯),𝐮𝑙⟩=⟨𝐯,𝐮𝑙⟩−∑𝑗=1𝑘⟨𝐯,𝐮𝑗⟩⟨𝐮𝑗,𝐮𝑙⟩=⟨𝐯,𝐮𝑙⟩−⟨𝐯,𝐮𝑙⟩=0.

So 𝐯−Pr𝒪︀(𝐯)∈𝒪︀⟂, and 𝒪︀⟂=span(𝒪︀)⟂=𝑊⟂ by Proposition 6.3.9(c).

(c) If Pr𝒪︀(𝐯)=𝐯, then 𝐯∈𝑊 by (a). Conversely, if 𝐯∈𝑊, then 𝐯=∑𝑗⟨𝐯,𝐮𝑗⟩𝐮𝑗=Pr𝒪︀(𝐯) by Proposition 6.3.18(a).

(d) For 𝐯,𝐯′∈𝑉 and 𝑎,𝑏∈𝔽, linearity in the first slot gives ⟨𝑎𝐯+𝑏𝐯′,𝐮𝑗⟩=𝑎⟨𝐯,𝐮𝑗⟩+𝑏⟨𝐯′,𝐮𝑗⟩ for each 𝑗. Multiplying by 𝐮𝑗 and summing over 𝑗 gives Pr𝒪︀(𝑎𝐯+𝑏𝐯′)=𝑎Pr𝒪︀(𝐯)+𝑏Pr𝒪︀(𝐯′).

(e) By (a) and (b), Pr𝒪︀(𝐯)⟂𝐯−Pr𝒪︀(𝐯), and these two vectors add up to 𝐯. So the first identity is Theorem 6.3.3(a). The second is Corollary 6.3.6 applied to Pr𝒪︀(𝐯)=∑𝑗⟨𝐯,𝐮𝑗⟩𝐮𝑗. Since ‖𝐯−Pr𝒪︀(𝐯)‖2≥0, the first identity gives ‖Pr𝒪︀(𝐯)‖2≤‖𝐯‖2, with equality if and only if ‖𝐯−Pr𝒪︀(𝐯)‖=0. By Proposition 6.1.27(a), that happens if and only if Pr𝒪︀(𝐯)=𝐯, that is, by (c), if and only if 𝐯∈𝑊. □

Part (e) is (6.3.2), and its inequality is Bessel’s inequality. The move behind it deserves a name, since it is the main source of upper bounds in this chapter.

Technique 6.4.5 (Projections shrink norms). Suppose 𝐱=𝐩+𝐪, where 𝐩 lies in a subspace 𝑊 and 𝐪⟂𝑊, as for 𝐩=Pr𝒪︀(𝐱) and 𝐪=𝐱−Pr𝒪︀(𝐱). By Pythagoras,

‖𝐱‖2=‖𝐩‖2+‖𝐪‖2.

So each piece is at most as long as 𝐱. Moreover ‖𝐩‖=‖𝐱‖ exactly when 𝐪=𝟎, that is, when 𝐱∈𝑊, and ‖𝐪‖=‖𝐱‖ exactly when 𝐩=𝟎.

Reach for it when you need an upper bound for a sum ∑𝑗|⟨𝐱,𝐮𝑗⟩|2 over an orthonormal list, which is ‖Pr𝒪︀(𝐱)‖2, or more generally when the quantity to be bounded is the length of one orthogonal piece of a vector whose length you know. The equality case turns the bound into a test for membership in 𝑊. The canonical example is Bessel’s inequality (Theorem 6.3.24). In Theorem 6.4.33 the error 𝐯−Pr𝑊(𝐯) turns out to be the piece of 𝐯−𝐰 orthogonal to 𝑊, for every 𝐰∈𝑊; and in infinite dimensions (Section 15.3) Bessel’s inequality survives where Parseval’s identity needs more work.

The projection is determined by orthogonality

Part (b) of Proposition 6.4.4 is the property that made 𝐩 the foot of the perpendicular in the intuition above. It determines Pr𝒪︀(𝐯) completely. This matters because the condition “𝐩∈𝑊 and 𝐯−𝐩⟂𝑊” mentions only the subspace 𝑊, not the orthonormal list 𝒪︀ that the formula uses.

Theorem 6.4.6 (The projection is characterized by orthogonality). Let 𝒪︀ be an orthonormal list in 𝑉, let 𝑊=span(𝒪︀), and let 𝐯∈𝑉. Then Pr𝒪︀(𝐯) is the unique vector 𝐩∈𝑉 such that

𝐩∈𝑊and𝐯−𝐩∈𝑊⟂.

Proof (by two candidates).routine

Uses. Proposition 6.4.4 (Properties of Pr𝒪︀), Proposition 6.3.9 (Properties of 𝐴⟂)

Techniques. Uniqueness via two candidates (Technique 1.1.8)

Hint 1. Existence is (a) and (b) of Proposition 6.4.4. For uniqueness, suppose that 𝐩 and 𝐩′ both have the two properties, and look at 𝐩−𝐩′.
Hint 2. 𝐩−𝐩′ lies in 𝑊. It is also the difference of 𝐯−𝐩′ and 𝐯−𝐩, which lie in 𝑊⟂. What is 𝑊∩𝑊⟂?
Sketch. Pr𝒪︀(𝐯) has both properties by Proposition 6.4.4. If 𝐩 and 𝐩′ both have them, then 𝐩−𝐩′∈𝑊, and 𝐩−𝐩′=(𝐯−𝐩′)−(𝐯−𝐩)∈𝑊⟂ because 𝑊⟂ is a subspace. So 𝐩−𝐩′∈𝑊∩𝑊⟂={𝟎}.

By (a) and (b) of Proposition 6.4.4, 𝐩=Pr𝒪︀(𝐯) has both properties. Suppose 𝐩 and 𝐩′ both have them. Since 𝑊 is a subspace, 𝐩−𝐩′∈𝑊. Since 𝑊⟂ is a subspace (Proposition 6.3.9(a)),

𝐩−𝐩′=(𝐯−𝐩′)−(𝐯−𝐩)∈𝑊⟂.

So 𝐩−𝐩′∈𝑊∩𝑊⟂, which is {𝟎} by Proposition 6.3.9(d). Hence 𝐩=𝐩′. □

Proof (by computing coordinates).routine

Uses. Proposition 6.3.18 (Coordinates in an orthonormal basis), Proposition 6.4.4 (Properties of Pr𝒪︀), Definition 6.4.1 (Projection onto the span of an orthonormal list)

Techniques. Take an inner product to isolate a coefficient (Technique 6.3.12)

Hint 1. Let 𝐩∈𝑊 with 𝐯−𝐩⟂𝑊. Since 𝐩∈span(𝒪︀), Proposition 6.3.18(a) expresses 𝐩 through the numbers ⟨𝐩,𝐮𝑗⟩.
Hint 2. Write ⟨𝐩,𝐮𝑗⟩=⟨𝐯,𝐮𝑗⟩−⟨𝐯−𝐩,𝐮𝑗⟩.
Sketch. Let 𝒪︀=𝐮1,…,𝐮𝑘. If 𝐩∈𝑊 and 𝐯−𝐩⟂𝑊, then 𝐩=∑𝑗⟨𝐩,𝐮𝑗⟩𝐮𝑗 and ⟨𝐩,𝐮𝑗⟩=⟨𝐯,𝐮𝑗⟩−0. So 𝐩=Pr𝒪︀(𝐯). Existence is Proposition 6.4.4(a) and (b).

Write 𝒪︀=𝐮1,…,𝐮𝑘. Existence is (a) and (b) of Proposition 6.4.4. Conversely, let 𝐩∈𝑊 with 𝐯−𝐩∈𝑊⟂. Since 𝐮𝑗∈𝑊, we have ⟨𝐯−𝐩,𝐮𝑗⟩=0, so

⟨𝐩,𝐮𝑗⟩=⟨𝐯,𝐮𝑗⟩−⟨𝐯−𝐩,𝐮𝑗⟩=⟨𝐯,𝐮𝑗⟩.

Since 𝐩∈span(𝒪︀), Proposition 6.3.18(a) gives

𝐩=∑𝑗=1𝑘⟨𝐩,𝐮𝑗⟩𝐮𝑗=∑𝑗=1𝑘⟨𝐯,𝐮𝑗⟩𝐮𝑗=Pr𝒪︀(𝐯),

as desired. □

The first proof never uses the formula for Pr𝒪︀. It shows that any two vectors with the two properties agree, whatever produced them, and all it needs is 𝑊∩𝑊⟂={𝟎}. The second proof computes the coordinates of such a vector and recognizes them as those of Pr𝒪︀(𝐯); this is how the lecture argues. The first proof is the one that generalizes, and it gives the following technique.

Technique 6.4.7 (Recognize a projection by its two conditions). To show that a vector 𝐩 is the projection of 𝐯 onto 𝑊, do not compute the projection. Check the two conditions of Theorem 6.4.6: 𝐩∈𝑊, and 𝐯−𝐩⟂𝑊. By Proposition 6.3.9(c), the second condition only has to be checked against a spanning list of 𝑊. Uniqueness then does the rest, much as a two-sided inverse is recognized by checking two products (Technique 2.5.16).

Reach for it when a formula or a vector is proposed as a projection, when projections onto related subspaces are compared, and when you need to know that a projection does not depend on the choices made to compute it. The canonical example is Corollary 6.4.8. Later examples are the projection onto 𝑊⟂ (Proposition 6.4.29), the recognition of orthogonal projections among all linear maps (Proposition 6.4.30), and the projection formula of Section 6.5.

Corollary 6.4.8 (The projection depends only on the span). If 𝒪︀ and 𝒪︀′ are orthonormal lists in 𝑉 with span(𝒪︀)=span(𝒪︀′), then Pr𝒪︀=Pr𝒪︀′.

Proof.routine

Uses. Theorem 6.4.6 (The projection is characterized by orthogonality), Proposition 6.4.4 (Properties of Pr𝒪︀)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. Let 𝑊 be the common span and fix 𝐯∈𝑉. Which two properties does Pr𝒪︀′(𝐯) have?
Hint 2. Both properties mention only 𝑊. Apply the uniqueness in Theorem 6.4.6 for the list 𝒪︀.
Sketch. With 𝑊=span(𝒪︀)=span(𝒪︀′), the vector Pr𝒪︀′(𝐯) lies in 𝑊 and 𝐯−Pr𝒪︀′(𝐯)∈𝑊⟂, by Proposition 6.4.4 for 𝒪︀′. These are the conditions that characterize Pr𝒪︀(𝐯) in Theorem 6.4.6.
Let 𝑊=span(𝒪︀)=span(𝒪︀′) and 𝐯∈𝑉. By (a) and (b) of Proposition 6.4.4, applied to the list 𝒪︀′, the vector 𝐩=Pr𝒪︀′(𝐯) lies in 𝑊 and satisfies 𝐯−𝐩∈𝑊⟂. By Theorem 6.4.6, applied to the list 𝒪︀, the only vector with these two properties is Pr𝒪︀(𝐯). Hence Pr𝒪︀′(𝐯)=Pr𝒪︀(𝐯) for every 𝐯. □

Example 6.4.9 (Two orthonormal bases, one projection). Let 𝑊={𝐱∈ℝ3|𝑥1+𝑥2+𝑥3=0}. Both

𝒪︀:𝐚=12(1,−1,0),𝐛=16(1,1,−2),𝒪︀′:𝐚′=12(1,0,−1),𝐛′=16(1,−2,1)

are orthonormal lists of two vectors in the 2-dimensional plane 𝑊, so both are orthonormal bases of 𝑊 (Corollary 6.3.14). For 𝐯=(3,0,0),

Pr𝒪︀(𝐯)=32(1,−1,0)+36(1,1,−2)=(2,−1,−1),Pr𝒪︀′(𝐯)=32(1,0,−1)+36(1,−2,1)=(2,−1,−1).

The individual shadows differ, because they depend on the axes, but their sums agree. As a check, 𝐯−(2,−1,−1)=(1,1,1) is orthogonal to 𝑊.

By hand it is often easier to work with an orthogonal list and postpone normalizing.

Corollary 6.4.10 (Projecting with an orthogonal list). Let 𝐟1,…,𝐟𝑘 be an orthogonal list of nonzero vectors in 𝑉, and let 𝒪︀ be the orthonormal list 𝐟1/‖𝐟1‖,…,𝐟𝑘/‖𝐟𝑘‖. Then

Pr𝒪︀(𝐯)=∑𝑗=1𝑘⟨𝐯,𝐟𝑗⟩‖𝐟𝑗‖2𝐟𝑗for all𝐯∈𝑉.

Each term is unchanged if 𝐟𝑗 is replaced by 𝑐𝐟𝑗 for a scalar 𝑐≠0.

Proof.routine

Uses. Definition 6.4.1 (Projection onto the span of an orthonormal list), Proposition 6.1.4 (Sesquilinearity), Proposition 6.1.27 (Basic properties of the norm)

Hint 1. Substitute 𝐮𝑗=𝐟𝑗/‖𝐟𝑗‖ into Definition 6.4.1. Is 1/‖𝐟𝑗‖ real?
Hint 2. For the last claim, take 𝑐 out of both slots of ⟨𝐯,𝑐𝐟𝑗⟩ and out of ‖𝑐𝐟𝑗‖2.
Sketch. Since ‖𝐟𝑗‖ is real, ⟨𝐯,𝐟𝑗/‖𝐟𝑗‖⟩𝐟𝑗/‖𝐟𝑗‖=⟨𝐯,𝐟𝑗⟩/‖𝐟𝑗‖2𝐟𝑗. Replacing 𝐟𝑗 by 𝑐𝐟𝑗 multiplies the term by 𝑐𝑐/|𝑐|2=1.

Since ‖𝐟𝑗‖ is a positive real number, it equals its conjugate, and Proposition 6.1.4 gives

⟨𝐯,𝐟𝑗‖𝐟𝑗‖⟩𝐟𝑗‖𝐟𝑗‖=⟨𝐯,𝐟𝑗⟩‖𝐟𝑗‖2𝐟𝑗.

Summing over 𝑗 gives the formula. If 𝐟𝑗 is replaced by 𝑐𝐟𝑗, the 𝑗th term becomes

⟨𝐯,𝑐𝐟𝑗⟩‖𝑐𝐟𝑗‖2𝑐𝐟𝑗=𝑐𝑐|𝑐|2⋅⟨𝐯,𝐟𝑗⟩‖𝐟𝑗‖2𝐟𝑗=⟨𝐯,𝐟𝑗⟩‖𝐟𝑗‖2𝐟𝑗,

by Proposition 6.1.4 and Proposition 6.1.27(b). □

For 𝑘=1 this is the shadow ⟨𝐯,𝐟1⟩/‖𝐟1‖2𝐟1 of Technique 6.2.4, and for an orthogonal basis of 𝑉 it is Corollary 6.3.21.

Orthogonal projection onto a subspace

By Corollary 6.4.8, Pr𝒪︀ depends only on the subspace spanned by 𝒪︀. So we may name it after the subspace.

Definition 6.4.11 (Orthogonal projection). Let 𝑊 be a subspace of 𝑉 that has an orthonormal basis 𝒪︀=𝐮1,…,𝐮𝑘. The orthogonal projection onto 𝑊 is the map Pr𝑊=Pr𝒪︀:𝑉→𝑉, that is,

Pr𝑊(𝐯)=⟨𝐯,𝐮1⟩𝐮1+⋯+⟨𝐯,𝐮𝑘⟩𝐮𝑘.

By Corollary 6.4.8 this does not depend on the choice of the orthonormal basis 𝒪︀. By Theorem 6.4.6, Pr𝑊(𝐯) is the unique vector 𝐩∈𝑊 with 𝐯−𝐩⟂𝑊.

A basis is a finite list, so only a finite-dimensional subspace can have an orthonormal basis. Conversely, Theorem 6.4.20 below shows that every finite-dimensional subspace has one. So Pr𝑊 is defined exactly for the finite-dimensional subspaces 𝑊 of 𝑉, while 𝑉 itself may be infinite-dimensional. In Example 6.4.3, for instance, Pr𝑊(𝑡2)=1/3 for 𝑊=span(1,𝑡)⊆𝐶[−1,1].

Remark 6.4.12 (Why “orthogonal”). The map 𝑃:ℝ2→ℝ2, 𝑃(𝑥,𝑦)=(𝑥−𝑦,0), also sends every vector into the 𝑥-axis 𝑊 and fixes every vector of 𝑊. It slides each point onto 𝑊 along the direction (1,1), not along the perpendicular. For instance 𝑃(0,1)=(−1,0), and (0,1)−𝑃(0,1)=(1,1) is not orthogonal to 𝑊, whereas Pr𝑊(0,1)=𝟎. Maps like 𝑃, which project onto one subspace along another, exist in every vector space, with or without an inner product, and they belong with the direct sums of Section 4.4. Among them, the orthogonal projection is the one that moves every vector perpendicularly to 𝑊. Proposition 6.4.30 shows how to recognize it.

Exercise 6.4.13.routine In ℂ3 with the dot product, let 𝐮=12(1,𝑖,0) and 𝐯=(0,1,1).

  1. (a)Compute Pr𝐮(𝐯), and check that 𝐯−Pr𝐮(𝐯)⟂𝐮.
  2. (b)A student uses ⟨𝐮,𝐯⟩𝐮 instead. Show that this vector does not have the property in (a).

Solution.

Uses. Definition 6.4.1 (Projection onto the span of an orthonormal list), Definition 6.1.8 (Dot product), Proposition 6.4.4 (Properties of Pr𝒪︀)

Hint 1. ⟨𝐯,𝐮⟩=𝐯⋅𝐮 conjugates the entries of 𝐮.
Hint 2. You should get ⟨𝐯,𝐮⟩=−𝑖/2, while ⟨𝐮,𝐯⟩ is its conjugate.
Sketch. (a) ⟨𝐯,𝐮⟩=(1⋅𝑖)/2=−𝑖/2, so Pr𝐮(𝐯)=(−𝑖/2)(1,𝑖,0)=(−𝑖/2,1/2,0), and 𝐯−Pr𝐮(𝐯)=(𝑖/2,1/2,1) has dot product 𝑖/2+(1/2)(−𝑖)=0 with (1,𝑖,0). (b) ⟨𝐮,𝐯⟩𝐮=(𝑖/2,−1/2,0), and 𝐯 minus it has dot product −2𝑖≠0 with (1,𝑖,0).

(a) By Definition 6.1.8, ⟨𝐯,𝐮⟩=(0⋅1+1⋅𝑖+1⋅0)/2=−𝑖/2. So

Pr𝐮(𝐯)=−𝑖2⋅12(1,𝑖,0)=−𝑖2(1,𝑖,0)=(−𝑖2,12,0),

and 𝐯−Pr𝐮(𝐯)=(𝑖/2,1/2,1). Its dot product with (1,𝑖,0) is (𝑖/2)⋅1+(1/2)⋅𝑖+0=𝑖/2−𝑖/2=0, so it is orthogonal to 𝐮, as Proposition 6.4.4(b) says.

(b) ⟨𝐮,𝐯⟩=⟨𝐯,𝐮⟩=𝑖/2, so the student’s vector is (𝑖/2)(1,𝑖,0)=(𝑖/2,−1/2,0), and 𝐯 minus it is (−𝑖/2,3/2,1). Its dot product with (1,𝑖,0) is −𝑖/2+(3/2)(−𝑖)=−2𝑖≠0. Over ℂ the vector being projected belongs in the first slot.

6.4.2The Gram–Schmidt algorithm

To use Definition 6.4.11 we need orthonormal bases. A subspace usually arrives as the span of some list 𝐯1,…,𝐯𝑚, such as the columns of a matrix or the monomials 1,𝑥,…,𝑥𝑛, and that list is rarely orthonormal. The Gram–Schmidt algorithm converts it into an orthonormal basis of the same span.

Intuition (Keep only what is new). Process the vectors one at a time, and keep an orthonormal list 𝐮1,…,𝐮𝑘 with the same span as the vectors processed so far. When 𝐯𝑗 arrives, split it as in Figure 6.4.1: 𝐯𝑗 is its projection onto span(𝐮1,…,𝐮𝑘) plus the remainder

𝐟=𝐯𝑗−Pr𝐮1,…,𝐮𝑘(𝐯𝑗).

The projection lies in the span we already have, so it contributes nothing new. The remainder is orthogonal to 𝐮1,…,𝐮𝑘 by Proposition 6.4.4(b), so after normalizing it can be appended to the orthonormal list, and it carries exactly the direction that 𝐯𝑗 adds (Figure 6.4.2). If the remainder is 𝟎, then 𝐯𝑗 lies in the span of the earlier vectors and adds no new direction, so we skip it.

Algorithm 6.4.14 (Gram–Schmidt)

Input
A list 𝐯1,…,𝐯𝑚 in 𝑉.
Output
An orthonormal list 𝐮1,…,𝐮𝑘, where 𝑘≤𝑚, with span(𝐮1,…,𝐮𝑘)=span(𝐯1,…,𝐯𝑚).

Start with no vectors kept (𝑘=0) and 𝑗=1.

1.

Project. Subtract from 𝐯𝑗 its projection onto the span of the vectors kept so far:

𝐟=𝐯𝑗−∑𝑖=1𝑘⟨𝐯𝑗,𝐮𝑖⟩𝐮𝑖.

2.

Keep or skip. If 𝐟≠𝟎, increase 𝑘 by 1, and set 𝐟𝑘=𝐟 and 𝐮𝑘=𝐟𝑘/‖𝐟𝑘‖. If 𝐟=𝟎, keep nothing.

3.

Repeat. If 𝑗<𝑚, increase 𝑗 by 1 and return to step 1. Otherwise output 𝐮1,…,𝐮𝑘.

The sum in step 1 is Pr𝒪︀(𝐯𝑗) for the current list 𝒪︀=𝐮1,…,𝐮𝑘; when 𝑘=0 it is empty and 𝐟=𝐯𝑗. We call 𝐟1,𝐟2,… the residuals. If no vector is skipped, then 𝑘=𝑗 after the 𝑗th pass, and the algorithm is the recursion

𝐟𝑗=𝐯𝑗−∑𝑖=1𝑗−1⟨𝐯𝑗,𝐮𝑖⟩𝐮𝑖,𝐮𝑗=𝐟𝑗‖𝐟𝑗‖(𝑗=1,…,𝑚).
(6.4.1)
Figure 6.4.2. Two passes of Gram–Schmidt. (a) The residual 𝐟2 is what remains of 𝐯2 after subtracting its shadow on the line through 𝐯1; normalizing 𝐯1 and 𝐟2 gives 𝐮1 and 𝐮2. (b) In the next pass, 𝐯3 is projected onto the shaded plane span(𝐯1,𝐯2)=span(𝐮1,𝐮2), and the residual 𝐟3, normalized, gives 𝐮3.

That the output is orthonormal and has the right span is a statement about what the algorithm keeps true from one pass to the next, so we prove it as in Technique 3.3.5.

Theorem 6.4.15 (Gram–Schmidt is correct). Run Algorithm 6.4.14 on a list 𝐯1,…,𝐯𝑚 in 𝑉. For 0≤𝑗≤𝑚, let 𝒪︀𝑗 be the list of vectors kept after the first 𝑗 passes, so that 𝒪︀0 is empty.

  1. (a)For every 𝑗, 𝒪︀𝑗 is orthonormal and span(𝒪︀𝑗)=span(𝐯1,…,𝐯𝑗).
  2. (b)In pass 𝑗, the vector 𝐯𝑗 is skipped if and only if 𝐯𝑗∈span(𝐯1,…,𝐯𝑗−1).
  3. (c)The output is an orthonormal basis of span(𝐯1,…,𝐯𝑚).
  4. (d)If 𝐯1,…,𝐯𝑚 is linearly independent, then no vector is skipped, and the output 𝐮1,…,𝐮𝑚 satisfies span(𝐮1,…,𝐮𝑗)=span(𝐯1,…,𝐯𝑗) and ⟨𝐯𝑗,𝐮𝑗⟩=‖𝐟𝑗‖>0 for every 𝑗.

Proof.standard

Uses. Proposition 6.4.4 (Properties of Pr𝒪︀), Proposition 1.3.18 (Comparing spans), Proposition 6.3.13 (Orthogonal lists are independent), Theorem 1.5.5 (Independence is decided at zero), Definition 6.3.15 (Orthonormal list, orthonormal basis)

Techniques. Algorithms as proofs: invariants and termination (Technique 3.3.5), Induction on the length of a list (Technique 1.6.9), Double containment (Technique 1.3.14)

Hint 1. Prove (a) by induction on 𝑗. In pass 𝑗, let 𝑊=span(𝒪︀𝑗−1). What do you know about 𝐟=𝐯𝑗−Pr𝒪︀𝑗−1(𝐯𝑗)?
Hint 2. By Proposition 6.4.4, 𝐟⟂𝑊, and 𝐟=𝟎 exactly when 𝐯𝑗∈𝑊. In the case 𝐟≠𝟎, the new unit vector is orthogonal to the old ones.
Hint 3. For the spans, compare with Proposition 1.3.18 in both directions, using 𝐯𝑗=Pr𝒪︀𝑗−1(𝐯𝑗)+‖𝐟‖𝐮.
Sketch. Induct on 𝑗; 𝒪︀0 is empty and spans {𝟎}. In pass 𝑗, let 𝑊=span(𝒪︀𝑗−1)=span(𝐯1,…,𝐯𝑗−1). By Proposition 6.4.4, 𝐟⟂𝑊, and 𝐟=𝟎 if and only if 𝐯𝑗∈𝑊; this gives (b). If 𝐟=𝟎, nothing changes, and span(𝐯1,…,𝐯𝑗)=𝑊. Otherwise 𝐮=𝐟/‖𝐟‖ is a unit vector orthogonal to 𝒪︀𝑗−1, and 𝐮∈span(𝐯1,…,𝐯𝑗) and 𝐯𝑗=Pr𝒪︀𝑗−1(𝐯𝑗)+‖𝐟‖𝐮 give equal spans. (c) is (a) for 𝑗=𝑚, with Proposition 6.3.13. For (d), independence rules out 𝐯𝑗∈span(𝐯1,…,𝐯𝑗−1), and ⟨𝐯𝑗,𝐮𝑗⟩=⟨Pr(𝐯𝑗)+‖𝐟𝑗‖𝐮𝑗,𝐮𝑗⟩=‖𝐟𝑗‖.

(a) We induct on 𝑗. For 𝑗=0, the empty list is orthonormal, and both sides equal {𝟎}.

Let 1≤𝑗≤𝑚, and suppose that 𝒪︀𝑗−1=𝐮1,…,𝐮𝑘 is orthonormal with span(𝒪︀𝑗−1)=span(𝐯1,…,𝐯𝑗−1). Call this subspace 𝑊. Pass 𝑗 computes 𝐟=𝐯𝑗−Pr𝒪︀𝑗−1(𝐯𝑗). By (a) and (c) of Proposition 6.4.4, Pr𝒪︀𝑗−1(𝐯𝑗)∈𝑊, and 𝐟=𝟎 if and only if 𝐯𝑗∈𝑊.

Suppose 𝐟=𝟎. Then 𝒪︀𝑗=𝒪︀𝑗−1 is orthonormal. Since 𝐯𝑗∈𝑊=span(𝐯1,…,𝐯𝑗−1), Proposition 1.3.18 gives span(𝐯1,…,𝐯𝑗)=span(𝐯1,…,𝐯𝑗−1)=𝑊=span(𝒪︀𝑗).

Suppose 𝐟≠𝟎. Then 𝒪︀𝑗 is 𝐮1,…,𝐮𝑘,𝐮 with 𝐮=𝐟/‖𝐟‖, a unit vector. By Proposition 6.4.4(b), 𝐟∈𝑊⟂, so ⟨𝐮,𝐮𝑖⟩=⟨𝐟,𝐮𝑖⟩/‖𝐟‖=0 for 𝑖≤𝑘. Hence 𝒪︀𝑗 is orthonormal. For the spans we prove both containments with Proposition 1.3.18. Each 𝐮𝑖 with 𝑖≤𝑘 lies in 𝑊⊆span(𝐯1,…,𝐯𝑗), and so does

𝐮=1‖𝐟‖(𝐯𝑗−Pr𝒪︀𝑗−1(𝐯𝑗)),

because Pr𝒪︀𝑗−1(𝐯𝑗)∈𝑊. So span(𝒪︀𝑗)⊆span(𝐯1,…,𝐯𝑗). Conversely, 𝐯1,…,𝐯𝑗−1 lie in 𝑊=span(𝒪︀𝑗−1)⊆span(𝒪︀𝑗), and so does

𝐯𝑗=Pr𝒪︀𝑗−1(𝐯𝑗)+‖𝐟‖𝐮.

So span(𝐯1,…,𝐯𝑗)⊆span(𝒪︀𝑗), and the induction is complete.

(b) We saw in the proof of (a) that pass 𝑗 keeps nothing exactly when 𝐯𝑗∈𝑊=span(𝐯1,…,𝐯𝑗−1).

(c) The output is 𝒪︀𝑚. By (a) it is orthonormal, hence linearly independent (Proposition 6.3.13), and it spans span(𝐯1,…,𝐯𝑚).

(d) If 𝐯𝑗=𝑐1𝐯1+⋯+𝑐𝑗−1𝐯𝑗−1 for some 𝑗, then 𝑐1𝐯1+⋯+𝑐𝑗−1𝐯𝑗−1−𝐯𝑗=𝟎 is a linear relation with a nonzero coefficient, so the list is dependent (Theorem 1.5.5). So if the list is independent, (b) shows that nothing is skipped. Then 𝒪︀𝑗=𝐮1,…,𝐮𝑗 for every 𝑗, and (a) gives the equality of spans. Finally,

𝐯𝑗=Pr𝒪︀𝑗−1(𝐯𝑗)+‖𝐟𝑗‖𝐮𝑗,

where the first term lies in span(𝐮1,…,𝐮𝑗−1) and is therefore orthogonal to 𝐮𝑗. Hence ⟨𝐯𝑗,𝐮𝑗⟩=‖𝐟𝑗‖⟨𝐮𝑗,𝐮𝑗⟩=‖𝐟𝑗‖, which is positive because 𝐟𝑗≠𝟎. □

The invariant (a) is exactly what makes step 1 the right move. Because span(𝒪︀𝑗−1) is the span of all the earlier vectors, the residual is orthogonal to each earlier output, not only to the most recent one. Subtracting only the shadow on 𝐮𝑗−1 would leave components along 𝐮1,…,𝐮𝑗−2.

Remark 6.4.16 (Postponing the normalization). By Corollary 6.4.10, the projection in step 1 can be computed from the residuals instead of the normalized vectors:

𝐟=𝐯𝑗−∑𝑖=1𝑘⟨𝐯𝑗,𝐟𝑖⟩‖𝐟𝑖‖2𝐟𝑖,

and each 𝐟𝑖 may be replaced by any nonzero multiple of itself without changing this sum. So by hand one runs the algorithm with residuals only, clears denominators in each residual as it appears, and normalizes once at the end. Square roots then appear only in the last step.

Example 6.4.17 (Gram–Schmidt in ℝ3). Let 𝐯1=(1,1,0), 𝐯2=(1,0,1), 𝐯3=(0,1,1). Following Remark 6.4.16:

𝐟1=(1,1,0),𝐟2=(1,0,1)−12(1,1,0)=12(1,−1,2),

which we replace by (1,−1,2). Since ⟨𝐯3,𝐟1⟩=1 with ‖𝐟1‖2=2, and ⟨𝐯3,(1,−1,2)⟩=1 with ‖(1,−1,2)‖2=6,

𝐟3=(0,1,1)−12(1,1,0)−16(1,−1,2)=23(−1,1,1),

which we replace by (−1,1,1). The rescaled residuals (1,1,0), (1,−1,2), (−1,1,1) are pairwise orthogonal, and normalizing them gives the orthonormal basis

𝐮1=12(1,1,0),𝐮2=16(1,−1,2),𝐮3=13(−1,1,1)

of ℝ3. As Theorem 6.4.15(d) predicts, ⟨𝐯2,𝐮2⟩=3/6=3/2 is the length of the unrescaled residual 12(1,−1,2).

𝐟1=(1,1,0),𝐟2=12(1,−1,2),𝐟3=23(−1,1,1)
Gram–Schmidt on the vectors of Example 6.4.17, one step at a time, keeping the residuals unnormalized as in Remark 6.4.16; normalizing them gives 𝐮1,𝐮2,𝐮3. In the interactive version, drag or type the inputs; a vector typed into the span of the earlier ones is skipped.

Example 6.4.18 (A dependent list). Run the algorithm on 𝐯1=(1,1,1), 𝐯2=(1,2,3), 𝐯3=(3,4,5), 𝐯4=(0,0,1) in ℝ3, again with residuals only. First 𝐟1=(1,1,1), and

𝐟2=(1,2,3)−63(1,1,1)=(−1,0,1).

In the third pass, ⟨𝐯3,𝐟1⟩=12 and ⟨𝐯3,𝐟2⟩=2, so

𝐯3−123(1,1,1)−22(−1,0,1)=(3−4+1,4−4−0,5−4−1)=𝟎.

So 𝐯3 is skipped: by Theorem 6.4.15(b) it lies in span(𝐯1,𝐯2), and the computation even exhibits the relation 𝐯3=4𝐟1+𝐟2=4𝐯1+(𝐯2−2𝐯1)=2𝐯1+𝐯2. In the fourth pass,

(0,0,1)−13(1,1,1)−12(−1,0,1)=16(1,−2,1),

which we replace by (1,−2,1). The output, after normalizing, is (1,1,1)/3, (−1,0,1)/2, (1,−2,1)/6: an orthonormal basis of span(𝐯1,…,𝐯4)=ℝ3.

So Gram–Schmidt also detects linear dependence, much as row reduction does, and the number of vectors it keeps is the dimension of the span.

Example 6.4.19 (Legendre polynomials). Give ℝ[𝑥]≤3 the inner product ⟨𝑝,𝑞⟩=∫−11𝑝(𝑡)𝑞(𝑡)d𝑡 of Example 6.3.17, and run Gram–Schmidt on 1,𝑥,𝑥2,𝑥3. Since ⟨𝑥𝑖,𝑥𝑗⟩=∫−11𝑡𝑖+𝑗d𝑡 is 2/(𝑖+𝑗+1) when 𝑖+𝑗 is even and 0 when 𝑖+𝑗 is odd,

𝑓1=1,𝑓2=𝑥−⟨𝑥,1⟩‖1‖21=𝑥,𝑓3=𝑥2−⟨𝑥2,1⟩‖1‖21−⟨𝑥2,𝑥⟩‖𝑥‖2𝑥=𝑥2−2/32=𝑥2−13,

which recovers the orthogonal basis of Example 6.3.17. The next pass gives 𝑓4=𝑥3−(3/5)𝑥, the polynomial of Exercise 6.3.49. By Theorem 6.4.15(d), span(𝑓1,…,𝑓𝑗)=span(1,𝑥,…,𝑥𝑗−1). So 𝑓𝑗+1=𝑥𝑗−Pr(𝑥𝑗), where the projection is onto the polynomials of degree less than 𝑗: it has degree 𝑗, leading coefficient 1, and is orthogonal to every polynomial of degree less than 𝑗. Rescaled so that their value at 1 is 1, these are the Legendre polynomials

𝑃0=1,𝑃1=𝑥,𝑃2=12(3𝑥2−1),𝑃3=12(5𝑥3−3𝑥).

The output depends on the inner product. The lecture’s example uses ⟨𝑝,𝑞⟩=∫01𝑝(𝑡)𝑞(𝑡)d𝑡 instead, and Gram–Schmidt applied to 1,𝑥 then gives 1,3(2𝑥−1) (compare Exercise 6.4.46).

Now we can show that the hypothesis of Definition 6.4.11 holds for every finite-dimensional subspace.

Theorem 6.4.20 (Orthonormal bases exist).
  1. (a)Every finite-dimensional inner product space has an orthonormal basis.
  2. (b)In a finite-dimensional inner product space, every orthonormal list extends to an orthonormal basis.
  3. (c)Every finite-dimensional subspace 𝑊 of an inner product space 𝑉 has an orthonormal basis. In particular, Pr𝑊 is defined.

Proof.routine

Uses. Theorem 6.4.15 (Gram–Schmidt is correct), Corollary 1.6.24 (Bases exist in finite dimensions), Definition 6.4.11 (Orthogonal projection), Definition 6.1.2 (Inner product)

Hint 1. Run Gram–Schmidt on a basis, or on any spanning list.
Hint 2. For (b), put the orthonormal list in front of a basis of 𝑉. What does Gram–Schmidt do to vectors that are already orthonormal?
Sketch. (a) Gram–Schmidt turns a basis of 𝑉 into an orthonormal basis of its span, which is 𝑉 (Theorem 6.4.15(c)). (b) Run it on 𝐮1,…,𝐮𝑘,𝐛1,…,𝐛𝑛 for a basis 𝐛1,…,𝐛𝑛 of 𝑉: the first 𝑘 residuals are 𝐮1,…,𝐮𝑘 themselves, and the output is an orthonormal basis of 𝑉 that starts with them. (c) The inner product restricted to 𝑊 is an inner product on 𝑊; apply (a).

(a) Let 𝑉 be finite-dimensional. It has a basis 𝐛1,…,𝐛𝑛 (Corollary 1.6.24). By Theorem 6.4.15(c), Gram–Schmidt turns it into an orthonormal basis of span(𝐛1,…,𝐛𝑛)=𝑉.

(b) Let 𝐮1,…,𝐮𝑘 be orthonormal, and let 𝐛1,…,𝐛𝑛 be a basis of 𝑉. Run Gram–Schmidt on the list 𝐮1,…,𝐮𝑘,𝐛1,…,𝐛𝑛. In pass 𝑗≤𝑘, the vectors kept so far are 𝐮1,…,𝐮𝑗−1 (by induction on 𝑗), so the residual is

𝐮𝑗−∑𝑖=1𝑗−1⟨𝐮𝑗,𝐮𝑖⟩𝐮𝑖=𝐮𝑗,

a unit vector, which is kept unchanged. So the output begins with 𝐮1,…,𝐮𝑘, and by Theorem 6.4.15(c) it is an orthonormal basis of the span of the whole list, which is 𝑉 because the list contains a basis.

(c) The inner product of 𝑉, restricted to pairs of vectors of 𝑊, satisfies the axioms of Definition 6.1.2 on 𝑊. So 𝑊 is a finite-dimensional inner product space, and it has an orthonormal basis by (a). Then Pr𝑊 is defined by Definition 6.4.11. □

Part (b) is the orthonormal version of extending an independent list to a basis (Theorem 4.1.16). Together with Parseval’s identity, part (a) completes the picture sketched after Theorem 6.3.22: every 𝑛-dimensional inner product space has an orthonormal basis, and its coordinates carry the inner product to the dot product of 𝔽𝑛.

Exercise 6.4.21.routine In ℂ3 with the dot product, apply Gram–Schmidt to 𝐯1=(1,𝑖,0), 𝐯2=(1,1,1). What goes wrong if ⟨𝐯2,𝐮1⟩ is replaced by ⟨𝐮1,𝐯2⟩ in step 1?

Solution.

Uses. Algorithm 6.4.14 (Gram–Schmidt), Definition 6.1.8 (Dot product), Corollary 6.4.10 (Projecting with an orthogonal list)

Hint 1. Work with residuals: 𝐟2=𝐯2−⟨𝐯2,𝐟1⟩/‖𝐟1‖2𝐟1 with 𝐟1=𝐯1.
Hint 2. ⟨𝐯2,𝐟1⟩=1+𝑖=1−𝑖 and ‖𝐟1‖2=2.
Sketch. 𝐟2=(1,1,1)−((1−𝑖)/2)(1,𝑖,0)=((1+𝑖)/2,(1−𝑖)/2,1), of squared norm 2. So 𝐮1=(1,𝑖,0)/2 and 𝐮2=((1+𝑖)/2,(1−𝑖)/2,1)/2. With the conjugated coefficient (1+𝑖)/2, the residual has dot product −2𝑖≠0 with 𝐯1.

We use Remark 6.4.16. First 𝐟1=(1,𝑖,0) with ‖𝐟1‖2=2. Next ⟨𝐯2,𝐟1⟩=1⋅1+1⋅𝑖+0=1−𝑖, so

𝐟2=(1,1,1)−1−𝑖2(1,𝑖,0)=(1−1−𝑖2,1−𝑖+12,1)=(1+𝑖2,1−𝑖2,1).

Check: 𝐟2⋅𝐟1=(1+𝑖)/2+((1−𝑖)/2)𝑖=(1+𝑖)/2+(−𝑖−1)/2=0. Also ‖𝐟2‖2=1/2+1/2+1=2. So

𝐮1=12(1,𝑖,0),𝐮2=12(1+𝑖2,1−𝑖2,1).

With the slots exchanged, the coefficient becomes 1−𝑖/2=(1+𝑖)/2, and the “residual” is (1,1,1)−((1+𝑖)/2)(1,𝑖,0)=((1−𝑖)/2,(3−𝑖)/2,1). Its dot product with 𝐯1 is (1−𝑖)/2+((3−𝑖)/2)(−𝑖)=(1−𝑖−3𝑖−1)/2=−2𝑖≠0, so the output would not be orthogonal.

6.4.3Orthogonal complements

In Orthogonality to a set we defined 𝐴⟂ for every subset 𝐴 of 𝑉. When 𝐴 is a subspace, 𝐴⟂ deserves a name of its own, which we now justify.

Definition 6.4.22 (Orthogonal complement). Let 𝑊 be a subspace of 𝑉. The orthogonal complement of 𝑊 is the subspace

𝑊⟂={𝐯∈𝑉|⟨𝐯,𝐰⟩=0for all𝐰∈𝑊}

of Definition 6.3.8.

By Proposition 6.3.9, 𝑊⟂ is a subspace of 𝑉, 𝑊∩𝑊⟂={𝟎}, and 𝑈⊆𝑊 implies 𝑊⟂⊆𝑈⟂. By Exercise 6.3.11, 𝑊⊆(𝑊⟂)⟂. Note that 𝑊⟂ depends on the ambient space: the perp of the 𝑥-axis is a line in ℝ2 and a plane in ℝ3.

Example 6.4.23 (Orthogonal complements).
  1. (a)In ℝ3, span((1,1,1))⟂ is the plane 𝑊={𝐱|𝑥1+𝑥2+𝑥3=0} of Example 6.4.9 (Example 6.3.10). Conversely 𝑊⟂=span((1,1,1)). Indeed (1,1,1) is orthogonal to the spanning vectors (1,−1,0) and (1,1,−2) of 𝑊, so span((1,1,1))⊆𝑊⟂, and Theorem 6.4.26 below gives equality.
  2. (b)For 𝐴∈ℝ𝑚×𝑛, let 𝑅⊆ℝ𝑛 be the span of the rows of 𝐴. By Example 6.3.10 and Proposition 6.3.9(c), ker𝐴=𝑅⟂: solving 𝐴𝐱=𝟎 means finding the vectors orthogonal to every row.
  3. (c)In 𝐶[−1,1] with ⟨𝑓,𝑔⟩=∫−11𝑓(𝑡)𝑔(𝑡)d𝑡, every odd function is orthogonal to every even function (Example 6.3.2(c)). Exercise 6.4.54 shows that the odd functions form exactly the orthogonal complement of the even functions.

The main theorem says that 𝑊⟂ really is a complement of 𝑊, as soon as 𝑊 is finite-dimensional. The proof is already contained in Proposition 6.4.4: every vector is its projection onto 𝑊 plus something orthogonal to 𝑊.

Theorem 6.4.24 (Orthogonal decomposition). Let 𝑊 be a finite-dimensional subspace of 𝑉. Every 𝐯∈𝑉 can be written in exactly one way as

𝐯=𝐰+𝐰′with𝐰∈𝑊and𝐰′∈𝑊⟂,

namely with 𝐰=Pr𝑊(𝐯) and 𝐰′=𝐯−Pr𝑊(𝐯). That is, 𝑉=𝑊⊕𝑊⟂.

Proof.routine

Uses. Theorem 6.4.20 (Orthonormal bases exist), Proposition 6.4.4 (Properties of Pr𝒪︀), Proposition 6.3.9 (Properties of 𝐴⟂), Definition 4.4.4 (Direct sum), Theorem 4.4.7 (Criteria for direct sums)

Techniques. Uniqueness via two candidates (Technique 1.1.8)

Hint 1. For existence, Pr𝑊 is defined because 𝑊 has an orthonormal basis. Which properties of Pr𝑊(𝐯) do you need?
Hint 2. For uniqueness, suppose 𝐰+𝐰′=𝐱+𝐱′ with 𝐰,𝐱∈𝑊 and 𝐰′,𝐱′∈𝑊⟂, and rearrange.
Sketch. By Theorem 6.4.20, Pr𝑊 is defined, and 𝐯=Pr𝑊(𝐯)+(𝐯−Pr𝑊(𝐯)) has its first piece in 𝑊 and its second in 𝑊⟂ by Proposition 6.4.4. If 𝐰+𝐰′=𝐱+𝐱′ are two such decompositions, then 𝐰−𝐱=𝐱′−𝐰′ lies in 𝑊∩𝑊⟂={𝟎}.

By Theorem 6.4.20, 𝑊 has an orthonormal basis, so Pr𝑊 is defined. For 𝐯∈𝑉, (a) and (b) of Proposition 6.4.4 give Pr𝑊(𝐯)∈𝑊 and 𝐯−Pr𝑊(𝐯)∈𝑊⟂, and these two vectors add up to 𝐯. So a decomposition exists.

Suppose 𝐯=𝐰+𝐰′=𝐱+𝐱′ with 𝐰,𝐱∈𝑊 and 𝐰′,𝐱′∈𝑊⟂. Then

𝐰−𝐱=𝐱′−𝐰′.

The left side lies in 𝑊 and the right side in 𝑊⟂, since both are subspaces. So both sides lie in 𝑊∩𝑊⟂={𝟎} (Proposition 6.3.9(d)), and 𝐰=𝐱, 𝐰′=𝐱′. In the language of Section 4.4, 𝑉=𝑊+𝑊⟂ and 𝑊∩𝑊⟂={𝟎}, so the sum is direct (Theorem 4.4.7, Definition 4.4.4). □

Uniqueness can also be read off from Theorem 6.4.6: if 𝐯=𝐰+𝐰′ with 𝐰∈𝑊 and 𝐰′∈𝑊⟂, then 𝐰∈𝑊 and 𝐯−𝐰=𝐰′⟂𝑊, so 𝐰=Pr𝑊(𝐯). In ℝ3 the theorem says that every vector is the sum of a vector in a given plane through 𝟎 and a vector along the normal line, which is how one splits a force into the part along a surface and the part pushing against it.

Note what was assumed: 𝑊 is finite-dimensional, but 𝑉 need not be. When 𝑊 is infinite-dimensional the theorem can fail. Exercise 6.4.63 gives a proper subspace 𝑊 of an inner product space 𝑉 with 𝑊⟂={𝟎}, so that 𝑊+𝑊⟂=𝑊≠𝑉; Section 15.3 explains what survives in infinite dimensions.

Corollary 6.4.25 (Dimension of the orthogonal complement). Let 𝑉 be finite-dimensional and 𝑊 a subspace of 𝑉. Then dim𝑊⟂=dim𝑉−dim𝑊. More precisely, if 𝐮1,…,𝐮𝑛 is an orthonormal basis of 𝑉 whose first 𝑘 vectors form an orthonormal basis of 𝑊, then 𝐮𝑘+1,…,𝐮𝑛 is an orthonormal basis of 𝑊⟂.

Proof (by the dimension formula).routine

Uses. Theorem 6.4.24 (Orthogonal decomposition), Theorem 4.4.19 (Dimension of a sum), Proposition 6.3.9 (Properties of 𝐴⟂), Proposition 4.1.21 (Dimensions of subspaces)

Techniques. Dimension counting (Technique 4.2.24)

Hint 1. 𝑊 and 𝑊⟂ are finite-dimensional because 𝑉 is. What does Theorem 6.4.24 say about 𝑊+𝑊⟂ and 𝑊∩𝑊⟂?
Hint 2. Apply dim(𝑊+𝑊⟂)=dim𝑊+dim𝑊⟂−dim(𝑊∩𝑊⟂).
Sketch. 𝑉=𝑊+𝑊⟂ and 𝑊∩𝑊⟂={𝟎}, so the dimension formula gives dim𝑉=dim𝑊+dim𝑊⟂−0.

Subspaces of the finite-dimensional space 𝑉 are finite-dimensional (Proposition 4.1.21). By Theorem 6.4.24, 𝑊+𝑊⟂=𝑉, and 𝑊∩𝑊⟂={𝟎} by Proposition 6.3.9(d). By Theorem 4.4.19,

dim𝑉=dim(𝑊+𝑊⟂)=dim𝑊+dim𝑊⟂−dim(𝑊∩𝑊⟂)=dim𝑊+dim𝑊⟂,

which gives the dimension formula. The statement about bases is proved in the second approach. □

Proof (by extending an orthonormal basis).routine

Uses. Theorem 6.4.20 (Orthonormal bases exist), Proposition 6.3.18 (Coordinates in an orthonormal basis), Proposition 6.3.9 (Properties of 𝐴⟂), Definition 6.3.15 (Orthonormal list, orthonormal basis)

Techniques. Double containment (Technique 1.3.14), Take an inner product to isolate a coefficient (Technique 6.3.12)

Hint 1. Take an orthonormal basis 𝐮1,…,𝐮𝑘 of 𝑊 and extend it to an orthonormal basis 𝐮1,…,𝐮𝑛 of 𝑉 with Theorem 6.4.20(b). Guess 𝑊⟂.
Hint 2. Show span(𝐮𝑘+1,…,𝐮𝑛)=𝑊⟂ by double containment. For ⊆, test against the spanning list 𝐮1,…,𝐮𝑘 of 𝑊. For ⊇, expand 𝐯∈𝑊⟂ in the basis.
Sketch. Extend an orthonormal basis 𝐮1,…,𝐮𝑘 of 𝑊 to one of 𝑉. Each 𝐮𝑗 with 𝑗>𝑘 is orthogonal to 𝐮1,…,𝐮𝑘, hence to 𝑊. Conversely, 𝐯∈𝑊⟂ has ⟨𝐯,𝐮𝑗⟩=0 for 𝑗≤𝑘, so its expansion ∑𝑗⟨𝐯,𝐮𝑗⟩𝐮𝑗 involves only 𝐮𝑘+1,…,𝐮𝑛. So 𝐮𝑘+1,…,𝐮𝑛 is an orthonormal basis of 𝑊⟂, and dim𝑊⟂=𝑛−𝑘.

By Theorem 6.4.20, 𝑊 has an orthonormal basis 𝐮1,…,𝐮𝑘, and it extends to an orthonormal basis 𝐮1,…,𝐮𝑛 of 𝑉, where 𝑛=dim𝑉. (Conversely, every orthonormal basis of 𝑉 whose first 𝑘 vectors span 𝑊 arises this way.) Let 𝑈=span(𝐮𝑘+1,…,𝐮𝑛). We show 𝑈=𝑊⟂ by double containment.

For 𝑗>𝑘, 𝐮𝑗 is orthogonal to 𝐮1,…,𝐮𝑘, so 𝐮𝑗∈𝑊⟂ by Proposition 6.3.9(c). As 𝑊⟂ is a subspace, 𝑈⊆𝑊⟂. Conversely, let 𝐯∈𝑊⟂. Then ⟨𝐯,𝐮𝑗⟩=0 for 𝑗≤𝑘, so by Proposition 6.3.18(b),

𝐯=∑𝑗=1𝑛⟨𝐯,𝐮𝑗⟩𝐮𝑗=∑𝑗=𝑘+1𝑛⟨𝐯,𝐮𝑗⟩𝐮𝑗∈𝑈.

So 𝑊⟂=𝑈. The list 𝐮𝑘+1,…,𝐮𝑛 is orthonormal and spans 𝑊⟂, so it is an orthonormal basis of 𝑊⟂, and dim𝑊⟂=𝑛−𝑘=dim𝑉−dim𝑊. □

The first proof counts. The second builds the basis of 𝑊⟂, and it shows that, in coordinates with respect to an orthonormal basis adapted to 𝑊, the decomposition 𝐯=Pr𝑊(𝐯)+(𝐯−Pr𝑊(𝐯)) simply splits the coordinate vector into its first 𝑘 entries and the rest.

For the matrix 𝐴 of Example 6.4.23(b), the corollary gives dim𝑅=𝑛−dimker𝐴, and rank–nullity (Theorem 4.2.11) gives dimim𝐴=𝑛−dimker𝐴. So the rows of a real matrix span a space of the same dimension as its columns. This is Theorem 4.3.8 for real matrices, obtained here by a dimension count.

Since 𝑊⊆(𝑊⟂)⟂ always holds, the next question is whether taking the complement twice returns 𝑊. In ℝ3 the complement of a plane is its normal line, and the complement of that line is the plane again.

Theorem 6.4.26 (The double complement). Let 𝑊 be a finite-dimensional subspace of 𝑉. Then (𝑊⟂)⟂=𝑊.

Proof (by the orthogonal decomposition).standard

Uses. Theorem 6.4.24 (Orthogonal decomposition), Proposition 6.3.9 (Properties of 𝐴⟂), Exercise 6.3.11

Techniques. Double containment (Technique 1.3.14)

Hint 1. One containment, 𝑊⊆(𝑊⟂)⟂, holds for every subset (Exercise 6.3.11). For the other, take 𝐯∈(𝑊⟂)⟂ and decompose it with Theorem 6.4.24.
Hint 2. Write 𝐯=Pr𝑊(𝐯)+𝐰′ with 𝐰′∈𝑊⟂. Show that 𝐰′ also lies in (𝑊⟂)⟂.
Sketch. 𝑊⊆(𝑊⟂)⟂ always. Conversely, if 𝐯∈(𝑊⟂)⟂, write 𝐯=Pr𝑊(𝐯)+𝐰′ with 𝐰′∈𝑊⟂. Both 𝐯 and Pr𝑊(𝐯)∈𝑊 lie in the subspace (𝑊⟂)⟂, so 𝐰′∈𝑊⟂∩(𝑊⟂)⟂={𝟎}, and 𝐯=Pr𝑊(𝐯)∈𝑊.
By Exercise 6.3.11, 𝑊⊆(𝑊⟂)⟂. Conversely, let 𝐯∈(𝑊⟂)⟂. By Theorem 6.4.24, 𝐯=Pr𝑊(𝐯)+𝐰′ with 𝐰′∈𝑊⟂. Here 𝐯∈(𝑊⟂)⟂ by assumption and Pr𝑊(𝐯)∈𝑊⊆(𝑊⟂)⟂, so 𝐰′=𝐯−Pr𝑊(𝐯)∈(𝑊⟂)⟂, since (𝑊⟂)⟂ is a subspace. So 𝐰′ lies in 𝑊⟂ and in (𝑊⟂)⟂, and Proposition 6.3.9(d), applied to the subspace 𝑊⟂, gives 𝐰′=𝟎. Hence 𝐯=Pr𝑊(𝐯)∈𝑊. □

Proof (by counting dimensions, when 𝑉 is finite-dimensional).routine

Uses. Corollary 6.4.25 (Dimension of the orthogonal complement), Proposition 4.1.21 (Dimensions of subspaces), Exercise 6.3.11

Techniques. Dimension counting (Technique 4.2.24)

Hint 1. You know 𝑊⊆(𝑊⟂)⟂. Compare dimensions.
Hint 2. Apply Corollary 6.4.25 twice: once to 𝑊 and once to 𝑊⟂.
Sketch. 𝑊⊆(𝑊⟂)⟂, and dim(𝑊⟂)⟂=𝑛−(𝑛−dim𝑊)=dim𝑊 by Corollary 6.4.25 applied twice. A subspace of the same finite dimension as a space containing it is that space.

Suppose 𝑉 is finite-dimensional, with 𝑛=dim𝑉. By Corollary 6.4.25, applied to 𝑊 and then to 𝑊⟂,

dim(𝑊⟂)⟂=𝑛−dim𝑊⟂=𝑛−(𝑛−dim𝑊)=dim𝑊.

Since 𝑊⊆(𝑊⟂)⟂ (Exercise 6.3.11) and the dimensions agree, 𝑊=(𝑊⟂)⟂ by Proposition 4.1.21. □

The second proof is shorter but needs 𝑉 finite-dimensional, so that 𝑊⟂ has a dimension at all. The first needs only that 𝑊 is finite-dimensional, which is the setting of the approximation problems below, where 𝑉 is a space of functions.

Corollary 6.4.27 (Testing whether a subspace is everything). Let 𝑊 be a finite-dimensional subspace of 𝑉. Then 𝑊=𝑉 if and only if 𝑊⟂={𝟎}.

Proof.routine

Uses. Theorem 6.4.24 (Orthogonal decomposition), Proposition 6.3.9 (Properties of 𝐴⟂)

Hint 1. One direction is 𝑉⟂={𝟎} (Proposition 6.3.9(d)).
Hint 2. For the other, decompose an arbitrary 𝐯∈𝑉 with Theorem 6.4.24.
Sketch. If 𝑊=𝑉, then 𝑊⟂=𝑉⟂={𝟎}. If 𝑊⟂={𝟎}, then every 𝐯 equals Pr𝑊(𝐯)+𝟎∈𝑊.
If 𝑊=𝑉, then 𝑊⟂=𝑉⟂={𝟎} by Proposition 6.3.9(d). Conversely, suppose 𝑊⟂={𝟎}, and let 𝐯∈𝑉. By Theorem 6.4.24, 𝐯−Pr𝑊(𝐯)∈𝑊⟂={𝟎}, so 𝐯=Pr𝑊(𝐯)∈𝑊. Hence 𝑊=𝑉. □

So to show that a finite-dimensional subspace 𝑊 is all of 𝑉, it suffices to show that the only vector orthogonal to 𝑊 is 𝟎.

Exercise 6.4.28.routine Let 𝑊={𝐱∈ℝ4|𝑥1+𝑥2+𝑥3+𝑥4=0}. Find 𝑊⟂, a formula for Pr𝑊⟂, and the vector of 𝑊 closest to 𝐞1.

Solution.

Uses. Theorem 6.4.26 (The double complement), Corollary 6.4.10 (Projecting with an orthogonal list), Theorem 6.4.6 (The projection is characterized by orthogonality), Proposition 6.3.9 (Properties of 𝐴⟂)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. 𝑊=span(𝐣)⟂ for 𝐣=(1,1,1,1). Apply Theorem 6.4.26.
Hint 2. Pr𝑊⟂ is the projection onto a line. For the closest vector, guess 𝐞1−Pr𝑊⟂(𝐞1) and check the two conditions of Technique 6.4.7 for the subspace 𝑊.
Sketch. 𝑊=span(𝐣)⟂, so 𝑊⟂=span(𝐣) by Theorem 6.4.26, and Pr𝑊⟂(𝐱)=((𝑥1+𝑥2+𝑥3+𝑥4)/4)𝐣. The vector 𝐩=𝐞1−𝐣/4=(3/4,−1/4,−1/4,−1/4) lies in 𝑊, and 𝐞1−𝐩=𝐣/4∈𝑊⟂, so 𝐩=Pr𝑊(𝐞1).

Let 𝐣=(1,1,1,1). Then 𝑊={𝐣}⟂=span(𝐣)⟂ by Proposition 6.3.9(c), and span(𝐣) is finite-dimensional, so Theorem 6.4.26 gives 𝑊⟂=(span(𝐣)⟂)⟂=span(𝐣). By Corollary 6.4.10 with the single vector 𝐣, ‖𝐣‖2=4,

Pr𝑊⟂(𝐱)=𝑥1+𝑥2+𝑥3+𝑥44𝐣.

In particular Pr𝑊⟂(𝐞1)=𝐣/4. Let

𝐩=𝐞1−14𝐣=(34,−14,−14,−14).

Its coordinates add up to 0, so 𝐩∈𝑊, and 𝐞1−𝐩=𝐣/4∈𝑊⟂. By Theorem 6.4.6 (applied with an orthonormal basis of 𝑊), 𝐩=Pr𝑊(𝐞1). By Theorem 6.4.33 below, this is the vector of 𝑊 closest to 𝐞1, at distance ‖𝐣/4‖=1/2. (Proposition 6.4.29(d) below explains the shortcut: Pr𝑊=id−Pr𝑊⟂.)

The projection as a linear map

We now collect the properties of Pr𝑊 as a map 𝑉→𝑉.

Proposition 6.4.29 (The orthogonal projection as a linear map). Let 𝑊 be a finite-dimensional subspace of 𝑉, and let 𝑃=Pr𝑊.

  1. (a)𝑃 is linear, im𝑃=𝑊, and ker𝑃=𝑊⟂.
  2. (b)𝑃2=𝑃. In fact 𝑃(𝐰)=𝐰 for every 𝐰∈𝑊.
  3. (c)⟨𝑃𝐯,𝐱⟩=⟨𝑃𝐯,𝑃𝐱⟩=⟨𝐯,𝑃𝐱⟩ for all 𝐯,𝐱∈𝑉.
  4. (d)If 𝑉 is finite-dimensional, then id𝑉−𝑃=Pr𝑊⟂.

Proof.routine

Uses. Proposition 6.4.4 (Properties of Pr𝒪︀), Theorem 6.4.6 (The projection is characterized by orthogonality), Definition 6.4.11 (Orthogonal projection), Theorem 6.4.20 (Orthonormal bases exist), Proposition 4.1.21 (Dimensions of subspaces), Exercise 6.3.11

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. For ker𝑃, apply Theorem 6.4.6: when is 𝟎 the vector 𝐩 with 𝐩∈𝑊 and 𝐯−𝐩⟂𝑊?
Hint 2. For (c), split the vector in the second slot as 𝐱=𝑃𝐱+(𝐱−𝑃𝐱), and the vector in the first slot similarly.
Hint 3. For (d), check that 𝐯−𝑃𝐯 satisfies the two conditions that characterize Pr𝑊⟂(𝐯).
Sketch. (a) Linearity is Proposition 6.4.4(d). The image lies in 𝑊 and contains every 𝐰=𝑃𝐰. 𝑃𝐯=𝟎 if and only if 𝟎∈𝑊 and 𝐯−𝟎⟂𝑊, that is, 𝐯∈𝑊⟂. (b) 𝑃𝐯∈𝑊 is fixed. (c) ⟨𝑃𝐯,𝐱−𝑃𝐱⟩=0 and ⟨𝐯−𝑃𝐯,𝑃𝐱⟩=0. (d) 𝐯−𝑃𝐯∈𝑊⟂, and 𝐯−(𝐯−𝑃𝐯)=𝑃𝐯∈𝑊 is orthogonal to 𝑊⟂.

(a) 𝑃 is linear by Proposition 6.4.4(d), and im𝑃⊆𝑊 by part (a) of the same proposition. If 𝐰∈𝑊, then 𝑃𝐰=𝐰 by part (c), so 𝑊⊆im𝑃. For the kernel: by Theorem 6.4.6, 𝑃𝐯=𝟎 if and only if 𝟎 satisfies 𝟎∈𝑊 and 𝐯−𝟎∈𝑊⟂, that is, if and only if 𝐯∈𝑊⟂.

(b) For 𝐯∈𝑉, 𝑃𝐯∈𝑊, so 𝑃(𝑃𝐯)=𝑃𝐯 by Proposition 6.4.4(c).

(c) Let 𝐯,𝐱∈𝑉. Since 𝑃𝐯∈𝑊 and 𝐱−𝑃𝐱∈𝑊⟂,

⟨𝑃𝐯,𝐱⟩=⟨𝑃𝐯,𝑃𝐱⟩+⟨𝑃𝐯,𝐱−𝑃𝐱⟩=⟨𝑃𝐯,𝑃𝐱⟩.

Similarly, since 𝐯−𝑃𝐯∈𝑊⟂ and 𝑃𝐱∈𝑊,

⟨𝐯,𝑃𝐱⟩=⟨𝑃𝐯,𝑃𝐱⟩+⟨𝐯−𝑃𝐯,𝑃𝐱⟩=⟨𝑃𝐯,𝑃𝐱⟩.

(d) Since 𝑉 is finite-dimensional, so is 𝑊⟂ (Proposition 4.1.21), so Pr𝑊⟂ is defined (Theorem 6.4.20). Let 𝐯∈𝑉 and 𝐩=𝐯−𝑃𝐯. Then 𝐩∈𝑊⟂ by Proposition 6.4.4(b), and 𝐯−𝐩=𝑃𝐯∈𝑊⊆(𝑊⟂)⟂ (Exercise 6.3.11). These are the two conditions of Theorem 6.4.6 for the subspace 𝑊⟂, so 𝐩=Pr𝑊⟂(𝐯). □

In (d), finite-dimensionality of 𝑉 was used only to know that Pr𝑊⟂ is defined. For any 𝑉, the map 𝐯↦𝐯−Pr𝑊(𝐯) is linear, has image 𝑊⟂, and picks out the 𝑊⟂-component in Theorem 6.4.24.

Parts (b) and (c) characterize orthogonal projections among all linear maps. Part (b) alone does not: the map 𝑃 of Remark 6.4.12 satisfies 𝑃2=𝑃, but ⟨𝑃𝐞2,𝐞1⟩=⟨(−1,0),(1,0)⟩=−1 while ⟨𝐞2,𝑃𝐞1⟩=⟨𝐞2,𝐞1⟩=0.

Proposition 6.4.30 (Recognizing orthogonal projections). Let 𝑉 be finite-dimensional and 𝑃∈L(𝑉). Then 𝑃=Pr𝑊 for some subspace 𝑊 of 𝑉 if and only if

𝑃2=𝑃and⟨𝑃𝐯,𝐱⟩=⟨𝐯,𝑃𝐱⟩for all𝐯,𝐱∈𝑉.

In that case 𝑊=im𝑃.

Proof.standard

Uses. Proposition 6.4.29 (The orthogonal projection as a linear map), Theorem 6.4.6 (The projection is characterized by orthogonality), Theorem 6.4.20 (Orthonormal bases exist), Proposition 4.1.21 (Dimensions of subspaces)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. One direction is Proposition 6.4.29(a)–(c). For the other, the only candidate is 𝑊=im𝑃. Check the two conditions that characterize Pr𝑊(𝐯) for the vector 𝑃𝐯.
Hint 2. Every vector of 𝑊 has the form 𝑃𝐱. Move 𝑃 across the inner product: ⟨𝐯−𝑃𝐯,𝑃𝐱⟩=⟨𝑃(𝐯−𝑃𝐯),𝐱⟩.
Sketch. If 𝑃=Pr𝑊, then 𝑃2=𝑃, the symmetry holds, and im𝑃=𝑊, by Proposition 6.4.29. Conversely, let 𝑊=im𝑃. Then 𝑃𝐯∈𝑊, and for every 𝑃𝐱∈𝑊, ⟨𝐯−𝑃𝐯,𝑃𝐱⟩=⟨𝑃𝐯−𝑃2𝐯,𝐱⟩=0. So 𝑃𝐯=Pr𝑊(𝐯) by Theorem 6.4.6.

If 𝑃=Pr𝑊, then 𝑃2=𝑃 and ⟨𝑃𝐯,𝐱⟩=⟨𝐯,𝑃𝐱⟩ by (b) and (c) of Proposition 6.4.29, and im𝑃=𝑊 by part (a).

Conversely, suppose 𝑃 has the two properties, and let 𝑊=im𝑃. It is a subspace of the finite-dimensional space 𝑉, so it is finite-dimensional (Proposition 4.1.21) and Pr𝑊 is defined (Theorem 6.4.20). Let 𝐯∈𝑉. Then 𝑃𝐯∈𝑊. Every vector of 𝑊 has the form 𝑃𝐱 for some 𝐱∈𝑉, and by the second property, applied to the vectors 𝐯−𝑃𝐯 and 𝐱,

⟨𝐯−𝑃𝐯,𝑃𝐱⟩=⟨𝑃(𝐯−𝑃𝐯),𝐱⟩=⟨𝑃𝐯−𝑃2𝐯,𝐱⟩=⟨𝟎,𝐱⟩=0.

So 𝐯−𝑃𝐯∈𝑊⟂. By Theorem 6.4.6, 𝑃𝐯=Pr𝑊(𝐯). As 𝐯 was arbitrary, 𝑃=Pr𝑊. □

The second condition says that 𝑃 can be moved from one slot of the inner product to the other. In the language of Section 6.6, it says that 𝑃 equals its adjoint, 𝑃∗=𝑃, that is, 𝑃 is self-adjoint (Definition 6.6.26). So the orthogonal projections are exactly the operators with 𝑃2=𝑃=𝑃∗. For 𝑉=𝔽𝑛 with the dot product, Proposition 6.3.27(d) shows that the condition says that the matrix of 𝑃 is Hermitian.

Projection matrices

In 𝔽𝑛 with the dot product, Pr𝑊 is a linear map 𝔽𝑛→𝔽𝑛, so it is multiplication by a matrix. The matrix is built from an orthonormal basis of 𝑊 and its conjugate transpose.

Theorem 6.4.31 (The matrix of an orthogonal projection). Let 𝑊 be a subspace of 𝔽𝑛 with the dot product, let 𝐮1,…,𝐮𝑘 be an orthonormal basis of 𝑊, and let 𝑄∈𝔽𝑛×𝑘 be the matrix with columns 𝐮1,…,𝐮𝑘. Then

Pr𝑊(𝐱)=𝑄𝑄∗𝐱for all𝐱∈𝔽𝑛,

and 𝑄𝑄∗=𝐮1𝐮1∗+⋯+𝐮𝑘𝐮𝑘∗. Moreover 𝑄∗𝑄=𝐼𝑘, while the 𝑛×𝑛 matrix 𝑃=𝑄𝑄∗ satisfies 𝑃2=𝑃 and 𝑃∗=𝑃.

Proof.routine

Uses. Definition 6.3.26 (Conjugate transpose), Proposition 2.4.8 (Four views of the product), Definition 6.1.8 (Dot product), Theorem 6.3.29 (Orthonormal columns), Proposition 6.3.27 (Properties of the conjugate transpose), Proposition 2.4.14 (Algebra of matrices)

Hint 1. Compute 𝑄∗𝐱 entry by entry. Row 𝑖 of 𝑄∗ is 𝐮𝑖∗.
Hint 2. The entries of 𝑄∗𝐱 are the coefficients ⟨𝐱,𝐮𝑖⟩, and multiplying by 𝑄 combines the columns of 𝑄 with these coefficients.
Sketch. The 𝑖th entry of 𝑄∗𝐱 is 𝐮𝑖∗𝐱=𝐱⋅𝐮𝑖=⟨𝐱,𝐮𝑖⟩, so 𝑄(𝑄∗𝐱)=∑𝑖⟨𝐱,𝐮𝑖⟩𝐮𝑖=Pr𝑊(𝐱). Columns times rows gives 𝑄𝑄∗=∑𝑖𝐮𝑖𝐮𝑖∗. Then 𝑄∗𝑄=𝐼𝑘 is Theorem 6.3.29, so (𝑄𝑄∗)2=𝑄(𝑄∗𝑄)𝑄∗=𝑄𝑄∗, and (𝑄𝑄∗)∗=𝑄𝑄∗.

Row 𝑖 of 𝑄∗ is 𝐮𝑖∗ (Definition 6.3.26), so the 𝑖th entry of 𝑄∗𝐱 is 𝐮𝑖∗𝐱=𝐱⋅𝐮𝑖=⟨𝐱,𝐮𝑖⟩ (Definition 6.1.8). By the column view of Proposition 2.4.8, 𝑄(𝑄∗𝐱) is the combination of the columns of 𝑄 with these coefficients:

𝑄𝑄∗𝐱=∑𝑖=1𝑘⟨𝐱,𝐮𝑖⟩𝐮𝑖=Pr𝑊(𝐱).

The columns-times-rows view of Proposition 2.4.8 gives 𝑄𝑄∗=∑𝑖𝐮𝑖𝐮𝑖∗, since column 𝑖 of 𝑄 is 𝐮𝑖 and row 𝑖 of 𝑄∗ is 𝐮𝑖∗. Next, 𝑄∗𝑄=𝐼𝑘 by Theorem 6.3.29. Hence, by associativity and Proposition 6.3.27,

(𝑄𝑄∗)2=𝑄(𝑄∗𝑄)𝑄∗=𝑄𝑄∗,(𝑄𝑄∗)∗=(𝑄∗)∗𝑄∗=𝑄𝑄∗.

□

The two products of 𝑄 and 𝑄∗ play different roles. 𝑄∗𝑄=𝐼𝑘 records that the columns are orthonormal. 𝑄𝑄∗ is the projection onto their span, and it equals 𝐼𝑛 only when 𝑘=𝑛, that is, when 𝑄 is unitary. This is the identification promised after Theorem 6.3.29. Each term 𝐮𝑖𝐮𝑖∗ is the projection onto the line span(𝐮𝑖), so Pr𝑊 is the sum of the projections onto the lines of an orthonormal basis, as in Figure 6.4.1. By Corollary 6.4.10, for an orthogonal basis 𝐟1,…,𝐟𝑘 of 𝑊 the matrix is

∑𝑖=1𝑘𝐟𝑖𝐟𝑖∗𝐟𝑖∗𝐟𝑖.

In particular, the projection onto the line spanned by a nonzero 𝐚∈𝔽𝑛 has matrix 𝐚𝐚∗/(𝐚∗𝐚). For a general basis of 𝑊 the formula needs an inverse, 𝐴(𝐴∗𝐴)−1𝐴∗, which is the subject of Section 6.5.

Example 6.4.32 (Projecting onto a plane in ℝ3). Let 𝑊 be the plane 𝑥1+𝑥2+𝑥3=0 of Example 6.4.9, and 𝐣=(1,1,1), so that 𝑊⟂=span(𝐣) (Example 6.4.23(a)). By Proposition 6.4.29(d) and the formula for lines,

Pr𝑊=𝐼3−𝐣𝐣𝖳3=13(2−1−1−12−1−1−12).

For instance Pr𝑊(3,0,0)=(2,−1,−1), as in Example 6.4.9. The same matrix comes from Theorem 6.4.31 with 𝑄 built from either orthonormal basis of Example 6.4.9. Projecting onto 𝑊⟂ and subtracting needed one rank-one matrix instead of two, a trick worth remembering when 𝑊⟂ is smaller than 𝑊.

6.4.4Best approximation

We return to the question that opened the section: which vector of 𝑊 is closest to 𝐯?

Intuition (The right triangle). Let 𝑊 be a plane through 𝟎 in ℝ3, and 𝐰 any point of 𝑊. The three points 𝐯, Pr𝑊(𝐯), and 𝐰 form a triangle with a right angle at Pr𝑊(𝐯): one leg, 𝐯−Pr𝑊(𝐯), is perpendicular to 𝑊, and the other, Pr𝑊(𝐯)−𝐰, lies in 𝑊 (Figure 6.4.3). The distance from 𝐯 to 𝐰 is the hypotenuse, which is longer than the leg 𝐯−Pr𝑊(𝐯) unless the other leg is 𝟎. So no point of 𝑊 is closer to 𝐯 than Pr𝑊(𝐯), and every other point of 𝑊 is farther away.

This is the shadow argument of Figure 6.2.1, with the line replaced by a subspace. It uses only Pythagoras, so it works in every inner product space.

Figure 6.4.3. For every 𝐰∈𝑊, the points 𝐯, Pr𝑊(𝐯), 𝐰 form a right triangle. Its hypotenuse 𝐯−𝐰 is longer than the leg 𝐯−Pr𝑊(𝐯) unless 𝐰=Pr𝑊(𝐯).

Theorem 6.4.33 (Best approximation). Let 𝑊 be a finite-dimensional subspace of 𝑉, and let 𝐯∈𝑉. Then

‖𝐯−Pr𝑊(𝐯)‖≤‖𝐯−𝐰‖for every𝐰∈𝑊,

with equality if and only if 𝐰=Pr𝑊(𝐯). That is, Pr𝑊(𝐯) is the unique vector of 𝑊 closest to 𝐯. If 𝐮1,…,𝐮𝑘 is an orthonormal basis of 𝑊, the least distance is given by

‖𝐯−Pr𝑊(𝐯)‖2=‖𝐯‖2−∑𝑗=1𝑘|⟨𝐯,𝐮𝑗⟩|2.

Proof (by Pythagoras).routine

Uses. Proposition 6.4.4 (Properties of Pr𝒪︀), Theorem 6.3.3 (Pythagorean theorem), Proposition 6.1.27 (Basic properties of the norm), Theorem 6.4.20 (Orthonormal bases exist)

Techniques. Orthogonal decomposition (Technique 6.2.4), Projections shrink norms (Technique 6.4.5)

Hint 1. Write 𝐯−𝐰=(𝐯−Pr𝑊(𝐯))+(Pr𝑊(𝐯)−𝐰). Where do the two pieces lie?
Hint 2. The first piece is in 𝑊⟂ and the second is in 𝑊, so they are orthogonal. Apply the Pythagorean theorem.
Hint 3. The formula for the least distance is Proposition 6.4.4(e).
Sketch. For 𝐰∈𝑊, 𝐯−𝐰=(𝐯−Pr𝑊(𝐯))+(Pr𝑊(𝐯)−𝐰), with the first piece in 𝑊⟂ and the second in 𝑊. By Pythagoras, ‖𝐯−𝐰‖2=‖𝐯−Pr𝑊(𝐯)‖2+‖Pr𝑊(𝐯)−𝐰‖2, which is at least ‖𝐯−Pr𝑊(𝐯)‖2, with equality exactly when 𝐰=Pr𝑊(𝐯). The distance formula is Proposition 6.4.4(e).

Pr𝑊 is defined by Theorem 6.4.20. Let 𝐰∈𝑊. Then

𝐯−𝐰=(𝐯−Pr𝑊(𝐯))+(Pr𝑊(𝐯)−𝐰),

where 𝐯−Pr𝑊(𝐯)∈𝑊⟂ by Proposition 6.4.4(b), and Pr𝑊(𝐯)−𝐰∈𝑊 because both terms lie in 𝑊. So the two pieces are orthogonal, and by Theorem 6.3.3(a),

‖𝐯−𝐰‖2=‖𝐯−Pr𝑊(𝐯)‖2+‖Pr𝑊(𝐯)−𝐰‖2≥‖𝐯−Pr𝑊(𝐯)‖2.
(6.4.2)

Taking nonnegative square roots gives the inequality. By (6.4.2), equality holds if and only if ‖Pr𝑊(𝐯)−𝐰‖=0, that is (Proposition 6.1.27(a)), if and only if 𝐰=Pr𝑊(𝐯). Finally, by Proposition 6.4.4(e),

‖𝐯−Pr𝑊(𝐯)‖2=‖𝐯‖2−‖Pr𝑊(𝐯)‖2=‖𝐯‖2−∑𝑗=1𝑘|⟨𝐯,𝐮𝑗⟩|2.

□

Proof (by completing the square).standard

Uses. Proposition 6.1.29 (Expanding a norm), Proposition 6.1.4 (Sesquilinearity), Corollary 6.3.6 (Pythagoras for orthogonal lists), Theorem 6.4.20 (Orthonormal bases exist), Definition 6.4.11 (Orthogonal projection)

Techniques. A sum of nonnegative terms (Technique 6.1.9)

Hint 1. Fix an orthonormal basis 𝐮1,…,𝐮𝑘 of 𝑊, write 𝐰=∑𝑗𝑐𝑗𝐮𝑗 and 𝑎𝑗=⟨𝐯,𝐮𝑗⟩, and expand ‖𝐯−𝐰‖2 as a function of 𝑐1,…,𝑐𝑘.
Hint 2. You should get ‖𝐯‖2+∑𝑗(|𝑐𝑗|2−2Re(𝑐𝑗𝑎𝑗)). Complete the square in each 𝑐𝑗, using |𝑐−𝑎|2=|𝑐|2−2Re(𝑐𝑎)+|𝑎|2.
Sketch. With 𝐰=∑𝑗𝑐𝑗𝐮𝑗 and 𝑎𝑗=⟨𝐯,𝐮𝑗⟩: ‖𝐯−𝐰‖2=‖𝐯‖2−2Re⟨𝐯,𝐰⟩+‖𝐰‖2=‖𝐯‖2+∑𝑗(|𝑐𝑗|2−2Re(𝑐𝑗𝑎𝑗))=‖𝐯‖2−∑𝑗|𝑎𝑗|2+∑𝑗|𝑐𝑗−𝑎𝑗|2. The last sum is nonnegative and vanishes exactly when every 𝑐𝑗=𝑎𝑗, that is, when 𝐰=Pr𝑊(𝐯).

By Theorem 6.4.20, 𝑊 has an orthonormal basis 𝐮1,…,𝐮𝑘. Let 𝑎𝑗=⟨𝐯,𝐮𝑗⟩, so that Pr𝑊(𝐯)=∑𝑗𝑎𝑗𝐮𝑗. Every 𝐰∈𝑊 is 𝐰=∑𝑗𝑐𝑗𝐮𝑗 for unique scalars 𝑐𝑗. By Proposition 6.1.29 with 𝑎=−1,

‖𝐯−𝐰‖2=‖𝐯‖2−2Re⟨𝐯,𝐰⟩+‖𝐰‖2.

By Proposition 6.1.4, ⟨𝐯,𝐰⟩=∑𝑗𝑐𝑗⟨𝐯,𝐮𝑗⟩=∑𝑗𝑐𝑗𝑎𝑗, and by Corollary 6.3.6, ‖𝐰‖2=∑𝑗|𝑐𝑗|2. For complex numbers 𝑐 and 𝑎, |𝑐−𝑎|2=(𝑐−𝑎)(𝑐−𝑎)=|𝑐|2−2Re(𝑐𝑎)+|𝑎|2. Hence

‖𝐯−𝐰‖2=‖𝐯‖2+∑𝑗=1𝑘(|𝑐𝑗|2−2Re(𝑐𝑗𝑎𝑗))=‖𝐯‖2−∑𝑗=1𝑘|𝑎𝑗|2+∑𝑗=1𝑘|𝑐𝑗−𝑎𝑗|2.

The first two terms do not depend on 𝐰, and the last sum is a sum of nonnegative terms, which is 0 if and only if 𝑐𝑗=𝑎𝑗 for every 𝑗. So ‖𝐯−𝐰‖2 is smallest exactly when 𝐰=∑𝑗𝑎𝑗𝐮𝑗=Pr𝑊(𝐯), and the smallest value is ‖𝐯‖2−∑𝑗|𝑎𝑗|2. □

The first proof starts from the candidate Pr𝑊(𝐯) and shows that it wins. The second does not need to know the answer in advance: completing the square produces the minimizing coefficients 𝑐𝑗=⟨𝐯,𝐮𝑗⟩ and the minimum at the same time, and it shows that the squared error grows like ∑𝑗|𝑐𝑗−𝑎𝑗|2 as 𝐰 moves away from the optimum. In the language of Technique 6.4.5, the first proof says that for every 𝐰∈𝑊, the error 𝐯−Pr𝑊(𝐯) is the piece of 𝐯−𝐰 orthogonal to 𝑊: moving 𝐰 around 𝑊 changes only the piece in 𝑊, and dropping that piece can only shorten a vector.

The theorem gives a third reason why Pr𝑊 does not depend on the orthonormal basis used to compute it: “the closest vector of 𝑊” is defined by distances alone. Putting Theorem 6.4.6 and Theorem 6.4.33 together, for 𝐩∈𝑊 the following are equivalent:

  1. (i)𝐩=Pr𝑊(𝐯), the formula computed from an orthonormal basis of 𝑊;
  2. (ii)𝐯−𝐩⟂𝑊;
  3. (iii)‖𝐯−𝐩‖≤‖𝐯−𝐰‖ for every 𝐰∈𝑊.

In proofs one usually checks (ii), in computations one uses (i), and in applications the reason to care is (iii).

Definition 6.4.34 (Distance to a subspace). Let 𝑊 be a finite-dimensional subspace of 𝑉 and 𝐯∈𝑉. The distance from 𝐯 to 𝑊 is

dist(𝐯,𝑊)=min𝐰∈𝑊‖𝐯−𝐰‖=‖𝐯−Pr𝑊(𝐯)‖.

The minimum exists by Theorem 6.4.33. So dist(𝐯,𝑊)=0 if and only if 𝐯∈𝑊, and by Theorem 6.4.24, dist(𝐯,𝑊) is the length of the component of 𝐯 in 𝑊⟂. When 𝑉 is finite-dimensional, that component is Pr𝑊⟂(𝐯) (Proposition 6.4.29(d)).

Example 6.4.35 (Distance to a hyperplane). Let 𝐧∈𝔽𝑛 be nonzero and 𝐻={𝐧}⟂={𝐱∈𝔽𝑛|𝐱⋅𝐧=0}. Then 𝐻=span(𝐧)⟂ (Proposition 6.3.9(c)), so 𝐻⟂=span(𝐧) by Theorem 6.4.26. By Proposition 6.4.29(d), 𝐯−Pr𝐻(𝐯)=Prspan(𝐧)(𝐯)=(⟨𝐯,𝐧⟩/‖𝐧‖2)𝐧, and therefore

dist(𝐯,𝐻)=|⟨𝐯,𝐧⟩|‖𝐧‖.

For the plane 2𝑥1−𝑥2+2𝑥3=0 in ℝ3 and 𝐯=(1,1,1), with 𝐧=(2,−1,2): ⟨𝐯,𝐧⟩=3 and ‖𝐧‖=3, so dist(𝐯,𝐻)=1, and the closest point of the plane is 𝐯−(3/9)𝐧=(1/3,4/3,1/3). This is the point-to-plane formula of multivariable calculus, now proved in every dimension and over ℂ.

Exercise 6.4.36.routine Find the point of the plane 𝑊=span((1,1,0),(1,0,1)) in ℝ3 closest to 𝐯=(0,0,3), and the distance from 𝐯 to 𝑊. Check your answer with Example 6.4.35.

Solution.

Uses. Example 6.4.17 (Gram–Schmidt in ℝ3), Theorem 6.4.33 (Best approximation), Example 6.4.35 (Distance to a hyperplane)

Hint 1. Example 6.4.17 already contains an orthonormal basis of 𝑊.
Hint 2. 𝐮1=(1,1,0)/2 and 𝐮2=(1,−1,2)/6. For the check, a normal vector of 𝑊 is 𝐮3.
Sketch. With 𝐮1,𝐮2 from Example 6.4.17, ⟨𝐯,𝐮1⟩=0 and ⟨𝐯,𝐮2⟩=6/6, so Pr𝑊(𝐯)=(1,−1,2) and 𝐯−Pr𝑊(𝐯)=(−1,1,1), of length 3. With 𝐧=(−1,1,1), |⟨𝐯,𝐧⟩|/‖𝐧‖=3/3=3.

By Example 6.4.17, 𝐮1=(1,1,0)/2, 𝐮2=(1,−1,2)/6 is an orthonormal basis of span(𝐯1,𝐯2)=𝑊. Here ⟨𝐯,𝐮1⟩=0 and ⟨𝐯,𝐮2⟩=6/6, so by Theorem 6.4.33 the closest point is

Pr𝑊(𝐯)=0⋅𝐮1+66⋅16(1,−1,2)=(1,−1,2).

The distance is ‖𝐯−Pr𝑊(𝐯)‖=‖(−1,1,1)‖=3. Check: (−1,1,1) is orthogonal to (1,1,0) and (1,0,1), so 𝑊={𝐧}⟂ with 𝐧=(−1,1,1) (both are planes, and one contains the other), and Example 6.4.35 gives |⟨𝐯,𝐧⟩|/‖𝐧‖=3/3=3.

Approximating functions

In a space of functions, Theorem 6.4.33 solves approximation problems. The inner product decides what “close” means. For ⟨𝑓,𝑔⟩=∫−11𝑓(𝑡)𝑔(𝑡)d𝑡, the distance ‖𝑓−𝑝‖=(∫−11(𝑓(𝑡)−𝑝(𝑡))2d𝑡)1/2 measures the error on average over the interval: it is small when 𝑓−𝑝 is small on most of [−1,1], even if it is larger at a few points.

Example 6.4.37 (The quadratic closest to 𝑒𝑡). In 𝐶[−1,1] with ⟨𝑓,𝑔⟩=∫−11𝑓(𝑡)𝑔(𝑡)d𝑡, let 𝑊 be the subspace of polynomial functions of degree at most 2. Which 𝑝∈𝑊 makes ∫−11(𝑒𝑡−𝑝(𝑡))2d𝑡 as small as possible? By Theorem 6.4.33 the answer is 𝑝=Pr𝑊(𝑒𝑡). The orthogonal basis 1,𝑡,𝑡2−1/3 of Example 6.4.19, whose squared norms are 2, 2/3, and 8/45, and Corollary 6.4.10 give

𝑝=⟨𝑒𝑡,1⟩2+⟨𝑒𝑡,𝑡⟩2/3𝑡+⟨𝑒𝑡,𝑡2−1/3⟩8/45(𝑡2−13).

Integrating by parts,

∫−11𝑒𝑡d𝑡=𝑒−𝑒−1,∫−11𝑡𝑒𝑡d𝑡=2𝑒−1,∫−11𝑡2𝑒𝑡d𝑡=𝑒−5𝑒−1,

so ⟨𝑒𝑡,𝑡2−1/3⟩=𝑒−5𝑒−1−(𝑒−𝑒−1)/3=(2/3)(𝑒−7𝑒−1). Therefore

𝑝(𝑡)=𝑒−𝑒−12+3𝑒−1𝑡+154(𝑒−7𝑒−1)(𝑡2−13)≈0.9963+1.1036𝑡+0.5367𝑡2.

Compare the Taylor polynomial 𝑇(𝑡)=1+𝑡+𝑡2/2, which is also quadratic. Figure 6.4.4 plots both errors. Near 0, 𝑇 is better: it agrees with 𝑒𝑡 to second order there. Over the whole interval, 𝑝 is better. Its squared distance from 𝑒𝑡 is ∫−11(𝑒𝑡−𝑝)2≈0.0014, against ∫−11(𝑒𝑡−𝑇)2≈0.0090 for 𝑇, and even its largest error on [−1,1] is smaller: about 0.082 at 𝑡=1, against 0.218 for 𝑇.

Figure 6.4.4. The errors 𝑒𝑡−𝑝(𝑡) of the best quadratic approximation in the sense of Example 6.4.37, and 𝑒𝑡−𝑇(𝑡) of the Taylor polynomial 𝑇(𝑡)=1+𝑡+𝑡2/2, on [−1,1]. The Taylor error is tiny near 0 and large near the ends; the projection spreads the error over the interval and changes sign three times.

The error 𝑔(𝑡)=𝑒𝑡−𝑝(𝑡) is orthogonal to 1, 𝑡, and 𝑡2. It has at most three zeros, since 𝑔‴=𝑒𝑡>0 and, by Rolle’s theorem, four zeros of 𝑔 would give a zero of 𝑔‴. With this, the argument of Exercise 6.4.61 shows that 𝑔 changes sign at least three times in (−1,1), as Figure 6.4.4 shows. The same recipe works for any continuous 𝑓 and any degree 𝑛: run Gram–Schmidt on 1,𝑡,…,𝑡𝑛 once, and then each approximation costs 𝑛+1 integrals. A function need not be differentiable to have a best approximation; Exercise 6.4.44 finds the quadratic closest to |𝑡|, which has no Taylor polynomial at 0.

Aside (Fourier truncation).Beyond 21-242 Take the inner product ⟨𝑓,𝑔⟩=12𝜋∫02𝜋𝑓(𝑡)𝑔(𝑡)d𝑡 on 𝐶([0,2𝜋],ℂ) and the orthonormal functions 𝑒𝑘(𝑡)=cos𝑘𝑡+𝑖sin𝑘𝑡 of Aside (Fourier coefficients), and let 𝑊𝑁=span(𝑒−𝑁,…,𝑒𝑁), the trigonometric polynomials of degree at most 𝑁. By Theorem 6.4.33, the trigonometric polynomial of degree at most 𝑁 closest to 𝑓 is the partial Fourier sum

𝑆𝑁𝑓=Pr𝑊𝑁(𝑓)=∑𝑘=−𝑁𝑁𝑐𝑘𝑒𝑘,𝑐𝑘=⟨𝑓,𝑒𝑘⟩,

and ‖𝑓−𝑆𝑁𝑓‖2=‖𝑓‖2−∑𝑘=−𝑁𝑁|𝑐𝑘|2. Since 𝑊𝑁⊆𝑊𝑁+1, the error can only decrease as 𝑁 grows. For 𝑓(𝑡)=𝑡, integration by parts gives 𝑐0=𝜋 and 𝑐𝑘=𝑖/𝑘 for 𝑘≠0, so

𝑆𝑁𝑓(𝑡)=𝜋−2∑𝑘=1𝑁sin𝑘𝑡𝑘,‖𝑓−𝑆𝑁𝑓‖2=4𝜋23−𝜋2−2∑𝑘=1𝑁1𝑘2.

The left side is nonnegative, so ∑𝑘=1𝑁1/𝑘2≤𝜋2/6 for every 𝑁. In fact the error tends to 0 as 𝑁→∞ (Section 15.3), which gives Euler’s formula ∑𝑘=1∞1/𝑘2=𝜋2/6.

Figure 6.4.5. The function 𝑡 on [0,2𝜋] and its partial Fourier sums 𝑆1, 𝑆3, 𝑆12. Each 𝑆𝑁 is the closest trigonometric polynomial of degree at most 𝑁 in the mean-square sense, and the fit improves with 𝑁 except near the ends of the interval.

Best approximation in 𝔽𝑚 is the subject of Section 6.5. There 𝑊 is the image of a matrix 𝐴, and Prim𝐴(𝐛) is the closest one can come to solving an inconsistent system 𝐴𝐱=𝐛.

6.4.5QR factorization Beyond 21-242

QR factorization is Gram–Schmidt in matrix form. It is not covered in lecture; see LADR 7D.

Gram–Schmidt applied to the columns of a matrix factors the matrix. If 𝐴 has linearly independent columns 𝐚1,…,𝐚𝑛 and Gram–Schmidt turns them into 𝐮1,…,𝐮𝑛, then span(𝐮1,…,𝐮𝑗)=span(𝐚1,…,𝐚𝑗) for each 𝑗. So each 𝐚𝑗 is a combination of 𝐮1,…,𝐮𝑗 only, and recording the coefficients produces an upper triangular matrix.

Theorem 6.4.38 (QR factorization). Let 𝐴∈𝔽𝑚×𝑛 have linearly independent columns 𝐚1,…,𝐚𝑛. Then there are unique matrices 𝑄∈𝔽𝑚×𝑛 with orthonormal columns and 𝑅∈𝔽𝑛×𝑛 upper triangular with positive real diagonal entries such that 𝐴=𝑄𝑅. The columns of 𝑄 are the output 𝐮1,…,𝐮𝑛 of Gram–Schmidt applied to 𝐚1,…,𝐚𝑛, and 𝑟𝑖𝑗=⟨𝐚𝑗,𝐮𝑖⟩ for 𝑖≤𝑗.

Proof.hard

Uses. Theorem 6.4.15 (Gram–Schmidt is correct), Proposition 6.3.18 (Coordinates in an orthonormal basis), Proposition 2.4.8 (Four views of the product), Lemma 3.3.32 (Products and inverses of triangular matrices), Theorem 6.3.29 (Orthonormal columns), Exercise 6.3.57, Proposition 6.3.27 (Properties of the conjugate transpose)

Techniques. Uniqueness via two candidates (Technique 1.1.8)

Hint 1. For existence, by Theorem 6.4.15(d), 𝐚𝑗∈span(𝐮1,…,𝐮𝑗). Expand it with Proposition 6.3.18(a), and read the coefficients as column 𝑗 of 𝑅.
Hint 2. For uniqueness, suppose 𝑄𝑅=𝑄′𝑅′. Then 𝑄=𝑄′𝑈 with 𝑈=𝑅′𝑅−1. What kind of matrix is 𝑈, and what does 𝑄∗𝑄=𝐼𝑛 say about it?
Hint 3. An upper triangular unitary matrix is diagonal (Exercise 6.3.57(c)).
Sketch. Existence: 𝐚𝑗=∑𝑖≤𝑗⟨𝐚𝑗,𝐮𝑖⟩𝐮𝑖, so column 𝑗 of 𝐴 is 𝑄 times the column (𝑟1𝑗,…,𝑟𝑗𝑗,0,…,0), and 𝑟𝑗𝑗=‖𝐟𝑗‖>0 by Theorem 6.4.15(d). Uniqueness: if 𝑄𝑅=𝑄′𝑅′, then 𝑈=𝑅′𝑅−1 is upper triangular with positive diagonal and 𝑄=𝑄′𝑈; then 𝐼𝑛=𝑄∗𝑄=𝑈∗𝑈, so 𝑈 is unitary and upper triangular, hence diagonal with entries of modulus 1, hence 𝑈=𝐼𝑛.

Existence. By Theorem 6.4.15(d), Gram–Schmidt applied to 𝐚1,…,𝐚𝑛 skips nothing, and its output 𝐮1,…,𝐮𝑛 is orthonormal with 𝐚𝑗∈span(𝐮1,…,𝐮𝑗). By Proposition 6.3.18(a),

𝐚𝑗=∑𝑖=1𝑗⟨𝐚𝑗,𝐮𝑖⟩𝐮𝑖.

Let 𝑄 have columns 𝐮1,…,𝐮𝑛, and let 𝑟𝑖𝑗=⟨𝐚𝑗,𝐮𝑖⟩ for 𝑖≤𝑗 and 𝑟𝑖𝑗=0 for 𝑖>𝑗. Then 𝑅 is upper triangular, 𝑟𝑗𝑗=‖𝐟𝑗‖>0 by Theorem 6.4.15(d), and by the column view of Proposition 2.4.8, column 𝑗 of 𝑄𝑅 is ∑𝑖𝑟𝑖𝑗𝐮𝑖=𝐚𝑗. So 𝐴=𝑄𝑅.

Uniqueness. Suppose 𝐴=𝑄𝑅=𝑄′𝑅′, where both pairs have the stated properties. An upper triangular matrix 𝑅 with nonzero diagonal entries is invertible with upper triangular inverse, whose diagonal entries are 1/𝑟𝑗𝑗: write 𝑅=𝐷𝑁 with 𝐷 the diagonal matrix of the 𝑟𝑗𝑗 and 𝑁=𝐷−1𝑅 unit upper triangular, and apply Lemma 3.3.32 to get 𝑅−1=𝑁−1𝐷−1. So 𝑈=𝑅′𝑅−1 is upper triangular with diagonal entries 𝑟𝑗𝑗′/𝑟𝑗𝑗>0, again by Lemma 3.3.32. Multiplying 𝑄𝑅=𝑄′𝑅′ on the right by 𝑅−1 gives 𝑄=𝑄′𝑈. Since 𝑄 and 𝑄′ have orthonormal columns, Theorem 6.3.29 and Proposition 6.3.27 give

𝐼𝑛=𝑄∗𝑄=𝑈∗𝑄′∗𝑄′𝑈=𝑈∗𝑈.

So the square matrix 𝑈 is unitary and upper triangular. By Exercise 6.3.57(c) it is diagonal with diagonal entries of modulus 1, and these entries are positive, so 𝑈=𝐼𝑛. Hence 𝑅′=𝑈𝑅=𝑅 and 𝑄′=𝑄𝑈−1=𝑄. □

The factorization repackages several earlier facts. The columns of 𝑄 are an orthonormal basis of im𝐴, so Prim𝐴=𝑄𝑄∗ by Theorem 6.4.31. If 𝐴 is square, then 𝑄 is unitary, so |det𝐴|=|det𝑄|det𝑅=𝑟11⋯𝑟𝑛𝑛 (Theorem 5.4.10, Proposition 5.3.15, Exercise 6.3.57), and the system 𝐴𝐱=𝐛 becomes 𝑅𝐱=𝑄∗𝐛, which is solved by back substitution. Section 6.5 uses the same reduction for inconsistent systems.

Example 6.4.39 (A QR factorization). Let 𝐴 have the columns 𝐚1=(1,1,0), 𝐚2=(1,0,1), 𝐚3=(0,1,1) of Example 6.4.17. The output of Gram–Schmidt was 𝐮1=(1,1,0)/2, 𝐮2=(1,−1,2)/6, 𝐮3=(−1,1,1)/3, and the entries of 𝑅 are the inner products 𝑟𝑖𝑗=⟨𝐚𝑗,𝐮𝑖⟩:

𝐴=(110101011)=𝑄𝑅,

where

𝑄=(1/21/6−1/31/2−1/61/302/61/3),𝑅=(21/21/203/61/6002/3).

The diagonal entries 2, 3/6, 2/3 are the lengths of the residuals, and their product is 2=|det𝐴|.

In floating-point arithmetic, Algorithm 6.4.14 as written can lose orthogonality badly when the columns are nearly dependent. Practical codes reorder the same computation (modified Gram–Schmidt) or build 𝑄 from reflections instead (Section 9.3).

Exercises

Exercise 6.4.40.routine In ℝ4, let 𝑊=span(𝐯1,𝐯2,𝐯3) with 𝐯1=(1,1,1,1), 𝐯2=(2,0,0,2), 𝐯3=(0,2,0,0).

  1. (a)Find an orthonormal basis of 𝑊 with Gram–Schmidt.
  2. (b)Find Pr𝑊(𝐛) for 𝐛=(1,2,3,4), and dist(𝐛,𝑊).
  3. (c)Find 𝑊⟂.

Solution.

Uses. Algorithm 6.4.14 (Gram–Schmidt), Remark 6.4.16 (Postponing the normalization), Corollary 6.4.10 (Projecting with an orthogonal list), Theorem 6.4.33 (Best approximation), Corollary 6.4.25 (Dimension of the orthogonal complement)

Hint 1. Run the algorithm with residuals only (Remark 6.4.16). The coefficients are ⟨𝐯𝑗,𝐟𝑖⟩/‖𝐟𝑖‖2.
Hint 2. The residuals are (1,1,1,1), (1,−1,−1,1), (0,1,−1,0). For (b), use Corollary 6.4.10 with these.
Hint 3. For (c), dim𝑊⟂=1, and 𝐛−Pr𝑊(𝐛) is a nonzero vector of 𝑊⟂.
Sketch. 𝐟1=(1,1,1,1), 𝐟2=𝐯2−𝐟1=(1,−1,−1,1), 𝐟3=𝐯3−𝐟1/2+𝐟2/2=(0,1,−1,0). Then Pr𝑊(𝐛)=(10/4)𝐟1+0𝐟2−(1/2)𝐟3=(5/2,2,3,5/2), and 𝐛−Pr𝑊(𝐛)=(3/2)(−1,0,0,1), of length 3/2. 𝑊⟂=span((1,0,0,−1)).

(a) By Remark 6.4.16 we may work with residuals. First 𝐟1=(1,1,1,1), with ‖𝐟1‖2=4. Next ⟨𝐯2,𝐟1⟩=4, so

𝐟2=(2,0,0,2)−(1,1,1,1)=(1,−1,−1,1),

with ‖𝐟2‖2=4. Then ⟨𝐯3,𝐟1⟩=2 and ⟨𝐯3,𝐟2⟩=−2, so

𝐟3=(0,2,0,0)−12(1,1,1,1)+12(1,−1,−1,1)=(0,1,−1,0),

with ‖𝐟3‖2=2. No residual is 𝟎, so 𝐯1,𝐯2,𝐯3 is independent, and

𝐮1=12(1,1,1,1),𝐮2=12(1,−1,−1,1),𝐮3=12(0,1,−1,0)

is an orthonormal basis of 𝑊 (Theorem 6.4.15).

(b) We have ⟨𝐛,𝐟1⟩=10, ⟨𝐛,𝐟2⟩=1−2−3+4=0, and ⟨𝐛,𝐟3⟩=−1. By Corollary 6.4.10,

Pr𝑊(𝐛)=104(1,1,1,1)+0−12(0,1,−1,0)=(52,2,3,52).

So 𝐛−Pr𝑊(𝐛)=(−3/2,0,0,3/2), which is indeed orthogonal to 𝐟1,𝐟2,𝐟3, and by Theorem 6.4.33, dist(𝐛,𝑊)=9/4+9/4=3/2.

(c) By Corollary 6.4.25, dim𝑊⟂=4−3=1. The vector (1,0,0,−1) is orthogonal to 𝐟1, 𝐟2, 𝐟3, which span 𝑊, so it lies in 𝑊⟂ (Proposition 6.3.9(c)). Hence 𝑊⟂=span((1,0,0,−1)). As it must, 𝐛−Pr𝑊(𝐛)=−(3/2)(1,0,0,−1) lies in 𝑊⟂.

Exercise 6.4.41.routine Let 𝑊=span((1,0,1),(1,1,0)) in ℝ3. Find the matrix 𝑃 of Pr𝑊 in two ways: (a) by Gram–Schmidt and Theorem 6.4.31, and (b) from a vector 𝐧 spanning 𝑊⟂. Check that 𝑃2=𝑃, 𝑃𝖳=𝑃, and tr𝑃=2.

Solution.

Uses. Theorem 6.4.31 (The matrix of an orthogonal projection), Corollary 6.4.10 (Projecting with an orthogonal list), Proposition 6.4.29 (The orthogonal projection as a linear map), Corollary 6.4.25 (Dimension of the orthogonal complement)

Hint 1. Gram–Schmidt with residuals gives (1,0,1) and (1,2,−1). Use ∑𝑖𝐟𝑖𝐟𝑖𝖳/‖𝐟𝑖‖2.
Hint 2. For (b), find 𝐧≠𝟎 orthogonal to both spanning vectors; then 𝑃=𝐼3−𝐧𝐧𝖳/‖𝐧‖2 by Proposition 6.4.29(d).
Sketch. Both ways give 𝑃=(1/3)(21112−11−12): in (a) as (1/2)𝐟1𝐟1𝖳+(1/6)𝐟2𝐟2𝖳 with 𝐟1=(1,0,1), 𝐟2=(1,2,−1), and in (b) as 𝐼3−(1/3)𝐧𝐧𝖳 with 𝐧=(−1,1,1). The trace is 6/3=2=dim𝑊.

(a) Gram–Schmidt with residuals: 𝐟1=(1,0,1), and (1,1,0)−(1/2)(1,0,1)=(1/2,1,−1/2), which we replace by 𝐟2=(1,2,−1). By Theorem 6.4.31 and Corollary 6.4.10,

𝑃=12(101000101)+16(12−124−2−1−21)=13(21112−11−12).

(b) The vector 𝐧=(−1,1,1) is orthogonal to (1,0,1) and (1,1,0), so it lies in 𝑊⟂, which is a line by Corollary 6.4.25. So 𝑊⟂=span(𝐧) and, by Proposition 6.4.29(d),

𝑃=𝐼3−𝐧𝐧𝖳3=𝐼3−13(1−1−1−111−111)=13(21112−11−12).

The matrix is symmetric, and tr𝑃=(2+2+2)/3=2. For 𝑃2=𝑃, by Theorem 6.4.31 there is nothing to check, but directly: the first row of 3𝑃 times the columns of 3𝑃 gives (4+1+1,2+2−1,2−1+2)=(6,3,3), which is 3 times the first row of 3𝑃, and similarly for the other rows; so (3𝑃)2=3(3𝑃), that is, 𝑃2=𝑃.

Exercise 6.4.42.routine To project 𝐯=(1,2,3) onto 𝑊=span(𝐚,𝐛), where 𝐚=(1,0,0) and 𝐛=(1,1,0), a student adds the shadows of 𝐯 on the two spanning vectors:

⟨𝐯,𝐚⟩‖𝐚‖2𝐚+⟨𝐯,𝐛⟩‖𝐛‖2𝐛=(1,0,0)+32(1,1,0)=(52,32,0).

Find the error, show that the answer fails the test of Theorem 6.4.6, and compute Pr𝑊(𝐯) correctly.

Solution.

Uses. Corollary 6.4.10 (Projecting with an orthogonal list), Theorem 6.4.6 (The projection is characterized by orthogonality), Algorithm 6.4.14 (Gram–Schmidt)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. Which hypothesis of Corollary 6.4.10 does the list 𝐚,𝐛 fail?
Hint 2. Check whether 𝐯−(5/2,3/2,0) is orthogonal to 𝐚. To fix the computation, orthogonalize 𝐚,𝐛 first.
Sketch. The formula needs an orthogonal list, and ⟨𝐚,𝐛⟩=1≠0. The student’s 𝐯−𝐩=(−3/2,1/2,3) has inner product −3/2 with 𝐚. Gram–Schmidt replaces 𝐛 by (0,1,0), and then Pr𝑊(𝐯)=(1,0,0)+(0,2,0)=(1,2,0).

The formula of Corollary 6.4.10 holds for orthogonal lists, and ⟨𝐚,𝐛⟩=1≠0. The test of Theorem 6.4.6 detects the error: for 𝐩=(5/2,3/2,0), the vector 𝐯−𝐩=(−3/2,1/2,3) has ⟨𝐯−𝐩,𝐚⟩=−3/2≠0, so 𝐯−𝐩∉𝑊⟂.

Gram–Schmidt turns 𝐚,𝐛 into the orthogonal list 𝐚, 𝐛−⟨𝐛,𝐚⟩𝐚=(0,1,0) with the same span, so 𝑊 is the 𝑥1𝑥2-plane. Now Corollary 6.4.10 applies:

Pr𝑊(𝐯)=1⋅(1,0,0)+2⋅(0,1,0)=(1,2,0),

and 𝐯−Pr𝑊(𝐯)=(0,0,3) is orthogonal to 𝑊. The student’s vector even lies in 𝑊; it is just the wrong vector of 𝑊.

Exercise 6.4.43.routine Run Gram–Schmidt on 𝐯1=(1,0,1,0), 𝐯2=(1,1,0,0), 𝐯3=(0,1,−1,0), 𝐯4=(0,0,0,1) in ℝ4. Which vector is skipped? Use the computation to write the skipped vector as a combination of the earlier ones, and give dimspan(𝐯1,…,𝐯4).

Solution.

Uses. Algorithm 6.4.14 (Gram–Schmidt), Theorem 6.4.15 (Gram–Schmidt is correct), Remark 6.4.16 (Postponing the normalization)

Hint 1. Use residuals. 𝐟1=(1,0,1,0) and 𝐟2 is a multiple of (1,2,−1,0).
Hint 2. The third residual is 𝟎. Its formula expresses 𝐯3 through 𝐟1 and 𝐟2; rewrite those in terms of 𝐯1 and 𝐯2.
Sketch. 𝐟1=(1,0,1,0); 𝐟2=𝐯2−𝐟1/2, rescaled to 𝐠=(1,2,−1,0)=2𝐯2−𝐯1; 𝐯3−(−1/2)𝐟1−(3/6)𝐠=𝟎, so 𝐯3 is skipped and 𝐯3=−𝐯1/2+𝐠/2=𝐯2−𝐯1; 𝐯4 is already orthogonal to the others. The dimension is 3.

With residuals (Remark 6.4.16): 𝐟1=(1,0,1,0), ‖𝐟1‖2=2. Then ⟨𝐯2,𝐟1⟩=1, and

𝐯2−12𝐟1=(12,1,−12,0),

which we replace by 𝐠=(1,2,−1,0)=2𝐯2−𝐯1, with ‖𝐠‖2=6. In the third pass, ⟨𝐯3,𝐟1⟩=−1 and ⟨𝐯3,𝐠⟩=2+1=3, so

𝐯3+12(1,0,1,0)−36(1,2,−1,0)=(0+12−12,1−1,−1+12+12,0)=𝟎.

So 𝐯3 is skipped, and by Theorem 6.4.15(b) it lies in span(𝐯1,𝐯2). Explicitly, 𝐯3=−(1/2)𝐯1+(1/2)(2𝐯2−𝐯1)=𝐯2−𝐯1, which is easily checked. Finally 𝐯4 is orthogonal to 𝐟1 and 𝐠, so its residual is 𝐯4 itself. Three vectors are kept, so the output

12(1,0,1,0),16(1,2,−1,0),(0,0,0,1)

is an orthonormal basis of span(𝐯1,…,𝐯4) (Theorem 6.4.15(c)), whose dimension is therefore 3.

Exercise 6.4.44.standard In 𝐶[−1,1] with ⟨𝑓,𝑔⟩=∫−11𝑓(𝑡)𝑔(𝑡)d𝑡, find the polynomial functions of degree at most 0, at most 1, and at most 2 closest to 𝑓(𝑡)=|𝑡|, and the squared distance from 𝑓 to each.

Solution.

Uses. Theorem 6.4.33 (Best approximation), Example 6.4.19 (Legendre polynomials), Corollary 6.4.10 (Projecting with an orthogonal list)

Hint 1. Use the orthogonal basis 1,𝑡,𝑡2−1/3 of Example 6.4.19, with squared norms 2, 2/3, 8/45. Each new degree adds one term to the projection.
Hint 2. ⟨|𝑡|,1⟩=1, ⟨|𝑡|,𝑡⟩=0 (odd integrand), and ⟨|𝑡|,𝑡2⟩=2∫01𝑡3d𝑡=1/2.
Hint 3. The squared distance is ‖𝑓‖2 minus the squared norm of the projection, and each term contributes ⟨𝑓,𝐟𝑗⟩2/‖𝐟𝑗‖2.
Sketch. The coefficients are 1/2, 0, and (1/6)/(8/45)=15/16. So the best constant and the best linear function are both 1/2, with squared distance 2/3−1/2=1/6, and the best quadratic is 1/2+(15/16)(𝑡2−1/3)=(3+15𝑡2)/16, with squared distance 1/6−(1/36)(45/8)=1/96.

Let 𝑓(𝑡)=|𝑡|. The polynomial functions of degree at most 𝑛 form a finite-dimensional subspace 𝑊𝑛, and by Theorem 6.4.33 the closest one to 𝑓 is Pr𝑊𝑛(𝑓). By Example 6.4.19, 1; 1,𝑡; and 1,𝑡,𝑡2−1/3 are orthogonal bases of 𝑊0, 𝑊1, 𝑊2, with squared norms 2, 2/3, 8/45. We need

⟨𝑓,1⟩=2∫01𝑡d𝑡=1,⟨𝑓,𝑡⟩=0,⟨𝑓,𝑡2−13⟩=2∫01𝑡3d𝑡−13=12−13=16,

where ⟨𝑓,𝑡⟩=0 because |𝑡|𝑡 is odd. By Corollary 6.4.10,

Pr𝑊0(𝑓)=Pr𝑊1(𝑓)=12,Pr𝑊2(𝑓)=12+1/68/45(𝑡2−13)=12+1516(𝑡2−13)=3+15𝑡216.

For the distances, ‖𝑓‖2=∫−11𝑡2d𝑡=2/3, and by Theorem 6.4.33 (applied with the normalized basis, whose squared inner products with 𝑓 are ⟨𝑓,𝐟𝑗⟩2/‖𝐟𝑗‖2),

dist(𝑓,𝑊0)2=dist(𝑓,𝑊1)2=23−122=16,dist(𝑓,𝑊2)2=16−(1/6)28/45=16−532=196.

The best linear approximation is no better than the best constant, because 𝑓 is even and 𝑡 is odd. Allowing 𝑡2 cuts the squared error by a factor of 16, although |𝑡| is not differentiable at 0 and has no Taylor polynomial there.

Exercise 6.4.45.standard Find the minimum of ∫−11(𝑡3−𝑎−𝑏𝑡−𝑐𝑡2)2d𝑡 over all 𝑎,𝑏,𝑐∈ℝ, and the values of 𝑎,𝑏,𝑐 that attain it.

Solution.

Uses. Theorem 6.4.33 (Best approximation), Example 6.4.19 (Legendre polynomials), Exercise 6.3.49

Hint 1. The integral is ‖𝑡3−𝑝‖2 for 𝑝=𝑎+𝑏𝑡+𝑐𝑡2 in the subspace 𝑊 of polynomial functions of degree at most 2. Which 𝑝 minimizes it?
Hint 2. 𝑝=Pr𝑊(𝑡3), and 𝑡3−Pr𝑊(𝑡3) is the fourth Gram–Schmidt residual of Example 6.4.19.
Sketch. By Theorem 6.4.33 the minimizer is 𝑝=Pr𝑊(𝑡3), and 𝑡3−Pr𝑊(𝑡3) is the residual 𝑡3−(3/5)𝑡 from Gram–Schmidt on 1,𝑡,𝑡2,𝑡3. So 𝑎=𝑐=0, 𝑏=3/5, and the minimum is ‖𝑡3−(3/5)𝑡‖2=8/175 (Exercise 6.3.49).

Let 𝑊 be the space of polynomial functions of degree at most 2 in 𝐶[−1,1] with ⟨𝑓,𝑔⟩=∫−11𝑓𝑔. The integral is ‖𝑡3−𝑝‖2 with 𝑝=𝑎+𝑏𝑡+𝑐𝑡2∈𝑊, and as (𝑎,𝑏,𝑐) ranges over ℝ3, 𝑝 ranges over all of 𝑊. By Theorem 6.4.33 the minimum is attained exactly at 𝑝=Pr𝑊(𝑡3).

By Example 6.4.19, 𝑊=span(1,𝑡,𝑡2), and the fourth Gram–Schmidt residual is 𝑡3−Pr𝑊(𝑡3)=𝑡3−(3/5)𝑡. So Pr𝑊(𝑡3)=(3/5)𝑡: the minimum is attained exactly at 𝑎=0, 𝑏=3/5, 𝑐=0, and its value is

‖𝑡3−35𝑡‖2=∫−11(𝑡6−65𝑡4+925𝑡2)d𝑡=27−1225+625=8175,

as computed in Exercise 6.3.49. (Calculus would set three partial derivatives to 0 and solve a 3×3 system; the orthogonal basis does that work once and for all.)

Exercise 6.4.46.standard Give ℝ[𝑥]≤2 the inner product ⟨𝑝,𝑞⟩=∫01𝑝(𝑡)𝑞(𝑡)d𝑡 used in lecture.

  1. (a)Apply Gram–Schmidt to 1,𝑥,𝑥2, and show that the output is 1, 3(2𝑥−1), 5(6𝑥2−6𝑥+1).
  2. (b)Find min𝑎,𝑏∈ℝ∫01(𝑡2−𝑎−𝑏𝑡)2d𝑡.

Solution.

Uses. Algorithm 6.4.14 (Gram–Schmidt), Remark 6.4.16 (Postponing the normalization), Theorem 6.4.33 (Best approximation)

Hint 1. ⟨𝑥𝑖,𝑥𝑗⟩=1/(𝑖+𝑗+1). Work with residuals.
Hint 2. The residuals are 1, 𝑥−1/2, 𝑥2−𝑥+1/6, with squared norms 1, 1/12, 1/180.
Hint 3. For (b), the minimizer is 𝑎+𝑏𝑥=Pr(𝑥2) onto span(1,𝑥), and the minimum is the squared norm of the third residual.
Sketch. 𝑓1=1; 𝑓2=𝑥−⟨𝑥,1⟩=𝑥−1/2; 𝑓3=𝑥2−1/3−(1/12)/(1/12)(𝑥−1/2)=𝑥2−𝑥+1/6. Normalizing with ‖𝑓2‖2=1/12 and ‖𝑓3‖2=1/180 gives the list. (b) The minimum is ‖𝑓3‖2=1/180, at 𝑎+𝑏𝑡=𝑡−1/6.

(a) Here ⟨𝑥𝑖,𝑥𝑗⟩=∫01𝑡𝑖+𝑗d𝑡=1/(𝑖+𝑗+1). With residuals: 𝑓1=1, ‖𝑓1‖2=1, and 𝑓2=𝑥−⟨𝑥,1⟩⋅1=𝑥−1/2, with

‖𝑓2‖2=∫01(𝑡−12)2d𝑡=112.

Next, ⟨𝑥2,1⟩=1/3 and ⟨𝑥2,𝑥−1/2⟩=1/4−1/6=1/12, so

𝑓3=𝑥2−13−1/121/12(𝑥−12)=𝑥2−𝑥+16.

Expanding, ‖𝑓3‖2=∫01(𝑡4−2𝑡3+(4/3)𝑡2−𝑡/3+1/36)d𝑡=1/5−1/2+4/9−1/6+1/36=1/180. Normalizing,

𝑢1=1,𝑢2=12(𝑥−12)=3(2𝑥−1),𝑢3=180(𝑥2−𝑥+16)=5(6𝑥2−6𝑥+1).

The first two are the output of the lecture’s example.

(b) As (𝑎,𝑏) ranges over ℝ2, 𝑎+𝑏𝑥 ranges over 𝑊=span(1,𝑥)=span(𝑓1,𝑓2). By Theorem 6.4.33, the minimum is dist(𝑥2,𝑊)2=‖𝑥2−Pr𝑊(𝑥2)‖2, and 𝑥2−Pr𝑊(𝑥2) is the residual 𝑓3. So the minimum is 1/180, attained at 𝑎+𝑏𝑥=𝑥2−𝑓3=𝑥−1/6, that is, 𝑎=−1/6, 𝑏=1.

Exercise 6.4.47.standard Let 𝑈 and 𝑊 be subspaces of 𝑉.

  1. (a)Show that (𝑈+𝑊)⟂=𝑈⟂∩𝑊⟂.
  2. (b)Suppose 𝑉 is finite-dimensional. Show that (𝑈∩𝑊)⟂=𝑈⟂+𝑊⟂.

Solution.

Uses. Definition 6.4.22 (Orthogonal complement), Proposition 1.4.24 (The sum of two subspaces), Theorem 6.4.26 (The double complement), Proposition 6.3.9 (Properties of 𝐴⟂)

Techniques. Double containment (Technique 1.3.14)

Hint 1. For (a), unwind the definitions. One containment uses 𝑈,𝑊⊆𝑈+𝑊; the other expands ⟨𝐯,𝐮+𝐰⟩.
Hint 2. For (b), apply (a) to the subspaces 𝑈⟂ and 𝑊⟂, then take ⟂ of both sides.
Hint 3. Theorem 6.4.26 says (𝑋⟂)⟂=𝑋 for every subspace 𝑋 of the finite-dimensional space 𝑉.
Sketch. (a) 𝑈,𝑊⊆𝑈+𝑊 gives (𝑈+𝑊)⟂⊆𝑈⟂∩𝑊⟂; conversely ⟨𝐯,𝐮+𝐰⟩=⟨𝐯,𝐮⟩+⟨𝐯,𝐰⟩=0. (b) By (a) and Theorem 6.4.26, (𝑈⟂+𝑊⟂)⟂=𝑈⟂⟂∩𝑊⟂⟂=𝑈∩𝑊. Taking ⟂ and using Theorem 6.4.26 again, 𝑈⟂+𝑊⟂=(𝑈∩𝑊)⟂.

(a) Since 𝑈⊆𝑈+𝑊 and 𝑊⊆𝑈+𝑊 (Proposition 1.4.24), Proposition 6.3.9(b) gives (𝑈+𝑊)⟂⊆𝑈⟂ and (𝑈+𝑊)⟂⊆𝑊⟂. Conversely, let 𝐯∈𝑈⟂∩𝑊⟂. Every vector of 𝑈+𝑊 is 𝐮+𝐰 with 𝐮∈𝑈 and 𝐰∈𝑊, and

⟨𝐯,𝐮+𝐰⟩=⟨𝐯,𝐮⟩+⟨𝐯,𝐰⟩=0+0=0.

So 𝐯∈(𝑈+𝑊)⟂.

(b) Every subspace 𝑋 of the finite-dimensional space 𝑉 is finite-dimensional, so (𝑋⟂)⟂=𝑋 by Theorem 6.4.26. Apply (a) to the subspaces 𝑈⟂ and 𝑊⟂:

(𝑈⟂+𝑊⟂)⟂=(𝑈⟂)⟂∩(𝑊⟂)⟂=𝑈∩𝑊.

Taking orthogonal complements of both sides and applying Theorem 6.4.26 to 𝑋=𝑈⟂+𝑊⟂,

𝑈⟂+𝑊⟂=((𝑈⟂+𝑊⟂)⟂)⟂=(𝑈∩𝑊)⟂,

as desired.

Exercise 6.4.48.standard Let 𝑉 be a finite-dimensional inner product space and 𝑈,𝑊 subspaces of 𝑉. Prove or disprove each statement.

  1. (a)If 𝑉=𝑈⊕𝑊, then 𝑊=𝑈⟂.
  2. (b)If every vector of 𝑈 is orthogonal to every vector of 𝑊 and 𝑈+𝑊=𝑉, then 𝑊=𝑈⟂.
  3. (c)Pr𝑈Pr𝑊=Pr𝑊Pr𝑈.
  4. (d)If ‖Pr𝑊(𝐯)‖=‖𝐯‖, then 𝐯∈𝑊.
  5. (e)Every 𝑃∈L(𝑉) with 𝑃2=𝑃 satisfies ‖𝑃𝐯‖≤‖𝐯‖ for all 𝐯∈𝑉.

Solution.

Uses. Theorem 6.4.24 (Orthogonal decomposition), Proposition 6.4.4 (Properties of Pr𝒪︀), Remark 6.4.12 (Why “orthogonal”), Definition 4.4.4 (Direct sum)

Techniques. Finding counterexamples and minimal examples (Technique 1.4.18)

Hint 1. For (a), (c), and (e), look in ℝ2, using lines that are neither equal nor perpendicular.
Hint 2. For (b), 𝑊⊆𝑈⟂ is clear. For the other containment, write 𝐯∈𝑈⟂ as 𝐮+𝐰 and take the inner product with 𝐮.
Hint 3. For (d), use Proposition 6.4.4(e).
Sketch. (a) False: ℝ2=span(𝐞1)⊕span((1,1)). (b) True: if 𝐯=𝐮+𝐰∈𝑈⟂, then 0=⟨𝐯,𝐮⟩=‖𝐮‖2. (c) False: for 𝑈=span(𝐞1), 𝑊=span((1,1)), Pr𝑈Pr𝑊𝐞1=(1/2,0) but Pr𝑊Pr𝑈𝐞1=(1/2,1/2). (d) True, by the equality case of Bessel. (e) False: 𝑃(𝑥,𝑦)=(𝑥+𝑦,0) has 𝑃2=𝑃 and ‖𝑃(1,1)‖=2>2.

(a) False. In ℝ2, let 𝑈=span(𝐞1) and 𝑊=span((1,1)). Then 𝑈∩𝑊={𝟎} and 𝑈+𝑊=ℝ2, so 𝑉=𝑈⊕𝑊, but 𝑈⟂=span(𝐞2)≠𝑊. Every subspace has many complements, and 𝑈⟂ is only one of them.

(b) True. By hypothesis 𝑊⊆𝑈⟂. Conversely, let 𝐯∈𝑈⟂, and write 𝐯=𝐮+𝐰 with 𝐮∈𝑈 and 𝐰∈𝑊. Then

0=⟨𝐯,𝐮⟩=⟨𝐮,𝐮⟩+⟨𝐰,𝐮⟩=‖𝐮‖2,

so 𝐮=𝟎 and 𝐯=𝐰∈𝑊.

(c) False. With 𝑈 and 𝑊 as in (a), Pr𝑊(𝐞1)=(1/2)(1,1), so

Pr𝑈Pr𝑊(𝐞1)=Pr𝑈(12,12)=(12,0),Pr𝑊Pr𝑈(𝐞1)=Pr𝑊(𝐞1)=(12,12).

(Exercise 6.4.58 shows when the two products agree.)

(d) True. By Proposition 6.4.4(e) applied to an orthonormal basis of 𝑊, ‖Pr𝑊(𝐯)‖=‖𝐯‖ holds only if 𝐯∈𝑊.

(e) False. 𝑃(𝑥,𝑦)=(𝑥+𝑦,0) is linear with 𝑃2(𝑥,𝑦)=𝑃(𝑥+𝑦,0)=(𝑥+𝑦,0)=𝑃(𝑥,𝑦), but ‖𝑃(1,1)‖=‖(2,0)‖=2>2=‖(1,1)‖. Like the map of Remark 6.4.12, 𝑃 projects onto the 𝑥-axis along a direction that is not perpendicular to it (here (1,−1)), and such projections can stretch vectors. Exercise 6.4.57 shows that this is the only way an idempotent can fail to shrink norms.

Exercise 6.4.49.standard Let 𝑈 and 𝑊 be finite-dimensional subspaces of 𝑉.

  1. (a)Suppose every vector of 𝑈 is orthogonal to every vector of 𝑊. Show that Pr𝑈+𝑊=Pr𝑈+Pr𝑊 and Pr𝑈Pr𝑊=0.
  2. (b)Conversely, show that if Pr𝑈Pr𝑊=0, then every vector of 𝑈 is orthogonal to every vector of 𝑊.

Solution.

Uses. Theorem 6.4.6 (The projection is characterized by orthogonality), Proposition 6.4.29 (The orthogonal projection as a linear map), Proposition 1.4.24 (The sum of two subspaces), Theorem 6.4.20 (Orthonormal bases exist)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. For (a), check the two conditions of Technique 6.4.7 for 𝐩=Pr𝑈(𝐯)+Pr𝑊(𝐯) and the subspace 𝑈+𝑊. (𝑈+𝑊 is finite-dimensional: concatenate orthonormal bases.)
Hint 2. For Pr𝑈Pr𝑊=0: Pr𝑊(𝐯)∈𝑊⊆𝑈⟂=kerPr𝑈.
Hint 3. For (b), compute ⟨𝐰,𝐮⟩=⟨Pr𝑊𝐰,Pr𝑈𝐮⟩ and move Pr𝑈 across with Proposition 6.4.29(c).
Sketch. (a) 𝑈+𝑊 is spanned by the concatenation of orthonormal bases of 𝑈 and 𝑊, which is orthonormal. For 𝐩=Pr𝑈(𝐯)+Pr𝑊(𝐯)∈𝑈+𝑊, ⟨𝐯−𝐩,𝐮⟩=⟨𝐯−Pr𝑈(𝐯),𝐮⟩−⟨Pr𝑊(𝐯),𝐮⟩=0 for 𝐮∈𝑈, and similarly for 𝑊; so 𝐩=Pr𝑈+𝑊(𝐯). Also Pr𝑊(𝐯)∈𝑊⊆𝑈⟂=kerPr𝑈. (b) ⟨𝐰,𝐮⟩=⟨Pr𝑊𝐰,Pr𝑈𝐮⟩=⟨Pr𝑈Pr𝑊𝐰,𝐮⟩=0.

(a) Let 𝐮1,…,𝐮𝑘 and 𝐰1,…,𝐰𝑙 be orthonormal bases of 𝑈 and 𝑊 (Theorem 6.4.20). By hypothesis ⟨𝐮𝑖,𝐰𝑗⟩=0, so the concatenated list is orthonormal, and it spans 𝑈+𝑊. So 𝑈+𝑊 is finite-dimensional and Pr𝑈+𝑊 is defined. (In fact the formula of Definition 6.4.11 for this basis already gives the claim; we give the argument of Technique 6.4.7 instead.)

Let 𝐯∈𝑉 and 𝐩=Pr𝑈(𝐯)+Pr𝑊(𝐯), which lies in 𝑈+𝑊. For 𝐮∈𝑈, we have Pr𝑊(𝐯)∈𝑊, so ⟨Pr𝑊(𝐯),𝐮⟩=0 by hypothesis, and

⟨𝐯−𝐩,𝐮⟩=⟨𝐯−Pr𝑈(𝐯),𝐮⟩−⟨Pr𝑊(𝐯),𝐮⟩=0−0=0.

In the same way ⟨𝐯−𝐩,𝐰⟩=0 for 𝐰∈𝑊. So 𝐯−𝐩 is orthogonal to every 𝐮+𝐰, that is, to 𝑈+𝑊, and 𝐩=Pr𝑈+𝑊(𝐯) by Theorem 6.4.6.

The hypothesis says 𝑊⊆𝑈⟂, and 𝑈⟂=kerPr𝑈 by Proposition 6.4.29(a). Since Pr𝑊(𝐯)∈𝑊, we get Pr𝑈Pr𝑊(𝐯)=𝟎 for every 𝐯.

(b) Let 𝐮∈𝑈 and 𝐰∈𝑊. Then 𝐮=Pr𝑈(𝐮) and 𝐰=Pr𝑊(𝐰), and by Proposition 6.4.29(c) for Pr𝑈,

⟨𝐰,𝐮⟩=⟨Pr𝑊(𝐰),Pr𝑈(𝐮)⟩=⟨Pr𝑈(Pr𝑊(𝐰)),𝐮⟩=⟨𝟎,𝐮⟩=0.

Exercise 6.4.50.standard Find the error in the following argument, and decide whether the claim is true.

Claim. If 𝑈 and 𝑊 are finite-dimensional subspaces of 𝑉, then Pr𝑈+𝑊=Pr𝑈+Pr𝑊.

Argument. Let 𝐯∈𝑉 and 𝐩=Pr𝑈(𝐯)+Pr𝑊(𝐯), which lies in 𝑈+𝑊. We have 𝐯−Pr𝑈(𝐯)⟂𝑈 and Pr𝑊(𝐯)⟂𝑈, so 𝐯−𝐩=(𝐯−Pr𝑈(𝐯))−Pr𝑊(𝐯)⟂𝑈. In the same way 𝐯−𝐩⟂𝑊, so 𝐯−𝐩⟂𝑈+𝑊. By Theorem 6.4.6, 𝐩=Pr𝑈+𝑊(𝐯).

Solution.

Uses. Theorem 6.4.6 (The projection is characterized by orthogonality), Exercise 6.4.49

Techniques. Finding counterexamples and minimal examples (Technique 1.4.18)

Hint 1. Every step but one is an instance of something proved in this section. Which statement about Pr𝑊(𝐯) has no justification?
Hint 2. Test the claim with 𝑈=𝑊.
Sketch. The step “Pr𝑊(𝐯)⟂𝑈” is unjustified: Pr𝑊(𝐯) lies in 𝑊, and 𝑊 need not be orthogonal to 𝑈. The claim is false: for 𝑈=𝑊=span(𝐞1) in ℝ2, Pr𝑈+Pr𝑊=2Pr𝑈, which sends 𝐞1 to 2𝐞1, while Pr𝑈+𝑊(𝐞1)=𝐞1. It is true when 𝑈⟂𝑊 (Exercise 6.4.49).

The error is the assertion Pr𝑊(𝐯)⟂𝑈. All we know is that Pr𝑊(𝐯)∈𝑊, and a vector of 𝑊 is orthogonal to 𝑈 only if, for instance, every vector of 𝑊 is orthogonal to every vector of 𝑈.

The claim is false. Let 𝑈=𝑊=span(𝐞1) in ℝ2. Then 𝑈+𝑊=𝑈, and

(Pr𝑈+Pr𝑊)(𝐞1)=2𝐞1≠𝐞1=Pr𝑈+𝑊(𝐞1).

The argument becomes correct under the extra hypothesis that every vector of 𝑈 is orthogonal to every vector of 𝑊, and then it proves Exercise 6.4.49(a).

Exercise 6.4.51.standard Let 𝑊 be a 𝑘-dimensional subspace of 𝔽𝑛, and let 𝑃 be the matrix of Pr𝑊.

  1. (a)Show that rank𝑃=tr𝑃=𝑘.
  2. (b)Show that 𝑝𝑖𝑖=‖𝑃𝐞𝑖‖2 for each 𝑖, and deduce that ∑𝑖=1𝑛‖Pr𝑊(𝐞𝑖)‖2=𝑘.
  3. (c)Deduce that some standard basis vector 𝐞𝑖 satisfies dist(𝐞𝑖,𝑊)2≤1−𝑘/𝑛.

Solution.

Uses. Theorem 6.4.31 (The matrix of an orthogonal projection), Proposition 2.4.28 (Cyclicity of the trace), Proposition 6.4.29 (The orthogonal projection as a linear map), Theorem 6.4.33 (Best approximation), Theorem 6.4.20 (Orthonormal bases exist)

Techniques. Cyclicity of trace (Technique 2.4.29)

Hint 1. By Theorem 6.4.31, 𝑃=𝑄𝑄∗ with 𝑄∗𝑄=𝐼𝑘. Use cyclicity of the trace.
Hint 2. For (b), 𝑝𝑖𝑖=(𝑃𝐞𝑖)⋅𝐞𝑖. Use Proposition 6.4.29(c).
Hint 3. For (c), dist(𝐞𝑖,𝑊)2=1−‖Pr𝑊(𝐞𝑖)‖2, and the 𝑛 numbers ‖Pr𝑊(𝐞𝑖)‖2 add up to 𝑘.
Sketch. (a) rank𝑃=dimimPr𝑊=𝑘, and tr(𝑄𝑄∗)=tr(𝑄∗𝑄)=tr𝐼𝑘=𝑘. (b) 𝑝𝑖𝑖=⟨𝑃𝐞𝑖,𝐞𝑖⟩=⟨𝑃𝐞𝑖,𝑃𝐞𝑖⟩; sum over 𝑖. (c) dist(𝐞𝑖,𝑊)2=1−𝑝𝑖𝑖, and the average of the 𝑝𝑖𝑖 is 𝑘/𝑛, so some 𝑝𝑖𝑖≥𝑘/𝑛.

(a) By Proposition 6.4.29(a), the image of Pr𝑊 is 𝑊, so rank𝑃=dim𝑊=𝑘. By Theorem 6.4.20, 𝑊 has an orthonormal basis, and by Theorem 6.4.31, 𝑃=𝑄𝑄∗ with 𝑄∈𝔽𝑛×𝑘 and 𝑄∗𝑄=𝐼𝑘. By Proposition 2.4.28, tr𝑃=tr(𝑄𝑄∗)=tr(𝑄∗𝑄)=tr𝐼𝑘=𝑘.

(b) The 𝑖th entry of 𝑃𝐞𝑖 is 𝑝𝑖𝑖, so 𝑝𝑖𝑖=(𝑃𝐞𝑖)⋅𝐞𝑖=⟨𝑃𝐞𝑖,𝐞𝑖⟩. By Proposition 6.4.29(c), this equals ⟨𝑃𝐞𝑖,𝑃𝐞𝑖⟩=‖𝑃𝐞𝑖‖2. Summing over 𝑖 and using (a), ∑𝑖‖Pr𝑊(𝐞𝑖)‖2=tr𝑃=𝑘.

(c) By Theorem 6.4.33, dist(𝐞𝑖,𝑊)2=‖𝐞𝑖‖2−‖Pr𝑊(𝐞𝑖)‖2=1−𝑝𝑖𝑖. The 𝑛 numbers 𝑝𝑖𝑖 add up to 𝑘, so the largest of them is at least 𝑘/𝑛. For that 𝑖, dist(𝐞𝑖,𝑊)2≤1−𝑘/𝑛. (For the plane of Example 6.4.32, every 𝑝𝑖𝑖 equals 2/3, so the bound is attained by all three.)

Exercise 6.4.52.standard Let 𝑊 be a finite-dimensional subspace of 𝑉 and 𝐯∈𝑉 with 𝐯∉𝑊.

  1. (a)Show that

    dist(𝐯,𝑊)=max{|⟨𝐯,𝐱⟩||𝐱∈𝑊⟂,‖𝐱‖=1},

    and find the 𝐱 attaining the maximum.

  2. (b)In 𝐶[−1,1] with ⟨𝑓,𝑔⟩=∫−11𝑓𝑔, find the largest value of ∫−11𝑡3𝑔(𝑡)d𝑡 over all 𝑔 with ∫−11𝑔2=1 that are orthogonal to 1,𝑡,𝑡2.

Solution.

Uses. Theorem 6.4.24 (Orthogonal decomposition), Theorem 6.2.1 (Cauchy–Schwarz inequality), Definition 6.4.34 (Distance to a subspace), Exercise 6.4.45

Techniques. Apply Cauchy–Schwarz to a well-chosen inner product (Technique 6.2.21)

Hint 1. For 𝐱∈𝑊⟂, ⟨𝐯,𝐱⟩=⟨𝐯−Pr𝑊(𝐯),𝐱⟩. Why?
Hint 2. Apply Cauchy–Schwarz, and find when equality holds.
Hint 3. For (b), 𝑊 is the space of polynomial functions of degree at most 2; the distance from 𝑡3 to it was found in Exercise 6.4.45.
Sketch. For a unit 𝐱∈𝑊⟂, ⟨Pr𝑊(𝐯),𝐱⟩=0, so |⟨𝐯,𝐱⟩|=|⟨𝐯−Pr𝑊(𝐯),𝐱⟩|≤‖𝐯−Pr𝑊(𝐯)‖ by Cauchy–Schwarz. Equality holds for 𝐱=(𝐯−Pr𝑊(𝐯))/dist(𝐯,𝑊), which is a unit vector in 𝑊⟂. (b) The maximum is dist(𝑡3,𝑊)=8/175, at 𝑔=(𝑡3−3𝑡/5)/8/175.

(a) Let 𝐫=𝐯−Pr𝑊(𝐯), so 𝐫∈𝑊⟂ and ‖𝐫‖=dist(𝐯,𝑊)>0 because 𝐯∉𝑊. For a unit vector 𝐱∈𝑊⟂, ⟨Pr𝑊(𝐯),𝐱⟩=0 since Pr𝑊(𝐯)∈𝑊, so by Theorem 6.2.1

|⟨𝐯,𝐱⟩|=|⟨𝐫,𝐱⟩|≤‖𝐫‖‖𝐱‖=dist(𝐯,𝑊).

For 𝐱=𝐫/‖𝐫‖, which is a unit vector in 𝑊⟂, we get ⟨𝐯,𝐱⟩=⟨𝐫,𝐫⟩/‖𝐫‖=‖𝐫‖. So the maximum exists and equals dist(𝐯,𝑊). By the equality case of Cauchy–Schwarz, the maximizers are the unit vectors 𝐱=𝜆𝐫/‖𝐫‖ with |𝜆|=1.

(b) Let 𝑊 be the space of polynomial functions of degree at most 2. A function orthogonal to 1,𝑡,𝑡2 is orthogonal to 𝑊 (Proposition 6.3.9(c)), so we are maximizing ⟨𝑡3,𝑔⟩ over unit vectors 𝑔∈𝑊⟂. By (a) and Exercise 6.4.45, the maximum of |⟨𝑡3,𝑔⟩| is dist(𝑡3,𝑊)=8/175, attained at 𝑔=±𝑞/‖𝑞‖ with 𝑞=𝑡3−(3/5)𝑡. Taking the plus sign makes ⟨𝑡3,𝑔⟩ positive, so the largest value of ∫−11𝑡3𝑔 is 8/175≈0.214.

So the distance from 𝐯 to 𝑊 can be computed in two dual ways: as a minimum over 𝑊, or as a maximum over unit vectors of 𝑊⟂.

Exercise 6.4.53.standard
  1. (a)Let 𝑈 be a finite-dimensional subspace of 𝑉, and let 𝐱0,𝐲∈𝑉. Show that among the vectors of 𝐱0+𝑈={𝐱0+𝐮|𝐮∈𝑈}, the one closest to 𝐲 is 𝐱0+Pr𝑈(𝐲−𝐱0), and that it is unique.
  2. (b)Find the solution of smallest norm of the system 𝑥1+𝑥2=2, 𝑥2+𝑥3=2 in ℝ3, and check that it is orthogonal to every solution of the homogeneous system.

Solution.

Uses. Theorem 6.4.33 (Best approximation), Proposition 3.1.19 (Solution sets are translates of the kernel), Corollary 6.4.10 (Projecting with an orthogonal list)

Hint 1. ‖𝐲−(𝐱0+𝐮)‖=‖(𝐲−𝐱0)−𝐮‖. So you are approximating 𝐲−𝐱0 by vectors of 𝑈.
Hint 2. For (b), the solution set is 𝐱0+ker𝐴 (Proposition 3.1.19), and the closest point to 𝐲=𝟎 is wanted.
Sketch. (a) By Theorem 6.4.33 applied to 𝐲−𝐱0, ‖(𝐲−𝐱0)−𝐮‖ is minimized exactly at 𝐮=Pr𝑈(𝐲−𝐱0). (b) With 𝐱0=(2,0,2) and ker𝐴=span((1,−1,1)), the answer is 𝐱0−Prker𝐴(𝐱0)=(2,0,2)−(4/3)(1,−1,1)=(2/3,4/3,2/3), which is orthogonal to (1,−1,1).

(a) For 𝐮∈𝑈, ‖𝐲−(𝐱0+𝐮)‖=‖(𝐲−𝐱0)−𝐮‖. By Theorem 6.4.33, applied to the vector 𝐲−𝐱0 and the subspace 𝑈, this is smallest exactly when 𝐮=Pr𝑈(𝐲−𝐱0). So 𝐱0+Pr𝑈(𝐲−𝐱0) is the unique closest vector.

(b) Let 𝐴=(110011). One solution is 𝐱0=(2,0,2), and ker𝐴=span((1,−1,1)): the equations say 𝑥1=−𝑥2=𝑥3. By Proposition 3.1.19 the solution set is 𝐱0+ker𝐴. The solution of smallest norm is the one closest to 𝐲=𝟎, which by (a) is

𝐱0+Prker𝐴(−𝐱0)=𝐱0−⟨𝐱0,(1,−1,1)⟩3(1,−1,1)=(2,0,2)−43(1,−1,1)=(23,43,23),

using Corollary 6.4.10. Check: 2/3+4/3=2 and 4/3+2/3=2; the norm is 24/9=8/3; and (2/3,4/3,2/3)⋅(1,−1,1)=0. In general the least-norm solution is 𝐱0−Prker𝐴(𝐱0), the component of any solution in (ker𝐴)⟂, which for real 𝐴 is the span of the rows (Example 6.4.23(b), Theorem 6.4.26). It is the only solution in (ker𝐴)⟂.

Exercise 6.4.54.standard In 𝐶[−1,1] with ⟨𝑓,𝑔⟩=∫−11𝑓(𝑡)𝑔(𝑡)d𝑡, let 𝐸 be the subspace of even functions and 𝑂 the subspace of odd functions.

  1. (a)Show that 𝐸⟂=𝑂 and 𝑂⟂=𝐸.
  2. (b)Let 𝑓∈𝐶[−1,1] and 𝑓𝑒(𝑡)=(𝑓(𝑡)+𝑓(−𝑡))/2. Show that 𝑓𝑒 is the unique even function closest to 𝑓, although 𝐸 is infinite-dimensional.

Solution.

Uses. Example 6.3.2 (Orthogonal vectors), Proposition 6.1.27 (Basic properties of the norm), Theorem 6.3.3 (Pythagorean theorem), Definition 6.4.22 (Orthogonal complement)

Hint 1. 𝑂⊆𝐸⟂ because the product of an even and an odd function is odd. For 𝐸⟂⊆𝑂, write 𝑓∈𝐸⟂ as 𝑓𝑒+𝑓𝑜 and pair 𝑓 with 𝑓𝑒.
Hint 2. For (b), 𝑓−𝑓𝑒=𝑓𝑜 is odd, hence orthogonal to 𝐸. Run the Pythagoras argument of Theorem 6.4.33 by hand.
Sketch. (a) Odd times even is odd, with integral 0, so 𝑂⊆𝐸⟂. If 𝑓∈𝐸⟂, then 0=⟨𝑓,𝑓𝑒⟩=‖𝑓𝑒‖2+⟨𝑓𝑜,𝑓𝑒⟩=‖𝑓𝑒‖2, so 𝑓=𝑓𝑜∈𝑂. The same with 𝐸 and 𝑂 exchanged gives 𝑂⟂=𝐸. (b) For 𝑔∈𝐸, 𝑓−𝑔=𝑓𝑜+(𝑓𝑒−𝑔) with 𝑓𝑜⟂𝑓𝑒−𝑔, so ‖𝑓−𝑔‖2=‖𝑓𝑜‖2+‖𝑓𝑒−𝑔‖2≥‖𝑓𝑜‖2, with equality only for 𝑔=𝑓𝑒.

Every 𝑓∈𝐶[−1,1] is 𝑓=𝑓𝑒+𝑓𝑜 with 𝑓𝑒(𝑡)=(𝑓(𝑡)+𝑓(−𝑡))/2 even and 𝑓𝑜(𝑡)=(𝑓(𝑡)−𝑓(−𝑡))/2 odd, both continuous.

(a) If 𝑔 is even and ℎ is odd, then 𝑔ℎ is odd, so ⟨𝑔,ℎ⟩=0 (Example 6.3.2(c)). This gives 𝑂⊆𝐸⟂ and 𝐸⊆𝑂⟂. Conversely, let 𝑓∈𝐸⟂. Since 𝑓𝑒∈𝐸,

0=⟨𝑓,𝑓𝑒⟩=⟨𝑓𝑒,𝑓𝑒⟩+⟨𝑓𝑜,𝑓𝑒⟩=‖𝑓𝑒‖2,

so 𝑓𝑒=𝟎 (Proposition 6.1.27) and 𝑓=𝑓𝑜∈𝑂. Similarly, if 𝑓∈𝑂⟂, then 0=⟨𝑓,𝑓𝑜⟩=‖𝑓𝑜‖2, so 𝑓=𝑓𝑒∈𝐸.

(b) Let 𝑔∈𝐸. Then 𝑓−𝑔=𝑓𝑜+(𝑓𝑒−𝑔), where 𝑓𝑜∈𝑂=𝐸⟂ and 𝑓𝑒−𝑔∈𝐸. By Theorem 6.3.3,

‖𝑓−𝑔‖2=‖𝑓𝑜‖2+‖𝑓𝑒−𝑔‖2≥‖𝑓𝑜‖2=‖𝑓−𝑓𝑒‖2,

with equality if and only if 𝑔=𝑓𝑒. So 𝑓𝑒 is the unique even function closest to 𝑓. The proof of Theorem 6.4.33 only needed the decomposition 𝑓=𝑓𝑒+𝑓𝑜 into a part in 𝐸 and a part orthogonal to 𝐸. For finite-dimensional subspaces that decomposition always exists (Theorem 6.4.24); here it exists for a reason specific to 𝐸, and Exercise 6.4.63 shows that it need not exist in general.

Exercise 6.4.55.standard
  1. (a)Let 𝐮1,…,𝐮𝑚 and 𝐮1′,…,𝐮𝑚′ be orthonormal lists in 𝑉 with span(𝐮1,…,𝐮𝑗)=span(𝐮1′,…,𝐮𝑗′) for every 𝑗. Show that 𝐮𝑗′=𝜆𝑗𝐮𝑗 for scalars 𝜆𝑗 with |𝜆𝑗|=1.
  2. (b)Let 𝐯1,…,𝐯𝑚 be linearly independent. Show that the output of Gram–Schmidt is the only orthonormal list 𝐮1,…,𝐮𝑚 such that, for every 𝑗, span(𝐮1,…,𝐮𝑗)=span(𝐯1,…,𝐯𝑗) and ⟨𝐯𝑗,𝐮𝑗⟩ is a positive real number.

Solution.

Uses. Proposition 6.3.18 (Coordinates in an orthonormal basis), Theorem 6.4.15 (Gram–Schmidt is correct), Proposition 6.1.4 (Sesquilinearity), Proposition 6.1.27 (Basic properties of the norm)

Techniques. Take an inner product to isolate a coefficient (Technique 6.3.12)

Hint 1. 𝐮𝑗′∈span(𝐮1,…,𝐮𝑗), so expand it with Proposition 6.3.18(a). Which coefficients vanish?
Hint 2. For 𝑖<𝑗, 𝐮𝑖∈span(𝐮1′,…,𝐮𝑗−1′), which is orthogonal to 𝐮𝑗′.
Hint 3. For (b), compare an arbitrary such list with the Gram–Schmidt output using (a), and use ⟨𝐯𝑗,𝜆𝐮𝑗⟩=𝜆⟨𝐯𝑗,𝐮𝑗⟩.
Sketch. (a) 𝐮𝑗′=∑𝑖≤𝑗⟨𝐮𝑗′,𝐮𝑖⟩𝐮𝑖, and for 𝑖<𝑗, 𝐮𝑖∈span(𝐮1′,…,𝐮𝑗−1′), which is orthogonal to 𝐮𝑗′. So 𝐮𝑗′=𝜆𝑗𝐮𝑗, and |𝜆𝑗|=‖𝐮𝑗′‖=1. (b) By Theorem 6.4.15(d) the output satisfies the conditions. For another such list, (a) gives 𝐮𝑗′=𝜆𝑗𝐮𝑗, and ⟨𝐯𝑗,𝐮𝑗′⟩=𝜆𝑗⟨𝐯𝑗,𝐮𝑗⟩ with both inner products positive, so 𝜆𝑗>0 and |𝜆𝑗|=1 force 𝜆𝑗=1.

(a) Fix 𝑗. Since 𝐮𝑗′∈span(𝐮1′,…,𝐮𝑗′)=span(𝐮1,…,𝐮𝑗), Proposition 6.3.18(a) gives

𝐮𝑗′=∑𝑖=1𝑗⟨𝐮𝑗′,𝐮𝑖⟩𝐮𝑖.

For 𝑖<𝑗, 𝐮𝑖∈span(𝐮1,…,𝐮𝑗−1)=span(𝐮1′,…,𝐮𝑗−1′), and 𝐮𝑗′ is orthogonal to each of 𝐮1′,…,𝐮𝑗−1′, hence to their span (Proposition 6.3.9(c)). So ⟨𝐮𝑗′,𝐮𝑖⟩=0 for 𝑖<𝑗, and 𝐮𝑗′=𝜆𝑗𝐮𝑗 with 𝜆𝑗=⟨𝐮𝑗′,𝐮𝑗⟩. Then 1=‖𝐮𝑗′‖=|𝜆𝑗|‖𝐮𝑗‖=|𝜆𝑗| by Proposition 6.1.27(b).

(b) By Theorem 6.4.15(d), the output 𝐮1,…,𝐮𝑚 of Gram–Schmidt has both properties. Let 𝐮1′,…,𝐮𝑚′ be another orthonormal list with both properties. The two lists have the same spans span(𝐯1,…,𝐯𝑗), so by (a), 𝐮𝑗′=𝜆𝑗𝐮𝑗 with |𝜆𝑗|=1. By Proposition 6.1.4,

⟨𝐯𝑗,𝐮𝑗′⟩=𝜆𝑗⟨𝐯𝑗,𝐮𝑗⟩.

Both inner products are positive reals, so 𝜆𝑗 is a positive real number of modulus 1, that is, 𝜆𝑗=1. Hence 𝐮𝑗′=𝐮𝑗 for every 𝑗.

Exercise 6.4.56.standard Give ℝ[𝑥] the inner product ⟨𝑝,𝑞⟩=∫−11𝑝(𝑡)𝑞(𝑡)d𝑡, and let 𝑛≥1. Among all polynomials of degree 𝑛 with leading coefficient 1, show that exactly one has the smallest norm, namely 𝑥𝑛−Pr𝑊(𝑥𝑛) with 𝑊=ℝ[𝑥]≤𝑛−1, the (𝑛+1)st Gram–Schmidt residual of 1,𝑥,𝑥2,…. Find the smallest value of ∫−11𝑝(𝑡)2d𝑡 for 𝑛=2 and 𝑛=3.

Solution.

Uses. Theorem 6.4.33 (Best approximation), Example 6.4.19 (Legendre polynomials), Exercise 6.3.49

Hint 1. The polynomials of degree 𝑛 with leading coefficient 1 are exactly the 𝑥𝑛−𝑞 with 𝑞∈ℝ[𝑥]≤𝑛−1.
Hint 2. Minimizing ‖𝑥𝑛−𝑞‖ over 𝑞∈𝑊 is a best-approximation problem.
Sketch. Such polynomials are 𝑥𝑛−𝑞 with 𝑞∈𝑊, and ‖𝑥𝑛−𝑞‖ is minimized exactly at 𝑞=Pr𝑊(𝑥𝑛). By Theorem 6.4.15(d), 𝑊 is the span of the first 𝑛 Gram–Schmidt outputs, so 𝑥𝑛−Pr𝑊(𝑥𝑛) is the next residual. For 𝑛=2,3 these are 𝑥2−1/3 and 𝑥3−(3/5)𝑥, with squared norms 8/45 and 8/175.

A polynomial of degree 𝑛 with leading coefficient 1 is 𝑥𝑛−𝑞 with 𝑞∈𝑊=ℝ[𝑥]≤𝑛−1, and every such difference is one. The space 𝑊 is finite-dimensional, so by Theorem 6.4.33, ‖𝑥𝑛−𝑞‖ is smallest for exactly one 𝑞∈𝑊, namely 𝑞=Pr𝑊(𝑥𝑛). When Gram–Schmidt is run on 1,𝑥,𝑥2,…, the first 𝑛 outputs span span(1,…,𝑥𝑛−1)=𝑊 (Theorem 6.4.15(d)), so the next residual is exactly 𝑥𝑛−Pr𝑊(𝑥𝑛).

By Example 6.4.19, for 𝑛=2 the minimizer is 𝑥2−1/3, with ‖𝑥2−1/3‖2=8/45 (Example 6.3.17), and for 𝑛=3 it is 𝑥3−(3/5)𝑥, with squared norm 8/175 (Exercise 6.3.49). So among all monic quadratics, 𝑥2−1/3 is the smallest on [−1,1] in the mean-square sense.

Exercise 6.4.57.hard Let 𝑉 be finite-dimensional and let 𝑃∈L(𝑉) satisfy 𝑃2=𝑃. Show that the following are equivalent:
  1. (i)𝑃 is an orthogonal projection, that is, 𝑃=Prim𝑃;
  2. (ii)every vector of ker𝑃 is orthogonal to every vector of im𝑃;
  3. (iii)‖𝑃𝐯‖≤‖𝐯‖ for every 𝐯∈𝑉.

Solution.

Uses. Proposition 6.4.29 (The orthogonal projection as a linear map), Proposition 6.4.4 (Properties of Pr𝒪︀), Theorem 6.4.6 (The projection is characterized by orthogonality), Proposition 6.1.29 (Expanding a norm)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7), Orthogonal decomposition (Technique 6.2.4), Proving TFAE (Technique 2.7.1)

Hint 1. (i) ⇒ (iii) is Bessel. For (ii) ⇒ (i), check the two conditions of Technique 6.4.7 for 𝑃𝐯; note 𝐯−𝑃𝐯∈ker𝑃.
Hint 2. For (iii) ⇒ (ii), take 𝐮∈im𝑃 and 𝐰∈ker𝑃. Then 𝑃𝐮=𝐮, so 𝑃(𝐮+𝜆𝐰)=𝐮 for every scalar 𝜆, and (iii) gives ‖𝐮‖≤‖𝐮+𝜆𝐰‖.
Hint 3. Choose 𝜆 to make 𝐮+𝜆𝐰 the part of 𝐮 orthogonal to 𝐰, as in Technique 6.2.4.
Sketch. (i) ⇒ (iii): Proposition 6.4.4(e). (iii) ⇒ (ii): for 𝐮∈im𝑃, 𝐰∈ker𝑃, 𝐰≠𝟎, and 𝜆=−⟨𝐮,𝐰⟩/‖𝐰‖2, we get ‖𝐮‖2=‖𝑃(𝐮+𝜆𝐰)‖2≤‖𝐮+𝜆𝐰‖2=‖𝐮‖2−|⟨𝐮,𝐰⟩|2/‖𝐰‖2, so ⟨𝐮,𝐰⟩=0. (ii) ⇒ (i): 𝑃𝐯∈im𝑃 and 𝐯−𝑃𝐯∈ker𝑃⊆(im𝑃)⟂, so 𝑃𝐯=Prim𝑃(𝐯).

We prove (i) ⇒ (iii) ⇒ (ii) ⇒ (i).

(i) ⇒ (iii). This is Proposition 6.4.4(e), applied to an orthonormal basis of im𝑃.

(iii) ⇒ (ii). Let 𝐮∈im𝑃 and 𝐰∈ker𝑃; we may assume 𝐰≠𝟎. Write 𝐮=𝑃𝐱; then 𝑃𝐮=𝑃2𝐱=𝑃𝐱=𝐮. So for every scalar 𝜆, 𝑃(𝐮+𝜆𝐰)=𝐮+𝜆𝟎=𝐮, and (iii) gives ‖𝐮‖≤‖𝐮+𝜆𝐰‖. Take 𝜆=−⟨𝐮,𝐰⟩/‖𝐰‖2. By Proposition 6.1.29,

‖𝐮+𝜆𝐰‖2=‖𝐮‖2+2Re(𝜆⟨𝐮,𝐰⟩)+|𝜆|2‖𝐰‖2=‖𝐮‖2−2|⟨𝐮,𝐰⟩|2‖𝐰‖2+|⟨𝐮,𝐰⟩|2‖𝐰‖2=‖𝐮‖2−|⟨𝐮,𝐰⟩|2‖𝐰‖2.

Combined with ‖𝐮‖2≤‖𝐮+𝜆𝐰‖2, this gives |⟨𝐮,𝐰⟩|2≤0, so ⟨𝐮,𝐰⟩=0.

(ii) ⇒ (i). Let 𝑊=im𝑃, which is finite-dimensional. For 𝐯∈𝑉, 𝑃𝐯∈𝑊, and 𝑃(𝐯−𝑃𝐯)=𝑃𝐯−𝑃2𝐯=𝟎, so 𝐯−𝑃𝐯∈ker𝑃. By (ii), 𝐯−𝑃𝐯∈𝑊⟂. By Theorem 6.4.6, 𝑃𝐯=Pr𝑊(𝐯).

So an idempotent operator fails to be an orthogonal projection exactly when it stretches some vector, as the map in Exercise 6.4.48(e) does.

Exercise 6.4.58.hard Let 𝑉 be finite-dimensional, let 𝑈 and 𝑊 be subspaces, and let 𝑃=Pr𝑈 and 𝑄=Pr𝑊. Show that 𝑃𝑄 is an orthogonal projection if and only if 𝑃𝑄=𝑄𝑃, and that in this case 𝑃𝑄=Pr𝑈∩𝑊.

Solution.

Uses. Proposition 6.4.30 (Recognizing orthogonal projections), Proposition 6.4.29 (The orthogonal projection as a linear map), Proposition 6.1.37 (Inner products distinguish vectors)

Techniques. Recognize a projection by its two conditions (Technique 6.4.7)

Hint 1. Both directions go through Proposition 6.4.30. Compute ⟨𝑃𝑄𝐯,𝐱⟩ by moving 𝑃 and then 𝑄 to the other slot.
Hint 2. You get ⟨𝑃𝑄𝐯,𝐱⟩=⟨𝐯,𝑄𝑃𝐱⟩. Compare this with the symmetry condition for 𝑃𝑄.
Hint 3. For the image: im𝑃𝑄⊆𝑈 always, and 𝑃𝑄=𝑄𝑃 puts it inside 𝑊 too. Conversely, 𝑃𝑄𝐳=𝐳 for 𝐳∈𝑈∩𝑊.
Sketch. By Proposition 6.4.29(c), ⟨𝑃𝑄𝐯,𝐱⟩=⟨𝑄𝐯,𝑃𝐱⟩=⟨𝐯,𝑄𝑃𝐱⟩. If 𝑃𝑄=𝑄𝑃, then (𝑃𝑄)2=𝑃2𝑄2=𝑃𝑄 and ⟨𝑃𝑄𝐯,𝐱⟩=⟨𝐯,𝑃𝑄𝐱⟩, so 𝑃𝑄 is an orthogonal projection onto im𝑃𝑄=𝑈∩𝑊. Conversely, if 𝑃𝑄 is an orthogonal projection, its symmetry gives ⟨𝐯,𝑃𝑄𝐱⟩=⟨𝐯,𝑄𝑃𝐱⟩ for all 𝐯, so 𝑃𝑄=𝑄𝑃.

For all 𝐯,𝐱∈𝑉, Proposition 6.4.29(c), applied first to 𝑃 and then to 𝑄, gives

⟨𝑃𝑄𝐯,𝐱⟩=⟨𝑄𝐯,𝑃𝐱⟩=⟨𝐯,𝑄𝑃𝐱⟩.
(6.4.3)

Suppose 𝑃𝑄=𝑄𝑃. Then (𝑃𝑄)2=𝑃𝑄𝑃𝑄=𝑃𝑃𝑄𝑄=𝑃2𝑄2=𝑃𝑄 by Proposition 6.4.29(b), and by (6.4.3), ⟨𝑃𝑄𝐯,𝐱⟩=⟨𝐯,𝑄𝑃𝐱⟩=⟨𝐯,𝑃𝑄𝐱⟩. By Proposition 6.4.30, 𝑃𝑄=Prim𝑃𝑄. Its image lies in im𝑃=𝑈, and since 𝑃𝑄=𝑄𝑃 also in im𝑄=𝑊. Conversely, if 𝐳∈𝑈∩𝑊, then 𝑃𝑄𝐳=𝑃𝐳=𝐳, so 𝐳∈im𝑃𝑄. Hence im𝑃𝑄=𝑈∩𝑊 and 𝑃𝑄=Pr𝑈∩𝑊.

Conversely, suppose 𝑃𝑄 is an orthogonal projection. By Proposition 6.4.30, ⟨𝑃𝑄𝐯,𝐱⟩=⟨𝐯,𝑃𝑄𝐱⟩ for all 𝐯,𝐱, and comparing with (6.4.3) gives ⟨𝐯,𝑃𝑄𝐱−𝑄𝑃𝐱⟩=0 for all 𝐯. Taking 𝐯=𝑃𝑄𝐱−𝑄𝑃𝐱 shows that this vector has norm 0, so 𝑃𝑄𝐱=𝑄𝑃𝐱 for every 𝐱.

Exercise 6.4.48(c) gives two subspaces for which 𝑃𝑄 is not an orthogonal projection. The commuting case includes 𝑈⊆𝑊, where 𝑃𝑄=𝑄𝑃=𝑃, and 𝑈⟂𝑊, where 𝑃𝑄=𝑄𝑃=0 (Exercise 6.4.49).

Exercise 6.4.59.hard Let 𝐯1,…,𝐯𝑚 be linearly independent in 𝑉, with Gram matrix 𝐺 (Definition 6.3.28). Run Gram–Schmidt, with residuals 𝐟𝑗 and output 𝐮𝑗, and let 𝑅∈𝔽𝑚×𝑚 have entries 𝑟𝑖𝑗=⟨𝐯𝑗,𝐮𝑖⟩.

  1. (a)Show that 𝑅 is upper triangular with diagonal entries ‖𝐟1‖,…,‖𝐟𝑚‖, and that 𝐺=𝑅∗𝑅.
  2. (b)Deduce that det𝐺=‖𝐟1‖2⋯‖𝐟𝑚‖2, and that dist(𝐯𝑚,span(𝐯1,…,𝐯𝑚−1))2=det𝐺𝑚/det𝐺𝑚−1, where 𝐺𝑗 is the Gram matrix of 𝐯1,…,𝐯𝑗 and det𝐺0=1.
  3. (c)(Hadamard’s inequality.) Show that det𝐺≤‖𝐯1‖2⋯‖𝐯𝑚‖2, with equality if and only if the list is orthogonal. Deduce that |det𝐴|≤‖𝐚1‖⋯‖𝐚𝑛‖ for every 𝐴∈𝔽𝑛×𝑛 with columns 𝐚1,…,𝐚𝑛.

Solution.

Uses. Theorem 6.4.15 (Gram–Schmidt is correct), Theorem 6.3.22 (Parseval’s identity), Proposition 5.3.15 (Triangular matrices), Theorem 5.4.10 (Multiplicativity), Exercise 6.3.57, Technique 6.4.5 (Projections shrink norms), Theorem 6.3.29 (Orthonormal columns), Theorem 5.4.7 (Invertibility and the determinant), Proposition 6.4.29 (The orthogonal projection as a linear map)

Techniques. Gram matrices (Technique 6.3.31)

Hint 1. For 𝑖>𝑗, 𝐯𝑗∈span(𝐮1,…,𝐮𝑗) is orthogonal to 𝐮𝑖. For the product, (𝑅∗𝑅)𝑖𝑗=∑𝑙𝑟𝑙𝑖𝑟𝑙𝑗; recognize Parseval’s identity in span(𝐮1,…,𝐮𝑚).
Hint 2. For (b), take determinants: det𝑅∗=det𝑅. Gram–Schmidt on 𝐯1,…,𝐯𝑗 produces the same first 𝑗 residuals.
Hint 3. For (c), 𝐟𝑗=𝐯𝑗−Pr(𝐯𝑗), and projections shrink norms.
Sketch. (a) 𝑟𝑖𝑗=0 for 𝑖>𝑗 since 𝐯𝑗⟂𝐮𝑖, and 𝑟𝑗𝑗=‖𝐟𝑗‖ by Theorem 6.4.15(d). By Parseval in the span of the 𝐮’s, (𝑅∗𝑅)𝑖𝑗=∑𝑙⟨𝐯𝑗,𝐮𝑙⟩⟨𝐯𝑖,𝐮𝑙⟩=⟨𝐯𝑗,𝐯𝑖⟩=𝑔𝑖𝑗. (b) det𝐺=|det𝑅|2=∏𝑗‖𝐟𝑗‖2; the ratio of consecutive Gram determinants is ‖𝐟𝑚‖2, the squared distance. (c) ‖𝐟𝑗‖≤‖𝐯𝑗‖ with equality iff 𝐯𝑗⟂𝐯1,…,𝐯𝑗−1. For 𝐴 with independent columns, 𝐺=𝐴∗𝐴 and det𝐺=|det𝐴|2.

(a) Let 𝑈=span(𝐮1,…,𝐮𝑚)=span(𝐯1,…,𝐯𝑚). For 𝑖>𝑗, 𝐯𝑗∈span(𝐮1,…,𝐮𝑗) (Theorem 6.4.15(d)), which is orthogonal to 𝐮𝑖, so 𝑟𝑖𝑗=0: 𝑅 is upper triangular. Also 𝑟𝑗𝑗=⟨𝐯𝑗,𝐮𝑗⟩=‖𝐟𝑗‖ by Theorem 6.4.15(d). Note that 𝑟𝑙𝑖=⟨𝐯𝑖,𝐮𝑙⟩ for all 𝑙 and 𝑖. Since 𝐮1,…,𝐮𝑚 is an orthonormal basis of the inner product space 𝑈, which contains every 𝐯𝑖, Theorem 6.3.22(a) gives

(𝑅∗𝑅)𝑖𝑗=∑𝑙=1𝑚𝑟𝑙𝑖𝑟𝑙𝑗=∑𝑙=1𝑚⟨𝐯𝑗,𝐮𝑙⟩⟨𝐯𝑖,𝐮𝑙⟩=⟨𝐯𝑗,𝐯𝑖⟩=𝑔𝑖𝑗.

(b) By Theorem 5.4.10 and Exercise 6.3.57(a), det𝐺=det(𝑅∗)det𝑅=det𝑅det𝑅=|det𝑅|2, and by Proposition 5.3.15, det𝑅=𝑟11⋯𝑟𝑚𝑚=‖𝐟1‖⋯‖𝐟𝑚‖. So det𝐺=∏𝑗‖𝐟𝑗‖2. Gram–Schmidt processes the list in order, so running it on 𝐯1,…,𝐯𝑗 produces the residuals 𝐟1,…,𝐟𝑗, and det𝐺𝑗=∏𝑖≤𝑗‖𝐟𝑖‖2. Hence det𝐺𝑚/det𝐺𝑚−1=‖𝐟𝑚‖2. Finally 𝐟𝑚=𝐯𝑚−Pr𝑋(𝐯𝑚) with 𝑋=span(𝐮1,…,𝐮𝑚−1)=span(𝐯1,…,𝐯𝑚−1), so ‖𝐟𝑚‖=dist(𝐯𝑚,𝑋) by Theorem 6.4.33.

(c) Write 𝑋𝑗=span(𝐯1,…,𝐯𝑗−1), so 𝐟𝑗=𝐯𝑗−Pr𝑋𝑗(𝐯𝑗). By Technique 6.4.5, ‖𝐟𝑗‖≤‖𝐯𝑗‖, with equality if and only if Pr𝑋𝑗(𝐯𝑗)=𝟎, that is (Proposition 6.4.29(a)), if and only if 𝐯𝑗⟂𝑋𝑗. Multiplying these inequalities between nonnegative numbers, det𝐺≤∏𝑗‖𝐯𝑗‖2, with equality if and only if 𝐯𝑗⟂𝐯𝑖 for all 𝑖<𝑗, that is, if and only if the list is orthogonal.

For 𝐴∈𝔽𝑛×𝑛: if its columns are dependent, then 𝐴 is not invertible and det𝐴=0 (Theorem 5.4.7), and there is nothing to prove. Otherwise, by Theorem 6.3.29, 𝐴∗𝐴 is the Gram matrix 𝐺 of the columns, so |det𝐴|2=det𝐴det𝐴=det(𝐴∗𝐴)=det𝐺≤∏𝑗‖𝐚𝑗‖2. Geometrically: the volume of a box is at most the product of its side lengths, with equality only for a rectangular box.

Exercise 6.4.60.hard Let 𝑉 be finite-dimensional, and let 𝑊1,…,𝑊𝑚 be subspaces of 𝑉 with

Pr𝑊1+⋯+Pr𝑊𝑚=id𝑉.

Show that every vector of 𝑊𝑖 is orthogonal to every vector of 𝑊𝑗 for 𝑖≠𝑗, and that every 𝐯∈𝑉 can be written in exactly one way as 𝐯=𝐰1+⋯+𝐰𝑚 with 𝐰𝑖∈𝑊𝑖.

Solution.

Uses. Proposition 6.4.29 (The orthogonal projection as a linear map), Proposition 6.1.27 (Basic properties of the norm)

Techniques. A sum of nonnegative terms (Technique 6.1.9), Projections shrink norms (Technique 6.4.5)

Hint 1. Write 𝑃𝑖=Pr𝑊𝑖. For any 𝐯, compute ‖𝐯‖2=⟨𝐯,∑𝑖𝑃𝑖𝐯⟩ and rewrite each term with Proposition 6.4.29(c).
Hint 2. You get ‖𝐯‖2=∑𝑖‖𝑃𝑖𝐯‖2. Now take 𝐯∈𝑊1.
Sketch. With 𝑃𝑖=Pr𝑊𝑖, ‖𝐯‖2=∑𝑖⟨𝑃𝑖𝐯,𝐯⟩=∑𝑖‖𝑃𝑖𝐯‖2. For 𝐯∈𝑊𝑖, the 𝑖th term is ‖𝐯‖2, so 𝑃𝑗𝐯=𝟎 for 𝑗≠𝑖, that is, 𝐯∈ker𝑃𝑗=𝑊𝑗⟂. Existence of the decomposition: 𝐯=∑𝑖𝑃𝑖𝐯. Uniqueness: apply 𝑃𝑖 to ∑𝑗𝐰𝑗, which kills 𝐰𝑗 for 𝑗≠𝑖 and fixes 𝐰𝑖.

Write 𝑃𝑖=Pr𝑊𝑖. For every 𝐯∈𝑉, by the hypothesis and Proposition 6.4.29(c),

‖𝐯‖2=⟨∑𝑖=1𝑚𝑃𝑖𝐯,𝐯⟩=∑𝑖=1𝑚⟨𝑃𝑖𝐯,𝐯⟩=∑𝑖=1𝑚⟨𝑃𝑖𝐯,𝑃𝑖𝐯⟩=∑𝑖=1𝑚‖𝑃𝑖𝐯‖2.

Now let 𝐯∈𝑊𝑖. Then 𝑃𝑖𝐯=𝐯, so the identity reads ‖𝐯‖2=‖𝐯‖2+∑𝑗≠𝑖‖𝑃𝑗𝐯‖2. A sum of nonnegative terms is 0 only if each term is, so 𝑃𝑗𝐯=𝟎 for every 𝑗≠𝑖, that is, 𝐯∈ker𝑃𝑗=𝑊𝑗⟂ (Proposition 6.4.29(a)). So every vector of 𝑊𝑖 is orthogonal to every vector of 𝑊𝑗.

For 𝐯∈𝑉, the hypothesis gives 𝐯=𝑃1𝐯+⋯+𝑃𝑚𝐯 with 𝑃𝑖𝐯∈𝑊𝑖. If also 𝐯=𝐰1+⋯+𝐰𝑚 with 𝐰𝑗∈𝑊𝑗, apply 𝑃𝑖: for 𝑗≠𝑖, 𝐰𝑗∈𝑊𝑗⊆𝑊𝑖⟂=ker𝑃𝑖, and 𝑃𝑖𝐰𝑖=𝐰𝑖. So 𝑃𝑖𝐯=𝐰𝑖, and the decomposition is unique.

For example, if 𝐮1,…,𝐮𝑛 is an orthonormal basis of 𝑉, then Prspan(𝐮1)+⋯+Prspan(𝐮𝑛)=id𝑉 by Proposition 6.3.18(b). The exercise says that every decomposition of id𝑉 into orthogonal projections looks like a grouping of such a basis.

Exercise 6.4.61.hard Let 𝑛≥1, and let 𝑝∈ℝ[𝑥] be a polynomial of degree 𝑛 with ∫−11𝑝(𝑡)𝑞(𝑡)d𝑡=0 for every polynomial 𝑞 of degree less than 𝑛. (For example, the Legendre polynomial 𝑃𝑛 of Example 6.4.19.) Show that 𝑝 has 𝑛 distinct roots, all in the open interval (−1,1).

Solution.

Uses. Lemma 6.1.14 (Nonnegative functions with zero integral), Proposition 7.1.22 (Counting roots), the intermediate value theorem

Techniques. Extremal choice and minimal counterexamples (Technique 1.5.9)

Hint 1. Let 𝑡1<⋯<𝑡𝑟 be the points of (−1,1) where 𝑝 changes sign. Build a polynomial 𝑠 of degree 𝑟 such that 𝑝𝑠 does not change sign on [−1,1].
Hint 2. Take 𝑠(𝑡)=(𝑡−𝑡1)⋯(𝑡−𝑡𝑟). If 𝑟<𝑛, then ∫−11𝑝𝑠=0 by hypothesis. Why is that impossible?
Hint 3. A continuous function that is ≥0 on [−1,1] and has integral 0 vanishes on [−1,1] (Lemma 6.1.14).
Sketch. 𝑝 has finitely many roots, so (−1,1) splits into finitely many open intervals on which 𝑝 has constant sign. Let 𝑡1<⋯<𝑡𝑟 be the roots at which the sign changes, and 𝑠=∏𝑖(𝑡−𝑡𝑖). Then 𝑝𝑠 has constant sign on [−1,1] and is not identically zero there, so ∫𝑝𝑠≠0. If 𝑟<𝑛, deg𝑠<𝑛 and the hypothesis gives ∫𝑝𝑠=0, a contradiction. So 𝑝 has at least 𝑛 distinct roots in (−1,1), and at most 𝑛 roots in all.

The polynomial 𝑝 is nonzero, so it has at most 𝑛 roots (Proposition 7.1.22). Let 𝑎1<⋯<𝑎𝑁 be its roots in (−1,1), and put 𝑎0=−1, 𝑎𝑁+1=1. On each open interval (𝑎𝑘,𝑎𝑘+1), 𝑝 has no root, so by the intermediate value theorem it has constant sign there. Say that 𝑝 changes sign at 𝑎𝑘 (1≤𝑘≤𝑁) if its signs on (𝑎𝑘−1,𝑎𝑘) and (𝑎𝑘,𝑎𝑘+1) differ, and let 𝑡1<⋯<𝑡𝑟 be the roots at which 𝑝 changes sign. Let

𝑠(𝑡)=(𝑡−𝑡1)(𝑡−𝑡2)⋯(𝑡−𝑡𝑟)

(𝑠=1 if 𝑟=0). Each factor 𝑡−𝑡𝑖 changes sign at 𝑡𝑖 and nowhere else, so 𝑠 has constant sign on each interval (𝑎𝑘,𝑎𝑘+1) and changes sign exactly at 𝑡1,…,𝑡𝑟. Hence the product 𝑝𝑠 has constant sign on each (𝑎𝑘,𝑎𝑘+1), and at each 𝑎𝑘 either both factors change sign or neither does, so 𝑝𝑠 has the same sign on all of these intervals. Replacing 𝑠 by −𝑠 if necessary, 𝑝𝑠≥0 on [−1,1] by continuity.

Suppose 𝑟<𝑛. Then deg𝑠=𝑟<𝑛, so ∫−11𝑝(𝑡)𝑠(𝑡)d𝑡=0 by hypothesis. Since 𝑝𝑠 is continuous and nonnegative on [−1,1], Lemma 6.1.14 gives 𝑝𝑠=0 on [−1,1]. But 𝑝𝑠 is a nonzero polynomial, with finitely many roots, a contradiction. So 𝑟≥𝑛: 𝑝 has at least 𝑛 distinct roots in (−1,1). Since it has at most 𝑛 roots, these are all of its roots.

The argument used only that 𝑝 is continuous, has finitely many zeros in [−1,1], and is orthogonal to all polynomials of degree less than 𝑛. So it applies to the error 𝑒𝑡−𝑝(𝑡) of Example 6.4.37 with 𝑛=3: that error has at most three zeros (see the remark after Example 6.4.37), and therefore changes sign at least three times in (−1,1).

Exercise 6.4.62.challenge Let 𝐯1,…,𝐯𝑚∈ℝ𝑛 satisfy ⟨𝐯𝑖,𝐯𝑗⟩<0 for all 𝑖≠𝑗. Show that 𝑚≤𝑛+1, and find 𝑛+1 such vectors in ℝ𝑛.

Solution.

Uses. Corollary 6.4.25 (Dimension of the orthogonal complement), Corollary 6.4.10 (Projecting with an orthogonal list), Proposition 6.4.4 (Properties of Pr𝒪︀)

Techniques. Induction on the length of a list (Technique 1.6.9), Orthogonal decomposition (Technique 6.2.4)

Hint 1. Induct on the dimension, proving the statement for every 𝑛-dimensional subspace of some ℝ𝑁. Project the first 𝑚−1 vectors onto the hyperplane 𝐯𝑚⟂.
Hint 2. Let 𝐰𝑖=𝐯𝑖−𝑐𝑖𝐯𝑚 with 𝑐𝑖=⟨𝐯𝑖,𝐯𝑚⟩/‖𝐯𝑚‖2<0. Compute ⟨𝐰𝑖,𝐰𝑗⟩ for 𝑖≠𝑗.
Hint 3. ⟨𝐰𝑖,𝐰𝑗⟩=⟨𝐯𝑖,𝐯𝑗⟩−𝑐𝑖𝑐𝑗‖𝐯𝑚‖2<0, since 𝑐𝑖𝑐𝑗>0. For the example, try 𝐞𝑖−𝑡(1,…,1) and −(1,…,1).
Sketch. Prove, by induction on 𝑛, that pairwise negative inner products allow at most 𝑛+1 vectors in any 𝑛-dimensional subspace 𝑉 of ℝ𝑁. For 𝑛=0 only 𝟎 exists and ⟨𝟎,𝟎⟩=0, so 𝑚≤1. For 𝑛≥1 and 𝑚≥2, all 𝐯𝑖≠𝟎; project 𝐯1,…,𝐯𝑚−1 onto 𝑈=𝐯𝑚⟂∩𝑉, of dimension 𝑛−1. The projections 𝐰𝑖=𝐯𝑖−𝑐𝑖𝐯𝑚 have ⟨𝐰𝑖,𝐰𝑗⟩=⟨𝐯𝑖,𝐯𝑗⟩−𝑐𝑖𝑐𝑗‖𝐯𝑚‖2<0, so 𝑚−1≤𝑛. Example: 𝐞𝑖−(1/2𝑛)𝐣 for 𝑖≤𝑛, and −𝐣, with 𝐣=(1,…,1).

We prove, by induction on 𝑛≥0, the following statement: if 𝑉 is an 𝑛-dimensional subspace of ℝ𝑁 (for some 𝑁) and 𝐯1,…,𝐯𝑚∈𝑉 satisfy ⟨𝐯𝑖,𝐯𝑗⟩<0 for all 𝑖≠𝑗, then 𝑚≤𝑛+1. The case 𝑉=ℝ𝑛 is the claim.

If 𝑛=0, then 𝑉={𝟎} and ⟨𝟎,𝟎⟩=0, so there is no pair 𝑖≠𝑗, and 𝑚≤1.

Let 𝑛≥1, and assume the statement for (𝑛−1)-dimensional subspaces. If 𝑚≤2 there is nothing to prove, so let 𝑚≥3. Every 𝐯𝑖 is nonzero, since ⟨𝐯𝑖,𝐯𝑗⟩≠0 for some 𝑗≠𝑖. Let 𝑈={𝐱∈𝑉|⟨𝐱,𝐯𝑚⟩=0}, the orthogonal complement of span(𝐯𝑚) inside the inner product space 𝑉, so dim𝑈=𝑛−1 by Corollary 6.4.25. For 𝑖<𝑚 let

𝑐𝑖=⟨𝐯𝑖,𝐯𝑚⟩‖𝐯𝑚‖2<0,𝐰𝑖=𝐯𝑖−𝑐𝑖𝐯𝑚.

By Corollary 6.4.10 and Proposition 6.4.4(b), 𝐰𝑖=𝐯𝑖−Prspan(𝐯𝑚)(𝐯𝑖)∈𝑈. For 𝑖≠𝑗, both less than 𝑚,

⟨𝐰𝑖,𝐰𝑗⟩=⟨𝐯𝑖,𝐯𝑗⟩−𝑐𝑗⟨𝐯𝑖,𝐯𝑚⟩−𝑐𝑖⟨𝐯𝑚,𝐯𝑗⟩+𝑐𝑖𝑐𝑗‖𝐯𝑚‖2=⟨𝐯𝑖,𝐯𝑗⟩−𝑐𝑖𝑐𝑗‖𝐯𝑚‖2−𝑐𝑖𝑐𝑗‖𝐯𝑚‖2+𝑐𝑖𝑐𝑗‖𝐯𝑚‖2=⟨𝐯𝑖,𝐯𝑗⟩−𝑐𝑖𝑐𝑗‖𝐯𝑚‖2<0,

because ⟨𝐯𝑖,𝐯𝑗⟩<0 and 𝑐𝑖𝑐𝑗>0. So 𝐰1,…,𝐰𝑚−1 are vectors in the (𝑛−1)-dimensional space 𝑈 with pairwise negative inner products, and the induction hypothesis gives 𝑚−1≤𝑛, that is, 𝑚≤𝑛+1.

For an example with 𝑚=𝑛+1, let 𝐣=(1,…,1)∈ℝ𝑛, 𝐯𝑖=𝐞𝑖−(1/2𝑛)𝐣 for 𝑖=1,…,𝑛, and 𝐯𝑛+1=−𝐣. For 𝑖≠𝑘≤𝑛,

⟨𝐯𝑖,𝐯𝑘⟩=0−12𝑛−12𝑛+𝑛4𝑛2=−34𝑛<0,⟨𝐯𝑖,𝐯𝑛+1⟩=−1+𝑛2𝑛=−12<0.

The proof is an induction on dimension in which projecting onto a hyperplane preserves the hypothesis. The triangularization theorems of Section 7.5 are proved by the same pattern (Technique 7.5.12).

Exercise 6.4.63.hardBeyond 21-242 Give ℝ[𝑥] the inner product ⟨𝑝,𝑞⟩=∑𝑘≥0𝑝𝑘𝑞𝑘, where 𝑝=∑𝑘𝑝𝑘𝑥𝑘 and 𝑞=∑𝑘𝑞𝑘𝑥𝑘, and let 𝑊={𝑝∈ℝ[𝑥]|𝑝(1)=0}.

  1. (a)Show that 𝑊 is a subspace with 𝑊≠ℝ[𝑥], but 𝑊⟂={𝟎}.
  2. (b)Deduce that ℝ[𝑥]≠𝑊⊕𝑊⟂ and (𝑊⟂)⟂≠𝑊.
  3. (c)Show that no vector of 𝑊 is closest to the constant polynomial 1, although inf𝑤∈𝑊‖1−𝑤‖=0.

Solution.

Uses. Definition 1.2.13 (Polynomials), Definition 1.2.17 (Evaluation), Proposition 1.2.18 (Degree and evaluation versus the operations), Proposition 6.3.9 (Properties of 𝐴⟂), Theorem 6.4.24 (Orthogonal decomposition)

Techniques. Finding counterexamples and minimal examples (Technique 1.4.18)

Hint 1. The sum defining ⟨𝑝,𝑞⟩ is finite. 𝑊 is the set of polynomials killed by evaluation at 1, and 1∉𝑊.
Hint 2. For 𝑞∈𝑊⟂, test against 𝑥𝑘−𝑥𝑘+1∈𝑊. What does ⟨𝑞,𝑥𝑘−𝑥𝑘+1⟩=0 say about the coefficients of 𝑞?
Hint 3. For (c), try 𝑤𝑛=1−(1+𝑥+⋯+𝑥𝑛)/(𝑛+1).
Sketch. (a) 𝑊 is closed under the operations since evaluation respects them, and 1∉𝑊. If 𝑞⟂𝑊, then 0=⟨𝑞,𝑥𝑘−𝑥𝑘+1⟩=𝑞𝑘−𝑞𝑘+1 for all 𝑘, so all coefficients of 𝑞 are equal, and since almost all are 0, 𝑞=0. (b) 𝑊+𝑊⟂=𝑊 and (𝑊⟂)⟂=𝑉. (c) 𝑤𝑛∈𝑊 and ‖1−𝑤𝑛‖2=1/(𝑛+1)→0, but ‖1−𝑤‖>0 for every 𝑤∈𝑊 since 1∉𝑊.

(a) For each 𝑝 only finitely many 𝑝𝑘 are nonzero, so the sum is finite. It is symmetric and linear in each slot, and ⟨𝑝,𝑝⟩=∑𝑘𝑝𝑘2>0 for 𝑝≠0, so it is an inner product (it is the dot product of coefficient sequences). By Proposition 1.2.18, (𝑎𝑝+𝑏𝑞)(1)=𝑎𝑝(1)+𝑏𝑞(1), so 𝑊 is a subspace, and 1∉𝑊, so 𝑊≠ℝ[𝑥].

Let 𝑞∈𝑊⟂. For each 𝑘≥0, the polynomial 𝑥𝑘−𝑥𝑘+1 vanishes at 1, so it lies in 𝑊, and

0=⟨𝑞,𝑥𝑘−𝑥𝑘+1⟩=𝑞𝑘−𝑞𝑘+1.

So 𝑞0=𝑞1=𝑞2=⋯. Since 𝑞𝑘=0 for all large 𝑘, every coefficient is 0, and 𝑞=0. Hence 𝑊⟂={𝟎}.

(b) 𝑊+𝑊⟂=𝑊≠ℝ[𝑥], so ℝ[𝑥] is not 𝑊⊕𝑊⟂. And (𝑊⟂)⟂={𝟎}⟂=ℝ[𝑥]≠𝑊 (Proposition 6.3.9(d)). Both conclusions of Theorem 6.4.24 and Theorem 6.4.26 fail. The hypothesis that breaks is finite-dimensionality: 𝑊 contains the independent list 1−𝑥,𝑥−𝑥2,𝑥2−𝑥3,…, of every length, so it has no (finite) orthonormal basis, and Pr𝑊 cannot be defined.

(c) Let 𝑤𝑛=1−(1+𝑥+⋯+𝑥𝑛)/(𝑛+1). Then 𝑤𝑛(1)=1−1=0, so 𝑤𝑛∈𝑊, and

‖1−𝑤𝑛‖2=‖1+𝑥+⋯+𝑥𝑛𝑛+1‖2=𝑛+1(𝑛+1)2=1𝑛+1.

So inf𝑤∈𝑊‖1−𝑤‖=0. But 1∉𝑊, so ‖1−𝑤‖>0 for every 𝑤∈𝑊. If some 𝑤∈𝑊 were closest to 1, then ‖1−𝑤‖≤‖1−𝑤𝑛‖=(𝑛+1)−1/2 for every 𝑛, forcing ‖1−𝑤‖=0, which is impossible. In the spaces of Section 15.3, which are complete, closest points do exist for closed subspaces, and this kind of example disappears.

Exercise 6.4.64.routineBeyond 21-242 Let 𝐴=(132320).

  1. (a)Find the QR factorization of 𝐴.
  2. (b)Use it to find Prim𝐴(𝐞1).
  3. (c)Check that 𝐴𝖳𝐴=𝑅𝖳𝑅.

Solution.

Uses. Theorem 6.4.38 (QR factorization), Theorem 6.4.31 (The matrix of an orthogonal projection), Algorithm 6.4.14 (Gram–Schmidt)

Hint 1. Gram–Schmidt on the columns: ‖𝐚1‖=3, and ⟨𝐚2,𝐮1⟩ is an integer.
Hint 2. 𝐮1=(1,2,2)/3 and 𝐮2=(2,1,−2)/3. For (b), Prim𝐴=𝑄𝑄𝖳.
Sketch. 𝐮1=(1,2,2)/3, 𝑟11=3; 𝑟12=⟨𝐚2,𝐮1⟩=3, 𝐟2=(3,3,0)−(1,2,2)=(2,1,−2), 𝑟22=3. So 𝑅=(3303). Then Prim𝐴(𝐞1)=(1/9)(1,2,2)+(2/9)(2,1,−2)=(5,4,−2)/9, and 𝐴𝖳𝐴=(99918)=𝑅𝖳𝑅.

(a) Let 𝐚1=(1,2,2) and 𝐚2=(3,3,0). Then ‖𝐚1‖=3, so 𝐮1=(1,2,2)/3 and 𝑟11=3. Next 𝑟12=⟨𝐚2,𝐮1⟩=(3+6+0)/3=3, and 𝐟2=𝐚2−3𝐮1=(2,1,−2), with 𝑟22=‖𝐟2‖=3 and 𝐮2=(2,1,−2)/3. By Theorem 6.4.38,

𝐴=𝑄𝑅,𝑄=13(12212−2),𝑅=(3303).

(b) The columns of 𝑄 are an orthonormal basis of im𝐴, so by Theorem 6.4.31,

Prim𝐴(𝐞1)=⟨𝐞1,𝐮1⟩𝐮1+⟨𝐞1,𝐮2⟩𝐮2=19(1,2,2)+29(2,1,−2)=19(5,4,−2).

(c) 𝐴𝖳𝐴=(1+4+43+6+03+6+09+9+0)=(99918) and 𝑅𝖳𝑅=(3033)(3303)=(99918). In general 𝐴∗𝐴=𝑅∗𝑄∗𝑄𝑅=𝑅∗𝑅, which is Exercise 6.4.59(a) for the columns of 𝐴.

More practice

The practice bank has 38 exercises on this section’s topics.