07 Injective and Surjective Functions
07 Injective and Surjective Functions
This chapter does not discuss a proof technique but applies some of the proof tech-
niques from earlier in the book to propositions and problems dealing with func-
tions, in particular, injections and surjections. These are concepts that some stu-
dents struggle with when they first study them in an introduction to proofs course.
So we give a few examples of such proofs in this chapter.
To understand the proofs discussed in this chapter, we need to understand func-
tions and the definitions of an injection (one-to-one function) and a surjection (onto
function). It is assumed that students have studied these concepts before, but the
definitions are stated below for reference.
39
40 Chapter 7. Injective and Surjective Functions
Notice that this means that range.f / codom.f / but does not necessarily mean
that range.f / D codom.f /. Whether we have this set equality or not depends on
the function f .
Notice that the condition that specifies that a function f is an injection is given
in the form of a conditional statement. As we shall see, in proofs, it is usually
easier to use the contrapositive of this conditional statement.
Chapter 7. Injective and Surjective Functions 41
Let f W A ! B.
Let f W A ! B.
range.f / D codom.f / D B; or
range.f / ¤ codom.f /; or
Many of us have probably heard in precalculus and calculus courses that a linear
function is a bijection. We prove this in the following proposition, but notice how
careful we are with stating the domain and codomain of the function.
Proof. We let m be a nonzero real number and let b be a real number and define
f W R ! R by f .x/ D mx C b for all x in R. We will prove that f is a bijection
by proving it is both an injection and a surjection.
To prove that f is an injection, we let x1 and x2 be real numbers (hence, in
the domain of f ) and assume that f .x1 / D f .x2 /. This means that mx1 C b D
mx2 C b. We can then subtract b from both sides of this equation and then divide
both sides by m since m ¤ 0 as follows:
mx1 C b D mx2 C b
mx1 D mx2
x1 D x2
This proves that for each y 2 R, there exists an x 2 R such that f .x/ D y, and
hence, f is a surjection.
Since we have proved that f is both an injection and a surjection, we have
proved that f is a bijection.
We will now discuss some examples of functions that will illustrate why the
domain and the codomain of a function are just as important as the rule defining
the outputs of a function when we need to determine if the function is an injection
or a surjection.
f .2/ D 5 and f . 2/ D 5:
This is enough to prove that the function f is not an injection since this
shows that there exist two different inputs that produce the same output.
Since f .x/ D x 2 C 1, we know that f .x/ 1 for all x 2 R. This implies
that the function f is not a surjection. For example, 2 is in the codomain
of f and f .x/ ¤ 2 for all x in the domain of f.
x g.x/ x g.x/
0 1 3 10
1 2 4 17
2 5 5 26
Chapter 7. Injective and Surjective Functions 45
Notice that the codomain is N, and the table of values suggests that some nat-
ural numbers are not outputs of this function. So it appears that the function
g is not a surjection.
To prove that g is not a surjection, pick an element of N that does not appear
to be in the range. We will use 3, and we will use a proof by contradiction
to prove that there is no x in the domain .Z / such that g.x/ D 3. So we
assume that there exists an x 2 Z with g.x/ D 3. Then
x2 C 1 D 3
x2 D 2
p
x D ˙ 2:
p
But this is not possible since 2 … Z . Therefore, there is no x 2 Z with
g.x/ D 3. This means that for every x 2 Z , g.x/ ¤ 3. Therefore, 3 is not
in the range of g, and hence g is not a surjection.
The table of values suggests that different inputs produce different outputs,
and hence that g is an injection. To prove that g is an injection, assume that
s; t 2 Z (the domain) with g.s/ D g.t /. Then
s2 C 1 D t 2 C 1
s2 D t 2 :
3. Let s be the function that associates with each natural number the sum of
its distinct natural number divisors. This is called the sum of the divisors
function. For example, the natural number divisors of 6 are 1, 2, 3, and 6,
and so
s.6/ D 1 C 2 C 3 C 6
D 12:
(a) Calculate s.k/ for each natural number k from 1 through 15.
(b) Is the sum of the divisors function an injection? Is it a surjection?
Justify your conclusions.