Fundamentals of Linear Algebra and Optimization CIS515, Some Slides
Total Page:16
File Type:pdf, Size:1020Kb
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 AffineMaps ................ 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 Affine 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, ware 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.