Surjection
In mathematics, a surjective function (or onto function or surjection) is a function with the property that all possible output values of the function are generated when the input ranges over all the values in the domain.More formally, a function f: X → Y is surjective if, for every y in the codomain Y, there is at least one x in the domain X with f(x) = y. Put another way, f is surjective if its range f(X) is equal to the codomain Y, or equivalently, if every element in the codomain has a preimage.
![]() Surjective, not injective |
![]() Injective, not surjective |
![]() Bijective |
![]() Not surjective, not injective |
| Table of contents |
|
2 Properties 3 See also |
On the other hand, the function g: R → R defined by g(x) = x2 is not surjective, because (for example) there is no real number x such that x2 = −1.
However, if we define the function h: R → [0, ∞) by the same formula as g, but with the codomain restricted to only the nonnegative real numbers, then the function h is surjective.
This is because, given an arbitrary nonnegative real number y, we can solve y = x2 to get solutions x = √y and x = −√y.
Examples and counterexamples
Properties
See also



