# Surjective function

<https://en.wikipedia.org/wiki/Surjective_function>

A function `f` from a set `X` to a set `Y` is a **surjective function** (also known as *onto* or a *surjection*), if for every element `y` in the codomain `Y` of `f`, there is at least one element `x` in the domain `X` of `f` such that `f(x) = y`. It is not required that `x` be unique; the function `f` may map one or more elements of `X` to the same element of `Y`.

dom >= cod = ran

* A mapping `f: A -> B` that has the existence property "for each element `b` of `B` there is an element `x` of `A` for which `b = f(x)`" is called a **surjective** or **onto** mapping.
* Informally, mapping is surjective if all elements in the codomain are involved in the mapping, but some elements are double-mapped. If no element in B were double-mapped, then the mapping would be injective; and since the entire codomain is involoved, the mapping would have been bijective (one-to-one and onto).
* Surjective mapping means that the codomain and the range of `f` are equal, `cod(f) = ran(f)`.
* Surjective mapping means that the domain is larger then the codomain (or range), `dom(f) > cod(f)`, since some elements in B are double-mapped.
* dom(f) : cod(f) : ran(f)
  * dom(f) > cod(f)
  * cod(f) = ran(f)
  * dom(f) > ran(f)
* Surjection is not invertable since some elements in the codomain are double mapped. Surjection irreversably collapses the domain into the range.
