Tutorials › Linear Algebra › One-to-One Is Not the Same as Onto

Linear Transformations of R^n · Tutorial 198 of 1000

One-to-One Is Not the Same as Onto

Learn to distinguish injectivity from surjectivity, test each using a transformation’s matrix, and explain why square invertible transformations have both properties.

Intermediate 10 min read

What You'll Learn

  • Distinguish a transformation’s codomain from the set of outputs it actually reaches.
  • Test whether a transformation is one-to-one by solving its homogeneous system.
  • Test whether a transformation is onto by checking whether every target vector has a preimage.
  • Identify injective and surjective examples using rectangular matrices.
  • Prove why injectivity and surjectivity coincide for square matrices.
  • Connect a square matrix transformation being bijective with having an inverse matrix.

Two Different Questions About a Transformation

A linear transformation can preserve enough information to distinguish every input without reaching every possible output. It can also reach every output while sending different inputs to the same place. These are separate properties: one-to-one concerns whether outputs identify their inputs, while onto concerns whether every vector in the stated codomain is reached. Rectangular matrices make the distinction especially visible because the input and output spaces may have different dimensions.

Let \(T:\mathbb{R}^n\to\mathbb{R}^m\) be a linear transformation with standard matrix \(\mathbf{A}\in\mathbb{R}^{m\times n}\), so \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\). The dimensions matter: the codomain is \(\mathbb{R}^m\), whether or not every vector in it is an output. The set of outputs is the column space \(\operatorname{Col}\mathbf{A}\), the span of the columns of \(\mathbf{A}\).

Definition: The transformation \(T:\mathbb{R}^n\to\mathbb{R}^m\) is one-to-one (or injective) if \(T(\mathbf{x}_1)=T(\mathbf{x}_2)\) implies \(\mathbf{x}_1=\mathbf{x}_2\). It is onto (or surjective) if for every \(\mathbf{b}\in\mathbb{R}^m\), there is at least one \(\mathbf{x}\in\mathbb{R}^n\) such that \(T(\mathbf{x})=\mathbf{b}\). It is bijective if it is both one-to-one and onto.

For a matrix transformation, being one-to-one means no two different inputs produce the same output. Subtracting the inputs and using linearity shows that this is equivalent to \(\mathbf{A}\mathbf{x}=\mathbf{0}\) having only the solution \(\mathbf{x}=\mathbf{0}\). Being onto means that \(\mathbf{A}\mathbf{x}=\mathbf{b}\) has a solution for every \(\mathbf{b}\) in the codomain. In other words, the columns of \(\mathbf{A}\) must span \(\mathbb{R}^m\).

A Rectangular Map That Is One-to-One but Not Onto

Worked Example: An Injective Map from R² to R³

Consider \(T:\mathbb{R}^2\to\mathbb{R}^3\) with standard matrix \(\mathbf{A}=\begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix}\). Determine which property holds.

For an input \(\mathbf{x}=\begin{bmatrix}s\\t\end{bmatrix}\), matrix multiplication gives

$$ T(\mathbf{x})=\mathbf{A}\mathbf{x} =\begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix} \begin{bmatrix}s\\t\end{bmatrix} =\begin{bmatrix}s\\t\\0\end{bmatrix}. $$

To test whether \(T\) is one-to-one, solve the homogeneous equation:

$$ \begin{bmatrix}1&0\\0&1\\0&0\end{bmatrix} \begin{bmatrix}s\\t\end{bmatrix} =\begin{bmatrix}0\\0\\0\end{bmatrix} \quad\Longrightarrow\quad s=0,\quad t=0. $$

The only input mapped to the zero vector is \(\begin{bmatrix}0\\0\end{bmatrix}\), so \(T\) is one-to-one. To test whether it is onto, take a target \(\begin{bmatrix}a\\b\\c\end{bmatrix}\). Every output has third coordinate \(0\), so the target \(\begin{bmatrix}0\\0\\1\end{bmatrix}\) has no preimage. Therefore \(T\) is not onto. Indeed, its image is the plane consisting of vectors whose third coordinate is zero.

