Consider the function mapping a student to his/her roll numbers. The domain of the function is the set of all students. The range of the function is the set of all possible roll numbers. Of course, two students cannot have the exact same roll number. So, each used roll number can be used to uniquely identify a student. Such a function is called an **injective function**.

## Injective function definition

A function f : A ⇾ B is defined to be one-to-one or injective if the images of distinct elements of A under f are distinct.

Suppose we have 2 sets, A and B. If a function that points from A to B is injective, it means that there will not be two or more elements of set A pointing to the same element in set B. Conversely, no element in set B will be pointed to by more than 1 element in set A.

Such a function is also called a **one-to-one function** since one element in the range corresponds to only one element in the domain.

## Composition of injective functions

The composition of functions is a way of combining functions. In the composition of functions, the output of one function becomes the input of the other. To know more about the composition of functions, check out our article on Composition of Functions

Consider two functions$g:B\to C$ and$f:A\to B$. If these two functions are injective, then, $f\circ g:A\to C$ which is their composition is also injective.

Let's prove this.

Let $x,y\in A$ and suppose $(f\circ g)\left(x\right)=(f\circ g)\left(y\right)$.

From the above,

$f(g(x))=f(g(y))$

Because $f$ is injective,

$g\left(x\right)=g\left(y\right)$

$g$ is also injective. Therefore,

$x=y$

This implies that$f\circ g$ is an injection.

### Graphical explanation of Injective functions

When you draw an injective function on a graph, for any value of y there will not be more than 1 value of x.

So, given the graph of a function, if no horizontal line (parallel to the X-axis) intersects the curve at more than 1 point, we can conclude that the function is injective. On the other hand, if a horizontal line can be drawn which intersects the curve at more than 1 point, we can conclude that it is not injective. This is known as the *horizontal line test*.

Consider the point P in the above graph. We can see that a straight line through P parallel to either the X or the Y-axis will not pass through any other point other than P. This applies to every part of the curve. Thus the curve passes both the vertical line test, implying that it is a function, and the horizontal line test, implying that the function is an injective function.

By contrast, the above graph is not an injective function. The points, P1 and P2 have the same Y (range) values but correspond to different X (domain) values. Thus, it is not injective.

## Types of injective functions

The following are the types of injective functions.

- $f:R\to R,f\left(x\right)=2x+1$is injective.
- $f:R\to R,f\left(x\right)=\mathrm{ln}\left(x\right)$ is injective.
- $f:R\to R,f\left(x\right)=2x$ is injective
- $f:R\to R,f\left(x\right)={x}^{3}$ is injective
- $f:R\to R,f\left(x\right)=\raisebox{1ex}{$x$}\!\left/ \!\raisebox{-1ex}{$2$}\right.$ is injective
- $f:R\to R,f\left(x\right)=4x+5$ is injective.
- $f:N\to N,f\left(x\right)={x}^{2}$ is injective, since all-natural numbers have unique squares.
- $f:R\to R,f\left(x\right)={x}^{2}+1$ is not injective.
- $f:R\to R,f\left(x\right)=\mathrm{cos}\left(x\right)$ is not injective.

## Injective, Surjective and Bijective function

Apart from injective functions, there are other types of functions like surjective and bijective functions It is important that you are able to differentiate these functions from an injective function. So let's look at their differences.

For injective functions, it is a one to one mapping. Every element in A has a unique mapping in B but for the other types of functions, this is not the case. For a bijective function, every element in A matches perfectly with an element in B. No element is left out. See the figure below.

For surjective functions, every element in set B has at least one matching element in A and more than one element in A can point to just one element in B. See the figure below.

## Injective function examples

Consider the function, $f:R\u21feR,f\left(x\right)=x.$

Clearly, the value of $f\left(x\right)$ will be different when the value of x is different.

The same applies to the functions $f\left(x\right)={x}^{3},{x}^{5}$, etc.

On the other hand, consider the function,$f:R\u21feR,f\left(x\right)={x}^{2}.$

This is not an injective function.

Consider the value, 4, in the range of the function.

$f\left(2\right)=f(-2)=4$

Thus, we see that more than 1 value in the domain can result in the same value in the range, implying that the function is not injective in nature.

The same applies to functions such as ${x}^{4},{x}^{6}$, etc.

Let $B=(4,5,6)$ and $D=(a,b,c,d)$. Which of the following is an injective function?

- $\left\{(4,b),(5,b),(6,b)\right\}$
- $\left\{(5,a),(5,a)\right\}$
- $\left\{(4,a),(5,b),(6,c)\right\}$

**Solution:**

The answer is option c. Option c satisfies the condition for an injective function because the elements in B are uniquely mapped with the elements in D.

If $f\left(x\right)=x+2$ is an injective function, is $f\left(x\right)=f\left(y\right),x=y$ true?

**Solution:**

The statement is true. If you assume $x=4$ then,

$f\left(x\right)=x+2\phantom{\rule{0ex}{0ex}}f\left(x\right)=4+2\phantom{\rule{0ex}{0ex}}f\left(x\right)=6$

From the statement,$f\left(x\right)=f\left(y\right)=6$

This means that:

$x=y=6$

## Injective functions - Key takeaways

- If a function that points from A to B is injective, it means that there will not be two or more elements of set A pointing to the same element in set B. Conversely, no element in set B will be pointed to by more than 1 element in set A.
- An injective function is also called a one-to-one function.
- When you draw an injective function on a graph, for any value of y there will not be more than 1 value of x.

###### Learn with 28 Injective functions flashcards in the free StudySmarter app

We have **14,000 flashcards** about Dynamic Landscapes.

Already have an account? Log in

##### Frequently Asked Questions about Injective functions

What is injective function?

If a function that points from A to B is injective, it means that there will not be two or more elements of set A pointing to the same element in set B.

What are examples of injective functions?

f(x)=x, f(x)=x³

How to prove if a function is injective?

When you draw an injective function on a graph, for any value of y there will not be more than 1 value of x. So, given the graph of a function, if no horizontal line (parallel to the X-axis) intersects the curve at more than 1 point, we can conclude that the function is injective.

What is an injective hash function?

An injective hash function is also known as a perfect hash function. It is a function that maps keys from a set *S* to unique values.

Can a function be surjective but not injective?

A function can be surjective but not injective.

##### About StudySmarter

StudySmarter is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.

Learn more