4. INNER PRODUCTS AND ORTHOGONALITY

In making the definition of a vector space, we generalized the linear structure (addition and scalar multiplication) of ℝ2 an ℝ3. We ignored other important features, such as the notions of length and angle. These ideas are embedded in the concept we now investigate, inner products.

4.1 Inner product spaces

We begin with a definition.

Definition 4.1

Let V be a real (or complex) vector space. Suppose that to each pair of vectors u, vV there is assigned a real number denoted by ⟨u, v⟩. This function is called an inner product on V if it satisfies the following axioms:

(11) (Linearity in the first entry) ⟨a u1 + bu2, v⟩ = au1, v⟩ + bu2, v⟩.

(12) (Symmetry) ⟨u, v⟩ = ⟨v, u⟩.

(13) (Positive definiteness) ⟨u, u⟩ ≥ 0; and ⟨u, u⟩ = 0 if and only if u = 0.

The vector space V with an inner product is called an inner product space.

Using the linearity axiom (I1) and the symmetry axiom (I2), we obtain

u,av1 + bv2⟩ = ⟨av1 + bv2, u⟩ = av1, u⟩ + bv2, u⟩ = au, v1⟩ + bu, v2⟩.

That is, the inner product function is also linear in its second entry. By induction, we obtain

a1 u1 + a2 u2 + … + ar ur, v⟩ = a1u1, v⟩ + a2u2, v⟩ + … + arur, v

and

u, b1 v1 + b2 v2 + … + bs vs⟩ = b1u, v1⟩ + b2u, v2⟩ + … + bsu, vs⟩.

Combining these two properties yields the following general formula:

i=1r ai ui , j=1s bj vj=i=1rj=1saibjui , vj=a1a2aru1 , v1u1 , v2u1 , vsu2 , v1u2 , v2u2 , vsur , v1ur , v2ur , vsb1b2bs                  (4.1)

By axiom (I3), ⟨u, u⟩ is a non negative number and hence its positive real square root exists. We use the notation

u=u,u.

This non negative real number ∥u∥ is called the norm of u. The relation ∥u2 = ⟨u, u⟩ will be used frequently.

Example 4.1

Consider the vector space ℝn. The function

u, v⟩ = uv

defines an inner product on ℝn. Notice that this is the usual dot product u · v. The norm ∥u∥ of a vector in this space is as follows:

u=uv

Although there are many ways to define an inner product on ℝn, we will often use the inner product in ℝn defined by the dot product, unless otherwise stated or implied; we will call it the usual inner product onn.

Example 4.2

Let V be the vector space of real continuous functions on the interval atb. Then the following is an inner product on V :

f,g=abf(t)g(t)dt

where f(t) and g(t) are any continuous functions on [a, b].

Another inner product on V is:

f,g=abf(t)g(t)w(t)dt

where w(t) is a given continuous function which is positive on the interval atb. In this case w (t) is called a weight function for the inner product.

Example 4.3

Let V denote the vector space of m × n matrices over ℝ. The following is an inner product on V :

A, B⟩ = Tr(BA)

where Tr stands form the trace, the sum of the diagonal elements. If A = (aij) and B = (bij), then

A,B=TrB A=i=1mj=1naijbij

the sum of the products of the corresponding entries. In particular,

A2=A,A=i=1mj=1naij2

the sum of the squares of all the elements of A.

4.2 Gram matrices of an inner product

Let V be an inner product space and let B = {b1, b2, …, bn} be a basis for V. Since any vectors u, vV can be written as a linear combination of the basis using their coordinates as weights, we can write the inner product using (4.1) as follows

u,v=[u]Bb1 , b1b1 , b2b1 , bnb2 , b1b2 , b2b2 , bnbn , b1bn , b2bn , bn[v]B.

The n × n matrix

GB=b1 , b1b1 , b2b1 , bnb2 , b1b2 , b2b2 , bnbn , b1bn , b2bn , bn

is called the Gram matrix if the inner product relative to the basis B. Notice that by axioms (I2) and (I3), the Gram matrix must satisfy

GB=GB and 0xGBx, for all xRn.

Example 4.4

Recall that if εn is the canonical basis in ℝn, then for every vector u ∈ ℝn, we have [u]εn = u. Moreover, the usual inner product is given by ⟨u, v⟩ = uv, which can be written as

u,v=[u]EnIn[v]En

So we conclude that the Gram matrix of the usual inner product with respect to the canonical basis is the identity matrix In, that is, GEn = In. This is easy to verify using the definition and is left to the reader as a straightforward exercise.

