Geometry of Linear Maps

So far a matrix has been a grid of numbers that stores a system, and $Ax$ has been a column of dot products. This page reads $A$ a different way: as a move. Feed in a vector $x$, get out the vector $Ax$, and ask what happened to the plane (or to space) in between. The answer turns out to be short. Every move a matrix can make is built from a handful of basic ones: stretches, flips, shears, rotations, and projections. And every one of those is decided by where two arrows go.

A $2 \times 2$ matrix takes a point of the plane and hands back another point. Do that to every point at once and the plane moves: it stretches, flips, tilts, turns, or squashes flat. This page is a tour of those moves, each one a small matrix, and the surprise at the end is that every $2 \times 2$ matrix is a chain of them. The letter F rides along in every picture, because an F shows at a glance whether a move stretched it, turned it, or flipped it over.

The function in every picture is $x \mapsto Ax$: a vector goes in, $A$ times it comes out. We'll call it the map of $A$, or just the move. The next page, Null Space & Range, gives it its proper name and its properties; this page is about what it looks like.

Two Arrows Decide Everything

Here's the fact that makes the whole page readable at a glance. You don't need to track every point; two of them tell you the rest.

Let $A$ be $m \times n$. Then $Ae_j$ is the $j$-th column of $A$: the columns of $A$ are the images of the standard basis vectors. So the map of $A$ is decided by where $e_1, \ldots, e_n$ go, and $A(c_1e_1 + \cdots + c_ne_n) = c_1(Ae_1) + \cdots + c_n(Ae_n)$.

Show proof

By the column picture, $Ax$ is $x_1$ times column $1$ plus $\cdots$ plus $x_n$ times column $n$. For $x = e_j$ every coefficient is $0$ except the $j$-th, which is $1$, so $Ae_j$ is column $j$. The last sentence is the column picture again, with $x = (c_1, \ldots, c_n)$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. $Ax$ is a chain of the columns, $x_1$ of the first and $x_2$ of the second. Feed in $e_1 = (1, 0)$ and the chain is one step of column $1$ and none of column $2$: you land on column $1$. So the grid of squares, whose corners are the combinations of $e_1$ and $e_2$, becomes the grid of parallelograms built on the two columns.

The full proof is in the n version.

So to read a matrix as a move: column $1$ is where the arrow $e_1$ lands, column $2$ is where $e_2$ lands, and everything else follows the grid. To write a move as a matrix: find where $e_1$ and $e_2$ go and stand those vectors up as the columns. Here's both directions on one small matrix.

Let $A = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}$. Where does $A$ send $e_1$, $e_2$, and $(3, -1)$? And which matrix sends $e_1$ to $(0, 2)$ and $e_2$ to $(1, 0)$?


$Ae_1$ is the first column, $(2, 1)$, and $Ae_2$ is the second, $(1, 1)$. Then $(3, -1) = 3e_1 - e_2$ goes to $3(2, 1) - (1, 1) = (5, 2)$, which is also what the row-by-row multiplication gives: $(2 \cdot 3 + 1 \cdot (-1), \ 1 \cdot 3 + 1 \cdot (-1)) = (5, 2)$.

For the second question, stand the images up as columns: $\begin{pmatrix} 0 & 1 \\ 2 & 0 \end{pmatrix}$. No solving needed; the matrix is the list of where the two arrows go.

One more general fact, about what a move can't do.

The map of a matrix sends $0$ to $0$, every line to a line (or to a single point), parallel lines to parallel lines (or points), and equally spaced points on a line to equally spaced points.

Show proof

$A0 = 0$ since every entry of $A0$ is a dot product with the zero vector. A line is $\{p + tv : t \in \R\}$ with $v \neq 0$, and by the rules for $A(x + y)$ and $A(cx)$, $A(p + tv) = Ap + t(Av)$. If $Av \neq 0$ that is the line through $Ap$ with direction $Av$; if $Av = 0$ every point lands on $Ap$. Two parallel lines $p + tv$ and $q + tv$ share the direction $v$, so their images share the direction $Av$. The points $p + kv$ for $k = 0, 1, 2, \ldots$ land on $Ap + k(Av)$, equally spaced along the image. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. A point on a line is a base point plus some steps of one direction. The move sends the base point somewhere and the direction somewhere, and the steps come along unchanged: $A(p + tv) = Ap + t(Av)$. Base point plus steps of one direction is a line again, with the dots still evenly spaced, and two lines that shared a direction still share one.

The full proof is in the n version.

