5  Functions

In this chapter we explore the concept of a mathematical function. Undoubtedly, functions have been prevalent in your previous mathematical experiences. You may have spent a lot of time working with functions given by an explicit formula, such as image. In this chapter we develop a broader understanding of functions, presenting a commonly used and intuitive (but incomplete) definition in Section 5.1, followed by a variety of related terminology and concepts, and then a rigorous definition in Section 5.5.

5.1.  What is a Function?

The notion of a function is broader than numerical functions that are given by explicit formulas.

DEFINITION 5.1 (Initial Version).    Let A and B be sets. A function from A to B is a rule that assigns to each image a unique associated element image.

There are two standard ways to represent “f is a function from A to B.” One is to write

image

and the other is

image

Both notations are supposed to indicate that the function f takes an input element image and outputs an element image, and we express this by writing image. In the sections that follow, you will often read statements like “Let image.” This is a short but complete sentence stating that f is a function from A to B.

For example, consider the function g defined in a piecewise fashion for real numbers x:

image

The formulas image and image both give real numbers if x is a real number, so we could use the notation image or image because both A and B equal image. As another example, you might have encountered parametric curves which trace out patterns in the plane. One of these gives a circle parametrized by

image

as illustrated in Figure 1. Here the input is a real number image and the output is a point image, so we write image or image.

image

Figure 1. The image of the function image is a circle.

Exercise 5.1   Define two functions from image to image.

The examples in this section emphasize that functions are not restricted to inputs and outputs involving real numbers. In particular, many functions do not have natural graphical representations. As a first example, we can construct a function f from image to the set image. We use the rule image when n is an even integer and image when n is odd, so

image

Formal languages are collections of strings of characters from a given alphabet. A particular example is the set of binary strings, consisting of all finite strings of 0s and 1s, including the empty string, which we denote image. We call the set of all finite binary strings image:

image

The notion of length provides a function from image to image. Using a slightly different style of function notation than we have seen so far, we denote the length of a string by image, so that we have image, image, and image. This function counts the total number of 0s and 1s in the given string. There is also a function image that counts only the 0s, where for example

image

Similarly there is a function image that counts only the 1s, so that

image

Exercise 5.2   Prove the following two elementary facts about image.

(a)   Let ω be formed by concatenating the two strings image and image, that is image. Prove that image.

(b)   Prove that image for any string image.

We can also construct a function

image

by defining image to be the first character in the string ω, reading left-to-right; for instance, image. Notice that we need to remove image from consideration because image has no first character.

Our next examples use the set of polynomials with integer coefficients. We denote this set by image, notation that is purposely reminiscent of examples from Section 4.5. The set image contains image, and it also contains linear functions like image and constant functions like image.

We can define image by

image

For example, image. We can also define a function image by

image

Thus image.

As a final introductory example, we can define a function κ from image to image, where a polynomial image is mapped to the shortest possible string that has a 1 in each position i where the coefficient of image is non-zero; other positions are filled in with 0s. For instance,

image

has 1s in positions 1, 2, and 4, and

image

To make the definition of our function κ precise, we set image when image, the zero polynomial; for all other image, the right-most position of image is a 1.

REMARK 5.2.   Because functions are ubiquitous, there are a number of different ways to speak of them. For example, in many situations the word “map” is synonymous with “function.” If image, which is sometimes written image, you will hear both “f maps x to y” and “f sends x to y.”

Exercise 5.3   It is time for you to construct some functions involving the set of polynomials image.

(a)   Construct a function image.

(b)   Construct a more interesting function1 from image to image than you did for part (a)   .

(c)   Construct an interesting function image.

(d)   Construct an interesting function image.

(e)   Construct an interesting function image.

(f)   Construct an interesting function image.

5.2.  Domain, Codomain, and Range

There are a number of words that are used quite frequently when discussing functions, and you need to absorb them.

DEFINITION 5.3.   If f is a function from X to Y, then the domain of f is X; the codomain is Y. The image of an element image is the unique element image where image. The range of f is the subset of Y consisting of all images:

image

Sometimes the range of f is called the image of the function f .

EXAMPLE 5.4.   Let image be the parametric curve defined in the previous section. The domain of γ is image, the codomain is image, and as is illustrated in Figure 1, the range of γ is the unit circle:

image

This highlights that the range can be significantly smaller than the specified codomain.

Exercise 5.4   Determine the ranges of the functions image, ϕ, and κ defined in Section 5.1.

EXAMPLE 5.5.   Here are some additional examples of functions.

(a)   For any set A, the identity function image has image for every image. It is denoted image, which we often use, and sometimes image. The domain, codomain, and range all equal A.

(b)   The floor function image sends image to the greatest integer less than or equal to x, and the ceiling image sends x to the least integer greater than or equal to x. For example, image and image. These are both functions from image to image. In both cases the range is all of the codomain image.

(c)   An infinite sequence of real numbers image is just another way to describe a function image, where the correspondence is image. In a later chapter we will ask whether such a function can ever have its range equal to the codomain image.

(d)   You can map a set to its power set by image with image for every image. You can also use complements to construct another map from A to image: let image with image. As an example, consider the set

