11.2  Orthonormal Bases and Gram–Schmidt

A basis lets us write every vector in coordinates, but finding those coordinates costs work: in Definition 1.5.2 the scalars a1,…,an come from solving a linear system. In an inner product space one kind of basis makes that cost disappear. If the basis vectors are mutually orthogonal unit vectors, then the i-th coordinate of v is just ⟨v,ei⟩, one inner product, computed without reference to the others. This section defines such bases, shows that every finite-dimensional inner product space has one, and gives the algorithm that produces them.

11.2.1. Orthonormal lists

The standard basis of Rn has two features beyond being a basis: distinct vectors are orthogonal, and each has length 1. The two conditions can be packed into a single formula using the Kronecker delta δij, which is 1 when i=j and 0 otherwise.

An orthonormal list is a list of unit vectors that are pairwise perpendicular.

Definition 11.2.1 (Orthonormal List)

Let V be an inner product space. A list (e1,…,ek) of vectors of V is orthonormal if ⟨ei,ej⟩=δijfor all i,j∈{1,…,k}, that is, if ⟨ei,ej⟩=0 whenever i≠j (orthogonal) and ‖ei‖=1 for every i (normalized).

In words: the single equation ⟨ei,ej⟩=δij carries two conditions at once, because the case i≠j says the vectors are orthogonal and the case i=j says ‖ei‖2=1. The list must be ordered, as every list in this book is, but nothing in the definition depends on the order. Note that no vector of an orthonormal list is 0, since ‖0‖=0≠1; so by Theorem 11.1.4, every orthonormal list is linearly independent. That single sentence is why orthonormality is so useful: independence, which normally takes an argument, comes for free.

Definition 11.2.2 (Orthonormal Basis)

An orthonormal basis of an inner product space V is an orthonormal list that is a basis of V.

Examples.

  • The standard basis. In Fn with the standard inner product, ⟨ei,ej⟩=δij by inspection. This is the model, and the notation ei is deliberately reused for orthonormal vectors in a general space.
  • A rotated basis of R2. The list (12(1,1), 12(1,−1)) is orthonormal: the inner product of the two vectors is 12(1−1)=0, and each has norm 122=1. Geometrically it is the standard basis turned through π/4.
  • A basis of R3. The columns of 13(12221−22−21) form an orthonormal list: each has norm 131+4+4=1, and the three pairwise inner products are 19(2+2−4), 19(2−4+2) and 19(4−2−2), all 0. Being independent and of length 3=dim⁡R3, it is a basis (Theorem 1.6.4 (a)).
  • Matrix units. In Mm×n(F) with the Frobenius inner product, the matrix units Eij satisfy ⟨Eij,Epq⟩=1 if (i,j)=(p,q) and 0 otherwise, since only one entry of each is nonzero. So the standard basis of Mm×n(F) is orthonormal.
  • The Lagrange basis. On F[x]≤n with the node inner product ⟨p,q⟩=∑i=0np(ci)q(ci)― of the previous section, the Lagrange polynomials ℓ0,…,ℓn of Definition 6.6.1 vanish at every node but their own, where they take the value 1; that is, ℓi(cj)=δij. Hence ⟨ℓi,ℓj⟩=∑kℓi(ck)ℓj(ck)―=δij: the Lagrange basis is an orthonormal basis for this inner product. An interpolation formula and an orthonormal expansion turn out to be the same statement.
  • The degenerate case. The empty list is orthonormal, vacuously, and it is an orthonormal basis of V={0}. This is not a joke: it is the base case of every induction below.

Nonexample by minimal change. In R2, the list ((1,1),(1,−1)) is orthogonal, and it is a basis. It is not orthonormal, because ‖(1,1)‖=2≠1. The failure is only in the normalization, and it is repaired by dividing each vector by its norm, which changes neither the spans nor the orthogonality (Theorem 11.1.2 (b)). Scaling is always available; orthogonality is the real content.

11.2.2. Coordinates in an orthonormal basis

Here is the payoff promised in the opening.

Theorem 11.2.1 (Coordinates, Inner Products, and Norms in an Orthonormal Basis)

Let (e1,…,en) be an orthonormal basis of an inner product space V, and let u,v∈V. Then:

  • (a) v=∑i=1n⟨v,ei⟩ei;
  • (b) ⟨u,v⟩=∑i=1n⟨u,ei⟩⟨v,ei⟩―;
  • (c) ‖v‖2=∑i=1n|⟨v,ei⟩|2 (Parseval’s identity for a finite orthonormal basis).

Idea. For (a) we already know that v=∑aiei for unique scalars ai; the only question is what they are. Pair both sides with ej: orthonormality kills every term except the j-th, and that one survives with coefficient 1. Parts (b) and (c) then follow by expanding, since the coordinates are now known.

Proof.

  • (a) Since (e1,…,en) is a basis, Theorem 1.5.1 gives scalars a1,…,an∈F with v=∑iaiei. Fix j. Pairing with ej and using (IP1), ⟨v,ej⟩=∑i=1nai⟨ei,ej⟩=∑i=1naiδij=aj, by Definition 11.2.1. So aj=⟨v,ej⟩ for every j, which is (a).

  • (b) Write u=∑i⟨u,ei⟩ei and v=∑j⟨v,ej⟩ej by (a). Expanding the first slot with (IP1) and the second with Theorem 11.1.1 (b), ⟨u,v⟩=∑i∑j⟨u,ei⟩⟨v,ej⟩―⟨ei,ej⟩. Only the terms with i=j survive, and there ⟨ei,ei⟩=1. This is (b).

  • (c) Take u=v in (b): the i-th term becomes ⟨v,ei⟩⟨v,ei⟩―=|⟨v,ei⟩|2 by Theorem 0.6.2 (c), and the left side is ‖v‖2.

Read (b) again: in the coordinates supplied by an orthonormal basis, every inner product becomes the standard inner product of Fn. So an orthonormal basis does not merely simplify coordinates; it turns an abstract inner product space into Fn with the dot product. We record that as a corollary below, and use it repeatedly: to make an abstract statement concrete, fix an orthonormal basis.

Example (Reading Off Coordinates)

Let e1=13(1,2,2), e2=13(2,1,−2), e3=13(2,−2,1), the orthonormal basis of R3 found above. Write v=(3,0,3) in this basis, and check Parseval’s identity.

Solution. By Theorem 11.2.1 (a), the coordinates are ⟨v,e1⟩=13(3+0+6)=3,⟨v,e2⟩=13(6+0−6)=0,⟨v,e3⟩=13(6+0+3)=3, so v=3e1+0e2+3e3. No system was solved. Checking directly, 3e1+3e3=(1,2,2)+(2,−2,1)=(3,0,3). For Parseval, ‖v‖2=9+0+9=18, and indeed 32+02+32=18.

Quick check. With the same e1,e2,e3, find the coordinates of v=(1,1,1) and verify Parseval’s identity.

Solution. ⟨v,e1⟩=13(1+2+2)=53, ⟨v,e2⟩=13(2+1−2)=13, ⟨v,e3⟩=13(2−2+1)=13. Then 259+19+19=279=3=‖v‖2, as Parseval requires.

11.2.3. The Gram–Schmidt process

Everything so far assumed that an orthonormal basis was handed to us. Does one always exist? The answer is yes in finite dimension, and the proof is an algorithm that we will use constantly.

The idea comes from a picture in R3. Given independent v1,v2, normalize v1 to get e1. The vector v2 is generally not perpendicular to e1; but its “shadow” on the line through e1 is the multiple ⟨v2,e1⟩e1, and subtracting the shadow leaves a vector w2 perpendicular to e1. Normalize it. Then repeat with v3, subtracting its shadows on both e1 and e2.

Diagram. Labels: mathbf v_1, mathbf v_2, langle mathbf v_2, mathbf e_1 rangle mathbf e_1, mathbf w_2 = mathbf v_2 - langle mathbf v_2, mathbf e_1 rangle mathbf e_1, mathbf e_1

Project, subtract, normalize. The right angle at the foot is the only thing that has to be checked, and one line of algebra checks it.

Theorem 11.2.2 (Gram–Schmidt Process)

Let V be an inner product space and let (v1,…,vm) be a linearly independent list in V. Define recursively wk=vk−∑i=1k−1⟨vk,ei⟩ei,ek=wk‖wk‖(k=1,…,m). Then every wk is nonzero, so the recursion is defined, and:

  • (a) (e1,…,em) is an orthonormal list;
  • (b) span(e1,…,ek)=span(v1,…,vk) for every k=1,…,m;
  • (c) if (v1,…,vr) is already orthonormal for some r≤m, then ei=vi for i≤r.

