One-to-One and Onto Transformations

One-to-one and onto transformations describe how a linear transformation T(x) = Ax moves vectors. T is one-to-one when different inputs always give different outputs, and onto when every vector in the codomain ℝᵐ is an output. Row reduce A: T is one-to-one when every column has a pivot and onto when every row has a pivot.

Before this lesson: Standard Matrix of a Linear Transformation, Span of Vectors and Linear Independence

What one-to-one and onto mean

A transformation T: ℝⁿ → ℝᵐ is one-to-one (also called injective) if each output comes from at most one input. In symbols, T(u) = T(v) forces u = v. No two inputs land on the same output.

T is onto ℝᵐ (also called surjective) if each vector b in ℝᵐ is the image of at least one input. In other words, the range of T, the set of all outputs, is all of ℝᵐ.

The two ideas are separate. A map can be one-to-one but not onto, onto but not one-to-one, both (a bijection), or neither. For functions of one variable, one-to-one is the horizontal line test from inverse functions.

Two mapping diagrams. Left, one-to-one but not onto: three input dots each send one arrow to a different output dot, and one output dot receives no arrow. Right, onto but not one-to-one: four input dots send arrows to three output dots; every output dot receives an arrow, and two arrows land on the same output dot.
Left: no output is hit twice (one-to-one), but one output is missed. Right: every output is hit (onto), but one output is hit twice.

One-to-one and onto theorems

Let A be the m × n standard matrix of T, so T(x) = Ax. Because T is linear, T(u) = T(v) means A(u − v) = 0. So T is one-to-one exactly when the homogeneous system Ax = 0 has only the trivial solution.

Property of TEquivalent matrix testPivot test
One-to-oneAx = 0 has only the solution x = 0; the columns of A are linearly independentA pivot in every column
Onto ℝᵐAx = b has a solution for every b in ℝᵐ; the columns of A span ℝᵐA pivot in every row

Pivots are counted in an echelon form of A, found by Gaussian elimination. A has at most min(m, n) pivots, which gives two quick size checks:

  • If n > m (more columns than rows), T cannot be one-to-one: some column has no pivot.
  • If n < m (more rows than columns), T cannot be onto ℝᵐ: some row has no pivot.
  • If n = m (A is square), T is one-to-one exactly when it is onto, and both hold exactly when A is invertible.

How to tell if a linear transformation is one-to-one or onto

  1. Write the standard matrix A of T and note its size m × n.
  2. Row reduce A to an echelon form. You do not need the augmented column, because only the pivot positions matter.
  3. One-to-one: check for a pivot in every column. If a column has no pivot, its variable is free, so Ax = 0 has a nonzero solution x and T(x) = T(0).
  4. Onto: check for a pivot in every row. If a row of the echelon form is all zeros, some b makes Ax = b inconsistent, and that b is not an output.

One-to-one and onto examples

Example 1: A 2 × 2 transformation

Is T(x₁, x₂) = (x₁ + 2x₂, 3x₁ + 4x₂) one-to-one? Is it onto ℝ²?

\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}

The standard matrix: the coefficients of each output entry form a row.

\begin{bmatrix} 1 & 2 \\ 0 & -2 \end{bmatrix}

R₂ − 3R₁ → R₂. Eliminate below the first pivot: 3 − 3(1) = 0 and 4 − 3(2) = −2.

Both columns have a pivot (1 and −2), so Ax = 0 has only the trivial solution.

Both rows have a pivot, so Ax = b is consistent for every b in ℝ².

Answer: T is one-to-one and onto ℝ², a bijection.

Example 2: Onto but not one-to-one

Let T: ℝ³ → ℝ² have standard matrix A = [1 2 −1; 2 5 1] (rows separated by a semicolon). Decide whether T is one-to-one and whether it is onto. If it is not one-to-one, find two inputs with the same output.

\begin{bmatrix} 1 & 2 & -1 \\ 2 & 5 & 1 \end{bmatrix}