No bending, no curving, and the origin never moves. That rules out a lot (a matrix can't slide the whole plane sideways, for instance; the Computer Graphics page has a trick for that). What's left is exactly the family of moves below.

Stretches and Flips

The simplest move changes one coordinate by a factor and leaves the others alone.

A stretch of the $i$-th direction by $k \neq 0$ is the map of the diagonal matrix that agrees with $I$ except for a $k$ in position $(i, i)$: it multiplies the $i$-th coordinate by $k$ and leaves the other coordinates unchanged.

A stretch of the $x$-direction by $k \neq 0$ is the map $(x, y) \mapsto (kx, y)$ of the matrix $\begin{pmatrix} k & 0 \\ 0 & 1 \end{pmatrix}$; a stretch of the $y$-direction by $k$ is $(x, y) \mapsto (x, ky)$, the matrix $\begin{pmatrix} 1 & 0 \\ 0 & k \end{pmatrix}$. In space there are three directions to stretch.

A factor between $0$ and $1$ is a squeeze, and a negative factor sends the coordinate to the other side of the origin while scaling it. Here's a pair, one of each sign.

Describe the maps of $\begin{pmatrix} 3 & 0 \\ 0 & 1 \end{pmatrix}$ and $\begin{pmatrix} -2 & 0 \\ 0 & 1 \end{pmatrix}$, and say where each sends the unit square.


The first: $e_1 \mapsto (3, 0)$ and $e_2 \mapsto (0, 1)$, so $(x, y) \mapsto (3x, y)$. Every $x$-coordinate is tripled; the unit square becomes the $3 \times 1$ rectangle with corners $(0, 0), (3, 0), (3, 1), (0, 1)$.

The second: $e_1 \mapsto (-2, 0)$, so $(x, y) \mapsto (-2x, y)$. The $x$-direction is doubled and sent the other way: the unit square lands on the rectangle from $(-2, 0)$ to $(0, 1)$, on the left of the $y$-axis. That's a stretch by $2$ and a flip across the $y$-axis at once.

The flip hiding in that second matrix deserves its own name. Two reflections come up constantly, and both are one-entry changes to the identity.

A reflection across a line through the origin sends every point to its mirror image across that line. The matrix $\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$ is the reflection across the $x$-axis, $(x, y) \mapsto (x, -y)$, and the swap $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ is the reflection across the line $y = x$, $(x, y) \mapsto (y, x)$.

Both deserve a check, because "the matrix swaps coordinates" and "the matrix is a mirror" don't obviously say the same thing.

Check that the swap $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ really is the mirror across $y = x$, and find the matrix of the reflection across the $y$-axis.


The mirror image of $(x, y)$ across the line $y = x$ is $(y, x)$: the two points are the same distance from the line, on opposite sides, and the segment between them is perpendicular to it (its direction $(y - x, x - y)$ is a multiple of $(1, -1)$). And $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} y \\ x \end{pmatrix}$. Points on the line itself, where $x = y$, don't move, as a mirror should leave them.

Across the $y$-axis the mirror image of $(x, y)$ is $(-x, y)$: $e_1 \mapsto (-1, 0)$, $e_2 \mapsto (0, 1)$, so the matrix is $\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}$, a stretch of the $x$-direction by $-1$.

A reflection can't be done by sliding the paper around. You have to pick it up and turn it over. The matrix did that without lifting anything. Suspicious.

Shears

The third kind of elementary move is the one that looks least like a move from geometry class. It comes from the row operation $R_i \to R_i + kR_j$, and it slides.

A shear is the map of a matrix that agrees with $I$ except for one off-diagonal entry $k$ in position $(i, j)$: it adds $k$ times the $j$-th coordinate to the $i$-th coordinate and leaves every other coordinate unchanged.

A shear of the plane slides each point parallel to one axis by an amount proportional to its other coordinate: $(x, y) \mapsto (x, y + kx)$ is the matrix $\begin{pmatrix} 1 & 0 \\ k & 1 \end{pmatrix}$, and $(x, y) \mapsto (x + ky, y)$ is the matrix $\begin{pmatrix} 1 & k \\ 0 & 1 \end{pmatrix}$.

The key sentence: how far a point slides depends on where it stands. Hefferon's example makes that visible with two vectors.

Let $A = \begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix}$. Find the images of $u = (1, 1)$ and $v = (2, 1)$, and describe what $A$ does to the unit square.


$Au = (1, 1 + 2) = (1, 3)$ and $Av = (2, 1 + 4) = (2, 5)$. In general $A(x, y) = (x, y + 2x)$: every point slides straight up by twice its $x$-coordinate. $u$, with $x = 1$, rises by $2$; $v$, with $x = 2$, rises by $4$. Points on the $y$-axis, where $x = 0$, don't move at all.