In particular, every finite-dimensional inner product space has an orthonormal basis.

Idea. Induction on k. Hypothesis: (e1,…,ek) is orthonormal and spans span(v1,…,vk). Two things need care. First, wk≠0: if it were 0, then vk would lie in span(e1,…,ek−1)=span(v1,…,vk−1), contradicting independence. That is the only place independence is used, and it is used exactly there. Second, wk⊥ej for j<k: pair and watch the sum collapse.

Proof. We prove by induction on k that wk≠0, that (e1,…,ek) is orthonormal, and that span(e1,…,ek)=span(v1,…,vk).

Base case k=1. The empty sum is 0, so w1=v1, which is nonzero because a list containing 0 is dependent. Then e1=v1/‖v1‖ has norm 1 by Theorem 11.1.2 (b), and span(e1)=span(v1) since each vector is a nonzero multiple of the other.

Induction step. Let 2≤k≤m and suppose the claim holds for k−1. Put U=span(e1,…,ek−1)=span(v1,…,vk−1).

First, wk≠0. If wk=0, then vk=∑i<k⟨vk,ei⟩ei∈U=span(v1,…,vk−1), so vk would be a linear combination of the earlier vi, making (v1,…,vm) dependent, contrary to hypothesis. Hence ‖wk‖>0 and ek is defined, with ‖ek‖=1.

Next, ek⊥ej for every j<k. By (IP1) and the induction hypothesis ⟨ei,ej⟩=δij, ⟨wk,ej⟩=⟨vk,ej⟩−∑i=1k−1⟨vk,ei⟩δij=⟨vk,ej⟩−⟨vk,ej⟩=0, and ek is a scalar multiple of wk, so ⟨ek,ej⟩=0 as well. Together with the induction hypothesis, (e1,…,ek) is orthonormal, which is (a).

For (b), ek is a linear combination of vk and e1,…,ek−1, hence lies in span(v1,…,vk) by the induction hypothesis; so span(e1,…,ek)⊆span(v1,…,vk). Conversely vk=‖wk‖ek+∑i<k⟨vk,ei⟩ei∈span(e1,…,ek), and the earlier vi lie there by the induction hypothesis. The two spans are equal, completing the induction.

For (c), suppose (v1,…,vr) is orthonormal and that ei=vi for all i<k, where k≤r. Then ⟨vk,ei⟩=⟨vk,vi⟩=0 for i<k, so wk=vk and ‖wk‖=1, giving ek=vk. Induction on k proves (c).

Finally, let V be finite-dimensional. If V={0}, the empty list is an orthonormal basis. Otherwise take any basis (v1,…,vn) of V and apply the process: by (a) the output is orthonormal, and by (b) it spans span(v1,…,vn)=V, so it is an orthonormal basis.

Two remarks on the formulas. The vector subtracted from vk is exactly the expansion of vk in the orthonormal basis (e1,…,ek−1) of U, which by Theorem 11.2.1 (a) is the best available “copy of vk inside U”; the next section will call it the orthogonal projection of vk onto U. And the subtraction is the same move that produced the vector z in the proof of Theorem 11.1.5. Project, then subtract is one move used twice.

Corollary 11.2.3 (Extending an Orthonormal List)

Let V be a finite-dimensional inner product space and let (e1,…,er) be an orthonormal list in V. Then there are vectors er+1,…,en∈V such that (e1,…,en) is an orthonormal basis of V.

Proof. The list (e1,…,er) is linearly independent by Theorem 11.1.4, since its vectors are orthogonal and nonzero. By Theorem 1.6.5 there are vr+1,…,vn∈V making (e1,…,er,vr+1,…,vn) a basis of V. Apply Theorem 11.2.2 to that basis. By part (c) the first r output vectors are e1,…,er unchanged, and by (a) and (b) the whole output is an orthonormal basis of V.

11.2.4. Two worked examples

Example (Gram–Schmidt in R3)

Apply the Gram–Schmidt process of Theorem 11.2.2 to v1=(1,1,1), v2=(0,1,1), v3=(0,0,1) in R3 with the dot product.

Solution. Step 1. ‖v1‖2=3, so e1=13(1,1,1).