Start with A.

\begin{bmatrix} 1 & 2 & -1 \\ 0 & 1 & 3 \end{bmatrix}

R₂ − 2R₁ → R₂. 2 − 2(1) = 0, 5 − 2(2) = 1 and 1 − 2(−1) = 3.

x_3 = 1

Column 3 has no pivot, so x₃ is free; choose x₃ = 1.

x_2 + 3(1) = 0

Row 2 of Ax = 0 with x₃ = 1.

x_2 = -3

Subtract 3 from both sides.

x_1 + 2(-3) - 1 = 0

Row 1 of Ax = 0 with x₂ = −3 and x₃ = 1.

x_1 - 7 = 0

Combine −6 − 1 = −7.

x_1 = 7

Add 7 to both sides.

A\begin{bmatrix} 7 \\ -3 \\ 1 \end{bmatrix} = \begin{bmatrix} 7 - 6 - 1 \\ 14 - 15 + 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix}

Check: the nonzero vector (7, −3, 1) is sent to 0.

Answer: T is onto ℝ² (a pivot in both rows) but not one-to-one: T(7, −3, 1) = T(0, 0, 0) = (0, 0).

Example 3: One-to-one but not onto

Let T(x₁, x₂) = (x₁ − x₂, 2x₁ + x₂, 3x₂). Decide whether T is one-to-one and whether T is onto ℝ³. If it is not onto, find a vector that is not an output.

\begin{bmatrix} 1 & -1 \\ 2 & 1 \\ 0 & 3 \end{bmatrix}

The standard matrix is 3 × 2.

\begin{bmatrix} 1 & -1 \\ 0 & 3 \\ 0 & 3 \end{bmatrix}

R₂ − 2R₁ → R₂. 2 − 2(1) = 0 and 1 − 2(−1) = 3.

\begin{bmatrix} 1 & -1 \\ 0 & 3 \\ 0 & 0 \end{bmatrix}

R₃ − R₂ → R₃. 3 − 3 = 0, so row 3 becomes all zeros.

Both columns have a pivot, so T is one-to-one. Row 3 has no pivot, so T is not onto ℝ³.

\left[\begin{array}{cc|c} 1 & -1 & b_1 \\ 0 & 3 & b_2 - 2b_1 \\ 0 & 0 & b_3 - b_2 + 2b_1 \end{array}\right]

Repeat the same row operations on [A | b]: R₂ − 2R₁, then R₃ − R₂ gives b₃ − (b₂ − 2b₁).

b_3 - b_2 + 2b_1 = 1 - 0 + 2(0) = 1

Try b = (0, 0, 1).

Row 3 reads 0 = 1, so Ax = (0, 0, 1) has no solution.

Answer: T is one-to-one but not onto; (0, 0, 1) is not in the range.

Example 4: A 3 × 3 matrix that needs a row swap

Is the transformation with standard matrix A = [1 2 3; 2 4 7; 1 3 5] one-to-one? Is it onto ℝ³?

\begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 7 \\ 1 & 3 & 5 \end{bmatrix}

Start with A.

\begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 1 \\ 1 & 3 & 5 \end{bmatrix}

R₂ − 2R₁ → R₂. 2 − 2(1) = 0, 4 − 2(2) = 0 and 7 − 2(3) = 1.

\begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 1 \\ 0 & 1 & 2 \end{bmatrix}

R₃ − R₁ → R₃. 1 − 1 = 0, 3 − 2 = 1 and 5 − 3 = 2.

\begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 2 \\ 0 & 0 & 1 \end{bmatrix}

Swap R₂ and R₃. The second column needs a nonzero entry in row 2.

The matrix is in echelon form with pivots 1, 1, 1 on the diagonal: a pivot in every row and every column.

Answer: T is one-to-one and onto ℝ³. Since A is square, A is also invertible.

