1. What an Onto Function Means
An onto (or surjective) function is one where every element of the codomain actually appears as an output. Nothing in the codomain is left out.
In other words: the function covers the entire codomain.
2. Formal Definition
A function f: A → B is onto if every element of B is the output of at least one element of A.
2.1. Definition
\forall b \in B, \; \exists a \in A \text{ such that } f(a) = b
3. How to Check if a Function Is Onto
You need to make sure the function produces every value in the codomain. The method depends on how the function is described.
3.1. 1. Using Algebra
Start with an arbitrary b in the codomain, solve the equation f(a) = b, and see if you get a valid a.
3.2. 2. Using Graph
Check whether every possible y-value in the codomain is hit by some point on the graph.
3.3. 3. Using Ordered Pairs
Look at the outputs (second elements). If the set of outputs includes the whole codomain, the function is onto.
4. Examples of Onto Functions
These functions hit every value in the codomain.
4.1. Example 1
f: \mathbb{R} → \mathbb{R}, f(x) = x
Every real number appears as its own output → onto.
4.2. Example 2
f: \mathbb{R} → \mathbb{R}, f(x) = 2x - 1
Given any b, solving 2x - 1 = b gives x = (b + 1)/2, which is a real number. So the function reaches every real number.
4.3. Example 3
From ordered pairs:
A = \{1,2,3\}, B = \{4,5\}
f = \{(1,4),(2,5),(3,4)\}
Outputs are {4, 5}, which matches codomain B → onto.
5. Non-Examples (Not Onto)
These functions miss some values in the codomain.
5.1. Example 1
f: \mathbb{R} → \mathbb{R}, f(x) = x^2
Negative numbers never appear as outputs → not onto.
5.2. Example 2
From ordered pairs:
A = \{1,2\}, B = \{4,5,6\}
f = \{(1,4),(2,5)\}
Output 6 is missing → not onto.
6. Why Onto Functions Matter
Onto functions ensure complete coverage of the codomain. This matters when checking whether a function is bijective, when defining inverses, and when mapping one set entirely onto another.