Step 2. ⟨v2,e1⟩=13(0+1+1)=23, so w2=(0,1,1)−23(1,1,1)=13(−2,1,1). Then ‖w2‖2=19(4+1+1)=23, and e2=16(−2,1,1).

Step 3. ⟨v3,e1⟩=13 and ⟨v3,e2⟩=16, so w3=(0,0,1)−13(1,1,1)−16(−2,1,1)=(0,−12,12). Then ‖w3‖2=12 and e3=12(0,−1,1).

Check. The three vectors have norm 1, and ⟨e1,e2⟩=118(−2+1+1)=0, ⟨e1,e3⟩=16(0−1+1)=0, ⟨e2,e3⟩=112(0−1+1)=0. The span condition is visible too: e1 is a multiple of v1, and e2 is a combination of v1 and v2.

The next example runs the same three steps in a function space, where no picture is available and only the algebra is left.

Example (Gram–Schmidt on 1,x,x2)

Apply the Gram–Schmidt process of Theorem 11.2.2 to (1,x,x2) in R[x]≤2 with ⟨p,q⟩=∫−11p(t)q(t)dt.

Solution. Step 1. ‖1‖2=∫−111dt=2, so e1=1/2.

Step 2. ⟨x,e1⟩=12∫−11tdt=0, since the integrand is odd. So w2=x, and ‖x‖2=∫−11t2dt=23, giving e2=3/2x.

Step 3. ⟨x2,e1⟩=12⋅23 and ⟨x2,e2⟩=3/2∫−11t3dt=0, again by oddness. Hence w3=x2−12⋅23⋅12=x2−13. Its squared norm is ∫−11(t2−13)2dt=25−49+29=845, so e3=104(3x2−1).

The monic polynomials produced along the way are 1, x, and x2−13. These are, up to scaling, the first three Legendre polynomials; the usual normalization takes P2=12(3x2−1)=32(x2−13), fixed by the convention Pk(1)=1 rather than by the norm. Section 10 of this chapter takes up such families in general.

Notice how much work the oddness of the integrand did: two of the three inner products were 0 before any computation. Symmetry of the weight is worth looking for.

Warning. Gram–Schmidt depends on the order of the list. Run the process on ((0,1),(1,1)) in R2: it returns ((0,1),(1,0)). Run it on ((1,1),(0,1)), the same two vectors in the other order: it returns (12(1,1),12(−1,1)). Both outputs are orthonormal bases of R2, and they are different. An orthonormal basis is never unique (for dim⁡V≥1 one can always replace e1 by −e1); the process returns an orthonormal basis adapted to the given order, not the orthonormal basis.

Quick check. Run Gram–Schmidt on ((1,0),(1,1)) in R2, and then on ((1,1),(1,0)). Do you get the same list?

Solution. First order: e1=(1,0); ⟨(1,1),e1⟩=1, so w2=(1,1)−(1,0)=(0,1) and e2=(0,1). Output ((1,0),(0,1)).

Second order: e1=12(1,1); ⟨(1,0),e1⟩=12, so w2=(1,0)−12(1,1)=12(1,−1) and e2=12(1,−1). Output (12(1,1),12(1,−1)). Not the same list, and not even the same set of lines.

Warning. The classical process is numerically fragile. Computed with rounding, the vectors e1,e2,… drift out of orthogonality, and the drift grows with k and with how nearly dependent the input list is. Nothing above is wrong — the fault is in the arithmetic, not the mathematics — but in practice one uses a rearranged version or reflections instead. Section 8 of this chapter gives the reflection-based method, and Chapter 24 explains why it is the stable one.

11.2.5. All inner product spaces of the same dimension look alike

Corollary 11.2.4 (Classification of Finite-Dimensional Inner Product Spaces)

Let V be an inner product space over F with dim⁡V=n. Then there is an isomorphism T:V→Fn with ⟨Tu,Tv⟩=⟨u,v⟩for all u,v∈V, where the right-hand inner product is that of V and the left-hand one is the standard inner product of Fn. An isomorphism with this property is an isometric isomorphism, so every n-dimensional inner product space over F is isometrically isomorphic to Fn.