So the unit square's left side ($x = 0$) stays put and its right side ($x = 1$) slides up by $2$: the square becomes the parallelogram with corners $(0, 0), (1, 2), (1, 3), (0, 1)$. Same base, same height, and the same area, but the right angles are gone.

Put the $k$ in the other corner and the slide goes sideways instead: $\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}$ sends $(x, y)$ to $(x + 2y, y)$, so each horizontal line slides right by twice its height.

Stretches, swaps, and shears are the maps of the elementary matrices: $I$ after one row operation. Scaling a row by $k$ gives a stretch, swapping two rows gives a swap, and adding $k$ times one row to another gives a shear. That's why the pieces of elimination are about to turn into the pieces of every move.

Rotations

Rotations are the moves everyone expects, and they're not elementary matrices. But the two-arrows rule writes them down in one line.

The rotation by $\theta$, written $R_\theta$, is the map that turns every point of the plane about the origin through the angle $\theta$ counterclockwise, keeping its distance from the origin.

Where do $e_1$ and $e_2$ land? On the unit circle, a quarter turn apart.

The matrix of the rotation by $\theta$ is

$$R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}.$$
Show proof

Turning $e_1 = (1, 0)$ by $\theta$ lands on the unit circle at angle $\theta$: $(\cos\theta, \sin\theta)$. Turning $e_2 = (0, 1)$, which sits at angle $90^\circ$, lands at angle $\theta + 90^\circ$: $(\cos(\theta + 90^\circ), \sin(\theta + 90^\circ)) = (-\sin\theta, \cos\theta)$. Those are the two columns. Rotation is linear (it sends a parallelogram with corners $0, u, v, u + v$ to a congruent one with corners $0, R_\theta u, R_\theta v, R_\theta(u + v)$, so sums go to sums, and it scales with scaling), so the two columns decide the whole map. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Turn the plane by $\theta$: $e_1$ rides the unit circle to $(\cos\theta, \sin\theta)$, and $e_2$, always a quarter turn ahead, lands at $(-\sin\theta, \cos\theta)$. Columns are where the basis arrows go.

The full proof is in the n version.

The two angles you'll use most have no trig in them at all.

Write the matrices of the rotations by $90^\circ$ and by $180^\circ$, and find where the rotation by $90^\circ$ sends $(3, 1)$.


At $\theta = 90^\circ$, $\cos\theta = 0$ and $\sin\theta = 1$: $R_{90^\circ} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$. At $180^\circ$, $\cos\theta = -1$ and $\sin\theta = 0$: $R_{180^\circ} = \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix}$, which is $(x, y) \mapsto (-x, -y)$, the point reflected through the origin.

$R_{90^\circ}(3, 1) = (0 \cdot 3 - 1 \cdot 1, \ 1 \cdot 3 + 0 \cdot 1) = (-1, 3)$. Check: $(3, 1)$ and $(-1, 3)$ have the same length $\sqrt{10}$ and their dot product is $-3 + 3 = 0$, a right angle.

One slip to watch for in the formula.

The minus sign goes top right. The matrix with $+\sin\theta$ in both corners, $\begin{pmatrix} \cos\theta & \sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$, is not a rotation at all: at $\theta = 90^\circ$ it's the swap, a reflection. The test that catches it every time is the letter F: a rotation never produces a backward F, a reflection always does. (Clockwise by $\theta$ is counterclockwise by $-\theta$: swap the signs of the two sines.)

Projections

Every move so far could be undone. The last kind can't.

A projection onto some of the coordinate axes is the map of a diagonal matrix whose diagonal entries are $1$'s and $0$'s (a partial identity): it keeps the coordinates with a $1$ and sets the others to $0$.

A projection onto an axis keeps that coordinate and sets the other to $0$: $\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$ is $(x, y) \mapsto (x, 0)$, the projection onto the $x$-axis. In space, $(x, y, z) \mapsto (x, y, 0)$ projects onto the $xy$-plane.

Here's the one that squashes space, and why nothing brings it back.

Describe the map of $P = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{pmatrix}$, and explain why no matrix $Q$ has $QP = I$.


$P(x, y, z) = (x, y, 0)$: every point of space drops straight down onto the $xy$-plane, and the unit cube flattens into the unit square. The whole $z$-axis lands on the origin.

If some $Q$ had $QP = I$, then for the point $(0, 0, 1)$ we would get $(0, 0, 1) = QP(0, 0, 1) = Q(0, 0, 0) = 0$, which is false. A projection sends different points to the same place, so nothing can send them back. (In the language of The Four Fundamental Subspaces, its null space is the $z$-axis, so it isn't invertible.)

The cube dropping onto the floor.

Now read a few matrices as moves, and write a few moves as matrices. The first question is about reading, and its answers are descriptions, so it stays multiple choice.

Loading practice engine...

And the other direction. In free response, type the four entries row by row, separated by commas, like 0, -1, 1, 0.

Loading practice engine...

Here are all the moves at once, with you at the dials. Each mission names a picture; find the matrix that makes it.

Make the Move

The readout under the sliders, $|ad - bc|$, is the area of the moved unit square. Keep an eye on it; it's the next page but one.

Every Move Is a Chain of Simple Ones

Doing one move and then another is a move. Its matrix is the product, and the order matters.

Doing the move of $A$ first and then the move of $B$ is the move of the product $BA$: $B(Ax) = (BA)x$. The first move goes on the right. In general $BA \neq AB$.

Show proof

$B(Ax) = (BA)x$ is the associative rule for matrix products (with $x$ as an $n \times 1$ matrix). For the inequality, stretch $x$ by $2$ then rotate by $90^\circ$: $e_1 \mapsto (2, 0) \mapsto (0, 2)$. Rotate then stretch: $e_1 \mapsto (0, 1) \mapsto (0, 1)$. Different images of $e_1$, so different matrices: $R_{90^\circ}S = \begin{pmatrix} 0 & -1 \\ 2 & 0 \end{pmatrix}$ but $SR_{90^\circ} = \begin{pmatrix} 0 & -2 \\ 1 & 0 \end{pmatrix}$. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Follow $e_1$ through the two moves: $A$ sends it to $A$'s first column, then $B$ sends that column wherever $B$ sends it, which is $B$ times the column, the first column of $BA$. The chain's matrix is read off one arrow at a time, and the move that happened first is the one written on the right, next to $x$. Swap the order and $e_1$ takes a different trip; the Chain of Moves widget below has a mission built on exactly that.

The full proof is in the n version.

Now the big one. Elimination reduces an invertible matrix to $I$ with row operations, and each row operation is an elementary matrix, which is a move. Run that backward and you've built the matrix out of moves.

A square matrix $A$ is invertible exactly when it is a product of elementary matrices. So the move of an invertible matrix is a chain of stretches, swaps, and shears, and every such chain is invertible.

Show proof

If $A$ is invertible, it row reduces to $I$ (Rank & Inverses), and each row operation is left multiplication by an elementary matrix: $E_k \cdots E_1 A = I$. So $A = E_1^{-1} \cdots E_k^{-1}$, and the inverse of an elementary matrix is elementary (undo a scale by scaling, a swap by the same swap, an add by subtracting). Conversely, a product of elementary matrices is a product of invertible matrices, hence invertible. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. Reduce $A$ to $I$ with row operations and write down each one as a move. Each move can be undone by a move of the same kind. Undo them in reverse order, starting from the untouched plane, and the F lands exactly where $A$ sends it. Here it is for $A = \begin{pmatrix} 1 & 2 \\ 1 & 3 \end{pmatrix}$, which turns out to be two shears.

The full proof is in the n version.

The proof is a recipe, and the recipe is elimination. Here it is on the matrix from the picture.

Write $A = \begin{pmatrix} 1 & 2 \\ 1 & 3 \end{pmatrix}$ as a chain of elementary moves.


Reduce: $R_2 \to R_2 - R_1$ gives $\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}$, then $R_1 \to R_1 - 2R_2$ gives $I$. As elementary matrices, $E_1 = \begin{pmatrix} 1 & 0 \\ -1 & 1 \end{pmatrix}$ and $E_2 = \begin{pmatrix} 1 & -2 \\ 0 & 1 \end{pmatrix}$, with $E_2E_1A = I$. So

$$A = E_1^{-1}E_2^{-1} = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}.$$

Reading right to left: first the shear $(x, y) \mapsto (x + 2y, y)$, then the shear $(x, y) \mapsto (x, y + x)$. Check with $e_1$: the first shear leaves it at $(1, 0)$, the second lifts it to $(1, 1)$, the first column of $A$. And $e_2 \mapsto (2, 1) \mapsto (2, 3)$, the second column.

What about matrices that aren't invertible? They squash something flat, and that's the only extra ingredient.

Every $m \times n$ matrix $A$ can be written as $A = PBQ$, where $P$ ($m \times m$) and $Q$ ($n \times n$) are invertible and $B$ is the $m \times n$ partial identity with $\rank(A)$ ones on its diagonal. So every move is an invertible chain, then a projection, then another invertible chain.

Show proof

Row reduce $A$ to its reduced row echelon form: $EA = R$ with $E$ a product of elementary matrices. Now do column operations on $R$: a column operation is right multiplication by an elementary matrix (it is a row operation on the transpose, and $(FR^t)^t = RF^t$). Each pivot column of $R$ is a standard vector $e_i$, so subtracting multiples of the pivot columns from the other columns clears every non-pivot column to $0$; then swapping columns moves the pivot columns to positions $1, \ldots, r$. The result is the partial identity $B$ with $r = \rank(A)$ ones: $RF = B$ for some product $F$ of elementary matrices. Then $EAF = B$, so $A = E^{-1}BF^{-1}$, and $P = E^{-1}$, $Q = F^{-1}$ are products of elementary matrices, hence invertible. $\blacksquare$

Why it's true (picture)

This is a visual argument, not a formal proof. A non-invertible matrix flattens the plane onto a line (or a point). Picture it in three steps: an invertible move lines things up, a projection does the flattening, and a second invertible move tilts the flattened line to wherever $A$ puts it. Here is $A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}$, which flattens everything onto the line $y = 2x$.

The full proof is in the n version.

Build some chains yourself. A shelf of moves, a target F, and the order to get right.

Chain of Moves

Missions 1 and 2 use the same two moves and land in different places. Your turn on paper. In free response, type the product's four entries row by row.

Loading practice engine...

Each of the moves multiplies every area by one fixed number: a stretch by $|k|$, a shear by $1$, a swap by $1$ (while turning the plane over), a projection by $0$. A chain multiplies the factors. That one number per matrix is the determinant, and for a $2 \times 2$ it's $ad - bc$, up to sign.

Application: Zooming In on a Curve

Most maps of the plane aren't linear. But zoom in close enough on any smooth map and it looks like one of this page's moves. That's what a derivative is.

The function $y = x^2 + x$ sends the interval from $0.9$ to $1.1$ to which interval? What about the map of the plane $(x, y) \mapsto (x^2, x + y)$ on a small square around $(1, 1)$?


$0.9 \mapsto 0.81 + 0.9 = 1.71$ and $1.1 \mapsto 1.21 + 1.1 = 2.31$. An input interval of width $0.2$ became an output interval of width $0.6$: a stretch by $3$, which is the derivative $2x + 1$ at $x = 1$. Near $x = 1$ the curve acts like the linear map $t \mapsto 3t$ on small displacements $t$.

For the map of the plane, write a point near $(1, 1)$ as $(1 + s, 1 + t)$ with $s, t$ small. Then $(x^2, x + y) = (1 + 2s + s^2, \ 2 + s + t)$. Dropping the tiny $s^2$, the displacement $(s, t)$ becomes $(2s, s + t)$, which is the matrix

$$\begin{pmatrix} 2 & 0 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} s \\ t \end{pmatrix}.$$

A stretch of the $x$-direction by $2$ and a shear. A small square around $(1, 1)$ comes out as (almost exactly) a parallelogram around $(1, 2)$, and the matrix is the map's derivative at $(1, 1)$: the matrix of partial derivatives $\begin{pmatrix} \partial x^2/\partial x & \partial x^2/\partial y \\ \partial(x + y)/\partial x & \partial(x + y)/\partial y \end{pmatrix}$ evaluated there.

This is why the chain rule multiplies: zooming in, $f$ is a matrix, $g$ is a matrix, and $g \circ f$ is the chain of the two moves, whose matrix is the product. In one variable the matrices are $1 \times 1$ and the product is the familiar $g'(f(x)) \cdot f'(x)$.

The toolkit for this page: a matrix is a move, decided by where $e_1, e_2$ go, which are its columns. The basic moves are stretches (diagonal entries), flips (a $-1$, or a swap), shears (one off-diagonal entry), rotations ($\cos\theta$, $-\sin\theta$, $\sin\theta$, $\cos\theta$), and projections (a $0$ on the diagonal). A chain of moves is the product with the first move on the right, every invertible matrix is a chain of stretches, swaps, and shears, and every matrix is such a chain, a projection, and another chain.

Mixed Practice

Every question so far came right after its idea, which is a hint a quiz never gives you. Down here the hint is gone. First, true or false: a claim from anywhere on this page, and you decide whether it holds.

Loading practice engine...

Next, a mixed set: every question type on this page, shuffled. Type a matrix's four entries row by row, with commas. The which-move questions stay multiple choice.

Loading practice engine...

Made it this far? Time for something with a little heat. A matrix is a chain of three moves, a stretch, then a shear with an unknown amount $k$, then a turn or a flip. Undo the last move, divide out the stretch, and $k$ is sitting in a corner. In free response, type the number.

🌶️ SPICY BONUS 🌶️

Loading practice engine...