image

Then image and image. The range of f is

image

while the range of g is

image

(e)   The function image with image is often called a projection, in this case a projection onto the first coordinate. The function image is the projection onto the second coordinate;2 its range is B.

(f)   The function image with image is often called a diagonal. To see why this name is appropriate, set image and sketch the points in the subset image of the plane image.

Exercise 5.5   Determine which of the following are functions with the given domains and codomains.

(a)   image with image.

(b)   image with image.

(c)   image with image.

(d)   image with image.

(e)   image with image.

(f)   image with image.

(g)   image with image, where image is the set of positive real numbers.

5.3.  Injective, Surjective, and Bijective

The core vocabulary of functions includes the adjectives injective, surjective, and bijective.

DEFINITION 5.6.   A function image is injective if for all image, image implies image.

Put another way, f is injective if no two distinct xs have the same image. An injective function is also called one-to-one. The claim that a function is injective is sometimes encoded by the symbol image, as in image and image.

EXAMPLE 5.7.   The function image given by image is injective for the following reason: for any image, having image means that image, which gives image upon dividing both sides by 3.

EXAMPLE 5.8.   Let image be the function that appends a 1 to the end of any given string. As examples, image and image. To prove that this function is injective, let image and image be two strings in image. If image, then the string image and the string image are identical. This means that image and image are identical strings as well.

Exercise 5.6   Determine whether the following functions are injective.

(a)   image given by image, where image is the set of positive real numbers.

(b)   image given by image.

(c)   image given by image.

(d)   image given by image. As an example, image.

DEFINITION 5.9.   A function image is surjective if for each image there exists an image such that image.

Put another way, f is surjective if each element in Y is hit by some element in X. A surjective function is also called onto. The claim that a function is surjective is sometimes encoded by the symbol image, as in image and image.

In Figure 2 we illustrate a function going from the set {Ole, Lena, Sven} to the set {Alice, Bob, Cecelia}, where each person in the first set is sent to his or her favorite partner when playing games. This function is not injective, as Lena and Sven both like playing with Bob. It is also not surjective: Cecelia is lonely, not being the preferred partner of anyone in the first set.

image

Figure 2. A function between two finite sets.

EXAMPLE 5.10.   The following three examples provide some insight into how you prove that a given function is or is not surjective.

(a)   The function image given by image is not surjective for the following reason: 1 is an element of (the codomain) image, but the equation image is not satisfied by any element of (the domain) image.

(b)   The function image given by appending a 1 to the end of any string is also not surjective. To prove this you could first note that the process of appending a 1 increases the length of any string ω by 1. Since image has length 0, image is not satisfied by any image.

(c)   Let image be defined by image. This function is surjective; we can also say that it is “onto image.” To prove this, we need to show that the range of g is all of image, which we do by considering three cases:

  (i)   Because image, we know 0 is in the range of g.

 (ii)   If image, define image to be the string consisting of n 0s. Then image, and thus all positive integers are in the range of g.

(iii)   If image, define image to be the string consisting of image 1s. Then image, and thus all negative integers are in the range of g.

Exercise 5.7   Prove the following claims:

(a)   The function in Example 5.5 (a)    is both surjective and injective for any set A.

(b)   The functions in Example 5.5 (b)    are surjective but not injective.

(c)   The function in Example 5.5 (f)    is injective, and it is surjective if and only if A contains at most one element.

DEFINITION 5.11.   A function is bijective if it is both injective and surjective.

There is a familiar graphical interpretation of injective, surjective, and bijective when image:

(a)   f is injective if each horizontal line intersects the graph of f in at most one point.

(b)   f is surjective if each horizontal line intersects the graph of f in at least one point.

(c)   f is bijective if each horizontal line intersects the graph of f in one and only one point.

You need to be a bit careful with this graphical interpretation: it applies when the codomain is image, but not necessarily in other circumstances. For example, in Section 5.1 we defined the function γ that traces out a circle in the plane. You might be tempted to say that horizontal lines can cross a circle twice, and thus γ is not injective. The x-axis, for example, intersects the circle at image and image. But this confuses the path traced out by γ with the graph of a function. To prove that γ is not injective, you can point out that image, and thus two real numbers are mapped to the same point in image. If you restrict the domain of γ to the half-open interval image, then γ is indeed an injective function, even though the image of γ is still a circle.

Bijective functions, called bijections, are very important because they provide matchings between the elements in two sets A and B. They are often referred to as one-to-one correspondences, emphasizing this fact.

Exercise 5.8   Find bijections image for the given open intervals of real numbers.

(a)   image and image

(b)   image and image

(c)   image and image

Exercise 5.9   Let image be an injection. Prove that the function image, defined by image for all image, is a bijection.

When X and Y are finite sets, we can count the number of functions image of different types. For example, if image and image, there are nine different functions, one for each column in Table 1. As we have indicated, six of these functions are injective; none are surjective. Exercises 5.35, 5.36, and the following exercise help you further explore the number of injective, surjective, bijective, and otherwise unrestricted functions between two finite sets.