Proof. By Theorem 11.2.2, V has an orthonormal basis E=(e1,…,en). Let T:V→Fn be the coordinate map Tv=[v]E, an isomorphism by Corollary 2.5.5. By Theorem 11.2.1 (a), the i-th entry of Tv is ⟨v,ei⟩. Hence the standard inner product of Tu and Tv in Fn is ∑i⟨u,ei⟩⟨v,ei⟩―, which equals ⟨u,v⟩ by Theorem 11.2.1 (b).

So dimension is a complete invariant of finite-dimensional inner product spaces over a fixed field: there is nothing to classify. This should be compared with Theorem 2.5.4, which said the same for vector spaces; adding an inner product adds no new invariant. What becomes interesting is the interaction of the inner product with a given operator, and that is the subject of Chapter 12. Isometries in general are the subject of Section 7 of this chapter.

11.2.6. Gram matrices

Given a list of vectors, all of its inner products can be collected into one matrix, and that matrix turns out to answer questions about the list.

Definition 11.2.3 (Gram Matrix)

Let (v1,…,vk) be a list in an inner product space V over F. Its Gram matrix is G∈Mk(F) with entries (G)ij=⟨vj,vi⟩(1≤i,j≤k).

The order of the subscripts looks backwards and is chosen on purpose: it makes G act on coefficient vectors the right way round, as part (b) below shows. For a real list the distinction disappears, since then ⟨vj,vi⟩=⟨vi,vj⟩.

For example, the Gram matrix of ((1,1,0),(1,0,1),(0,1,1)) in R3 is (211121112), with the squared norms on the diagonal.

Over C the order of the subscripts becomes visible. For v1=(1,0) and v2=(i,1) in C2, the off-diagonal entries are (G)12=⟨v2,v1⟩=i,(G)21=⟨v1,v2⟩=i―=−i, so G=(1i−i2), which is Hermitian but not symmetric. Part (b) below says x∗Gx=‖x1v1+x2v2‖2; with x=(1,1) both sides are 3, since v1+v2=(1+i,1). Writing (G)ij=⟨vi,vj⟩ instead would transpose G and leave that identity reading x∗G⊤x.

Theorem 11.2.5 (Properties of the Gram Matrix)

Let (v1,…,vk) be a list in an inner product space V over F, with Gram matrix G. Then:

  • (a) G is Hermitian, G∗=G, and its diagonal entries are the real numbers ‖vi‖2≥0;
  • (b) x∗Gx=‖∑jxjvj‖2 for every x∈Fk;
  • (c) G is invertible if and only if (v1,…,vk) is linearly independent;
  • (d) detG is a real number with detG≥0, and detG>0 exactly when the list is linearly independent.

Idea. Part (b) is the whole theorem: the quadratic expression x∗Gx is a squared length, so it vanishes only for the coefficient vectors of genuine dependence relations. That identifies nul(G) with the set of dependence relations and gives (c) at once. For (d), fix an orthonormal basis of the span and write G=A∗A for a coordinate matrix A; a determinant of that shape is a squared modulus.

Proof.

  • (a) By (IP2), (G∗)ij=(G)ji―=⟨vi,vj⟩―=⟨vj,vi⟩=(G)ij. The diagonal entries are ⟨vi,vi⟩=‖vi‖2, real and ≥0 by Theorem 11.1.1 (a).

  • (b) Write u=∑jxjvj. Expanding by (IP1) and Theorem 11.1.1 (b), ‖u‖2=∑i∑jxjxi―⟨vj,vi⟩=∑ixi―∑j(G)ijxj, and the right-hand side is exactly the entry of the 1×1 matrix x∗Gx.

  • (c) We show nul(G)={x∈Fk:∑jxjvj=0}. If ∑jxjvj=0, then for each i, (Gx)i=∑j⟨vj,vi⟩xj=⟨∑jxjvj,vi⟩=0 by (IP1), so Gx=0. Conversely, if Gx=0, then x∗Gx=0, so ‖∑jxjvj‖=0 by (b) and hence ∑jxjvj=0 by Theorem 11.1.2 (a). Now G is invertible if and only if Gx=0 forces x=0 (Theorem 3.4.4, (a) ⇔ (b)), which by the displayed equality of sets says exactly that the only dependence relation among the vj is the trivial one.

  • (d) Let U=span(v1,…,vk), let r=dim⁡U, and let (e1,…,er) be an orthonormal basis of U, which exists by Theorem 11.2.2. Let A∈Mr×k(F) have as its j-th column the coordinate vector of vj, so that vj=∑papjep. By Theorem 11.2.1 (b), (G)ij=⟨vj,vi⟩=∑p=1rapjapi―=(A∗A)ij, so G=A∗A.

