 In the previous video, I mentioned how a basis is a linearly independent spanning set, but I also mentioned without proof that a basis is a minimal spanning set. So if we have some, you know, subspace w, which is a span of so many vectors, right? So let's say that we like x1, x2, x3, up to maybe like some xp right here. And this is a spanning set, but this spanning set might not be independent. It could be that some of the spanners are actually linear combinations of the other spanners. And therefore we could throw them out without changing the span. Like maybe we give rid of x2, x3, and we keep all the rest. We could always prune down a spanning set. We could always prune it down to a minimal spanning set to make a basis. This means throwing out the vectors which are unnecessary. Now, how do we know which ones are unnecessary? Well, it turns out we're gonna look at a special case to that which actually provides the general method. Suppose we're given an M by N matrix A. And we've already seen already what we call two of the four fundamental spaces of a matrix A. So we've introduced the column space and we've introduced the null space. So remember the column space is the span of the column vectors of A. This will necessarily be a subspace of FM. And the null space is the solution set to the homogeneous system AX equals zero, which is necessarily gonna be FM. Now the dimension of the column space is what we call the rank of the matrix. Which remember, we define the rank as the number of pivot columns in a matrix. Well, I claim that the dimension of the column space will be the rank. That is the pivot columns of A form a basis for the column space of A. So the pivot columns are only columns you need in terms of spanning. And so if you have a set of vectors like we did before, right? So like I was mentioning right here, we have some set of vectors. Well, you can always put those vectors together. A set of vectors basically becomes a matrix. A matrix whose column vectors are exactly these vectors X1, X2, et cetera, right? So you put these vectors together in form of matrix. Then the span of those vectors will be equivalent to the column space of set matrix. As we row reduce the matrix, we identify who's a pivot and who's not. If we throw out the non-pivot positions and only retain the original pivot positions, that is we throw out the non-pivots and keep the pivots. The non-pivots in terms of the system of linear equations, they correspond to free variables. That means we have some freedom, but in particular we don't actually need them to span. And so if we throw out the non-pivot columns and keep the pivot columns, the pivot columns will correspond to an independent set of vectors which has the same span as before, AKA it's a basis. And so what one has to do if you have a spanning set, if you wanna prune it down, you just put those vectors together in a matrix, row reduce the matrix, identify the pivot columns, and then grab the original vectors that correspond to those pivot columns and you'll prune your spanning set down to a minimal spanning set, which will necessarily be a basis. I also wanna mention that the dimension of the null space is what we call the nullity before, which we actually defined it to be the number of non-pivots. So it turns out counting the free variables has to do with how big the solution set is for AX equals zero, but we'll talk about that a little bit more in another video. Let's focus on the column space right now and the rank, okay? So given this matrix A, which is a three by five matrix we can see right here, we're gonna construct a basis for the column space of A. We're gonna do this by row reducing the matrix. So we think of the first pivot position right there in the one, one spot. We're going to get rid of the numbers below the ones. So we're gonna take row two minus two times row one, and we're gonna take row three minus row one. So we get minus two, minus six, minus six, minus four, minus eight for the second row. That'll give us zero, one, zero, negative one, and positive one, like so. For row three minus row one, we get minus one, minus three, minus three, minus two, minus four. This will give us zero, negative one, zero, one, and negative one, like so. So then we move our pivot to the second spot right there since we finished the first column. I'm noticing that together this negative one here, I can just add row two to it. So we're gonna get plus one, minus one, and plus one. Oh, that gives me a row of zeros. This matrix now is in echelon form. We want echelon form because when we are in echelon form, we can identify the pivot positions. We do not need row reduced echelon form to do that. I mean, it's helpful, but we don't need it. We will now recognize that the first and second columns were pivots. So we will then select the first and the second columns of A. We go back to the original matrix A. We're not selecting the, we're not taking the columns of the echelon form. We just need the echelon form to identify where the pivots are located. We have to go back to the original matrix A and select its columns. Because if you take the span of these columns and the echelon form, that does not give you the same space as the column space of A, right? The span of these columns will be different to the span of these columns, but the location of the pivots do not change. The pivots were in positions one and position two. Therefore, the column space of A is going to be the span of, we take the first vector, one, two, one, and we take the second vector, three, seven, two. So I mean, by definition, the column space was the span of all five of these vectors, but it turns out, oh, we don't need the last three because those last three are combinations of the first two and therefore they just add extra redundancy to the system. We don't need them. In particular, the rank of our matrix A right here is two. There's only two pivots. The dimension of the column space is two dimensional and therefore we can take care of everything from there. Now, before continuing, I do want to kind of mention a metaphor, if we will, on what's going on here. In a previous lecture, I kind of made some examples about RC cars with joysticks and mentioned how that kind of has something to do with independence, has something to do with dimension, right? So I mentioned like, oh, my son has a car with two different joysticks on it. One joystick allows the car to go forward and backwards. The other one allows it to turn left and right. So therefore, by combining the two joysticks together, it allows my son to drive his car anywhere on a flat surface, right? It can drive anywhere on the floor. But let's imagine that his car was actually tricked out. He's got a couple extra joysticks on his remote, right? Maybe something like these extra joysticks for which the first joystick makes the car spin in a circle, right? And then the second joystick makes it drive diagonally, right? It'll drive diagonally based upon this. It's like, okay, you have these four joysticks now. Is the car able to travel more than two dimensions like the helicopter we had mentioned before? Like a helicopter can go forward, back, left and right, but it can also go up and down like a little drone. But the RC car, these extra joysticks are not ever causing it to leave two dimensions. These extra joysticks are somewhat redundant that if you want your car to spin in a circle, you can actually do that using forward, back, left and right. If you want your car to drive diagonally, you just go, like if you wanna drive to the top right like that, that just means you go forward and right simultaneously. This right here is just the sum of these two vectors. You don't need it. The circle one might be a little bit harder to convince yourself on, but it is still there. And so in terms of this discussion right here, if we have like this column space of four vectors, turns out two of the vectors were unnecessary. We can accomplish the same span with just two of the joysticks. And that's what the basis is all about. What is the minimal spanning set? What's a minimal set of spanners? That yes, I can get the whole span with five vectors, but I only need the first two. So these two are the only ones that are necessary. Well, why does the joysticks, why do these extra joysticks exist on the remote control? Well, it's, you know, sure, having more controls makes it easier to do tricks with the RC car. But if we're talking about just mobility, my son can drive his car to any place on the floor using just the two yellow joysticks, the two extra ones, although great for tricks, not necessary. Let's look at another example. And then we'll be able to do this one super quick, right? Honestly, the hardest part of these problems is row reducing the matrix. So if we have a matrix which is four by five, a four by five matrix right here, let's find a basis for the column space. We have to row reduce the matrix and you'll see that I already have the RREF computed for us, which you don't need RREF, any echelon form will do it. I just mentioned this one because if you have a graphing calculator, the RREF is a standard function. Just throw the matrix in there, RREF it, if I can use that as a verb. And there we go. We can then identify the pivot positions. There's a pivot in one, one, two, two. And then notice the last pivot is in the three, five position. This tells us that the basis for the column space will consist of the first column of A, the second column of A and the fifth column of A. Always take your, for the basis of the column space, you have to go back to the original matrix and grab its columns. So the column space of A, it'll be spanned by the vectors one, negative two, two and three, three, negative two, three and four. And then the last one here at negative nine, two, one and negative eight. So if you can get a echelon form of the matrix pretty quickly, then you can find a basis for the column space very quickly. Notice in this situation, the rank of the matrix is three. There are three pivot positions and you need exactly three vectors to span the entire column space. These other two vectors, although they might be great to have for doing tricks or something, they're not actually necessary in terms of the span. This column space is a three flat. It's not a five flat. We don't need those two extra column vectors inside of A.