Table 1 Six of the nine possible functions from image to image are injective.

image

Exercise 5.10   Consider all of the different functions from a set A with three elements to a set B with five elements. Try to answer the following questions without creating the full table of functions as we did in the smaller case above.

(a)   How many functions are there?

(b)   How many of these functions are injections?

(c)   How many of these functions are bijections?

(d)   How do your answers change if image and image?

5.4.  Composition

The function image is a composition of the “outer” cosine function and the “inner” polynomial image. This concept of function composition is not, however, restricted to functions that can be presented by formulas.

DEFINITION 5.12.   If image and image are functions, then their composition is written

image

and is defined by sending each image to the element image. That is, image if image and image.

The notation image is particularly helpful for composition, as you can visualize image by

image

Similarly a diagram like the one shown in Figure 3 can be used to visualize function composition.3 This figure depicts two functions image and image, where image, image, and image. Following the arrows shows, for example, that image.

image

Figure 3. Two functions image and image.

EXAMPLE 5.13.   Let image be given by image and image by image. In this case, since image, both image and image are legitimate functions from image to image. However, image, while image.

EXAMPLE 5.14.   Let f and g be the functions shown in Figure 3. The function f is injective but not surjective because image is not in the range of f. The function g is surjective but not injective because image but image. The composition image is neither injective nor surjective.

Exercise 5.11   Referring to the previous example, what is image, if anything?

We end this section with a handful of important, foundational facts about the adjectives injective, surjective, and bijective in the context of composition of functions. But first we offer a couple of cautionary examples. You might expect that if image is injective, then g and f must be injective. However, consider the example where image and image, both having domain and range equal to image. Then the composition image is injective, but the same is not true for g, as you should now verify.

Exercise 5.12    

(a)   Verify that if image and image, then g is not injective, but the composition image is injective.

(b)   Find functions f and g where g is surjective and image is surjective, but f is not surjective.

These examples should help you appreciate the following proposition.

PROPOSITION 5.15.   Let image and image.

(a)   If image is injective, then f is injective.

(b)   If image is surjective, then g is surjective.

PROOF.   To prove part (a), assume to the contrary that f is not injective. Then there must be distinct elements a and image in A such that image. But then it must also be the case that image. This contradicts the hypothesis that image is injective.

To prove part (b), note that because image is surjective it must be the case that given any image there is an image such that image. But if we let image, we know that image. And so given any image there is a image such that image.

image

Thankfully, the properties that are held by both f and g also hold for their composition.

PROPOSITION 5.16.   Let image and image.

(a)   If f and g are both surjective, then so is image.

(b)   If f and g are both injective, then so is image.

(c)   If f and g are both bijective, then so is image.

Exercise 5.13   Prove Proposition 5.16. As a hint for (a), you might start with the statement “Let c be any element of C. Since g is surjective, …” As a hint for (b), you might start with the statement “Suppose that image and image are any two elements of A such that image, which we can also write as image. Since g is injective, …” Finally, as a hint for (c), make sure you’ve done parts (a) and (b)!

REMARK 5.17.   Our definition of function composition requires that the codomain of f is the same as the domain of g. This is more restrictive than is necessary. If image and image, where image, then you can still define the composition image by image. See Exercises 5.45 and 5.69 at the end of this chapter if you would like to explore this modest extension of the definition.

5.5.  What is a Function? Redux!

While Definition 5.1 likely aligns well with your prior knowledge of functions and has allowed us to first explore some of their fundamental concepts, mathematicians are often uncomfortable defining functions as “rules” taking elements from one set to another. One reason for this discomfort is because the notion of a rule is somewhat vague. A related reason is that “rule” is often misinterpreted as meaning “formula,” which is too restrictive. However, if that interpretation is too restrictive, just what is it we mean when we use “rule” in the definition?

An alternate and ultimately preferable approach is to define functions using the set theory we developed in Chapter 3. The motivation comes from our experience with polynomials, trigonometric functions, and other functions that are quite closely identified with their graphs. In the case of a function image, the graph of f is the set of points image, which is a subset of image. We are used to this idea in the context of real numbers, but we can define the “graph” of a function image regardless of whether it is feasible to visualize it in the plane image.

DEFINITION 5.18.   Let f be a function from a set A to a set B, both non-empty. Then the graph of f is the subset of image described by

image

If f is a function from A to B, then the following property holds for the graph of f : given any image, there is a unique element image in the graph of f. This statement is just a direct generalization of the standard vertical line test for the case when A and B are subsets of image. But we can reverse our way of thinking to see that any subset image that satisfies this property can be used to define a function from A to B: you simply say that the function associated to S maps image to image when image. Put another way, the subset of image becomes the “rule.”

DEFINITION 5.19 (Unambiguous Version).    Let A and B be sets. A function from A to B is a subset image such that for each element image there is a unique element image.

Notice that we are defining a function as a set, even though we are giving the set a lower-case name, “f.”

EXAMPLE 5.20.   Let image and image. Then image is a function from A to B, as is image. On the other hand, none of the following subsets of image are functions.

(a)   image

(b)   image

