The rule, and why it exists
Before I state the rule, I need you to understand where it comes from — because without the "why," you're just memorizing a mechanical procedure, and that is a waste of both our time. We built functions in the Sets stratum. Matrices are functions on (full story next lesson). When you compose two functions , you want a single object that represents "apply first, then ." For matrices, that single object is the product — and the requirement that for every vector is what forces the multiplication rule. The rule is not arbitrary. It is the only rule consistent with composition. Remember when the Sets stratum showed that composition is almost never commutative? We're about to see that explode spectacularly, and it'll be fucking glorious.
The product rule: For () and (), the product is the matrix whose entry in row , column is the dot product of row of with column of :
Every entry of is a dot product. This is not coincidental — it's the algebraic trace of the composition requirement.
Dimension compatibility: the handshake requirement
For to exist, the inner dimensions must match: is , must be for some . The result is .
The inner 's must agree — they "cancel". Think of it as a handshake: the number of columns in the left matrix must equal the number of rows in the right matrix, or they refuse to shake hands and the product is undefined.
A concrete product
Let and , both .
Each entry required a dot product: row of the left matrix against column of the right. Every. Single. Entry.
in general
Now watch this. Using the same matrices:
Matrix multiplication is not commutative. This should not be surprising — you already knew from the Sets stratum that composition of functions is not commutative. "Put on socks then shoes" and "put on shoes then socks" are not the same sequence. is "apply first, then ". is "apply first, then ". Different order, different result. The non-commutativity of matrix multiplication is not a bug, it is not a quirk, it is not something to be apologized for. It is the direct mathematical signature of the non-commutativity of function composition, made concrete and inescapable. Every time a student writes without checking, somewhere in this lab a beaker cracks.
The matrix-vector product: columns are key
A special and vital reading of matrix multiplication: for a matrix () and a column vector () is a matrix product yielding an vector.
But here's the reading you should burn into your memory: if are the columns of , then
is a linear combination of 's columns, with the entries of as the coefficients. The components of are the mixing weights. This is THE most important reading of matrix-vector multiplication, and we will use it constantly — burn it into your skull: in understanding systems of equations ( is solvable iff is a combination of 's columns), in understanding transformations (next lesson), and throughout the Vector Spaces stratum. If you take nothing else from this lesson, take that sentence. Write it on your hand. Tattoo it somewhere tasteful.