Skip to main content

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 T:VWT:V\to W between vector spaces is linear if

T(u+v)=T(u)+T(v)T(\mathbf{u}+\mathbf{v})=T(\mathbf{u})+T(\mathbf{v})

and

T(cu)=cT(u)T(c\mathbf{u})=cT(\mathbf{u})

for all vectors and scalars. Equivalently,

T(c1v1++ckvk)=c1T(v1)++ckT(vk).T(c_1\mathbf{v}_1+\cdots+c_k\mathbf{v}_k) = c_1T(\mathbf{v}_1)+\cdots+c_kT(\mathbf{v}_k).

The kernel and range are

ker(T)={v:T(v)=0},range(T)={T(v):vV}.\ker(T)=\{\mathbf{v}:T(\mathbf{v})=\mathbf{0}\}, \qquad \operatorname{range}(T)=\{T(\mathbf{v}):\mathbf{v}\in V\}.

A transformation is one-to-one if distinct inputs give distinct outputs. It is onto if its range is the whole codomain.

If T:RnRmT:\mathbb{R}^n\to\mathbb{R}^m is linear, then there is an m×nm\times n standard matrix AA such that

T(x)=Ax.T(\mathbf{x})=A\mathbf{x}.

The columns of AA are the images of the standard basis vectors:

A=[T(e1)T(e2)T(en)].A= \begin{bmatrix} T(\mathbf{e}_1)&T(\mathbf{e}_2)&\cdots&T(\mathbf{e}_n) \end{bmatrix}.

Key results

A linear transformation is determined by its values on a basis. If B={v1,,vn}B=\{\mathbf{v}_1,\ldots,\mathbf{v}_n\} is a basis for VV and the values T(vi)T(\mathbf{v}_i) are known, then for any

x=c1v1++cnvn,\mathbf{x}=c_1\mathbf{v}_1+\cdots+c_n\mathbf{v}_n,

linearity forces

T(x)=c1T(v1)++cnT(vn).T(\mathbf{x})=c_1T(\mathbf{v}_1)+\cdots+c_nT(\mathbf{v}_n).

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 T(u)=0T(\mathbf{u})=\mathbf{0} and T(v)=0T(\mathbf{v})=\mathbf{0}, then

T(u+v)=0,T(cu)=0.T(\mathbf{u}+\mathbf{v})=\mathbf{0}, \qquad T(c\mathbf{u})=\mathbf{0}.

For finite-dimensional spaces, the rank-nullity theorem says

dim(kerT)+dim(rangeT)=dim(V).\dim(\ker T)+\dim(\operatorname{range} T)=\dim(V).

For a matrix transformation T(x)=AxT(\mathbf{x})=A\mathbf{x}, this is the same as

nullity(A)+rank(A)=n.\operatorname{nullity}(A)+\operatorname{rank}(A)=n.

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 T:RnRmT:\mathbb{R}^n\to\mathbb{R}^m, onto means the columns of the standard matrix span Rm\mathbb{R}^m.

Composition of linear transformations corresponds to matrix multiplication. If S(x)=BxS(\mathbf{x})=B\mathbf{x} and T(y)=AyT(\mathbf{y})=A\mathbf{y}, then

(TS)(x)=A(Bx)=(AB)x.(T\circ S)(\mathbf{x})=A(B\mathbf{x})=(AB)\mathbf{x}.

Linearity can be checked with one combined condition:

T(cu+dv)=cT(u)+dT(v)T(c\mathbf{u}+d\mathbf{v})=cT(\mathbf{u})+dT(\mathbf{v})

for all vectors u,v\mathbf{u},\mathbf{v} and scalars c,dc,d. 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 T(0)=0T(\mathbf{0})=\mathbf{0} because

T(0)=T(0v)=0T(v)=0.T(\mathbf{0})=T(0\mathbf{v})=0T(\mathbf{v})=\mathbf{0}.

So a function such as T(x)=x+1T(x)=x+1 is immediately not linear. However, passing the zero test does not prove linearity; a nonlinear function such as T(x)=x2T(x)=x^2 also sends 00 to 00 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:

T(u+k)=T(u)+T(k)=T(u).T(\mathbf{u}+\mathbf{k})=T(\mathbf{u})+T(\mathbf{k})=T(\mathbf{u}).

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 R2\mathbb{R}^2 are one-to-one and onto because they preserve all information and can be reversed by rotating back.

Visual

QuestionMatrix test for T(x)=AxT(\mathbf{x})=A\mathbf{x}Transformation meaning
Is TT one-to-one?pivot in every columnno nonzero vector maps to zero
Is TT onto Rm\mathbb{R}^m?pivot in every rowevery output vector is reached
What is ker(T)\ker(T)?solve Ax=0A\mathbf{x}=\mathbf{0}inputs lost by the map
What is range(T)\operatorname{range}(T)?column space of AApossible outputs