(c)   image

The first does not have a unique ordered pair with leading entry equal to 2; the second has no ordered pair with leading entry 1; and the third is not contained in image.

Exercise 5.14   Suppose that image and the function f contains image, image, and image. Must f contain any other elements?

We emphasize that the functions we have seen in the first sections of this chapter are indeed functions according to Definition 5.19: the “rule” mapping a to b is simply the condition that image is in the set f. For example, the functions in Figure 3 are

image

And the function κ from Section 5.1 is an infinite subset of image, two of its elements being image and image.

Exercise 5.15   If you define the function image from Section 5.1 as a subset image, what elements of image have the form image for some image?

We now revisit some of the terminology from the previous sections. If f is a function from A to B, then the domain of f is A; the codomain is B. The image of an element image is the unique image such that image. By defining image to be this element b, all of our previous definitions translate seamlessly. For example, the range of f is the subset of B consisting of all images:

image

It is important that you become comfortable with both types of function notation, as each is useful in different settings.

We can restate the definition of the composition of functions using the unambiguous definition of functions: if image and image are functions, then their composition is the subset of image defined by

image

For example, the composition of f and g in Figure 3 is image, with a, b, and c acting as the intermediate elements in B.

Exercise 5.16   Restate the definitions of injective and surjective in a way that utilizes the unambiguous definition of a function f as a subset of image.

We finish this section with a proof of the Pigeonhole Principle, a lemma that is widely used throughout mathematics. It derives its name from a common, informal phrasing: if m pigeons fly into n coops, with image, then at least one coop gets at least two pigeons. Stated in the terminology of functions, the Pigeonhole Principle is:

LEMMA 5.21 (The Pigeonhole Principle).    Let image, where A and B are finite, non-empty sets. If image, then f is not injective.

The proof of the Pigeonhole Principle fits well with the unambiguous definition of functions presented in this section.

PROOF.   Our proof is by induction on the size of the set B.

Base Case: If image, then image, so A contains at least two distinct elements, image and image. This means that f contains both image and image, where b is the only element of B, so f is not injective.

Inductive Step: Assume the lemma is true for all finite sets B whose size is less than or equal to n for some image. Now consider a function image where image is greater than image. For this argument we fix an element image.

Case 1:   If A contains at least two distinct elements, image and image, such that f contains both image and image, then f is not injective.

Case 2:   If A contains no element a such that image, then f is also a subset of image. Since image and image, we know that f is not an injection, by our induction hypothesis.

Case 3:   By the previous two cases, we may now assume there is a unique image such that image. We can then define

image

We know that for every image there is a unique image, because f being a function implies that image is also a function. Notice that

image

and so we may apply our our induction hypothesis to image, proving that image is not injective. It follows that f cannot be injective either.

image

Exercise 5.17   Explain two quick steps in the proof of the Pigeonhole Principle above: if f is a function, so is image; and if image is not injective, neither is f.

The Pigeonhole Principle is the focus of Project 11.5. We highly recommend that you look at this project, which begins with a number of accessible results that follow from the Pigeonhole Principle.

GOING BEYOND THIS BOOK.   The definition of a function introduced in this section is the result of a long evolution in the history of mathematics; see the nice survey of this history in Israel Kleiner’s “Evolution of the function concept: A brief survey” [Kle89].

5.6.  Inverse Functions

Two functions are said to be inverses of each other if one function “undoes” the other, in a manner described more carefully near the end of this section. You have encountered the idea of inverse functions before, perhaps in the process of solving equations. For example, if you have reduced a problem to image, then you would take the cube root of both sides to determine that image. This works because the functions image and image are inverses. Similarly if you meet image, you can apply the natural logarithm to both sides to determine that image, and therefore image. Here we used the fact that the natural logarithm function image and the exponential function image are inverses.

The definition of a function f as a subset of image is particularly convenient for defining the inverse of f.

DEFINITION 5.22.    If image is a function, define the inverse image as a subset of image:

image

Let f be a function from a subset of image to image. Because the inverse of f is created by simply reversing the order of elements, image contains all points of the form image. This is equivalent to reflecting the graph of f across the line image; the example of image and image is illustrated in Figure 4.

image

Figure 4. Plotting a function and its inverse – in this case image and image – reveals symmetry about the line image.

Exercise 5.18   Carefully plot image and image, determining all of the points where they intersect.

There are many situations where image is not a function. Consider the example of image, shown along with the subset image of image in Figure 5. Looking at the graph of f you can see that there are four values of x where image, and via the quadratic formula you can determine that the four solutions of image are image. Because multiple values are taken to image by f, you cannot determine the value of x just from knowing that image.

image

Figure 5. The function image is shown with a dotted curve. Viewing f as a subset of image, you can form its formal inverse, shown as a solid curve, which is not a function.

There are many vertical lines in Figure 5, including the line image, that pass through several points of image. Thus image does not satisfy the definition of a function. Specifically, it is not the case that for each element image there is a unique element image. There is another problem with thinking of image as a function from image to image. Because there is no real-valued solution to image, there is no element image. So for some values of image there is no element image.

