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.
Proposition 7.1. Let The functionf WR ! R by f .x/ D mx C b for all x in R is a bijection.
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 mx1C b D
mx2C b. We can then subtract b from both sides of this equation and then divide
both sides by m since m ¤ 0 as follows:
mx1C b D mx2C b
mx1 D mx2
x1 D x2
So we have proved that for all x1; x2 2 R, if f .x1/ D f .x2/, then x1 D x2, and
hence, f is an injection.
To prove that f is a surjection, we choose a real number y in the codomain of f. We need to prove that there exists an x 2 R such that f .x/ D y. Working backward, we see that if mx C b D y, then x D y b
m (since m ¤ 0). We see that x 2 R (the domain of f ) since the real numbers are closed under subtraction and
Chapter 7. Injective and Surjective Functions 43
division by nonzero real numbers. This is done as follows:
f .x/ D f ymb D m ymb C b D .y b/ C b D b
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.
Example 7.2(The Importance of the Domain and Codomain)
Each of the following functions will have the same rule for computing the out- puts corresponding to a given input. However, they will have different domains or different codomains.
1. A Function that Is Neither an Injection nor a Surjection Let f WR ! R be defined by f .x/ D x2C 1. Notice that
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 x2C 1, we know that f .x/ 1 for all x 2 R. This implies that the function f is not a surjection. For example, 2is in the codomain of f and f .x/ ¤ 2 for all x in the domain of f.
2. A Function that Is Not an Injection but Is a Surjection]
Let T D fy 2 R j y 1g, and define F W R ! T by F .x/ D x2C 1. As in Example 1, the function F is not an injection since F .2/ D F . 2/ D 5. Is the function F a surjection? That is, does F map R onto T ? As in Example 1, we do know that F .x/ 1 for all x 2 R.
44 Chapter 7. Injective and Surjective Functions
To see if it is a surjection, we must determine if it is true that for every y 2 T , there exists an x 2 R such that F .x/ D y. So we choose y 2 T. The goal is to determine if there exists an x 2 R such that
F .x/ D y, or x2C 1 D y:
One way to proceed is to work backward and solve the last equation (if possible) for x. Doing so, we get
x2 D y 1
x Dpy 1or x D py 1:
Now, since y 2 T , we know that y 1 and hence that y 1 0. This means thatpy 1 2 R. Hence, if we use x Dpy 1, then x 2 R, and
F .x/ D F py 1 Dpy 12C 1 D .y 1/ C 1 D y:
This proves that F is a surjection since we have shown that for all y 2 T, there exists an x 2 R such that F .x/ D y. Notice that for each y 2 T, this was a constructive proof of the existence of an x 2 R such that F .x/ D y.
An Important Lesson. In Examples 1 and 2, the same mathematical formula was used to determine the outputs for the functions. However, one function was not a surjection and the other one was a surjection. This illustrates the important fact that whether a function is surjective not only depends on the formula that defines the output of the function but also on the domain and codomain of the function.
3. A Function that Is an Injection but Is Not a Surjection] Let Z
D fx 2 Z j x 0g D N[f0g. Define g WZ
! N by g.x/ D x2C1. (Notice that this is the same formula used in Examples 1 and 2.) Following is a table of values for some inputs for the function g.
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 gis 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
x2C 1 D 3 x2 D 2
x D ˙p2:
But this is not possible sincep2 … Z
. Therefore, there is no x 2 Zwith
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
s2C 1 D t2C 1 s2 D t2:
Since s; t 2 Z
, we know that s 0 and t 0. So the preceding equation implies that s D t. Hence, g is an injection.
An Important Lesson. The functions in the three preceding examples all used the same formula to determine the outputs. The functions in Examples 1 and 2 are not injections but the function in Example 3 is an injection. This illustrates the important fact that whether a function is injective not only de- pends on the formula that defines the output of the function but also on the domain of the function.
46 Chapter 7. Injective and Surjective Functions