Skip to content

Linear Mappings

§2.2 said a matrix has two faces — data and action. This section makes the second face precise, and delivers the payoff: once you fix a basis, every linear mapping between finite-dimensional spaces is a matrix. Not “can be represented by” in a loose sense — there is an exact correspondence, and the matrix depends on which basis you chose.

That dependence is the subtle part, and it is where most of the confusion in this section lives.

  • What makes a mapping linear, in one condition rather than two.
  • Isomorphism, endomorphism, automorphism — and the theorem that says dimension is all that matters.
  • Coordinates with respect to an ordered basis, and why the ordering is not pedantry.
  • The transformation matrix, whose columns are the images of the basis vectors, in coordinates.
  • Basis change: the same mapping, a different matrix, related by A~=T1AS\tilde{\mathbf{A}} = \mathbf{T}^{-1}\mathbf{A}\mathbf{S}.
  • Image and kernel, and the rank-nullity theorem tying their dimensions together.

Converting pounds to euros is linear. Convert £10 and £20 separately, or convert £30 at once — same answer. Double the pounds and you double the euros. Two properties, and they are exactly the two the definition demands.

Now notice what is not linear: adding a £3 fixed fee. Convert £10 and £20 separately and you pay the fee twice; convert £30 once and you pay it once. The fee breaks additivity, and a mapping with a constant offset is affine, not linear — §2.8’s subject, and the reason a neural network layer with a bias term is affine rather than linear.

diagram Diagram mermaid

A mapping Φ:VW\Phi : V \to W between real vector spaces is a linear mapping — equivalently a vector space homomorphism or linear transformation — when

x,yV  λ,ψR:Φ(λx+ψy)=λΦ(x)+ψΦ(y)\forall \mathbf{x}, \mathbf{y} \in V \;\forall \lambda, \psi \in \mathbb{R}:\quad \Phi(\lambda\mathbf{x} + \psi\mathbf{y}) = \lambda\Phi(\mathbf{x}) + \psi\Phi(\mathbf{y})

This single condition packages the two separate ones — additivity Φ(x+y)=Φ(x)+Φ(y)\Phi(\mathbf{x}+\mathbf{y}) = \Phi(\mathbf{x})+\Phi(\mathbf{y}) and homogeneity Φ(λx)=λΦ(x)\Phi(\lambda\mathbf{x}) = \lambda\Phi(\mathbf{x}) — and they are equivalent: set λ=ψ=1\lambda = \psi = 1 to recover the first, and ψ=0\psi = 0 to recover the second.

An immediate consequence worth noting because it is the fastest disqualifier: Φ(0)=Φ(0x)=0Φ(x)=0\Phi(\mathbf{0}) = \Phi(0\cdot\mathbf{x}) = 0\cdot\Phi(\mathbf{x}) = \mathbf{0}. Every linear mapping sends zero to zero. If a candidate mapping does not, it is not linear, and you are done.

namecondition
IsomorphismΦ:VW\Phi : V \to W linear and bijective
EndomorphismΦ:VV\Phi : V \to V linear (same space both sides)
AutomorphismΦ:VV\Phi : V \to V linear and bijective
IdentityidV:VV\mathrm{id}_V : V \to V, xx\mathbf{x} \mapsto \mathbf{x}

And the theorem that makes dimension the only thing that matters:

Theorem.Finite-dimensional V,W are isomorphic    dim(V)=dim(W)\textbf{Theorem.}\quad \text{Finite-dimensional } V, W \text{ are isomorphic} \iff \dim(V) = \dim(W)

Read what that says. Two spaces of the same dimension “are kind of the same thing, as they can be transformed into each other without incurring any loss” — the book’s phrasing. It is why Rm×n\mathbb{R}^{m\times n} and Rmn\mathbb{R}^{mn} can be used interchangeably, and why every nn-dimensional space is “really” Rn\mathbb{R}^n once you pick a basis.

