Algebra

A matrix is a picture of what happens to the grid

Four numbers in a box is not an object anyone has intuitions about. The same four numbers, shown as an instruction for redrawing the plane, are.
15 min read 7 figures Throwing things away

A matrix is usually introduced as a rectangular array of numbers with rules attached — the same pedagogic move that presents sine as a ratio and hopes the meaning arrives later. The rules are peculiar. Addition works entrywise, as expected. Multiplication does not — it involves rows meeting columns in a pattern that has to be memorised, and it is not commutative, which is presented as a fact to be accepted rather than explained.

None of this is arbitrary. It is all forced, once the matrix is understood as what it actually is: a set of instructions for redrawing the plane. What follows is an attempt to make every one of those rules look inevitable rather than conventional — the same treatment the conic sections get from a cone.

A linear map redrawing the planeThe integer grid before and after a linear transformation; the shaded unit square becomes a parallelogram whose area is the determinant.beforeafter · area × 2.50210.51.5
Fig. 1 The integer grid, before and after. Every straight line has stayed straight, every parallel pair has stayed parallel, and the origin has not moved — those three properties are what “linear” means. The shaded unit square has become a parallelogram.

The columns are the destinations

Here is the fact that makes matrices readable rather than memorable. The columns of a matrix say where the basis vectors go.

For the matrix above, (210.51.5)\begin{pmatrix} 2 & 1 \\ 0.5 & 1.5\end{pmatrix}, the first column says the vector pointing one unit east lands at (2,0.5)(2, 0.5). The second says the vector pointing one unit north lands at (1,1.5)(1, 1.5). That is the entire content of the matrix, and everything else follows.

A matrix's columns are where the basis vectors landThe first column gives the destination of the vector pointing one unit east; the second gives the destination of the vector pointing one unit north.eastnorth(2, 0.5)(1, 1.5)210.51.5column 1column 2
Fig. 2 The two columns of the matrix, read as destinations. Everything else about the transformation follows from these two arrows.

It follows because the map is linear, and linearity means the map respects addition and scaling. Any point is a combination of the two basis vectors — the point (3,2)(3, 2) is three easts plus two norths — so its destination must be three of the first column plus two of the second. Which is exactly the rule for multiplying a matrix by a vector. The rule is not a convention; it is the only rule consistent with wanting the grid lines to stay straight and evenly spaced.

Matrix multiplication is then composition: do one transformation, then another — exactly as multiplying complex numbers composes two turns. That it is not commutative stops being surprising the moment it is read this way. Rotating and then stretching is visibly not the same as stretching and then rotating, in the same way that putting on socks then shoes is not the same as shoes then socks.

None of the three properties is negotiable, incidentally. Drop straight lines stay straight and the grid can curve. Drop parallels stay parallel and squares can become trapezoids. Drop the origin stays put and translations creep in, which is why moving an object requires the slightly larger machinery of affine maps. Computer graphics carries an extra coordinate on every point for exactly this reason: it buys translations back.

The determinant is an area

The unit square, carried along by the map, becomes a parallelogram. The determinant is the factor by which its area changed.

A linear map redrawing the planeThe integer grid before and after a linear transformation; the shaded unit square becomes a parallelogram whose area is the determinant.beforeafter · area × 110.901
Fig. 3 A shear on its own. Every horizontal line slides sideways in proportion to its height; the grid is visibly deformed and not one square millimetre of area has been created or destroyed.
Four linear mapsA shear, a rotation, a squeeze and a singular map, each applied to the same grid and unit square.sheardet = 1 · area unchangedrotationdet = 1 · area unchangedsqueezedet = 0.99 · area unchangedcollapsedet = 0 · area zero
Fig. 4 Four maps. A shear slides the plane sideways without changing any area. A rotation turns it rigidly. A squeeze stretches one direction while compressing the other, by matching amounts. The last one collapses everything onto a line.

For the shear this is the surprising one: the grid is visibly deformed, every square has become a slanted parallelogram, and yet no area has been lost or gained anywhere. A parallelogram with the same base and the same height as a rectangle has the same area, so sliding the top of the square sideways costs nothing. The determinant is 1.

The rotation is 1 for the obvious reason: turning something does not resize it.

The squeeze stretches by 1.8 in one direction and compresses by 1/1.81/1.8 in the other. Those cancel, and the determinant is 1 again. This is exactly the transformation that preserves area while making shapes arbitrarily long and thin, and it is the reason a determinant of 1 does not mean “nothing much happened”.

Zero determinant, and why it matters

The fourth panel is the interesting one. The map (10.521)\begin{pmatrix} 1 & 0.5 \\ 2 & 1\end{pmatrix} sends the entire plane onto a single line. The unit square becomes a segment. Its area is zero, so the determinant is zero.

What has happened is that the two columns landed on the same line as each other, so the second basis vector’s destination is just a multiple of the first’s. The map has run out of directions. A two-dimensional input has produced a one-dimensional output, and a whole dimension’s worth of information has been thrown away.

