Linear Transformations
Linear transformations are the function version of matrices. They preserve addition and scalar multiplication, so they preserve linear structure: lines through the origin, spans, subspaces, dependence relations, and coordinates. Matrices are concrete representations of linear transformations after bases are chosen.
This page ties together two viewpoints. A matrix can be read as an array of numbers, but it is often better read as an action on vectors. Conversely, an abstract linear function becomes computable once bases are chosen, because its behavior on a basis determines its behavior everywhere.
Definitions
A function between vector spaces is linear if
and
for all vectors and scalars. Equivalently,
The kernel and range are
A transformation is one-to-one if distinct inputs give distinct outputs. It is onto if its range is the whole codomain.
If is linear, then there is an standard matrix such that
The columns of are the images of the standard basis vectors:
Key results
A linear transformation is determined by its values on a basis. If is a basis for and the values are known, then for any
linearity forces
The kernel of a linear transformation is a subspace of the domain, and the range is a subspace of the codomain. The proof is a closure check. For the kernel, if and , then
For finite-dimensional spaces, the rank-nullity theorem says
For a matrix transformation , this is the same as
A linear transformation is one-to-one exactly when its kernel contains only the zero vector. It is onto exactly when its range equals the codomain. For , onto means the columns of the standard matrix span .
Composition of linear transformations corresponds to matrix multiplication. If and , then
Linearity can be checked with one combined condition:
for all vectors and scalars . This single condition includes both additivity and scalar compatibility. It is often the fastest way to disprove linearity: find one input combination for which the equality fails.
The zero vector test is necessary but not sufficient. Every linear transformation must satisfy because
So a function such as is immediately not linear. However, passing the zero test does not prove linearity; a nonlinear function such as also sends to but fails additivity.
Matrix representations depend on bases. The standard matrix is used when the standard bases are understood in both domain and codomain. If different bases are chosen, the same transformation may have a different representing matrix. This is not a contradiction. It is the same geometric or algebraic action described in different coordinate languages. Similar matrices arise when the domain and codomain are the same space and the basis is changed.
The kernel measures information lost by the transformation. If two inputs differ by a kernel vector, then they have the same output:
Thus a nontrivial kernel prevents one-to-one behavior. The range measures which outputs are possible. If the range is smaller than the codomain, then some requested outputs cannot be reached no matter what input is chosen.
Geometrically, common linear transformations include rotations, reflections, projections, shears, and scalings. Projections have nontrivial kernels because they collapse directions perpendicular to the target subspace. Rotations in are one-to-one and onto because they preserve all information and can be reversed by rotating back.
Visual
| Question | Matrix test for | Transformation meaning |
|---|---|---|
| Is one-to-one? | pivot in every column | no nonzero vector maps to zero |
| Is onto ? | pivot in every row | every output vector is reached |
| What is ? | solve | inputs lost by the map |
| What is ? | column space of | possible outputs |
Worked example 1: Build a standard matrix
Problem: find the standard matrix for the linear transformation that rotates vectors counterclockwise by .
Step 1: apply to the standard basis vectors.
The vector points along the positive -axis; after a counterclockwise rotation it points along the positive -axis.
Step 2: apply to .
Step 3: place these images as columns:
Step 4: check on a general vector.
which is exactly the counterclockwise rotation rule. Checked answer: with the matrix above.
Worked example 2: Kernel, range, one-to-one, and onto
Problem: let be defined by
Find the kernel and range, and decide whether is one-to-one or onto.
Step 1: write the standard matrix:
Step 2: solve :
The second equation is twice the first. Let and . Then
Thus
Step 3: find the range. The columns are
All are scalar multiples of , so
Step 4: decide one-to-one and onto. The kernel contains nonzero vectors, so is not one-to-one. The range is a line in , not all of , so is not onto.
Checked answer: , , and .
Code
import sympy as sp
A = sp.Matrix([[1, 2, -1],
[2, 4, -2]])
print("rref:", A.rref())
print("rank:", A.rank())
print("nullspace:", A.nullspace())
print("columnspace:", A.columnspace())
The matrix computation gives the kernel and range of the transformation because the transformation is in standard coordinates.
Common pitfalls
- Testing linearity by checking only one example. Linearity must hold for all vectors and scalars.
- Forgetting that translations such as with are not linear.
- Confusing codomain with range. The codomain is declared; the range is what the transformation actually reaches.
- Assuming one-to-one and onto are the same for maps between spaces of different dimensions.
- Putting basis images as rows instead of columns when building the standard matrix.
- Losing the order of composition: corresponds to when uses and uses .
A fast way to disprove linearity is to test the zero vector and one simple sum. If , the function is not linear. If the zero test passes, try checking whether for convenient vectors. One counterexample is enough to disprove linearity, while a proof requires the general variables.
For transformations represented by matrices, pivot positions tell the mapping story. A pivot in every column means no free variables in , so the kernel is trivial and the map is one-to-one. A pivot in every row means the columns span the codomain, so the map is onto. These are not separate facts from row reduction; they are row reduction interpreted as function behavior.
When bases change, matrices change but the transformation does not. This distinction is central in advanced linear algebra. The derivative operator on polynomials, for example, is a linear transformation independent of any matrix. Once a polynomial basis is chosen, it receives a matrix representation. A different polynomial basis gives a different matrix for the same operator.
Composition is where order errors are most visible. If and , then means apply first and second. In matrices, if is represented by and by , then the composition is represented by . The order is forced by the vector being multiplied on the right.
Some familiar functions are affine rather than linear. A map of the form
with preserves lines and parallelism, but it does not preserve the origin and is not linear. Affine maps are important in geometry and computer graphics, but linear algebra treats their linear part and translation part separately.
The matrix of a projection illustrates kernel and range clearly. Projection onto a plane has range equal to that plane and kernel equal to the perpendicular direction that gets collapsed. Reflection across a line has trivial kernel and is invertible. Shear transformations are also invertible when they slide one coordinate direction by another without collapsing dimension.
Rank-nullity gives a quick dimension test for possible behavior. A linear map from a higher-dimensional space to a lower-dimensional space cannot be one-to-one, because nullity must be positive. A linear map from a lower-dimensional space to a higher-dimensional space cannot be onto, because its range dimension is at most the domain dimension.