If the list is dependent, then G is singular by (c) and detG=0. If it is independent, then r=k and A is square. By Theorem 7.4.5, det(A∗)=det(A―), and det(A―)=detA―, because by the Leibniz formula (Theorem 7.4.3) the determinant is a sum of products of entries and conjugation preserves sums and products (Theorem 0.6.2). Hence, by Theorem 7.5.4, detG=det(A∗)det(A)=detA―detA=|detA|2. This is real and ≥0, and it is >0 because A is the matrix of an isomorphism onto its coordinates, hence invertible with detA≠0 (Theorem 7.5.2).

Over R, with V=Rn and the dot product, part (d) is the statement Chapter 7 reached from Cauchy–Binet: Corollary 7.7.3 says that det(AA⊤)≥0 for a real A, with equality exactly when the rows of A are dependent. Taking the rows of A to be v1,…,vk makes AA⊤ the Gram matrix, so that corollary is the special case of (d) in which the ambient space is Rn. The pointer left there is now paid: a Gram matrix is exactly a matrix of pairwise inner products, and its determinant is nonnegative for that reason.

Example (Deciding Independence with a Gram Matrix)

Decide whether ((1,1,0),(1,0,1),(0,1,−1)) is independent in R3, using its Gram matrix.

Solution. The pairwise dot products give G=(21112−11−12), and expanding along the first row, detG=2(4−1)−1(2+1)+1(−1−2)=6−3−3=0. By Theorem 11.2.5 (d) the list is dependent. Indeed Gx=0 for x=(1,−1,−1), and Theorem 11.2.5 (c) says this is a dependence relation: (1,1,0)−(1,0,1)−(0,1,−1)=0.

Two features of this method are worth noting. It never needs coordinates in the ambient space, so it works verbatim for polynomials and functions, where writing the vectors as columns is not an option. And the answer comes with a witness: a null vector of G is a dependence relation, ready to read off.

11.2.7. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define an orthonormal list, using the Kronecker delta, and say what an orthonormal basis is.
  • (b) Why is every orthonormal list linearly independent? Name the result used.
  • (c) Write down the coordinates of v in an orthonormal basis (e1,…,en), and state Parseval’s identity.
  • (d) True or false: the Gram–Schmidt process (Theorem 11.2.2) applied to a list and to the same list in reverse order produces the same orthonormal list. Justify your answer.
  • (e) State the criterion for linear independence in terms of the Gram matrix.
  • (f) True or false: every 3-dimensional real inner product space is isometrically isomorphic to R3 with the dot product. Justify your answer.

Solution.

  • (a) A list (e1,…,ek) with ⟨ei,ej⟩=δij for all i,j (Definition 11.2.1); an orthonormal basis is such a list that is also a basis (Definition 11.2.2).

  • (b) Its vectors are pairwise orthogonal and nonzero (each has norm 1), so Theorem 11.1.4 applies.

  • (c) v=∑i⟨v,ei⟩ei, and ‖v‖2=∑i|⟨v,ei⟩|2 (Theorem 11.2.1).

  • (d) False. On ((0,1),(1,1)) the process returns ((0,1),(1,0)), while on ((1,1),(0,1)) it returns (12(1,1),12(−1,1)).

  • (e) The list is independent if and only if its Gram matrix is invertible, if and only if detG>0 (Theorem 11.2.5 (c), (d)).

  • (f) True. By Corollary 11.2.4, the coordinate map with respect to any orthonormal basis is an isometric isomorphism onto R3.

B. Practice

Exercise (B1: Gram–Schmidt with numbers)

Apply the Gram–Schmidt process of Theorem 11.2.2 to each list, with the dot product.

  • (a) ((1,0,1),(1,1,0),(0,1,1)) in R3.
  • (b) ((1,1,0,0),(1,0,1,0),(0,0,1,1)) in R4.

