Section 35 Inner Product Spaces
Focus Questions
By the end of this section, you should be able to give precise and thorough answers to the questions listed below. You may want to keep these questions in mind to focus your thoughts as you complete the section.
What is an inner product space?
What is an orthogonal set in an inner product space?
What is an orthogonal basis for an inner product space?
How do we find the coordinate vector for a vector in an inner product space relative to an orthogonal basis for the space?
What is the projection of a vector orthogonal to a subspace and why are such orthogonal projections important?
Subsection Application: Fourier Series
In calculus, a Taylor polynomial for a function is a polynomial approximation that fits well around the center of the approximation. For this reason, Taylor polynomials are good local approximations, but they are not in general good global approximations. In particular, if a function has periodic behavior it is impossible to model well globally with polynomials that have infinite limits at infinity. For these kinds of functions, trigonometric polynomials are better choices. Trigonometric polynomials lead us to Fourier series, and we will investigate how inner products allow us to use trigonometric polynomials to model musical tones later in this section.
Subsection Introduction
In Section 23 we were introduced to inner products in The concept of an inner product can be extended to vector spaces, as we will see in this section. This will allow us to measure lengths and angles between vectors and define orthogonality in certain vector spaces.
Recall that an inner product on assigns to each pair of vectors and the scalar Thus, an inner product on defines a mapping from to Recall also that an inner product on is commutative, distributes over vector addition, and respects scalar multiplication, and the inner product of a vector in by itself is always non-negative and is equal to 0 only when the vector is the zero vector. We will investigate this ideas in vector spaces in Preview Activity 35.1.
Preview Activity 35.1.
Consider the vector space of polynomials of degree less than or equal to with real coefficients. Define a mapping from to by
(a)
Calculate
(b)
If and are in is it true that
Verify your answer.
(c)
If and are in is it true that
Verify your answer.
(d)
If and are in and is a scalar, is it true that
Verify your answer.
(e)
If is in must it be the case that When is
Subsection Inner Product Spaces
As we saw in Preview Activity 35.1, we can define a mapping from to that has the same properties of inner products on So we can extend the definition of inner product to arbitrary vector spaces.
Definition 35.1.
An inner product on a vector space is a mapping from satisfying
for all and in
for all and in
for all in and all scalars
for all in and if and only if
An inner product space is a vector space on which an inner product is defined.
Activity 35.2.
Consider the mapping from to defined by
(a)
Show that this mapping satisfies the second property of an inner product.
(b)
Although this mapping satisfies the first three properties of an inner product, show that this mapping does not satisfy the fourth property and so is not an inner product.
Since inner products in vector spaces are defined in the same way as inner products in they will satisfy the same properties. Some of these properties are summarized in the following theorem.
Theorem 35.2.
Let be an inner product on and let and be vectors in and a scalar. Then
One special inner product is indicated in Preview Activity 35.1. Recall that is the vector space of continuous functions on the closed interval Let map from to be defined by
The verification that this mapping is an inner product is left to the exercises.
Subsection The Length of a Vector
We can use inner products to define the length of any vector in an inner product space and the distance between two vectors in an inner product space. The idea comes right from the relationship between lengths of vectors in and inner products on (compare to Definition 23.5).
Definition 35.3.
Let be a vector in an inner product space. The length of is the real number
The length of a vector in a vector space is also called magnitude or norm. Just as with inner products on we can use the notion of length to define unit vectors in inner product spaces (compare to Definition 23.7).
Definition 35.4.
A vector in an inner product space is a unit vector if
We can find a unit vector in the direction of a nonzero vector in an inner product space by dividing by the norm of the vector. That is, the vector is a unit vector in the direction of the vector provided that is not zero.
We define the distance between vectors and in an inner product space in the same way we defined distance using the dot product (compare to Definition 23.8).
Definition 35.5.
Let and be vectors in an inner product space. The distance between and is the length of the difference or
Activity 35.3.
The trace (see Definition 19.8) of an matrix is the sum of the diagonal entries of That is,
If and are in the space of matrices with real entries, we define the mapping from to by
This mapping is an inner product on the space called the Frobenius inner product (details are in the exercises). Let and in
(a)
Find the length of the vectors and using the Frobenius inner product.
(b)
Find the distance between and using the Frobenius inner product.
Subsection Orthogonality in Inner Product Spaces
We defined orthogonality in using inner products in (see Definition 23.11) and the angle between vectors. We can extend those ideas to any inner product space.
If and are nonzero vectors in an inner product space, then the angle between and is such that
and This angle is well-defined due to the Cauchy-Schwarz inequality whose proof is left to the exercises.
With the angle between vectors in mind, we can define orthogonal vectors in an inner product space.
Definition 35.6.
Vectors and in an inner product space are orthogonal if
Note that this defines the zero vector to be orthogonal to every vector.
Activity 35.4.
In this activity we use the Frobenius inner product (see Activity 35.3). Let and in
(a)
Find a nonzero vector in orthogonal to
(b)
Find the angle between and
Using orthogonality we can generalize the notions of orthogonal sets and bases, orthonormal bases and orthogonal complements we defined in to all inner product spaces in a natural way.
Subsection Orthogonal and Orthonormal Bases in Inner Product Spaces
As we did with inner products in we define an orthogonal set to be one in which all of the vectors in the set are orthogonal to each other (compare to Definition 24.1).
Definition 35.7.
A subset of an inner product space for which for all in is called an orthogonal set.
As in an orthogonal set of nonzero vectors is always linearly independent. The proof is similar to that of Theorem 24.3 and is left to the exercises.
Theorem 35.8.
Let be a set of nonzero orthogonal vectors in an inner product space. Then the vectors are linearly independent.
A basis that is also an orthogonal set is given a special name (compare to Definition 24.2).
Definition 35.9.
An orthogonal basis for a subspace of an inner product space is a basis of that is also an orthogonal set.
Using inner products in we saw that the representation of a vector as a linear combination of vectors in an orthogonal basis was quite elegant. The same is true in any inner product space. To see this, let be an orthogonal basis for a subspace of an inner product space and let be any vector in We know that
for some scalars If then, using inner product properties and the orthogonality of the vectors we have
So
Thus, we can calculate each weight individually with two simple inner product calculations.
We summarize this discussion in the next theorem (compare to Theorem 24.4).
Theorem 35.10.
Let be an orthogonal basis for a subspace of an inner product space. Let be a vector in Then
Activity 35.5.
Let and be vectors in the inner product space with inner product defined by Let You may assume that is an orthogonal basis for Let Find the weight so that Use technology as appropriate to evaluate any integrals.
The decomposition (35.1) is even simpler if for each Recall that
so the condition implies that the vector has norm 1. As with inner products in an orthogonal basis with this additional condition is given a special name (compare to Definition 24.5).
Definition 35.11.
An orthonormal basis for a subspace of an inner product space is an orthogonal basis such that for
If is an orthonormal basis for a subspace of an inner product space and is a vector in then (35.1) becomes
Recall that we can construct an orthonormal basis from an orthogonal basis by dividing each basis vector by its magnitude.
Subsection Orthogonal Projections onto Subspaces
In Section 25 we saw how to project a vector in onto a subspace of The same process works for vectors in any inner product space.
Definition 35.12.
Let be a subspace of an inner product space and let be an orthogonal basis for For a vector in the orthogonal projection of onto is the vector
The projection of orthogonal to is the vector
The notation indicates that we expect this vector to be orthogonal to every vector in
Activity 35.6.
In Section 25 we showed that in the inner product space using the dot product as inner product, if is a subspace of and is in then is orthogonal to every vector in In this activity we verify that same fact in an inner product space. That is, assume that is an orthogonal basis for a subspace of an inner product space and is a vector in Follow the indicated steps to show that is orthogonal to every vector in
(a)
Let be the projection of onto Write in terms of the basis vectors in
(b)
The vector is the projection of orthogonal to Let be between and Use the result of part (a) to show that is orthogonal to Exercise 16 then shows that is orthogonal to every vector in
Activity 35.6 shows that the vector is orthogonal to vector for So, in fact, is the projection of onto the orthogonal complement of which will be defined shortly.
Subsection Best Approximations in Inner Product Spaces
We have seen, e.g., linear regression to fit a line to a set of data, that we often want to find a vector in a subspace that “best” approximates a given vector in a vector space. As in the projection of a vector onto a subspace has this important property. That is, is the vector in closest to and therefore the best approximation of by a vector in To see that this is true in any inner product space, we first need a generalization of the Pythagorean Theorem that holds in inner product spaces.
Theorem 35.13. Generalized Pythagorean Theorem.
Let and be orthogonal vectors in an inner product space Then
Proof.
Let and be orthogonal vectors in an inner product space Then
Note that replacing with in the theorem also shows that if and are orthogonal.
Now we will prove that the projection of a vector onto a subspace of an inner product space is the best approximation in to the vector
Theorem 35.14.
Let be a subspace of an inner product space and let be a vector in Then
for every vector in different from
Proof.
Let be a subspace of an inner product space and let be a vector in Let be a vector in Now
Since both and are in we know that is in Since is orthogonal to every vector in we have that is orthogonal to We can now use the Generalized Pythagorean Theorem to conclude that
Since it follows that and
Since norms are nonnegative, we can conclude that as desired.
Theorem 35.14 shows that the distance from to is less than the distance from any other vector in to So is the best approximation to of all the vectors in
In using the dot product as inner product, if and then the square of the error in approximating by is given by
So minimizes this sum of squares over all vectors in As a result, we call the least squares approximation to
Activity 35.7.
The set is an orthogonal basis for a subspace of the inner product space using the inner product Find the polynomial in that is closest to the polynomial and give a numeric estimate of how good this approximation is.
Subsection Orthogonal Complements
If we have a set of vectors in an inner product space we can define the orthogonal complement of as we did in (see Definition 23.14).
Definition 35.15.
The orthogonal complement of a subset of an inner product space is the set
As we saw in to show that a vector is in the orthogonal complement of a subspace, it is enough to show that the vector is orthogonal to every vector in a basis for that subspace. The same is true in any inner product space. The proof is left to the exercises.
Theorem 35.16.
Let be a basis for a subspace of an inner product space A vector in is orthogonal to every vector in if and only if is orthogonal to every vector in
Activity 35.8.
Consider with the inner product
(a)
Find where is in
(b)
Describe as best you can the orthogonal complement of in Is in this orthogonal complement? Is
As was the case in give a subspace of an inner product space any vector in can be written uniquely as a sum of a vector in and a vector in
Activity 35.9.
Let be an inner product space of dimension and let be a subspace of Let be any vector in We will demonstrate that can be written uniquely as a sum of a vector in and a vector in
(a)
Explain why is in
(b)
Explain why is in
(c)
Explain why can be written as a sum of vectors, one in and one in
(d)
Now we demonstrate the uniqueness of this decomposition. Suppose and where and are in and and are in Show that and so that the representation of as a sum of a vector in and a vector in is unique. (Hint: What is )
We summarize the result of Activity 35.9.
Theorem 35.17.
Let be a finite dimensional inner product space, and let be a subspace of Any vector in can be written in a unique way as a sum of a vector in and a vector in
Theorem 35.17 is useful in many applications. For example, to compress an image using wavelets, we store the image as a collection of data, then rewrite the data using a succession of subspaces and their orthogonal complements. This new representation allows us to visualize the data in a way that compression is possible.
Subsection Examples
What follows are worked examples that use the concepts from this section.
Example 35.18.
Let be the inner product space with inner product
Let and
(a)
Show that the set is an orthogonal basis for
Solution.
All calculations are done by hand or with a computer algebra system, so we leave those details to the reader.
If we show that the set is an orthogonal set, then Theorem 35.8 shows that is linearly independent. Since the linearly independent set that contains four vectors must be a basis for To determine if the set is an orthogonal set, we must calculate the inner products of pairs of distinct vectors in Since and we conclude that is an orthogonal basis for
(b)
Use 35.10 to write the polynomial as a linear combination of the basis vectors in
Solution.
All calculations are done by hand or with a computer algebra system, so we leave those details to the reader.
We can write the polynomial as a linear combination of the basis vectors in as follows:
Now
so
Example 35.19.
Let be the inner product space with inner product defined by
(a)
Let be the plane spanned by and in Find the vector in that is closest to the vector Exactly how close is your best approximation to the vector
Solution.
The vector we're looking for is the projection of onto the plane. A spanning set for the plane is Neither vector in is a scalar multiple of the other, so is a basis for the plane. Since
the set is an orthogonal basis for the plane. The projection of the vector onto the plane spanned by and is given by
To measure how close close is to we calculate
(b)
Express the vector as the sum of a vector in and a vector orthogonal to
If then is in and
is in and
Subsection Summary
-
An inner product on a vector space is a mapping from satisfying
for all and in
for all and in
for all in and
for all in and if and only if
An inner product space is a pair where is a vector space and is an inner product on
The length of a vector in an inner product space is defined to be the real number
The distance between two vectors and in an inner product space is the scalar
-
The angle between two vectors and is the angle which satisfies and
Two vectors and in an inner product space are orthogonal if
A subset of an inner product space is an orthogonal set if for all in
A basis for a subspace of an inner product space is an orthogonal basis if the basis is also an orthogonal set.
-
Let be an orthogonal basis for a subspace of an inner product space Let be a vector in Then
where
for each
An orthogonal basis for a subspace of an inner product space is an orthonormal basis if for each from 1 to
-
If is an orthogonal basis for and then
-
The projection of the vector in an inner product space onto a subspace of is the vector
where is an orthogonal basis of Projections are important in that is the best approximation of the vector by a vector in in the least squares sense.
-
With as in (a), the projection of orthogonal to is the vector
The norm of provides a measure of how well approximates the vector
-
The orthogonal complement of a subset of an inner product space is the set
Exercises Exercises
1.
Let be the set of all continuous real valued functions on the interval If is in we can extend to a continuous function from to by letting be the function defined by
In this way we can view as a subset of the vector space of all functions from to Verify that is a vector space.
Hint.Use properties of continuous functions.
2.
Use the definition of an inner product to determine which of the following defines an inner product on the indicated space. Verify your answers.
(a)
for and in
(b)
for (where is the vector space of all continuous functions on the interval )
(c)
for (where is the vector space of all differentiable functions on the interval )
(d)
for and an invertible matrix
3.
We can sometimes visualize an inner product in or (or other spaces) by describing the unit circle where
in that inner product space. For example, in the inner product space with the dot product as inner product, the unit circle is just our standard unit circle. Inner products, however, can distort this familiar picture of the unit circle. Describe the points on the unit circle in the inner product space with inner product using the following steps.
(a)
Let Set up an equation in and that is equivalent to the vector equation
(b)
Describe the graph of the equation you found in It should have a familiar form. Draw a picture to illustrate. What do you think of calling this graph a “circle”?
4.
(a)
Show that is an inner product.
(b)
The inner product can be represented as a matrix transformation where and are written as column vectors. Find a matrix that represents this inner product.
5.
This exercise is a generalization of Exercise 4. Define on by
for some positive scalars
(a)
Show that is an inner product.
(b)
The inner product can be represented as a matrix transformation where and are written as column vectors. Find a matrix that represents this inner product.
6.
Is the sum of two inner products on an inner product space an inner product on If yes, prove it. If no, provide a counterexample. (By the sum of inner products we mean a function satisfying
for all and in where and are inner products on )
7.
(a)
Does define an inner product on for every matrix Verify your answer.
(b)
If your answer to part (a) is no, are there any types of matrices for which defines an inner product?
8.
The trace of an matrix has some useful properties.
(a)
Show that for any matrices and
(b)
Show that for any matrix and any scalar
(c)
Show that for any matrix.
9.
Let be an inner product space and be two vectors in
(a)
Check that if the Cauchy-Schwarz inequality
holds.
Hint.Evaluate each side of the inequality.
(b)
Assume Let and Use the fact that to conclude the Cauchy-Schwarz inequality in this case.
Hint.Write as an inner product and expand.
10.
The Frobenius inner product is defined as
for matrices and Verify that defines an inner product on
11.
(a)
Show that if then the Frobenius inner product (see Exercise 10) of and is
Hint.Expand the inner product.
(b)
Extend part (a) to the general case. That is, show that for an arbitrary
Hint.Expand the inner product.
(c)
Compare the Frobenius inner product to the scalar product of two vectors.
Hint.Convert and to vectors in whose entries are the entries in the first row followed by the entries in the second row and so on.
12.
(a)
Show that is an orthogonal basis for using the dot product as inner product.
(b)
Explain why the vector is not in
(c)
Find the vector in that is closest to How close is this vector to
13.
Let be the inner product space with inner product
Let and let in
(a)
Show that is an orthogonal basis for using the given inner product.
(b)
Explain why the vector is not in
Hint.Try to write in terms of the basis vectors for
(c)
Find the vector in that is closest to How close is this vector to
14.
Let be the inner product space with inner product
Let and let in
(a)
Show that is an orthogonal basis for using the given inner product.
(b)
Explain why the polynomial is not in
(c)
Find the vector in that is closest to How close is this vector to
15.
Prove the remaining properties of Theorem 35.2. That is, if is an inner product on a vector space and and are vectors in and is any scalar, then
(a)
(b)
(c)
(d)
16.
Prove the following theorem referenced in Activity 35.6.
Theorem 35.20.
Let be a basis for a subspace of an inner product space A vector in is orthogonal to every vector in if and only if is orthogonal to every vector in
17.
Prove Theorem 35.8.
18.
Let be a vector space with basis Define as follows:
if and in (Since the representation of a vector as a linear combination of basis elements is unique, this mapping is well-defined.) Show that is an inner product on and conclude that any finite dimensional vector space can be made into an inner product space.
19.
Label each of the following statements as True or False. Provide justification for your response.
(a) True/False.
An inner product on a vector space is a function from to the real numbers.
(b) True/False.
If is an inner product on a vector space and if is a vector in then the set is a subspace of
(c) True/False.
There is exactly one inner product on each inner product space.
(d) True/False.
If and are vectors in an inner product space with then
(e) True/False.
If for all vectors in an inner product space then
(f) True/False.
If and are vectors in an inner product space and the distance from to is the same as the distance from to then and are orthogonal.
(g) True/False.
If is a subspace of an inner product space and a vector is orthogonal to every vector in a basis of then is in
(h) True/False.
If is an orthogonal basis for an inner product space then so is for any nonzero scalar
(i) True/False.
An inner product in an inner product space results in another vector in
(j) True/False.
An inner product in an inner product space is a function that maps pairs of vectors in to the set of non-negative real numbers.
(k) True/False.
The vector space of all matrices can be made into an inner product space.
(l) True/False.
Any non-zero multiple of an inner product on space is also an inner product on
(m) True/False.
Every set of non-zero orthogonal vectors in a vector space of dimension is a basis for
(n) True/False.
For any finite-dimensional inner product space and a subspace of is a subspace of
(o) True/False.
If is a subspace of an inner product space, then
Subsection Project: Fourier Series and Musical Tones
Joseph Fourier first studied trigonometric polynomials to understand the flow of heat in metallic plates and rods. The resulting series, called Fourier series, now have applications in a variety of areas including electrical engineering, vibration analysis, acoustics, optics, signal processing, image processing, geology, quantum mechanics, and many more. For our purposes, we will focus on synthesized music.
Pure musical tones are periodic sine waves. Simple electronic circuits can be designed to generate alternating current. Alternating current is current that is periodic, and hence is described by a combination of and for integer values of To synthesize an instrument like a violin, we can project the instrument's tones onto trigonometric polynomials — and then we can produce them electronically. As we will see, these projections are least squares approximations onto certain vector spaces. The website falstad.com/fourier/
provides a tool for hearing sounds digitally created by certain functions. For example, you can listen to the sound generated by a sawtooth function of the form
Try out some of the tones on this website (click on the Sound button to hear the tones). You can also alter the tones by clicking on any one of the white dots and moving it up or down. and play with the buttons. We will learn much about what this website does in this project.
Pure tones are periodic and so are modeled by trigonometric functions. In general, trigonometric polynomials can be used to produce good approximations to periodic phenomena. A trigonometric polynomial is an object of the form
where the and are real constants. With judicious choices of these constants, we can approximate periodic and other behavior with trigonometric polynomials. The first step for us will be to understand the relationships between the summands of these trigonometric polynomials in the inner product space 61 of continuous functions from to with the inner product
Our first order of business is to verify that (35.3) is, in fact, an inner product.
Project Activity 35.10.
Let be the set of continuous real-valued functions on the interval In Exercise 1 in Section 35 we are asked to show that is a vector space, while Exercise 2 in Section 35 asks us to show that defines an inner product on However, (36.2) is slightly different than this inner product. Show that any positive scalar multiple of an inner product is an inner product, and conclude that (35.3) defines an inner product on (We will see why we introduce the factor of later.)
Now we return to our inner product space with inner product (35.3). Given a function in we approximate using only a finite number of the terms in a trigonometric polynomial. Let be the subspace of spanned by the functions
One thing we need to know is the dimension of
Project Activity 35.11.
We start with the initial case of
(a)
Show directly that the functions and are orthogonal.
(b)
What is the dimension of Explain.
Now we need to see if what happened in Project Activity 35.11 happens in general. A few tables of integrals and some basic facts from trigonometry can help.
Project Activity 35.12.
A table of integrals shows the following for (up to a constant):
(a)
Use (35.4) to show that and are orthogonal in if
(b)
Use (35.5) to show that and are orthogonal in if
(c)
Use (35.6) to show that and are orthogonal in if
(d)
Use (35.7) to show that and are orthogonal in
(e)
What is Explain.
Once we have an orthogonal basis for we might want to create an orthonormal basis for Throughout the remainder of this project, unless otherwise specified, you should use a table of integrals or any appropriate technological tool to find integrals for any functions you need.
Project Activity 35.13.
Show that the set
is an orthonormal basis for Use the fact that the norm of a vector in an inner product space with inner product is defined to be (This is where the factor of will be helpful.)
Now we need to recall how to find the best approximation to a vector by a vector in a subspace, and apply that idea to approximate an arbitrary function with a trigonometric polynomial in Recall that the best approximation of a function in is the projection of onto If we have an orthonormal basis of then the projection of onto is
With this idea, we can find formulas for the coefficients when we project an arbitrary function onto
Project Activity 35.14.
If is an arbitrary function in we will write the projection of onto as
The and are the Fourier coefficients for The expression is called the th harmonic of The first harmonic is called the fundamental frequency. The human ear cannot hear tones whose frequencies exceed 20000 Hz, so we only hear finitely many harmonics (the projections onto for some ).
(a)
Show that
Explain why gives the average value of on You may want to go back and review average value from calculus. This is saying that the best constant approximation of on is its average value, which makes sense.
(b)
Show that for
(c)
Show that for
Let us return to the sawtooth function defined earlier and find its Fourier coefficients.
Project Activity 35.15.
Let be defined by on and repeated periodically afterwards with period Let be the projection of onto
(a)
Evaluate the integrals to find the projection
(b)
Use appropriate technology to find the projections and for the sawtooth function Draw pictures of these approximations against and explain what you see.
(c)
Now we find formulas for all the Fourier coefficients. Use the fact that is an odd function to explain why for each Then show that for each
(d)
Go back to the website falstad.com/fourier/
and replay the sawtooth tone. Explain what the white buttons represent.
Project Activity 35.16.
This activity is not connected to the idea of musical tones, so can be safely ignored if so desired. We conclude with a derivation of a very fascinating formula that you may have seen for To do so, we need to analyze the error in approximating a function with a function in
Let be the projection of onto Notice that is also in It is beyond the scope of this project, but in “nice” situations we have as Now is orthogonal to so the Pythagorean theorem shows that
Since as we can conclude that
We use these ideas to derive a formula for
(a)
Use the fact that is an orthonormal basis to show that
Conclude that
(b)
For the remainder of this activity, let be the sawtooth function defined by on and repeated periodically afterwards. We determined the Fourier coefficients and of this function in Project Activity 35.15.
(i)
Show that
(ii)
Calculate using the inner product and compare to (35.12) to find a surprising formula for
With suitable adjustments, we can work over any interval that is convenient, but for the sake of simplicity in this project, we will restrict ourselves to the interval