Three more closure facts: the composition of linear mappings is linear; the inverse of an isomorphism is an isomorphism; and Φ+Ψ\Phi + \Psi and λΦ\lambda\Phi are linear. So linear mappings themselves form a vector space.

Fix an ordered basis B=(b1,,bn)B = (\mathbf{b}_1,\dots,\mathbf{b}_n) of VV — a tuple, not a set. Every xV\mathbf{x} \in V then has a unique representation

x=α1b1++αnbn,α=[α1αn]Rn\mathbf{x} = \alpha_1\mathbf{b}_1 + \cdots + \alpha_n\mathbf{b}_n, \qquad \boldsymbol\alpha = \begin{bmatrix}\alpha_1\\ \vdots\\ \alpha_n\end{bmatrix} \in \mathbb{R}^n

and α\boldsymbol\alpha is the coordinate vector of x\mathbf{x} with respect to BB. Uniqueness is §2.6’s characterisation 4 — this is what a basis was for.

The notation gets genuinely tricky here, and the book pauses to fix it:

writtenis
B=(b1,,bn)B = (\mathbf{b}_1,\dots,\mathbf{b}_n)an ordered basis — a tuple
B={b1,,bn}\mathcal{B} = \{\mathbf{b}_1,\dots,\mathbf{b}_n\}an unordered basis — a set
B=[b1,,bn]\mathbf{B} = [\mathbf{b}_1,\dots,\mathbf{b}_n]a matrix whose columns are those vectors

Ordering matters because coordinates are a list. Swap b1\mathbf{b}_1 and b2\mathbf{b}_2 and the coordinate vector (2,3)(2, 3) becomes (3,2)(3, 2) — a different list describing the same point. A set cannot express that, which is why bases are tuples from here on.

A basis is a coordinate system, and the same vector has different coordinates in different ones. The book’s Example 2.20: x=(2,3)\mathbf{x} = (2,3)^\top in the standard basis means x=2e1+3e2\mathbf{x} = 2\mathbf{e}_1 + 3\mathbf{e}_2. With b1=(1,1)\mathbf{b}_1 = (1,-1)^\top and b2=(1,1)\mathbf{b}_2 = (1,1)^\top, the same point has coordinates 12(1,5)\tfrac12(-1, 5)^\top.

Here is the construction. Let B=(b1,,bn)B = (\mathbf{b}_1,\dots,\mathbf{b}_n) be an ordered basis of VV and C=(c1,,cm)C = (\mathbf{c}_1,\dots,\mathbf{c}_m) one of WW. For each jj, expand the image of the jj-th basis vector in the CC basis:

Φ(bj)=α1jc1++αmjcm=i=1mαijci\Phi(\mathbf{b}_j) = \alpha_{1j}\mathbf{c}_1 + \cdots + \alpha_{mj}\mathbf{c}_m = \sum_{i=1}^{m}\alpha_{ij}\mathbf{c}_i

The m×nm\times n matrix AΦ\mathbf{A}_\Phi with entries AΦ(i,j)=αijA_\Phi(i,j) = \alpha_{ij} is the transformation matrix of Φ\Phi with respect to BB and CC.

The jj-th column of AΦ\mathbf{A}_\Phi is the coordinate vector of Φ(bj)\Phi(\mathbf{b}_j) with respect to CC. That is the whole definition, and it is §2.2’s “the columns are the images of the basis vectors” — now stated properly, with the caveat that “images” means in coordinates, and which coordinates depends on CC.

Then, with x^\hat{\mathbf{x}} the coordinate vector of x\mathbf{x} in BB and y^\hat{\mathbf{y}} that of y=Φ(x)\mathbf{y} = \Phi(\mathbf{x}) in CC:

y^=AΦx^\hat{\mathbf{y}} = \mathbf{A}_\Phi\hat{\mathbf{x}}

Matrix multiplication maps coordinates to coordinates. Not vectors to vectors — coordinates. The distinction is invisible when both bases are standard, which is why it is so easy to miss and so confusing when it finally matters.

