Summary
A matrix describes a linear map. Its columns say where the input basis vectors land. The same weights that build an input also combine its column images.
Consider and the nonzero input . Can its output be zero? Can we predict that output from the two column arrows?
The geometry
Let and be the input basis vectors. Their images are columns and . The second column is twice the first. Both point along one output line.
Learning objective
A nonzero input can collapse to zero when matrix columns are dependent
Derivation
Can a nonzero coefficient vector disappear under dependent columns?
Original coordinate construction checked against MIT 18.022, Peter Selinger's CC BY 4.0 Matrix Theory and Linear Algebra, and Boyd and Vandenberghe's Introduction to Applied Linear Algebra.
Work one output
Write . Linearity gives
For any input , the output is . Thus the range is the line spanned by . The null space contains every multiple of . Check : column weighting and ordinary multiplication both give .
General form and shapes
With input coordinates and output coordinates, and . Linearity means for inputs and scalar weights . Since , we get .
- The column space, or range, contains all outputs. It lies in .
- Each row computes one output coordinate as a linear functional. The row space lies in .
- The null space, or kernel, is . These input directions disappear.
- Rank is the column-space dimension, equal to the row-space dimension.
Rank plus null-space dimension equals . Here . Independent columns prevent input information loss. A square matrix with independent columns is also onto and invertible.
Change the map
1. Produce three coordinates
New task: send the same two input coordinates to a three-coordinate output.
Picture and change: choose columns and . Keep the input weights .
Check: . The columns are independent, so no nonzero input collapses. The map is not onto all of .
Use when: a layer changes feature count. Inputs count columns; outputs count rows.
2. Add an output offset
New task: compute with .
Picture and change: combine columns as before, then translate the result by . The complete map is affine, not linear.
Check: and . Its values at basis vectors are no longer simply the columns of .
Use when: a fixed bias displaces the origin.
Composition and multiplication
For of shape and of shape , applying then gives . The result has shape . Associativity follows from composition: . Reversing the maps generally changes the result.
A projection need not be perpendicular
Let . It satisfies , but sends to . Its kernel is the line spanned by , not the perpendicular complement of its range. For an orthogonal projection, also require .
Try reversing two maps
Let and . Compare with .
Check your answer
, so . But , so . The order changes the output.
Special families
| Matrix | Geometric action |
|---|---|
| Orthogonal () | Rotation or reflection (preserves length and angle) |
| Diagonal | Independent scaling along each axis |
| Symmetric | Has real eigenvalues; orthogonal eigenvector basis |
| Positive definite | Symmetric + all eigenvalues > 0; defines an inner product |
| Permutation | Reorders coordinates |
| Projection () | Maps onto its range along its kernel; orthogonal only when also symmetric |
Common pitfalls
- Treating matrix multiplication as element-wise. Use Hadamard () for element-wise; matrix multiplication is composition.
- Forgetting that shapes determine the map. is a map , not the other way around.
- Confusing column space with row space. Both have dimension = rank, but they live in different spaces ( vs ).
A fixed-weight dense operation is linear. Adding bias makes it affine; applying a nonlinear activation changes the map again. Neural networks and input-dependent attention are not generally linear functions of their inputs.