Onto (surjective) and bijective functions
f: A → B is onto when every element of B is the image of some element of A, so range = codomain. One-one and onto make f bijective.
What onto means
For f: A → B, the set B is the codomain, and the set of actual outputs is the range. f is onto (surjective) if every element of B is the image of at least one element of A, so the range is the whole of B. In an arrow diagram, every element of B receives at least one arrow. If some element of B receives no arrow, f is into, not onto. The codomain matters: the same rule can be onto one set and not onto another.
How to prove onto (solve for x)
- 1Take any y in the codomain B.
- 2Set y = f(x) and solve for x in terms of y.
- 3★Check that this x lies in the domain A. Look out for division by zero, and for domains like N or Z.
- 4Check that f(x) = y. Then every y has a preimage, so f is onto.
- 5To disprove, name one y in B that has no preimage.
★ key step
Example 1: onto R
Show that f: R → R, f(x) = 5 − 2x is onto.
- Rule: every y ∈ R must equal f(x) for some x ∈ R.
- Let y ∈ R and set y = 5 − 2x.
- Then 2x = 5 − y, so x = (5 − y)/2.
- (5 − y)/2 is a real number for every real y.
- Check: f((5 − y)/2) = 5 − 2 × (5 − y)/2 = 5 − (5 − y) = y.
Every real y has the preimage (5 − y)/2, so f is onto.
The four possibilities
| Function | One-one? | Onto? | Type |
|---|---|---|---|
| f: R → R, f(x) = 2x + 1 | Yes | Yes | Bijective |
| f: N → N, f(x) = 2x | Yes | No: 3 has no preimage | One-one only |
| f: N → N, f(n) = (n + 1)/2 for odd n and n/2 for even n | No: f(1) = f(2) = 1 | Yes: f(2m) = m | Onto only |
| f: R → R, f(x) = x² | No: f(−1) = f(1) | No: −1 has no preimage | Neither |
Example 2: one-one and onto (board style)
Show that f: R − {−1} → R − {1}, f(x) = (x − 2)/(x + 1) is a bijection.
- Rule: show that f is one-one and onto.
- One-one: let (x₁ − 2)/(x₁ + 1) = (x₂ − 2)/(x₂ + 1).
- Cross-multiply and expand: x₁x₂ + x₁ − 2x₂ − 2 = x₁x₂ + x₂ − 2x₁ − 2.
- Cancel: x₁ − 2x₂ = x₂ − 2x₁, so 3x₁ = 3x₂ and x₁ = x₂.
- Onto: take any y ≠ 1 and set y = (x − 2)/(x + 1).
- Then xy + y = x − 2, so x(y − 1) = −(y + 2), and x = (y + 2)/(1 − y).
- This x is real because y ≠ 1. Also x ≠ −1, since x = −1 would give y + 2 = y − 1, that is 2 = −1, which is impossible.
- Check: x − 2 = 3y/(1 − y) and x + 1 = 3/(1 − y), so f(x) = 3y/3 = y.
f is one-one and onto, so f is a bijection.
Example 3: neither one-one nor onto
Show that f: R → R, f(x) = x/(x² + 1) is neither one-one nor onto.
- One-one fails: f(2) = 2/5 and f(1/2) = (1/2)/(5/4) = 2/5, but 2 ≠ 1/2.
- Onto: try to solve x/(x² + 1) = 1.
- This gives x = x² + 1, that is x² − x + 1 = 0.
- Its discriminant is (−1)² − 4(1)(1) = −3 < 0, so there is no real x.
- So 1 in the codomain has no preimage.
f is neither one-one nor onto.
In a sold-out cinema show, the map 'ticket → seat' is onto: no seat is left empty. If no seat is sold twice as well, the map is a bijection, which is exactly what a booking app must make sure of.
1 marks: “The function f: N → N, f(x) = 5x is:” One-one but not onto. 5x₁ = 5x₂ gives x₁ = x₂, but a number that is not a multiple of 5, such as 3, has no preimage in N.
2 marks: “Show that f: R → R, f(x) = 5x³ + 4 is onto.” Let y ∈ R. Solve y = 5x³ + 4: x³ = (y − 4)/5, so x is the cube root of (y − 4)/5, which is real for every y. Then f(x) = y, so f is onto.
1 marks: “How many bijections are there from A = {1, 2, 3, 4} to itself?” 4! = 4 × 3 × 2 × 1 = 24.
Onto: no one left out. Every element of the codomain gets an arrow. One-one + onto = bijection.