Example 4.5

Consider the usual inner product in ℝ3 and the basis B = {b1, b2, b3}, where

b1=100,b2=110,b3=111.

Then,

b1, b1⟩ = 1, ⟨b1, b2⟩ = 1, ⟨b1, b3⟩ = 1,
b2,b2⟩=2, ⟨b2, b3⟩ = 2, ⟨b3, b3⟩ = 2.

So the Gram matrix of the usual inner product relative to B is

GB=111122123

Notice that the Gram matrix of the usual inner product in ℝ3 relative to the canonical basis is I3. In fact, the Gram matrix of an inner product is, in general, different for each choice of basis, that is, the Gram matrix of an inner product depends on the basis. This is true for any inner product space.

Example 4.6

Consider the vector space ℙ2 endowed with the inner product defined by

f,g=01f(t)g(t)dt.

For the standard basis S2 = {1, t, t2}, we have

1,1=01dt=1,1,t=01tdt=12,1 , t2=01t2dt=13t,t=01t2dt=13,t , t2=01t3dt=14,t2 , t2=01t4dt=15

Then the Gram matrix of the inner product relative to the standard basis is

GS2=11/21/31/21/31/41/31/41/5.

We can use the Gram matrix to compute the inner product between to elements of ℙ2. If p(t) = 1 − t and q(t) = 1 − t + t2, then

p(t),q(t)=[p(t)]S2GS2[q(t)]S2=1    1    011/21/31/21/31/41/31/41/5111=512

The definition of an inner product is independent of the choice of basis. Nevertheless, the Gram matrices of an inner product relative to an old basis B and a new basis C are, in general, not equal; that is, GBGC. So it is sensible to conclude that the two Gram matrices are related in some way. We explore this relation here.

First, using the Gram matrix GB, we can write

u,v=[u]BGB[v]B.

Recall that for any vector xV, the coordinate vector [x]B is related to the coordinate vector [x]C by means of the change of basis matrix PBC:

[x]B=PBC[x]C.

Therefore, we can use the change of basis matrix to change the coordinate vectors relative to the old basis to coordinate vectors relative to the new basis:

u,v=PBC [ u ]CGBPBC [ v ]C=[u]CPBC GB PBC[v]C.

Comparing the last equation with

u,v=[u]CGC[v]C,

we conclude that

GC=PBCGBPBC.

Example 4.7

Consider the usual inner product in ℝ3. Its Gram matrices relative to two different bases were computed in Example 4.4 and Example 4.5. The Gram matrix relative to the canonical basis is Gε3 = I3, where as the Gram matrix relative to the basis B given in Example 4.5 is

GB=111122123.

The matrix GB can be obtained from Gε3 = I3 by means of the change of basis matrix

PE3B=111011001.

Indeed, we compute

PE3BGE3PE3B=1    0    01    1    01    1    11    1    10    1    10    0    1=1    1    11    2    21    2    3=GB.

4.3 Cauchy-Schwarz inequality

The following inequality is called the Cauchy-Schwarz inequality; it is used in many branches of mathematics.

Theorem 4.1

For any vectors u, vV,

|⟨u, v⟩| ≤ ∥u∥ ∥v∥.

This inequality is an equality if and only if one of u, v is a scalar multiple of the other.

Proof. Let u, v ε V. If v = 0, then both sides of the inequality are equal to 0 and the desired result holds. Thus we can assume that v ≠ 0.

By axiom (I3), for all λ ε ℝ, we get:

uλv,uλv0

Consequently,

u22λu,v+λ2v20

Taking λ=u,vv2, we obtain

u22u,v2v2+u,v2v20

That is,

u2u,v2v20

Multiplying both sides by ∥v2,

u2v2u,v20

which implies

u,v2u2v2.

Taking the positive square root of both sides, we finally get

|u,v|uv.

Observe that if u = λ v, then

u - λv, u - λv⟩ = 0.

In this case, each step of the proof is valid with ≤ and ≥ replaced with equality signs. Moreover, each step (with equality replacing inequalities) is reversible. Therefore, the Cauchy-Schwarz inequality is an equality if and only if u or v is a scalar multiple of the other.

Example 4.8

Consider any real numbers a1, …, an, b1, …, bn. Then the Cauchy-Schwarz inequality applied to the usual inner product in ℝn implies

a1 b1 + a2 b2 + + an bn2a12 + a22 + + an2b12 + b22 + + bn2

Example 4.9

Let f and g be any real continuous functions defined on the interval atb. Then, applying the Cauchy-Schwarz inequality to the first inner product introduced in Example 4.2, we obtain