The same fundamental issues are illustrated by the function from image to image shown in Figure 6. In this case, you can visualize image by reversing the arrows, producing

image

As the figure highlights, the number 2 is not the first element of an ordered pair in image (notice that f is not surjective), and the number 3 is the first element of three ordered pairs in image (notice that f is not injective).

These examples motivate the need for a characterization of what makes image a function.

image

Figure 6. The function f is shown on the left, with image illustrated on the right.

THEOREM 5.23.   Let image be a function. Then image defines a function from B to A if and only if f is a bijection.

PROOF.   Assume first that f is a bijection, that is, f is both injective and surjective. Since f is surjective, given any image there is an image such that image. This means that given any image there is an ordered pair image. To see that this pair is unique given any image, and thus that image is a function, assume to the contrary that there is also a pair image, with image. Then image and image, contradicting the fact that f is injective.

If f is not a bijection, then f is either not surjective or not injective. If f is not surjective then there is a image that does not appear as the second element of an ordered pair in f. Thus there is no image such that image, so image is not a function. If f is not injective, then there are distinct elements image and an element image such that image and image are both in f. Thus image and image are both in image, which contradicts the requirement that the ordered pair beginning with b is unique.

image

Exercise 5.19   Let’s examine the logical structure of the proof for Theorem 5.23. If P is the proposition “f is a bijection,” then P is stating that f is both injective and surjective. Thus P is equivalent to image, where image is “f is surjective” and image is “f is injective.”

Let Q be the proposition “image is a function.” In our proof of Theorem 5.23 we showed:

image

Verify that this expression is logically equivalent to what is claimed in the theorem: image.

If image is a bijection, we can now say why image “undoes” f, and vice versa, in the common notation of functions. Since f is a function, for every image there is a unique image such that image, and thus image. Since image is also function, we can write both image and image, so

image

for all image. Moreover, since f is a bijection, for every image there is a unique element image such that image, and thus image. As before, we can again write image and image, so

image

for all image. Put another way, we now know that image and image. (Recall that the functions image and image are the identity functions mentioned in Example 5.5.)

Exercise 5.20   Let image and image. Prove that if image and image, then f and g are bijections, and image.

5.7.  Functions and Subsets

There are many confusing things about inverses and how they are used in practice. For one, because you often want to know what elements in the domain are mapped by f to a particular element in the range, it is not uncommon to use image even when image is not a function. It is also not uncommon to apply a function not just to single elements but to a subset of the domain. In this section we explore these notationally challenging practices.

5.7.1 Where did this come from?   Let image be a function. Given some image, you might wonder what elements of A are taken to b by f. For example, the length function image takes a binary string in image and returns a non-negative integer: we find that image, and image as well. As shown in Exercise 5.15, there are eight strings of length 3:

image

If image, then the pre-image of image is defined to be

image

or stated in terms of ordered pairs,

image

Notice that the pre-image of an element b may be a single element in A or it may be a subset of elements. In particular, if b is not in the range of f, then the pre-image of b is the empty set.

In the previous section we examined image. Looking at the graph in Figure 5 you see that f takes four distinct real numbers to image, and with a bit of algebra you can show that

image

And since image is not in the range of image, the pre-image of image is image.

Exercise 5.21   Let image be the function image, shown in Figure 7.

(a)   What is the pre-image of 0?

(b)   What is the pre-image of 6?

(c)   Which real numbers have a pre-image consisting of exactly two numbers? (You may need a bit of calculus to help with this part.)

image

Figure 7. The cubic function for Exercise 5.21.

5.7.2 From Elements to Subsets.   Continuing our examination of image from Exercise 5.21, it is not uncommon to want to understand where a function like f takes an entire subset of real numbers. For example, we might like to apply f to the closed interval image and write

image

by which we mean

image

The lower limit, image, is the minimum for f over the interval image.

Any function image can be used to describe an associated function from the power set of A to the power set of B. There is no commonly accepted notation for this “induced” function, and we will temporarily denote it by image. The rule that defines image is this:

image

That is, image is the set of all images of elements in image.

As an example, let f be the floor function, image. Then

(a)   image,

(b)   image,

(c)   image,

(d)   image.

Exercise 5.22   Let image be the function

image

(a)   Verify that image and image.

(b)   What is image?

(c)   What is image?

(d)   What is image?

(e)   What is image?

5.7.3 Subsets of the Range.   If image, then the pre-image of 0 is the set image. Because f is not injective, we know that image is not itself a function. However, it is tempting to write

image

Such a statement is in essence claiming that image can be thought of as a function, but one where the image of an element might be a subset of image, the domain of the function f. That is, the range of image is in the power set image.

We can combine the notions in the previous two sections – working with pre-images even when image is not a function and the construction of image from f  – to construct a function from subsets of B to subsets of A. Given a function image, there is an induced function from image to image. It is defined for each image by

image

In particular, if image then we can write

image

Exercise 5.66 asks you to verify that image and image are indeed functions. As with image, our use of the notation image is temporary.

We return to the function image to illustrate this construction. For this f we have

(a)   image,

(b)   image,

