A function *f*:**A** → **B** is surjective [or onto]
if for every element `b` of the set **B**, there is an element `a`
in the set **A** such that *f*(`a`) = `b`. Compare with
partial function.

The interesting thing about surjectivity is that the range of the function [in
the example *f*:**A** → **B**, the range is **B**] is
considered to be part of the definition of the function. This is not always immediately
obvious. For example, the function sin:ℜ → ℜ [where ℜ is the
set of real numbers] is *not* surjective, but the function sin:ℜ →
{x : (x ∈ ℜ) ∧ (x ≥ -1) ∧ (x ≤ 1)} *is* surjective. In
general, for every function *f*, there is another function *g* which
is identical except the range is limited to the actual results of the function, and so is
essentially the same function but is always surjective.