Hey folks, my name is Nathan Johnston and welcome to lecture 22 of Introductory Linear Algebra. In today's class we're going to learn all about elementary matrices. Okay, the idea behind elementary matrices is they do for matrices roughly what prime numbers do for positive integers.
Okay, so remember every positive integer you can write it as a product of prime numbers, so in a sense the prime numbers they're like the building blocks for positive integers. Okay, well something similar is true for matrices. Almost every matrix can be written as a product of elementary matrices, these things that we're going to look at today. So in a sense the elementary matrices they're like the building blocks for matrices and this is going to be very useful because what we're going to be able to do with these is once we're able to prove things for elementary matrices, which is often very easy, then we can just prove things for general matrices by saying oh yeah well it holds for this one and this one and this one and this one and therefore it holds for the product which is basically every matrix. Okay, so that's where we're going.
Today we're introducing sort of like the building block matrices for most matrices out there. All right, and they actually come from row operations. Okay, so every elementary matrix corresponds in a one-to-one fashion with row operations. So for example, last week we learned how to solve linear systems, and the way we did it was we represented the linear system via a matrix, so something like this, and then we would do elementary row operations to it to get down into reduced row echelon form.
So if we were given this matrix here... maybe we would start by swapping those two rows at the top there to bring this one up to the top left corner, right? So maybe we would do that row one swap row two row operation.
Now the neat thing though is that instead of doing that row operation, alternatively, we could have multiplied that matrix, our starting matrix, on the left by some cleverly chosen matrix. And in particular, I claim if we multiplied it on the left by this matrix, it would have the exact same effect. as doing that row swap that we just talked about. So let's do that calculation. What I mean here is if we take our original matrix here, so this is the matrix that we started with up here, and I multiplied it on the left by this elementary matrix.
This is something that I'm calling an elementary matrix. Then what happens is you're going to do rows dotted with columns, and then rows dotted with columns, and rows dotted with columns. And this third row is just going to leave the third row of this matrix where it is. but then sort of the swapped positions of the ones there are going to interchange the first and second rows.
So you can see that this result here is exactly the same as the result that we got up there. Okay, so this matrix, in a sense, it corresponds to this row operation. And there are also matrices that correspond to the other elementary row operations. So like these addition row operations and multiplication row operations as well.
Okay, so let's have a look at those. Okay, so for example, For that first row operation I wrote here, row 3 minus 3 row 1, well there's a matrix that does the same thing when you multiply on the left by that matrix, okay? And here it is. I claim that if I multiply on the left by this matrix, then that's going to have the same effect as if I did the row operation row 3 minus 3 row 1. Okay, so let's see that, okay?
If you do this row operation, sorry, if you do this matrix multiplication on the left, I'm just going to start with the matrix that I had up here, okay? And the idea is I want to do row 3 minus 3 row 1 to get rid of this entry here. I want to turn it into a zero.
Okay and one way that I could do that is I can multiply by this matrix. Okay and when I do that multiplying by like this row is going to leave the first row of this matrix alone. Then this row of the elementary matrix is going to leave the second row of the matrix on the right alone. But then this row what it's doing is it's sort of picking up minus three copies of the top row. and then plus one copy of the bottom row.
Okay and you can double check that yes this bottom row down here it is exactly row three minus three row one. Okay so multiplication by this matrix on the left did the same thing as that elementary row operation. Okay and similarly this one's maybe even a little bit easier to see. If I want to multiply the second row by a half, well one way to do that is multiply on the left by this matrix here.
Just throw ones down the diagonal except a half in row two. Okay, and that'll have the effect that we want. That'll multiply that second row by a half while leaving all other rows alone. Okay, so the second row here is going to get multiplied by a half, but everything else is going to stay the same.
Okay, so what exactly do I mean by an elementary matrix? Okay, I've been using this term, but what do I actually mean by it? Well, if you look at each of these three matrices on the left here that I've been calling elementary matrices, The way that you can construct them is you start off with the identity matrix and you just do the row operation that you want to it. Okay so for example this top one I said that this elementary matrix corresponded to the row operation row1 swap row2.
Well, what this matrix is, it's just what you get if you take the identity matrix and you swap row 1 and row 2. That's how you construct that elementary matrix. And then this next one, if you start off with the identity matrix and you do row 3 minus 3 row 1 to it, you get exactly this matrix. So that's why it's an elementary matrix.
You can get to it from a single elementary row operation from the identity matrix. In this one down here, identity matrix, you do one half row two to it and you're going to get this one. So that's what makes it an elementary matrix.
Okay so that's what our definition of an elementary matrix is. A matrix is elementary if it can be obtained from the identity matrix via a single row operation. And then the claim is, well, multiplying on the left by that elementary matrix has the same effect as doing that row operation to whatever matrix you're multiplying it by.
So, I mean, more generally, like not just looking at like the 3x4 case like we were doing up above, more generally, the swap row operation, it has an elementary matrix that looks like this, okay? It's going to look like the identity matrix, so it's going to have 1s all the way down the diagonal, 0s everywhere else, and then just with a couple of exceptions, there's going to be sort of like four entries here that are a little bit off from that, just because there are two rows of that identity matrix that got swapped. So you're gonna have sort of like a little 2x2 block here that looks like a backward identity matrix or something like that So in general, that's what an elementary matrix corresponding to the swap row operation looks like Okay, and in general the multiplication row operation what the corresponding elementary matrix looks like is well again It looks like an identity matrix So it's just got ones down the diagonal Except then it's gonna have a single non-zero entry somewhere else and that non-zero entry is gonna be C It's gonna be whatever the scalar that's getting multiplied by one of the rows is.
Okay, and then the last type of elementary row operation, the scalar multiplication row operation, where you multiply a single row by a scalar, it just looks like an identity matrix except one of the diagonal entries is not a 1, it's a c. It's whatever that scalar is. Okay. Alright, so that's what elementary matrices look like, and well if we use this fact that, you know, multiplication on the left by an elementary matrix is the same thing as doing a row operation, well think about what happens if you do that over and over and over again, right?
Like to get from a matrix to its reduced row echelon form you do row operation. then another row operation, then another row operation, and so on. You do a whole bunch of row operations.
Okay, so equivalently, you multiply on the left by an elementary matrix, then you multiply on the left by an elementary matrix, and so on. You multiply on the left by a whole bunch of elementary matrices. Okay, so what happens is...
If you're row reducing A down to its reduced row echelon form R, then you're multiplying on the left by a whole bunch of elementary matrices. So there's some sequence of elementary matrices such that when you multiply on the left like that, you get down to the reduced row echelon form. Okay, so the way to think about this is this whole matrix together, like if you multiply all of these elementary matrices together, that gives you a single matrix, and that matrix sort of acts like a log that keeps track of, hey, how can I turn A into its reduced row echelon form?
How can I turn that matrix into its reduced row echelon form? Well, you do the sort of linear combinations of rows that are specified by this big ugly matrix here. Okay, and now I'm going to show you how you can actually find that matrix.
All right, so let's go through an example that shows how to actually find this matrix without actually, you know, listing out all of these elementary matrices and actually multiplying them together because that's actually a lot of work. We're not going to do that much work. I'm going to show you a bit of a quicker and easier way to find that that log matrix that tells you how to put a matrix into reduced row echelon form.
All right. So yeah, what we're going to do is we're going to find a matrix E, so this is the product of all the elementary matrices such that Ea equals the reduced row echelon form. All right.
And the way to do that, the method that works, is you take your original matrix A, and you're going to augment on the right by an identity matrix. So I'm taking my matrix, I'm just augmenting with an entire identity matrix on the right. And now, just do your row operations.
Bring this to reduced row echelon form. All right so I'm just going to go through this. I mean I'm going to go through it quickly because we already know how to solve linear systems so we know how to do Gaussian elimination to bring things into reduced rational and form.
Okay so first I'm going to swap two rows to bring that one up to the top left corner. Okay and be careful you're doing your row operations on the right as Okay, next I want to get rid of the 3 down here. Okay, so I'm going to do row 3 minus 3 row 1. That's why I did that row operation there, row 3 minus 3 row 1. Okay, next I want to get a 1 in this entry here.
I want my next leading entry to be a 1. Okay, so I'm just going to swap these two bottom rows. I could have done two things here. I could have done one half times the second row, or I could have swapped these bottom two rows, and I just decided to swap the bottom two rows.
It doesn't matter what you do. Okay, next, because I'm going all the way to reduce for echelon form, I want to get a zero up here, and I want to get a zero down here as well. Okay, so these are just two row addition operations that I have to do then.
Okay, and those are the ones that I did to get a zero. in this top middle entry and in this bottom middle entry. Okay the next thing that I have to do is I have to turn this minus 8 into a 1 right because I'm going all the way to reduce rational and form. So that's just a scalar multiplication row operation.
I multiply that bottom row by minus 1 over 8 and that turns it into a 1 like I wanted. Okay and then to get to all the way to reduced row echelon form the last thing I've got to do is I've got to get these two entries to zero okay and that's just going to be a couple of addition row operations to get them into zeros and then I'm done. Now this whole matrix is in reduced row echelon form okay and in particular that means the left piece must be in reduced row echelon form and then the remarkable thing that happens is whatever this junk is on the right that's the matrix E that I spoke about earlier okay that's the log that keeps track of how does your matrix go from, you know, just its original matrix down into reduced row echelon form. Okay, in other words, if I took that original matrix A that I started with and multiplied it on the left by this guy here, I would get this reduced row echelon form.
Okay, so let's go through that calculation. Just double check that. Okay, so here's the claim. If I define E to be this matrix on the right, so I've just copy and pasted it into its own matrix, then E times A is the reduced row echelon form of A.
Okay, and that's just something that you can double check really quickly on your own. Just do matrix multiplication. Okay, here's E.
Here's that matrix A that I started with. And if you do that matrix multiplication, you're going to get the reduced row echelon form. For example, I mean, top row dotted with left columns, that's 5 eighths times 0, plus a quarter, plus 3 quarters.
So it's a quarter plus 3 quarters. That's 1. So the top left corner of the product is going to be 1. And so on. You do that for all the other entries, and you're going to find, hey, that looks an awful lot like the reduced rational form.
And that's true in general, okay? That always always always happens. Okay, so we haven't proved that yet, this was just an example to sort of illustrate the method, but it is true in general, okay? And the way that you can prove that, the way that you can see that this happens in general, is via block matrix multiplication, okay?
If you believe that multiplication on the left by an elementary matrix by a single elementary matrix, corresponds to a single elementary row operation, then this fact follows fairly quickly. Okay, this sort of the fact that you can row reduce this matrix augmented with the identity matrix to get e, that follows fairly quickly. Okay, and here's how it works. What you do is you say, okay, I'm going to start off with this matrix a augmented with the identity, just like this is exactly what we did in this previous example.
You augment with an identity matrix on the right, and then you row reduce it to some other matrix. I'm just going to call whatever you get on the left r. I'm going to call whatever you get on the right e. And the elementary matrices corresponding to the row operations that I used to do that row reduction, they're going to be e1, e2, up to ek.
So in other words, what I'm claiming is that I used these elementary row operations to turn ai into re. So this is a row-reduced form of ai. So that's the claim that I just made. Okay, but now if you use your block matrix multiplication tricks, and like actually do the block matrix multiplication over here, like multiply these guys in, then what happens is you see that this matrix over here, it's the same as this matrix, okay? Block matrix multiplication tells us that if you have a matrix times a 1 by 2 block matrix, well you can just multiply this matrix in to each piece, okay?
So... Now you just compare left and right hand sides. On the right hand side in the right block, I've got this product here.
It's the product of all the elementary matrices. Whereas in the right block over here, I've got E. Okay, so that tells me those have to be the same thing.
E equals this, sorry, E equals this right hand block over here. It equals EK times E2 times E1. Okay, but wait, if E equals the product of all these elementary matrices, That equals the product of all these elementary matrices too, so this piece also must be E. So that means that this left block over here is exactly E times A.
and that must equal the left block over here which is r. Okay so if you just string all of this together and compare blocks, compare the right blocks first and then compare the left blocks, you find exactly what we claimed above. You find exactly that yeah the matrix r on the left must equal e times a where e is whatever you get on the right. Alright, so that's a big big mouthful, but let's state that as a sort of a theorem here, just so that's a little bit more concrete and packed together.
Okay, so here's the statement. Here's what we just proved. Okay, if the block matrix A augmented with an identity on the right can be reduced to some matrix where we're just calling whatever's on the left R and whatever's on the right E, then it must be the case that R equals E times A. Okay, R is You take whatever you got on the right and you multiply it by a.
Okay and usually in this theorem, like the most important case of this theorem, is when r is the reduced row echelon form of a. Okay but it doesn't have to be. The theorem is true no matter what you row reduce it to.
Okay you don't have to go all the way down to reduced row echelon form but that's going to be the most interesting case for us when r is the reduced row echelon form but doesn't have to be. Alright, so this is nice. It tells us that just like multiplication on the left by a single elementary matrix corresponds to a single row operation, well multiplication on the left by, you know, this matrix E corresponds to a whole sequence of row operations.
You can encode an entire sequence of row operations, any sequence of row operations that you like, into a matrix that you multiply by on the left. And I mean, so practically, this is not useful. Practically, if you want to take a matrix and row reduce it to something, just row reduce it. Use your row operations.
But theoretically, this is going to be an extremely useful fact, okay? We're going to use this fact to prove all sorts of nice things. This sort of correspondence between row operations and matrix multiplication, that's very, very useful. And we'll see why next class, while starting next class, when we look at invertible matrices, okay?
So I will see you then for that. Thanks for watching.