Example 5: An error-detecting code

A sender encodes a message (x₁, x₂) as T(x₁, x₂) = (x₁ + x₂, x₁ − x₂, 2x₁ + x₂) and transmits the three numbers. (a) Show that two different messages never give the same code. (b) The receiver gets (5, 1, 8) and then (5, 1, 9). Decide whether each is a valid code, and decode the valid one.

\begin{bmatrix} 1 & 1 \\ 1 & -1 \\ 2 & 1 \end{bmatrix}

The standard matrix of the encoder.

\begin{bmatrix} 1 & 1 \\ 0 & -2 \\ 2 & 1 \end{bmatrix}

R₂ − R₁ → R₂. 1 − 1 = 0 and −1 − 1 = −2.

\begin{bmatrix} 1 & 1 \\ 0 & -2 \\ 0 & -1 \end{bmatrix}

R₃ − 2R₁ → R₃. 2 − 2(1) = 0 and 1 − 2(1) = −1.

\begin{bmatrix} 1 & 1 \\ 0 & -2 \\ 0 & 0 \end{bmatrix}

R₃ − ½R₂ → R₃. −1 − ½(−2) = 0.

(a) Both columns have a pivot, so T is one-to-one: each code comes from exactly one message.

x_1 + x_2 = 5,\; x_1 - x_2 = 1

(b) Use the first two entries of (5, 1, 8).

2x_1 = 6

Add the two equations.

x_1 = 3

Divide both sides by 2.

3 + x_2 = 5

Substitute x₁ = 3 into the first equation.

x_2 = 2

Subtract 3 from both sides.

2x_1 + x_2 = 2(3) + 2 = 8

Check the third entry: it matches 8.

The first entries of (5, 1, 9) give the same x₁ = 3 and x₂ = 2, but the third entry should be 8, not 9.

Answer: (a) T is one-to-one, so decoding is never ambiguous. (b) (5, 1, 8) is valid and decodes to (3, 2). (5, 1, 9) is not in the range of T (T is not onto ℝ³), so the receiver knows an error happened.

Common mistakes

MistakeExample of the errorFix
Swapping the two pivot testsCalling the 3 × 2 matrix in Example 3 onto because both columns have pivotsColumns → one-to-one. Rows → onto.
Reading pivots before row reducingSeeing no zero rows in [1 2 3; 2 4 7; 1 3 5] and stopping therePivots are positions in an echelon form, so row reduce first.
Thinking one-to-one implies ontoSaying the encoder in Example 5 is onto ℝ³ because it is one-to-oneThe two tests are the same only for square matrices. A 3 × 2 matrix is never onto ℝ³.
Testing a single vectorShowing T(1, 0) ≠ T(0, 1) and calling T one-to-oneOne-to-one needs Ax = 0 to have only the trivial solution, which is a statement about every input.
Ignoring the size checkRow reducing a 2 × 4 matrix to test one-to-oneWith more columns than rows, some column has no pivot, so T is not one-to-one.

Related ideas

Kernel and range. The set of x with T(x) = 0 is the kernel of T, and the set of outputs is its range. T is one-to-one exactly when the kernel is only 0, and onto exactly when the range is all of ℝᵐ. The Null Space and Column Space lesson (coming soon) studies these sets as subspaces.

Invertible transformations. A linear transformation that is both one-to-one and onto has an inverse transformation, and its standard matrix is invertible (see inverse matrices). The Invertible Matrix Theorem collects this with many other equivalent conditions.