ab f ( t ) g ( t ) d t2ab f ( t )2 d tab g ( t )2 d t

The next theorem gives basic properties of the norm; the proof of the third property requires the Cauchy-Schwarz inequality.

Theorem 4.2

Let V be an inner product space. Then the norm in V satisfies the following properties:

(N1) ∥v∥ ≥ 0; and ∥v∥ = 0 if and only if v = 0.

(N2) ∥kv∥ = |k| ∥v∥.

(N3) (Triangle inequality) ∥u + v∥ ≤ ∥u∥ + ∥v∥; this inequality is an equality if and only if one of u, v is a non negative multiple of the other.

Proof. Property (N1) is a direct consequence of axiom (I3). Property (N2) is a direct consequence of the definition of norm and the linearity of the inner product in both entries:

kv=kv,kv=k2v,v=|k|v.

Most of our effort is in proving property (N3). For u, vV,

u+v2=u+v,u+v=u2+2u,v+v2u2+2|u,v|+v2u2+2uv+v2 (by Cauchy-Schwartz) =(u+v)2.

Taking square roots of both sides of the inequality above gives the triangle inequality. The proof above shows that the triangle inequality is an equality if and only if ⟨u, v⟩ = ∥u∥ ∥v∥. If one u, v is a non negative multiple of the other, then the above equality holds. Conversely, if the above equality holds, then the condition for the Cauchy-Schwarz inequality implies that one of u, v must be a scalar multiple of the other. If u = λ v, then bye (N2), ⟨u, v⟩ = ∥u∥ ∥v∥ implies λ = |λ|, which forces the scalar in question to be non negative, as desired.

If ∥u∥ = 1, or, equivalently, if ⟨u, u⟩ = 1, then u is called a unit vector and is said to be normalized. Every non zero vector vV can be multiplied by the reciprocal of its norm to obtain a unit vector

v^=vv

which is a positive multiple of v. This process is called normalizing v.

The non negative real number

d(u, v) = ∥u- v

is called the distance between u and v. For any non zero vectors u, vV, the angle between u and v is defined to be the angle θ such that 0 ≤ θπ and

cosθ=u,vuv.

By the Cauchy-Schwartz inequality, -1 ≤ cos θ ≤ 1 and so the angle always exists and is unique.

4.4 Orthogonality

Let V be an inner product space. The vectors u, vV are said to be orthogonal and u is said to be orthogonal to v if

u, v⟩ = 0.

The relation is clearly symmetric; that is, if u is orthogonal to v, then ⟨v, u⟩ = 0 and so v is orthogonal to u. We note that 0V is orthogonal to every vector vV for

0, v⟩ = ⟨0v,v⟩ = 0⟨v, v⟩ = 0.

Conversely, if u is orthogonal to every vV, then ⟨u, u⟩ = 0 and hence u = 0 by axiom (I3). Observe that u and v are orthogonal if and only if cos θ = 0 where θ is the angle between u and v, and this is true if and only if θ = π/2.

Example 4.10

Consider an arbitrary vector u = [a1 a2 … an] in ℝn. Then a vector v = [x1 x2 … xn] is orthogonal to u if

u, v⟩ = a1x1 +a2x2 + … +anxn = 0.

In other words, v is orthogonal to u if v satisfies a homogeneous equation whose coefficients are the entries of u.

Example 4.11

Suppose that we want a non zero vector which is orthogonal to v1= [1 3 5] and v2= [0 1 4] in ℝ3. Let w = [x y z]. We want

0 = ⟨v1, w⟩ = x + 3y + 5z and 0 = ⟨v2, w⟩ = y + 4z.

Thus we obtain the homogeneous system

x + 3y + 5z = 0,
y + 4z = 0.

with general solution

w=xyz=λ741,λR.

Then, w with λ ≠ 0 is orthogonal to v1 and v2.

Let S be a subset of an inner product space V. The orthogonal complement of S, denoted by S (read “S perp”) consists of those vectors in V which are orthogonal to every vector uS:

S = {vV : ⟨v, u⟩ = 0 for every uS}.

We show that S is a subspace of V. Clearly 0S since 0 is orthogonal to every vector in V. Now suppose that u, wS. Then, for any scalars a and b and any vector uS, we have

av + bw, u⟩ = av, u⟩ + bw, u⟩ = a0 + b0 = 0.

Thus a v + b wS and therefore S is a subspace of V.

Example 4.12

Suppose we want to find a basis for the subspace S = Span{u} in ℝ3 where u = [1 3 - 4]. Note that S consists of all vectors w = [x y z] such that

