Gram-Schmidt Orthogonalization

In Orthogonality and Projections we said that a set of nonzero vectors in is called an orthogonal set if for all . In this section we will prove that every orthogonal set is linearly independent, and therefore it is a basis for its span. We have already seen that the expansion of a vector as a linear combination of orthogonal basis vectors is easy to obtain because formulas exist for the coefficients. Hence the orthogonal bases are the “nice” bases. Our next task is to show that every subspace of has an orthogonal basis. We will start with intuitive explorations in lower dimensions, then proceed to formalize our results for subspaces of .

A Visual Guide to Creating an Orthogonal Basis

Given an arbitrary basis of , let’s start building our orthogonal basis, , by setting . To find the next element of our orthogonal basis, consider the orthogonal projection of onto . (See the figure below.)

Next, let . Observe that is orthogonal to (See Theorem th:orthDecompX of Orthogonality and Projections). This gives us an orthogonal collection . It is intuitively clear that and are linearly independent. Therefore is an orthogonal basis of .

The following exploration illustrates this process dynamically.

Choose an arbitrary basis of by dragging the tips of vectors and to desired positions. Use the navigation bar at the bottom of the interactive window to go through the steps of constructing an orthogonal basis of .

We can apply this process to any two-dimensional subset of . The following exploration will guide you through the process of constructing an orthogonal basis for a plane spanned by two arbitrary vectors in .

Let . is a plane through the origin in . Use the navigation bar at the bottom of the interactive window to go through the steps of constructing an orthogonal basis for . RIGHT-CLICK and DRAG to rotate the image for a better view.

In the next exploration, we take the process of constructing an orthogonal basis to the edge of the visual realm and construct an orthogonal basis for .

In the GeoGebra interactive below is a basis of . Use check boxes to go through the steps for constructing an orthogonal basis starting with the given basis. RIGHT-CLICK and DRAG to rotate the image for a better view.

Gram-Schmidt Orthogonalization Algorithm

In Orthogonality and Projections we have repeatedly assumed that our subspaces of have an orthogonal basis. We will now prove that this is indeed the case. Recall that to be a basis of a subspace, a set of vectors must be linearly independent and it must span the subspace. We will start by demonstrating that a set of orthogonal vectors must be linearly independent.

Proof
To show that this set is linearly independent, we need to demonstrate that the only solution to the following equation is the trivial solution. To accomplish this, we need to show that all for all . To do so we take the dot product of each side of the above equation with the vector and obtain the following.
Now since the set is orthogonal, for all , so we have:

We know that , so it follows that . Since was chosen arbitrarily, for all . This proves that is linearly independent.

The following theorem shows how to start with an arbitrary basis of a subspace of and find an orthogonal basis for . To better understand the notation and the process presented in this theorem, you may want to match the steps of the theorem to the steps of Exploration exp:orth3.

Proof
Using the definition of projection onto a subspace, the iterative procedure above may be written: We see immediately that and that because is a linear combination of and . In fact, for any value of , we see that , because each is a linear combination of the vectors .

Repeated application of Corollary cor:orthProjOntoW shows that the set is orthogonal. Linear independence follows from orthogonality by Theorem orthbasis.

We conclude that is a linearly independent orthogonal set that spans .

The Gram-Schmidt algorithm demonstrates in a constructive way that every subspace of has an orthogonal basis. We formalize this in one final theorem.

Proof
Suppose is an orthogonal subset of . If , it is already a basis. Otherwise, there exists in outside . Using the Gram-Schmidt procedure we define , where . If , we are done. Otherwise, the process continues to create larger and larger orthogonal subsets of . They are all linearly independent by Theorem th:GS, so we have a basis when we reach a subset containing vectors.

The process described in the proof of this theorem is used in this final example.

Practice Problems

Try Example ex:GSextend again starting with some other vector .

Problems GS1-GS4

In each case, use the Gram-Schmidt algorithm to convert the given basis of to an orthogonal basis.

,
,
,
,

Text Source

This section was adapted from the first part of Section 8.1 of Keith Nicholson’s Linear Algebra with Applications. (CC-BY-NC-SA)

W. Keith Nicholson, Linear Algebra with Applications, Lyryx 2018, Open Edition, p. 415