Practice problems

  1. Is T(x₁, x₂) = (2x₁ + x₂, 4x₁ + 3x₂) one-to-one? Onto ℝ²?
  2. Is T(x₁, x₂) = (x₁ + 3x₂, 2x₁ + 6x₂) one-to-one? Onto ℝ²? If not one-to-one, give a nonzero x with T(x) = 0.
  3. A = [1 0 2; 0 1 −1]. Is T(x) = Ax one-to-one? Onto ℝ²?
  4. A = [1 2; 0 1; 1 3]. Is T(x) = Ax one-to-one? Onto ℝ³?
  5. Can a linear transformation T: ℝ⁴ → ℝ³ be one-to-one? Explain.
  6. Can a linear transformation T: ℝ² → ℝ⁵ be onto ℝ⁵? Explain.
  7. Is T(x₁, x₂, x₃) = (x₁ − x₂, x₂ − x₃, x₃ − x₁) one-to-one? Onto ℝ³?
  8. A = [1 1 1; 1 2 3; 1 3 6]. Is T(x) = Ax one-to-one and onto ℝ³?
  9. For which values of h is the transformation with matrix A = [1 h; 3 6] one-to-one?
  10. A sensor encodes a reading (a, b) as (a + b, a − b, a + 3b). Show that the encoding is one-to-one, then decide whether (6, 2, 10) and (6, 2, 9) are valid codes.
Show answers

1.

\begin{bmatrix} 2 & 1 \\ 4 & 3 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 2 & 1 \\ 0 & 1 \end{bmatrix}

R₂ − 2R₁ → R₂. 4 − 2(2) = 0 and 3 − 2(1) = 1.

Answer: pivots in both columns and both rows, so T is one-to-one and onto ℝ².

2.

\begin{bmatrix} 1 & 3 \\ 2 & 6 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 1 & 3 \\ 0 & 0 \end{bmatrix}

R₂ − 2R₁ → R₂. 2 − 2(1) = 0 and 6 − 2(3) = 0.

x_2 = 1,\; x_1 + 3(1) = 0

Column 2 has no pivot; set x₂ = 1 in row 1.

x_1 = -3

Subtract 3 from both sides.

Answer: neither. T(−3, 1) = (−3 + 3, −6 + 6) = (0, 0), and row 2 has no pivot.

3.

\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & -1 \end{bmatrix}

Already in echelon form, with pivots in columns 1 and 2.

x_3 = 1,\; x_1 + 2(1) = 0,\; x_2 - 1 = 0

Column 3 has no pivot; set x₃ = 1.

x_1 = -2,\; x_2 = 1

Solve each row.

Answer: onto ℝ² (a pivot in both rows) but not one-to-one: T(−2, 1, 1) = (−2 + 2, 1 − 1) = (0, 0).

4.

\begin{bmatrix} 1 & 2 \\ 0 & 1 \\ 1 & 3 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 1 & 2 \\ 0 & 1 \\ 0 & 1 \end{bmatrix}

R₃ − R₁ → R₃. 1 − 1 = 0 and 3 − 2 = 1.

\begin{bmatrix} 1 & 2 \\ 0 & 1 \\ 0 & 0 \end{bmatrix}

R₃ − R₂ → R₃. 1 − 1 = 0, so row 3 becomes all zeros.

Answer: one-to-one (pivots in both columns) but not onto ℝ³ (row 3 has no pivot).

5.

No. The standard matrix is 3 × 4, so it has at most 3 pivots. One of the 4 columns has no pivot, so Ax = 0 has a nonzero solution.

6.

No. The standard matrix is 5 × 2, so it has at most 2 pivots. At least 3 of the 5 rows have no pivot.

7.

\begin{bmatrix} 1 & -1 & 0 \\ 0 & 1 & -1 \\ -1 & 0 & 1 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 1 & -1 & 0 \\ 0 & 1 & -1 \\ 0 & -1 & 1 \end{bmatrix}

R₃ + R₁ → R₃. −1 + 1 = 0, 0 + (−1) = −1 and 1 + 0 = 1.

\begin{bmatrix} 1 & -1 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 0 \end{bmatrix}

R₃ + R₂ → R₃. −1 + 1 = 0 and 1 + (−1) = 0, so row 3 becomes all zeros.