w, u⟩ = x + 3y - 4z = 0.

The general solution of this homogeneous equation is

w=xyz=λ310+μ401,λ,μR.

Therefore, a basis for S is

310 , 401.

The next theorem is a basic result in linear algebra.

Theorem 4.3

Let S = Span{v} where vV and v0. Then for every xV there is a unique uS and a unique wS such that

x = u + w.

Proof. Let λ be a scalar. Then

x = λv + (x - λv).

Notice that λS. Thus we need to choose λ so that v is orthogonal to (x - λv). In other words, we want

0 = ⟨x-λv,v⟩ = ⟨x, v⟩ - λv2.

The equation above shows that we should choose λ to ⟨x, v/v2. Making this choice of λ, we can write

x=x,vv2v+x x,vv2 v.

Example 4.13

Consider the vectors x = [0 1] and v = [1 1] in ℝ2 with the usual inner product. Then ⟨x, v⟩ = 1, ∥v2 = 2, and

w=xx,vv2v=011211=1212.

Then x can be written uniquely as

x=12v+w,

where ⟨v, w⟩ = 0.

Example 4.14

Consider the vector space ℙ2 endowed with the inner product defined by

f,g=01f(t)g(t)dt

Relative to the standard basis S2 = {1, t, t2}, we have the Gram matrix

GS2=11/21/31/21/31/41/31/41/5.

If p(t) = 1 - t and q(t) = 1 - t + t2, then

p(t),q(t)=1    1    011/21/31/21/31/41/31/41/5111=512

and

p(t)=2542q(t)+p ( t ) 2542 q ( t )=2542q(t)+1742 1742 t 2542 t2

Then

p(t)=2542q(t)+p ( t ) 2542 q ( t )=2542q(t)+1742 1742 t 2542 t2

where

q ( t ) , 1742 1742 t 2542 t2=1742    1742    254211/21/31/21/31/41/31/41/5111=0

4.5 Orthogonal sets and bases

A set S of vectors in V is called orthogonal if each pair of vectors in S are orthogonal, and S is called orthonormal if S is orthogonal and each vector in S has unit norm. In other words, S = {u1, u2, …, ur} is orthogonal if

ui, uj ⟩ = 0 for ij

and is orthonormal if

ui , uj=δi,j=0,     if ij1,     if i=j

Normalizing an orthogonal set S refers to the process of multiplying each vector in S by the reciprocal of its norm in order to transform S into an orthonormal set of vectors. The following theorems apply.

Theorem 4.4

Suppose that S is an orthogonal set of non zero vectors. Then S is linearly independent.

Proof. Let S = {u1, u2, …, ur} be an orthogonal set. Suppose that the scalars a1, a2, …, ar satisfy

a1 u1 + a2 u2 + … + ar ur = 0.

Computing the inner product of both sides of the above equation with ui for i = 1, 2, …, r, by the orthogonality of S we obtain

0=ui , 0=ui , a1 u1 + a2 u2 + + ar ur=a1ui , u1++aiui , ui++arui , ur=aiui2, for i=1,2,,r

This implies that ai = 0 for i = 1, 2, …, r is the unique solution of the homogeneous equation. Therefore S is a linearly independent set.

Theorem 4.5 Pythagoras

Suppose that S = {u, v} is an orthogonal set of two vectors. Then

u+v2= ∥u2 + ∥v2.

Proof. Suppose that ⟨u, v⟩ = 0. Then

u+v2=u+v,u+v=u,u+2u,v+v,v=u,u+v,v=u2+v2

which gives the desired result.

Example 4.15

Consider the canonical basis ε3 = {e1, e2, e3} in ℝ3 with the usual inner product. It is clear that

e1,e2⟩ = ⟨e1, e2⟩ = ⟨e2,e3⟩ = 0 and ⟨e1,e1⟩ = ⟨e2,e2⟩ = ⟨e3,e3⟩ = 1.

Thus ε3 is an orthonormal basis of ℝ3. More generally, the canonical basis in ℝn with the usual inner product is orthonormal for every n.

Example 4.16

Consider the vector space ℙ2 endowed with the inner product defined by

f,g=01f(t)g(t)dt

Relative to the standard basis S2 = {1, t, t2}, we have the Gram matrix

GS2=11/21/31/21/31/41/31/41/5.

Let S = {1, 1 - 2 t, 2 - 12t + 12t2} is an orthogonal set since

