Linear Map & Matrix Multiplication
BasisPrerequisites
A matrix is not just a grid of numbers to be stored and retrieved — it encodes a function between vector spaces. Understanding this connection is the heart of linear algebra: every question about matrices is really a question about structure-preserving functions, and every such function can be captured by a matrix.
Linear maps
A linear map (also called a linear transformation) is a function between vector spaces over a field that respects the vector space operations. Precisely, is linear if for all and all :
- (additivity)
- (homogeneity)
These two conditions together are called linearity. They can be combined into the single equivalent condition: for all and all ,
In other words, preserves linear combinations. A map that satisfies linearity “plays nicely” with the structure of the vector spaces on both sides.
Immediate consequences
Two important properties follow at once from linearity:
- . (Set in homogeneity.)
- . (Apply homogeneity with .)
A linear map must always send the zero vector to the zero vector; if you find a function with , it is not linear.
Examples
- Scaling: , for a fixed constant — scaling by is linear.
- Rotation in : rotating every vector by a fixed angle is a linear map on .
- Projection: defined by is linear — it projects onto the -plane.
- The zero map: for all is trivially linear.
Representing a linear map by a matrix
Fix a basis of and a basis of . Because is linear, the entire map is determined by where it sends the basis vectors. Every can be written uniquely as , and then
So knowing is enough to know on all of . Write each image in coordinates with respect to the basis of :
The matrix of (with respect to and ) is the matrix whose -th column is the coordinate vector of . The entry sits in row , column .
Matrices as linear maps
Conversely, every matrix over defines a linear map by
where is treated as a column vector. The -th entry of is — the dot product of the -th row of with . You can verify that satisfies linearity directly from this formula.
Matrix multiplication as composition
Suppose you have two linear maps:
Their composition is also a linear map. What is its matrix?
If is (so ) and is (so ), then the matrix of is the matrix , where
(BA)_{ij} \coloneqq \sum_{k=1}^{n} b_{ik}\, a_{kj}. \tag{1}
This is the definition of matrix multiplication. You compute the entry of by taking the dot product of the -th row of with the -th column of . Notice the order: the matrix of is , not — the rightmost matrix corresponds to the map applied first.
For this product to be defined, the number of columns of must equal the number of rows of (both equal above, the dimension of the intermediate space ).
Non-commutativity
Matrix multiplication is not commutative in general: even when both products and are defined and have the same shape (which requires and to both be square of the same size), you typically have . This reflects the fact that performing two transformations in different orders usually gives different results.
Associativity
Matrix multiplication is associative: whenever the dimensions are compatible. This follows from the associativity of function composition: .
The vector space of linear maps
The set of all linear maps from to , written , is itself a vector space. You define addition and scalar multiplication pointwise:
Both operations produce linear maps, and all vector space axioms hold. Under the correspondence between linear maps and matrices (once bases are fixed), is isomorphic to .
Summary
- A linear map satisfies for all vectors and scalars.
- It always sends to , and its behavior is entirely determined by where it sends a basis.
- Every linear map between finite-dimensional spaces has a matrix representation: the columns are the images of basis vectors expressed in coordinates.
- Conversely, every matrix defines a linear map via .
- Matrix multiplication corresponds exactly to the composition of linear maps — apply first, then .
- Matrix multiplication is associative but not commutative in general.
- is a vector space under pointwise operations, isomorphic to .