TExcelTAD
Home › Linear Algebra & Matrix Theory › Properties of Linear Transformations

Properties of Linear Transformations

Does a linear transformation lose information, and can it reach every output? These are the questions of one-to-one and onto, and for a linear map T(x)=AxT(\mathbf{x}) = A\mathbf{x} both are answered by counting pivots of AA. Maps that are both are invertible, and their inverse is the inverse matrix.

Kernel and image

For a linear map T:Rn→RmT : \mathbb{R}^n \to \mathbb{R}^m with standard matrix AA:

Name Definition Equals
kernel ker⁡T\ker T {x:T(x)=0}\{\mathbf{x} : T(\mathbf{x}) = \mathbf{0}\} null⁡(A)\operatorname{null}(A), a subspace of Rn\mathbb{R}^n
image (range) im⁡T\operatorname{im} T {T(x):x∈Rn}\{T(\mathbf{x}) : \mathbf{x} \in \mathbb{R}^n\} col⁡(A)\operatorname{col}(A), a subspace of Rm\mathbb{R}^m

These are the null space and column space from Column Space, Row Space and Null Space, now with a geometric meaning: the kernel is what TT crushes to zero, the image is what TT can reach. Rank-nullity reads dim⁡ker⁡T+dim⁡im⁡T=n\dim \ker T + \dim \operatorname{im} T = n.

One-to-one

TT is one-to-one (injective) if different inputs always give different outputs: T(u)=T(v)⇒u=vT(\mathbf{u}) = T(\mathbf{v}) \Rightarrow \mathbf{u} = \mathbf{v}.

Theorem. A linear TT is one-to-one   ⟺  \iff ker⁡T={0}\ker T = \{\mathbf{0}\}.

Proof: if T(u)=T(v)T(\mathbf{u}) = T(\mathbf{v}), then T(u−v)=0T(\mathbf{u} - \mathbf{v}) = \mathbf{0}, so u−v∈ker⁡T\mathbf{u} - \mathbf{v} \in \ker T. If the kernel is {0}\{\mathbf{0}\}, u=v\mathbf{u} = \mathbf{v}. Conversely, if some x≠0\mathbf{x} \ne \mathbf{0} had T(x)=0=T(0)T(\mathbf{x}) = \mathbf{0} = T(\mathbf{0}), TT would not be one-to-one.

In terms of AA: one-to-one   ⟺  \iff Ax=0A\mathbf{x} = \mathbf{0} has only x=0\mathbf{x} = \mathbf{0}   ⟺  \iff pivot in every column   ⟺  \iff the columns are independent   ⟺  \iff rank⁡A=n\operatorname{rank} A = n. This requires n≤mn \le m: you cannot squeeze R3\mathbb{R}^3 into R2\mathbb{R}^2 without collisions.

Onto

TT is onto (surjective) if every b∈Rm\mathbf{b} \in \mathbb{R}^m is an output: Ax=bA\mathbf{x} = \mathbf{b} is solvable for all b\mathbf{b}.

In terms of AA: onto   ⟺  \iff col⁡(A)=Rm\operatorname{col}(A) = \mathbb{R}^m   ⟺  \iff pivot in every row   ⟺  \iff the columns span Rm\mathbb{R}^m   ⟺  \iff rank⁡A=m\operatorname{rank} A = m. This requires n≥mn \ge m: R2\mathbb{R}^2 cannot cover R3\mathbb{R}^3.

Shape of AA (m×nm \times n) can be one-to-one? can be onto?
tall, m>nm > n yes, if rank=n\text{rank} = n never
wide, m<nm < n never yes, if rank=m\text{rank} = m
square, m=nm = n yes   ⟺  \iff onto   ⟺  \iff invertible yes   ⟺  \iff one-to-one   ⟺  \iff invertible

For square matrices the two properties coincide: nn pivots means a pivot in every row and every column.

python · try it yourself
from sympy import Matrix

def describe(A):
    r = A.rank()
    m, n = A.shape
    return f"{m}x{n}, rank {r}: one-to-one={r == n}, onto={r == m}, kernel dim={n - r}"

print("embed R^2 in R^3 :", describe(Matrix([[1, 0], [0, 1], [1, 1]])))
print("project R^3->R^2 :", describe(Matrix([[1, 0, 0], [0, 1, 0]])))
print("rotation in R^2  :", describe(Matrix([[0, -1], [1, 0]])))
print("collapse to line :", describe(Matrix([[1, 2], [2, 4]])))
embed R^2 in R^3 : 3x2, rank 2: one-to-one=True, onto=False, kernel dim=0
project R^3->R^2 : 2x3, rank 2: one-to-one=False, onto=True, kernel dim=1
rotation in R^2  : 2x2, rank 2: one-to-one=True, onto=True, kernel dim=0
collapse to line : 2x2, rank 1: one-to-one=False, onto=False, kernel dim=1