(c)   image,

(d)   image.

As another example, consider image defined by

image

Then each of the following statements is true:

(a)   image and image,

(b)   image,

(c)   image,

(d)   image.

Exercise 5.23   We can consider the trigonometric functions sine and cosine to have domain image and codomain image. What are image and image?

Exercise 5.24   Consider the following two functions from image to image:

image

Plot enough points for each function so that you have a decent impression of its graph. Then compute the following.

(a)   image and image

(b)   image and image

(c)   image

(d)   image

(e)   image

(f)   image, where image

5.7.4 Abuse of Notation.   Given image we have now introduced three associated concepts:

image, which may or may not be a function from B to A;

image, which is a function from image to image;

image, which is a function from image to image.

We also mentioned that there is no standard notation for image and image. In practice, the symbols f and image are used, or perhaps we should say reused or overused, in their places. The multiple meanings for the same notation is potentially confusing, but in context it is usually clear what is being described. Thus if image, then you will indeed see expressions like

image

In each case, you can determine what is being stated without the burden of additional notation.

Using notation in an imprecise fashion, or using the same notation for two related but distinguishable constructions, is referred to as an abuse of notation. As the overuse of the symbols f and image is a rather common abuse of notation, for the remainder of the book we will drop the subscript “image” and follow the convention of using the symbols f and image in all of the contexts we have described in this section.

5.8.  A Few Facts About Functions and Subsets

Let image be a bijection and let image be its inverse function. We have seen that image for all image and image for all image. When you apply functions and inverses to subsets instead of elements, similar but weaker statements hold.

It will be helpful to begin with an example. Consider the function

image

whose graph is plotted in Figure 8, highlighting the fact that f takes the closed interval image to image. You can see in the graph of f that there are additional values of x that map into the closed interval image. In particular, a bit of algebra shows that image, which is the key fact in determining that image. Thus

image

The original interval is not, however, completely unrelated to image: it is a subset of it.

image

Figure 8. The function image takes the closed interval image to image.

PROPOSITION 5.24.   Let image be a function.

(a)   If image, then image.

(b)   If image, then image.

PROOF.   We first prove part (a). For each image we know that image by the discussion in Section 5.7.2. By the discussion in Section 5.7.3, we know that image. Hence image.

To prove part (b), simply notice that

image

image

Exercise 5.25   Let image. Prove or find a counterexample to each of the following claims.

(a)   If f is injective, then for all subsets image, image.

(b)   If f is surjective, then for all subsets image, image.

(c)   If f is bijective, then for all subsets image, image.

The behavior of functions applied to unions and intersections is similarly aligned with intuition, but it is once again weaker than what you might at first expect.

PROPOSITION 5.25.   Let image be a function and image. Then

(a)   image,

(b)   image.

PROOF.   We first prove that image. Let image. Then there is a image with image. Since image we have image or image. Thus image or image, hence image.

Conversely, let image. Then image or image, so image for some image or image for some image. Either way we conclude that image. This establishes part (a).

To prove part (b) we begin with an element image. Because w is in the image of image, there must be some image with image. Since image, image, and similarly since image, image. Thus image.

image

Exercise 5.26   Construct an example showing that image doesn’t always hold.

5.9.  End-of-Chapter Exercises

Exercises you can work on after Sections 5.1 and 5.2

5.27 The following questions ask about the domain and range of some standard trigonometric functions.

(a)   What is the range of image?

(b)   What is the domain of image?

(c)   What is the range of image?

(d)   What is the domain of image?

5.28 Determine the range of the following functions.

(a)   The function image defined by image.

(b)   The function image defined by

image

5.29 Determine the range of the following functions that involve image, the set of all polynomials with integer coefficients.

(a)   The function image defined by image.

(b)   The function image defined by image.

5.30 Determine which of the following are functions with the given domains and codomains.

(a)   image with image.

(b)   image with image.

(c)   For any finite set A, image with image.

(d)   image with image.

(e)   image with image.

(f)   For any set A, image with image.

5.31 Define the function image by

image

(a)   What is Range(g)?

(b)   Now consider the same definition for image but as a function image with a different domain. What is Range(g) in this case?

Exercises you can work on after Section 5.3

5.32 Define a function image by

image

where image is the ceiling function. Is f injective or surjective? Or neither?

5.33 Define the function image by

image

Prove that f is injective but not surjective.

5.34 Let image be the function image, where a and b are elements of image. For any such pair of coefficients, must f be …

(a)   …injective?

(b)   …surjective?

(c)   …bijective?

5.35 Consider the following continuation of Exercise 5.10 for finite sets A and B.

(a)   Determine the number of different bijections from A to B if image.

(b)   Determine the number of different injections from A to B if image.

5.36 Consider the following continuation of Exercises 5.10 and 5.35.

(a)   Determine the number of different surjections from A to B if image and image.

(b)   Determine the number of different surjections from A to B if image and image, with image. As a hint, Stirling numbers of the second kind, discussed in Section 3.8, might prove helpful.

5.37 Construct an injective map image. Then try your best to construct an injective map image.

5.38 Let image and image, and define image by

