Skip to main content

Section 7.2 Some Examples and Proofs

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 f(x)=mx+b be a nonzero real number and let b be a real number and define f:RR by f(x)=mx+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)=f(x2). This means that mx1+b=mx2+b. We can then subtract b from both sides of this equation and then divide both sides by m since m0 as follows:

mx1+b=mx2+bmx1=mx2x1=x2

So we have proved that for all x1,x2R, if f(x1)=f(x2), then x1=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 xR such that f(x)=y. Working backward, we see that if mx+b=y, then x=ybm (since m0). We see that xR (the domain of f ) since the real numbers are closed under subtraction and division by nonzero real numbers. This is done as follows:

f(x)=f(ybm)=m(ybm)+b=(yb)+b=b

This proves that for each yR, there exists an xR such that f(x)=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 outputs corresponding to a given input. However, they will have different domains or different codomains.

(a) A Function that Is Neither an Injection nor a Surjection.

Let f:RR be defined by f(x)=x2+1. Notice that

f(2=5) and f(2)=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)=x2+1, we know that f(x)1 for all xR. 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.

(b) A Function that Is Not an Injection but Is a Surjection.

Let T={yR|y1}, and define F:RT by F(x)=x2+1. As in Task 7.2.a, the function F is not an injection since F(2)=F(2)=5.

Is the function F a surjection? That is, does F map R onto T? As in Task 7.2.a, we do know that F(x)1 for all xR.

To see if it is a surjection, we must determine if it is true that for every yT, there exists an xR such that F(x)=y. So we choose yT. The goal is to determine if there exists an xR such that

F(x)=y, orx2+1=y.

One way to proceed is to work backward and solve the last equation (if possible) for x. Doing so, we get

x2=y1x=y1 or x=y1

Now, since yT, we know that y1 and hence thaty10. This means that y1R. Hence, if we use x=y1, then xR, and

F(x)=F(y1)=(y1)2+1=(y1)+1=y

This proves that F is a surjection since we have shown that for all yT, there exists an xR such that F(x)=y. Notice that for each yT, this was a constructive proof of the existence of an xR such that F(x)=y.

An Important Lesson. In Task 7.2.a and Task 7.2.b, 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.

(c) A Function that Is an Injection but Is Not a Surjection.

Let Z={xZ|x0}=N{0}. Define g:ZN by g(x)=x2+1. (Notice that this is the same formula used in Task 7.2.a and Task 7.2.b.) Following is a table of values for some inputs for the function g.

x g(x)
0 1
1 2
2 5
3 10
4 17
5 26

Notice that the codomain is N, and the table of values suggests that some natural 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)=3. So we assume that there exists an xZ with g(x)=3. Then

x2+1=3x2=2x=±2

But this is not possible since 2Z. Therefore, there is no xZ with g(x)=3. This means that for every xZ, 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,tZ (the domain) with g(s)=g(t). Then

s2+1=t2+1s2=t2.

Since s,tZ, we know that s0 and t0. So the preceding equation implies that s=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 Task 7.2.a and Task 7.2.b are not injections but the function in Task 7.2.c is an injection. This illustrates the important fact that whether a function is injective not only depends on the formula that defines the output of the function but also on the domain of the function.