Injective function

|||
| --- | --- |
|width="210"|**Injection**. Maximum one arrow to each element in the codomain B (from an element in domain A).|

In mathematics, a **injective** function is a function _f_ : _A_ → _B_ with the following property: for every element _b_ in the codomain _B_, there is **at most** one element _a_ in the domain _A_ such that _f_(_a_)=_b_, or equivalently, distinct elements in the domain map to distinct elements in the codomain.

The term _injection_ and the related terms _surjection_ and _bijection_ were introduced by Nicholas Bourbaki. In the 1930s, he and a group of other mathematicians published a series of books on modern advanced mathematics.

An injective function is often called a **1-1** (read "one-to-one") function. However, this is to be distinguished from a **1-1 correspondence**, which is a bijective function (both injective and surjective).

|||
| --- | --- |
|width="210"|**Not an injection**. Two elements {X} and {Y} in the domain A are mapped to the same element {1} in the codomain B.|

## Basic properties

Formally:
-   is an injective function if     or equivalently
-   is an injective function if  
The element  is called a **pre-image** of the element  if  . Injections have one or none pre-images for every element _b_ in _B_.

## Cardinality

Cardinality is the _number_ of elements in a set. The cardinality of _A_={X,Y,Z,W} is 4. This is written as #_A_=4.

If the cardinality of the codomain is less than the cardinality of the domain, then the function cannot be an injection. For example, there is no injection from 6 elements to 5 elements, since it is impossible to map 6 elements to 5 elements without a duplicate.

### Elementary functions

Let _f_(_x_):ℝ→ℝ be a real-valued function _y_=_f_(_x_) of a real-valued argument _x_. (This means both the input and output are real numbers.)
- **Graphic meaning**: The function _f_ is an injection if every horizontal line intersects the graph of _f_ in **at most** one point.
- **Algebraic meaning**: The function _f_ is an injection if _f_(_x_<sub>o</sub>)=_f_(_x_<sub>1</sub>) means _x_<sub>o</sub>=_x_<sub>1</sub>.

**Example:** The linear function of a slanted line is 1-1. That is, _y_=_ax_+_b_ where _a_≠0 is an injection. (It is also a surjection and thus a bijection.)
- Proof: Let _x_<sub>o</sub> and _x_<sub>1</sub> be real numbers. Suppose the line maps these two _x_-values to the same _y_-value.  This means _a_·_x_<sub>o</sub>+_b_=_a_·_x_<sub>1</sub>+_b_. Subtract _b_ from both sides. We get _a_·_x_<sub>o</sub>=_a_·_x_<sub>1</sub>. Now divide both sides by _a_ (remember _a_≠0).  We get _x_<sub>o</sub>=_x_<sub>1</sub>. So we have proved the formal definition and the function _y_=_ax_+_b_ where _a_≠0 is an injection.

**Example:** The polynomial function of third degree: _f_(_x_)=_x_<sup>3</sup> is an injection. However, the polynomial function of third degree: _f_(_x_)=_x_<sup>3</sup> –3x is not an injection.
- Discussion 1: Any horizontal line intersects the graph of _f_(_x_)=_x_<sup>3</sup> exactly once. (Also, it is a surjection.)
- Discussion 2. Any horizontal line between _y_=-2 and _y_=2 intersects the graph in three points so this function is **not** an injection. (However, it is a surjection.)

**Example:** The quadratic function _f_(_x_) = _x_<sup>2</sup> is **not** an injection.
- Discussion: Any horizontal line _y_=c where c>0 intersects the graph in two points. So this function is **not** an injection. (Also, it is not a surjection.)

Note: One can make a non-injective function into an injective function by eliminating part of the domain. We call this **restricting** the domain. For example, restrict the domain of _f_(_x_)=_x_² to non-negative numbers (positive numbers and zero). Define
-   where  
This function is now an injection. (See also restriction of a function.)

**Example:** The exponential function _f_(_x_) = 10<sup>_x_</sup> is an injection. (However, it is not a surjection.)
- Discussion: Any horizontal line intersects the graph in at most one point. The horizontal lines _y_=c where c>0 cut it in exactly one point. The horizontal lines _y_=c where c≤0 do not cut the graph at any point.

Note: The fact that an exponential function is injective can be used in calculations.
-  
- Example:

|colspan=3|Injection: no horizontal line intersects more than one point of the graph|||||
| --- | --- | --- | --- | --- | --- |
|width="230"|<hr /> Injection. _f_(_x_):ℝ→ℝ (and surjection)|width="230"|<hr /> Injection. _f_(_x_):ℝ→ℝ (and surjection)|width="230"|<hr /> Not an injection. _f_(_x_):ℝ→ℝ (is surjection)|
|width="230"|<hr /> Not an injection. _f_(_x_):ℝ→ℝ (not surjection)|width="230"|<hr />Injection. _f_(_x_):ℝ→ℝ (not surjection)|width="230"|<hr />Injection. _f_(_x_):(0,+∞)→ℝ (and surjection)|

### Other examples

**Example:** The **logarithmic function base 10**  _f_(_x_):→ℝ defined by _f_(_x_)=log(_x_) or _y_=log<sub>10</sub>(_x_) is an injection (and a surjection). (This is the inverse function of 10<sup>_x_</sup>.)

**Example:** The function _f_:ℕ→ℕ that maps every natural number _n_ to _2n_ is an injection. Every even number has exactly one pre-image. Every odd number has no pre-image.

## Related pages

- Function (mathematics)
- Surjective function
- Bijective function

## Other websites

- interactive quiz
- interactive