Check: For every \(\begin{bmatrix}s\\t\end{bmatrix}\), multiplying gives \(\begin{bmatrix}s\\t\\0\end{bmatrix}\), as claimed. The output \(\begin{bmatrix}0\\0\\1\end{bmatrix}\) cannot equal this because its third coordinate is \(1\), not \(0\).

A Rectangular Map That Is Onto but Not One-to-One

Worked Example: A Surjective Map from R³ to R²

Let \(S:\mathbb{R}^3\to\mathbb{R}^2\) have standard matrix \(\mathbf{B}=\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}\). Determine which property holds.

For a target \(\begin{bmatrix}a\\b\end{bmatrix}\in\mathbb{R}^2\), choose the input \(\begin{bmatrix}a\\b\\0\end{bmatrix}\). Then

$$ \begin{bmatrix}1&0&1\\0&1&1\end{bmatrix} \begin{bmatrix}a\\b\\0\end{bmatrix} =\begin{bmatrix}a\\b\end{bmatrix}. $$

This construction supplies a preimage for every target, so \(S\) is onto. To test whether it is one-to-one, solve \(\mathbf{B}\mathbf{x}=\mathbf{0}\): the equations are \(x+z=0\) and \(y+z=0\). Setting \(z=1\) gives \(x=-1\), \(y=-1\), so \(\begin{bmatrix}-1\\-1\\1\end{bmatrix}\) is a nonzero input mapped to zero. Thus \(S\) is not one-to-one.

Check: Multiplying that nonzero input back gives

$$ \begin{bmatrix}1&0&1\\0&1&1\end{bmatrix} \begin{bmatrix}-1\\-1\\1\end{bmatrix} =\begin{bmatrix}-1+1\\-1+1\end{bmatrix} =\begin{bmatrix}0\\0\end{bmatrix}. $$

Since \(S(\mathbf{0})=\mathbf{0}\) as well, these are two distinct inputs with the same output.

These examples show why it is important to name the codomain when asking whether a map is onto. The first transformation reaches every point in a plane inside \(\mathbb{R}^3\), but it is not onto \(\mathbb{R}^3\). The second reaches every point in \(\mathbb{R}^2\), though some of those outputs have more than one preimage.

Why the Properties Coincide in the Square Case

For a general \(m\times n\) matrix, the two tests ask for pivots in different directions. Injectivity requires a pivot in every column; surjectivity requires a pivot in every row. When the matrix is square, it has the same number of rows and columns, so these conditions become equivalent. The row-reduction criteria below also explain why the distinction in the rectangular examples is possible.

Theorem: Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), and let \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\). The transformation \(T:\mathbb{R}^n\to\mathbb{R}^m\) is one-to-one exactly when the RREF of \(\mathbf{A}\) has a pivot in every column. It is onto exactly when the RREF has a pivot in every row.

Proof. Let \(\mathbf{R}\) be the RREF of \(\mathbf{A}\). Row operations preserve the solutions of a homogeneous system, so \(\mathbf{A}\mathbf{x}=\mathbf{0}\) and \(\mathbf{R}\mathbf{x}=\mathbf{0}\) have the same solutions. In the reduced system, a column without a pivot corresponds to a free variable. If every column has a pivot, there are no free variables, and the homogeneous system has only its zero solution. If a column lacks a pivot, set one free variable to \(1\), set the other free variables to \(0\), and solve for the pivot variables. This gives a nonzero solution. Thus the kernel contains only zero exactly when every column has a pivot, proving the one-to-one criterion.

