<s>
In	O
mathematics	O
,	O
a	O
surjective	B-Algorithm
function	I-Algorithm
(	O
also	O
known	O
as	O
surjection	B-Algorithm
,	O
or	O
onto	B-Algorithm
function	I-Algorithm
)	O
is	O
a	O
function	O
such	O
that	O
every	O
element	O
can	O
be	O
mapped	O
from	O
element	O
so	O
that	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
every	O
element	O
of	O
the	O
function	O
's	O
codomain	B-Algorithm
is	O
the	O
image	O
of	O
one	O
element	O
of	O
its	O
domain	B-Algorithm
.	O
</s>
<s>
The	O
term	O
surjective	B-Algorithm
and	O
the	O
related	O
terms	O
injective	O
and	O
bijective	B-Algorithm
were	O
introduced	O
by	O
Nicolas	O
Bourbaki	O
,	O
a	O
group	O
of	O
mainly	O
French	O
20th-century	O
mathematicians	O
who	O
,	O
under	O
this	O
pseudonym	O
,	O
wrote	O
a	O
series	O
of	O
books	O
presenting	O
an	O
exposition	O
of	O
modern	O
advanced	O
mathematics	O
,	O
beginning	O
in	O
1935	O
.	O
</s>
<s>
The	O
French	O
word	O
sur	O
means	O
over	O
or	O
above	O
,	O
and	O
relates	O
to	O
the	O
fact	O
that	O
the	O
image	O
of	O
the	O
domain	B-Algorithm
of	O
a	O
surjective	B-Algorithm
function	I-Algorithm
completely	O
covers	O
the	O
function	O
's	O
codomain	B-Algorithm
.	O
</s>
<s>
Any	O
function	O
induces	O
a	O
surjection	B-Algorithm
by	O
restricting	O
its	O
codomain	B-Algorithm
to	O
the	O
image	O
of	O
its	O
domain	B-Algorithm
.	O
</s>
<s>
Every	O
surjective	B-Algorithm
function	I-Algorithm
has	O
a	O
right	O
inverse	O
assuming	O
the	O
axiom	O
of	O
choice	O
,	O
and	O
every	O
function	O
with	O
a	O
right	O
inverse	O
is	O
necessarily	O
a	O
surjection	B-Algorithm
.	O
</s>
<s>
The	O
composition	B-Application
of	O
surjective	B-Algorithm
functions	I-Algorithm
is	O
always	O
surjective	B-Algorithm
.	O
</s>
<s>
Any	O
function	O
can	O
be	O
decomposed	O
into	O
a	O
surjection	B-Algorithm
and	O
an	O
injection	O
.	O
</s>
<s>
A	O
surjective	B-Algorithm
function	I-Algorithm
is	O
a	O
function	O
whose	O
image	O
is	O
equal	O
to	O
its	O
codomain	B-Algorithm
.	O
</s>
<s>
Equivalently	O
,	O
a	O
function	O
with	O
domain	B-Algorithm
and	O
codomain	B-Algorithm
is	O
surjective	B-Algorithm
if	O
for	O
every	O
in	O
there	O
exists	O
at	O
least	O
one	O
in	O
with	O
.	O
</s>
<s>
Surjections	B-Algorithm
are	O
sometimes	O
denoted	O
by	O
a	O
two-headed	O
rightwards	O
arrow	O
(	O
)	O
,	O
as	O
in	O
.	O
</s>
<s>
For	O
any	O
set	O
X	O
,	O
the	O
identity	O
function	O
idX	O
on	O
X	O
is	O
surjective	B-Algorithm
.	O
</s>
<s>
The	O
function	O
defined	O
by	O
f(n )	O
=	O
n	O
mod	O
2	O
(	O
that	O
is	O
,	O
even	O
integers	O
are	O
mapped	O
to	O
0	O
and	O
odd	O
integers	O
to	O
1	O
)	O
is	O
surjective	B-Algorithm
.	O
</s>
<s>
The	O
function	O
defined	O
by	O
f(x )	O
=	O
2x	O
+	O
1	O
is	O
surjective	B-Algorithm
(	O
and	O
even	O
bijective	B-Algorithm
)	O
,	O
because	O
for	O
every	O
real	O
number	O
y	O
,	O
we	O
have	O
an	O
x	O
such	O
that	O
f(x )	O
=	O
y	O
:	O
such	O
an	O
appropriate	O
x	O
is	O
(	O
y	O
−	O
1	O
)	O
/2	O
.	O
</s>
<s>
The	O
function	O
defined	O
by	O
f(x )	O
=	O
x3	O
−	O
3x	O
is	O
surjective	B-Algorithm
,	O
because	O
the	O
pre-image	O
of	O
any	O
real	O
number	O
y	O
is	O
the	O
solution	O
set	O
of	O
the	O
cubic	O
polynomial	O
equation	O
x3	O
−	O
3x	O
−	O
y	O
=	O
0	O
,	O
and	O
every	O
cubic	O
polynomial	O
with	O
real	O
coefficients	O
has	O
at	O
least	O
one	O
real	O
root	O
.	O
</s>
<s>
However	O
,	O
this	O
function	O
is	O
not	O
injective	O
(	O
and	O
hence	O
not	O
bijective	B-Algorithm
)	O
,	O
since	O
,	O
for	O
example	O
,	O
the	O
pre-image	O
of	O
y	O
=	O
2	O
is	O
{	O
x	O
=	O
−1	O
,	O
x	O
=	O
2}	O
.	O
</s>
<s>
The	O
function	O
defined	O
by	O
g(x )	O
=	O
x2	O
is	O
not	O
surjective	B-Algorithm
,	O
since	O
there	O
is	O
no	O
real	O
number	O
x	O
such	O
that	O
x2	O
=	O
−1	O
.	O
</s>
<s>
However	O
,	O
the	O
function	O
defined	O
by	O
(	O
with	O
the	O
restricted	O
codomain	B-Algorithm
)	O
is	O
surjective	B-Algorithm
,	O
since	O
for	O
every	O
y	O
in	O
the	O
nonnegative	O
real	O
codomain	B-Algorithm
Y	O
,	O
there	O
is	O
at	O
least	O
one	O
x	O
in	O
the	O
real	O
domain	B-Algorithm
X	O
such	O
that	O
x2	O
=	O
y	O
.	O
</s>
<s>
The	O
natural	O
logarithm	O
function	O
is	O
a	O
surjective	B-Algorithm
and	O
even	O
bijective	B-Algorithm
(	O
mapping	B-Algorithm
from	O
the	O
set	O
of	O
positive	O
real	O
numbers	O
to	O
the	O
set	O
of	O
all	O
real	O
numbers	O
)	O
.	O
</s>
<s>
Its	O
inverse	O
,	O
the	O
exponential	O
function	O
,	O
if	O
defined	O
with	O
the	O
set	O
of	O
real	O
numbers	O
as	O
the	O
domain	B-Algorithm
,	O
is	O
not	O
surjective	B-Algorithm
(	O
as	O
its	O
range	B-Algorithm
is	O
the	O
set	O
of	O
positive	O
real	O
numbers	O
)	O
.	O
</s>
<s>
The	O
matrix	O
exponential	O
is	O
not	O
surjective	B-Algorithm
when	O
seen	O
as	O
a	O
map	O
from	O
the	O
space	O
of	O
all	O
n×n	O
matrices	B-Architecture
to	O
itself	O
.	O
</s>
<s>
It	O
is	O
,	O
however	O
,	O
usually	O
defined	O
as	O
a	O
map	O
from	O
the	O
space	O
of	O
all	O
n×n	O
matrices	B-Architecture
to	O
the	O
general	O
linear	O
group	O
of	O
degree	O
n	O
(	O
that	O
is	O
,	O
the	O
group	O
of	O
all	O
n×n	O
invertible	O
matrices	B-Architecture
)	O
.	O
</s>
<s>
Under	O
this	O
definition	O
,	O
the	O
matrix	O
exponential	O
is	O
surjective	B-Algorithm
for	O
complex	O
matrices	B-Architecture
,	O
although	O
still	O
not	O
surjective	B-Algorithm
for	O
real	B-Architecture
matrices	I-Architecture
.	O
</s>
<s>
The	O
projection	O
from	O
a	O
cartesian	O
product	O
to	O
one	O
of	O
its	O
factors	O
is	O
surjective	B-Algorithm
,	O
unless	O
the	O
other	O
factor	O
is	O
empty	O
.	O
</s>
<s>
In	O
a	O
3D	O
video	O
game	O
,	O
vectors	O
are	O
projected	O
onto	O
a	O
2D	O
flat	O
screen	O
by	O
means	O
of	O
a	O
surjective	B-Algorithm
function	I-Algorithm
.	O
</s>
<s>
A	O
function	O
is	O
bijective	B-Algorithm
if	O
and	O
only	O
if	O
it	O
is	O
both	O
surjective	B-Algorithm
and	O
injective	O
.	O
</s>
<s>
If	O
(	O
as	O
is	O
often	O
done	O
)	O
a	O
function	O
is	O
identified	O
with	O
its	O
graph	B-Application
,	O
then	O
surjectivity	B-Algorithm
is	O
not	O
a	O
property	O
of	O
the	O
function	O
itself	O
,	O
but	O
rather	O
a	O
property	O
of	O
the	O
mapping	B-Algorithm
.	O
</s>
<s>
This	O
is	O
,	O
the	O
function	O
together	O
with	O
its	O
codomain	B-Algorithm
.	O
</s>
<s>
Unlike	O
injectivity	O
,	O
surjectivity	B-Algorithm
cannot	O
be	O
read	O
off	O
of	O
the	O
graph	B-Application
of	O
the	O
function	O
alone	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
g	O
is	O
a	O
right	O
inverse	O
of	O
f	O
if	O
the	O
composition	B-Application
of	O
g	O
and	O
f	O
in	O
that	O
order	O
is	O
the	O
identity	O
function	O
on	O
the	O
domain	B-Algorithm
Y	O
of	O
g	O
.	O
The	O
function	O
g	O
need	O
not	O
be	O
a	O
complete	O
inverse	O
of	O
f	O
because	O
the	O
composition	B-Application
in	O
the	O
other	O
order	O
,	O
,	O
may	O
not	O
be	O
the	O
identity	O
function	O
on	O
the	O
domain	B-Algorithm
X	O
of	O
f	O
.	O
In	O
other	O
words	O
,	O
f	O
can	O
undo	O
or	O
"	O
reverse	O
"	O
g	O
,	O
but	O
cannot	O
necessarily	O
be	O
reversed	O
by	O
it	O
.	O
</s>
<s>
Every	O
function	O
with	O
a	O
right	O
inverse	O
is	O
necessarily	O
a	O
surjection	B-Algorithm
.	O
</s>
<s>
The	O
proposition	O
that	O
every	O
surjective	B-Algorithm
function	I-Algorithm
has	O
a	O
right	O
inverse	O
is	O
equivalent	O
to	O
the	O
axiom	O
of	O
choice	O
.	O
</s>
<s>
If	O
is	O
surjective	B-Algorithm
and	O
B	O
is	O
a	O
subset	O
of	O
Y	O
,	O
then	O
f( f	O
−	O
1(B )	O
)	O
=	O
B	O
.	O
</s>
<s>
A	O
function	O
is	O
surjective	B-Algorithm
if	O
and	O
only	O
if	O
it	O
is	O
right-cancellative	O
:	O
given	O
any	O
functions	O
,	O
whenever	O
g	O
o	O
f	O
=	O
h	O
o	O
f	O
,	O
then	O
g	O
=	O
h	O
.	O
This	O
property	O
is	O
formulated	O
in	O
terms	O
of	O
functions	O
and	O
their	O
composition	B-Application
and	O
can	O
be	O
generalized	O
to	O
the	O
more	O
general	O
notion	O
of	O
the	O
morphisms	O
of	O
a	O
category	O
and	O
their	O
composition	B-Application
.	O
</s>
<s>
Specifically	O
,	O
surjective	B-Algorithm
functions	I-Algorithm
are	O
precisely	O
the	O
epimorphisms	O
in	O
the	O
category	O
of	O
sets	O
.	O
</s>
<s>
Any	O
function	O
with	O
domain	B-Algorithm
X	O
and	O
codomain	B-Algorithm
Y	O
can	O
be	O
seen	O
as	O
a	O
left-total	O
and	O
right-unique	O
binary	O
relation	O
between	O
X	O
and	O
Y	O
by	O
identifying	O
it	O
with	O
its	O
function	B-Application
graph	I-Application
.	O
</s>
<s>
A	O
surjective	B-Algorithm
function	I-Algorithm
with	O
domain	B-Algorithm
X	O
and	O
codomain	B-Algorithm
Y	O
is	O
then	O
a	O
binary	O
relation	O
between	O
X	O
and	O
Y	O
that	O
is	O
right-unique	O
and	O
both	O
left-total	O
and	O
right-total	O
.	O
</s>
<s>
The	O
cardinality	B-Application
of	O
the	O
domain	B-Algorithm
of	O
a	O
surjective	B-Algorithm
function	I-Algorithm
is	O
greater	O
than	O
or	O
equal	O
to	O
the	O
cardinality	B-Application
of	O
its	O
codomain	B-Algorithm
:	O
If	O
is	O
a	O
surjective	B-Algorithm
function	I-Algorithm
,	O
then	O
X	O
has	O
at	O
least	O
as	O
many	O
elements	O
as	O
Y	O
,	O
in	O
the	O
sense	O
of	O
cardinal	O
numbers	O
.	O
</s>
<s>
Specifically	O
,	O
if	O
both	O
X	O
and	O
Y	O
are	O
finite	O
with	O
the	O
same	O
number	O
of	O
elements	O
,	O
then	O
is	O
surjective	B-Algorithm
if	O
and	O
only	O
if	O
f	O
is	O
injective	O
.	O
</s>
<s>
Given	O
two	O
sets	O
X	O
and	O
Y	O
,	O
the	O
notation	O
is	O
used	O
to	O
say	O
that	O
either	O
X	O
is	O
empty	O
or	O
that	O
there	O
is	O
a	O
surjection	B-Algorithm
from	O
Y	O
onto	O
X	O
.	O
</s>
<s>
The	O
composition	B-Application
of	O
surjective	B-Algorithm
functions	I-Algorithm
is	O
always	O
surjective	B-Algorithm
:	O
If	O
f	O
and	O
g	O
are	O
both	O
surjective	B-Algorithm
,	O
and	O
the	O
codomain	B-Algorithm
of	O
g	O
is	O
equal	O
to	O
the	O
domain	B-Algorithm
of	O
f	O
,	O
then	O
is	O
surjective	B-Algorithm
.	O
</s>
<s>
Conversely	O
,	O
if	O
is	O
surjective	B-Algorithm
,	O
then	O
f	O
is	O
surjective	B-Algorithm
(	O
but	O
g	O
,	O
the	O
function	O
applied	O
first	O
,	O
need	O
not	O
be	O
)	O
.	O
</s>
<s>
These	O
properties	O
generalize	O
from	O
surjections	B-Algorithm
in	O
the	O
category	O
of	O
sets	O
to	O
any	O
epimorphisms	O
in	O
any	O
category	O
.	O
</s>
<s>
Any	O
function	O
can	O
be	O
decomposed	O
into	O
a	O
surjection	B-Algorithm
and	O
an	O
injection	O
:	O
For	O
any	O
function	O
there	O
exist	O
a	O
surjection	B-Algorithm
and	O
an	O
injection	O
such	O
that	O
h	O
=	O
g	O
o	O
f	O
.	O
To	O
see	O
this	O
,	O
define	O
Y	O
to	O
be	O
the	O
set	O
of	O
preimages	O
where	O
z	O
is	O
in	O
.	O
</s>
<s>
These	O
preimages	O
are	O
disjoint	B-Algorithm
and	O
partition	O
X	O
.	O
</s>
<s>
Then	O
f	O
is	O
surjective	B-Algorithm
since	O
it	O
is	O
a	O
projection	O
map	O
,	O
and	O
g	O
is	O
injective	O
by	O
definition	O
.	O
</s>
<s>
Any	O
function	O
induces	O
a	O
surjection	B-Algorithm
by	O
restricting	O
its	O
codomain	B-Algorithm
to	O
its	O
range	B-Algorithm
.	O
</s>
<s>
Any	O
surjective	B-Algorithm
function	I-Algorithm
induces	O
a	O
bijection	B-Algorithm
defined	O
on	O
a	O
quotient	O
of	O
its	O
domain	B-Algorithm
by	O
collapsing	O
all	O
arguments	O
mapping	B-Algorithm
to	O
a	O
given	O
fixed	O
image	O
.	O
</s>
<s>
More	O
precisely	O
,	O
every	O
surjection	B-Algorithm
can	O
be	O
factored	O
as	O
a	O
projection	O
followed	O
by	O
a	O
bijection	B-Algorithm
as	O
follows	O
.	O
</s>
<s>
Given	O
fixed	O
and	O
,	O
one	O
can	O
form	O
the	O
set	O
of	O
surjections	B-Algorithm
.	O
</s>
<s>
The	O
cardinality	B-Application
of	O
this	O
set	O
is	O
one	O
of	O
the	O
twelve	O
aspects	O
of	O
Rota	O
's	O
Twelvefold	B-Algorithm
way	I-Algorithm
,	O
and	O
is	O
given	O
by	O
,	O
where	O
denotes	O
a	O
Stirling	O
number	O
of	O
the	O
second	O
kind	O
.	O
</s>
