# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/function-composition-inverse-function/injective-surjective-bijective-function
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/function-composition-inverse-function/injective-surjective-bijective-function/en.mdx

Learn one-to-one, onto, and bijective function types with clear examples. Understand mapping properties and inverse function requirements.

---

## Understanding Function Mapping Properties

In mathematics, functions map elements from one set (the domain) to another set (the codomain). This mapping can be classified into several types based on how domain and codomain elements are connected. The three main types are injective, surjective, and bijective functions.

Let's assume we have a function $$f: X \to Y$$.

Visible text: Let's assume we have a function .

## Injective Function (One-to-One)

A function is called **injective** or **one-to-one** if every distinct element in the domain $$X$$ maps to a distinct element in the codomain $$Y$$. In other words, no two different domain elements can have the same image (output) in the codomain.

Visible text: A function is called **injective** or **one-to-one** if every distinct element in the domain maps to a distinct element in the codomain . In other words, no two different domain elements can have the same image (output) in the codomain.

**Formal Definition:**

A function $$f: X \to Y$$ is injective if for every $$x_1, x_2 \in X$$, the following holds:

Visible text: A function is injective if for every , the following holds:

```math
f(x_1) = f(x_2) \implies x_1 = x_2
```

Or, equivalently (using the contrapositive):

```math
x_1 \neq x_2 \implies f(x_1) \neq f(x_2)
```

Imagine every student in one school (domain) must have a unique student ID number (codomain). No two students can have the same ID number. The mapping function from students to ID numbers is an injective function.

**Examples:**

- The function $$f(x) = 2x$$ for $$x \in \mathbb{R}$$ is injective, because every distinct value of $$x$$ will produce a distinct $$2x$$.
- The function $$g(x) = x^2$$ for $$x \in \mathbb{R}$$ is **not** injective, because $$g(2) = 4$$ and $$g(-2) = 4$$. There are two different inputs ($$2$$ and $$-2$$) that produce the same output ($$4$$).

Visible text: - The function for is injective, because every distinct value of will produce a distinct .
- The function for is **not** injective, because and . There are two different inputs ( and ) that produce the same output ().

## Surjective Function (Onto)

A function is called **surjective** or **onto** if every element in the codomain $$Y$$ is the image of **at least one** element in the domain $$X$$. In other words, there are no "unreachable" elements in the codomain that don't have a corresponding element in the domain. The range of a surjective function is equal to its codomain.

Visible text: A function is called **surjective** or **onto** if every element in the codomain is the image of **at least one** element in the domain . In other words, there are no "unreachable" elements in the codomain that don't have a corresponding element in the domain. The range of a surjective function is equal to its codomain.

**Formal Definition:**

A function $$f: X \to Y$$ is surjective if for every $$y \in Y$$, there exists **at least one** $$x \in X$$ such that:

Visible text: A function is surjective if for every , there exists **at least one** such that:

```math
f(x) = y
```

Imagine every seat in a movie theater (codomain) must be occupied by at least one audience member (domain) when the movie starts. The mapping function from audience members to seats is surjective if all seats are filled.

**Examples:**

- The function $$f(x) = x^3$$ from $$\mathbb{R} \to \mathbb{R}$$ is surjective, because every real number $$y$$ in the codomain is the cube of some real number $$x$$ (specifically, $$x = \sqrt[3]{y}$$).
- The function $$g(x) = x^2$$ from $$\mathbb{R} \to \mathbb{R}$$ is **not** surjective, because there is no real number $$x$$ that yields $$g(x) = -1$$ (or any other negative number). Negative elements in the codomain have no corresponding element in the domain.
- However, if we restrict the codomain to $$g(x) = x^2$$ from $$\mathbb{R} \to [0, \infty)$$ (non-negative real numbers), then this function becomes surjective.

Visible text: - The function from is surjective, because every real number in the codomain is the cube of some real number (specifically, ).
- The function from is **not** surjective, because there is no real number that yields (or any other negative number). Negative elements in the codomain have no corresponding element in the domain.
- However, if we restrict the codomain to from (non-negative real numbers), then this function becomes surjective.

## Bijective Function (One-to-One Correspondence)

A function is called **bijective** if it is both **injective and surjective**. This means that every element in the domain maps to a unique element in the codomain, and every element in the codomain has exactly one corresponding element in the domain.

A bijective function creates a perfect **one-to-one correspondence** between the elements of the domain and the codomain.

**Formal Definition:**

A function $$f: X \to Y$$ is bijective if for every $$y \in Y$$, there exists **exactly one** $$x \in X$$ such that:

Visible text: A function is bijective if for every , there exists **exactly one** such that:

```math
f(x) = y
```

Imagine two groups with the same number of members. Each member of the first group is paired with exactly one member of the second group, and each member of the second group also has exactly one partner. A mapping like this is bijective.

**Important:** A function can only have an **inverse function** if it is **bijective**.

**Examples:**

- The function $$f(x) = 2x$$ from $$\mathbb{R} \to \mathbb{R}$$ is bijective (injective and surjective).
- The function $$f(x) = x^3$$ from $$\mathbb{R} \to \mathbb{R}$$ is bijective (injective and surjective).
- The function $$g(x) = x^2$$ from $$\mathbb{R} \to \mathbb{R}$$ is not bijective (neither injective nor surjective).
- The function $$h(x) = e^x$$ from $$\mathbb{R} \to \mathbb{R}$$ is not bijective (injective but not surjective).
- The function $$k(x) = x^3 - x$$ from $$\mathbb{R} \to \mathbb{R}$$ is not bijective (surjective but not injective).

Visible text: - The function from is bijective (injective and surjective).
- The function from is bijective (injective and surjective).
- The function from is not bijective (neither injective nor surjective).
- The function from is not bijective (injective but not surjective).
- The function from is not bijective (surjective but not injective).