image

(a)   Prove that if f and g are injections, then so is h.

(b)   Prove that if f and g are surjections, then so is h.

5.39 Determine which of the following functions are bijections.

(a)   image given by image.

(b)   image given by image.

(c)   For a set A, image given by image.

5.40 Given sets A and B, recall the function image that projects onto the first coordinate: image. What conditions do you need to put on the sets A and B to insure that this function is …

(a)   …injective?

(b)   …surjective?

(c)   …bijective?

5.41 Determine whether there is a bijection image for the following given sets A and B.

(a)   image and image.

(b)   image and image.

Don’t let the single missing point in part (b) deceive you: accommodating it might prove to be quite challenging!

5.42 Try to find bijections image for the following given sets A and B. We believe the first one is not so hard, the next is harder, and so on. Some bijections might not be possible; this topic will reappear in Chapter 7.

(a)   image and image.

(b)   image and image.

(c)   image and image.

(d)   image and image.

(e)   image and image.

Caution: The last one is REALLY hard.

Exercises you can work on after Section 5.4

5.43 Suppose that A, B, and C are finite sets that each contain five elements. Do there exist functions image and image that satisfy the following conditions? Prove that your answers are correct.

(a)   image and image is injective.

(b)   image and image is surjective.

(c)   image and image.

(d)   image and image.

5.44 Let image be the function defined in Exercise 5.33. Let image be defined by

image

For example,

image

Describe the composition image.

5.45 The arcsine function, image, is a function from image to image, where image if and only if image. In this exercise we ask you to describe the functions image and image: for each composition, justify your answers to the following questions:

(a)   What is the domain of the composition?

(b)   What is the range of the composition?

(c)   Is the composition injective?

(d)   Is the composition surjective?

(e)   Is the composition bijective?

Note that the range of arcsine is properly contained in the domain of the sine function. As we remarked at the end of Section 5.4, a composition like image still makes sense, even though the range of image is not identical to the domain of image.

5.46 Prove that function composition is associative. That is, if

image

then

image

5.47 Consider the function image defined by

image

For example, image, image and image.

(a)   What is the range of h?

(b)   We have heard this function called the Popcorn Function as well as Stars Over Babylon. Why are those appropriate names? Plot at least 12 points on the graph of this function using rational x-values with image.

(c)   A function f is an idempotent if image and f are the same function. Show that image is an idempotent. Two simpler idempotent functions can be found in Exercise 5.24.

(d)   Comment on Zippy in Figure 9.

image

Figure 9. Idempotent functions are defined in Exercise 5.47.

5.48 Define a function image by

image

It is easy to see that the only values of x for which image are those with image. In this exercise you will extend this insight to iterated versions of f, namely the functions

image

It may be helpful to sketch the graphs of f and image, before starting these problems.

(a)   Which values of x satisfy image?

(b)   Which values of x satisfy image?

(c)   Which values of x satisfy image?

(d)   Let image. Which values of x satisfy image?

(e)   What is Range(f )? Range(image)?

Exercises you can work on after Section 5.5

5.49 Determine which of the following are functions with the given domains X and codomains Y. For those that are functions, determine which are injective, surjective, or bijective.

(a)   image and image.

(b)   image, image, and image.

(c)   image, image, and image.

(d)   image, image, and image.

(e)   image and

image

For example, image because image has two distinct prime factors.

(f)   image, image, and

image

For example, image.

5.50 Prove that the composition of two functions is a function, using the ordered pairs definition of functions.

5.51 The functions image and κ were defined in Section 5.1. Does either image or image make sense? If so, describe the effect of the resulting function(s).

5.52 Let image be a function.

(a)   Prove that f is injective if and only if

image

for all image.

(b)   Prove that f is surjective if and only if

image

for all image.

5.53 Let image be a function. In many situations you may want to restrict the domain of f or expand its range.

(a)   If image, then define the restriction of f to C as

image

Prove that image is a function from C to B.

(b)   If D is any set that contains B, then you can use f to define a function with domain A and codomain D, using the fact that

image

Prove that f is still a function in this setting.

5.54 Give two examples of infinite subsets image where image, the restriction of the sine function, is an injective function. (The restriction of a function is defined in Exercise 5.53.)

5.55 Prove that the restriction of sine to the integers, image, is injective. (The graph of image, for integers between image and 20, is shown in Figure 10.) We recommend using the trigonometric identity

image

You may assume that image, a fact that you can prove in Section 8.6.

image

Figure 10. The sine function restricted to the integers.

Was image one of your answers to Exercise 5.54?

5.56 In a class of n students, some students are friends and others are not. We assume that being friends is a symmetric relationship, so that if Alice is friends with Bob, then Bob is also friends with Alice. Prove that there must be two students in the class with the same number of friends. Here’s a hint: can Alice have no friends in the class while at the same time Bob is friends with image students?

5.57 Let

image

Prove that if 19 distinct elements are chosen from S, then two of those integers must sum to 104.

Exercises you can work on after Section 5.6

5.58 The function image and its inverse are shown in Figure 11.

(a)   What is image?

