WRITING LINEAR-ALGEBRA

LA-02

Matrices are functions in disguise.

Part of Linear Algebra from Scratch

For the first half of my linear algebra book, I was treating matrices as a thing I memorized procedures about. Multiply this row by that column. Take the determinant. Invert it if you can. They felt like a particularly bureaucratic kind of arithmetic.

Then someone — I think Strang, in a video — said the line that reorganized everything: a matrix is a function. Specifically, a function that takes one vector and gives you back another vector. The numbers inside the matrix are the recipe for that function. Multiplication is just applying it.

The function-shape of a matrix

If a matrix has three columns and two rows, it is a function from a three-dimensional vector to a two-dimensional vector. The columns describe where the input axes get sent. Column one tells you where the x-axis goes. Column two tells you where the y-axis goes. Column three tells you where the z-axis goes.

That is the entire story. Matrix-vector multiplication is a weighted sum of “where the axes get sent,” weighted by the input vector’s coordinates.

I’m aware this is one of those things that feels obvious in retrospect and slightly miraculous on first contact.

What this reframes

Once a matrix is a function, a lot of the course collapses into a smaller list of ideas:

  • Matrix multiplication is function composition. If A sends 3-D to 2-D and B sends 2-D to 4-D, then BA sends 3-D to 4-D. The order matters because composition order matters.
  • The identity matrix is the do-nothing function.
  • An inverse matrix is the function that undoes the original. If a matrix squashes a dimension, no function can un-squash it — that’s why the determinant is zero and why the inverse doesn’t exist.
  • Eigenvectors are inputs the function only stretches, doesn’t rotate.

Why this took me so long

Two reasons. First, the textbook chapter on matrix multiplication leads with the algorithm — here is the procedure for multiplying two matrices — instead of the meaning. The procedure is correct, but it doesn’t tell you what the procedure is for. You can pass the chapter exam without ever knowing what matrices are doing.

Second, every analogy that gets used early on — “a table of numbers,” “a system of equations” — is technically true but doesn’t survive contact with the upper chapters. The function framing does. It’s the framing the rest of the course is built on. Whoever phrases it that way to you first is doing you a real kindness.

Where this is going

The next post will be about the determinant — why it is what it is, what it actually measures, and why “if it’s zero the matrix has no inverse” is one of the most over-explained and under-motivated facts in the curriculum.

If you'd like new posts when they land, you can leave your email here.