Skip to content

Surjective Function

Definition

A function f ⁣:X→Yf\colon X\to Y is surjective if for every y∈Y,y \in Y\text{,} there exists an x∈Xx \in X such that f(x)=y.f (x) = y\text{.} In other words, a function is onto if its codomain is exactly its range.


Interpretation

Surjectivity describes how completely a function covers its codomain: every element of YY must be the output of at least one input, so no element of the codomain is left unused.

Two arrow diagrams: a surjective function, where every point of the target is hit, and a non-surjective one, where one target point is never reached.

In the left diagram each of the three points of YY receives at least one arrow, the top one even two, so the function is surjective; sharing an output is allowed. In the right diagram the bottom point of YY, drawn hollow, receives no arrow, so that function is not surjective, even though every input is used.

To prove surjectivity, take an arbitrary y∈Yy\in Y and find an x∈Xx\in X with f(x)=yf(x)=y, usually by solving this equation for xx. For f(x)=x3f(x)=x^3 on R\mathbb{R} the solution is x=y3x=\sqrt[3]{y}. To disprove it, a single yy without a solution suffices, as y=−1y=-1 shows for x2x^2 on R\mathbb{R}. In terms of the range, ff is surjective if and only if its range equals YY; for a function on a subset of R\mathbb{R}, every horizontal line y=cy=c with c∈Yc\in Y must meet the graph at least once.

Surjectivity is a property of the rule together with the codomain: with codomain [0,+∞)[0,+\infty) instead of R\mathbb{R}, the function x2x^2 becomes surjective. Together with injectivity it makes ff a bijection: surjectivity guarantees at least one solution of f(x)=yf(x)=y, injectivity at most one.

A common slip is to check the inputs instead of the outputs. That every input has an output is true for every function; surjectivity is about every element of the codomain.


Key Results

  • A function is surjective if every element of the codomain is attained.
  • Surjectivity depends on both the function rule and the chosen codomain.
  • Changing the codomain may change surjectivity.

Examples

  • The function f(x)=x3f(x)=x^3 from R\mathbb{R} to R\mathbb{R} is surjective.
  • The function f(x)=x2f(x)=x^2 from R\mathbb{R} to R\mathbb{R} is not surjective.

Prerequisites

Sources

Aliases: onto function, surjection, surjective Symbols: element of, infinity, real numbers, square root

Last updated: 20 October 2026 03:02