Canonical: https://knowlpedia.com/shared-foundations/injective-function/

# Injective function

A function that never takes the same value on two different inputs

An **injective function** is a [function](https://knowlpedia.com/shared-foundations/function/) \(f:A\to B\) such that whenever \(f(a_1)=f(a_2)\), it follows that \(a_1=a_2\).

## Remarks

Injectivity means distinct elements of the [domain](https://knowlpedia.com/shared-foundations/domain/) remain distinct after applying \(f\). In terms of [cardinality](https://knowlpedia.com/shared-foundations/cardinality/), an injective function from \(A\) to \(B\) is evidence that \(A\) is “no larger than” \(B\).

## Examples

- The inclusion map \(i:S\to A\) of a [subset](https://knowlpedia.com/shared-foundations/subset/) is injective, since \(i(s)=i(s')\) implies \(s=s'\).
- The function \(f:\mathbb{Z}\to\mathbb{Z}\) given by \(f(n)=2n\) is injective, but it is not surjective onto \(\mathbb{Z}\).
