| Surjection. There is an arrow to every element in the codomain B from (at least) one element of the domain A. |
In mathematics, a surjective or onto function is a function f : A → B with the following property. For every element b in the codomain B, there is at least one element a in the domain A such that f(a)=b. This means that no element in the codomain is unmapped, and that the range and codomain of f are the same set.
The term surjection and the related terms injection and bijection were introduced by the group of mathematicians that called itself Nicholas Bourbaki. In the 1930s, this group of mathematicians published a series of books on modern advanced mathematics. The French prefix sur means above or onto and was chosen since a surjective function maps its domain on to its codomain.
| Not a surjection. No element in the domain A is mapped to the element {4} in the codomain B. |
Formally:
where the element is called the image of the element , and the element a pre-image of the element .
The formal definition can also be interpreted in two ways:
A pre-image does not have to be unique. In the top image, both {X} and {Y} are pre-images of the element {1}. It is only important that there be at least one pre-image.
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 numbers.)
Finding a pre-image xo for a given yo is equivalent to either question:
In mathematics, we can find exact (analytic) roots only of polynomials of first, second (and third) degree. We find roots of all other functions approximately (numerically). This means a formal proof of surjectivity is rarely direct. So the discussions below are informal.
Example: The linear function of a slanted line is onto. That is, y=ax+b where a≠0 is a surjection. (It is also an injection and thus a bijection.)
Example: The cubic polynomial (of third degree) f(x)=x3-3x is a surjection.
Example: The quadratic function f(x) = x2 is not a surjection. There is no x such that x2 = −1. The range of x² is [0,+∞) , that is, the set of non-negative numbers. (Also, this function is not an injection.)
Note: One can make a non-surjective function into a surjection by restricting its codomain to elements of its range. For example, the new function, fN(x):ℝ → [0,+∞) where fN(x) = x2 is a surjective function. (This is not the same as the restriction of a function which restricts the domain!)
Example: The exponential function f(x) = 10x is not a surjection. The range of 10x is (0,+∞), that is, the set of positive numbers. (This function is an injection.)
Example: The logarithmic function base 10 f(x):(0,+∞)→ℝ defined by f(x)=log(x) or y=log10(x) is a surjection (and an injection). (This is the inverse function of 10x.)
Example: The function f((x,y)):ℝ²→ℝ defined by z=y is a surjection. Its graph is a plane in 3-dimensional space. The pre-image of zo is the line y=zo in the x0y plane.