(b)   What is image?

(c)   What is image?

(d)   image is between which two integers?

image

Figure 11. The function image is shown with a solid curve and its inverse is represented by the dotted curve.

5.59 Define image by

image

Prove that f is a bijection, and describe image.

5.60 For any set S, let image be the function from image to image taking a subset of S to its complement in S.

(a)   Prove that image is a bijection.

(b)   Prove that image is its own inverse.

5.61 Let image be a bijection. By Theorem 5.23, image is also function; moreover, by Exercise 5.20 it is a bijection. Since image is a bijection, it follows that it has an inverse function, image. Prove that f and image are the same function.

Exercises you can work on after Sections 5.7 and 5.8

5.62 Let image, as shown in Figure 5.

(a)   What is the pre-image of 5?

(b)   For what values of x does the set image have exactly two elements? If it’s helpful, the minimum values of image occur at the points image.

5.63 Let image be defined by

image

In other words, r takes a polynomial to its set of real roots.

(a)   Verify that image, and determine image.

(b)   Find a polynomial image where image.

(c)   Show that image is not empty.

5.64 Let image and image. Then image. Show by an example that it is possible to have image without having image.

5.65 Determine image and image for the following functions and subsets.

(a)   image given by image, with image and image.

(b)   image given by image, with image and image.

(c)   image given by image if image is a fraction in lowest terms, with image and image.

5.66 Given a function f from a set A to a set B, we defined image and image in Section 5.7.

(a)   Verify that the “function” image is actually a function.

(b)   Verify that the “function” image is actually a function.

5.67 Let image, as shown in Figure 5.

(a)   What is image?

(b)   What is image?

(c)   What is image?

5.68 Let image be a function, and let image be an indexed family of subsets of A. Prove the following.

(a)   image

(b)   image

More Exercises!

5.69 Let image and image.

(a)   Assuming that image, construct a definition of the composition image (as described in Remark 5.17) using the unambiguous definition of a function.

(b)   Give an unambiguous definition of image which only requires

image

and explain why this is different from the situation in part (a).

(c)   If it is not the case that image, what is the maximal subset image such that you can define the composition image? Here image denotes the restriction of f to X, as defined in Exercise 5.53.

5.70 Given a partition image of the set image, let image be the function where image is the size of the block of image that contains a. Prove that for any two partitions of D, image and image, there are distinct numbers image such that image and image.

5.71 We have seen that a bijection image has an inverse function image, with image and image. If image is any function (not necessarily a bijection) then we say f has a left inverse if there is a function image such that image.

(a)   Let image be defined by

image

Find a left inverse for f.

(b)   Find another left inverse for f, thereby showing that left inverses are not unique.

(c)   Prove that if image is an injection, then f has a left inverse.

5.72 Construct a similar exercise to Exercise 5.71 that defines and explores right inverses instead of left inverses.

5.73 The goal of this exercise is to prove the following claim:

Let image, and define image. Let A be any subset of image with image. Then A must contain x and y, where x is a proper divisor of y.

Our approach draws on ideas from Chapter 4, particularly the Fundamental Theorem of Arithmetic (Theorem 4.11).

(a)   Use the Fundamental Theorem of Arithmetic (Theorem 4.11) to prove that every natural number has a unique expression as image where k is a non-negative integer and image is an odd natural number.

(b)   Define a function image via image, and prove that the restriction of image to the set A is not injective.

(c)   Conclude that there must be an x and image where x is a proper divisor of y.

(d)   Explain why we really do have to assume that image, regardless of the value of n.

5.74 We use image to denote the set of functions from A to B. Let image be a bijection. Define image by

image

or if you prefer

image

Prove that image is a bijective function.

If You Have Studied Calculus

5.75 Find a condition on the coefficients that characterizes when a cubic polynomial image is bijective, and prove that your characterization is correct.

5.76 Recall that image is the set of all polynomials with integer coefficients.

(a)   Let image be the derivative. For example, image and image. Explain why d is a function.

(b)   Is d injective? Give a proof or find a counterexample.

(c)   Is d surjective? Give a proof or find a counterexample.

5.77 Let image, with the domain of f equal to the set of positive real numbers.

(a)   Explain why you know that image is injective, and has an inverse.

(b)   What is image?

(c)   image is between what two integers?

5.78 Let image be the set of all polynomials with rational coefficients.

(a)   Construct a similar set of questions to Exercise 5.76 in the context of integration. Take care with “+C”!

(b)   Answer your questions.


1   As an example, you might have defined your function from image to image by image. That is valid, but not interesting. The function image strikes us as being more interesting. We hope your answer to (b) is even more interesting than this. And please don’t ask us to define “interesting”!

2   The notation image is technically incorrect; the input element is the ordered pair image, so the output should be denoted image, as we did in the previous sentence with f. But, in fact, notation like image is quite standard, to reduce the number of parentheses in a context where the meaning is clear.

3   Yes, the order of f and g in the name image is opposite to the order presented in image and in Figure 3. This is due to standard function notation like image having the function name on the left, while mathematical text and visuals such as ours are naturally read left-to-right.