Same mapping, different bases, different matrix. How different?

  A~Φ=T1AΦS  \boxed{\;\tilde{\mathbf{A}}_\Phi = \mathbf{T}^{-1}\mathbf{A}_\Phi\mathbf{S}\;}

where SRn×n\mathbf{S} \in \mathbb{R}^{n\times n} is the transformation matrix of idV\mathrm{id}_V mapping coordinates in the new basis B~\tilde{B} onto coordinates in the old BB, and TRm×m\mathbf{T} \in \mathbb{R}^{m\times m} does the same for C~\tilde{C} onto CC.

Read the formula right to left, which is the order it executes in: S\mathbf{S} translates new-basis coordinates into old-basis ones, AΦ\mathbf{A}_\Phi does the actual mapping in the old coordinates, and T1\mathbf{T}^{-1} translates the result back into the new output coordinates. Three steps, and only the middle one is the mapping.

B~C~  =  B~BCC~\tilde{B} \to \tilde{C} \;=\; \tilde{B} \to B \to C \to \tilde{C}

Two names for the resulting relation:

  • A,A~\mathbf{A}, \tilde{\mathbf{A}} are equivalent if A~=T1AS\tilde{\mathbf{A}} = \mathbf{T}^{-1}\mathbf{A}\mathbf{S} for some regular S,T\mathbf{S}, \mathbf{T}.
  • A,A~\mathbf{A}, \tilde{\mathbf{A}} are similar if A~=S1AS\tilde{\mathbf{A}} = \mathbf{S}^{-1}\mathbf{A}\mathbf{S} — the same matrix on both sides.

Similar matrices are always equivalent; equivalent ones need not be similar. Similarity is the one Chapter 4 cares about, because it is what “the same endomorphism in a different basis” means, and diagonalisation (§4.4) is the search for a basis making the matrix diagonal.

Two subspaces come free with every linear mapping:

ker(Φ):=Φ1(0W)={vV:Φ(v)=0W}\ker(\Phi) := \Phi^{-1}(\mathbf{0}_W) = \{\mathbf{v} \in V : \Phi(\mathbf{v}) = \mathbf{0}_W\} Im(Φ):=Φ(V)={wW:vV,  Φ(v)=w}\operatorname{Im}(\Phi) := \Phi(V) = \{\mathbf{w} \in W : \exists\mathbf{v} \in V,\; \Phi(\mathbf{v}) = \mathbf{w}\}

VV is the domain and WW the codomain. The kernel — also null space — is what gets crushed to zero. The image — also range — is what can be reached.

Four facts:

  • Φ(0V)=0W\Phi(\mathbf{0}_V) = \mathbf{0}_W always, so 0Vker(Φ)\mathbf{0}_V \in \ker(\Phi): the kernel is never empty.
  • Im(Φ)\operatorname{Im}(\Phi) is a subspace of WW; ker(Φ)\ker(\Phi) is a subspace of VV.
  • Φ\Phi is injective if and only if ker(Φ)={0}\ker(\Phi) = \{\mathbf{0}\}.
  • For A=[a1,,an]\mathbf{A} = [\mathbf{a}_1,\dots,\mathbf{a}_n], the image is the span of the columns — the column space — so rk(A)=dim(Im(Φ))\operatorname{rk}(\mathbf{A}) = \dim(\operatorname{Im}(\Phi)).

Note the asymmetry, which is easy to get backwards: the kernel lives in Rn\mathbb{R}^n, the width of the matrix, and the image lives in Rm\mathbb{R}^m, the height. The kernel is about relationships among the columns; the image is about what the columns reach.

  dim(ker(Φ))+dim(Im(Φ))=dim(V)  \boxed{\;\dim(\ker(\Phi)) + \dim(\operatorname{Im}(\Phi)) = \dim(V)\;}

Also called the fundamental theorem of linear mappings. Every input dimension is accounted for exactly once: it either survives into the image or gets crushed into the kernel. Nothing is lost and nothing is double-counted.

