Elementary Matrices, Matrix Inverse, Determinants, More on Linear Systems
Total Page:16
File Type:pdf, Size:1020Kb
DM559 Linear and Integer Programming Lecture 4 Elementary Matrices, Matrix Inverse, Determinants, More on Linear Systems Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Elementary Matrices Matrix Inverse Determinants Outline Cramer’s rule 1. Elementary Matrices 2. Matrix Inverse 3. Determinants 4. Cramer’s rule 2 Elementary Matrices Matrix Inverse Determinants Outline Cramer’s rule 1. Elementary Matrices 2. Matrix Inverse 3. Determinants 4. Cramer’s rule 3 Elementary Matrices Matrix Inverse Determinants Row Operations Revisited Cramer’s rule Let’s examine the process of applying the elementary row operations: 2 3 2−! 3 a11 a12 ··· a1n a 1 −! 6a21 a22 ··· a2n 7 6 a 2 7 A = 6 7 = 6 7 6 . .. 7 6 . 7 4 . 5 4 . 5 −! am1 am2 ··· amn a m −! ( a i row ith of matrix A) Then the three operations can be described as: 2 −!a 3 2−!a 3 2 −!a 3 −!1 −!2 −! 1 −! 6λ a 27 6 a 1 7 6 a 2 + λ a 17 6 7 6 7 6 7 6 . 7 6 . 7 6 . 7 4 . 5 4 . 5 4 . 5 −! −! −! a m a m a m 4 Elementary Matrices Matrix Inverse Determinants Cramer’s rule For any n × n matrices A and B: 2 3 2 3 2−! 3 a11 a12 ··· a1n b11 b12 ··· b1n a 1B −! 6a21 a22 ··· a2n7 6b21 b22 ··· b2n7 6 a 2B7 AB = 6 7 6 7 = 6 7 6 . .. 7 6 . .. 7 6 . 7 4 . 5 4 . 5 4 . 5 −! an1 an2 ··· ann bn1 bn2 ··· bnn a nB 2 −! 3 2 −! 3 2 −! 3 a 1B a 1B a 1 −! −! −! −! −! −! 6 a 2B + λ a 1B7 6( a 2 + λ a 1)B7 6 a 2 + λ a 17 6 7 = 6 7 = 6 7 B 6 . 7 6 . 7 6 . 7 4 . 5 4 . 5 4 . 5 −! −! −! a nB a nB a n (matrix obtained by a row operation on AB) = (matrix obtained by a row operation on A)B (matrix obtained by a row operation on B) = (matrix obtained by a row operation on I )B 5 Elementary Matrices Matrix Inverse Determinants Elementary matrix Cramer’s rule Definition (Elementary matrix) An elementary matrix, E, is an n × n matrix obtained by doing exactly one row operation on the n × n identity matrix, I . Example: 21 0 03 20 1 03 21 0 03 40 3 05 41 0 05 44 1 05 0 0 1 0 0 1 0 0 1 6 Elementary Matrices Matrix Inverse Determinants Cramer’s rule 2 1 2 43 2 1 2 43 ii−i B = 4 1 3 65 −−! 4 0 1 25 −1 0 1 −1 0 1 21 0 03 2 1 0 03 ii−i I = 40 1 05 −−! 4−1 1 05 = E1 0 0 1 0 0 1 2 1 0 03 2 1 2 43 2 1 2 43 E1B = 4−1 1 05 4 1 3 65 = 4 0 1 25 0 0 1 −1 0 1 −1 0 1 7 Elementary Matrices Matrix Inverse Determinants Outline Cramer’s rule 1. Elementary Matrices 2. Matrix Inverse 3. Determinants 4. Cramer’s rule 8 Elementary Matrices Matrix Inverse Determinants Matrix Inverse Cramer’s rule The three elementary row operations are trivially invertible. Theorem Any elementary matrix is invertible, and the inverse is also an elementary matrix 2 1 0 03 2 1 2 43 2 1 2 43 E1B = 4−1 1 05 4 1 3 65 = 4 0 1 25 0 0 1 −1 0 1 −1 0 1 21 0 03 2 1 2 43 2 1 2 43 −1 E1 (E1B) = 41 1 05 4 0 1 25 = 4 1 3 65 = B 0 0 1 −1 0 1 −1 0 1 9 Elementary Matrices Matrix Inverse Determinants Row equivalence Cramer’s rule Definition (Row equivalence) If two matrices A and B are m × n matrices, we say that A is row equivalent to B if and only if there is a sequence of elementary row operations to transform A to B. This equivalence relation satisfies three properties: • reflexive: A ∼ A • symmetric: A ∼ B =) B ∼ A • transitive: A ∼ B and B ∼ C =) A ∼ C Theorem Every matrix is row equivalent to a matrix in reduced row echelon form 10 Elementary Matrices Matrix Inverse Determinants Invertible Matrices Cramer’s rule Theorem If A is an n × n matrix, then the following statements are equivalent: 1. A−1 exists 2. Ax = b has a unique solution for any b 2 Rn 3. Ax = 0 only has the trivial solution, x = 0 4. The reduced row echelon form of A is I . Proof: (1) =) (2) =) (3) =) (4) =) (1). 11 Elementary Matrices Matrix Inverse Determinants Cramer’s rule • (1) =) (2) [9 A−1] =) [9!x : Ax = b; 8b 2 Rn] A−1Ax = A−1b =) I x = A−1b =) x = A−1b hence x = A−1b is the only possible solution and it is a solution indeed: A(A−1b) = (AA−1)b = I b = b; 8b • (2) =) (3) [9!x : Ax = b; 8b 2 Rn] =) [Ax = 0 =) x = 0] If Ax = b has a unique solution for all b 2 Rn, then this is true for b = 0. The unique solution of Ax = 0 must be the trivial solution, x = 0 12 Elementary Matrices Matrix Inverse Determinants Cramer’s rule • (3) =) (4) [Ax = 0 =) x = 0] =) [RREF of A is I ] then in the reduced row echelon form of A there are no non-leading (free) variables and there is a leading one in every column hence also a leading one in every row (because A is square and in RREF) hence it can only be the identity matrix • (4) =) (1) [RREF of A is I ] =) [9 A−1] 9 sequence of row operations and elementary matrices E1;:::; Er that reduce A to I ie, Er Er−1 ··· E1A = I −1 −1 Each elementary matrix has an inverse hence multiplying repeatedly on the left by Er , Er−1: −1 −1 −1 A = E1 ··· Er−1Er I hence, A is a product of invertible matrices hence invertible. (Recall that (AB)−1 = B−1A−1) 13 Elementary Matrices Matrix Inverse Determinants Matrix Inverse via Row Operations Cramer’s rule We saw that: −1 −1 −1 A = E1 ··· Er−1Er I taking the inverse of both sides: −1 −1 −1 −1 −1 A = (E1 ··· Er−1Er ) = Er ··· E1 = Er ··· E1I Hence: −1 if Er Er−1E ··· E1A = I then A = Er Er−1 ··· E1I Method: • Construct [A j I ] • Use row operations to reduce this to [I j B] • If this is not possible then the matrix is not invertible • If it is possible then B = A−1 14 Elementary Matrices Matrix Inverse Determinants Example Cramer’s rule 2 3 2 3 2 3 1 2 4 1 2 4 1 0 0 ii−i 1 2 4 1 0 0 iii+i A = 4 1 3 6 5 ! [A j I ] = 4 1 3 6 0 1 0 5 −−! 4 0 1 2 −1 1 0 5 −1 0 1 −1 0 1 0 0 1 0 2 5 1 0 1 2 3 2 3 1 2 4 1 0 0 i−4iii 1 2 0 −11 8 −4 iii−2ii ii−2iii −−−! 4 0 1 2 −1 1 0 5 −−−! 4 0 1 0 −7 5 −2 5 0 0 1 3 −2 1 0 0 1 3 −2 1 2 1 0 0 3 −2 0 3 i−2ii −−−! 4 0 1 0 −7 5 −2 5 0 0 1 3 −2 1 2 3 −2 0 3 −1 A = 4 −7 5 −2 5 3 −2 1 Verify by checking AA−1 = I and A−1A = I . What would happen if the matrix is not invertible? 15 Elementary Matrices Matrix Inverse Determinants Verifying an Inverse Cramer’s rule Theorem If A and B are n × n matrices and AB = I , then A and B are each invertible matrices, and A = B−1 and B = A−1. Proof: show that Bx = 0 has unique solution x = 0, then B is invertible. Bx = 0 =) A(Bx) = A0 =) (AB)x = 0 AB=)=I I x = 0 =) x = 0 So B−1 exists. Hence: AB = I =) (AB)B−1 = IB−1 =) A(BB−1) = B−1 =) A = B−1 So A is the inverse of B, and therefore also invertible and A−1 = (B−1)−1 = B (Corollary: we do not need to verify both A−1A = I and AA−1 = I , one sufficies) 16 Elementary Matrices Matrix Inverse Determinants Outline Cramer’s rule 1. Elementary Matrices 2. Matrix Inverse 3. Determinants 4. Cramer’s rule 17 Elementary Matrices Matrix Inverse Determinants Determinants Cramer’s rule • The determinant of a matrix A is a particular number associated with A, written jAj or det(A), that tells whether the matrix A is invertible. • For the2 × 2 case: a b 1 0 (1=a)R1 1 b=a 1=a 0 [A j I ] = −−−−−! c d 0 1 c d 0 1 R −cR 1 b=a 1=a 0 aR 1 b=a 1=a 0 −−−−−!2 1 −−!2 0 d − cb=a −c=a 1 0 (ad − bc) −c a Hence A−1 exists if and only if ad − bc 6= 0. • hence, for a2 × 2 matrix the determinant is a b a b = = ad − bc c d c d 18 • The extension to n × n matrices is done recursively Definition (Minor) For an n × n matrix the (i; j) minor of A, denoted by Mij , is the determinant of the (n − 1) × (n − 1) matrix obtained by removing the ith row and the jth column of A.