 Welcome back to our lecture series linear algebra done openly. As usual, I'll be your professor today, Dr. Andrew Missildine. In section 3.6 entitled linear transformations on R2, we're going to explore how multiplication by a non-singular matrix transforms the geometry in R2. So necessarily we're going to focus on 2 by 2 matrices. Now while some analogous statements could be extended to the general vector space Fn, and these analogs would depend upon the field itself, only some of the geometric interpretations may apply. So when one takes a class in linear algebra, oftentimes a focus, a huge focus is placed upon the real vector space R2 or R3, things like that. And the main reason is because while R2 and R3 are these vector spaces, we intuitively know very well because of their geometric applications. We as human beings live probably in a three dimensional vector space that looks Euclidean like R3. When we think of animations, we draw pictures in R2. These are ones we can geometrically put our minds around very well. And so other vector spaces like C2 or some of the finite vector spaces like Z25 or Z52, whatever, right? These different vector spaces, the geometry is sort of a little bit different, and as such the intuition might not immediately be there. And so in this section 3.6, we're just going to focus on the geometry in R2. I should mention that a similar analysis of that we will see in this lecture could be conducted for the geometry in R3, right? So R3, again, since vector space, we can understand very well. And so we can talk about the geometric transformations present there like reflections and rotations like we'll see in these lectures, this lecture. But again, for the sake of simplicity and to not blow our geometric minds away, we're going to focus this lecture on just what happens. When you multiply by a non-singular 2 by 2 matrix. So it turns out when you multiply by these non-singular matrices in R2, there's one of three possibilities, which almost coincide with the three types of elementary row operations. It's not exact match up, but we're going to see that right here. So the first type of geometric transformation we can see in R2 is going to coincide with what we call a stretch or a compression. Or if we want to sort of remain neutral, we could call it a scaling of some time. Sounds like a scaling matrix and that's exactly what's going to be going on here. So suppose we have two real numbers, A and B, and the only stipulation I do put on them is that they're going to be positive. The negative case will be taken care of in a later video in this lecture. So if we consider the 2 by 2 matrix where we take A001, first of all, you'll notice, of course, this is an example of a diagonal matrix. The entries off the main diagonal are zero. And in fact, because we have a one right here, this is an example of what we referred earlier as a scaling elementary matrix. And so that's the two type of elementary matrices we're going to consider right now. We can scale. So if you have an A in the 1, 1 position right there, if you multiply on the left, this will have the effect of scaling the first row of the matrix. If you multiply on the right instead, this scales the first column, although we mostly just deal with row operations here. So this is a scaling elementary matrix, which we scale the first row by A. What this will do as a consequence to the geometry is if you multiply a vector, so you have some vector x right here, and you multiply on the left by the matrix A001, it'll have the effect that you are going to horizontally stretch the vector by a factor of A. And stretch typically indicates that the vector is going to get longer. So if you think of it like, oh, here's a vector in space, stretching it, again, that's a typically a word we use to think that the vector got longer. Now, if you're actually going to stretch the vector, you're assuming that the vector, the scalar, excuse me, A has a length greater than 1. So that's what we mean by stretch. On the other hand, if the vector, excuse me, if the scalar A, it's positive, so it's going to be greater than 0, but if its value is less than 1, like say 1 half, we actually think of that as a compression that the vector is actually going to get shorter in length. So we might get something like that, it got compressed, it's shorter. And so if A is a value larger than 1, you're going to stretch the vector horizontally speaking. If A is less than 1, but still greater than 0, you'll horizontally compress it. And, you know, the compress dilate, dilation is something typically used as a synonym for stretching. So you stretched it or you dilated, that's because you scaled by value greater than 1. If you compress it or contract it, that's a word sometimes used. That's because you multiply by a scalar less than 1, that made the vector get smaller. Now, if you were to have this scalar show up in the 1, 1 position, this will have the effect of scaling the vector horizontally. And so let me kind of illustrate why that is. If we multiply this just by a generic vector in R2, say like x, y, when you multiply this vector, what happens here, you take the first row times this vector right here, you're going to end up with A times x plus 0. And then we take the second row times the vector here, you end up with just a y. So the only thing that happened was that the x coordinate got multiplied by A. And so that's why we get this horizontal stretcher compression. Now, on the other hand, if you want to affect the y coordinate, you're going to take a elementary scaling matrix, which you're going to put a B in the 2, 2 position, and then 1 otherwise in the 1, 1 position. This will have the effect of stretching vertically the y coordinate. If B, of course, is greater than 1, if B is less than 1, this could be a compression. Again, these might be called dilations or contractions. All synonyms are the same thing. And you see what happens when you multiply this by a generic vector. If you take the first row times it by x, y, you're just going to get back an x. If you times this row by x, y, you're going to end up with a By. And so this has the effect of multiplying just the y coordinate. Now, if you want to hit both the x and y coordinate at the same time, you can do something like C00C. If you take what we call a scalar matrix, right, this is just C times the identity matrix, I2, right there. If you multiply this by the vector x, y, you see that this will give you Cx times Cy. This is the same thing as times the vector x by the scalar C. And that's why these vectors where the entries along the diagonal are identical are called scalar matrices. It's a special type of scaling elementary matrices. And so if you want to stretch the x and y coordinate by the same factor, you just put the diagonal entries as the same. But if you want different values, you can actually take different values. You can stretch the x coordinate, you can stretch the y coordinate differently. Let's see a specific example of this. So to help us illustrate the type of transformations we're going to do here, the geometric transformation is somewhat invisible if we only look at points one by one. So sometimes it's useful to look at shapes. And so the common shape we'll use the most often is the so-called unit square, which we'll call this capital J for when we have to reference this thing here. The unit square is the polygon formed in the plane by the four points 0, 0, 1, 0, 0, 1 and 1, 1. Which the significance of these points you'll see very quickly is that first of all the point 0, 0, this is just the origin. Or if we think of it as a vector space, this is the zero vector. The vector 1, 0, this is just the vector we typically called E1. And then the vector 0, 1, this is what we typically refer to as E2. So notice that E1 and E2 together form the standard basis for R2. And then the point 1, 1, this is actually just the sum of E1 plus E2. So you add those together. And so this square, so this is the square that's formed by the standard. You think of this as the parallelogram spanned by the standard basis of R2. So looking at the unit square is a pretty good place to get an idea of the geometric transformations in play here. So imagine we are going to multiply by the diagonal matrix 1, 1, 0, 0, 3. So the diagonal entries are going to be 1, 1, 1, and 3. What geometric effect does this diagonal matrix have to the plane R2? Well, since it's a diagonal matrix, it can be factored into a product of elementary matrices of scaling type. And how you factored actually, there's complete freedom here. You can factor this as we're going to scale the first row by one half and scale the second row by three. Now, in terms of operations, this is the first and this is the second. Because if the vector x, y is right here, the vector on the right will actually affect the vector x, y first. And then the one on the left is actually the second acting vector. So if we take this product here, this will look like, in fact, one half x times three y. So geometrically speaking, this matrix will have the effect that we are going to stretch vertically the picture by a factor of three, and we're going to horizontally compress the graph by a factor of two. So compressing by a factor of two is the same thing as multiplying by one half right here, because compression gets smaller, right? And if we, geometrically, this is what's going on here, there's going to be a horizontal, a horizontal compress by two and a vertical stretch by three. And if we look at the unit square piece by piece, we can see what happens. If you take this matrix right here, and you multiply by the zero vector, you're always going to get zero vector here. Be aware that a multiply by a matrix is a linear transformation and linear transformations always send zero to zero. So this matrix multiplication will always give you zero here. And so I want you to see right here that this blue square right here that I'm now outlining. This is the unit square with no transformation to it whatsoever. We have the origin, we have E1, we have E2, and we have the 0.11, which is the sum of those two things right there. So this is our unit square unchanged, okay? So the unit square will send the origin back to itself. Linear transformations always do this. What about the matrix times E1? Well, if you do the product here, one half times zero, you'll get one half. If we take zero three times one zero, we get a zero. And so you get this vector right here. You'll notice that this vector right here is just the first column of the matrix. That's not a coincidence. If you ever have a matrix, any matrix, and you times it by E1, you're going to get back the first column of that matrix, which for a matrix A, we typically call that A1. Like so, that's not a coincidence whatsoever. So you can actually very quickly see, oh, the image is going to just be the first vector, the first column right there. The same thing happens when we multiply by E2. If you take the first column times it by E2, you get zero. If you take the second column times it by E2, you're going to just get back a three. And so you'll notice here that if you take any matrix and you times it by E2, this is just going to give you back the second column of the matrix, which again, if the matrix is called A, we probably call the second column vector A2 right there. These two vectors are identical. So we can actually quite, we can do this without actually matrix multiplication whatsoever, the unit square. This is why we focus on it. The first point, E1 right here, it'll map to the first column, which the first column right turned out to be one half and zero right there. So this guy's going to move to the left by one there. Well, I guess this is actually a half mark. So you just cut the length of this vector in half. So the original vector had length one. This gets contracted to the vector of length one half. That's what happens to that point. On the other hand, if we take E2, because we're stretching this by a factor of three, the original vector, which has a length of one gets stretched to be a vector of length three. And so this vector is now going to move to the point zero comma three. Okay. What about the last one? Well, here we can just do the matrix product. You're just going to get a one. If you do that, you'll get a one half. Do the second row. You're going to get a three. But notice what's happening here is that if you take a matrix and you times it by E1 plus E2, because this is a linear transformation, you know, we can actually, it'll preserve some, we can distribute the A right here. This is going to be A times E1 plus A times E2, which like we mentioned, this is actually going to equal A1 plus A2. So taking the image of one one just means you add together the columns, which gives you again, one half and three right here. So nothing, nothing too difficult. And so the point one one is going to move to the point one half comma three. And so if we connect the four dots here, so let's see what happened. The origin move to the origin. E1 move to one half zero E2 move to zero three and then one one moves to one half three. If we connect the dots, we get this rectangle, which how is the rectangle formed? We took the, we took it and we compressed it horizontally by a factor of two, but then we stretched it vertically by a factor of three. And we can see these effects on the unit square that multiplication by diagonal matrices will change the plane by some type of combination of dilation and contraction. The first coordinate here in the matrix will horizontally stretch or compress the graph. And then the second entry along the diagonal will vertically stretch or compress the graph. And this is what multiplication by a diagonal matrix does. It causes some type of stretching or compressing of the plane.