A function is surjective, or "onto", if for all
, there exists at least one
such that
; that is, every element in the codomain is mapped to by at least one element in the domain.
Examples:
- Let
and
, and let
such that
,
,
,
, and
. Each element of
is mapped to by at least one element of
, so
is surjective.
- For the same
and
as in the previous example, let
be a function such that
,
,
,
, and
. This is not a surjective function since there are elements in the codomain that are not mapped to by any elements of the domain.
- Let
. For every
, there exists
such that
. So,
is a surjective function.
- Let
.
is in the codomain, but there is no
such that
. Thus,
is not surjective.
Resources