Solution.

  • (a) ‖(1,0,1)‖2=2, so e1=12(1,0,1). Next ⟨(1,1,0),e1⟩=12, so w2=(1,1,0)−12(1,0,1)=12(1,2,−1), with ‖w2‖2=14⋅6=32, giving e2=16(1,2,−1). Finally ⟨(0,1,1),e1⟩=12 and ⟨(0,1,1),e2⟩=16, so w3=(0,1,1)−12(1,0,1)−16(1,2,−1)=23(−1,1,1), with ‖w3‖2=49⋅3=43, giving e3=13(−1,1,1).

  • (b) e1=12(1,1,0,0). Then ⟨(1,0,1,0),e1⟩=12, so w2=(1,0,1,0)−12(1,1,0,0)=12(1,−1,2,0), with ‖w2‖2=14⋅6=32 and e2=16(1,−1,2,0). Finally ⟨(0,0,1,1),e1⟩=0 and ⟨(0,0,1,1),e2⟩=26, so w3=(0,0,1,1)−13(1,−1,2,0)=13(−1,1,1,3), with ‖w3‖2=19⋅12=43 and e3=123(−1,1,1,3).

Exercise (B2: Gram–Schmidt on polynomials)

In R[x]≤2 with ⟨p,q⟩=∫01p(t)q(t)dt, apply the Gram–Schmidt process of Theorem 11.2.2 to (1,x,x2). Compare the monic outputs with those of Example (Gram–Schmidt on 1,x,x2) and explain the difference.

Solution. ‖1‖2=1, so e1=1. Then ⟨x,1⟩=∫01tdt=12, so w2=x−12 and ‖w2‖2=∫01(t−12)2dt=13−12+14=112, giving e2=3(2x−1). Next ⟨x2,e1⟩=13 and ⟨x2,e2⟩=3∫01(2t3−t2)dt=3(12−13)=36, so w3=x2−13−36⋅3(2x−1)=x2−x+16. Its squared norm is ∫01(t2−t+16)2dt=1180, so e3=5(6x2−6x+1).

The monic outputs are 1, x−12, x2−x+16, whereas on [−1,1] they were 1, x, x2−13. Orthogonality is a property of the inner product, not of the polynomials: changing the interval changes which polynomials are orthogonal. These are the shifted Legendre polynomials, and the substitution t↦2t−1 carries one family to the other.

Exercise (B3: Coordinates without solving a system)

Let e1=13(1,2,2), e2=13(2,1,−2), e3=13(2,−2,1) in R3.

  • (a) Write v=(1,−1,4) in this basis.
  • (b) Compute ‖v‖2 in two ways, and state which theorem says the answers agree.
  • (c) Compute ⟨v,u⟩ for u=(3,0,3) from the coordinates of v and u, using Example (Reading Off Coordinates) for u.

Solution.

  • (a) ⟨v,e1⟩=13(1−2+8)=73, ⟨v,e2⟩=13(2−1−8)=−73, ⟨v,e3⟩=13(2+2+4)=83. So v=73e1−73e2+83e3.

  • (b) Directly, ‖v‖2=1+1+16=18. From the coordinates, 499+499+649=1629=18. They agree by Theorem 11.2.1 (c).

  • (c) The coordinates of u are (3,0,3) by Example (Reading Off Coordinates), so by Theorem 11.2.1 (b), ⟨v,u⟩=73⋅3+(−73)⋅0+83⋅3=7+8=15. Directly, ⟨v,u⟩=3+0+12=15.

Exercise (B4: Gram matrices)

For each list, write down the Gram matrix and use it to decide whether the list is independent.

  • (a) ((1,1,0),(1,0,1),(0,1,1)) in R3 with the dot product.
  • (b) ((1,i),(i,1)) in C2 with the standard inner product.
  • (c) (1,x,x2−13) in R[x]≤2 with ⟨p,q⟩=∫−11pq.

Solution.

  • (a) G=(211121112), and expanding along the first row, detG=2(4−1)−1(2−1)+1(1−2)=6−1−1=4>0. By Theorem 11.2.5 (d) the list is independent.

  • (b) ⟨(1,i),(1,i)⟩=1+1=2 and ⟨(i,1),(1,i)⟩=i1―+1i―=i−i=0, so G=2I2 by Theorem 11.2.5 (a). Then detG=4>0 and the list is independent; in fact it is orthogonal, so Theorem 11.1.4 already gives the answer.

  • (c) These are the monic outputs of Example (Gram–Schmidt on 1,x,x2), so they are pairwise orthogonal, and G=diag(2,23,845). Its determinant is 2⋅23⋅845=32135>0, so the list is independent. A Gram matrix is diagonal exactly when the list is orthogonal.