Worked example 1: Build a standard matrix

Problem: find the standard matrix for the linear transformation T:R2R2T:\mathbb{R}^2\to\mathbb{R}^2 that rotates vectors counterclockwise by 9090^\circ.

Step 1: apply TT to the standard basis vectors.

e1=[10]T(e1)=[01].\mathbf{e}_1= \begin{bmatrix}1\\0\end{bmatrix} \quad\Longrightarrow\quad T(\mathbf{e}_1)= \begin{bmatrix}0\\1\end{bmatrix}.

The vector e1\mathbf{e}_1 points along the positive xx-axis; after a 9090^\circ counterclockwise rotation it points along the positive yy-axis.

Step 2: apply TT to e2\mathbf{e}_2.

e2=[01]T(e2)=[10].\mathbf{e}_2= \begin{bmatrix}0\\1\end{bmatrix} \quad\Longrightarrow\quad T(\mathbf{e}_2)= \begin{bmatrix}-1\\0\end{bmatrix}.

Step 3: place these images as columns:

A=[0110].A= \begin{bmatrix} 0&-1\\ 1&0 \end{bmatrix}.

Step 4: check on a general vector.

A[xy]=[yx],A\begin{bmatrix}x\\y\end{bmatrix} = \begin{bmatrix} -y\\x \end{bmatrix},

which is exactly the 9090^\circ counterclockwise rotation rule. Checked answer: T(x)=AxT(\mathbf{x})=A\mathbf{x} with the matrix above.

Worked example 2: Kernel, range, one-to-one, and onto

Problem: let T:R3R2T:\mathbb{R}^3\to\mathbb{R}^2 be defined by

T(x,y,z)=[x+2yz2x+4y2z].T(x,y,z)= \begin{bmatrix} x+2y-z\\ 2x+4y-2z \end{bmatrix}.

Find the kernel and range, and decide whether TT is one-to-one or onto.

Step 1: write the standard matrix:

A=[121242].A= \begin{bmatrix} 1&2&-1\\ 2&4&-2 \end{bmatrix}.

Step 2: solve Ax=0A\mathbf{x}=\mathbf{0}:

x+2yz=0,2x+4y2z=0.x+2y-z=0, \qquad 2x+4y-2z=0.

The second equation is twice the first. Let y=sy=s and z=tz=t. Then

x=2s+t.x=-2s+t.

Thus

ker(T)={s[210]+t[101]:s,tR}.\ker(T)= \left\{ s\begin{bmatrix}-2\\1\\0\end{bmatrix} +t\begin{bmatrix}1\\0\\1\end{bmatrix} :s,t\in\mathbb{R} \right\}.

Step 3: find the range. The columns are

[12],[24],[12].\begin{bmatrix}1\\2\end{bmatrix}, \begin{bmatrix}2\\4\end{bmatrix}, \begin{bmatrix}-1\\-2\end{bmatrix}.

All are scalar multiples of [12]\begin{bmatrix}1\\2\end{bmatrix}, so

range(T)=span{[12]}.\operatorname{range}(T)= \operatorname{span}\left\{ \begin{bmatrix}1\\2\end{bmatrix} \right\}.

Step 4: decide one-to-one and onto. The kernel contains nonzero vectors, so TT is not one-to-one. The range is a line in R2\mathbb{R}^2, not all of R2\mathbb{R}^2, so TT is not onto.

Checked answer: dim(kerT)=2\dim(\ker T)=2, dim(rangeT)=1\dim(\operatorname{range}T)=1, and 2+1=3=dim(R3)2+1=3=\dim(\mathbb{R}^3).

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 T(x)=AxT(\mathbf{x})=A\mathbf{x} 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 T(x)=Ax+bT(\mathbf{x})=A\mathbf{x}+\mathbf{b} with b0\mathbf{b}\neq\mathbf{0} 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: TST\circ S corresponds to ABAB when SS uses BB and TT uses AA.

A fast way to disprove linearity is to test the zero vector and one simple sum. If T(0)0T(\mathbf{0})\neq\mathbf{0}, the function is not linear. If the zero test passes, try checking whether T(u+v)=T(u)+T(v)T(\mathbf{u}+\mathbf{v})=T(\mathbf{u})+T(\mathbf{v}) 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 Ax=0A\mathbf{x}=\mathbf{0}, 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 S:UVS:U\to V and T:VWT:V\to W, then TST\circ S means apply SS first and TT second. In matrices, if SS is represented by BB and TT by AA, then the composition is represented by ABAB. 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

T(x)=Ax+bT(\mathbf{x})=A\mathbf{x}+\mathbf{b}

with b0\mathbf{b}\neq\mathbf{0} 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.

Connections