core19 min studyLesson 12 in Mathematics

Linear transformations

Read a matrix as the images of basis vectors, then use rank and nullspace to explain lost information.

Before you begin
On this page

What you’ll understand

  • Check linearity without relying on the appearance of a graph.
  • Construct a matrix from its action on basis vectors.
  • Explain injectivity and reachability using nullspace and rank.

A matrix is a compact instruction for a linear transformation after input and output bases have been chosen. Thinking in terms of the transformation explains why matrix columns matter and why some systems cannot be inverted. Linear layers in a neural network, projections onto sensor channels, and operators in quantum mechanics all use this language, although their surrounding models introduce additional assumptions. Begin by asking what happens to a basis rather than multiplying entries without a purpose.

Linearity is a promise about combinations

A map is linear if applying it to any linear combination gives the same result as applying it separately and combining the outputs. Consequently a linear map sends zero to zero. Multiplication by a fixed matrix is linear, including rectangular matrices. The familiar formula f(x)=2x+3f(x)=2x+3 is affine rather than linear in this sense: its offset means that zero does not remain zero.

Once you know the images of all basis vectors, you know the entire linear map. Write an input as a combination of basis vectors, distribute the map through that combination, and collect the outputs. This argument explains the column convention: in standard coordinates, column jj of a matrix is where the jjth input basis vector lands. Matrix multiplication is the bookkeeping of this geometric statement.

T(au+bv)=aT(u)+bT(v),Ax=∑j=1nxjAejT(a u+b v)=aT(u)+bT(v),\qquad A x=\sum_{j=1}^{n}x_j A e_j
For a linear map between real vector spaces, real scalars a,b may be arbitrary. The second identity uses the standard basis of an n-dimensional input space.↔ Scroll wide equations horizontally.

The nullspace records invisible changes

The nullspace consists of all inputs mapped to zero. If a nonzero vector lies there, two distinct inputs separated by that vector have exactly the same output. The transformation has discarded information. The column space, also called its image, contains every output that can be reached. Its dimension is the rank. A measurement system can lose distinctions in its input while still covering every possible output channel.

Rank and nullity account for the input dimension together. An independent input direction either contributes to an observable output or belongs to the invisible combinations described by the kernel. For a matrix with more columns than rows, a nontrivial nullspace is unavoidable. For a square matrix, zero nullity is equivalent to invertibility; a rectangular map needs more careful distinctions between left inverses and right inverses.

ker⁡A={x:Ax=0},rank⁡(A)+dim⁡(ker⁡A)=n\ker A=\{x:Ax=0\},\qquad \operatorname{rank}(A)+\dim(\ker A)=n
Rank–nullity holds for a linear map with finite input dimension n. Rank counts independent outputs, not the total number of matrix entries.↔ Scroll wide equations horizontally.

Composition remembers order and coordinates

If BB acts first and AA second, the composed matrix is ABAB. Dimensions must match, and reversing the order generally changes the transformation or makes the product undefined. Stretching a picture horizontally and then rotating it does not usually produce the same picture as rotating first. This is a concrete reason that multiplication of matrices differs from multiplication of ordinary numbers.

Changing bases changes a matrix representation but not the abstract map. For one endomorphism, if columns of an invertible matrix PP are the new basis vectors, the new representation is P−1APP^{-1}AP. This coordinate flexibility later helps expose eigenmodes and quantum operators. A learned neural-network layer with a bias instead has an affine component; calling the whole layer linear would conceal that distinction.

Build a two-sensor map

A map takes e1e_1 to (1,0)(1,0), e2e_2 to (0,1)(0,1), and e3e_3 to (1,1)(1,1). Find the output for x=(2,−1,3)x=(2,-1,3) and one invisible input direction.

  1. Place the specified images in columns: A=(101011)A=\begin{pmatrix}1&0&1\\0&1&1\end{pmatrix}. It maps three input coordinates to two output coordinates.

  2. Use linearity: Ax=2(1,0)−(0,1)+3(1,1)=(5,2)Ax=2(1,0)-(0,1)+3(1,1)=(5,2). Each contribution is weighted by the corresponding input coordinate.

  3. Solve Ax=0Ax=0: the equations are x1+x3=0x_1+x_3=0 and x2+x3=0x_2+x_3=0. Setting x3=1x_3=1 gives (−1,−1,1)(-1,-1,1), an invisible direction.

The result

The output is (5,2), rank is 2, and nullity is 1. Adding any multiple of (−1,−1,1) to the input leaves these two sensor outputs unchanged.

Explore the model

Interactive lab

Interactive lab · vectors

Inspect projection as a linear measurement

Change the angle and magnitude of the single displayed vector and inspect its x/y projections. Projecting onto x is a linear map from the plane to one scalar: a vertical input component is invisible to that measurement. The lab illustrates this projection rather than simulating the worked example's rectangular matrix.

Inspect projection as a linear measurementPlayback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Current readings: x component: 1.393; y component: 0.975; Magnitude: 1.7. All parameters are adjustable with the labeled controls below.−7.46−3.7303.737.46−3.5−1.7501.753.5xyvvₓ = 1.39
Vectorx / y projectionsTrace marker
x component
1.393
y component
0.975
Magnitude
1.7
t = 0 s

Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forA projection retains one component while discarding an independent input direction.

Check your understanding

A 2×3 matrix has rank 2. What is the dimension of its nullspace?

Try it yourself

Does T(x,y)=(x+y,2x+2y)T(x,y)=(x+y,2x+2y) retain both input coordinates? Find its rank and an invisible direction.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Compare the two output coordinates, then solve x+y=0.

Compare with the solution

Every output lies on the line (s,2s)(s,2s), so rank is one. The nonzero vector (1,−1)(1,-1) maps to (0,0)(0,0), giving a one-dimensional kernel. Only the sum x+yx+y survives; the individual contributions cannot be reconstructed without extra information.

Take it with you

  • Matrix columns are images of input basis vectors.
  • Nullspace describes lost distinctions; column space describes reachable outputs.
  • Composition order and the chosen input/output bases matter.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.