This lesson works through what it means for a function to be injective (one to one), surjective (onto), and bijective (both at once), then proves these properties for two worked examples.
The three definitions
- A function is injective (one to one) when different inputs always give different outputs.
- A function is surjective (onto) when every element of the codomain is hit by some input.
- A function is bijective when it is both injective and surjective.
Example 1: one to one but not onto
Let f:N→N be defined by
f(x)=x2+x+1.
We prove f is one to one but not onto.
Proving it is one to one
Take x1,x2∈N with f(x1)=f(x2). Then
x12+x1+1=x22+x2+1.
Cancel the +1 and group:
(x12−x22)+(x1−x2)=0.
Factor, using x12−x22=(x1−x2)(x1+x2):
(x1−x2)(x1+x2+1)=0.
Since x1,x2∈N, the factor x1+x2+1=0. Therefore
x1−x2=0⟹x1=x2.
So f(x1)=f(x2) forces x1=x2, and f is injective.
Why it is not onto
For every x∈N we have
f(x)=x2+x+1≥3,
since the smallest value is at x=1, where f(1)=1+1+1=3. So the range of f starts at 3. But the codomain is N, which contains 1 and 2. No input maps to 1 or 2, so the range is not equal to the codomain. Therefore f is not onto.
Example 2: a bijective function
Let A=R∖{3} and B=R∖{1}, and let f:A→B be
f(x)=x−3x−2,x∈A.
We show f is bijective.
Proving it is one to one
Suppose f(x1)=f(x2):
x1−3x1−2=x2−3x2−2.
Cross multiply:
(x1−2)(x2−3)=(x2−2)(x1−3).
Expand both sides:
x1x2−3x1−2x2+6=x1x2−3x2−2x1+6.
Cancel x1x2 and 6, then collect terms:
−3x1+2x1=−3x2+2x2⟹−x1=−x2.
So x1=x2, and f is injective.
Proving it is onto
Set y=f(x)=x−3x−2 and solve for x in terms of y. Cross multiplying,
y(x−3)=x−2⟹xy−3y=x−2.
Gather the x terms:
xy−x=3y−2⟹x(y−1)=3y−2,
so
x=y−13y−2.
To confirm this x really maps to y, substitute it back into f:
Numerator: y−13y−2−2=y−13y−2−2(y−1)=y−1y.
Denominator: y−13y−2−3=y−13y−2−3(y−1)=y−11.
Therefore
f(y−13y−2)=1/(y−1)y/(y−1)=y.
Every y∈B has a preimage in A, so f is onto.
Since f is both injective and surjective, f is bijective.
Key takeaways
- To prove a function is one to one, assume f(x1)=f(x2) and show this forces x1=x2.
- To show a function is not onto, find elements of the codomain that the range never reaches.
- To prove a function is onto, solve y=f(x) for x in terms of y and check that this input maps back to y.
- A function that is both injective and surjective is bijective.