In mathematics, an
injective function is a function that preserves distinctness: it never maps distinct elements of its domain to the same element of its codomain. In other words, every element of the function's codomain is mapped to by at most one element of its domain.


An injective function (is not a bijection)


Another injective function (is a bijection)


A non-injective function (this one happens to be a surjection)
If in addition all of the elements in the codomain are in fact mapped to by some element of the domain, then the function is said to be
bijective A
bijection (or bijective function or one-to-one correspondence) is the formal name given to an exact pairing of the elements of a set X with the elements of a set Y.


A bijective function, f:X→Y, where set X is {1, 2, 3, 4} and set Y is {A, B, C, D}. For example, f(1) = D.
In mathematics, a function f from a set X to a set Y is
surjective (or onto), or a surjection, if for every y in Y, there is an x in X with f(x) = y; that is, each element of Y can be obtained by applying f to some element of X. (There might be multiple elements of X that are turned into the same element of Y by applying f.)
The French prefix sur means over or above and relates to the fact that the image of the domain of a surjective function completely covers the function's codomain.


A surjective function from domain X to codomain Y. The function is surjective because every point in the codomain is the value of f(x) for at least one point x in the domain.