From a Matrix to a Linear Map
A matrix does more than store numbers: it describes a rule that takes an input vector and produces an output vector. For an \(m\times n\) real matrix \(A\), multiplication sends each vector in \(\mathbb{R}^n\) to a vector in \(\mathbb{R}^m\). Studying which outputs can occur, and which inputs produce zero, gives a concise way to understand what the matrix can and cannot do. These questions arise throughout multivariate statistics, where matrices encode transformations of data and parameters.
Matrix multiplication satisfies this condition: \(A(ax+by)=aAx+bAy\). The domain records the allowable inputs, and the codomain specifies the space in which outputs lie. Neither alone tells us which outputs are actually attained.
Range, Null Space, and Rank
If the columns of \(A\) are \(a_1,\ldots,a_n\), then for \(x=(x_1,\ldots,x_n)^\mathsf{T}\),
Consequently, the range consists exactly of all linear combinations of the columns. It is a subspace of \(\mathbb{R}^m\). The null space is the set of solutions to the homogeneous equation \(Ax=0\), and it is a subspace of \(\mathbb{R}^n\). The rank counts the number of independent directions in the range; it does not, by itself, count the number of nonzero entries in the matrix.
Worked Example: A Map That Reaches Every Output but Loses Input Information
Let
For input \(x=(x_1,x_2,x_3)^\mathsf{T}\), the output is
The first two columns, \((1,0)^\mathsf{T}\) and \((2,1)^\mathsf{T}\), are linearly independent: if \(c_1(1,0)^\mathsf{T}+c_2(2,1)^\mathsf{T}=0\), the second coordinate gives \(c_2=0\), and then the first gives \(c_1=0\). They therefore span \(\mathbb{R}^2\), so the range is \(\mathbb{R}^2\) and the rank is 2.
To find the null space, solve \(Ax=0\). The equations are \(x_1+2x_2+x_3=0\) and \(x_2+x_3=0\). The second gives \(x_2=-x_3\); substituting into the first gives \(x_1=-x_3\). Thus
The map reaches every vector in its codomain, but distinct inputs can have the same output: for example, \(A(-1,-1,1)^\mathsf{T}=0=A(0,0,0)^\mathsf{T}\). Its rank and nullity add to \(2+1=3\), the dimension of the domain.
The Rank-Nullity Theorem
The theorem says that every input direction either contributes to a new output direction or is absorbed into the null space, with the two dimensions accounting for the full domain. Here is a basis argument that proves the equality.
Let \(k=\dim(\operatorname{Null}(T))\), and choose a basis \(v_1,\ldots,v_k\) for that space. Extend it to a basis \(v_1,\ldots,v_k,w_1,\ldots,w_r\) of \(\mathbb{R}^n\). Since this is a basis of the domain, \(k+r=n\).
Every \(x\in\mathbb{R}^n\) has an expansion \(x=\sum_{i=1}^k a_i v_i+\sum_{j=1}^r b_jw_j\). Applying \(T\) gives \(T(x)=\sum_{j=1}^r b_jT(w_j)\), because each \(T(v_i)=0\). Thus \(T(w_1),\ldots,T(w_r)\) span the range.
If \(\sum_{j=1}^r b_jT(w_j)=0\), then \(T(\sum_{j=1}^r b_jw_j)=0\), so \(\sum_{j=1}^r b_jw_j\) belongs to the null space. It can therefore be written as \(\sum_{i=1}^k a_i v_i\). The resulting relation \(\sum_{j=1}^r b_jw_j-\sum_{i=1}^k a_i v_i=0\) is a relation among the full basis of the domain. Its coefficients must all be zero, so every \(b_j=0\).
The images \(T(w_1),\ldots,T(w_r)\) form a basis of the range, so its dimension is \(r\). Hence \(\dim(\operatorname{Null}(T))+\dim(\operatorname{Range}(T))=k+r=n\). \(\square\)
Injectivity and Surjectivity
For linear maps, these properties have direct descriptions in terms of null space and rank:
To prove the first statement, if \(T\) is injective and \(T(x)=0=T(0)\), then \(x=0\), so the null space contains only zero. Conversely, if the null space contains only zero and \(T(x)=T(y)\), linearity gives \(T(x-y)=0\). Thus \(x-y=0\), which means \(x=y\). For the second statement, surjectivity means the range is all of \(\mathbb{R}^m\); this holds exactly when its dimension is \(m\), which is the definition of rank \(m\). \(\square\)
Combining these facts with rank-nullity gives useful dimension limits. Injectivity requires nullity zero, hence rank \(n\), which is possible only if \(n\leq m\). Surjectivity requires rank \(m\), which is possible only if \(m\leq n\). When the dimensions allow either property, the actual rank still has to be checked.
Worked Example: Injective but Not Surjective
Consider the map \(T:\mathbb{R}^2\to\mathbb{R}^3\) with matrix
Its columns are \(b_1=(1,2,0)^\mathsf{T}\) and \(b_2=(2,4,1)^\mathsf{T}\). They are independent: if \(s b_1+t b_2=0\), the third coordinate gives \(t=0\), and the first then gives \(s=0\). Thus \(\operatorname{rank}(B)=2\). By rank-nullity, the nullity is \(2-2=0\), so the map is injective.
For input \((s,t)^\mathsf{T}\), its output is \((s+2t,2s+4t,t)^\mathsf{T}\). Every output \((u,v,w)^\mathsf{T}\) in the range therefore satisfies \(v=2u\). Conversely, if \(v=2u\), choosing \(t=w\) and \(s=u-2w\) produces that output. The range is exactly the set of vectors satisfying \(v=2u\), a two-dimensional subspace of \(\mathbb{R}^3\). It is not the entire codomain, so the map is not surjective.
Worked Example: Rank and Nullity for a Square Matrix
Let
Write its columns as \(c_1=(1,2,0)^\mathsf{T}\), \(c_2=(2,4,1)^\mathsf{T}\), and \(c_3=(3,6,1)^\mathsf{T}\). Since \(c_3=c_1+c_2\), the columns span the same space as \(c_1,c_2\). These two are independent: if \(a c_1+b c_2=0\), the third coordinate gives \(b=0\), then the first gives \(a=0\). Therefore the rank is 2.
Solving \(Cx=0\) gives the equations \(x_1+2x_2+3x_3=0\), \(2x_1+4x_2+6x_3=0\), and \(x_2+x_3=0\). The middle equation repeats the first after multiplication by 2. From the third, \(x_2=-x_3\); substituting into the first gives \(x_1=-x_3\). Hence the null space is spanned by \((-1,-1,1)^\mathsf{T}\), so its dimension is 1. Rank-nullity checks the result: \(2+1=3\). The matrix is neither injective (its null space is nonzero) nor surjective onto \(\mathbb{R}^3\) (its rank is less than 3).
Common Pitfall and Why Rank Matters
A frequent mistake is to assume that a matrix with \(m\) rows must be surjective onto \(\mathbb{R}^m\), or that one with \(n\) columns must be injective. Dimensions alone give necessary limits, not guarantees. For instance, a \(3\times2\) matrix could have rank 1 rather than 2, and then its map would not be injective. The column relationships, or equivalently the rank, determine the answer.
Another useful distinction is between an output space and the range within it. The codomain \(\mathbb{R}^m\) is where outputs are allowed to live; the range is the subset the map actually attains. A map can have a three-dimensional codomain and a two-dimensional range. Rank-nullity then describes precisely how much of the input domain is lost: the null space contains the input directions that do not change the output.
In statistical models, this distinction helps diagnose whether different parameter or data directions can be distinguished after a matrix transformation. A nonzero null-space vector represents a change in input that leaves the output unchanged; a range smaller than the codomain means some output vectors cannot be produced. These are structural facts about the map, not conclusions that can be inferred from the matrix dimensions alone.
Check Your Understanding
Use the definitions and rank-nullity theorem to answer these questions.
- For a matrix with 5 columns and rank 3, what is its nullity?
- What condition on the null space is equivalent to injectivity of a linear map?
- A map has domain \(\mathbb{R}^4\), codomain \(\mathbb{R}^3\), and rank 3. Is it surjective? What is its nullity, and can it be injective?
- Why does the fact that a matrix has 3 rows not, by itself, prove that its map is surjective onto \(\mathbb{R}^3\)?
- For a matrix \(A\), explain why every vector in its range is a linear combination of its columns.