This is why a determinant of zero means a matrix has no inverse, and it is a much better reason than the one usually offered — that the formula for the inverse has a determinant in the denominator. The formula divides by zero because there is nothing to divide, not the other way round. Once distinct points have been squashed onto the same output point, no transformation can pull them apart again, since it would have to know which of the infinitely many candidates each one came from.

Every fact about singular matrices flows from this, in the way that every fact about Königsberg flows from four numbers being odd. Why does det=0\det = 0 mean the columns are linearly dependent? Because they landed on a common line. Why does it mean the system Ax=bA\mathbf{x} = \mathbf{b} has either no solutions or infinitely many? Because the output is confined to a line: if b\mathbf{b} is off that line, nothing maps to it; if b\mathbf{b} is on it, an entire line of inputs maps to it.

A linear map redrawing the planeThe integer grid before and after a linear transformation; the shaded unit square becomes a parallelogram whose area is the determinant.beforeafter · area × 10.71-0.710.710.71
Fig. 5 A rotation. Every length and every angle is preserved, so the grid stays square and the determinant is exactly 1.
A linear map redrawing the planeThe integer grid before and after a linear transformation; the shaded unit square becomes a parallelogram whose area is the determinant.beforeafter · area × -0.9611.41.41
Fig. 6 A map with determinant 11.96=0.961 - 1.96 = -0.96. Areas barely change size, but the grid has been turned inside out: what was anticlockwise is now clockwise.

A negative determinant, incidentally, means the plane got flipped over — the transformation reversed orientation, turning anticlockwise into clockwise. The magnitude is still the area factor; the sign records handedness.

The sign is not a detail

That last sentence is usually delivered as an afterthought, and it carries more than the area factor does.

A linear map redrawing the planeThe integer grid before and after a linear transformation; the shaded unit square becomes a parallelogram whose area is the determinant.beforeafter · area × -1100-1
Fig. 7 A pure reflection in the horizontal axis. Every length is preserved, every angle is preserved, no area changes — and the determinant is 1-1. The grid is identical to the one it started as, apart from a property no measurement of size can detect.

Nothing about this map changes the size of anything. Lengths, angles, areas: all untouched. A reader handed the before and after grids with the labels removed could not tell from any measurement that a transformation had occurred at all — and yet the two are not related by any rotation. A shape and its mirror image are different objects, and no amount of sliding or turning within the plane brings one onto the other.

That is the sign’s entire content, and it is a genuinely global fact hiding in one bit. Determinants of positive sign form the maps that can be reached continuously from doing nothing; negative ones cannot. The set of invertible maps comes in two pieces, and the determinant’s sign says which piece.

The physical version is more striking. A left hand and a right hand are mirror images, and no rotation in three-dimensional space converts one into the other — a fact anyone who has tried to put a left glove on a right hand has verified experimentally. Chemistry cares intensely: two molecules identical in every bond length and bond angle but of opposite handedness can have entirely different biological effects, and separating them is a whole industry. All of this is a single minus sign in a determinant.

The essay’s central image is slightly misleading here, and worth correcting. A grid being pulled out of shape suggests that a transformation is a matter of degree — more stretch, less stretch, more shear. The sign says there is also a matter of kind, that no degree of stretching ever crosses, and that the two kinds are separated by the maps that destroy a dimension. To get from a positive determinant to a negative one continuously, the determinant must pass through zero, which is to say the plane must be flattened onto a line and then unfolded the other way. Reversing handedness requires giving up a dimension on the way.

The same distinction, in a setting where it fails rather than holds, is what makes a surface with only one side so disconcerting: on a Möbius strip, a shape can be slid around until it comes back mirrored, because the surface offers a route that the plane does not.

The composition rule, for free

Two facts that are tedious to prove algebraically are immediate from the picture.

det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B). Apply one map that multiplies areas by 3, then another that multiplies by 2, and areas end up 6 times larger. There is nothing else it could be.

det(A1)=1/det(A)\det(A^{-1}) = 1/\det(A). Undoing a map that tripled areas must divide them by three.

These are one-line consequences of “the determinant is an area factor”, and multi-line inductions from the algebraic definition. That is a good general signal: when a proof is long and the corresponding picture is short, the picture is usually closer to what is actually going on.

The determinant is the wrong tool for the job it is famous for

The picture makes a clean claim: zero determinant means a dimension was destroyed, and the map cannot be undone. As mathematics that is exact. As a test to be performed on an actual matrix it is close to useless, and the reason is worth following because it is not a matter of rounding.

Determinants scale ferociously. Multiplying a matrix by a constant multiplies its determinant by that constant raised to the power of the size — halve every entry of a 1000×10001000 \times 1000 matrix and its determinant is divided by 210002^{1000}, a number with three hundred digits. The matrix is exactly as invertible as it was; the same map, in the same directions, undone the same way. Only the reported number has moved, and it has moved off the end of what a machine can represent.

