Algorithms to Compute Bases and the Rank of a Matrix Subspaces associated to a matrix Suppose that A is an m n matrix The row space of A is the subspace of R n spanned by the rows of A The column space of A is the subspace of R m spanned by the columns of A The null space of A is the subspace N(A) = { x R n A x = m } of R n N(A) is a subspace of R n by the Subspace Theorem (Theorem of Lecture Note 4) The row rank of A is the dimension of the row space of A The column rank of A is the dimension of the column space of A The nullity of A is the dimension of the null space N(A) More on row equivalence We give some theorems on row equivalence, showing that some subspaces constructed from matrices do not change under elementary row operations This allows us to find important information about these subspaces from the RRE form of a matrix These interpretations will be given later in this note Theorem Suppose that the m n matrices A A m and B = are row equivalent (with A,, A m, B,, B m R n ) Then the subspaces Span(A,, A m ) and Span(B,, B m ) of R n are equal To prove Theorem, we need only verify it for a single elementary row operation Theorem Suppose that A and B are row equivalent matrices Then N(A) = N(B) B B m Theorem is just a restatement of Theorem of Lecture Note Theorem 3 Suppose that m n matrices (A,, A n ) and B = (B,, B n ) with A,, A n, B,, B n R m are row equivalent Then the subspaces {(x,, x n ) T R n x A + + x n A n = } and {(x,, x n ) T R n x B + + x n B n = } of R n are equal That is, A,, A n and B,, B n have the same dependence relations and Theorem 3 follows from Theorem and the identities A B x x n x x n = x A + + x n A n = x B + + x n B n
of formula () of Lecture Note Algorithm to compute a basis of the row space of a matrix Suppose that A A A m is an m n matrix Transform A into its reduced row echelon form B Then the nonzero rows of B form a basis of the row space Span(A,, A m ) of A To establish this algorithm, apply Theorem to conclude that the span of the rows of B is equal to the row space of A Using the fact that every nonzero row of the RRE form B contains a leading one, it follows from the definition of linear independence that the nonzero rows of B are linearly independent Example 4 Let u = (,,, 5), u = (, 4,, 8), u 3 = (3,,, 3) Find a basis of the subspace X = Span(u, u, u 3 ) of R 4 Solution: Let u u u 3 = We compute the RRE form of A which is 3 The first two rows are nonzero Thus is a basis of X 5 4 8 3 3 {(,,, 3), (,,, )} Algorithm to refine the columns of a matrix to a basis of its column space Suppose that (A, A,, A n ) is an m n matrix Transform A into its reduced row echelon form B = (B, B,, B n ) Let B i, B i,, B ir be the columns of B which contain a leading Then {A i, A i,, A ir } is a basis of the column space Span(A, A,, A n ) of A To establish this algorithm, observe using Theorem 3 that the RRE form B of A gives the standard form solutions to the equation x A + + x n A n = Substituting the standard form solution for the x i, we obtain first that A i, A i,, A ir are linearly independent, and then that they span the column space of A
Example 5 Find a subset of the vectors v = 3, v = 4, v 3 =, v 4 = which is a basis of the subspace W = Span(v, v, v 3, v 4 ) of R 3 5 8 3 Solution: Let (v, v, v, v 4 ) = 5 4 8 3 3 We compute the RRE form of A which is 3 There are leading ones in the first and third columns Thus v =, v 3 = 3 is a basis of W Algorithm to compute a basis of the null space of a matrix Let (a ij ) be an m n matrix, and x x x = x n be a n vector of indeterminates Let N(A) be the null space of the matrix A By Theorem, a basis for N(A) can be found by solving the system A x = m using Gaussian elimination to find the standard form solution, putting the standard form solution into a column vector and expanding with indeterminate coefficients The vectors in this expansion are a basis of N(A) Example Find a basis of N(A) if 3 4 3 5 5 8 Solution: We compute that the RRE form of A is 3
We write the standard form solution as x s x x 3 = s t s = s x 4 t with s, t R Thus is a basis of N(A), + t Algorithm to extend a set of linearly independent row vectors to a basis of R n Suppose that w,, w m R n are linearly independent Let {e,, e n } be the standard basis of R n Transform the m n matrix w w w m into a reduced row echelon form B Let B i, B i,, B i n m be the indices of the columns of B which do not contain a leading Then {w,, w m, e i,, e in m } is a basis of R n To establish this algorithm, recall that the span of the rows of the RRE form of B is equal to Span(w,, w m ) by Theorem Since w,, w m are linearly independent, B contains m leading ones One then checks that the rows of B and e i,, e in m are linearly independent We then have that w,, w m, e i,, e in m span an n-dimensional subspace of R n, so they are a basis of R n by ) of Theorem 4 of Lecture Note 4 The rank of a matrix Theorem 7 rowrank(a) = columnrank(a) Proof Let r be the number of leading ones in the RRE form of A By the algorithm to compute a basis of a row space of a matrix, a basis of the row space of A has r vectors By the algorithm to refine the columns of a matrix to a basis of its column space, a basis of the column space of A also has r vectors Thus the row space and column space of A have the same dimension We define the rank of A to be the row rank of A (which is also the column rank of A) Theorem 8 (Rank Nullity Theorem) Suppose that A is an m n matrix Then rank(a) + nullity(a) = n Proof Let r be the number of leading ones in the RRE form of A Then rank(a) = r (by the algorithm to compute a basis of the row space of a matrix or the algorithm to refine the columns of a matrix to a basis of its column space) The nullity of A is n r, by the algorithm to compute a basis of the null space of a matrix, since there are n r free variables in the general solution to A x = m 4
As explained in Theorem of Lecture Note 5, we have the following theorem Theorem 9 Suppose that A is an n n matrix Then the columns of A are linearly independent if and only if Det(A) Suppose that A is an m n matrix An r r submatrix of A is a matrix obtained from A by removing m r rows and n r columns Corollary Suppose that A is an m n matrix Then rank(a) = r if and only if Det(M) = for all (r +) (r +) submatrices M of A and there exists an r r submatrix M of A such that Det(M) Computing determinants has a high degree of complexity, so the best practical way to compute rank(a) of a particular matrix A is to compute the RRE form B of A, and then observe that rank(a) = the number of leading ones of B = the number of nonzero rows of B More applications of the Algorithms We can use coordinate vectors with respect to a convenient basis (say a standard basis) to apply the above algorithms to an arbitrary vector space Example Find a subset of the matrices ( ) ( 4 v =, v = 4 which is a basis of V = Span(v, v, v 3 ) ) ( 3, v 3 = 5 Solution: We use the algorithm to refine the column vectors of a matrix to a basis of its column space Let β = {e, e, e, e } be the standard basis of R Form the matrix ((v ) β, (v ) β, (v 3 ) β ) = 4 3 4 5 We compute that the RRE form of A is, which has leading ones in the first and third columns Thus, 3 5 is a basis of the column space of A (the first and third columns of A) Since (v ) β = and (v 3) β = 3, 5 5 ),
we have that { ( v = is a basis of V Example Find a basis of the subspace of P 4 ) ( 3, v 3 = 5 )} U = {f P 4 f() = f() = } Solution: We apply the algorithm to compute a basis of the null space of a matrix We will find the linear conditions on the coefficients a, a, a, a 3 of () f(x) = a + a x + a x + a 3 x 3 P 4 for f to be in U These linear conditions are f() = a + a + a + a 3 = f(3) = a + a + 4a + 8a 3 = The coefficient matrix of this homogeneous system of equations is ( ) 4 8 We compute that the RRE form of A is ( 3 7 We write the standard form solution as a t + t a a = 3t 7t t = t a 3 t with t, t R Substituting the solutions a a a = 3 a 3 back into (), we obtain that and a a a a 3 ) 3 + t = { 3x + x, 7x + x 3} is a basis of U (We are really working with coordinate vectors with respect to the basis β = {, x, x, x 3 } of P 4 ) 7 7