For the onto criterion, row operations amount to multiplying \(\mathbf{A}\) on the left by an invertible matrix \(\mathbf{E}\), so the equation \(\mathbf{A}\mathbf{x}=\mathbf{b}\) is equivalent to \(\mathbf{R}\mathbf{x}=\mathbf{E}\mathbf{b}\). If every row of \(\mathbf{R}\) has a pivot, each system \(\mathbf{R}\mathbf{x}=\mathbf{E}\mathbf{b}\) is consistent: assign the free variables zero and solve for the pivot variables. Thus every \(\mathbf{b}\) has a preimage. If some row has no pivot, that row of the RREF is zero. Choose \(\mathbf{b}=\mathbf{E}^{-1}\mathbf{e}_i\), where \(i\) is the index of a zero row and \(\mathbf{e}_i\) is the corresponding standard basis vector in \(\mathbb{R}^m\). Then \(\mathbf{E}\mathbf{b}=\mathbf{e}_i\), making the zero row of \(\mathbf{R}\mathbf{x}=\mathbf{E}\mathbf{b}\) the inconsistent equation \(0=1\). So \(T\) is not onto. This proves both directions of the onto criterion. \(\square\)

Corollary: If \(\mathbf{A}\in\mathbb{R}^{n\times n}\), then \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\) is one-to-one if and only if it is onto.

Proof. In the RREF of an \(n\times n\) matrix, having a pivot in every column means there are \(n\) pivots. Each pivot is in a different row, and there are \(n\) rows, so there is a pivot in every row as well. Conversely, \(n\) pivots in every row must occupy \(n\) different columns, so there is a pivot in every column. By the theorem, having pivots in every column is equivalent to being one-to-one, and having pivots in every row is equivalent to being onto. Hence the two properties are equivalent. \(\square\)

Bijective Square Matrices and Inverses

A square matrix \(\mathbf{A}\) is called invertible if there is a square matrix \(\mathbf{B}\) such that \(\mathbf{A}\mathbf{B}=\mathbf{B}\mathbf{A}=\mathbf{I}_n\). For a square matrix, this is exactly the situation in which the associated transformation is both one-to-one and onto. The inverse matrix represents the rule that recovers the unique input from each output.

Worked Example: A Square Invertible Transformation

Consider \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). Verify that \(\mathbf{B}\) is an inverse and interpret the transformation.

Multiplying in both orders gives

$$ \mathbf{A}\mathbf{B} =\begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}1&-1\\0&1\end{bmatrix} =\begin{bmatrix}1&0\\0&1\end{bmatrix} =\mathbf{I}_2, \qquad \mathbf{B}\mathbf{A} =\begin{bmatrix}1&-1\\0&1\end{bmatrix} \begin{bmatrix}1&1\\0&1\end{bmatrix} =\begin{bmatrix}1&0\\0&1\end{bmatrix} =\mathbf{I}_2. $$

The transformation sends \(\begin{bmatrix}x\\y\end{bmatrix}\) to \(\begin{bmatrix}x+y\\y\end{bmatrix}\). Given any target \(\begin{bmatrix}a\\b\end{bmatrix}\), the input \(\mathbf{B}\begin{bmatrix}a\\b\end{bmatrix}=\begin{bmatrix}a-b\\b\end{bmatrix}\) maps back to that target. This input is unique because multiplying an equation \(\mathbf{A}\mathbf{x}=\mathbf{b}\) by \(\mathbf{B}\) forces \(\mathbf{x}=\mathbf{B}\mathbf{b}\). Thus the map is onto and one-to-one.

Check: Substituting the proposed input gives \(\mathbf{A}\begin{bmatrix}a-b\\b\end{bmatrix}=\begin{bmatrix}a-b+b\\b\end{bmatrix}=\begin{bmatrix}a\\b\end{bmatrix}\), and the two matrix products above verify the inverse in both orders.

The link between invertibility and the two properties can be established directly, without using determinants.

Theorem: For \(\mathbf{A}\in\mathbb{R}^{n\times n}\), the matrix \(\mathbf{A}\) is invertible if and only if \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\) is bijective.

