Lecture 45 · Week 12· 17:14
Inner product spaces
Inner products on Rn, Cn, polynomials and functions; norms.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Today: lengths and angles in every vector space
Welcome to week twelve. In lecture four, the dot product gave us lengths, distances and angles in R n. Today we bring that geometry to every vector space. Recall the dot product. u dot v is the sum of the products of matching entries, and the length of v is the square root of v dot v. In lecture four, we proved four rules of the dot product: symmetry, additivity, homogeneity and positivity. Every fact about lengths that followed, even the Cauchy Schwarz inequality, used only these four rules, never the formula itself.
And since lecture twenty one, polynomials and functions are vectors too. So we can ask: how long is the polynomial x squared? What is the angle between sine and cosine? Here is the plan. First, the definition of an inner product, with examples in R n and C n. Then inner products of polynomials and functions. Then norms and orthogonality. Then the Cauchy Schwarz inequality, with a proof that works everywhere. And finally, the triangle inequality and angles.
Inner products
Throughout, the field F is the real numbers or the complex numbers. An inner product on a vector space V assigns to each pair of vectors u and v a scalar, written u comma v in angle brackets. We read it as the inner product of u and v. It must satisfy four rules. First, additivity in the first slot: the inner product of u plus v with w splits into the inner product of u and w, plus the inner product of v and w. Second, homogeneity in the first slot: the inner product of c u with w is c times the inner product of u and w. The scalar comes out in front.
Third, conjugate symmetry: swapping the two vectors gives the complex conjugate. And fourth, positivity: the inner product of a nonzero vector with itself is positive. A vector space with an inner product is an inner product space. Over the real numbers, the conjugate does nothing, and rule c is plain symmetry. Over the complex numbers, rule c with v equal to u says that the inner product of u with itself equals its own conjugate. So it is a real number, and rule d can compare it with zero. The first example is the dot product on R n. The four rules of lecture four give the four rules of an inner product, and the card shows which rule gives which. We call it the standard inner product on R n.
But a space can carry other inner products. On R two, take two u one v one, plus three u two v two. Each term is linear in u, and swapping u and v changes nothing. The inner product of v with itself is two v one squared, plus three v two squared, which is positive unless v is zero. Take the vector v equal to (one, one). With the new inner product, v with itself is two times one times one, plus three times one times one, which is five. With the dot product, it is one plus one, which is two. So the length of a vector depends on the inner product we choose. The weights must be positive. With u one v one, minus u two v two, the first three rules still hold. But the vector e two, which is (zero, one), gives zero minus one, which is minus one. Positivity fails, so this formula is not an inner product.
The standard inner product on C n
Now C n. Here the dot product formula breaks. Take u equal to (one, i), which is not zero. Yet u one times u one, plus u two times u two, is one plus i squared, which is zero. Positivity fails. The cure is the modulus. For a complex number z, z times z bar is the modulus of z, squared, a real number that is never negative. So on C n, we conjugate the entries of the second vector. The inner product of u and v is u one times v one bar, plus and so on, up to u n times v n bar. Each term is linear in u, which gives rules a and b. Conjugating the sum conjugates each term, and gives the inner product of v and u, which is rule c. And the inner product of v with itself is the sum of the squared moduli of its entries, which is positive unless v is zero.
This is the standard inner product on C n. For real vectors, the bars do nothing, and it is the dot product again. Let's try it, with u equal to (one, i), and v equal to (i, two). The inner product of u and v is one times i bar, which is minus i, plus i times two bar, which is two i. The total is i. In the other order, we get i times one bar, which is i, plus two times i bar, which is minus two i. The total is minus i, the conjugate of i, as rule c requires.
And the inner product of u with itself is the modulus of one, squared, plus the modulus of i, squared, which is two. For v, it is one plus four, which is five. In the second slot, the rules change a little. The inner product is still additive there, but a scalar c comes out as its conjugate, c bar. And the zero vector has inner product zero with every vector. The proofs move to the first slot and back. By rule c, the inner product of u and c v is the conjugate of the inner product of c v and u. There c comes out, and the conjugate of a product is the product of the conjugates. That gives c bar times the conjugate of v with u, which is c bar times the inner product of u and v.
Additivity in the second slot is proved the same way. The zero vector is zero times itself, so homogeneity takes that zero out of the first slot. And over the real numbers, the bar does nothing: a real inner product is linear in each slot.
Polynomials and functions
Now polynomials. On P n of R, the real polynomials of degree at most n, define the inner product of p and q as the integral from minus one to one of p of x times q of x. The first three rules come from the integral. The integral of a sum is the sum of the integrals, constants come out, and p times q is q times p. Positivity needs one fact from calculus. If a continuous function h is never negative on an interval, and its integral there is zero, then h is zero at every point of the interval.
Here is why. If h were positive at one point, it would stay above half that value on a small interval around the point. That gives a rectangle of positive area under the graph, so the integral would be positive. Apply the fact to h equal to p squared, which is never negative. If the integral of p squared were zero, p would be zero at every point between minus one and one. But a nonzero polynomial has only finitely many roots. So for p not zero, the integral is positive. Let's compute some values. The inner product of one with one is the integral of one from minus one to one, which is two. One with x is the integral of x, which is zero: the area above the axis cancels the area below.
x with x, and also one with x squared, are both the integral of x squared, which is two thirds. x with x squared is the integral of x cubed, which is zero again. And x squared with itself is the integral of x to the fourth, which is two fifths. The same works for functions. C of a b is the space of continuous real functions on the interval from a to b. On it, the inner product of f and g is the integral from a to b of f of x times g of x. Positivity follows from the same fact, with h equal to f squared. Take the interval from minus pi to pi. There, sine times cosine is an odd function: its graph has as much area below the axis as above. So the inner product of sine and cosine is zero.
And sine with itself is the integral of sine squared. Sine squared splits into one half, minus one half cosine of two x. The cosine part integrates to zero, and the one half gives pi. In the same way, cosine with itself is pi.
Norm, distance and orthogonality
Every inner product gives a length. The norm of v is the square root of the inner product of v with itself. It exists, since that number is real and never negative. The distance between u and v is the norm of u minus v. And a unit vector is a vector of norm one. For the dot product on R n, these are the norm, the distance and the unit vectors of lecture four. The norm behaves like a length. It is never negative, and it is zero only for the zero vector. The norm of c v is the modulus of c, times the norm of v. And dividing a nonzero vector by its norm gives a unit vector.
For the second rule, c comes out of the first slot as c, and out of the second slot as c bar. So the inner product of c v with itself is c c bar, times v with v, which is the modulus of c, squared, times the norm of v, squared. Take square roots. Three norms from our examples. In C two, the norm of u is the square root of two. In P two of R, the norm of x is the square root of two thirds. And on the interval from minus pi to pi, the norm of sine is the square root of pi. And a distance. The distance from x to x squared, squared, expands into x with x, minus twice x with x squared, plus x squared with itself. That is two thirds, minus zero, plus two fifths, so the distance is the square root of sixteen fifteenths.
Two vectors are orthogonal if their inner product is zero. With our integral, one is orthogonal to x, and x is orthogonal to x squared, but one is not orthogonal to x squared. And sine is orthogonal to cosine. Orthogonality depends on the inner product. For the weighted inner product, the vectors (one, one), and (three, minus two), are orthogonal: two times three, plus three times minus two, is zero. But their dot product is three minus two, which is one. Pythagoras holds in every inner product space. Expand the inner product of u plus v with itself. It splits into u with u, plus u with v, plus v with u, plus v with v.
If u and v are orthogonal, the two middle terms are zero. Then the norm of u plus v, squared, is the norm of u, squared, plus the norm of v, squared. For sine and cosine, Pythagoras gives pi plus pi, which is two pi. Directly, sine plus cosine, squared, is one plus two sine cosine, and its integral is two pi plus zero. The same answer.
The Cauchy–Schwarz inequality
Now the central theorem, the Cauchy Schwarz inequality. In every inner product space, the modulus of the inner product of u and v is at most the norm of u times the norm of v. Equality holds exactly when the list u, v is linearly dependent, that is, when one vector is a multiple of the other. In lecture four, we proved this in R n with a quadratic and its discriminant. That proof needs real numbers. Here is a proof that works in every inner product space. It is the heart of this lecture and it is demanding, so take it slowly, and pause whenever you need to. If u is zero, both sides are zero: equality, and the list is dependent. So let u be nonzero. The idea is to split v into a part along u, and a part orthogonal to u. In the next lecture, the part along u gets a name: the orthogonal projection of v onto u.
Let c be the inner product of v and u, divided by the inner product of u with itself, and let w be v minus c u. Then w with u is v with u, minus c times u with u. Now put in c: in its place goes v with u, over u with u. The u with u in the bottom cancels the u with u beside it. That leaves v with u, minus v with u, which is zero. So w is orthogonal to u, and so to c u. Now v is c u plus w, two orthogonal parts. By Pythagoras, the norm of v, squared, is the norm of c u, squared, plus the norm of w, squared. Dropping the norm of w, squared, can only make it smaller. So the norm of v, squared, is at least the modulus of c, squared, times the norm of u, squared. Put in c. Since v with u is the conjugate of u with v, the two have the same modulus. We get the modulus of u with v, squared, divided by the norm of u, squared.
Multiply by the norm of u, squared, and take square roots. That is the inequality. Equality holds exactly when the norm of w is zero, that is, when v is c times u. And if v is any multiple of u, then w is a multiple of u that is orthogonal to u, so w is zero. In the picture, the hypotenuse v is never shorter than the leg c u. One theorem, many inequalities. For our vectors u and v in C two, it says that the modulus of i, which is one, is at most root two times root five. In C of a b, it says that the square of the integral of f g is at most the integral of f squared, times the integral of g squared.
And for the polynomials one and x squared, the inner product is two thirds, while the norms multiply to the square root of two, times the square root of two fifths. That is two over root five, about zero point eight nine. The inequality is strict, since x squared is not a multiple of one.
The triangle inequality and angles
Cauchy Schwarz gives the triangle inequality: the norm of u plus v is at most the norm of u, plus the norm of v. Write z for the inner product of u and v. By Pythagoras, the norm of u plus v, squared, is the norm of u, squared, plus z plus z bar, plus the norm of v, squared. Now z plus z bar is twice the real part of z, which is at most twice the modulus of z. By Cauchy Schwarz, that is at most twice the norm of u times the norm of v. So the whole is at most the square of the norm of u plus the norm of v.
Both sides are non-negative, so taking square roots keeps the inequality. For distances, write u minus w as u minus v, plus v minus w. Then the distance from u to w is at most the distance from u to v, plus the distance from v to w. In a real inner product space, Cauchy Schwarz puts the inner product of u and v, divided by the product of the norms, between minus one and one. So it is the cosine of exactly one angle theta between zero and pi. That is the angle between u and v. The angle is a right angle exactly when u and v are orthogonal. It is zero or pi exactly when v is a positive or a negative multiple of u.
For one and x squared, the cosine is two thirds, divided by two over root five, which is root five over three, about zero point seven four five. The angle is about forty one point eight degrees. And one and x make a right angle.
Try it yourself
You can try this yourself, on this lecture's page at Open Semester dot com. On the left are two vectors, u and v, in R two. The dashed curve holds the vectors of norm one. With the dot product, u is (one, one), and v is (three, minus two). Their inner product is one, so they are not orthogonal. And the dashed curve is the unit circle. Now choose the weighted inner product of example ten point one point three. The arrows stay where they are, but the inner product of u and v is now zero, so they are orthogonal. And the dashed curve becomes an ellipse.
Drag v onto the line through u. The bar fills up: the inner product equals the product of the norms, which Cauchy Schwarz allows only for multiples. Try your own weights and vectors, and watch the lengths, the angles and the right angles change with the inner product.
To sum up
Let's sum up. An inner product is linear in the first slot, conjugate symmetric, and positive. Examples are the dot product on R n, the standard inner product on C n, and integrals of products of polynomials or functions. Every inner product gives a norm, a distance and orthogonality. Pythagoras, Cauchy Schwarz and the triangle inequality hold in every inner product space, and over the real numbers they give angles. Before the next lecture, read section ten point one of the course book, try problems one to three on sheet twelve about inner products, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we use orthogonality to find the closest point of a subspace: orthogonal projections. See you there.
In this lecture
Materials
Try it
Lengths and angles depend on the inner product
Drag the coral u and the blue v, and pick an inner product au1v1 + bu2v2 with positive weights a, b. The dashed curve holds the vectors of norm 1 for that inner product. The arrows stay the same, but their lengths, their angle and whether they are orthogonal all change with the inner product. The bar shows |⟨u, v⟩| inside ‖u‖ ‖v‖: it fills up only when one vector is a multiple of the other.
Check yourself
3 questions, from warm-up to stretch
Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.
- Question 1 of 3 Warm-up
In with the standard inner product (Example 10.1.4), let and . Write and find and . Then find .
Hint 1 of 2
The conjugate goes on the entries of the second vector: . And .
Hint 2 of 2
and . For the norm, , with .
Worked solution
- . So and .
- , so .
- Check: , the conjugate of , as conjugate symmetry says.
- Question 2 of 3 Core
In with (Example 10.1.6), let and . Find and . Then find the number for which is orthogonal to , as in the proof of the Cauchy–Schwarz inequality. Type fractions as, for example, 5/3.
Hint 1 of 2
Multiply out first: and . On , , and .
Hint 2 of 2
In the proof of Cauchy–Schwarz, makes orthogonal to . Here and .
Worked solution
- .
- .
- , which is exactly when . (Over , .)
- Check: , and .
- Question 3 of 3 Stretch
On take the weighted inner product (Example 10.1.3). Let and . Find so that . For that , find . Is that also orthogonal to for the dot product?
Hint 1 of 2
. Set it equal to . For the norm, add the vectors first and use the same weights.
Hint 2 of 2
gives , and . You can check the answer with Pythagoras: it should be .
Worked solution
- , which is exactly when . So .
- , so .
- Pythagoras (Theorem 10.1.12) agrees: and , and .
- For the dot product, , so the answer is No: orthogonality depends on the inner product.
How did it go?