17. Inner product spaces
Definition 17.1. Let V be a real vector space. An inner product on V is a function
h , i : V × V −→ R, which is
• symmetric, that is
hu, vi = hv, ui.
• bilinear, that is linear (in both factors):
hλu, vi = λhu, vi, for all scalars λ and
hu
1+ u
2, vi = hu
1, vi + hu
2, vi, for all vectors u
1, u
2and v.
• positive that is
hv, vi ≥ 0.
• non-degenerate that is if hu, vi = 0 for every v ∈ V then u = 0.
We say that V is a real inner product space. The associated quadratic form is the function
Q : V −→ R, defined by
Q(v) = hv, vi.
Example 17.2. Let A ∈ M
n,n(R) be a real matrix. We can define a function
h , i : R
n× R
n−→ R, by the rule
hu, vi = u
tAv.
The basic rules of matrix multiplication imply that this function is bi- linear. Note that the entries of A are given by
a
ij= e
tiAe
j= he
i, e
ji.
In particular, it is symmetric if and only if A is symmetric that is A
t= A. It is non-degenerate if and only if A is invertible, that is A has rank n. Positivity is a little harder to characterise.
Perhaps the canonical example is to take A = I
n. In this case if u = (r
1, r
2, . . . , r
n) and v = (s
1, s
2, . . . , s
n) then u
tI
nv = P r
is
i. Note
1
that if we take u = v then we get P r
i2. The square root of this is the Euclidean distance.
Definition 17.3. Let V be a real vector space. A norm on V is a function
k.k : V −→ R, what has the following properties
•
kkvk = |k|kvk, for all vectors v and scalars k.
• positive that is
kvk ≥ 0.
• non-degenerate that is if kvk = 0 then v = 0.
• satisfies the triangle inequality, that is ku + vk ≤ kuk + kvk.
Lemma 17.4. Let V be a real inner product space.
Then
k.k : V −→ R, defined by
kvk = phv, vi, is a norm on V .
Proof. It is clear that the norm satisfies the first property and that it is positive. Suppose that u ∈ V . By assumption there is a vector v such that
hu, vi 6= 0.
Consider
0 ≤ hu + tv, u + tvi
= hu, ui + 2thu, vi + t
2hv, vi.
If hv, vi = 0 then certainly hu, ui > 0. Otherwise put t = − hu, vi
hv, vi > 0.
Then
hu, ui + 2thu, vi + t
2hv, vi = hu, ui + thu, vi.
Once again
hu, ui > (hu, vi)
2hv, vi > 0.
Thus the norm is non-degenerate.
Now suppose that u and v ∈ V . Then
hu + v, u + vi = hu, ui + 2hu, vi + hv, vi
≤ kuk
2+ 2kuk · kvk + kvk
2= (kuk + kvk)
2.
Taking square roots gives the triangle inequality. Note that one can recover the inner product from the norm, using the formula
2hu, vi = Q(u + v) − Q(u) − Q(v),
where Q is the associated quadratic form. Note the annoying ap- pearence of the factor of 2.
Notice also that on the way we proved:
Lemma 17.5 (Cauchy-Schwarz-Bunjakowski). Let V be a real inner product space.
If u and v ∈ V then
hu, vi ≤ kuk · kvk.
Definition 17.6. Let V be a real vector space with an inner product.
We say that two vectors v and w are orthogonal if hu, vi = 0.
We say that a basis v
1, v
2, . . . , v
nis an orthogonal basis if the vectors v
1, v
2, . . . , v
nare pairwise orthogonal. If in addition the vectors v
ihave length one, we say that v
1, v
2, . . . , v
nis an orthonormal basis.
Lemma 17.7. Let V be a real inner product space.
(1) If the vectors v
1, v
2, . . . , v
mare pairwise orthogonal then they are independent. In particular if m = dim V then v
1, v
2, . . . , v
mare an orthogonal basis of V .
(2) If v
1, v
2, . . . , v
nare an orthonormal basis of V and v ∈ V then v = X
r
iv
i, where
r
i= hv, v
ii.
3
Proof. We first prove (1). Suppose that
r
1v
1+ r
2v
2+ · · · + r
mv
m= 0.
Taking the inner product of both sides with v
jgives 0 = hr
1v
1+ r
2v
2+ · · · + r
mv
m, v
ji
=
m
X
i=1
r
ihv
i, v
ji
= r
jhv
j, v
ji.
As
hv
j, v
ji 6= 0, it follows that r
j= 0. This is (1).
The proof of (2) is similar.
So how does one find an orthonormal basis?
Algorithm 17.8 (Gram-Schmidt). Let v
1, v
2, . . . , v
nbe independent vectors in a real inner product space V .
(1) Let 1 ≤ k ≤ n be the largest index such that v
1, v
2, . . . , v
kare orthonormal.
(2) If k = m then stop.
(3) Otherwise let
u
k+1= v
k+1− r
1v
1− r
2v
2− · · · − r
mv
m, where r
i= hv
k+1, v
ii. Replace v
k+1by
u
k+1ku
k+1k , and return to (1).
In practice the algorithm works as follows. First we replace v
1by v
1kv
1k ,
so that v
1has unit length. Then we consider v
2. We have to subtract some of v
1to ensure that it is orthogonal to v
1. So consider a vector of the form
u = v
2+ λv
1,
where λ is chosen to make u orthogonal to v
1. We have 0 = hu, v
1i = hv
2, v
1i + λhv
1, v
1i, so that
λ = −hv
2, v
1i.
Then we rescale to get a vector of unit length. At the next stage, we can choose λ and µ so that
v
3+ λv
1+ µv
2,
is orthogonal v
1and v
2. The key thing is that since v
1and v
2are orthogonal, our choice of λ and µ are independent of each other.
For example, consider the vectors
v
1= (1, −1, 1), v
2= (1, 0, 1) and v
3= (1, 1, 2), in R
3with the usual inner product. The first step is to replace v
1by
v
1= 1
√ 3 (1, −1, 1).
Now let
u = (1, 0, 1) − 2
3 (1, −1, 1)
= 1
3 (1, 2, 1).
Then we replace u by a vector parallel to u of unit length v
2= 1
√ 6 (1, 2, 1).
Finally we put
u = (1, 1, 2) − 2
3 (1, −1, 1) − 5
6 (1, 2, 1)
= 1
2 (−1, 0, 1).
Finally we replace u by a vector of unit length, v
3= 1
√ 2 (−1, 0, 1).
Thus v
1= 1
√ 3 (1, −1, 1) v
2= 1
√ 6 (1, 2, 1) and v
3= 1
√ 2 (−1, 0, 1), is the orthonormal basis produced by Gram-Schmidt.
One very useful property of inner products is that we get canonically defined complimentary linear subspaces:
Lemma 17.9. Let V be a finite dimensional real inner product space.
If U ⊂ V is a linear subspace, then let
U
⊥= { w ∈ V | hw, ui = 0, ∀u ∈ U },
the set of all vectors orthogonal to every element of U . Then
5