1,12t=10011/21/31/21/31/41/31/41/5120=01 , 2 12 t + 12 t2=10011/21/31/21/31/41/31/41/521212=01 2 t , 2 12 t + 12 t2=12011/21/31/21/31/41/31/41/521212=0

The most useful property of orthogonal bases is that the coordinates of any vector relative to an orthogonal basis can be computed directly one by one, without the need to solve a system of linear equations.

Suppose that {u1, …, un} is an orthogonal basis for V. Then, for any vV,

Theorem 4.6

Suppose that {u1, …, un} is an orthogonal basis for V. Then, for any v ε V,

v=v , u1u1 , u1u1+v , u2u2 , u2u2++v , unun , unun.

Proof. Since {u1, …, un} is a basis for V, any vector vV can be written as a linear combination of the basis; that is,

v = a1u1 +a2u2 + … + anun

for suitable scalars a1, a2, …, an. Using the orthogonality of the basis, we compute

v , ui=a1 u1 + a2 u2 + + an un , ui=a1u1 , ui++aiui , ui++anun , ui=aiui , ui, for i=1,2,,n

This implies that ai = ⟨v, ui/ui, ui⟩ for i = 1, 2, …, n, which is the desired result.

The above scalars

ai=v , uiui , ui=v , uiui2, for i=1,2,,n

are called the Fourier coefficients of v with respect to {u1, …, un}.

Consider a non zero vector w in an inner product space V. For any vV, we have showed that

λ=v,ww,w=v,ww2

is the unique scalar such that v^ = v - λ w is orthogonal to w. The projection of v along w, denoted by projwv, is defined as

projwv=v,ww,ww=v,ww2w

The above notion is generalized as follows.

Theorem 4.7

Suppose that u1, u2, …, ur form an orthogonal set of non zero vectors in V. Let v be any vector in V. Define

v = v - (c1 u1 + c2 u2 + … + cr ur)

where

c1=v , u1u1 , u1,c2=v , u2u2 , u2,,cr=v , urur , ur.

Then v^ is orthogonal to u1, u2, …, ur.

Proof. We verify that v^ is orthogonal to u1, u2, …, ur. For i = 1, 2, …, r, compute using the orthogonality of u1, u2, …, ur,

v^ , ui=v c1 u1 + c2 u2 + + cr ur , ui=v , uic1u1 , uic2u2 , uiciui , uicrur , ui=v , uiciui , ui=v , uiv , uiui , uiui , ui=v , uiv , ui=0

Therefore v^ is orthogonal to u1, u2, …, ur.

Notice that each ci in the theorem above is the Fourier coefficient of v along the corresponding vector ui.

The notion of the projection of a vector vV along a subspace W of V is defined as follows. If W = Span{w1, w2, …, wr} where the wi form an orthogonal set, then the projection of v along W, denoted by projW v, is defined as

w1=v1,w2=v2projw1v2w3=v3projw1v3projw2v3,wn=vnprojw1vnprojw2vnprojwn1vn.

4.6 Gram-Schmidt orthogonalization

Suppose that {v1, v2, …, vn} is a basis of an inner product space V. One can use this to construct an orthogonal basis {w1, w2, …, wn} of V as follows. Set

w1=v1w2=v2projw1v2w3=v3projw1v3projw2v3projwn1vn.

In other words, for k = 2, 3, …, n, we define

wk=vkprojWk1vk, where Wk1=Spanw1 , w2 , , wk1.

By Theorem 4.7, each wk is orthogonal to the preceding w’s. Thus, {w1, w2, …, wn} forms an orthogonal basis for V as claimed. Normalizing will then yield an orthonormal basis for V.

The above construction is known as the Gram-Schmidt orthogonalization process. Each vector wk is a linear combination of vk and the preceding w’s. Hence, it can easily be shown, by induction, that each wk is a linear combination of v1, v2, …, vk. Because taking multiples of vectors does not affect orthogonality, it may be simpler in hand calculations to clear fractions in any new wk, by multiplying wk by an appropriate scalar, before obtaining the next wk+1.

Suppose u1, u2, …, ur are linearly independent, and so they form a basis for

U = Span{u1, u2, …, ur}.

Applying Gram-Schmidt orthogonalization to the u’s yields an orthogonal basis for U. The following theorems use the above algorithm and remarks.

Theorem 4.8

Suppose that S = {w1, w2, …, wr} is an orthogonal basis for a subspace W of a vector space V. Then one may extend S to an orthogonal basis for V ; that is, one may find vectors wr+1, …, wn such that {w1, w2, …, wn} is an orthogonal basis for V.