C. Going deeper

Exercise (C1: The Gram matrix determines the list)

Let (v1,…,vk) be a list in an inner product space V and (w1,…,wk) a list in an inner product space W, both over F, with the same Gram matrix: ⟨vj,vi⟩=⟨wj,wi⟩ for all i,j.

  • (a) Prove that ∑jxjvj=0 if and only if ∑jxjwj=0, for every x∈Fk.
  • (b) Deduce that there is an isomorphism T:span(v1,…,vk)→span(w1,…,wk), well defined by Tvj=wj for every j.
  • (c) Prove that T is an isometric isomorphism, that is, ⟨Tu,Tu′⟩=⟨u,u′⟩ for all u,u′ in the domain.

Solution.

  • (a) Let G be the common Gram matrix. By Theorem 11.2.5 (b), ‖∑jxjvj‖2=x∗Gx=‖∑jxjwj‖2. By Theorem 11.1.2 (a), one side is 0 if and only if the other is, and a norm is 0 only at the zero vector.

  • (b) Every element of U=span(v1,…,vk) is ∑jxjvj for some x. Define T(∑jxjvj)=∑jxjwj. This is well defined: if ∑jxjvj=∑jyjvj, then ∑j(xj−yj)vj=0, so ∑j(xj−yj)wj=0 by (a), that is ∑jxjwj=∑jyjwj. It is linear because the formula is linear in x, it is surjective onto span(w1,…,wk) by construction, and it is injective: if T(∑xjvj)=0, then ∑xjwj=0, so ∑xjvj=0 by (a).

  • (c) Let u=∑jxjvj and u′=∑iyivi. Expanding by (IP1) and Theorem 11.1.1 (b), ⟨u,u′⟩=∑i∑jxjyi―⟨vj,vi⟩, and the same computation in W gives ⟨Tu,Tu′⟩=∑i∑jxjyi―⟨wj,wi⟩. The two sums are equal term by term, since the Gram matrices agree.

Exercise (C2: Gram–Schmidt on a dependent list)

Let (v1,…,vm) be a list in an inner product space, not assumed independent, and run the recursion of Theorem 11.2.2.

  • (a) Let k be the smallest index with vk∈span(v1,…,vk−1). Prove that the recursion is defined up to ek−1 and that wk=0, so the step ek=wk/‖wk‖ fails.
  • (b) Repair the process: show that if, whenever wk=0, we discard vk and continue with vk+1, the output is an orthonormal basis of span(v1,…,vm).
  • (c) Run the repaired process on ((1,1,0),(2,2,0),(1,0,1)) in R3.

Solution.

  • (a) The list (v1,…,vk−1) is independent, since a dependence among its members would, by Theorem 1.4.1, put some vj with j<k in the span of its predecessors, contradicting the minimality of k. So Theorem 11.2.2 applies to it and produces e1,…,ek−1 with span(e1,…,ek−1)=span(v1,…,vk−1)=:U. Since vk∈U, Theorem 11.2.1 (a) applied inside U gives vk=∑i<k⟨vk,ei⟩ei, which is precisely the vector subtracted, so wk=0. Dividing by ‖wk‖=0 is impossible.

  • (b) Let e1,…,es be the vectors that the repaired process outputs. The proof of Theorem 11.2.2 shows, unchanged, that after processing v1,…,vk the accumulated list is orthonormal and spans span(v1,…,vk): the only step that used independence was the claim wk≠0, and in the repaired process a step with wk=0 discards a vk that lies in the span already built, so the span does not change. Taking k=m, the output is an orthonormal list spanning span(v1,…,vm), hence an orthonormal basis of it.

  • (c) e1=12(1,1,0). For v2=(2,2,0): ⟨v2,e1⟩=42=22, so w2=(2,2,0)−22⋅12(1,1,0)=0, and v2 is discarded. For v3=(1,0,1): ⟨v3,e1⟩=12, so w3=(1,0,1)−12(1,1,0)=12(1,−1,2), with ‖w3‖2=64=32 and e2=16(1,−1,2). The output (12(1,1,0),16(1,−1,2)) is an orthonormal basis of the plane spanned by the three given vectors.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.