Proof. Suppose first that \(\mathbf{A}\) is invertible with inverse \(\mathbf{B}\). If \(\mathbf{A}\mathbf{x}_1=\mathbf{A}\mathbf{x}_2\), multiply both sides by \(\mathbf{B}\) to obtain \(\mathbf{x}_1=\mathbf{x}_2\), so \(T\) is one-to-one. For any \(\mathbf{b}\in\mathbb{R}^n\), choose \(\mathbf{x}=\mathbf{B}\mathbf{b}\). Then \(\mathbf{A}\mathbf{x}=\mathbf{A}\mathbf{B}\mathbf{b}=\mathbf{b}\), so \(T\) is onto.

Conversely, suppose \(T\) is bijective. For each standard basis vector \(\mathbf{e}_j\), surjectivity gives an input \(\mathbf{x}_j\) with \(\mathbf{A}\mathbf{x}_j=\mathbf{e}_j\). Form the matrix \(\mathbf{B}\) whose columns are \(\mathbf{x}_1,\dots,\mathbf{x}_n\). The \(j\)th column of \(\mathbf{A}\mathbf{B}\) is \(\mathbf{A}\mathbf{x}_j=\mathbf{e}_j\), so \(\mathbf{A}\mathbf{B}=\mathbf{I}_n\). For any \(\mathbf{x}\in\mathbb{R}^n\), this implies \(\mathbf{A}(\mathbf{B}\mathbf{A}\mathbf{x})=(\mathbf{A}\mathbf{B})\mathbf{A}\mathbf{x}=\mathbf{A}\mathbf{x}\). Since \(T\) is one-to-one, the inputs \(\mathbf{B}\mathbf{A}\mathbf{x}\) and \(\mathbf{x}\) must be equal. This holds for every \(\mathbf{x}\), so \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\). Therefore \(\mathbf{B}\) is an inverse of \(\mathbf{A}\). \(\square\)

Common Pitfall: Treating One Property as the Other

A frequent mistake is to assume that a transformation is onto just because it is one-to-one, or vice versa. For example, the square transformation \(\begin{bmatrix}x\\y\end{bmatrix}\mapsto\begin{bmatrix}x\\0\end{bmatrix}\) is not one-to-one: both \(\begin{bmatrix}0\\0\end{bmatrix}\) and \(\begin{bmatrix}0\\1\end{bmatrix}\) map to \(\begin{bmatrix}0\\0\end{bmatrix}\). It is also not onto \(\mathbb{R}^2\), because \(\begin{bmatrix}0\\1\end{bmatrix}\) is not an output. The false calculation “the matrix has two columns, so it must be onto \(\mathbb{R}^2\)” confuses the number of columns with whether the columns span the codomain. In fact, its matrix \(\begin{bmatrix}1&0\\0&0\end{bmatrix}\) has no pivot in its second row or second column.

Use the domain and codomain, then ask the appropriate question: injectivity asks whether two inputs can share an output; surjectivity asks whether a specified target has a preimage. For a square matrix the answers must agree, but for a rectangular matrix they need not.

PropertyMatrix testQuestion to ask
One-to-onePivot in every columnDoes \(\mathbf{A}\mathbf{x}=\mathbf{0}\) have only the zero solution?
OntoPivot in every rowCan every vector in the codomain be reached?
Invertible, for a square matrixPivots in every row and columnCan each output be reached from exactly one input?

Check Your Understanding

For each matrix transformation, identify whether it is one-to-one, onto, both, or neither. Support your answer with the relevant system or a preimage argument.

  1. For \(\mathbf{A}=\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}\), decide whether \(T:\mathbb{R}^2\to\mathbb{R}^3\) is one-to-one and whether it is onto.
  2. For \(\mathbf{B}=\begin{bmatrix}1&2&0\\0&1&1\end{bmatrix}\), find a nonzero vector in \(\operatorname{Nul}\mathbf{B}\), or show that none exists, and test whether \(\mathbf{B}\) is onto \(\mathbb{R}^2\).
  3. Explain why a pivot in every column is the test for one-to-one, while a pivot in every row is the test for onto.
  4. Prove that if a square matrix transformation has an inverse matrix, then it is both one-to-one and onto.
  5. Why does the statement “one-to-one if and only if onto” require a square matrix in this discussion? Give one of the rectangular examples as evidence.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon