Wav Lectures
Wav Lectures
2 Subspaces 7
2.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Lines through the origin as subspaces of R2 . . . . . . . . . . . 8
2.3 A subset of R2 that is not a subspace . . . . . . . . . . . . . . 9
2.4 Subspaces of R3 . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4.1 Planes containing the origin . . . . . . . . . . . . . . . 10
2.5 Summary of subspaces of R3 . . . . . . . . . . . . . . . . . . . 11
2.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
iii
iv CONTENTS
4 Linear Maps 21
4.1 Two Important Examples . . . . . . . . . . . . . . . . . . . . 21
4.1.1 The Integral . . . . . . . . . . . . . . . . . . . . . . . . 21
4.1.2 The Derivative . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Linear Maps from Rn to Rm . . . . . . . . . . . . . . . . . . . 22
4.2.1 Lemma . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.2.2 A Counterexample . . . . . . . . . . . . . . . . . . . . 24
4.2.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5 Inner Product 27
7 Gram-Schmidt Orthogonalization 43
7.1 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.3 Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
8 Orthogonal Projections 47
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
8.2 w ∈ W is closest to v iff v − w ⊥ W . . . . . . . . . . . . . . 47
8.2.1 Construction of w . . . . . . . . . . . . . . . . . . . . . 49
8.3 The main theorem . . . . . . . . . . . . . . . . . . . . . . . . 50
8.4 Orthogonal projections . . . . . . . . . . . . . . . . . . . . . . 51
8.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.6 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
1.1 Definition
Definition 1. A vector space over R is a nonempty set V of objects,
called vectors, on which are defined two operations, called addition + and
multiplication by scalars · , satisfying the following properties:
A1 (Closure of addition)
For all u, v ∈ V, u + v is defined and u + v ∈ V .
M2 (Multiplication by 1)
1 · u = u for all u ∈ V .
1
2 LECTURE 1. VECTOR SPACES OVER R
1.2 Examples
Before examining the axioms in more detail, let us discuss two examples.
Example.
LetV = Rn ,considered as column vectors
x1
x2
Rn = { .. |x1 , x2 , . . . , xn ∈ R} Then for
.
xn
x1 y1
u = ... , v = .. ∈ Rn and r ∈ R :
.
xn yn
Define
x1 + y1 rx1
u+v =
..
and r · u = ...
.
xn + yn rxn
Note
that
the zero
vector and
the additive inverse of u are given by:
0 −x1
~0 = . −u = ...
.. ,
0 −x2
Remark. Rn can also be considered as the space of all row vectors.
Rn = {(x1 , . . . , xn ) | x1 , . . . , xn ∈ R}
Solution.
Remark. (a) The zero element is the function ~0 which associates to each x
the number 0:
~0(x) = 0 for all x ∈ [0, 1)
0 : x 7→ ~0
Proof
(f + 0)(x) = f (x) + 0(x)
= f (x) + ~0 = f (x)
Remark.
(b) Here we prove that + is associative:
Proof. Let f, g, h ∈ V A . Then
[(f + g) + h](x) = (f + g)(x) + h(x)
= (f (x) + g(x)) + h(x)
= f (x) + (g(x) + h(x)) associativity in V
= f (x) + (g + h)(x)
= [f + (g + h)](x)
6 LECTURE 1. VECTOR SPACES OVER R
1.3 Exercises
Let V = R4 . Evaluate the following:
Subspaces
A1 (Commutativity of addition)
For u, v ∈ W , we have u + v = v + u. This is because u, v are also in
V and commutativity holds in V .
7
8 LECTURE 2. SUBSPACES
One can check that the other axioms follow in the same way.
2.1 Examples
Usually the situation is that we are given a vector space V and a subset of
vectors W satisfying some conditions and we need to see if W is a subspace
of V .
W = {v ∈ V : some conditions on v}
V = R2 ,
W = {(x, y)|y = kx} for a given k
= line through (0, 0) with slope k.
and
u + v = (x1 + x2 , y1 + y2 )
= (x1 + x2 , kx1 + kx2 )
= (x1 + x2 , k(x1 + x2 )) ∈ W
1. {0}
3. R2
This is why a line not passing through (0, 0) can not be a subspace of R2 .
W = {(x, y)|x2 − y 2 = 0}
Is W a subspace of R2 ? Why?
We have (1, 1) and (1, −1) ∈ W but (1, 1) + (1, −1) = (2, 0) ∈
/ W . i.e., W is
not closed under addition.
2.4 Subspaces of R3
What are the subspaces of R3 ?
1. {0} and R3 .
or
p=0
Then we have
and
2.6 Exercises
Determine whether the given subset of Rn is a subspace or not (Explain):
a) W = {(x, y) ∈ R2 | xy = 0}.
b) W = {(x, y, z) ∈ R3 | 3x + 2y 2 + z = 0}.
c) W = {(x, y, z) ∈ R3 | 2x + 3y − z = 0}.
2x3 = x1 − 10x2 .
13
14 LECTURE 3. VECTOR SPACES OF FUNCTIONS
x 7→ f 0 (x)
Therefore,
f (x0 + h) − f (x0 )
lim
h→0 h
does not exist.
We have
C r (I) $ C r−1 (I) ( · · · $ C 1 (I) $ C(I).
2
f 0 (x) = 35 x 3
which is continuous.
10 − 31
f 00 (x) = 3 x
16 LECTURE 3. VECTOR SPACES OF FUNCTIONS
3r−1
f (x) = x 3
f + g and rf (r ∈ R)
are piecewise-continuous.
We will work a lot with indicator functions so let us look at some of their
properties.
• x∈
/ A, then χA (x) = 0, so χA (x)χB (x) = 0.
• x∈
/ B, then χB (x) = 0, so χA (x)χB (x) = 0.
It follows that
0 = χA∩B (x) = χA (x)χB (x)
18 LECTURE 3. VECTOR SPACES OF FUNCTIONS
• If x ∈
/ A ∪ B, then x ∈
/ A and x ∈
/ B. Thus the LHS (left hand side) and the
RHS (right hand side) are both zero.
• If x ∈ A ∪ B then either
Now, what if A ∩ B 6= ∅?
Lemma. χA∪B (x) = χA (x) + χB (x) − χA∩B (x).
Proof.
• If x ∈
/ A ∪ B, then both of the LHS and the RHS take the value 0.
1. If x ∈ A, x ∈/ B, then
χA∪B (x) = 1
χA (x) + χB (x) − χA∩B = 1 + 0 − 0 = 1
2. Similarly for the case x ∈ B, x ∈
/ A: LHS equals the RHS.
3.6. EXERCISE 19
3. If x ∈ A ∩ B, then
χA∪B (x) = 1
χA (x) + χB (x) − χA∩B = 1 + 1 − 1 = 1
As we have checked all possibilities, we have shown that the statement in the
lemma is correct
3.6 Exercise
Write the product
Linear Maps
We have all seen linear maps before. In fact, most of the maps we have been
using in Calculus are linear.
Z 1 Z 1 Z 1
2 2
x + 3x − cos x dx = x dx + 3 x dx
−1 −1 −1
Z 1
− cos x dx
−1
1 1
1 3 3
= x + x2 − [sin x]1−1
3 −1 2 −1
2
= − sin 1 + sin(−1).
3
What we have used is the fact that the integral is a linear map C([a, b]) −→ R
and that
21
22 LECTURE 4. LINEAR MAPS
Z b Z b Z b
rf (x) + sg(x) dx = r f (x) dx + s g(x) dx.
a a a
T (v + u) = T (v) + T (u)
T (rv) = rT (v).
Lemma. Suppose that T : V −→ W is linear. Then T (~0) = ~0.
Proof. We can write ~0 = 0v, where v is any vector in V . But then T (~0) = T (0v) =
0T (v) = 0
Hence,
T (x1 , x2 ) = x1 T (1, 0) + x2 T (0, 1).
Write T (1, 0) and T (0, 1) as:
Thus,
all the information
about T is given by the matrix:
a11 a12
.
a21 a22
Example. Next, let us find all the linear maps T : R3 −→ R3 . As before we write
(x1 , x2 , x3 ) ∈ R3 as:
where,
Then,
Example. All the linear maps from R3 −→ R. Notice that R is also a vector space,
so we can consider all the linear maps Rn to R. We have :
where,
T (1, 0, ..., 0) = a1 , T (0, 1, ..., 0) = a2 , . . . T (0, 0, ..., 1) = an .
24 LECTURE 4. LINEAR MAPS
4.2.1 Lemma
Lemma. A map Rn −→ Rm is linear if and only if there exists numbers aij , i =
1, ..., n, j = 1, ..., m, such that:
4.2.2 A Counterexample
Example. The map T (x, y, z) = (2x + 3xy, z + y) is not linear because of the factor
xy. Notice that:
T (1, 1, 0) = (5, 0)
but
T (2(1, 1, 0)) = T (2, 2, 0) = (16, 0)
and
2T (1, 1, 0) = (10, 0) 6= (16, 0)
4.2.3 Examples
Example. Evaluate the given following maps at a given point:
D(3x2 + 4x − 1) = 6x + 4
Z 2 2
2 x 1 3 x
x − e dx = x −e
1 3 1
8 1
= − e2 − + e
3 3
7 2
= −e +e
3
4.3 Kernel
Definition. Let V and W be two vector spaces and T : V −→ W a linear map.
• A1 The set Ker(T ) = {v ∈ V : T (v) = 0} is called the kernel of T .
Then,
T (1, −1) = (1 − 1, 1 − 1) = (0, 0).
But T (2(1, −1)) = T (2, −2) = (4 − 2, 2 − 2) = (2, 0) 6= (0, 0).
So if T is not linear, then the set v ∈ V : T (v) = 0 is in general not a vector
space.
26 LECTURE 4. LINEAR MAPS
2x − 3y + z = 0 and x + 2y − z = 0.
The equations describe planes through (0, 0, 0) with normal vectors (2, −3, 1) and
(1, 2, −1) respectively. The normal vectors are not parallel and therefore the planes
are different. It follows that the intersection is a line.
Let us describe this line. Adding the equations we get:
3x − y = 0 or y = 3x.
0 = x + 2(3x) − z = 7x − z or z = 7x.
Inner Product
Let us start with the following problem. Given a point P ∈ R2 and a line L j R2 ,
how can we find the point on the line closest to P ?
Answer: Draw a line segment from P meeting the line in a right angle. Then,
the point of intersection is the point on the line closest to P .
Let us now take a plane L j R3 and a point outside the plane. How can we
find the point u ∈ L closest to P ?
The answer is the same as before, go from P so that you meet the plane in a
right angle.
Observation
In each of the above examples we needed two things:
Both of these things can be done by using the dot-product (or inner product) in
Rn .
27
28 LECTURE 5. INNER PRODUCT
The norm (or length) of the vector ~u = (x1 , x2 , ..., xn ) ∈ Rn is the non-negative
number: p q
kuk = (u, u) = x21 + x22 + ... + x2n .
Examples
Perpendicular
Because,
q q
|x1 y1 + x2 y2 + ... + xn yn | ≤ x21 + x22 + ... + x2n y12 + y22 + ... + yn2
or
|(u, v)| ≤ kuk · kvk
we have that (for u, v 6= 0)
(u, v)
−1 ≤ ≤ 1.
kuk · kvk
Hence we can define:
(u, v)
cos(∠(u, v)) = .
kuk · kvk
In particular, u⊥v (u is perpendicular to v) if and only if (u, v) = 0.
Questions
Example. Let L be the line in R2 given by y = 2x. Thus,
L = {r(1, 2) : r ∈ R} .
4
Hence, r = 5 and ~v = ( 54 , 85 ). Question 2: What is the distance of P from the line?
Answer: The length of the vector v − u, i.e. kv − uk. First we have to find out
what v − u is. We have done almost all the work:
4 8 6 −3
v − u = (2, 1) − ( , ) = ( , ).
5 5 5 5
The distance therefore is: r √
36 9 3 5
+ = .
25 25 5
We will use the properties above to define an inner product on arbitrary vector
spaces.
Definition
Let V be a vector space. An inner product on V is a map (., .) : V × V −→ R
satisfying the following properties:
1. (positivity) (u, u) ≥ 0, for all v ∈ V .
2. (zero length) (u, u) = 0 only if u = 0.
3. (linearity)If v ∈ V is fixed, then a map u 7→ (u, v) from V to R is linear.
4. (symmetry) (u, v) = (v, u), for all u, v ∈ V .
Definition. We say that u and v are perpendicular if (u, v) = 0.
Definition. If (.,.) is an inner product on the vector space V , then the norm of
a vector v ∈ V is given by:
p
kuk = (u, u).
30 LECTURE 5. INNER PRODUCT
Examples
Example. Let a < b, I = [a, b], and V = P C([a, b]). Define:
Z b
(f, g) = f (t)g(t) dt
a
Problem
Problem: Find a polynomial f (t) = a + bt that is perpendicular to the polynomial
g(t) = 1 − t.
Important Facts
We state now two important facts about the inner product on a vector space V .
Recall that in R2 we have:
(u, v)
cos(θ) = .
kuk · kvk
where u, v are two non-zero vectors in R2 and θ is the angle between u and v. In
particular, because −1 ≤ cos θ ≤ 1, we must have:
We will show now that this comes from the positivity and linearity of the inner
product.
for all u, v ∈ V .
33
Proof. We can assume that u, v 6= 0 because otherwise both the LHS and the RHS
will be zero. By the positivity of the inner product we get:
(v, u) (v, u)
0 ≤ (v − 2 u, v − u) (positivity)
kuk kuk2
(v, u) (v, u) (v, u)2
= (v, v) − 2 (u, v) − 2 (v, u) + (u, u) (linearity)
kuk kuk kuk4
(u, v)2 (v, u)2
= kvk2 − 2 + (symmetry)
kuk2 kuk2
(u, v)2
= kvk2 − .
kuk2
Thus,
(u, v)2 2
2 ≤ kvk or k(u, v)k ≤ kuk · kvk.
kuk
Note
Notice that:
(u, v) (u, v)
0 = (v − 2 u, v − u)
kuk kuk2
only if
(u, v)
v− u=0
kuk2
i.e.
(u, v)
v= u.
kuk2
Thus, v and u have to be on the same line through 0.
A Lemma
We can therefore conclude:
Lemma. k(u, v)k = kuk · kvk if and only if u and v are on the same line through 0.
34 LECTURE 5. INNER PRODUCT
Theorem
The following statement is generalization of Pythagoras Theorem.
ku + vk ≤ kuk · kvk
Proof.
ku + vk2 = (u + v, u + v)
= (u, u) + 2(u, v) + (v, v) (∗)
2 2
≤ kuk + 2 kuk · kvk + kvk
= (kuk + kvk)2 .
On the other hand, if ku + vk2 = kuk2 + kvk2 , we see from (*) that (u, v) = 0.
(u, v) = 4 − 4 = 0
and
kuk2 = 1 + 4 + 1 = 6, kvk2 = 4 + 16 = 20.
Also, u + v = (1, 4, 3) and finally:
Let V be the vector space R2 and consider the vectors (1, 0), (0, 1). Then, every
vector (x, y) ∈ R2 can be written as a combination of those vectors. That is:
Similarly, the two vectors (1, 1) and (1, 2) do not belong to the same line, and
every vector in R2 can be written as a combination of those two vectors.
6.1 Introduction
In particular:
(x, y) = a(1, 1) + (1, 2)
gives us two equations
a + b = x and a + 2b = y
b = −x + y
a = 2x − y
35
36 LECTURE 6. GENERATING SETS AND BASES
Or, as a combination of (1, −1, 0), (1, 1, 1) and (0, 1, −1), that is:
a + b = x (1)
−a + b + c = y (2)
b−c = z (3).
a = x−b
x+y+z
= x−
3
2x − y − z
= .
3
2x − y − z x+y+z x + y − 2z
(x, y, z) = (1, −1, 0) + (1, 1, 1) + (0, 1, −1).
3 3 3
6.2. IN GENERAL 37
6.2 In general
Notice that we get only one solution, so there is only one way that we can write a
vector in R3 as a combination of those vectors. In general, if we have k vectors in
R3 , then the equation:
x = (x1 , x2 , ..., xn ) = c1 v1 + c2 v2 + ... + ck vk (∗)
gives n-equations involving the n-coordinates of v1 , v2 , ..., vk and the unknowns
c1 , c2 , ..., ck . There are three possibilities:
6.3 Possibilities
A The equation(*) has no solution. Thus, x can not be written as a combina-
tion of the vectors v1 , v2 , ..., vk .
B The equation (*) has only one solution, so x can be written in exactly one
way as a combination of v1 , v2 , ..., vk .
C The system of equations has infinitely many solutions, so there are more than one
way to write x as a combination of v1 , v2 , ..., vk .
6.3.1 Case C
Let us look at the last case a little closer. If we write x in two different ways:
x = c1 v1 + c2 v2 + ... + ck vk
x = d1 v1 + d2 v2 + ... + dk vk
Then, by subtracting, we get:
0 = (c1 − d1 )v1 + (c2 − d2 )v2 + ... + (ck − dk )vk
where some of the numbers ci − di are non-zero.
Similarly, since we can write:
0 = a1 v1 + a2 v2 + ... + ak vk
and
x = c1 v1 + c2 v2 + ... + ck vk
then we also have:
x = (c1 + a1 )v1 + (c2 + a2 )v2 + ... + (ck + ak )vk .
Thus, we can write x as a combination of the vectors v1 , v2 , ..., vk in several different
ways (in fact ∞-many ways).
38 LECTURE 6. GENERATING SETS AND BASES
6.4 Definitions
We will now use this as a motivation for the following definitions.
(v,v1 )
Thus, (v, v1 ) = c1 kv1 k2 , or c1 = kv1 k2
. Repeat this for v2 , ..., vn .
Corollary. If the vectors v1 , v2 , ..., vn are orthogonal, then they are linearly inde-
pendent.
6.5. EXAMPLES 39
6.5 Examples
Example. Let V = R2 . The vectors (1, 2) and (−2, −4) are linearly dependent
because:
The vectors (1, 2), (1, 1) are linearly independent. In fact, (1, 2), (1, 1) is a basis
for R2 .
Indeed, let (x, y) ∈ R2 . Then,
Thus,
x = c1 + c2
y = 2c1 + c2 .
Example. Let V = R3 . One vector can only generate a line, two vectors can at
most span a plane, so we need at least three vectors to span R3 . The vectors
(1, 2, 1), (1, −1, 1) are orthogonal but not a basis. In fact, those two vectors span
the plane:
W = (x, y, z) ∈ R3 : x − z = 0
(explain why).
On the other hand, the vectors: (1, 2, 1), (1, −1, 1) and (1, 0, −1) are orthogonal,
and hence a basis.
40 LECTURE 6. GENERATING SETS AND BASES
with
4+6+1
c1 =
1+4+1
4−3+1
c2 =
3
4−1
c3 =
2
In general, we have:
x + 2y + z x−y+z x−z
(x, y, z) = (1, 2, 1) + (1, −1, 1) + (1, 0, −1)
6 3 2
Let us now discuss some spaces of functions:
0 = c1 + 2c2 x
Assume that 0 = c0 x + c1 xex . It does not help to put x = 0 now, but let us
first differentiate both sides and get:
0 = c0 + c1 ex + c1 xex
Now, x = 0 gives:
0 = c0 + c1 (1)
6.5. EXAMPLES 41
0 = c1 χ[0, 1 ) + c2 χ[ 1 ,1) .
2 2
An equation like this means that every x we put into the function on the RHS,
the result is always 0.
1
Let us take x = 4. Then: χ[0, 1 ) ( 14 ) = 1, but χ[ 1 ,1) ( 41 ) = 0. Hence, 0 =
2 2
c1 · 1 + c2 · 0, or c1 = 0. Taking x = 34 shows that c2 = 0.
d) The functions χ[0, 1 ) , χ[0,1) are not orthogonal, but linearly independent.
2
0 = c1 χ[0,1) + c2 χ[0, 1 ) .
2
Take x so that χ[0, 1 ) (x) = 0 but χ[0,1) (x) = 1. Thus, any x ∈ [0, 1) \ [0, 21 ) = [ 12 , 1)
2
will do the job. So, take x = 43 . Then, we see that:
0 = c1 · 1 + c2 · 0, orc1 = 0.
1
Then take x = 4 to see that c2 = 0.
42 LECTURE 6. GENERATING SETS AND BASES
Lecture 7
Gram-Schmidt
Orthogonalization
The ”best” basis we can have for a vector space is an orthogonal basis. That is
because we can most easily find the coefficients that are needed to express a vector
as a linear combination of the basis vectors v1 , ..., vn :
(v, v1 ) (v, vn )
v= 2 v1 + ... + vn .
kv1 k kvn k2
But usually we are not given an orthogonal basis. In this section we will show how
to find an orthogonal basis starting from an arbitrary basis.
7.1 Procedure
Let us start with two linear independent vectors v1 and v2 (i.e. not on the same line
through zero). Let u1 = v1 . How can we find a vector u2 which is perpendicular
to u1 and that the span of u1 and u2 is the same as the span of v1 and v2 ? We try
to find a number a ∈ R such that:
u2 = au1 + v2 , u 2 ⊥ u1
Take the inner product with u1 to get:
0 = (u2 , u1 ) = a(u1 , u1 ) + (v2 , u1 )
= a ku1 k2 + (v2 , u1 )
or
(v2 , u1 )
a=−
ku1 k2
43
44 LECTURE 7. GRAM-SCHMIDT ORTHOGONALIZATION
7.2 Examples
Example. Let v1 = (1, 1), v2 = (2, −1). Then, we set u1 = (1, 1) and
(v2 , u1 )
u2 = (2, −1) − u1
ku1 k2
2−1
= (2, −1) − (1, 1)
2
3
= (1, −1)
2
Example. Let v1 = (2, −1), v2 = (0, 1). Then, we set u1 = (2, −1) and
(v2 , u1 )
u2 = (0, 1) − u1
ku1 k2
−1
= (0, 1) − (2, −1)
5
2
= (1, 2)
5
7.2. EXAMPLES 45
Note We could have also started with v2 = (0, 1), and get first basis vector to
be (0, 1) and second vector to be:
(2, −1) · (0, 1)
(2, −1) − (0, 1) = (2, 0)
k(0, 1)k2
Example. Let v1 = (0, 1, 2), v2 = (1, 1, 2), v3 = (1, 0, 1). Then, we set u1 = (0, 1, 2)
and
(0, 1, 2) · (1, 1, 2)
u2 = (1, 1, 2) − (0, 1, 2)
k(0, 1, 2)k2
5
= (1, 1, 2) − (0, 1, 2)
2
= (1, 0, 0)
2
u3 = (1, 0, 1) − (0, 1, 2) − (1, 0, 0)
5
1
= (0, −2, 1)
5
Example. Let v0 = 1, v1 = x, v2 = x2 . Then, v0 , v1 , v2 is a basis for the space of
polynomials of degree ≤. But they are not orthogonal, so we start with u0 = v0
and u1 = v1 − (vku1 ,uk02) u0 . So we need to find:
0
Z 1
1 1
(v1 , u0 ) = x dx = [ x2 ]10 =
0 2 2
Z 1
ku0 k2 = 1 dx = [x]10 = 1
0
Hence, u1 = x − 12 . Then:
(v2 , u0 ) (v2 , u1 )
u1 = v2 − 2 u0 − u1 .
ku0 k ku1 k2
We also find that:
Z 1
1
(v2 , u0 ) = x2 dx =
0 3
Z 1
1 1
(v2 , u1 ) = x2 (x − ) dx =
0 2 12
Z 1
1 1
ku1 k2 = (x − )2 dx = .
0 2 12
1
Hence, u2 = x2 − 3 − (x − 12 ) = x2 − x + 16 .
46 LECTURE 7. GRAM-SCHMIDT ORTHOGONALIZATION
7.3 Theorem
Theorem. (Gram-Schmidt Orthogonalization)Let V be a vector space with inner
product (., .). Let v1 , ..., vk be a linearly independent set in V . Then, there
exists an orthogonal set u1 , ..., uk such that (vi , ui ) > 0 and span{vi , ..., vi } =
span{u1 , ..., ui } for all i = 1, ..., k.
Orthogonal Projections
8.1 Introduction
We will now come back to our original aim: Given a vector space V , a
subspace W , and a vector v ∈ V , find the vector w ∈ W which is closest to
v.
First let us clarify what the ”closest” means. The tool to measure distance
is the norm, so we want kv − wk to be as small as possible.
Thus our problem is:
Find a vector w ∈ W such that
kv − wk ≤ kv − uk
for all u ∈ W .
Now let us recall that if W = Rw1 is a line, then the vector w on the line
W is the one with the property that v − w ⊥ W .
We will start by showing that this is always the case.
47
48 LECTURE 8. ORTHOGONAL PROJECTIONS
Theorem. Let V be a vector space with inner product (·, ·). Let W ⊂ V be
a subspace and v ∈ V . If w ∈ W is the closest to v, then v − w ⊥ W .
F (t) := kv − w + txk2 (x ∈ W )
Therefore
8.2.1 Construction of w
Our task now is to construct the vector w such that v − w ⊥ W . The idea
is to use Gram-Schmidt orthogonalization.
Let W = Ru and v ∈ V . Applying Gram-Schmidt to u and v gives:
(v, u)
v− u⊥W
kuk2
(v,u)
So that w = kuk2
u is the vector (point) on the line W closest to v.
What if the dimension of W is greater than one? Let v1 , . . . , vn be an or-
thogonal basis for W . Applying the Gram-Schmidt to the vectors v1 , . . . , vn , v
shows that
n
X (v, vj )
v− v
2 j
j=1
kv j k
n
X (v, vj )
v− vj
j=1
kvj k2
n
X (v, vj )
w= vj .
j=1
kvj k2
n
X
w= ck vk .
k=1
k 6= j we get:
0 = (v − w, vj )
= (v, vj ) − (w, vj )
Xn
= (v, vj ) − ck (vk , vj )
k=1
= (v, vj ) − cj (vj , vj )
= (v, vj ) − cj kvj k2 .
(v − w, vj ) = (v, vj ) − (w, vj )
n
X (v, vk )
= (v, vj ) − (vk , vj )
k=1
kvk k2
(v, vj )
= (v, vj ) − kvj k2
kvj k2
= (v, vj ) − (v, vj )
= 0
Hence v − w ⊥ vj . But, as we saw before, this implies that v − w ⊥ W
because v1 , . . . , vn is a basis.
8.4. ORTHOGONAL PROJECTIONS 51
8.5 Summary
The result of this discussion is the following:
To find the vector w closest to v we have to:
8.6 Examples
Example. Let W be the line W = R(1, 2). Then u = (1, 2) is a basis (orthog-
onal!) for W . It follows that the orthogonal projection is given by
x + 2y
P (x, y) = (1, 2).
5
Let (x, y) = (3, 1). Then
P (3, 1) = (1, 2).
Example. Let W be the line given by y = 3x. Then (1, 3) ∈ W and hence
W = R(1, 3).It follows that
x + 3y
P (x, y) = (1, 3).
10
Example. Let W be the plane generated by the vectors (1, 1, 1) and (1, 0, 1).
Find the orthogonal projection P : R3 −→ W .
Solution. We notice first that ((1, 1, 1), (1, 0, 1)) = 2 6= 0, so this is not an
orthogonal basis. Using Gram-Schmidt we get:
v1 = (1, 1, 1)
v2 = (1, 0, 1) − 23 (1, 1, 1) = ( 31 , − 23 ), 31 = 13 (1, −2, 1).
To avoid fractions, we can use (1, −2, 1) instead of 13 (1, −2, 1). Thus the
orthogonal projection is:
x+y+z x − 2y + z
P (x, y, z) = (1, 1, 1) + (1, −2, 1)
3 6
2x + 2y + 2z x − 2y + z
= + ,
6 6
2x + 2y + 2z x − 2y + z
−2 ,
6 6
2x + 2y + 2z x − 2y + z
+
6 6
x+z x+z
= , y, .
2 2
Solution. We notice that our first step is to find an orthogonal basis for W .
The vectors (1, −1, 0) and (2, 0, −1) are in W , but are not orthogonal.We
have
(2, 0, −1) − 22 (1, −1, 0) = (1, 1, −1) ∈ W
and orthogonal to (1, −1, 0). So we get:
x−y x+y−z
P (x, y, z) = (1, −1, 0) + (1, 1, −1)
2 3
5x − y − 2z −x + 5y − 2z −x − y + z
= , , .
6 6 3
8.7 Exercises
1. Let V ⊂ R2 be the line V = R(1, −1).
(a) Write a formula for the orthogonal projection P : R2 → V.
(b) What is: i) P (1, 1), ii) P (2, 1), iii) P (2, −2)?
2. Let W ⊂ R3 be the plane
W = {(x, y, z) ∈ R3 : x − 2y + z = 0}.
(a) Find the orthogonal projection P : R3 → W.
(b) What is: i) P (1, 1, 2), ii) P (1, −2, 1), iii) P (2, 1, 1)?
3. Let W ⊂ R3 be the plane generated by the vectors (1, 1, 1) and (1, −1, 1).
(a) Find the orthogonal projection P : R3 → W.
(b) What is: i) P (1, 1, 2), ii) P (2, 0, 1)?
4. Let W be the space of continuous functions on [0, 1] generated by the
constant function 1 and x. Thus W = {a0 + a1 x : a0 , a1 ∈ R}. Find
the orthogonal projection of the following functions onto W :
i) P (x2 ), ii) P (ex ), iii) P (1 + x2 ).
5. Let W be the space of piecewise continuous functions on [0, 1] gener-
ated by χ[0,1/2) and χ[1/2,1) . Find orthogonal projections of the following
functions onto W :
i) P (x), ii) P (x2 ), iii) P (χ[0,3/4] ).
54 LECTURE 8. ORTHOGONAL PROJECTIONS
Lecture 9
55
56 LECTURE 9. 2-D HAAR WAVELET TRANSFORM
ψij = χ[ j
, j+1 ) − χ[ j+2 , j+3 )
2i+1 2i+1 2i+1 2i+1
Recall that ϕij is used to express the averages, and ψij is used to express the
details.
We have:
ϕni ⊗ ϕnj = ϕIijn .
Can be used to express the ”average values” on Iijn and
can be used to express details going from one column to the next, one row
to the next, and going diagonally.
Let f be a step function in [0, 1) × [0, 1). Instead of associating to f an
array, we have to use a matrix. Thus if:
n −1
2X
f (x, y) = sij χIijn
i,j=1
9.2. THE TWO-DIM. HAAR WAVELET TRANSFORM 57
Notice that the first indices (the ones corresponding to the x-variable)
indicate the row, and the second indices correspond to the column.
Example. 2 × 2-matrix
1 1
χ[0, 1 ) ⊗ χ[0,1) ↔
2 0 0
[4, 2] → [3, 1]
and
[0, 6] → [3, −3]
58 LECTURE 9. 2-D HAAR WAVELET TRANSFORM
Thus,
4 2 3 1
−→
0 6 3 −3
We now apply the 1 − D wavelet transform to the rows:
and
[1, −3]T → [−1, 2]T
This results to the new matrix,
3 1 3 1
−→
3 −3 0 −3
Notice that the element 3 represents the average value of all values:
4+2+0+6 12
= = 3.
4 4
To understand the other matrix elements, we will do this for a general matrix.
So, we have:
s00 +s01 s00 −s01
s00 s01 1st −step
−→ 2
s10 +s01
2
s10 −s01
s10 s11 2 2
1st -step: Apply the inverse 1-D Haar Wavelet Transform on the columns.
2st -step: Apply the inverse 1-D
Haar Wavelet
Transform on the rows.
2 1
Example. Given the matrix , find the initial matrix.
−1 0
2 1 1−D inverse on columns 2−1 1+0 1 1
−→ =
−1 0 2 − (−1) 1 − 0 3 1
60 LECTURE 9. 2-D HAAR WAVELET TRANSFORM
1−D inverse on rows 1+1 1−1 2 0
−→ =
3+1 3−1 4 2
1st -step: Pick the 2 × 2 matrix in the left upper corner. Apply the inverse
1-D on the columns.
2nd -step: Apply the 1-D inverse transform on the rows on the 2 × 2 matrix
from step 1.
3rd -step: We have now a new 4 × 4 matrix. Apply the inverse 1-D to the
columns.
4th -step: Apply the inverse 1-D to the rows.
2 1 0 3
1 0 2 −1
Example. Given the matrix 1 2 −1 2 , find the initial matrix.
0 −1 1 3
2 1
We start by the 2 × 2 matrix and we apply the inverse transform to this
1 0
matrix:
2 1 columns 3 1 rows 4 2
−→ −→ .
1 0 3 1 2 0
We have now the new matrix:
4 2 0 3
2 0
2 −1
1 2 −1 2
0 −1 1 3
9.3. THE INVERSE TRANSFORM 61
Example. To this new matrix, we will apply the inverse row-column trans-
form:
4 2 0 3 5 4 −1 5
2 0
2 −1 inverse −→
on columns
3 0 1 1
1 2 −1 2 2 −1 3 2
0 −1 1 3 2 1 1 −4
4 6 9 −1
inverse on rows
4 2 1 −1
−→ 5 −1 1
−3
3 1 −3 5
4 6 9 −1
4 2 1 −1
So the final answer is: 5 −1 1 −3
3 1 −3 5
62 LECTURE 9. 2-D HAAR WAVELET TRANSFORM
Lecture 10
10.1 Introduction
Up to now we have only considered vector spaces over the field of real num-
bers. For the Fourier transform we will need vector spaces where we can
multiply vectors by complex numbers. If x ∈ R, then we know that x2 ≥ 0
and x2 = 0 only if x = 0. Therefore there is no real number such that
x2 = −1, or: There is no real solution to the equation
x2 + 1 = 0.
x2 + bx + c = 0
63
64 LECTURE 10. COMPLEX VECTOR SPACES
i2 = −1
z = x + iy , x, y ∈ R.
The set of complex numbers is denoted by C. We say that x = <z is the real
part of z and y = =z is the imaginary part of z.
Recall that the set of real numbers can be thought of as a line, the real
line. To picture the set of complex numbers we use the plane. A vector
~v = (x, y) corresponds to the complex number z = x + iy.
To find out what the product of z and w is, we use the familiar rules
along with i2 = −1. Thus
z · z = (x + iy)(x − iy)
= x2 − (iy)2
= x2 + y 2 .
√
Thus zz := |z| is the length of the vector (x, y) or the absolute value of
the complex number z.
10.2.3 Reciprocal of z
Lemma. Let z = x + iy be a complex number with |z| =
6 0. Then
1 z x − iy
= 2 = 2 .
z |z| x + y2
(x+iy)(x−iy) x2 +y 2
Proof. We have z xx−iy
2 +y 2 = x2 +y 2
= x2 +y 2
=1
10.2.4 Examples
• (2 + 3i) + (5 − 2i) = 7 + i.
1 2−i 2
• 2+i
= 5
= 5
− 15 i.
10.3.1 Examples
Proof.
ez = ex (cos y + i sin y)
= ex (cos y − i sin y)
= ex−iy
= ez
dF df dg
(t) = (t) + (t) i
dt dt dt
Examples
1)
Z 1
2t + 3t2 i dt = t2 ]10 + t3 ]10 i
0
= 1 + i.
68 LECTURE 10. COMPLEX VECTOR SPACES
2) Z 2π Z 2π
(1+i)t
e dt = et cos t + et sin t dt
0 0
We have
Z 2π Z 2π
t
e cos t dt = cos tet ]2π
+ 0 et sin t dt
0 0
Z 2π
2π
= e −1− et cos t dt
0
Thus
Z 2π
1
et cos t dt = (e2π − 1).
0 2
Similarly we have
Z 2π
1
et sin t dt = − (e2π − 1).
0 2
Thus,
2π
e2π − 1
Z
e(1+i)t dt =
(1 − i).
0 2
But we could have also used the rule
Z
1
eat dt = eat + C
a
where a is any complex number, a 6= 0. Then
Z 2π
1 (1+i)t 2π
e(1+i)t dt = e ]0
0 1+i
1
= [e2π+i2π − e0 ]
1+i
1
= [e2π − 1]
1+i
10.5. COMPLEX VECTOR SPACES 69
Furthermore
1 1
= (1 − i)
1+i 2
Thus we have
2π
e2π − 1
Z
e(1+i)t dt = (1 − i)
0 2
R1
Example. Evaluate the integral 0 (t + 2it2 )(t2 − 3it) dt.
Solution: First we have to carry out the multiplication
(t + 2it2 )(t2 − 3it) = t3 + 6t3 − 2it4 − 3it2
= 7t3 − (2t4 + 3t2 )i
Thus
Z 1 Z 1 Z 1
2 2 3
(t + 2it )(t − 3it) dt = 7t dt − ( 2t4 + 3t2 )i
0 0 0
7 41 2
= t ]0 − [ t5 + t3 ]10 i
4 5
7 7
= − i.
4 5
Lemma. Let (·, ·) be an inner product on the complex vector space V . Then
Proof. We have
Examples
Example (1). Let V = Cn . Define for u = (z1 , . . . , zn ) and v = (w1 , . . . , wn )
(u, v) = z1 w1 + · · · + zn wn .
Then
(u, u) = z1 z1 + · · · + zn zn
= |z1 |2 + · · · + |zn |2 ≥ 0.
10.5. COMPLEX VECTOR SPACES 71
Similarly,
Finally,
(u, v) = z1 w1 + · · · + zn wn
= z1 w1 + · · · + zn wn
= (v, u).
Remark. Notice that kuk = 0 if and only if u = 0 and that kλuk = |λ| kuk.
Examples
1. V = C2 and u = (1, i). Then
kuk2 = 1 + ii = 1 + i(−i) = 1 + 1 = 2.
72 LECTURE 10. COMPLEX VECTOR SPACES
2. V = C2 and u = (1 + i, 2 + 3i):
Then
f (t)f (t) = |f (t)|2 = (cos (at) + i sin (at))(cos (at) − i sin (at))
= (cos (at))2 + (sin (at))2
= 1.
Hence,
s s
Z 1 Z 1
kf k = |f (t)|2 dt = 1 dt = 1.
0 0
f (t) = t + it2 .
Then
Hence,
s r r
Z 1
1 1 8
kf k = t2 + t4 dt = + = .
0 3 5 15
10.5. COMPLEX VECTOR SPACES 73
Then
Hence,
Z 1
2
kf k = t4 + 6t2 − 24t + 37 dt
0
1
= + 2 − 12 + 37
5
136
= .
5
74 LECTURE 10. COMPLEX VECTOR SPACES
Lecture 11
11.1 Introduction
The goal of the chapter is to study the Discrete Fourier Transform (DFT)
and the Fast Fourier Transform (FFT). In the course of the chapter we will
see several similarities between Fourier series and wavelets, namely
There is, however, a very important difference between Fourier series and
wavelets, namely
Wavelets have compact support, Fourier series do not.
75
76 LECTURE 11. DISCRETE AND FAST FOURIER TRANSFORMS
(ω20 )0 (ω21 )0
2 1 1
FΩ = = (the Haar matrix)
(ω20 )1 (ω21 )1 1 −1
−1
wk )N
One proof The easiest way to prove Proposition 13 is to note that (~ k=0
N
forms an orthonormal basis for C . Therefore, the formula
N
X −1 N
X −1
~f = fˆk w
~k = h~f , w
~ k iN w
~k
k=0 k=0
Therefore
~f = (9, 7, 5, 7)
= 7 · (1, 1, 1, 1) + 1 · (1, i, −1, −i)
+ 0 · (1, −1, 1, −1) + 1 · (1, −i, −1, i)
~f 7→ b 1
DF T : CN → CN , f= N ΩT ~f .
NF
DF T −1 : CN → CN , f 7→ ~f = N
b ~
F Ωf .
√
Using the multiplicative constant 1/ N instead of 1/N , the Discrete
Fourier Transform thus is multiplication by the matrix N √1 N T
F U := N F Ω .
T
−1
In the exercises you are asked to show that (N
F U) = (N
F U ) . Such an
operator has a special name:
Definition 17 For each linear space V with an inner product h·, ·i, a
linear operator L : V → V is unitary if
for all v, w ∈ V .
Let us try to estimate the number of calculations that are required. So let
us start with N complex numbers (f0 , . . . , fN −1 ).
• The numbers should then be added, but that would merely amount to
2N operations. Our number of operations is thus 4N 2 .
4 × 162 × 15
• With N = 16 we would need = 16 min,
16 × 60
4 × 322 × 15
• With N = 32 we would need = 64 min, and
16 × 60
4 × 2562 × 15
• With N = 28 = 256 we would need = 4096 min, (almost
16 × 60
three days).
We want to know how the DFT of even~f and the DFT of ~ are related to
odd f
the DFT of ~f . The answer is given in the next result:
Central result
Lemma 19 For each k ∈ {0, 1, . . . , N2 −1} and all arrays ~f = (f (0), . . . , f (N −
1)) ∈ CN
1
fˆk = · even fˆk + [e−i·2π/N ]k · [odd fˆk ] ,
2
1
fˆ N = · even fˆk − [e−i·2π/N ]k · [odd fˆk ] .
k+
2 2
We will not give a proof but merely see what the Lemma says in the case
N = 2. Then N/2 = 1 and ~f = (f0 , f1 ). Thus even~f = (f0 ) and odd~f = (f1 ).
Using that e−i·2π/2 = −1, the Lemma simply says that
f0 + f1 f0 − f1
fˆ0 = and fˆ1 = .
2 2
Time required?
We will only count complex operations.
• Using the FFT (where we decompose ~f into two smaller arrays, divide
each of these into two smaller arrays, and so on), we end up with k
arrays each of length 2.
Is this significant?
In particular, taking N = 210 ≈ 1.024 × 103 and calculate the time, the DFT
takes
4 × 220 × 15
≈ 1247 years
16 × 60 × 60 × 24 × 365
but the FFT only takes
4 × 10 × 210 × 15
≈ 10.67 min.
16 × 60 × 60
Obviously this is a very distinct reduction in the time required to perform
the calculations :-)
where the sums thus obtained are just the IFFT applied to the coefficients
ˆ N −1
(fk eiku )k=0 . Therefore, to interpolate f at the points x = u + ` · 2π , ` ∈
N
ˆ iku iu k
{0, . . . , N − 1}, it suffices to multiply each coefficient fk by e = (e ) and
then calculate the IFFT of the array (fˆk eiku )N −1
k=0 .
(1) For each k ∈ {0, . . . , n − 1}, perform one step of the FFT on each of the
2(n−k)−1 pairs of adjacent sequences of 2k elements.
We can therefore perform the Fast Fourier Transform in the following way:
• For each p ∈ {0, . . . , N − 1}, calculate q = B(p) and arrange the data
~z = (z0 , . . . , zN −1 ) as
• Compute the N/2 Fast Fourier Transform steps from one to two points
of each of the N/2 pairs:
• Compute the N/4 Fast Fourier Transform steps from two to four points
of each of the N/4 sequences of four numbers:
• Compute the Fast Fourier Transform step from N/2 to N points of the
sequence of N numbers: