← Back to all lessons
Class 12Algebra15:15Published 7 Mar 2024

Injective, Surjective and Bijective Functions

Learn what makes a function injective, surjective or bijective, with two fully worked Class XII examples that prove a function is one to one but not onto, and that another is bijective.

This lesson explains the difference between one to one (injective), onto (surjective) and bijective functions, then puts the definitions to work. The first example shows that a function from the natural numbers to the natural numbers is injective but fails to be onto because its range never reaches 1 or 2. The second example proves a rational function on the reals is both injective and onto, and so bijective, by finding its inverse. The methods shown are exactly what Class XII students need for relations and functions questions.

What you'll learn

  • How to tell injective, surjective and bijective functions apart
  • Proving a function is one to one by assuming equal outputs and showing the inputs match
  • Showing a function is not onto by comparing its range with its codomain
  • Proving a function is onto by solving for the input in terms of the output

Lesson chapters

0:00What injective, surjective and bijective mean
1:37Example: prove a function is one to one
6:06Why that function is not onto
9:24Bijective example: proving one to one
12:14Proving the function is onto

Lesson notes

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:NNf : \mathbb{N} \to \mathbb{N} be defined by

f(x)=x2+x+1.f(x) = x^2 + x + 1.

We prove ff is one to one but not onto.

Proving it is one to one

Take x1,x2Nx_1, x_2 \in \mathbb{N} with f(x1)=f(x2)f(x_1) = f(x_2). Then

x12+x1+1=x22+x2+1.x_1^2 + x_1 + 1 = x_2^2 + x_2 + 1.

Cancel the +1+1 and group:

(x12x22)+(x1x2)=0.(x_1^2 - x_2^2) + (x_1 - x_2) = 0.

Factor, using x12x22=(x1x2)(x1+x2)x_1^2 - x_2^2 = (x_1 - x_2)(x_1 + x_2):

(x1x2)(x1+x2+1)=0.(x_1 - x_2)(x_1 + x_2 + 1) = 0.

Since x1,x2Nx_1, x_2 \in \mathbb{N}, the factor x1+x2+10x_1 + x_2 + 1 \neq 0. Therefore

x1x2=0x1=x2.x_1 - x_2 = 0 \quad\Longrightarrow\quad x_1 = x_2.

So f(x1)=f(x2)f(x_1) = f(x_2) forces x1=x2x_1 = x_2, and ff is injective.

Why it is not onto

For every xNx \in \mathbb{N} we have

f(x)=x2+x+13,f(x) = x^2 + x + 1 \geq 3,

since the smallest value is at x=1x = 1, where f(1)=1+1+1=3f(1) = 1 + 1 + 1 = 3. So the range of ff starts at 33. But the codomain is N\mathbb{N}, which contains 11 and 22. No input maps to 11 or 22, so the range is not equal to the codomain. Therefore ff is not onto.

Example 2: a bijective function

Let A=R{3}A = \mathbb{R} \setminus \{3\} and B=R{1}B = \mathbb{R} \setminus \{1\}, and let f:ABf : A \to B be

f(x)=x2x3,xA.f(x) = \frac{x - 2}{x - 3}, \qquad x \in A.

We show ff is bijective.

Proving it is one to one

Suppose f(x1)=f(x2)f(x_1) = f(x_2):

x12x13=x22x23.\frac{x_1 - 2}{x_1 - 3} = \frac{x_2 - 2}{x_2 - 3}.

Cross multiply:

(x12)(x23)=(x22)(x13).(x_1 - 2)(x_2 - 3) = (x_2 - 2)(x_1 - 3).

Expand both sides:

x1x23x12x2+6=x1x23x22x1+6.x_1 x_2 - 3x_1 - 2x_2 + 6 = x_1 x_2 - 3x_2 - 2x_1 + 6.

Cancel x1x2x_1 x_2 and 66, then collect terms:

3x1+2x1=3x2+2x2x1=x2.-3x_1 + 2x_1 = -3x_2 + 2x_2 \quad\Longrightarrow\quad -x_1 = -x_2.

So x1=x2x_1 = x_2, and ff is injective.

Proving it is onto

Set y=f(x)=x2x3y = f(x) = \dfrac{x - 2}{x - 3} and solve for xx in terms of yy. Cross multiplying,

y(x3)=x2xy3y=x2.y(x - 3) = x - 2 \quad\Longrightarrow\quad xy - 3y = x - 2.

Gather the xx terms:

xyx=3y2x(y1)=3y2,xy - x = 3y - 2 \quad\Longrightarrow\quad x(y - 1) = 3y - 2,

so

x=3y2y1.x = \frac{3y - 2}{y - 1}.

To confirm this xx really maps to yy, substitute it back into ff:

Numerator: 3y2y12=3y22(y1)y1=yy1.\dfrac{3y - 2}{y - 1} - 2 = \dfrac{3y - 2 - 2(y - 1)}{y - 1} = \dfrac{y}{y - 1}.

Denominator: 3y2y13=3y23(y1)y1=1y1.\dfrac{3y - 2}{y - 1} - 3 = \dfrac{3y - 2 - 3(y - 1)}{y - 1} = \dfrac{1}{y - 1}.

Therefore

f ⁣(3y2y1)=y/(y1)1/(y1)=y.f\!\left(\frac{3y - 2}{y - 1}\right) = \frac{\,y/(y-1)\,}{\,1/(y-1)\,} = y.

Every yBy \in B has a preimage in AA, so ff is onto.

Since ff is both injective and surjective, ff is bijective.

Key takeaways

  • To prove a function is one to one, assume f(x1)=f(x2)f(x_1) = f(x_2) and show this forces x1=x2x_1 = x_2.
  • 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)y = f(x) for xx in terms of yy and check that this input maps back to yy.
  • A function that is both injective and surjective is bijective.