Recipe
Test whether a function is onto
Use when: you're given f: A \to B and asked whether it's onto (surjective), meaning every element of the codomain actually gets produced
Goal: either a construction showing an input exists for every element of the codomain, or one specific codomain element no input reaches
Taught in Onto functions
Quick recipe
-
1
Set the function's rule equal to an arbitrary output b, then attempt to isolate the input a in terms of b.
Example
For f(x) = 3x - 7: set 3x - 7 = y for an arbitrary real y, then solve: 3x = y+7, so x = \dfrac{y+7}{3}.
Why: constructing an explicit input for an arbitrary output is what "every element of B is reached" actually means, not just checking a handful of values.
-
2
Confirm whether the expression from the previous step always produces a valid member of the domain, for every b in the codomain.
Example
\dfrac{y+7}{3} is a real number for every real y, so it always lies in the domain \mathbb{R}: f is onto. By contrast, solving 2n = 3 for an integer n gives n = 1.5, not an integer.
- the constructed input is always in the domain, for every b — the function is onto; write up the construction as the proof.
- the constructed input sometimes falls outside the domain, such as not being an integer — look for one specific b that breaks it.
Why: a formula for the input only proves onto if it genuinely stays inside the domain for every codomain element, not just for some of them.
-
3
Pick a candidate output the constructed formula could not produce as a valid domain element, then confirm directly that no input works.
Example
For f(n) = 2n on the integers: 2n = 3 has no integer solution, since n = 1.5 is not an integer, so 3 is never reached.
Why: one confirmed unreachable element disproves "every b is hit" completely, the same way one counterexample disproves any "for all" claim.
-
4
Write "onto," backed by the completed construction, or "not onto," backed by the specific unreached element.
Why: onto is a claim about the entire codomain, so the verdict needs either a general construction or a specific counterexample behind it.
Common mistakes
- Checking that a few codomain elements are reached and concluding onto without a general construction.
- Forgetting to confirm the constructed input actually lies in the stated domain, not just that the algebra worked.
- Picking a b value that happens to be reachable when hunting for a counterexample, then wrongly concluding the function is onto.
- Confusing onto with one-to-one, since one asks whether every output is reached and the other asks whether outputs ever repeat.