Proof. Since S is a linearly independent set in V, we can extend S to a basis of V. That is, we can find vectors ur+1, …, un such that {w1, …, wr, ur+1, … un} is a basis for V. For k = r + 1, …, n, we define

wk=ukprojWk1uk, where Wk1=Spanw1 , w2 , , wk1

This is just the Gram-Schmidt orthogonalization process applied to {w1, …, wr, ur+1, … un}, which yields an orthogonal basis for V.

Theorem 4.9

Let W be a subspace of an inner product space V. Then each vector vV can be expressed uniquely in the form

v=w+w^,wW,w^W.

Proof. Let {u1, …, ur} be a basis for W. Applying the Gram-Schmidt orthogonalization process, we obtain an orthogonal basis for W: S = {w1, …, wr}. Using S, for every vV, we can write

v = projW v + (v − projW v).

Clearly, projW vW. By Theorem 4.7, (v − projW v) is orthogonal to every vector in S and, thus, to every vector in W. Therefore, (v − projW v) ∈ W.

Suppose that we can write

v=w+w^,wW,w^W.

Then subtracting the above expression from v = projW v + (v − projW v), we get

0=projW v w+v projW v w^

Observe that (projW vw) ∈ W and (v − projWvW^) ∈ W. Therefore,

0=0 , projW v w=projW v w + v projW v w^ , projW v w=projW v w , projW v w.

This implies that projWvw = 0 or, equivalently, w = projW v. Similarly,

0=0 , v projW v w^=projW v w + v projW v w^ , v projW v w^=v projW v w^ , v projW v w^

Therefore, v - projWv - w = 0 or, equivalently, w = v - projW v. This proves that each vV is expressed uniquely as v = projW v + (v - projW v).

Example 4.17

Apply the Gram-Schmidt orthogonalization process to find an orthogonal basis for the subspace U of ℝ4 spanned by

v1=1111,v2=1245,v3=1342.

Therefore, we first set w1= v1. Then we set

w2=v2projw1v2=v2124w1=2112.

Finally, compute

v3projw1v3projw2v3=v3(8)4w1(7)10w2=851710131075

Multiplying the last vector by 10 to clear fractions, we set

w3=16171314

Thus, w1, w2, w3 form an orthogonal basis for U.

Example 4.18

Let V be the vector space of polynomials with inner product

f,g=11f(t)g(t)dt.

Apply the Gram-Schmidt orthogonalization process to {1, t, t2, t3} to find an orthogonal basis for P3.

Here we use the fact that, for r + s = n,

tr , ts=11tndt=tn+1n+1 11=2/(n+1),     when n is even 0,     when n is odd .

We compute

f0(t)=1f1(t)=tprojf0t=t0=tf2(t)=t2projf0t2projf1t2=t213,f3(t)=t3projf0t3projf1t3projf2t3=t335t.

Thus, 1 , t , t2 13 , t3 35 t is the required orthogonal basis.

4.7 Orthogonal projections and minimization

Suppose that U is a subspace of an inner product space V. Then each vector vV can be written uniquely in the form

v = u + w,

where uU and wU. We use this decomposition to define a linear mapping on V, denoted by projU, called the orthogonal projection of V along U. For vV, we define projUv to be the vector u in the decomposition above.

The orthogonal projection along a subspace satisfies the following properties.

Theorem 4.10

Let U is a subspace of an inner product space V. Then,

1. range projU = U

2. ker projU = U

3. v − projU vU for every vV.

4. projU2=projU

5. ∥projU v∥ 6 ∥v∥ for every vV.

Proof. 1. If uU, then u = projUu. Therefore, u ∈ range projU. Conversely, if u ∈ range projU, then by definition, uU. Altogether, we have U ⊆ range projU and range projUU, which implies range projU = U.

2. If uU, then it is expressed uniquely as u = 0+u since it has no component in U other than the zero vector. Then projU u = 0 which means that u ∈ ker projU. Conversely, if u ∈ ker projU then projU u = 0. But u is expressed uniquely as u = 0+w where wU. It follows that uU. Altogether, we have U ⊆ ker projU and ker projUU, which implies ker projU = U.

3. Since v can be expressed as v = u + w where wU and, by definition, u = projU v. It follows that w = v - projU v and, thus, v - projU vU.

4. Consider any vector vV. Then, by the first and second statements above, it can be written as v = projU v + w where w ∈ ker projU. Therefore, applying the orthogonal projection to both sides of this equation, we get

projUv=projU2v+projUw=projU2v

But this is true for any vV. Then, projU2=projU.

5. For every vV, by Pythagoras,

projU v2projU v2+v projU v2=v2.

Taking the positive square root of both sides, we get projU vv.

By the definition of orthogonal projection, if U = Span{u1, u2, …, ur} where the ui form an orthogonal basis, then

projUv=v , u1u1 , u1u1+v , u2u2 , u2u2++v , urur , urur.

The following problem often arises: given a subspace U of V and a vector vV, find a vector uU such that ∥v - u∥ is as small as possible. The next theorem shows that this minimization problem is solved by taking u = projUv.

Theorem 4.11

Suppose that U is a subspace of V and vV. Then

v - projU v∥ ≤ ∥v-u

for every uU. Furthermore, if uU and the inequality above is an equality, then u = projv.

Proof. Suppose that uU. Then

v projU v2v projU v2+projU v u2=v projU v + projU v u2=vu2

where the first equality comes from Pythagoras, which applies because (v - projU v) ∈ U and (projU v - u) ∈ U. Taking the square roots gives the desired inequality, which is an equality if and only if

v projU v2=v projU v2+projU v u2

This happens if and only if ∥projU vu∥ = 0, which happens if and only if u = projv.

Example 4.19

Let V be the vector space of polynomials with inner product

f,g=11f(t)g(t)dt

Then, {1, t} is an orthogonal basis of P1. The polynomial q(t) ∈ P1 such that ∥t2k - q(t)∥ is as small as possible is

q(t)=projp1t2k=12k+1,

and the polynomial r(t) ∈ P1 such that ∥t2k+1 - r(t)∥ is as small as possible is

r(t)=projP1t2k+1=3t2k+3.

4.8 Least-squares problems

Inconsistent systems of equations A x = b arise often in applications. When a solution is demanded and none exists, the best one can do is to find an x that makes A x as close as possible to b. Think of A x as an approximation to b. The smaller the distance between b and A x, given by ∥bA x∥, the better the approximation. The general least-squares problem is to find an x that makes ∥bA x∥ as small as possible.

Definition 4.2

If A is m × n and b is in ℝm, a least-squares solution of A x = b is an x^ in ℝn such that

bAx^bAx

for all x in ℝn.

The most important aspect of the least-squares problem is that no matter what x we select, the vector A x will necessarily be in the column space, Col A. So we seek an x that makes A x the closest point in Col A to b. Of course, if b happens to be in Col A, then b is A x for some x, and such an x is a “least-squares solution.”

Given A and b as above, let

b^=projColAb

where the orthogonal projection of b along Col A is defined with respect to a given inner product. Because b^ is in the column space of A, the equation A x = b^ is consistent, and there is an x^ in ℝn such that

A x^ = b^.

Since b^ is the closest point in Col A to b, a vector x^ is a least-squares solution of A x = b^ if and only if x^ satisfies A x^ = b^, which may have many solutions if the equation has free variables.

Suppose that x^ satisfies Ax^ = b^. The projection xb has the property that bxb is orthogonal to Col A, so bA x^ is orthogonal to each column of A. If aj is any column of A, then ⟨aj, bA x^⟩ = 0, and ajG(bAx^)=0, where G is the Gram matrix relative to an appropriate basis. Since aj is a row of A,

AG(bAx^)=0.

These calculations show that each least-squares solution of A x = b satisfies the equation

AGAx^=AGb

This matrix equation represents a system of equations called the normal equations for A x = b.

Theorem 4.12

The set of least-squares solutions of A x = b coincides with the non empty set of solutions of the normal equations AGAx^=AGb.

Proof. As shown above, the set of least-squares solutions is non empty and each least-squares solution x^ satisfies the normal equations. Conversely, suppose that x^ satisfies A G A x^ = A Gb. Then x^ satisfies A G (b - Ax^) = 0, which shows that b - Ax^ is orthogonal to the rows of A and hence is orthogonal to the columns of A. Since the columns of A span Col A, the vector b - Ax^ is orthogonal to all of Col A. Hence the equation

b=Ax^ + (bAx^)

is the decomposition of b into the sum of a vector in Col A and a vector in (Col A). By the uniqueness of the orthogonal decomposition, Ax^ must be the orthogonal projection of b along Col A. That is, Ax = b and x is a least-squares solution.

Example 4.20

Find the least-squares solution with respect to the usual inner product in ℝ2 of the inconsistent system A x = b for

A=400211,b=2011.

In this case, we may assume that everything is expressed relative to the canonical basis, thus the Gram matrix is the identity matrix I2, so the normal equations read AAx = Ab. To use the normal equations, we compute:

AA=401021400211=17115Ab=4010212011=1911.

The equation AAx = Ab becomes

17115x1x2=1911.

Row operations can be used to solve this system, but since AA is invertible and 2 × 2, it is probably faster to compute

A A1=1845    11    17

and then to solve AA x = Ab as

x^=A A1Ab=12.

In many calculations AA is invertible, but this is not always the case as in the following example.

Example 4.21

Find a least-squares solution relative to the usual inner product of A x = b for

A=1    1    0    01    1    0    01    0    1    01    0    1    01    0    0    11    0    0    1,b=310251.

As in the previous example, the Gram matrix of the inner product relative to the standard basis is the identity matrix. Compute

AA=111111110000001100000011110011001010101010011001=6222220020202002Ab=111111110000001100000011310251=4426.

The augmented matrix for AA x = Ab is

622242200420202200261    0    0    1    30    1    0    1    50    0    1    1    20    0    0    0    0.

So the general least-squares solution of x = b has the form

x^=3520+λ1111.

4.9 Orthogonal diagonalization

Let V be an inner product space. A symmetric linear mapping T : VV relative to an inner product is a linear mapping such that ⟨T (u), v⟩ = ⟨u, T (v)⟩ for all u, vV.

Theorem 4.13

Suppose that T : VV is a symmetric linear mapping. If B = {b1, …, bn} is an orthonormal basis for V and M = (mj,k) is the matrix representation of T relative to B, then M = M.

Proof. Recall that we obtain the k-th column of M by writing T (bk) as a linear combination of the basis B; the scalars used in this linear combination then become the k-th column of M. Since B is orthonormal, we know how to write T (bk) as a linear combination of B:

Tbk=T bk , b1b1++T bk , bnbn.

Thus mj,k = ⟨T (bk), bj⟩. Using the symmetry of T and the symmetry of the inner product, we get

mj,k=T bk , bj=bk , T bj=T bj , bk=mk,j.

Therefore, M = (mj,k) = (mk,j) = M.

One of the most important properties of symmetric linear mappings is stated in the following theorem.

Theorem 4.14

If T : VV is a symmetric linear mapping, then any two eigenvectors from different eigenspaces are orthogonal.

Proof. Let v1 and v2 be eigenvectors that correspond to distinct eigenvalues, say, λ1 and λ2. To show that ⟨v1, v2⟩ = 0, compute

λ1v1 , v2=λ1 v1 , v2=T v1 , v2=v1 , T v2=v1 , λ2 v2=λ2v1 , v2.

Hence (λ1λ2) ⟨v1, v2⟩ = 0. But λ1λ2 ≠ 0 so ⟨v1, v2⟩ = 0.

A linear mapping T : VV is said to be orthogonally diagonalizable if V has an orthonormal basis consisting of eigenvectors of T. The proof of the following theorem is quite involved and is ommitted.

Theorem 4.15

Let V be an inner product space. A linear mapping T : VV is orthogonally diagonalizable if and only if T is symmetric relative to the inner product.

This theorem is rather amazing, because the work in the previous chapter would suggest that it is usually impossible to tell when a linear mapping is diagonalizable. But this is not the case for symmetric matrices.

The next example treats a linear mapping whose eigenvalues are not all distinct.

Example 4.22

Orthogonally diagonalize the linear mapping T : ℝ3 → ℝ3 defined relative to the canonical basis by

T(x)=3    2    42    6    24    2    3x.

The usual calculations produce the characteristic equation

0=λ3+12λ221λ98=(λ7)2(λ+2).

A basis for the eigenspace associated with λ1 = 7 is

v1 = 101 , v2 = 1/210

and a basis for λ2 = -2 is

v3 = 11/21.

Although v1 and v2 are linearly independent, they are not orthogonal. Applying the Gram-Schmidt orthogonalization process and normalization, we obtain the following orthonormal basis for the eigenspace associated with λ1:

u1 = 1/201/2 , u2 = 1/184/181/18.

An orthonormal basis for the eigenspace associated with λ2 :

u3 = 2/31/32/3.

Hence, C = {u1, u2, u3} is an orthonormal basis for R3 and the matrix representation of T relative to C is

7    0    00    7    00    0    2.

An interesting observation is that if P = [u1un] is a square matrix whose columns satisfy uiuj=0 for ij and ujuj=1 (as in the example above), then PP = In. This implies that P-1 = P. Moreover, it is not difficult to verify that P-1 = P if and only if the columns of P satisfy uiuj=0 for ij and ujuj=1.