Fundamentals of Linear Algebra and Optimization
CIS515, Some Slides
Jean Gallier Department of Computer and Information Science University of Pennsylvania Philadelphia, PA 19104, USA e-mail: [email protected]
c Jean Gallier November 5, 2013 2 Contents
1 Basics of Linear Algebra 9 1.1 Motivations: Linear Combinations, Linear Independence, Rank ...... 9 1.2 Vector Spaces ...... 27 1.3 Linear Independence, Subspaces ...... 37 1.4 Bases of a Vector Space ...... 47 1.5 LinearMaps ...... 57 1.6 Matrices ...... 68 1.7 Haar Basis Vectors; a Glimpse at Wavelets 108 1.8 TheE↵ect of a Change of Bases on Matrices138 1.9 A neMaps ...... 149 1.10 Direct Products, Sums, and Direct Sums . 164 1.11 The Dual Space E⇤ and Linear Forms . . 178 1.12 Hyperplanes and Linear Forms ...... 199 1.13 Transpose of a Linear Map and of a Matrix 200 1.14 The Four Fundamental Subspaces . . . . . 207
2 Gaussian Elimination, LU, Cholesky, Re-
3 4 CONTENTS duced Echelon 217 2.1 Motivating Example: Curve Interpolation . 217 2.2 Gaussian Elimination and LU-Factorization226 2.3 Gaussian Elimination of Tridiagonal Ma- trices ...... 269 2.4 SPD Matrices and the Cholesky Decompo- sition ...... 276 2.5 Reduced Row Echelon Form ...... 280
3 Determinants 305 3.1 Permutations, Signature of a Permutation 305 3.2 AlternatingMultilinearMaps ...... 311 3.3 Definition of a Determinant ...... 319 3.4 Inverse Matrices and Determinants . . . . 330 3.5 Systems of Linear Equations and Determi- nants ...... 334 3.6 DeterminantofaLinearMap ...... 335 3.7 The Cayley–Hamilton Theorem ...... 337 3.8 Further Readings ...... 344
4 Vector Norms and Matrix Norms 345 4.1 Normed Vector Spaces ...... 345 4.2 MatrixNorms ...... 354 4.3 ConditionNumbersofMatrices ...... 373 CONTENTS 5 5 Iterative Methods for Solving Linear Sys- tems 387 5.1 Convergence of Sequences of Vectors and Matrices ...... 387 5.2 Convergence of Iterative Methods . . . . . 392 5.3 Methods of Jacobi, Gauss-Seidel, and Re- laxation ...... 397 5.4 ConvergenceoftheMethods ...... 410
6 Euclidean Spaces 419 6.1 Inner Products, Euclidean Spaces . . . . . 419 6.2 Orthogonality ...... 429 6.3 Linear Isometries (Orthogonal Transforma- tions) ...... 447 6.4 The Orthogonal Group, Orthogonal Matrices453 6.5 QR-Decomposition for Invertible Matrices 458
7 QR-Decomposition for Arbitrary Matri- ces 465 7.1 Orthogonal Reflections ...... 465 7.2 QR-Decomposition Using Householder Ma- trices ...... 473
8 BasicsofHermitianGeometry 479 8.1 Sesquilinear Forms, Hermitian Forms . . . 479 6 CONTENTS 8.2 Orthogonality, Duality, Adjoint of A Lin- earMap ...... 492 8.3 Linear Isometries (also called Unitary Trans- formations) ...... 502 8.4 The Unitary Group, Unitary Matrices . . . 506
9 Eigenvectors and Eigenvalues 511 9.1 Eigenvectors and Eigenvalues of a Linear Map ...... 511 9.2 Reduction to Upper Triangular Form . . . 525 9.3 Location of Eigenvalues ...... 529
10 Spectral Theorems 533 10.1 NormalLinearMaps ...... 533 10.2 Self-Adjoint and Other Special Linear Maps548 10.3 Normal and Other Special Matrices . . . . 553
11 Introduction to The Finite Elements 561 11.1 A One-Dimensional Problem: Bending of aBeam...... 561 11.2 A Two-Dimensional Problem: An Elastic Membrane ...... 587 11.3 Time-Dependent Boundary Problems . . . 596
12 Singular Value Decomposition and Polar CONTENTS 7 Form 617 12.1 Singular Value Decomposition for Square Matrices ...... 617 12.2 Singular Value Decomposition for Rectan- gularMatrices ...... 632
13 Applications of SVD and Pseudo-inverses635 13.1 Least Squares Problems and the Pseudo- inverse ...... 635 13.2 Data Compression and SVD ...... 648 13.3 Principal Components Analysis (PCA) . . 651 13.4 Best A ne Approximation ...... 664
14 Quadratic Optimization Problems 675 14.1 Quadratic Optimization: The Positive Def- inite Case ...... 675 14.2 Quadratic Optimization: The General Case 694 14.3 Maximizing a Quadratic Function on the Unit Sphere ...... 699
Bibliography 708 8 CONTENTS Chapter 1
Basics of Linear Algebra
1.1 Motivations: Linear Combinations, Linear Inde- pendence and Rank
Consider the problem of solving the following system of three linear equations in the three variables x1,x2,x3 R: 2
x +2x x =1 1 2 3 2x1 + x2 + x3 =2 x 2x 2x =3. 1 2 3
One way to approach this problem is introduce some “column vectors.”
9 10 CHAPTER 1. BASICS OF LINEAR ALGEBRA Let u, v, w,andb,bethevectors given by
1 2 1 1 u = 2 v = 1 w = 1 b = 2 011 0 21 0 21 031 @ A @ A @ A @ A and write our linear system as
x1u + x2v + x3w = b.
In the above equation, we used implicitly the fact that a vector z can be multiplied by a scalar R,where 2
z1 z1 z = z = z , 0 21 0 21 z3 z3 @ A @ A and two vectors y and and z can be added, where
y1 z1 y1 + z1 y + z = y + z = y + z . 0 21 0 21 0 2 21 y3 z3 y3 + z3 @ A @ A @ A 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK11 The set of all vectors with three components is denoted 3 1 by R ⇥ .
3 1 The reason for using the notation R ⇥ rather than the more conventional notation R3 is that the elements of 3 1 R ⇥ are column vectors;theyconsistofthreerowsand asinglecolumn,whichexplainsthesuperscript3 1. ⇥ On the other hand, R3 = R R R consists of all triples ⇥ ⇥ of the form (x1,x2,x3), with x1,x2,x3 R,andthese are row vectors. 2
For the sake of clarity, in this introduction, we will denote n 1 the set of column vectors with n components by R ⇥ .
An expression such as
x1u + x2v + x3w where u, v, w are vectors and the xisarescalars(inR)is called a linear combination. 12 CHAPTER 1. BASICS OF LINEAR ALGEBRA Using this notion, the problem of solving our linear sys- tem x1u + x2v + x3w = b is equivalent to determining whether b can be expressed as a linear combination of u, v, w.
Now, if the vectors u, v, w are linearly independent, which means that there is no triple (x1,x2,x3) =(0, 0, 0) such that 6
x1u + x2v + x3w =03,
3 1 it can be shown that every vector in R ⇥ can be written as a linear combination of u, v, w.
Here, 03 is the zero vector 0 03 = 0 . 001 @ A 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK13 It is customary to abuse notation and to write 0 instead of 03.Thisrarelycausesaproblembecauseinmostcases, whether 0 denotes the scalar zero or the zero vector can be inferred from the context.
3 1 In fact, every vector z R ⇥ can be written in a unique way as a linear combination2
z = x1u + x2v + x3w. Then, our equation
x1u + x2v + x3w = b has a unique solution,andindeed,wecancheckthat
x1 =1.4 x = 0.4 2 x = 0.4 3 is the solution.
But then, how do we determine that some vectors are linearly independent?
One answer is to compute the determinant det(u, v, w), and to check that it is nonzero. 14 CHAPTER 1. BASICS OF LINEAR ALGEBRA In our case,
12 1 det(u, v, w)= 21 1=15, 1 2 2 which confirms that u, v, w are linearly independent.
Other methods consist of computing an LU-decomposition or a QR-decomposition, or an SVD of the matrix con- sisting of the three columns u, v, w,
12 1 A = uvw = 21 1 . 01 2 21 @ A If we form the vector of unknowns
x1 x = x , 0 21 x3 @ A then our linear combination x1u + x2v + x3w can be written in matrix form as 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK15 12 1 x 1 x1u + x2v + x3w = 21 1 x2 . 01 2 21 0x 1 3 @ A @ A So, our linear system is expressed by
12 1 x 1 1 21 1 x2 = 2 , 01 2 21 0x 1 031 3 @ A @ A @ A or more concisely as Ax = b.
Now, what if the vectors u, v, w are linearly dependent? 16 CHAPTER 1. BASICS OF LINEAR ALGEBRA For example, if we consider the vectors
1 2 1 u = 2 v = 1 w = 1 , 011 0 11 0 2 1 @ A @ A @ A we see that u v = w, anontriviallinear dependence.
It can be verified that u and v are still linearly indepen- dent.
Now, for our problem
x1u + x2v + x3w = b to have a solution, it must be the case that b can be expressed as linear combination of u and v.
However, it turns out that u, v, b are linearly independent (because det(u, v, b)= 6), so b cannot be expressed as alinearcombinationofu and v and thus, our system has no solution. 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK17 If we change the vector b to 3 b = 3 , 001 then @ A b = u + v, and so the system
x1u + x2v + x3w = b has the solution
x1 =1,x2 =1,x3 =0.
Actually, since w = u v,theabovesystemisequivalent to (x + x )u +(x x )v = b, 1 3 2 3 and because u and v are linearly independent, the unique solution in x + x and x x is 1 3 2 3 x1 + x3 =1 x x =1, 2 3 which yields an infinite number of solutions parameter- ized by x3,namely x =1 x 1 3 x2 =1+x3. 18 CHAPTER 1. BASICS OF LINEAR ALGEBRA In summary, a 3 3linearsystemmayhaveaunique solution, no solution,⇥ or an infinite number of solutions, depending on the linear independence (and dependence) or the vectors u, v, w, b.
This situation can be generalized to any n n system, and even to any n m system (n equations in⇥ m variables), as we will see later.⇥
The point of view where our linear system is expressed in matrix form as Ax = b stresses the fact that the map x Ax is a linear transformation. 7! This means that A( x)= (Ax) 3 1 for all x R ⇥ and all R,andthat 2 2 A(u + v)=Au + Av, 3 1 for all u, v R ⇥ . 2 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK19
I'lr- ONL"( Hl::, c.oULQ IN
ABs-H2.A'-'\ -"{"f::.RlV\s.'" Reproduced by special permission 01 Playboy Ma\ Copyright © January 1970 by Playboy.
Figure 1.1: The power of abstraction 20 CHAPTER 1. BASICS OF LINEAR ALGEBRA We can view the matrix A as a way of expressing a linear 3 1 3 1 map from R ⇥ to R ⇥ and solving the system Ax = b amounts to determining whether b belongs to the image (or range)ofthislinearmap.
Yet another fruitful way of interpreting the resolution of the system Ax = b is to view this problem as an intersection problem.
Indeed, each of the equations
x +2x x =1 1 2 3 2x1 + x2 + x3 =2 x 2x 2x =3 1 2 3 defines a subset of R3 which is actually a plane. 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK21 The first equation x +2x x =1 1 2 3 defines the plane H1 passing through the three points (1, 0, 0), (0, 1/2, 0), (0, 0, 1), on the coordinate axes, the second equation
2x1 + x2 + x3 =2 defines the plane H2 passing through the three points (1, 0, 0), (0, 2, 0), (0, 0, 2), on the coordinate axes, and the third equation x 2x 2x =3 1 2 3 defines the plane H3 passing through the three points (3, 0, 0), (0, 3/2, 0), (0, 0, 3/2), on the coordinate axes. The intersection H H of any two distinct planes H i \ j i and Hj is a line, and the intersection H1 H2 H3 of the three planes consists of the single point (1\.4, \0.4, 0.4). 22 CHAPTER 1. BASICS OF LINEAR ALGEBRA Under this interpretation, observe that we are focusing on the rows of the matrix A,ratherthanonitscolumns, as in the previous interpretations.
£lrJSTE/N' S ,_F/RS,
Figure 1.2: Linear Equations 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK23 Another great example of a real-world problem where lin- ear algebra proves to be very e↵ective is the problem of data compression,thatis,ofrepresentingaverylarge data set using a much smaller amount of storage.
Typically the data set is represented as an m n matrix A where each row corresponds to an n-dimensional⇥ data point and typically, m n. In most applications, the data are not independent so the rank of A is a lot smaller than min m, n ,andthe the goal of low-rank decomposition is to{ factor} A as the product of two matrices B and C,whereB is a m k matrix and C is a k n matrix, with k min m,⇥ n (here, means “much⇥ smaller than”): ⌧ { } ⌧ 24 CHAPTER 1. BASICS OF LINEAR ALGEBRA
0 1 0 1 B A C = B B C C B C B C 0 1 B m n C B m k C k n B ⇥ C B ⇥ C ⇥ B C B C @ A B C B C B C B C B C B C @ A @ A Now, it is generally too costly to find an exact factoriza- tion as above, so we look for a low-rank matrix A0 which is a “good” approximation of A.
In order to make this statement precise, we need to define amechanismtodeterminehowclosetwomatricesare. This can be done using matrix norms,anotiondiscussed in Chapter 4.
The norm of a matrix A is a nonnegative real number A which behaves a lot like the absolute value x of a realk k number x. | | 1.1. MOTIVATIONS: LINEAR COMBINATIONS, LINEAR INDEPENDENCE, RANK25
Then, our goal is to find some low-rank matrix A0 that minimizes the norm 2 A A0 , k k over all matrices A0 of rank at most k,forsomegiven k min m, n . ⌧ { } Some advantages of a low-rank approximation are: 1. Fewer elements are required to represent A;namely, k(m + n)insteadofmn.Thuslessstorageandfewer operations are needed to reconstruct A. 2. Often, the decomposition exposes the underlying struc- ture of the data. Thus, it may turn out that “most” of the significant data are concentrated along some directions called principal directions. 26 CHAPTER 1. BASICS OF LINEAR ALGEBRA Low-rank decompositions of a set of data have a multi- tude of applications in engineering, including computer science (especially computer vision), statistics, and ma- chine learning.
As we will see later in Chapter 13, the singular value de- composition (SVD) provides a very satisfactory solution to the low-rank approximation problem.
Still, in many cases, the data sets are so large that another ingredient is needed: randomization.However,asafirst step, linear algebra often yields a good initial solution.
We will now be more precise as to what kinds of opera- tions are allowed on vectors.
In the early 1900, the notion of a vector space emerged as a convenient and unifying framework for working with “linear” objects. 1.2. VECTOR SPACES 27 1.2 Vector Spaces
A(real)vectorspaceisasetE together with two op- erations, +: E E E and : R E E,called addition and scalar⇥ ! multiplication· ,thatsatisfysome⇥ ! simple properties.
First of all, E under addition has to be a commutative (or abelian) group, a notion that we review next.
However, keep in mind that vector spaces are not just algebraic objects; they are also geometric objects. 28 CHAPTER 1. BASICS OF LINEAR ALGEBRA Definition 1.1. A group is a set G equipped with a bi- nary operation : G G G that associates an element a b G to every· pair⇥ of! elements a, b G,andhaving the· following2 properties: is associative2,hasanidentity element e G,andeveryelementin· G is invertible (w.r.t. ). 2 · More explicitly, this means that the following equations hold for all a, b, c G: 2 (G1) a (b c)=(a b) c.(associativity); · · · · (G2) a e = e a = a.(identity); · · 1 (G3) For every a G,thereissomea G such that 1 12 2 a a = a a = e (inverse). · · AgroupG is abelian (or commutative)if a b = b a · · for all a, b G. 2
AsetM together with an operation : M M M and an element e satisfying only conditions· (G1)⇥ and! (G2) is called a monoid. 1.2. VECTOR SPACES 29 For example, the set N = 0, 1,...,n,... of natu- ral numbers is a (commutative){ monoid under} addition. However, it is not a group. Example 1.1. 1. The set Z = ..., n, . . . , 1, 0, 1,...,n,... of integers is a{ group under addition, with identity} ele- ment 0. However, Z⇤ = Z 0 is not a group under multiplication. { } 2. The set Q of rational numbers (fractions p/q with p, q Z and q =0)isagroupunderaddition,with 2 6 identity element 0. The set Q⇤ = Q 0 is also a group under multiplication, with identity { element} 1. 3. Similarly, the sets R of real numbers and C of com- plex numbers are groups under addition (with iden- tity element 0), and R⇤ = R 0 and C⇤ = C 0 are groups under multiplication { (with} identity element { } 1). 30 CHAPTER 1. BASICS OF LINEAR ALGEBRA 4. The sets Rn and Cn of n-tuples of real or complex numbers are groups under componentwise addition:
(x1,...,xn)+(y1,...,yn)=(x1 + y1,...,xn + yn), with identity element (0,...,0). All these groups are abelian. 5. Given any nonempty set S,thesetofbijections f : S S,alsocalledpermutations of S,isagroup under! function composition (i.e., the multiplication of f and g is the composition g f), with identity element the identity function idS.Thisgroupisnot abelian as soon as S has more than two elements. 6. The set of n n matrices with real (or complex) co- e cients is a⇥ group under addition of matrices, with identity element the null matrix. It is denoted by Mn(R)(orMn(C)). 7. The set R[X]ofallpolynomialsinonevariablewith real coe cients is a group under addition of polyno- mials. 1.2. VECTOR SPACES 31 8. The set of n n invertible matrices with real (or complex) coe ⇥cients is a group under matrix mul- tiplication, with identity element the identity matrix In.Thisgroupiscalledthegeneral linear group and is usually denoted by GL(n, R)(orGL(n, C)). 9. The set of n n invertible matrices with real (or com- plex) coe cients⇥ and determinant +1 is a group un- der matrix multiplication, with identity element the identity matrix In.Thisgroupiscalledthespecial linear group and is usually denoted by SL(n, R)(or SL(n, C)). 10. The set of n n invertible matrices with real coe - ⇥ cients such that RR> = In and of determinant +1 is a group called the special orthogonal group and is usu- ally denoted by SO(n)(whereR> is the transpose of the matrix R,i.e.,therowsofR> are the columns of R). It corresponds to the rotations in Rn. 32 CHAPTER 1. BASICS OF LINEAR ALGEBRA 11. Given an open interval ]a, b[, the set (]a, b[) of con- C tinuous functions f :]a, b[ R is a group under the operation f + g defined such! that (f + g)(x)=f(x)+g(x) for all x ]a, b[. 2
It is customary to denote the operation of an abelian 1 group G by +, in which case the inverse a of an element a G is denoted by a. 2 Vector spaces are defined as follows. 1.2. VECTOR SPACES 33 Definition 1.2. A real vector space is a set E (of vec- tors) together with two operations +: E E E (called ⇥ ! vector addition)1 and : R E E (called scalar multiplication)satisfyingthefollowingconditionsforall· ⇥ ! ↵, R and all u, v E; 2 2 (V0) E is an abelian group w.r.t. +, with identity element 0;2 (V1) ↵ (u + v)=(↵ u)+(↵ v); · · · (V2) (↵ + ) u =(↵ u)+( u); · · · (V3) (↵ ) u = ↵ ( u); ⇤ · · · (V4) 1 u = u. · In (V3), denotes multiplication in R. ⇤
Given ↵ R and v E,theelement↵ v is also denoted 2 2 · by ↵v.ThefieldR is often called the field of scalars.
In definition 1.2, the field R may be replaced by the field of complex numbers C,inwhichcasewehaveacomplex vector space.
1The symbol + is overloaded, since it denotes both addition in the field R and addition of vectors in E. It is usually clear from the context which + is intended. 2The symbol 0 is also overloaded, since it represents both the zero in R (a scalar) and the identity element of E (the zero vector). Confusion rarely arises, but one may prefer using 0 for the zero vector. 34 CHAPTER 1. BASICS OF LINEAR ALGEBRA It is even possible to replace R by the field of rational numbers Q or by any other field K (for example Z/pZ, where p is a prime number), in which case we have a K-vector space (in (V3), denotes multiplication in the field K). ⇤
In most cases, the field K will be the field R of reals.
From (V0), a vector space always contains the null vector 0, and thus is nonempty.
From (V1), we get ↵ 0=0,and↵ ( v)= (↵ v). · · · From (V2), we get 0 v =0,and( ↵) v = (↵ v). · · · Another important consequence of the axioms is the fol- lowing fact: For any u E and any R,if =0and u =0,thenu =0. 2 2 6 · The field R itself can be viewed as a vector space over itself, addition of vectors being addition in the field, and multiplication by a scalar being multiplication in the field. 1.2. VECTOR SPACES 35 Example 1.2. 1. The fields R and C are vector spaces over R. 2. The groups Rn and Cn are vector spaces over R,and Cn is a vector space over C.
3. The ring R[X]n of polynomials of degree at most n with real coe cients is a vector space over R,andthe ring C[X]n of polynomials of degree at most n with complex coe cients is a vector space over C. 4. The ring R[X]ofallpolynomialswithrealcoe cients is a vector space over R,andtheringC[X]ofall polynomials with complex coe cients is a vector space over C.
5. The ring of n n matrices Mn(R)isavectorspace ⇥ over R.
6. The ring of m n matrices Mm,n(R)isavectorspace ⇥ over R. 7. The ring (]a, b[) of continuous functions f :]a, b[ C ! R is a vector space over R. 36 CHAPTER 1. BASICS OF LINEAR ALGEBRA Let E be a vector space. We would like to define the important notions of linear combination and linear inde- pendence.
These notions can be defined for sets of vectors in E,but it will turn out to be more convenient to define them for families (vi)i I,whereI is any arbitrary index set. 2 1.3. LINEAR INDEPENDENCE, SUBSPACES 37 1.3 Linear Independence, Subspaces
One of the most useful properties of vector spaces is that there possess bases.
What this means is that in every vector space, E,thereis some set of vectors, e1,...,en ,suchthatevery vector v E can be written{ as a linear} combination, 2 v = e + + e , 1 1 ··· n n of the ei,forsomescalars, 1,..., n R. 2
Furthermore, the n-tuple, ( 1,..., n), as above is unique.
This description is fine when E has a finite basis, e ,...,e ,butthisisnotalwaysthecase! { 1 n} For example, the vector space of real polynomials, R[X], does not have a finite basis but instead it has an infinite basis, namely 1,X,X2,...,Xn,... 38 CHAPTER 1. BASICS OF LINEAR ALGEBRA For simplicity, in this chapter, we will restrict our atten- tion to vector spaces that have a finite basis (we say that they are finite-dimensional).
Given a set A,anI-indexed family (ai)i I of elements of A (for short, a family)issimplyafunction2 a: I A. ! Remark: When considering a family (ai)i I,thereisno reason to assume that I is ordered. 2
The crucial point is that every element of the family is uniquely indexed by an element of I.
Thus, unless specified otherwise, we do not assume that the elements of an index set are ordered.
We agree that when I = ,(ai)i I = .Afamily(ai)i I is finite if I is finite. ; 2 ; 2 1.3. LINEAR INDEPENDENCE, SUBSPACES 39
Given a family (ui)i I and any element v,wedenoteby 2 (ui)i I k (v) 2 [ the family (wi)i I k defined such that, wi = ui if i I, and w = v,where2 [{k} is any index such that k/I. 2 k 2
Given a family (ui)i I,asubfamily of (ui)i I is a family 2 2 (uj)j J where J is any subset of I. 2 In this chapter, unless specified otherwise, it is assumed that all families of scalars are finite (i.e., their index set is finite). 40 CHAPTER 1. BASICS OF LINEAR ALGEBRA Definition 1.3. Let E be a vector space. A vector v E is a linear combination of a family (ui)i I of 2 2 elements of E i↵there is a family ( i)i I of scalars in R such that 2 v = iui. i I X2 When I = ,westipulatethatv =0. ;
We say that a family (ui)i I is linearly independent i↵ 2 for every family ( i)i I of scalars in R, 2 u =0 impliesthat =0 foralli I. i i i 2 i I X2 Equivalently, a family (ui)i I is linearly dependent i↵ 2 there is some family ( i)i I of scalars in R such that 2 u =0 and =0 forsomej I. i i j 6 2 i I X2 We agree that when I = ,thefamily is linearly inde- pendent. ; ;
Afamily(ui)i I is linearly independent i↵either I = , or I consists of2 a single element i and u =0,or I ;2 i 6 | | and no vector uj in the family can be expressed as a linear combination of the other vectors in the family. 1.3. LINEAR INDEPENDENCE, SUBSPACES 41
Afamily(ui)i I is linearly dependent i↵either I consists of a single element,2 say i,andu =0,or I 2andsome i | | uj in the family can be expressed as a linear combination of the other vectors in the family.
When I is nonempty, if the family (ui)i I is linearly in- 2 dependent, then ui =0foralli I.Furthermore,if I 2, then u = u6 for all i, j 2I with i = j. | | i 6 j 2 6
Example 1.3. 1. Any two distinct scalars , µ =0inR are linearly dependent. 6 2. In R3,thevectors(1, 0, 0), (0, 1, 0), and (0, 0, 1) are linearly independent. 3. In R4,thevectors(1, 1, 1, 1), (0, 1, 1, 1), (0, 0, 1, 1), and (0, 0, 0, 1) are linearly independent. 4. In R2,thevectorsu =(1, 1), v =(0, 1) and w =(2, 3) are linearly dependent, since w =2u + v. 42 CHAPTER 1. BASICS OF LINEAR ALGEBRA When I is finite, we often assume that it is the set I = 1, 2,...,n .Inthiscase,wedenotethefamily(ui)i I { } 2 as (u1,...,un).
The notion of a subspace of a vector space is defined as follows.
Definition 1.4. Given a vector space E,asubsetF of E is a linear subspace (or subspace)ofE i↵ F is nonempty and u + µv F for all u, v F ,andall , µ R. 2 2 2
It is easy to see that a subspace F of E is indeed a vector space.
It is also easy to see that any intersection of subspaces is a subspace.
Every subspace contains the vector 0.
For any nonempty finite index set I,onecanshowby induction on the cardinality of I that if (ui)i I is any 2 family of vectors ui F and ( i)i I is any family of 2 2 scalars, then i I iui F . 2 2 P 1.3. LINEAR INDEPENDENCE, SUBSPACES 43 The subspace 0 will be denoted by (0), or even 0 (with amildabuseofnotation).{ } Example 1.4. 1. In R2,thesetofvectorsu =(x, y)suchthat x + y =0 is a subspace. 2. In R3,thesetofvectorsu =(x, y, z)suchthat x + y + z =0 is a subspace. 3. For any n 0, the set of polynomials f(X) R[X] 2 of degree at most n is a subspace of R[X]. 4. The set of upper triangular n n matrices is a sub- space of the space of n n matrices.⇥ ⇥
Proposition 1.1. Given any vector space E, if S is any nonempty subset of E, then the smallest subspace S (or Span(S)) of E containing S is the set of all (finite)h i linear combinations of elements from S. 44 CHAPTER 1. BASICS OF LINEAR ALGEBRA One might wonder what happens if we add extra condi- tions to the coe cients involved in forming linear combi- nations.
Here are three natural restrictions which turn out to be important (as usual, we assume that our index sets are finite):
(1) Consider combinations i I iui for which 2 P i =1. i I X2 These are called a ne combinations.
One should realize that every linear combination
i I iui can be viewed as an a ne combination. 2 P However, we get new spaces. For example, in R3, the set of all a ne combinations of the three vectors e1 =(1, 0, 0),e2 =(0, 1, 0), and e3 =(0, 0, 1), is the plane passing through these three points.
Since it does not contain 0 = (0, 0, 0), it is not a linear subspace. 1.3. LINEAR INDEPENDENCE, SUBSPACES 45
(2) Consider combinations i I iui for which 2 i 0, Pfor all i I. 2 These are called positive (or conic) combinations.
It turns out that positive combinations of families of vectors are cones.Theyshowupnaturallyinconvex optimization.
(3) Consider combinations i I iui for which we require (1) and (2), that is 2 P =1, and 0foralli I. i i 2 i I X2 These are called convex combinations.
Given any finite family of vectors, the set of all convex combinations of these vectors is a convex polyhedron.
Convex polyhedra play a very important role in convex optimization. 46 CHAPTER 1. BASICS OF LINEAR ALGEBRA
----
,- I
Figure 1.3: The right Tech 1.4. BASES OF A VECTOR SPACE 47 1.4 Bases of a Vector Space
Definition 1.5. Given a vector space E and a subspace V of E,afamily(vi)i I of vectors vi V spans V or generates V i↵for every2 v V ,thereissomefamily2 2 ( i)i I of scalars in R such that 2
v = ivi. i I X2
We also say that the elements of (vi)i I are generators 2 of V and that V is spanned by (vi)i I,orgenerated by 2 (vi)i I. 2
If a subspace V of E is generated by a finite family (vi)i I, we say that V is finitely generated. 2
Afamily(ui)i I that spans V and is linearly independent is called a basis2 of V . 48 CHAPTER 1. BASICS OF LINEAR ALGEBRA Example 1.5. 1. In R3,thevectors(1, 0, 0), (0, 1, 0), and (0, 0, 1) form abasis. 2. The vectors (1, 1, 1, 1), (1, 1, 1, 1), (1, 1, 0, 0), (0, 0, 1, 1) form a basis of R4 known as the Haar basis.Thisbasisanditsgeneralizationtodimension 2n are crucial in wavelet theory. 3. In the subspace of polynomials in R[X]ofdegreeat most n,thepolynomials1,X,X2, ...,Xn form a ba- sis.
n k n k 4. The Bernstein polynomials (1 X) X for k k =0,...,n,alsoformabasisofthatspace.These✓ ◆ polynomials play a major role in the theory of spline curves.
It is a standard result of linear algebra that every vector space E has a basis, and that for any two bases (ui)i I 2 and (vj)j J, I and J have the same cardinality. 2 In particular, if E has a finite basis of n elements, every basis of E has n elements, and the integer n is called the dimension of the vector space E. 1.4. BASES OF A VECTOR SPACE 49 We begin with a crucial lemma.
Lemma 1.2. Given a linearly independent family (ui)i I of elements of a vector space E, if v E is not a lin-2 2 ear combination of (ui)i I, then the family (ui)i I k(v) 2 2 [ obtained by adding v to the family (ui)i I is linearly independent (where k/I). 2 2
The next theorem holds in general, but the proof is more sophisticated for vector spaces that do not have a finite set of generators.
Theorem 1.3. Given any finite family S =(ui)i I generating a vector space E and any linearly indepen-2 dent subfamily L =(uj)j J of S (where J I), there is a basis B of E such that2 L B S. ✓ ✓ ✓ 50 CHAPTER 1. BASICS OF LINEAR ALGEBRA The following proposition giving useful properties charac- terizing a basis is an immediate consequence of Theorem 1.3.
Proposition 1.4. Given a vector space E, for any family B =(vi)i I of vectors of E, the following prop- erties are equivalent:2 (1) B is a basis of E. (2) B is a maximal linearly independent family of E. (3) B is a minimal generating family of E.
The following replacement lemma due to Steinitz shows the relationship between finite linearly independent fam- ilies and finite families of generators of a vector space. 1.4. BASES OF A VECTOR SPACE 51 Proposition 1.5. (Replacement lemma) Given a vec- tor space E, let (ui)i I be any finite linearly indepen- 2 dent family in E, where I = m, and let (vj)j J be | | 2 any finite family such that every ui is a linear combi- nation of (vj)j J, where J = n. Then, there exists a set L and an injection2 ⇢|: |L J (a relabeling func- tion) such that L I = , L!= n m, and the fam- \ ; | | ilies (ui)i I (v⇢(l))l L and (vj)j J generate the same subspace2 of [E. In particular,2 m2 n.
The idea is that m of the vectors vj can be replaced by the linearly independent ui’s in such a way that the same subspace is still generated.
The purpose of the function ⇢: L J is to pick n m el- ! ements j1,...,jn m of J and to relabel them l1,...,ln m in such a way that these new indices do not clash with the indices in I;thisway,thevectorsvj1,...,vjn m who “sur- vive” (i.e. are not replaced) are relabeled vl1,...,vln m, and the other m vectors vj with j J j1,...,jn m 2 { } are replaced by the ui.Theindexsetofthisnewfamily is I L. [ 52 CHAPTER 1. BASICS OF LINEAR ALGEBRA Actually, one can prove that Proposition 1.5 implies The- orem 1.3 when the vector space is finitely generated.
Putting Theorem 1.3 and Proposition 1.5 together, we obtain the following fundamental theorem.
Theorem 1.6. Let E be a finitely generated vector space. Any family (ui)i I generating E contains a 2 subfamily (uj)j J which is a basis of E. Furthermore, 2 for every two bases (ui)i I and (vj)j J of E, we have I = J = n for some fixed2 integer n2 0. | | | | Remark: Theorem 1.6 also holds for vector spaces that are not finitely generated.
When E is not finitely generated, we say that E is of infinite dimension.
The dimension of a finitely generated vector space E is the common dimension n of all of its bases and is denoted by dim(E). 1.4. BASES OF A VECTOR SPACE 53 Clearly, if the field R itself is viewed as a vector space, then every family (a)wherea R and a =0isabasis. 2 6 Thus dim(R)=1.
Note that dim( 0 )=0. { } If E is a vector space of dimension n 1, for any sub- space U of E, if dim(U)=1,thenU is called a line; if dim(U)=2,thenU is called a plane; if dim(U)=n 1, then U is called a hyperplane. If dim(U)=k,thenU is sometimes called a k-plane.
Let (ui)i I be a basis of a vector space E. 2
For any vector v E,sincethefamily(ui)i I generates 2 2 E,thereisafamily( i)i I of scalars in R,suchthat 2
v = iui. i I X2 54 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Averyimportantfactisthatthefamily( i)i I is unique. 2
Proposition 1.7. Given a vector space E, let (ui)i I be a family of vectors in E. Let v E, and assume2 2 that v = i I iui. Then, the family ( i)i I of scalars 2 2 such that v = i I iui is unique i↵ (ui)i I is linearly independent.P 2 2 P
If (ui)i I is a basis of a vector space E,foranyvector 2 v E,if(xi)i I is the unique family of scalars in R such that2 2 v = xiui, i I X2 each xi is called the component (or coordinate) of index i of v with respect to the basis (ui)i I. 2 Many interesting mathematical structures are vector spaces.
Averyimportantexampleisthesetoflinearmapsbe- tween two vector spaces to be defined in the next section. 1.4. BASES OF A VECTOR SPACE 55 Here is an example that will prepare us for the vector space of linear maps.
Example 1.6. Let X be any nonempty set and let E be a vector space. The set of all functions f : X E can be made into a vector space as follows: Given! any two functions f : X E and g : X E,let (f + g): X E be! defined such that! ! (f + g)(x)=f(x)+g(x) for all x X,andforevery R,let f : X E be defined such2 that 2 ! ( f)(x)= f(x) for all x X. 2 The axioms of a vector space are easily verified. 56 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Figure 1.4: Early Traveling 1.5. LINEAR MAPS 57 1.5 Linear Maps
Afunctionbetweentwovectorspacesthatpreservesthe vector space structure is called a homomorphism of vector spaces, or linear map.
Linear maps formalize the concept of linearity of a func- tion.
Keep in mind that linear maps, which are transformations of space, are usually far more important than the spaces themselves.
In the rest of this section, we assume that all vector spaces are real vector spaces. 58 CHAPTER 1. BASICS OF LINEAR ALGEBRA Definition 1.6. Given two vector spaces E and F ,a linear map between E and F is a function f : E F satisfying the following two conditions: ! f(x + y)=f(x)+f(y)forallx, y E; 2 f( x)= f(x)forall R,x E. 2 2
Setting x = y =0inthefirstidentity,wegetf(0) = 0.
The basic property of linear maps is that they transform linear combinations into linear combinations.
Given any finite family (ui)i I of vectors in E,givenany 2 family ( i)i I of scalars in R,wehave 2
f( iui)= if(ui). i I i I X2 X2 The above identity is shown by induction on I using the properties of Definition 1.6. | | 1.5. LINEAR MAPS 59 Example 1.7. 1. The map f : R2 R2 defined such that ! x0 = x y y0 = x + y is a linear map. 2. For any vector space E,theidentity map id: E E given by ! id(u)=u for all u E 2 is a linear map. When we want to be more precise, we write idE instead of id. 3. The map D : R[X] R[X]definedsuchthat ! D(f(X)) = f 0(X),
where f 0(X)isthederivativeofthepolynomialf(X), is a linear map 60 CHAPTER 1. BASICS OF LINEAR ALGEBRA Definition 1.7. Given a linear map f : E F ,we define its image (or range) Im f = f(E), as the! set Im f = y F ( x E)(y = f(x)) , { 2 | 9 2 } 1 and its Kernel (or nullspace) Ker f = f (0), as the set Ker f = x E f(x)=0 . { 2 | }
Proposition 1.8. Given a linear map f : E F , the set Im f is a subspace of F and the set Ker!f is a subspace of E. The linear map f : E F is injective i↵ Ker f =0(where 0 is the trivial subspace! 0 ). { }
Since by Proposition 1.8, the image Im f of a linear map f is a subspace of F ,wecandefinetherank rk(f)off as the dimension of Im f. 1.5. LINEAR MAPS 61 Afundamentalpropertyofbasesinavectorspaceisthat they allow the definition of linear maps as unique homo- morphic extensions, as shown in the following proposi- tion.
Proposition 1.9. Given any two vector spaces E and F , given any basis (ui)i I of E, given any other family 2 of vectors (vi)i I in F , there is a unique linear map f : E F such2 that f(u )=v for all i I. ! i i 2
Furthermore, f is injective i↵ (vi)i I is linearly inde- 2 pendent, and f is surjective i↵ (vi)i I generates F . 2
By the second part of Proposition 1.9, an injective linear map f : E F sends a basis (ui)i I to a linearly inde- ! 2 pendent family (f(ui))i I of F ,whichisalsoabasiswhen f is bijective. 2
Also, when E and F have the same finite dimension n, (ui)i I is a basis of E,andf : E F is injective, then 2 ! (f(ui))i I is a basis of F (by Proposition 1.4). 2 62 CHAPTER 1. BASICS OF LINEAR ALGEBRA The following simple proposition is also useful.
Proposition 1.10. Given any two vector spaces E and F , with F nontrivial, given any family (ui)i I of vectors in E, the following properties hold: 2
(1) The family (ui)i I generates E i↵for every family 2 of vectors (vi)i I in F , there is at most one linear map f : E F2 such that f(u )=v for all i I. ! i i 2 (2) The family (ui)i I is linearly independent i↵for 2 every family of vectors (vi)i I in F , there is some 2 linear map f : E F such that f(ui)=vi for all i I. ! 2 1.5. LINEAR MAPS 63 Given vector spaces E, F ,andG,andlinearmaps f : E F and g : F G,itiseasilyverifiedthatthe composition! g f : E ! G of f and g is a linear map. ! Alinearmapf : E F is an isomorphism i↵there is alinearmapg : F !E,suchthat ! g f =id and f g =id . ( ) E F ⇤ It is immediately verified that such a map g is unique.
The map g is called the inverse of f and it is also denoted 1 by f .
Proposition 1.9 shows that if F = Rn,thenwegetan isomorphism between any vector space E of dimension J = n and Rn. | | One can verify that if f : E F is a bijective linear 1 ! map, then its inverse f : F E is also a linear map, and thus f is an isomorphism.! 64 CHAPTER 1. BASICS OF LINEAR ALGEBRA Another useful corollary of Proposition 1.9 is this:
Proposition 1.11. Let E be a vector space of finite dimension n 1 and let f : E E be any linear map. The following properties hold:! (1) If f has a left inverse g, that is, if g is a linear map such that g f =id, then f is an isomorphism 1 and f = g. (2) If f has a right inverse h, that is, if h is a linear map such that f h =id, then f is an isomorphism 1 and f = h.
The set of all linear maps between two vector spaces E and F is denoted by Hom(E,F). 1.5. LINEAR MAPS 65 When we wish to be more precise and specify the field K over which the vector spaces E and F are defined we write HomK(E,F).
The set Hom(E,F)isavectorspaceundertheoperations defined at the end of Section 1.1, namely (f + g)(x)=f(x)+g(x) for all x E,and 2 ( f)(x)= f(x) for all x E. 2 When E and F have finite dimensions, the vector space Hom(E,F)alsohasfinitedimension,asweshallsee shortly.
When E = F ,alinearmapf : E E is also called an endomorphism.ThespaceHom(E,E! )isalsodenoted by End(E). 66 CHAPTER 1. BASICS OF LINEAR ALGEBRA It is also important to note that composition confers to Hom(E,E)aringstructure.
Indeed, composition is an operation :Hom(E,E) Hom(E,E) Hom(E,E), which is ⇥ ! associative and has an identity idE,andthedistributivity properties hold: (g + g ) f = g f + g f; 1 2 1 2 g (f + f )=g f + g f . 1 2 1 2 The ring Hom(E,E)isanexampleofanoncommutative ring.
It is easily seen that the set of bijective linear maps f : E E is a group under composition. Bijective linear maps! are also called automorphisms.
The group of automorphisms of E is called the general linear group (of E),anditisdenotedbyGL(E), or by Aut(E), or when E = Rn,byGL(n, R), or even by GL(n). 1.5. LINEAR MAPS 67
"I A\)(i\\«£. "\\J'l\) AN\) THE. V'AA6t-JI1A''f\ c MJ rJ DJ ev:r \ AJ-?o A'Jr-A\ot r\\T.\'
Figure 1.5: Hitting Power 68 CHAPTER 1. BASICS OF LINEAR ALGEBRA 1.6 Matrices
Proposition 1.9 shows that given two vector spaces E and F and a basis (uj)j J of E,everylinearmapf : E F 2 ! is uniquely determined by the family (f(uj))j J of the 2 images under f of the vectors in the basis (uj)j J. 2
If we also have a basis (vi)i I of F ,theneveryvector 2 f(uj)canbewritteninauniquewayas
f(uj)= aijvi, i I X2 where j J,forafamilyofscalars(aij)i I. 2 2
Thus, with respect to the two bases (uj)j J of E and 2 (vi)i I of F ,thelinearmapf is completely determined by a2 “I J-matrix” ⇥ M(f)=(aij)i I, j J. 2 2 1.6. MATRICES 69 Remark: Note that we intentionally assigned the index set J to the basis (uj)j J of E,andtheindexI to the 2 basis (vi)i I of F ,sothattherows of the matrix M(f) associated2 with f : E F are indexed by I,andthe columns of the matrix!M(f)areindexedbyJ.
Obviously, this causes a mildly unpleasant reversal. If we had considered the bases (ui)i I of E and (vj)j J of F , 2 2 we would obtain a J I-matrix M(f)=(aji)j J, i I. ⇥ 2 2 No matter what we do, there will be a reversal! We de- cided to stick to the bases (uj)j J of E and (vi)i I of F , so that we get an I J-matrix2M(f), knowing2 that we may occasionally su↵⇥er from this decision! 70 CHAPTER 1. BASICS OF LINEAR ALGEBRA When I and J are finite, and say, when I = m and J = n,thelinearmapf is determined by| the| matrix M| (|f) whose entries in the j-th column are the components of the vector f(uj)overthebasis(v1,...,vm), that is, the matrix
a11 a12 ... a1 n a a ... a M(f)= 21 22 2 n 0 ...... 1 Ba a ... a C B m 1 m 2 mnC @ A whose entry on row i and column j is aij (1 i m, 1 j n). 1.6. MATRICES 71 We will now show that when E and F have finite dimen- sion, linear maps can be very conveniently represented by matrices, and that composition of linear maps corre- sponds to matrix multiplication.
We will follow rather closely an elegant presentation method due to Emil Artin.
Let E and F be two vector spaces, and assume that E has a finite basis (u1,...,un)andthatF has a finite basis (v1,...,vm). Recall that we have shown that every vector x E can be written in a unique way as 2 x = x u + + x u , 1 1 ··· n n and similarly every vector y F can be written in a unique way as 2 y = y v + + y v . 1 1 ··· m m
Let f : E F be a linear map between E and F . ! 72 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Then, for every x = x1u1 + + xnun in E,bylinearity, we have ··· f(x)=x f(u )+ + x f(u ). 1 1 ··· n n Let f(u )=a v + + a v , j 1 j 1 ··· mj m or more concisely, m
f(uj)= aijvi, i=1 X for every j,1 j n. This can be expressed by writing the coe cients a1j,a2j,...,amj of f(uj)overthebasis(v1,...,vm), as the jth column of a matrix, as shown below:
f(u1) f(u2) ... f(un)
v1 a11 a12 ... a1n v2 a21 a22 ... a2n . 0 ...... 1 v Ba a ... a C m B m1 m2 mn C @ A 1.6. MATRICES 73
Then, substituting the right-hand side of each f(uj)into the expression for f(x), we get m m f(x)=x ( a v )+ + x ( a v ), 1 i 1 i ··· n in i i=1 i=1 X X which, by regrouping terms to obtain a linear combination of the vi,yields n n f(x)=( a x )v + +( a x )v . 1 j j 1 ··· mj j m j=1 j=1 X X
Thus, letting f(x)=y = y v + + y v ,wehave 1 1 ··· m m n
yi = aijxj (1) j=1 X for all i,1 i m. To make things more concrete, let us treat the case where n =3andm =2. 74 CHAPTER 1. BASICS OF LINEAR ALGEBRA In this case,
f(u1)=a11v1 + a21v2 f(u2)=a12v1 + a22v2 f(u3)=a13v1 + a23v2, which in matrix form is expressed by
f(u1) f(u2) f(u3) v a a a 1 11 12 13 , v a a a 2 ✓ 21 22 23 ◆ and for any x = x1u1 + x2u2 + x3u3,wehave
f(x)=f(x1u1 + x2u2 + x3u3) = x1f(u1)+x2f(u2)+x3f(u3) = x1(a11v1 + a21v2)+x2(a12v1 + a22v2) + x3(a13v1 + a23v2) =(a11x1 + a12x2 + a13x3)v1 +(a21x1 + a22x2 + a23x3)v2.
Consequently, since
y = y1v1 + y2v2, 1.6. MATRICES 75 we have
y1 = a11x1 + a12x2 + a13x3 y2 = a21x1 + a22x2 + a23x3.
This agrees with the matrix equation
x1 y1 a11 a12 a13 = x2 . y2 a21 a22 a23 0 1 ✓ ◆ ✓ ◆ x3 @ A Let us now consider how the composition of linear maps is expressed in terms of bases.
Let E, F ,andG,bethreevectorsspaceswithrespec- tive bases (u1,...,up)forE,(v1,...,vn)forF ,and (w1,...,wm)forG.
Let g : E F and f : F G be linear maps. ! ! As explained earlier, g : E F is determined by the im- ages of the basis vectors u ,and! f : F G is determined j ! by the images of the basis vectors vk. 76 CHAPTER 1. BASICS OF LINEAR ALGEBRA We would like to understand how f g : E G is de- ! termined by the images of the basis vectors uj.
Remark: Note that we are considering linear maps g : E F and f : F G,insteadoff : E F and g : F ! G,whichyieldsthecomposition! f g!: E G instead! of g f : E G. ! ! Our perhaps unusual choice is motivated by the fact that if f is represented by a matrix M(f)=(aik)andg is represented by a matrix M(g)=(bkj), then f g : E G is represented by the product AB of the matrices A!and B.
If we had adopted the other choice where f : E F and g : F G,theng f : E G would be represented! by the product! BA. !
Obviously, this is a matter of taste! We will have to live with our perhaps unorthodox choice. 1.6. MATRICES 77 Thus, let m
f(vk)= aikwi, i=1 X for every k,1 k n,andlet n
g(uj)= bkjvk, Xk=1 for every j,1 j p. Also if x = x u + + x u , 1 1 ··· p p let y = g(x) and z = f(y)=(f g)(x), with y = y v + + y v 1 1 ··· n n and z = z w + + z w . 1 1 ··· m m 78 CHAPTER 1. BASICS OF LINEAR ALGEBRA After some calculations, we get p n
zi = ( aikbkj)xj. j=1 X Xk=1
Thus, defining cij such that n
cij = aikbkj, Xk=1 for 1 i m,and1 j p,wehave p
zi = cijxj (4) j=1 X
Identity (4) suggests defining a multiplication operation on matrices, and we proceed to do so. 1.6. MATRICES 79 Definition 1.8. If K = R or K = C,anm n-matrix ⇥ over K is a family (aij)1 i m, 1 j n of scalars in K,rep- resented by an array
a11 a12 ... a1 n a21 a22 ... a2 n 0 ...... 1 Ba a ... a C B m 1 m 2 mnC @ A In the special case where m =1,wehavearow vector, represented by
(a a ) 11 ··· 1 n and in the special case where n =1,wehaveacolumn vector,representedby
a11 . 0 1 am 1 @ A In these last two cases, we usually omit the constant index 1(firstindexincaseofarow,secondindexincaseofa column). 80 CHAPTER 1. BASICS OF LINEAR ALGEBRA The set of all m n-matrices is denoted by M (K)or ⇥ m,n Mm,n.
An n n-matrix is called a square matrix of dimension n. ⇥
The set of all square matrices of dimension n is denoted by Mn(K), or Mn.
Remark: As defined, a matrix A =(aij)1 i m, 1 j n is a family,thatis,afunctionfrom 1, 2,...,m 1, 2,...,n to K. { }⇥ { } As such, there is no reason to assume an ordering on the indices. Thus, the matrix A can be represented in many di↵erent ways as an array, by adopting di↵erent orders for the rows or the columns.
However, it is customary (and usually convenient) to as- sume the natural ordering on the sets 1, 2,...,m and 1, 2,...,n ,andtorepresentA as an{ array according} to{ this ordering} of the rows and columns. 1.6. MATRICES 81 We also define some operations on matrices as follows. Definition 1.9. Given two m n matrices A =(a ) ⇥ ij and B =(bij), we define their sum A + B as the matrix C =(cij)suchthatcij = aij + bij;thatis,
a11 a12 ... a1 n b11 b12 ... b1 n a a ... a b b ... b 21 22 2 n + 21 22 2 n 0 ...... 1 0 ...... 1 Ba a ... a C Bb b ... b C B m 1 m 2 mnC B m 1 m 2 mnC @ a11 + b11A a12@+ b12 ... a1 n +Ab1 n a + b a + b ... a + b = 21 21 22 22 2 n 2 n . 0 ...... 1 Ba + b a + b ... a + b C B m 1 m 1 m 2 m 2 mn mnC @ A We define the matrix A as the matrix ( a ). ij Given a scalar K,wedefinethematrix A as the 2 matrix C =(cij)suchthatcij = aij;thatis
a11 a12 ... a1 n a11 a12 ... a1 n a a ... a a a ... a 21 22 2 n = 21 22 2 n . 0 ...... 1 0 ...... 1 Ba a ... a C B a a ... a C B m 1 m 2 mnC B m 1 m 2 mnC @ A @ A 82 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Given an m n matrices A =(aik)andann p matrices B =(b ),⇥ we define their product AB as⇥ the m p kj ⇥ matrix C =(cij)suchthat n
cij = aikbkj, Xk=1 for 1 i m,and1 j p.IntheproductAB = C shown below
a11 a12 ... a1 n b11 b12 ... b1 p a21 a22 ... a2 n b21 b22 ... b2 p 0 ...... 1 0 ...... 1 Ba a ... a C Bb b ... b C B m 1 m 2 mnC B n 1 n 2 npC @ A @ c11 c12A... c1 p c c ... c = 21 22 2 p 0 ...... 1 Bc c ... c C B m 1 m 2 mpC @ A 1.6. MATRICES 83 note that the entry of index i and j of the matrix AB ob- tained by multiplying the matrices A and B can be iden- tified with the product of the row matrix corresponding to the i-th row of A with the column matrix corre- sponding to the j-column of B:
b1 j n (a a ) . = a b . i 1 ··· in 0 1 ik kj b k=1 nj X @ A
The square matrix In of dimension n containing 1 on the diagonal and 0 everywhere else is called the identity matrix.Itisdenotedby
10... 0 01... 0 I = n 0 ...... 1 B00... 1 C B C @ A
Given an m n matrix A =(a ), its transpose A> = ⇥ ij (aji> ), is the n m-matrix such that aji> = aij,foralli, 1 i m,andall⇥ j,1 j n. The transpose of a matrix A is sometimes denoted by At, or even by tA. 84 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Note that the transpose A> of a matrix A has the prop- erty that the j-th row of A> is the j-th column of A.
In other words, transposition exchanges the rows and the columns of a matrix.
The following observation will be useful later on when we discuss the SVD. Given any m n matrix A and any n p matrix B,ifwedenotethecolumnsof⇥ A by A1,...,A⇥ n and the rows of B by B1,...,Bn,thenwehave AB = A1B + + AnB . 1 ··· n
For every square matrix A of dimension n,itisimmedi- ately verified that AIn = InA = A.
If a matrix B such that AB = BA = In exists, then it is unique, and it is called the inverse of A.ThematrixB 1 is also denoted by A .
An invertible matrix is also called a nonsingular matrix, and a matrix that is not invertible is called a singular matrix. 1.6. MATRICES 85 Proposition 1.11 shows that if a square matrix A has a left inverse, that is a matrix B such that BA = I,ora right inverse, that is a matrix C such that AC = I,then 1 1 A is actually invertible; so B = A and C = A .This also follows from Proposition 1.25.
It is immediately verified that the set Mm,n(K)ofm n matrices is a vector space under addition of matrices⇥ and multiplication of a matrix by a scalar.
Consider the m n-matrices Ei,j =(ehk), defined such that e =1,and⇥e =0,ifh = i or k = j. ij hk 6 6
It is clear that every matrix A =(aij) Mm,n(K)can be written in a unique way as 2 m n
A = aijEi,j. i=1 j=1 X X
Thus, the family (Ei,j)1 i m,1 j n is a basis of the vector space Mm,n(K), which has dimension mn. 86 CHAPTER 1. BASICS OF LINEAR ALGEBRA Square matrices provide a natural example of a noncom- mutative ring with zero divisors.
Example 1.8. For example, letting A, B be the 2 2- matrices ⇥ 10 00 A = ,B= , 00 10 ✓ ◆ ✓ ◆ then 10 00 00 AB = = , 00 10 00 ✓ ◆✓ ◆ ✓ ◆ and 00 10 00 BA = = . 10 00 10 ✓ ◆✓ ◆ ✓ ◆
We now formalize the representation of linear maps by matrices. 1.6. MATRICES 87 Definition 1.10. Let E and F be two vector spaces, and let (u1,...,un)beabasisforE,and(v1,...,vm)be abasisforF .Eachvectorx E expressed in the basis 2 (u1,...,un)asx = x1u1 + + xnun is represented by the column matrix ··· x1 M(x)= . 0 1 xn and similarly for each vector y@ FAexpressed in the basis (v ,...,v ). Every linear map2f : E F is represented 1 m ! by the matrix M(f)=(aij), where aij is the i-th compo- nent of the vector f(uj)overthebasis(v1,...,vm), i.e., where m f(u )= a v , for every j,1 j n. j ij i i=1 X The coe cients a1j,a2j,...,amj of f(uj)overthebasis (v1,...,vm)formthejth column of the matrix M(f) shown below:
f(u1) f(u2) ... f(un)
v1 a11 a12 ... a1n v a a ... a 2 21 22 2n . . 0 ...... 1 v Ba a ... a C m B m1 m2 mn C @ A 88 CHAPTER 1. BASICS OF LINEAR ALGEBRA The matrix M(f)associatedwiththelinearmap f : E F is called the matrix of f with respect to the ! bases (u1,...,un) and (v1,...,vm).
When E = F and the basis (v1,...,vm)isidenticalto the basis (u1,...,un)ofE,thematrixM(f)associated with f : E E (as above) is called the matrix of f with ! respect to the basis (u1,...,un).
Remark: As in the remark after Definition 1.8, there is no reason to assume that the vectors in the bases (u1,...,un)and(v1,...,vm)areorderedinanyparticu- lar way.
However, it is often convenient to assume the natural or- dering. When this is so, authors sometimes refer to the matrix M(f)asthematrixoff with respect to the ordered bases (u1,...,un)and(v1,...,vm). 1.6. MATRICES 89 Then, given a linear map f : E F represented by the ! matrix M(f)=(aij)w.r.t.thebases(u1,...,un)and (v1,...,vm), by equations (1) and the definition of matrix multiplication, the equation y = f(x) corresponds to the matrix equation M(y)=M(f)M(x),thatis,
y1 a11 ... a1 n x1 . = ...... 0 1 0 1 0 1 ym am 1 ... amn xn Recall that@ A @ A @ A
a11 a12 ... a1 n x1 a21 a22 ... a2 n x2 0 ...... 1 0 . 1 Ba a ... a C Bx C B m 1 m 2 mnC B nC @ A @ A a11 a12 a1 n a21 a22 a2 n = x1 0 . 1 + x2 0 . 1 + + xn 0 . 1 . . . ··· . Ba C Ba C Ba C B m 1C B m 2C B mnC @ A @ A @ A 90 CHAPTER 1. BASICS OF LINEAR ALGEBRA Sometimes, it is necessary to incoporate the bases (u1,...,un)and(v1,...,vm)inthenotationforthema- trix M(f)expressingf with respect to these bases. This turns out to be a messy enterprise!
We propose the following course of action: write =(u1,...,un)and =(v1,...,vm)forthebasesof EU and F ,anddenotebyV
M , (f) U V the matrix of f with respect to the bases and . U V Furthermore, write x for the coordinates M(x)=(x ,...,x )ofU x E w.r.t. the basis and 1 n 2 U write y for the coordinates M(y)=(y1,...,ym)of y F w.r.t.V the basis .Then, 2 V y = f(x) is expressed in matrix form by
y = M , (f) x . V U V U
When = ,weabbreviateM , (f)asM (f). U V U V U 1.6. MATRICES 91 The above notation seems reasonable, but it has the slight disadvantage that in the expression M , (f)x ,theinput U V U argument x which is fed to the matrix M , (f)doesnot U U V appear next to the subscript in M , (f). U U V
We could have used the notation M , (f), and some peo- ple do that. But then, we find aV bitU confusing that comes before when f maps from the space E with theV basis to theU space F with the basis . U V
So, we prefer to use the notation M , (f). U V Be aware that other authors such as Meyer [25] use the notation [f] , ,andotherssuchasDummitandFoote U V [13] use the notation M V(f), instead of M , (f). U U V
This gets worse! You may find the notation M U (f)(as in Lang [21]), or [f] ,orotherstrangenotations.V U V 92 CHAPTER 1. BASICS OF LINEAR ALGEBRA Let us illustrate the representation of a linear map by a matrix in a concrete situation.
Let E be the vector space R[X]4 of polynomials of degree at most 4, let F be the vector space R[X]3 of polynomi- als of degree at most 3, and let the linear map be the derivative map d:thatis,
d(P + Q)=dP + dQ d( P )= dP, with R. 2 We choose (1,x,x2,x3,x4)asabasisofE and (1,x,x2,x3) as a basis of F .
Then, the 4 5matrixD associated with d is obtained by expressing⇥ the derivative dxi of each basis vector xi for i =0, 1, 2, 3, 4overthebasis(1,x,x2,x3). 1.6. MATRICES 93 We find
01000 00200 D = . 0000301 B00004C B C @ A Then, if P denotes the polynomial P =3x4 5x3 + x2 7x +5, we have dP =12x3 15x2 +2x 7, the polynomial P is represented by the vector (5, 7, 1, 5, 3) and dP is represented by the vector ( 7 , 2, 15 , 12), and we have 5 01000 7 7 00200 0 1 2 1 = , 0000301 0 151 B 5C B00004C B C B 12 C B C B 3 C B C @ A B C @ A @ A as expected! 94 CHAPTER 1. BASICS OF LINEAR ALGEBRA The kernel (nullspace) of d consists of the polynomials of degree 0, that is, the constant polynomials.
Therefore dim(Ker d)=1,andfrom dim(E)=dim(Kerd)+dim(Imd) (see Theorem 1.22), we get dim(Im d)=4 (since dim(E)=5).
For fun, let us figure out the linear map from the vector space R[X]3 to the vector space R[X]4 given by integra- tion (finding the primitive, or anti-derivative) of xi,for i =0, 1, 2, 3).
The 5 4matrixS representing with respect to the same bases⇥ as before is R 00 0 0 10 0 0 0 1 S = 01/20 0 . B001/30C B C B00 01/4C B C @ A 1.6. MATRICES 95
We verify that DS = I4,
00 0 0 01000 1000 10 0 0 00200 0 1 0100 01/20 0 = , 0000301 000101 B001/30C B00004C B C B0001C B C B00 01/4C B C @ A B C @ A @ A as it should!
The equation DS = I4 show that S is injective and has D as a left inverse. However, SD = I ,andinstead 6 5 00 0 0 00000 01000 10 0 0 01000 0 1 00200 0 1 01/20 0 = 00100 , 0000301 B001/30C B00010C B C B00004C B C B00 01/4C B C B00001C B C @ A B C @ A @ A because constant polynomials (polynomials of degree 0) belong to the kernel of D. 96 CHAPTER 1. BASICS OF LINEAR ALGEBRA The function that associates to a linear map f : E F the matrix M(f)w.r.t.thebases(u ,...,u ) ! 1 n and (v1,...,vm)hasthepropertythatmatrixmultipli- cation corresponds to composition of linear maps.
This allows us to transfer properties of linear maps to matrices. 1.6. MATRICES 97 Proposition 1.12. (1) Given any matrices A Mm,n(K), B Mn,p(K), and C Mp,q(K), we have2 2 2 (AB)C = A(BC); that is, matrix multiplication is associative.
(2) Given any matrices A, B Mm,n(K), and C, D M (K), for all K,2 we have 2 n,p 2 (A + B)C = AC + BC A(C + D)=AC + AD ( A)C = (AC) A( C)= (AC), so that matrix multiplication :M (K) M (K) M (K) is bilinear. · m,n ⇥ n,p ! m,p
Note that Proposition 1.12 implies that the vector space Mn(K)ofsquarematricesisa(noncommutative)ring with unit In. 98 CHAPTER 1. BASICS OF LINEAR ALGEBRA The following proposition states the main properties of the mapping f M(f)betweenHom(E,F)andM . 7! m,n In short, it is an isomorphism of vector spaces.
Proposition 1.13. Given three vector spaces E, F , G, with respective bases (u1,...,up), (v1,...,vn), and (w1,...,wm), the mapping M :Hom(E,F) Mn,p that associates the matrix M(g) to a linear map!g : E F satisfies the following properties for all x E!, all g, h: E F , and all f : F G: 2 ! ! M(g(x)) = M(g)M(x) M(g + h)=M(g)+M(h) M( g)= M(g) M(f g)=M(f)M(g).
Thus, M :Hom(E,F) M is an isomorphism of ! n,p vector spaces, and when p = n and the basis (v1,...,vn) is identical to the basis (u1,...,up), M :Hom(E,E) M is an isomorphism of rings. ! n 1.6. MATRICES 99 In view of Proposition 1.13, it seems preferable to rep- resent vectors from a vector space of finite dimension as column vectors rather than row vectors.
Thus, from now on, we will denote vectors of Rn (or more generally, of Kn)ascolummvectors.
It is important to observe that the isomorphism M :Hom(E,F) M given by Proposition 1.13 de- ! n,p pends on the choice of the bases (u1,...,up)and (v1,...,vn), and similarly for the isomorphism M :Hom(E,E) M ,whichdependsonthechoiceof ! n the basis (u1,...,un).
Thus, it would be useful to know how a change of basis a↵ects the representation of a linear map f : E F as amatrix. ! 100 CHAPTER 1. BASICS OF LINEAR ALGEBRA Proposition 1.14. Let E be a vector space, and let (u1,...,un) be a basis of E. For every family (v1,...,vn), let P =(aij) be the matrix defined such that vj = n i=1 aijui. The matrix P is invertible i↵ (v1,...,vn) is a basis of E. P
Definition 1.11. Given a vector space E of dimension n,foranytwobases(u1,...,un)and(v1,...,vn)ofE, let P =(aij)betheinvertiblematrixdefinedsuchthat n
vj = aijui, i=1 X which is also the matrix of the identity id: E E with ! respect to the bases (v1,...,vn)and(u1,...,un), in that order.Indeed,weexpresseachid(vj)=vj over the basis (u1,...,un). The coe cients a1j,a2j,...,anj of vj over the basis (u1,...,un)formthejth column of the matrix P shown below:
v1 v2 ... vn
u1 a11 a12 ... a1n u a a ... a 2 21 22 2n . . 0 ...... 1 u Ba a ... a C n B n1 n2 nnC @ A 1.6. MATRICES 101 The matrix P is called the change of basis matrix from (u1,...,un) to (v1,...,vn).
Clearly, the change of basis matrix from (v1,...,vn)to 1 (u1,...,un)isP .
Since P =(a )isthematrixoftheidentityid:E E ij ! with respect to the bases (v1,...,vn)and(u1,...,un), given any vector x E,ifx = x u + + x u over 2 1 1 ··· n n the basis (u ,...,u )andx = x0 v + + x0 v over the 1 n 1 1 ··· n n basis (v1,...,vn), from Proposition 1.13, we have
x1 a11 ... a1 n x10 . = ...... 0 1 0 1 0 1 xn an 1 ... ann xn0 @ A @ A @ A showing that the old coordinates (xi)ofx (over (u1,...,un)) are expressed in terms of the new coordinates (xi0)ofx (over (v1,...,vn)).
Now we face the painful task of assigning a “good” nota- tion incorporating the bases =(u ,...,u )and U 1 n =(v1,...,vn)intothenotationforthechangeofbasis matrixV from to . U V 102 CHAPTER 1. BASICS OF LINEAR ALGEBRA Because the change of basis matrix from to is the U V matrix of the identity map idE with respect to the bases and in that order,wecoulddenoteitbyM , (id) V U V U (Meyer [25] uses the notation [I] , ). V U
We prefer to use an abbreviation for M , (id) and we will use the notation V U
P , V U for the change of basis matrix from to . U V Note that
1 P , = P , . U V V U
Then, if we write x =(x1,...,xn)fortheold co- ordinates of x withU respect to the basis and x = U V (x10 ,...,xn0 )forthenew coordinates of x with respect to the basis ,wehave V 1 x = P , x ,x= P , x . U V U V V V U U 1.6. MATRICES 103 The above may look backward, but remember that the matrix M , (f)takesinputexpressedoverthebasis to outputU expressedV over the basis . U V
Consequently, P , takes input expressed over the basis V U V to output expressed over the basis ,andx = P , x matches this point of view! U U V U V
Beware that some authors (such as Artin [1]) define the 1 change of basis matrix from to as P , = P , . Under this point of view, the oldU basisV is expressedU V V U in terms of the new basis .Wefindthisabitunnatural.U V Also, in practice, it seems that the new basis is often expressed in terms of the old basis, rather than the other way around.
Since the matrix P = P , expresses the new basis V U (v1,...,vn)intermsoftheold basis (u1,..., un), we observe that the coordinates (xi)ofavectorx vary in the opposite direction of the change of basis. 104 CHAPTER 1. BASICS OF LINEAR ALGEBRA For this reason, vectors are sometimes said to be con- travariant.
However, this expression does not make sense! Indeed, a vector in an intrinsic quantity that does not depend on a specific basis.
What makes sense is that the coordinates of a vector vary in a contravariant fashion.
Let us consider some concrete examples of change of bases.
2 Example 1.9. Let E = F = R ,withu1 =(1, 0), u =(0, 1), v =(1, 1) and v =( 1, 1). 2 1 2
The change of basis matrix P from the basis =(u1,u2) to the basis =(v ,v )is U V 1 2 1 1 P = 11 ✓ ◆ and its inverse is
1/21/2 P 1 = . 1/21/2 ✓ ◆ 1.6. MATRICES 105
The old coordinates (x1,x2)withrespectto(u1,u2)are expressed in terms of the new coordinates (x10 ,x20 )with respect to (v1,v2)by
x 1 1 x 1 = 10 , x 11 x ✓ 2◆ ✓ ◆✓ 20 ◆ and the new coordinates (x10 ,x20 )withrespectto(v1,v2) are expressed in terms of the old coordinates (x1,x2)with respect to (u1,u2)by
x 1/21/2 x 10 = 1 . x0 1/21/2 x ✓ 2◆ ✓ ◆✓ 2◆ 106 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Example 1.10. Let E = F = R[X]3 be the set of poly- nomials of degree at most 3, and consider the bases = 2 3 3 3 3 3 U (1,x,x ,x )and =(B0(x),B1(x),B2(x),B3(x)), where 3 3 3V 3 B0(x),B1(x),B2(x),B3(x)aretheBernstein polynomi- als of degree 3, given by
B3(x)=(1 x)3 B3(x)=3(1 x)2x 0 1 B3(x)=3(1 x)x2 B3(x)=x3. 2 3
By expanding the Bernstein polynomials, we find that the change of basis matrix P , is given by V U 1000 33 00 P , = 0 1 . V U 3 630 B 13 31C B C @ A We also find that the inverse of P , is V U 10 00 1 11/300 P , = 0 1 . V U 12/31/30 B11 11C B C @ A 1.6. MATRICES 107 Therefore, the coordinates of the polynomial 2x3 x +1 over the basis are V 1 10 00 1 2/3 11/300 1 = , 01/31 012/31/301 0 0 1 B 2 C B11 11C B 2 C B C B C B C @ A @ A @ A and so
2 1 2x3 x +1=B3(x)+ B3(x)+ B3(x)+2B3(x). 0 3 1 3 2 3
Our next example is the Haar wavelets, a fundamental tool in signal processing. 108 CHAPTER 1. BASICS OF LINEAR ALGEBRA 1.7 Haar Basis Vectors and a Glimpse at Wavelets
We begin by considering Haar wavelets in R4.
Wavelets play an important role in audio and video signal processing, especially for compressing long signals into much smaller ones than still retain enough information so that when they are played, we can’t see or hear any di↵erence.
Consider the four vectors w1,w2,w3,w4 given by
1 1 1 0 1 1 1 0 w = w = w = w = . 1 011 2 0 11 3 0 0 1 4 0 1 1 B1C B 1C B 0 C B 1C B C B C B C B C @ A @ A @ A @ A Note that these vectors are pairwise orthogonal, so they are indeed linearly independent (we will see this in a later chapter).
Let = w1,w2,w3,w4 be the Haar basis,andlet W { } 4 = e1,e2,e3,e4 be the canonical basis of R . U { } 1.7. HAAR BASIS VECTORS; A GLIMPSE AT WAVELETS 109
The change of basis matrix W = P , from to is given by W U U W
11 1 0 11 10 W = , 01 10 11 B1 10 1C B C @ A and we easily find that the inverse of W is given by
1/40 0 0 11 1 1 01/40 0 11 1 1 W 1 = . 0 001/201 01 10 01 B 0001/2C B00 1 1C B C B C @ A @ A So, the vector v =(6, 4, 5, 1) over the basis becomes U c =(c1,c2,c3,c4)=(4, 1, 1, 2) over the Haar basis , with W
4 1/40 0 0 11 1 1 6 1 01/40 0 11 1 1 4 = . 011 0 001/201 01 10 01 051 B2C B 0001/2C B00 1 1C B1C B C B C B C B C @ A @ A @ A @ A 110 CHAPTER 1. BASICS OF LINEAR ALGEBRA
Given a signal v =(v1,v2,v3,v4), we first transform v into its coe cients c =(c1,c2,c3,c4)overtheHaarbasis 1 by computing c = W v.Observethat v + v + v + v c = 1 2 3 4 1 4 is the overall average value of the signal v.Thecoe cient c1 corresponds to the background of the image (or of the sound).
Then, c2 gives the coarse details of v,whereas,c3 gives the details in the first part of v,andc4 gives the details in the second half of v.
Reconstruction of the signal consists in computing v = Wc. 1.7. HAAR BASIS VECTORS; A GLIMPSE AT WAVELETS 111 The trick for good compression is to throw away some of the coe cients of c (set them to zero), obtaining a compressed signal c,andstillretainenoughcrucialin- formation so that the reconstructed signal v = W c looks almost as goodb as the original signal v. b b Thus, the steps are:
1 inputv coe cients c = W v compressed c ! ! compressed v = W c. ! b This kind of compression scheme makes modernb videob conferencing possible.
1 It turns out that there is a faster way to find c = W v, 1 without actually using W .Thishastodowiththe multiscale nature of Haar wavelets. 112 CHAPTER 1. BASICS OF LINEAR ALGEBRA Given the original signal v =(6, 4, 5, 1) shown in Figure 1.6, we compute averages and half di↵erences obtaining
6451
Figure 1.6: The original signal v
Figure 1.7: We get the coe cients c3 =1andc4 =2.
2 1 5533 1 2
Figure 1.7: First averages and first half di↵erences
Note that the original signal v can be reconstruced from the two signals in Figure 1.7.
Then, again we compute averages and half di↵erences ob- taining Figure 1.8.
11 4444 1 1 Figure 1.8: Second averages and second half di↵erences
We get the coe cients c1 =4andc2 =1. 1.7. HAAR BASIS VECTORS; A GLIMPSE AT WAVELETS 113 Again, the signal on the left of Figure 1.7 can be recon- structed from the two signals in Figure 1.8.
This method can be generalized to signals of any length 2n.Thepreviouscasecorrespondston =2.
Let us consider the case n =3.
The Haar basis (w1,w2,w3,w4,w5,w6,w7,w8)isgiven by the matrix
11 1 0 1 0 0 0 11 1 0 10 0 0 011 10 0 1 0 01 B11 10 0 10 0C W = B C B1 10 1 0 0 1 0C B C B1 10 1 0 0 10C B C B1 10 10 0 0 1C B C B1 10 10 0 0 1C B C @ A 114 CHAPTER 1. BASICS OF LINEAR ALGEBRA The columns of this matrix are orthogonal and it is easy to see that 1 W =diag(1/8, 1/8, 1/4, 1/4, 1/2, 1/2, 1/2, 1/2)W >.
Apatternisbeginingtoemerge.Itlookslikethesecond Haar basis vector w2 is the “mother” of all the other basis vectors, except the first, whose purpose is to perform averaging.
Indeed, in general, given w =(1,...,1, 1,..., 1), 2 2n the other Haar basis vectors are obtained by a “scaling | {z } and shifting process.” 1.7. HAAR BASIS VECTORS; A GLIMPSE AT WAVELETS 115
Starting from w2,thescalingprocessgeneratesthevec- tors w ,w ,w ,...,w j ,...,w n 1 , 3 5 9 2 +1 2 +1 such that w2j+1+1 is obtained from w2j+1 by forming two consecutive blocks of 1 and 1ofhalfthesizeofthe blocks in w2j+1,andsettingallotherentriestozero.Ob- j n j serve that w2j+1 has 2 blocks of 2 elements.
The shifting process, consists in shifting the blocks of 1and 1inw2j+1 to the right by inserting a block of n j (k 1)2 zeros from the left, with 0 j n 1and 1 k 2j.
Thus, we obtain the following formula for w2j+k:
w2j+k(i)= n j 01i (k 1)2 n j n j n j 1 81(k 1)2 +1 i (k 1)2 +2 > n j n j 1 n j > 1(k 1)2 +2 +1 i k2 <