Invertible transformations

T:Rn→RnT : \mathbb{R}^n \to \mathbb{R}^n is invertible if there is a map T−1T^{-1} with T−1(T(x))=xT^{-1}(T(\mathbf{x})) = \mathbf{x} and T(T−1(y))=yT(T^{-1}(\mathbf{y})) = \mathbf{y} for all x,y\mathbf{x}, \mathbf{y}. This happens exactly when TT is one-to-one and onto, and then:

  • T−1T^{-1} is again linear, and
  • its standard matrix is A−1A^{-1} (Matrix Inverses).

Linearity of T−1T^{-1}: for outputs y1=T(x1)\mathbf{y}_1 = T(\mathbf{x}_1) and y2=T(x2)\mathbf{y}_2 = T(\mathbf{x}_2), T(x1+x2)=y1+y2T(\mathbf{x}_1 + \mathbf{x}_2) = \mathbf{y}_1 + \mathbf{y}_2, so T−1(y1+y2)=x1+x2=T−1(y1)+T−1(y2)T^{-1}(\mathbf{y}_1 + \mathbf{y}_2) = \mathbf{x}_1 + \mathbf{x}_2 = T^{-1}(\mathbf{y}_1) + T^{-1}(\mathbf{y}_2); scalars work the same way.

Geometrically: the inverse of rotation by θ\theta is rotation by −θ-\theta, the inverse of scaling by 2 is scaling by 12\frac{1}{2}, the inverse of a shear by kk is a shear by −k-k, and a reflection is its own inverse. Projections have no inverse: they have a non-zero kernel.

python · try it yourself
from sympy import Matrix, Rational

shear = Matrix([[1, 3], [0, 1]])
print("shear inverse:", shear.inv().tolist())

T = Matrix([[2, 1], [5, 3]])
y = T * Matrix([4, -1])
print("T(x) =", list(y), "-> T^-1 recovers x =", list(T.inv() * y))

P = Matrix([[1, 0], [0, 0]])                # projection onto the x-axis
print("projection: kernel basis", [list(v) for v in P.nullspace()], " invertible:", P.det() != 0)
print("P sends [3, 5] and [3, -2] to the same point:", list(P * Matrix([3, 5])), list(P * Matrix([3, -2])))
shear inverse: [[1, -3], [0, 1]]
T(x) = [7, 17] -> T^-1 recovers x = [4, -1]
projection: kernel basis [[0, 1]]  invertible: False
P sends [3, 5] and [3, -2] to the same point: [3, 0] [3, 0]

In software

  • Rendering loses depth. Projecting a 3D scene onto a 2D screen is not one-to-one: every point along a viewing ray lands on the same pixel. That is why "screen to world" picking cannot return a point, only a ray, which is then intersected with the scene (Screen-to-World Rays).
  • Lossy vs lossless. A transformation with a non-trivial kernel destroys information. Dimensionality reduction (PCA to 2 components) and a neural layer that maps 4096 features to 1024 cannot be undone; an invertible layer can, which is the principle behind "normalizing flow" generative models built from invertible maps.
  • Undo. Editors that store transforms (rotate, scale, shear a selection) undo them by applying the inverse matrix; a "flatten" or "squash to zero width" operation cannot be undone that way and must store the original data.
  • Embeddings into larger spaces (one-to-one, not onto): an embedding layer maps tokens into Rd\mathbb{R}^d; most vectors of Rd\mathbb{R}^d correspond to no token at all.

Exercises

Exercise 1: Classify

For each matrix, say whether T(x)=AxT(\mathbf{x}) = A\mathbf{x} is one-to-one and whether it is onto: (a) [123456]\begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix}, (b) [123246]\begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \end{bmatrix}, (c) [111−1]\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}.

Answer

(a) one-to-one, not onto; (b) neither; (c) both (invertible).

Solution
(a) 3×2, columns independent→rank 2=n: one-to-one; rank 2<m=3: not onto(b) 2×3, row 2=2⋅row 1→rank 1: < n=3 not one-to-one, < m=2 not onto(c) det⁡=−1−1=−2≠0→rank 2: both\begin{aligned} &\text{(a) } 3 \times 2, \text{ columns independent} \to \text{rank } 2 = n\text{: one-to-one; rank } 2 < m = 3\text{: not onto} \\ &\text{(b) } 2 \times 3, \text{ row } 2 = 2 \cdot \text{row } 1 \to \text{rank } 1\text{: } {<}\, n = 3 \text{ not one-to-one, } {<}\, m = 2 \text{ not onto} \\ &\text{(c) } \det = -1 - 1 = -2 \ne 0 \to \text{rank } 2\text{: both} \end{aligned}

Exercise 2: Find the kernel

Find a basis of ker⁡T\ker T for T([x,y,z])=[x+y−z,2x−y+z]T([x, y, z]) = [x + y - z, 2x - y + z].

Answer

ker⁡T=span⁡{[0,1,1]}\ker T = \operatorname{span}\{[0, 1, 1]\}.

Solution
x+y−z=0,2x−y+z=0add: 3x=0→x=0, then y=zkernel={[0,t,t]}=span⁡{[0,1,1]}\begin{aligned} &x + y - z = 0, \quad 2x - y + z = 0 \\ &\text{add: } 3x = 0 \to x = 0, \text{ then } y = z \\ &\text{kernel} = \{[0, t, t]\} = \operatorname{span}\{[0, 1, 1]\} \end{aligned}
python · try it yourself
from sympy import Matrix
print([list(v) for v in Matrix([[1, 1, -1], [2, -1, 1]]).nullspace()])
[[0, 1, 1]]

Exercise 3: Invert a transformation

TT rotates R2\mathbb{R}^2 by 90° counter-clockwise and then scales by 2. Find the matrix of TT and of T−1T^{-1}, and describe T−1T^{-1} geometrically.

Answer

T=[0−220]T = \begin{bmatrix} 0 & -2 \\ 2 & 0 \end{bmatrix}, T−1=[012−120]T^{-1} = \begin{bmatrix} 0 & \frac{1}{2} \\ -\frac{1}{2} & 0 \end{bmatrix}: scale by 12\frac{1}{2}, then rotate by 90° clockwise.

Solution
T=(2I)⋅R(90∘)=2⋅[0−110]=[0−220]T−1=R(90∘)−1(2I)−1=R(−90∘)⋅12I=12⋅[01−10]=[012−120]\begin{aligned} T &= (2I) \cdot R(90^\circ) = 2 \cdot \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & -2 \\ 2 & 0 \end{bmatrix} \\ T^{-1} &= R(90^\circ)^{-1} (2I)^{-1} = R(-90^\circ) \cdot \tfrac{1}{2}I = \tfrac{1}{2} \cdot \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & \frac{1}{2} \\ -\frac{1}{2} & 0 \end{bmatrix} \end{aligned}

(Here the two factors commute, so the order of "scale" and "rotate back" does not matter.)

python · try it yourself
from sympy import Matrix
T = Matrix([[0, -2], [2, 0]])
print(T.inv().tolist())
[[0, 1/2], [-1/2, 0]]

Exercise 4: Can it be onto?

Can a linear map R5→R7\mathbb{R}^5 \to \mathbb{R}^7 be onto? Can a linear map R7→R5\mathbb{R}^7 \to \mathbb{R}^5 be one-to-one? Explain with ranks.

Answer

No and no.

Solution

A map R5→R7\mathbb{R}^5 \to \mathbb{R}^7 has a 7×5 matrix of rank at most 5<75 < 7, so its image is at most 5-dimensional and cannot be R7\mathbb{R}^7. A map R7→R5\mathbb{R}^7 \to \mathbb{R}^5 has a 5×7 matrix with rank at most 5, so by rank-nullity its kernel has dimension at least 7−5=27 - 5 = 2, and it is not one-to-one.

Test yourself

T(x)=AxT(\mathbf{x}) = A\mathbf{x} with AA of size 3×3 and rank 3. Which is true?

  1. TT is one-to-one but not onto
  2. TT is onto but not one-to-one
  3. TT has a non-zero kernel
  4. TT is invertible

A linear map is one-to-one exactly when…

  1. its image is everything
  2. its matrix is square
  3. its kernel is {0}\{\mathbf{0}\}
  4. its matrix is symmetric

Why can't a mouse click on the screen be turned back into a single 3D point?

  1. Floating-point error
  2. Perspective projection is not one-to-one: a whole ray maps to one pixel
  3. The GPU discards the matrix
  4. Screens are not linear