So a determinant near zero does not mean a matrix is near singular, and a determinant of 1020010^{-200} may belong to a perfectly well-behaved map. Worse in the other direction: a matrix can have determinant exactly 11 and be as close to singular as anything ever gets. The map that stretches by 10610^{6} in one direction and compresses by 10610^{-6} in the other has determinant 11 — the squeeze from the zoo figure, at an extreme setting — and it has flattened the plane to within a millionth of a line. Every practical consequence of singularity is present. The area factor cannot see it, because area is the one quantity the squeeze leaves alone.

What actually answers the question is the ratio between the largest and smallest stretch factors, called the condition number: how much the map favours its best direction over its worst. That number is 101210^{12} for the squeeze above and 11 for a rotation, which correctly ranks them. It is also considerably more expensive to compute than a determinant, which is part of why the determinant kept its reputation.

There is a consolation, and it is that the picture held the answer all along, in a feature nobody thought to read it for. Carry the unit circle through the map instead of the unit square. It comes out an ellipse — always, for every linear map, because that is what linearity does to a circle. The determinant is that ellipse’s area. The condition number is its aspect ratio, long axis over short. The two are independent readings of one drawing.

Run the zoo through it. The rotation’s ellipse is still a circle: area 11, ratio 11. The reflection’s is a circle too, area 11 with the orientation flipped, ratio 11. The shear (10.901)\begin{pmatrix}1&0.9\\0&1\end{pmatrix} has area 11 and axes 1.5471.547 and 0.6470.647 — ratio 2.392.39, so a map that creates no area at all has already distorted shape by a factor of two and a half. The squeeze has area 11 and axes 1.81.8 and 0.5560.556: ratio 3.243.24. The singular map’s ellipse has collapsed to a segment 2.52.5 long and nothing wide, so its area is zero and its ratio is infinite. Three of those maps have determinant exactly 11 and aspect ratios of 11, 2.392.39 and 3.243.24.

That is the previous few paragraphs restated as a picture, and it settles where the blame lies. The drawing does contain the quantity the determinant cannot see. It was simply never being asked — this essay drew a square, and the image of a square reports the area it has become without reporting the shape it has been pulled into.

The lesson generalises past matrices. A quantity that is zero exactly when a property holds is not thereby a measurement of how nearly the property holds. The determinant answers is this map singular with complete authority and answers is this map nearly singular not at all, and the second question is the one that arises whenever the entries came from measurements rather than from a textbook.

What the picture cannot show

The grid pictures are two-dimensional, and almost everything interesting about linear algebra happens in higher dimensions where no such picture exists. A 1000×10001000 \times 1000 matrix has the same three-line description — the columns say where the basis vectors go — and no drawing at all.

More subtly, the plane pictures make some facts look more obvious than they are. That the determinant multiplies under composition is genuinely easy in two dimensions and stays true in nn; that a map with non-zero determinant is invertible is also true in general. But “the unit square becomes a parallelogram” has no direct analogue for a non-square matrix, where the input and output live in spaces of different dimension and there is no determinant at all. Rank, not determinant, is the concept that survives — and rank has no two-dimensional picture that does it justice.

The pictures also cannot show eigenvectors, which are what most applications actually want. Those are visible in a different drawing — the directions the grid leaves pointing where they started — and that is a separate rung.

The ladder from here

Later rungs: eigenvectors and eigenvalues, drawn as the directions a map does not turn. Diagonalisation, and what it means to choose the right basis. The characteristic polynomial. Singular value decomposition as “every map is a rotation, a stretch, and another rotation”. Rank and nullity as the dimensions that survive and the dimensions that collapse. Change of basis. Rotation matrices in three dimensions, and why they do not commute. Projections, least squares, and the dot product as a shadow. The connection to complex multiplication, which is exactly the rotation-and-scale subfamily. And Markov matrices, where the grid picture becomes a picture of probability flowing.

Throwing away the numbers

There is a broader habit here, and it is the same one that turns the seven bridges of Königsberg into four dots and seven lines: discard the parts of the description that the question does not depend on.

A matrix has four numbers. The determinant has one. Enormous amounts of information have been thrown away — the determinant cannot say whether the map was a rotation or a shear or a reflection composed with a stretch. But the one number it keeps answers a specific question completely: has anything been lost, and by how much has the scale changed?

Knowing what to discard is most of the skill, and Euler discarding a city is the canonical demonstration. The eigenvalues throw away a different subset and answer a different question — which directions were left pointing the way they started. That question has its own picture, and it is not this one; the grid shows what happened to everything, and eigenvectors are about the few directions where nothing much did. The rank throws away nearly everything and keeps only how many dimensions survived. Each is a lens, and each is useless for the questions the others answer.

The picture is what makes it possible to see which lens is which. Four numbers in a box do not suggest anything. A grid being pulled out of shape suggests quite a lot.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

AreaBasisDeterminantMatrixOrientationRankShearSingular matrix