Answer: neither. Column 3 and row 3 have no pivot; for example, T(1, 1, 1) = (0, 0, 0).

8.

\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 1 & 3 & 6 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 2 \\ 1 & 3 & 6 \end{bmatrix}

R₂ − R₁ → R₂. 2 − 1 = 1 and 3 − 1 = 2.

\begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 2 \\ 0 & 2 & 5 \end{bmatrix}

R₃ − R₁ → R₃. 3 − 1 = 2 and 6 − 1 = 5.

\begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 2 \\ 0 & 0 & 1 \end{bmatrix}

R₃ − 2R₂ → R₃. 2 − 2(1) = 0 and 5 − 2(2) = 1.

Answer: three pivots, one in every row and column, so T is one-to-one and onto ℝ³.

9.

\begin{bmatrix} 1 & h \\ 3 & 6 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 1 & h \\ 0 & 6 - 3h \end{bmatrix}

R₂ − 3R₁ → R₂.

6 - 3h \ne 0

Column 2 needs a pivot.

h \ne 2

3h = 6 when h = 2.

Answer: T is one-to-one exactly when h ≠ 2 (and then it is also onto, since A is square).

10.

\begin{bmatrix} 1 & 1 \\ 1 & -1 \\ 1 & 3 \end{bmatrix}

The standard matrix.

\begin{bmatrix} 1 & 1 \\ 0 & -2 \\ 1 & 3 \end{bmatrix}

R₂ − R₁ → R₂. 1 − 1 = 0 and −1 − 1 = −2.

\begin{bmatrix} 1 & 1 \\ 0 & -2 \\ 0 & 2 \end{bmatrix}

R₃ − R₁ → R₃. 1 − 1 = 0 and 3 − 1 = 2.

\begin{bmatrix} 1 & 1 \\ 0 & -2 \\ 0 & 0 \end{bmatrix}

R₃ + R₂ → R₃. 2 + (−2) = 0, so row 3 becomes all zeros.

Both columns have pivots, so the encoding is one-to-one.

a + b = 6,\; a - b = 2

Use the first two entries.

2a = 8,\; a = 4

Add the equations, then divide by 2.

b = 6 - 4 = 2

Substitute into a + b = 6.

a + 3b = 4 + 3(2) = 10

The third entry must be 10.

Answer: (6, 2, 10) is valid and decodes to (4, 2); (6, 2, 9) is not a valid code.

One-to-one and onto FAQ

What does it mean for a linear transformation to be one-to-one?

Different inputs always give different outputs: T(u) = T(v) only when u = v. For T(x) = Ax, this happens exactly when Ax = 0 has only the trivial solution, so A has a pivot in every column.

What does it mean for a linear transformation to be onto?

Every vector b in the codomain is an output of T. For T(x) = Ax, this means Ax = b is consistent for every b, so A has a pivot in every row.

Can a linear transformation be one-to-one but not onto?

Yes, when the matrix has more rows than columns. The map in Example 3 sends ℝ² into ℝ³: it is one-to-one, but its outputs only fill a plane in ℝ³.

How do you check one-to-one and onto with the determinant?

Only for a square matrix: if det A ≠ 0, T is both one-to-one and onto; if det A = 0, it is neither. For a non-square matrix, count pivots instead.

Summary

  • T(x) = Ax is one-to-one when each output comes from at most one input, and onto ℝᵐ when every vector in ℝᵐ is an output.
  • One-to-one ⇔ Ax = 0 has only the trivial solution ⇔ the columns are linearly independent ⇔ a pivot in every column.
  • Onto ⇔ the columns span ℝᵐ ⇔ a pivot in every row.
  • More columns than rows: never one-to-one. More rows than columns: never onto.
  • A square matrix is one-to-one exactly when it is onto, and both mean A is invertible.

Previous lesson: Standard Matrix of a Linear Transformation

Next lesson: Composition of Linear Transformations

Back to the Linear Algebra Index