Three consequences the book draws out:

  1. If dim(Im(Φ))<dim(V)\dim(\operatorname{Im}(\Phi)) < \dim(V) then the kernel is non-trivial: dim(ker(Φ))1\dim(\ker(\Phi)) \ge 1.
  2. In that case AΦx=0\mathbf{A}_\Phi\mathbf{x} = \mathbf{0} has infinitely many solutions.
  3. If dim(V)=dim(W)\dim(V) = \dim(W), then injective     \iff surjective     \iff bijective.

Consequence 3 is the one that saves work. For a square matrix you need check only one of the three properties; all of them follow. For a non-square one they can differ freely.

Is it linear? Four candidates, checked against Φ(0)=0\Phi(\mathbf{0}) = \mathbf{0} first because it is free:

mappingΦ(0)=0\Phi(\mathbf{0}) = \mathbf{0}?linear?why
Φ(x)=3x\Phi(x) = 3xyesyesboth properties hold
Φ(x)=3x+1\Phi(x) = 3x + 1no, gives 11noaffine, not linear
Φ(x)=x2\Phi(x) = x^2yesno(x+y)2x2+y2(x+y)^2 \neq x^2+y^2
Φ(f)=abfdx\Phi(f) = \int_a^b f\,\mathrm{d}xyesyesintegration is linear
Φ(x)=cos(x)\Phi(x) = \cos(x)no, gives 11nodisqualified immediately

The last row shows the value of the zero test: cos\cos is settled without touching additivity.

Coordinates in two bases. Take x=(2,3)\mathbf{x} = (2,3)^\top written in the standard basis, and the alternative B=((1,1),(1,1))B = \bigl((1,-1)^\top, (1,1)^\top\bigr). Solve α1(1,1)+α2(1,1)=(2,3)\alpha_1(1,-1)^\top + \alpha_2(1,1)^\top = (2,3)^\top:

α1+α2=2α1+α2=3\begin{aligned} \alpha_1 + \alpha_2 &= 2\\ -\alpha_1 + \alpha_2 &= 3 \end{aligned}

Adding: 2α2=52\alpha_2 = 5, so α2=52\alpha_2 = \tfrac52; then α1=252=12\alpha_1 = 2 - \tfrac52 = -\tfrac12. So the coordinates are 12(1,5)\tfrac12(-1, 5)^\top — the book’s Example 2.20 exactly. Same point, different list.

Image and kernel of the book’s Example 2.25. For

Φ:R4R2,A=[12101001]\Phi : \mathbb{R}^4 \to \mathbb{R}^2, \qquad \mathbf{A} = \begin{bmatrix}1 & 2 & -1 & 0\\ 1 & 0 & 0 & 1\end{bmatrix}

The image is the span of the columns (1,1),(2,0),(1,0),(0,1)(1,1)^\top, (2,0)^\top, (-1,0)^\top, (0,1)^\top — four vectors in R2\mathbb{R}^2, which must be dependent, and they span all of R2\mathbb{R}^2. So dim(Im)=2\dim(\operatorname{Im}) = 2.

For the kernel, reduce:

[12101001]    [1001011212]\begin{bmatrix}1 & 2 & -1 & 0\\ 1 & 0 & 0 & 1\end{bmatrix} \;\rightsquigarrow\; \begin{bmatrix}1 & 0 & 0 & 1\\ 0 & 1 & -\tfrac12 & -\tfrac12\end{bmatrix}

Non-pivot columns 3 and 4, so two kernel directions:

ker(Φ)=span[[01210],  [11201]]\ker(\Phi) = \operatorname{span}\left[\begin{bmatrix}0\\ \tfrac12\\ 1\\ 0\end{bmatrix},\;\begin{bmatrix}-1\\ \tfrac12\\ 0\\ 1\end{bmatrix}\right]

Check the first: 10+212+(1)1+00=01\cdot0 + 2\cdot\tfrac12 + (-1)\cdot1 + 0\cdot0 = 0 ✓ and 10+0+0+10=01\cdot0 + 0 + 0 + 1\cdot0 = 0 ✓.

Rank-nullity: dim(ker)+dim(Im)=2+2=4=dim(V)\dim(\ker) + \dim(\operatorname{Im}) = 2 + 2 = 4 = \dim(V) ✓. Four input dimensions, two survive, two are crushed.

A rank-1 map squashes the whole plane onto a line. The amber line is the image; the red dashed line is the kernel — every point on it lands on the origin.

sketch Image and kernel of a linear map p5.js
The map Phi(x)=Ax with a rank-1 matrix squashes the entire input plane (blue lattice) onto one line, the image (amber). The red dashed line is the kernel: every point on it maps to the origin. dim(kernel) + dim(image) = 2.

Watch the probe. When the blue input crosses the red dashed line the amber output passes through the origin — that is what “the kernel maps to zero” looks like in motion. And no matter where the input goes, the output never leaves the amber line: the image is all the map can reach, and it is one-dimensional because the rank is 1.

The book’s Example 2.23 in the lab: a matrix that looks like a shear in the standard basis and is a pure diagonal scaling in the right one.

matrixThe matrix whose eigenbasis makes it diagonallinear map on R^2
-505-505x1x2
2112
columns of A = images of e1, e2
det A 3area factor 3orientation preserved
det A3A e1(2, 1)A e2(1, 2)
basisThe plane before anything happens, with the standard basis e1 = (1, 0) and e2 = (0, 1) and the unit square they span.
1/8

Its eigenvectors are (1,1) and (1,-1) with eigenvalues 3 and 1 — so in that basis it is diag(3, 1). Watch the eigen-directions in the final frame.

The last frame draws the eigen-directions, and they are exactly (1,1)(1,1) and (1,1)(1,-1) with eigenvalues 33 and 11. Those numbers are the diagonal of A~\tilde{\mathbf{A}}. Basis change and eigendecomposition are the same operation seen from two sides — §4.4 makes it official.

linear_mappings.py
import numpy as np
 
rng = np.random.default_rng(0)
 
def is_linear(phi, dim, trials=500, tol=1e-9):
    """Test the single linearity condition on random inputs and scalars."""
    for _ in range(trials):
        x, y = rng.standard_normal(dim), rng.standard_normal(dim)
        lam, psi = rng.normal(), rng.normal()
        lhs = phi(lam * x + psi * y)
        rhs = lam * np.asarray(phi(x)) + psi * np.asarray(phi(y))
        if not np.allclose(lhs, rhs, atol=tol):
            return False
    return True
 
# ---- the zero test disqualifies fastest ------------------------------
cands = {
    "3x            ": lambda v: 3 * v,
    "3x + 1        ": lambda v: 3 * v + 1,
    "x squared     ": lambda v: v ** 2,
    "cos(x)        ": lambda v: np.cos(v),
    "A @ x         ": lambda v: np.array([[1.0, 2.0], [3.0, 4.0]]) @ v,
}
for name, f in cands.items():
    z = np.asarray(f(np.zeros(2)))
    sends_zero = np.allclose(z, 0)
    print(f"{name} Phi(0)=0: {str(sends_zero):5s}  linear: {is_linear(f, 2)}")
 
# ---- coordinates with respect to an ordered basis --------------------
x = np.array([2.0, 3.0])
B = np.array([[1.0, 1.0], [-1.0, 1.0]])        # columns b1=(1,-1), b2=(1,1)
alpha = np.linalg.solve(B, x)
print("\ncoordinates of (2,3) in B:", alpha, " = 0.5 * ", 2 * alpha)
print("rebuild:", B @ alpha, " matches x:", np.allclose(B @ alpha, x))
 
# Ordering matters: swap the basis vectors and the coordinate list swaps.
B_swapped = B[:, ::-1]
print("with the basis vectors swapped:", np.linalg.solve(B_swapped, x))
 
# ---- the transformation matrix's columns ----------------------------
A = np.array([[1.0, 2.0], [3.0, 4.0]])
for j, e in enumerate(np.eye(2)):
    print(f"\nPhi(e{j+1}) =", A @ e, " == column {}: {}".format(j, A[:, j]))
 
# ---- basis change: the book's Example 2.23 -------------------------
A23 = np.array([[2.0, 1.0], [1.0, 2.0]])
S = np.array([[1.0, 1.0], [1.0, -1.0]])        # new basis vectors as columns
A_tilde = np.linalg.inv(S) @ A23 @ S
print("\nExample 2.23:")
print("A in the canonical basis:\n", A23)
print("A in the basis ((1,1),(1,-1)):\n", np.round(A_tilde, 12))
print("diagonal?", np.allclose(A_tilde, np.diag(np.diag(A_tilde))))
vals, vecs = np.linalg.eigh(A23)
print("eigenvalues:", vals, " -> the diagonal entries, in the other order")
 
# ---- the book's Example 2.24, all the way through ------------------
A24 = np.array([[1.0, 2.0, 0.0],
                [-1.0, 1.0, 3.0],
                [3.0, 7.0, 1.0],
                [-1.0, 2.0, 4.0]])
S24 = np.array([[1.0, 0.0, 1.0],
                [1.0, 1.0, 0.0],
                [0.0, 1.0, 1.0]])
T24 = np.array([[1.0, 1.0, 0.0, 1.0],
                [1.0, 0.0, 1.0, 0.0],
                [0.0, 1.0, 1.0, 0.0],
                [0.0, 0.0, 0.0, 1.0]])
A24_tilde = np.linalg.inv(T24) @ A24 @ S24
print("\nExample 2.24, T^-1 A S =\n", np.round(A24_tilde, 10))
 
# ---- image, kernel, rank-nullity: the book's Example 2.25 ---------
A25 = np.array([[1.0, 2.0, -1.0, 0.0],
                [1.0, 0.0,  0.0, 1.0]])
r = np.linalg.matrix_rank(A25)
n = A25.shape[1]
k1 = np.array([0.0, 0.5, 1.0, 0.0])
k2 = np.array([-1.0, 0.5, 0.0, 1.0])
print("\nExample 2.25:")
print("rank = dim(Im) :", r, " (all of R^2)")
print("dim(ker)       :", n - r)
print("k1 in kernel   :", np.allclose(A25 @ k1, 0), " k2 in kernel:", np.allclose(A25 @ k2, 0))
print("rank-nullity   :", (n - r), "+", r, "=", n, " == dim(V):", n)
 
# ---- injective iff surjective iff bijective, for SQUARE only ------
print("\nsquare, full rank      -> all three:", end=" ")
Sq = np.array([[1.0, 2.0], [3.0, 4.0]])
rk = np.linalg.matrix_rank(Sq)
print(f"rank {rk} of 2, injective={rk==2}, surjective={rk==2}")
print("non-square, tall       -> can be injective and NOT surjective:", end=" ")
Tall = np.array([[1.0], [2.0], [3.0]])
print(f"rank {np.linalg.matrix_rank(Tall)}, image is a line in R^3")
print("non-square, wide       -> surjective and NOT injective:", end=" ")
print(f"rank {r} of R^2 reached, but kernel has dim {n - r}")
text
3x             Phi(0)=0: True   linear: True
3x + 1         Phi(0)=0: False  linear: False
x squared      Phi(0)=0: True   linear: False
cos(x)         Phi(0)=0: False  linear: False
A @ x          Phi(0)=0: True   linear: True
 
coordinates of (2,3) in B: [-0.5  2.5]  = 0.5 *  [-1.  5.]
rebuild: [2. 3.]  matches x: True
with the basis vectors swapped: [ 2.5 -0.5]
 
Phi(e1) = [1. 3.]  == column 0: [1. 3.]
 
Phi(e2) = [2. 4.]  == column 1: [2. 4.]
 
Example 2.23:
A in the canonical basis:
 [[2. 1.]
 [1. 2.]]
A in the basis ((1,1),(1,-1)):
 [[3. 0.]
 [0. 1.]]
diagonal? True
eigenvalues: [1. 3.]  -> the diagonal entries, in the other order
 
Example 2.24, T^-1 A S =
 [[-4. -4. -2.]
 [ 6.  0.  0.]
 [ 4.  8.  4.]
 [ 1.  6.  3.]]
 
Example 2.25:
rank = dim(Im) : 2  (all of R^2)
dim(ker)       : 2
k1 in kernel   : True  k2 in kernel: True
rank-nullity   : 2 + 2 = 4  == dim(V): 4
 
square, full rank      -> all three: rank 2 of 2, injective=True, surjective=True
non-square, tall       -> can be injective and NOT surjective: rank 1, image is a line in R^3
non-square, wide       -> surjective and NOT injective: rank 2 of R^2 reached, but kernel has dim 2

Four things confirmed against the book.

The zero test does real work. 3x + 1 and cos(x) are eliminated by one evaluation each, and x squared survives the zero test and fails linearity — so the test is necessary but not sufficient, exactly as expected.

Coordinates depend on the ordering. (0.5,2.5)=12(1,5)(-0.5, 2.5) = \tfrac12(-1, 5) reproduces Example 2.20, and swapping the two basis vectors swaps the coordinate list to (2.5,0.5)(2.5, -0.5). Same point, same basis set, different basis tuple, different answer.

Example 2.23 comes out diagonal, diag(3,1)\operatorname{diag}(3, 1), and the eigenvalues are 11 and 33 — the same numbers, in the order eigh chose to return them. Basis change found the eigenbasis without being asked.

Example 2.24 reproduces the book’s A~Φ\tilde{\mathbf{A}}_\Phi exactly, including the awkward (4,4,2)(-4, -4, -2) first row.

figure The book's Figure 2.10, reproduced matplotlib
Four panels showing 400 points arranged in a square. The first is the original, the second is rotated by 45 degrees, the third is stretched by two along the horizontal axis, and the fourth is a combined reflection, rotation and stretch. Four panels showing 400 points arranged in a square. The first is the original, the second is rotated by 45 degrees, the third is stretched by two along the horizontal axis, and the fourth is a combined reflection, rotation and stretch.
Four hundred points, three matrices. Straight lines stay straight and evenly spaced lines stay evenly spaced in every panel — that is what linearity looks like.
figure Rank-nullity as a conservation law matplotlib
Bar chart for matrices of several shapes and ranks, each showing the image dimension and the kernel dimension stacked to exactly the number of input dimensions. Bar chart for matrices of several shapes and ranks, each showing the image dimension and the kernel dimension stacked to exactly the number of input dimensions.
For every matrix the two bars sum to the number of columns. Every input dimension either survives into the image or is crushed into the kernel.

The second figure is rank-nullity drawn as a conservation law, which is the most useful way to hold it. Each bar’s total height is dim(V)\dim(V) — the number of columns — and the split between image and kernel varies with the rank. The total never does.

That framing makes the consequences immediate rather than something to derive. A wide matrix (n>mn > m) cannot have a trivial kernel, because the image dimension is capped at m<nm < n and the rest of nn has to go somewhere. So a wide matrix is never injective — there are always distinct inputs colliding on the same output. That is precisely why an under-determined system has infinitely many solutions (§2.1), and why a compression step is inherently lossy (Chapter 10).

Conversely a tall matrix (m>nm > n) can have a trivial kernel and still fail to be surjective, because the image is at most nn-dimensional inside an mm-dimensional codomain. That is why an overdetermined system usually has no solution.

The three-way equivalence — injective iff surjective iff bijective — needs dim(V)=dim(W)\dim(V) = \dim(W), and the figure shows why: only when the bar height equals the codomain dimension can filling one force the other.

shapetypical rankkernelinjective?surjective?
square, full ranknn{0}\{\mathbf{0}\}yesyes — and bijective
square, deficient<n< nnon-trivialnono
tall, m>nm > n, full ranknn{0}\{\mathbf{0}\}yesno — image is nn-dim in Rm\mathbb{R}^m
wide, n>mn > m, full rankmmdimension nm1n - m \ge 1noyes

The two middle-column entries in the last two rows are the asymmetry the figure makes visible: a tall matrix loses nothing and reaches little; a wide one reaches everything and loses information.

pch.quizTag Check yourself
  1. What is the fastest way to show a mapping is not linear?

    pch.quizShowAnswer

    B — Check whether it sends the zero vector to the zero vector — Linearity forces Phi(0) = 0, so any mapping with a constant offset is disqualified by one evaluation. It is necessary but not sufficient — x squared passes the zero test and is still not linear.

  2. What does the j-th column of a transformation matrix contain?

    pch.quizShowAnswer

    B — The coordinates of the image of the j-th domain basis vector, with respect to the codomain basis — That is the definition. It is section 2.2's 'columns are the images of the basis vectors', made precise — with the important caveat that 'images' means in coordinates, and which coordinates depends on the codomain basis.

  3. A four-by-six matrix has full rank. What can you say?

    pch.quizShowAnswer

    B — It is surjective but not injective — the kernel has dimension two — Four rows and six columns means the image is at most four-dimensional and full rank makes it exactly four, so it covers the codomain. Rank-nullity then forces the kernel to have dimension six minus four, so distinct inputs collide.

  4. Why does anyone bother changing basis?

    pch.quizShowAnswer

    B — Because the same mapping can have a far simpler matrix in the right basis — the book's example turns a shear-looking matrix into a diagonal one — The mapping does not change; the description does. A diagonal matrix raised to a high power is trivial, which is the entire motivation for Chapter 4's diagonalisation and for Chapter 10's choice of a basis in which data compresses.

Exercise 2 – Coordinates depend on the ordering

Section titled “Exercise 2 – Coordinates depend on the ordering”

Exercise 3 – Basis change can diagonalise

Section titled “Exercise 3 – Basis change can diagonalise”

Exercise 4 – Rank-nullity as a conservation law

Section titled “Exercise 4 – Rank-nullity as a conservation law”
  • Linearity is one condition — the mapping commutes with taking linear combinations — and it packages additivity and homogeneity together.
  • Every linear mapping sends zero to zero, which is the cheapest disqualifier: any constant offset makes a mapping affine rather than linear.
  • Isomorphism is linear plus bijective; endomorphism maps a space to itself; automorphism is both.
  • Two finite-dimensional spaces are isomorphic exactly when their dimensions agree, which is why an m-by-n matrix space can be treated as a vector space of length mn.
  • A basis must be ordered because coordinates are a list — swapping two basis vectors swaps the coordinates of every point.
  • The j-th column of the transformation matrix is the coordinates of the image of the j-th basis vector, expressed in the codomain basis.
  • Matrix multiplication maps coordinates, not vectors — the underlying vectors never touch a matrix.
  • Basis change is T inverse times A times S, read right to left: translate in, map, translate out.
  • Similar means the same matrix on both sides; equivalent allows different ones. Similar implies equivalent, not conversely.
  • The kernel lives in the width and the image in the height — different spaces, which is why rank-nullity needs care.
  • The kernel is never empty; it always contains the zero vector, and the mapping is injective exactly when that is all it contains.
  • Rank-nullity is a conservation law: image dimension plus kernel dimension equals the number of input dimensions, always.
  • A wide matrix is never injective and a tall one is rarely surjective, and injective-iff-surjective-iff-bijective needs the two dimensions to match.

Next: what happens when the offset is allowed back in — Affine Spaces.

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading