Lecture 20 · Week 5· 17:07

Basis and dimension in Rn

Bases of subspaces, dimension, Steinitz exchange idea.

Play: Lecture 20: Basis and dimension in Rn
Lecture · 17:07 · Open on YouTube · Report a problem with this video
TranscriptThe full text of the lecture. Click any sentence to play the video from there.

Today: describing a subspace

Welcome back. In the last lecture we met subspaces: lines and planes through the origin, the column space, and the null space. A subspace usually holds infinitely many vectors, so we want a short list that describes it completely. Take the floor of three dimensional space: all vectors whose third entry is zero. It is spanned by three vectors: v one, which is (one, zero, zero), v two, which is (zero, one, zero), and v three, which is (one, one, zero). But v three is v one plus v two, so it adds nothing. Leave it out, and v one and v two still span the floor. Now nothing is redundant.

A list like this, which spans and has no redundant vector, is called a basis. The floor has many bases. But, as we will prove today, every one of them has exactly two vectors. That number is the dimension of the floor. Here is the plan. We define a basis, and see why it gives every vector unique coordinates. We learn to shrink a spanning list, or grow an independent one, into a basis. Then we prove the key theorem, and from it, that all bases of a subspace have the same length. That defines dimension, and we finish with bases of the column space and the null space.

Bases

Here is the definition. Let H be a subspace of F n. A list of vectors b one up to b k in H is a basis of H if two things hold. First, the vectors are linearly independent. Second, they span H. A basis is a list, so its vectors come in an order: the same vectors in another order form another basis. And the zero subspace is a special case: by convention, its basis is the empty list. The first example is the standard basis of F n: the vectors e one up to e n. Here e j has a one in position j, and zeros everywhere else.

They are independent, as we saw in lecture eleven. And they span, because any vector x is x one times e one, plus x two times e two, and so on, up to x n times e n. A second basis of the plane: b one is (one, two), and b two is (three, one). Neither is a multiple of the other, so they are independent. And they span the plane. Put them as the columns of a matrix, and replace row two by row two minus two times row one. Two minus two is zero, and one minus six is minus five. There is a pivot in every row, so by lecture twelve, the columns span the plane.

Now two lists that fail. Take the vector (one, zero), the vector (two, zero), and the vector (zero, one). Together they span the plane, but they are dependent: two times the first, minus the second, is zero. And the single vector (one, two), on its own, is independent, but it spans only a line. So a basis is a balance. A spanning list must not be too short, and an independent list must not be too long. A basis is both at once.

Coordinates

Why are bases so useful? Because of this theorem. Let b one up to b k be a basis of a subspace H. Then every vector x in H can be written as c one b one, plus c two b two, and so on, up to c k b k, in exactly one way. At least one way, because the basis spans H. At most one way: suppose x has two such expressions, one with weights c i, and one with weights d i. Subtract one from the other. On the left, x minus x is zero. On the right, we get c one minus d one, times b one, plus and so on, up to c k minus d k, times b k.

The basis vectors are independent, so every one of these weights is zero. So c i equals d i for every i, and the two expressions are the same. The numbers c one up to c k are called the coordinates of x in this basis. In the standard basis, the coordinates of a vector are just its entries. We study coordinates in depth in lecture twenty five. Let's find the coordinates of the vector x equals (five, five), in the basis b one, b two. We need c one times the vector (one, two), plus c two times the vector (three, one), to equal (five, five).

That is two equations. In the first coordinate, c one plus three c two equals five. In the second, two c one plus c two equals five. The second equation gives c two equals five minus two c one. Put this into the first: c one plus fifteen minus six c one equals five. So minus five c one is minus ten, and c one is two. Then c two is five minus four, which is one. Check: two times the vector (one, two), plus one times the vector (three, one). In the first coordinate, two plus three is five. In the second, four plus one is five.

So x has coordinates two and one. On the slanted grid of b one and b two, the point (five, five), sits at exactly one crossing: two steps along b one, then one step along b two.

Shrink or grow

How do we find a basis? There are two natural ways. Start with a list that spans, and throw out redundant vectors. Or start with an independent list, and add vectors until it spans. First, shrinking. Let H be the span of v one up to v k, and suppose H is not just the zero vector. Then some of the vectors v one up to v k form a basis of H. The proof is a loop. If the list is independent, it is a basis, and we are done. If it is dependent, then by lecture eleven, one vector is a combination of the others. By lecture three, removing it does not change the span. So we remove it, and repeat.

Each round makes the list shorter, so the loop must stop. And it stops only at a list that is independent and still spans H: a basis. Back to the floor. v one plus v two minus v three is zero, and every weight in this relation is nonzero. So any one of the three vectors can go. Remove v three, and we get the basis v one, v two. Remove v one instead, and we get the basis v two, v three. Different choices give different bases, but each one has two vectors.

Now growing. Let H be a subspace of F n. Every independent list in H can be extended to a basis of H. In particular, H has a basis, and every basis of H has at most n vectors. Start with the independent list. If it spans H, we are done. If not, pick a vector w in H outside its span, and add it. By lecture eleven, a vector outside the span keeps the list independent. An independent list in F n has at most n vectors, so we can add at most n times. The loop stops, and it stops only when the list spans H. To show that H has a basis: if H is not just the zero vector, start from any nonzero vector in it. And the zero subspace has the empty list as its basis.

The key theorem

The floor has many bases, and all of them have two vectors. Why can no basis of the floor have three vectors? The reason is this theorem. Let H be a subspace of F n, spanned by k vectors, w one up to w k. Then every independent list in H has at most k vectors. In other words, more than k vectors in H are always dependent. This is the central proof of the lecture, and it is demanding. Take it slowly, and pause or rewatch it if you need to.

Take m vectors u one up to u m in H, with m bigger than k. Each u j lies in the span of the w's, so it is a combination of them: u j is a one j times w one, plus and so on, up to a k j times w k. Now we use matrices. Let W be the matrix with columns w one up to w k, and let M be the matrix with columns u one up to u m. Collect the weights in a matrix C: column j of C holds the weights of u j. So C has k rows and m columns. By the column rule, W times column j of C is u j. So, column by column, M equals W C.

Now C has more columns than rows. So the system C x equals zero has more unknowns than equations, and by lecture ten it has a nontrivial solution x. For this x, M x is W C, times x, which is W times C x, which is W times zero, which is zero. But M x is x one u one, plus and so on, up to x m u m. So this is a linear dependence relation, with weights not all zero. The vectors u one up to u m are dependent.

The exchange idea

There is an idea hidden in this proof, and it is worth seeing directly. Each independent vector can take the place of one spanning vector, and the list still spans. In the plane, start with the spanning list e one, e two, and the independent vectors u one, which is (one, two), and u two, which is (three, one). First, u one is one e one plus two e two. The weight of e one is not zero, so we can solve for e one: e one is u one minus two e two.

So the span of u one and e two contains e one and e two, and that makes it the whole plane. We have exchanged e one for u one, and the list u one, e two still spans. Next, u two. It is three e one plus e two. Replace e one by u one minus two e two. This gives three u one, minus six e two, plus e two, which is three u one minus five e two. The weight of e two is minus five, not zero. So we can solve for e two, and exchange it for u two. Now the list u one, u two spans the plane.

Each new independent vector pushes out one old spanning vector. If all the weights on the old vectors were ever zero, the new vector would be a combination of the u's before it, and the list would not be independent. So the u's can never outnumber the spanning vectors. This exchange argument goes back to Steinitz. In lecture twenty three, we use it again, for vector spaces that do not sit inside any F n.

Dimension

Now the payoff. Let H be a subspace of F n. Then any two bases of H have the same number of vectors. Take two bases, one with k vectors and one with m vectors. The first basis spans H, and the second is independent in H, so by the key theorem, m is at most k. Exchange the roles, and k is at most m. So k equals m. So this number belongs to H itself, not to the basis we chose. It is called the dimension of H, written dim H. The zero subspace has dimension zero.

Every subspace of F n has a basis with at most n vectors, so its dimension is a whole number from zero to n. Examples. The standard basis has n vectors, so F n has dimension n. A line through the origin, spanned by one nonzero vector, has dimension one. And the floor has dimension two. So in three dimensional space, the zero subspace has dimension zero, lines through the origin have dimension one, planes through the origin have dimension two, and the whole space has dimension three. Dimension counts the independent directions.

Bases of Col A and Nul A

For the subspaces that come from a matrix, we can read off a basis from the reduced row echelon form. Let A be an m by n matrix over a field F. First, the pivot columns of A form a basis of the column space. So the dimension of the column space is the number of pivots. Second, write the general solution of A x equals zero in parametric vector form, with one vector for each free variable. These vectors form a basis of the null space. So the dimension of the null space is the number of free variables.

Every column is either a pivot column, or belongs to a free variable. So the two dimensions add up to n, the number of columns. Why does it work? Row operations keep the column relations, as we saw in lecture nine. In the reduced form, the pivot columns are e one, e two, and so on, which are independent, and every other column is a combination of them. The same relations hold among the columns of A. For the null space: each vector has a one at its own free variable, and zeros at the other free variables. So in a combination that gives zero, each weight can be read off at its own free position, and it must be zero. And the vectors span, because the general solution is made of them.

Let's take the matrix from lecture ten. Its first row is (one, two, minus one, minus one), its second row is (two, four, minus one, zero), and its third row is (minus one, minus two, two, three). Its reduced row echelon form has first row (one, two, zero, one), second row (zero, zero, one, two), and a third row of zeros. The pivots are in columns one and three. So a basis of the column space is column one of A, which is (one, two, minus one), and column three, which is (minus one, minus one, two). The column space is a plane in three dimensional space. A warning: take the pivot columns of A itself, not of the reduced form. Row operations change the columns, and the reduced form has a different column space: all its columns end in zero.

For the null space, the free variables are x two and x four. Call them s and t. Then x one is minus two s minus t, and x three is minus two t. So x is s times the vector (minus two, one, zero, zero), plus t times the vector (minus one, zero, minus two, one). These two vectors form a basis of the null space, a plane in four dimensional space. Two plus two is four, the number of columns. In lecture twenty seven, this becomes the rank nullity theorem.

When the count is right

If we already know the dimension, half of the work of checking a basis comes for free. Let H be a subspace of F n with dimension k. First, any k independent vectors in H form a basis. Extend them to a basis: that basis has k vectors, so nothing was added. Second, if k is at least one, any k vectors that span H form a basis. Shrink them to a basis: it has k vectors, so nothing was removed.

Third, if U is a subspace inside H, then the dimension of U is at most the dimension of H, and if the two are equal, then U is all of H. A basis of U extends to a basis of H, and if the counts agree, nothing is added, so the basis of U already spans H. For example, take the vector (one, two, three), the vector (four, five, six), and the vector (seven, eight, ten). As we saw in lecture eleven, they are independent. They are three independent vectors in a space of dimension three, so they form a basis. We never had to check that they span. So for n vectors in F n, being independent, spanning, and being a basis all mean the same thing.

Summary

Let's summarise. A basis of a subspace H is a list of vectors in H that is linearly independent and spans H. Every vector of H is a combination of the basis in exactly one way. A spanning list can be shrunk to a basis, and an independent list can be grown into one. So every subspace of F n has a basis. In a subspace spanned by k vectors, an independent list has at most k vectors. So all bases have the same length: the dimension.

The pivot columns of A are a basis of its column space, and the vectors of the general solution are a basis of its null space. Their dimensions add up to the number of columns. Before the next lecture, read section four point two of the course book, try the problems on sheet five about bases and dimension, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we leave F n behind, and meet vector spaces in general: polynomials, matrices and functions, all treated as vectors. See you there.

Check yourself

3 questions, from warm-up to stretch

Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.

  1. Question 1 of 3 Warm-up

    The vectors and form a basis of . Find the coordinates of in this basis, so that .

    Hint 1 of 2

    By Theorem 4.2.4 there is exactly one way to write . Write this vector equation row by row, as in Example 4.2.5.

    Hint 2 of 2

    The two rows are and . Add them to find .

    Worked solution
    1. Row by row, is and .
    2. Adding the two equations gives , so . Then .
    3. Check: . So has coordinates and in the basis , and by Theorem 4.2.4 these are the only ones.
  2. Question 2 of 3 Core

    Let , with reduced row echelon form . Use Theorem 4.2.14 to find and . In the basis of from the parametric vector form, the vector for the free variable is . Find and .

    Hint 1 of 2

    is the number of pivots, and is the number of free variables. Find the pivot columns of first.

    Hint 2 of 2

    The pivots are in columns and , so and are free. gives and : solve for and , then take , .

    Worked solution
    1. The pivots of are in columns and . So the pivot columns of , and , form a basis of , and .
    2. The free variables are and . The rows of give and .
    3. So . These two vectors form a basis of , so , and , .
    4. Check: , and , the number of columns (Theorem 4.2.14(c)).
  3. Question 3 of 3 Stretch

    Let , the plane in , and let , . Find . Is a basis of ? Can three vectors in be linearly independent?

    is a basis of :
    Three independent vectors in :
    Hint 1 of 2

    For , use Theorem 4.2.14(b): count the free variables of . Then check that and lie in and are independent.

    Hint 2 of 2

    The matrix has one pivot and two free variables, so . With the dimension known, Theorem 4.2.16(a) says how many independent vectors make a basis, and Theorem 4.2.9 limits how many can be independent.

    Worked solution
    1. . The matrix is already in reduced row echelon form, with one pivot (column ) and two free variables, and . By Theorem 4.2.14(b), .
    2. and lie in : and . Neither is a multiple of the other, so they are independent.
    3. They are independent vectors in , and , so by Theorem 4.2.16(a) they form a basis of .
    4. is spanned by vectors, so by Theorem 4.2.9 an independent list in has at most vectors. Three vectors in are always dependent: the answer is No.

Found a mistake, or something not working on this page? Report it and we'll fix it. See what we've corrected.