Chapter Three. Functions. In this section, we study what is undoubtedly the most fundamental type of relation used in mathematics.

Similar documents
1 if 1 x 0 1 if 0 x 1

Practice with Proofs

INTRODUCTORY SET THEORY

Cartesian Products and Relations

1 The Concept of a Mapping

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

H/wk 13, Solutions to selected problems

You know from calculus that functions play a fundamental role in mathematics.

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

To define function and introduce operations on the set of functions. To investigate which of the field properties hold in the set of functions

1. Prove that the empty set is a subset of every set.

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Mathematics Course 111: Algebra I Part IV: Vector Spaces

3. Mathematical Induction

Lecture 16 : Relations and Functions DRAFT

Mathematics Review for MS Finance Students

Geometric Transformations

Real Roots of Univariate Polynomials with Real Coefficients

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Continued Fractions and the Euclidean Algorithm

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

it is easy to see that α = a

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

PROBLEM SET 6: POLYNOMIALS

8 Divisibility and prime numbers

6.2 Permutations continued

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

The last three chapters introduced three major proof techniques: direct,

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

Quotient Rings and Field Extensions

NOTES ON LINEAR TRANSFORMATIONS

1.7 Graphs of Functions

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Application. Outline. 3-1 Polynomial Functions 3-2 Finding Rational Zeros of. Polynomial. 3-3 Approximating Real Zeros of.

Limits and Continuity

Math 4310 Handout - Quotient Vector Spaces

Chapter 7. Functions and onto. 7.1 Functions

PYTHAGOREAN TRIPLES KEITH CONRAD

8 Primes and Modular Arithmetic

Basic Proof Techniques

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Understanding Basic Calculus

DERIVATIVES AS MATRICES; CHAIN RULE

Lecture 13 - Basic Number Theory.

Chapter 9. Systems of Linear Equations

k, then n = p2α 1 1 pα k

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 3. Spaces with special properties

Mathematical Methods of Engineering Analysis

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

1.5. Factorisation. Introduction. Prerequisites. Learning Outcomes. Learning Style

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

BANACH AND HILBERT SPACE REVIEW

Section 2.7 One-to-One Functions and Their Inverses

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

minimal polyonomial Example

This chapter is all about cardinality of sets. At first this looks like a

Homework until Test #2

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

2.1 Increasing, Decreasing, and Piecewise Functions; Applications

SECTION 10-2 Mathematical Induction

Alex, I will take congruent numbers for one million dollars please

MA4001 Engineering Mathematics 1 Lecture 10 Limits and Continuity

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

Review of Fundamental Mathematics

THE FUNDAMENTAL THEOREM OF ALGEBRA VIA PROPER MAPS

FIRST YEAR CALCULUS. Chapter 7 CONTINUITY. It is a parabola, and we can draw this parabola without lifting our pencil from the paper.

MA651 Topology. Lecture 6. Separation Axioms.

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Metric Spaces Joseph Muscat 2003 (Last revised May 2009)

Introduction to Finite Fields (cont.)

MATH10040 Chapter 2: Prime and relatively prime numbers

Handout #1: Mathematical Reasoning

Linear Algebra Notes for Marsden and Tromba Vector Calculus

Factoring Polynomials

7 Relations and Functions

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

The Division Algorithm for Polynomials Handout Monday March 5, 2012

So let us begin our quest to find the holy grail of real analysis.

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Metric Spaces. Chapter 1

Introduction to Topology

Mathematical Induction. Mary Barnes Sue Gordon

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Chapter 3. if 2 a i then location: = i. Page 40

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

MATH 289 PROBLEM SET 4: NUMBER THEORY

11 Ideals Revisiting Z

CS 3719 (Theory of Computation and Algorithms) Lecture 4

1 Sets and Set Notation.

Solving Quadratic Equations

TOPIC 4: DERIVATIVES

List the elements of the given set that are natural numbers, integers, rational numbers, and irrational numbers. (Enter your answers as commaseparated

Transcription:

Chapter Three Functions 3.1 INTRODUCTION In this section, we study what is undoubtedly the most fundamental type of relation used in mathematics. Definition 3.1: Given sets X and Y, a function from X to Y is a subset f of X Y with the property that, for any x X, there exists a unique y Y such that (x, y) f. We denote the fact that f is a function from X to Y by writing f : X Y The set X is called the domain of the function f and is written dom f. The set Y is called the codomain of f. Also associated with f is a subset of Y called the image of f. This is denoted by im f and defined by im f = {y Y there exists x X such that (x, y) f} If X = Y, then we call f a function on X. Example 3.1: Determine which of the following are functions and find the image of each function. (a) The subset f 0 of {1, 2, 3} {1, 2, 3} given by f 0 = {(1, 2), (2, 3)}. (b) The subset f 1 of {1, 2, 3} {1, 2, 3} given by f 1 = {(1, 2), (2, 1), (3, 2)}. (c) The subset f 2 of {1, 2, 3} {1, 2, 3} given by f 2 = {(1, 1), (1, 3), (2,3), (3,1)}. (d) The subset f 3 of Z Z defined by f 3 = {(m, n) n is a multiple of m}. (e) The subset f 4 of Z Z defined by f 4 = {(m, n) n = 2m + 1}.

138 Chapter 3 Functions Solution: (a) The subset f 0 is not a function because there is no ordered pair in f 0 of the form (3, y). This violates the condition of the definition that, for each x {1, 2, 3}, there must exist a y {1, 2, 3} such that (x, y) f 0. (b) The subset f 1 is a function on {1, 2, 3}; im f 1 = {1, 2}. (c) The subset f 2 is not a function on {1, 2, 3} because both (1, 1) f 2 and (1, 3) f 2. This violates the condition of the definition that, for each x {1, 2, 3}, there should be a unique y {1, 2, 3} for which (x, y) f 2. (d) The subset f 3 is not a function on Z because, for instance, (2, 4) f 3 and (2, 6) f 3. Again, the definition says that, in order for f 3 to be a function, there should be a unique y Z such that (2, y) f 3, and we see that this is not the case. (e) The subset f 4 is a function on Z; im f 4 is precisely the set of odd integers. Suppose that f is a function from X to Y. Again, the condition of Definition 3.1 is the following: For any x X, there exists a unique y Y such that (x, y) f. We call y the image of x under f and write y = f(x). The notation f(x) is read f of x. Moreover, if y = f(x), then x is said to be a preimage of y under f. Thus, with this notation, we can restate the definition of the image of f as follows: im f = {f(x) x X} It is also common to refer to y = f(x) as the value of f at x and to say that f maps x to y. (A function is sometimes called a mapping.) One commonly defines a function by writing, Define f : X Y by y = f(x), where y = f(x) is a formula that expresses y (uniquely) in terms of x. We call y = f(x) the defining formula of the function f. It can be viewed as a rule specifying how to compute the image of a given x X. Example 3.2: Define f : Q + Q + by f(x) = 1/x. This f is called the reciprocal function (on Q + ) since each positive rational number is mapped to its reciprocal. It is clear that f is a function, since each positive rational number has a unique reciprocal. For example, f(2) = 1/2 and f(2/3) = 1/(2/3) = 3/2. Also, each positive rational number is the reciprocal of its reciprocal, so that im f = Q +. Example 3.3: Define g: R Z by g(x) = x, where x denotes the largest integer that is less than or equal to x. This g is called the greatest integer function or floor function. It is clear that g is a function since the process of rounding down a given real number x to the largest integer m such that m x determines a unique m. For example, g(2) = 2, g(π) = 3, g( 2) = 2, and g( π) = 4. Note that for each integer m, g(m) = m, so that im g = Z. Example 3.4: Define l: R Z by l(x) = x, where x denotes the smallest integer that is greater than or equal to x. This l is called the least integer function or ceiling function. It

3.1 Introduction 139 is clear that l is a function since the process of rounding up a given real number x to the smallest integer m such that x m determines a unique m. For example, l(2) = 2, l(π) = 4, l( 2) = 2, and l( π) = 3. Note that for each integer m, l(m) = m, so that im l = Z. Example 3.5: Define n: R Z by n(x) = [x], where [x] denotes the integer that is nearest to x. For example, n(2) = 2, n(π) = 3, n( 2) = 2, and n( π) = 3. This n is called the nearest integer function. But wait, you say (if you ve been reading the section carefully): What, for example, is the value of n(2.5)? Is it the case that n(2.5) = 2 or is n(2.5) = 3? This is a problem! If we want n to be a function with domain R, then n(2.5) must have some value; and, if we want n to be a function, then we can t let n(2.5)have two different values. The common terminology for a problem such as this is to say that the function n is not well-defined. To make n well-defined, we need a rule to insure that every real number has a unique image under n. One rule that is commonly invoked is break ties by rounding up; that is, if there is a tie for the title of the nearest integer to x, then let n(x) = x. With this rule, for example, we have that n(2.5) = 3. Note that this rule can be made more precise as follows: ( ) 2m 1 n = m for any integer m. 2 Example 3.6: Define g: Z 7 Z 7 by g(x) = 4x. Then g(0) = 0, g(1) = 4, g(2) = 1, g(3) = 5, g(4) = 2, g(5) = 6, and g(6) = 3. (A remark: In (Z n, +, ), for m Z n, mx = m x; that is, one gets the same value whether one interprets mx as a multiple of x or as the product m x. So we can interpret mx in whichever way is more convenient.) Note that im g = Z 7. Example 3.7: Define h: Z 6 Z 3 by h(x) = x mod 3. Then h(0) = 0, h(1) = 1, h(2) = 2, h(3) = 3 mod 3 = 0, h(4) = 4 mod 3 = 1, and h(5) = 5 mod 3 = 2. So im h = Z 3. If f is a function whose domain and range are both subsets of the set R of real numbers, then associated with each ordered pair (x, y) f there is a uniquely determined point (x, y) in the xycoordinate plane. In analytic geometry and calculus, the set of all points so determined is called the graph of f. No doubt you have had considerable experience with graphing functions. Example 3.8: Sketch the graphs of the following functions. (a) f : R R; f(x) = 4 2x (b) g: (0, ) (0, ); f(x) = 1/x (c) h: R ( 4, ); h(x) = x 2 2x 3

140 Chapter 3 Functions Solution: The graphs are shown in Figure 3.1. Figure 3.1 If X and Y are subsets of R and a function f from X to Y is given, then the property that each x X has a unique image under f can be interpreted geometrically. First of all, note that this property is equivalent to the statement that the following implication holds for any x X and all y 1, y 2 Y : [ (x, y1 ) f and (x, y 2 ) f ] y 1 = y 2 This statement implies that every vertical line intersects the graph of f in at most one point. Thus, if we are given a set of points in the xy-coordinate plane, then we can determine whether the associated set of ordered pairs is a function by applying this vertical line test. Example 3.9: It is easy to apply the vertical line test to each of the graphs in Figure 3.1. Each is seen to determine a function, as noted in the previous example. Figure 3.2 shows the graph of the subset {(x, y) x = y 2 }. Note that any vertical line x = x 0, where x 0 > 0, intersects the graph of this subset in two points, namely, (x 0, x 0 ) and (x 0, x 0 ). Thus, this subset fails the vertical line test, and so it is not the graph of a function.

3.1 Introduction 141 Figure 3.2 Exercise Set 3.1 1. Let S = {1, 2, 3, 4}. Determine which of the following subsets of S S are functions on S, and determine the images of those that are. (a) f 1 = {(1, 2), (3, 4), (4, 1)} (b) f 2 = {(1, 3), (2, 3), (3, 3),(4, 3)} (c) f 3 = {(1, 1), (2, 2), (3, 3), (3,4), (4, 4)} (d) f 4 = {(1, 3), (2, 4), (3, 1),(4, 2)} 2. Let T denote your maternal family tree (T includes your (biological) mother, your maternal grandmother, your maternal great-grandmother, and so on, and any children of these people). Determine which of the following subsets of T T are functions. (a) g 1 = {(x, y) y is the mother of x} (b) g 2 = {(x, y) x and y are sisters} (c) g 3 = {(x, y) y is an aunt of x} (d) g 4 = {(x, y) y is the eldest daughter of x s maternal grandmother} 3. Graph each of the following subsets of R R. Determine which are functions and find the images of those that are. (a) h 1 = {(x, y) 2x y = 3} (c) h 3 = {(x, y) (x 1) 2 + y 2 = 9} (b) h 2 = {(x, y) x 2 + y = 4} (d) h 4 = {(x, y) y = 8 + 2x x 2 } (e) h 5 = {(x, y) x y = 2} (f) h 6 = {(x, y) (x 2 + 1)y = 1} 4. Each part defines a function and gives a value x in the domain of the function and a value y in the codomain of the function. You are to (1) find the image of x, (2) find the set of preimages of y, and (3) determine the image of the function.

142 Chapter 3 Functions (a) f : {1, 2, 3, 4,5} {1, 2, 3, 4}; f(1) = 2, f(2) = 4, f(3) = 1, f(4) = 4, f(5) = 2; x = 3, y = 4 (b) g: {2, 3, 4, 5,...} set P of primes; g(x) =smallest prime factor of x; x = 91, y = 5 (c) h 1 : Z 11 Z 11 ; h 1 (x) = 5x; x = 4, y = 3 (d) h 2 : Z 12 Z 12 ; h 2 (x) = 4x; x = 4, y = 3 (e) r: Z Z 5 ; r(x) = x mod 5; x = 12, y = 3 (f) v: Z Z; v(x) = gcd(x, 12); x = 30, y = 6 3.2 ONE-TO-ONE FUNCTIONS AND ONTO FUNCTIONS Let f be a function from the set X to the set Y. Then each x X has a unique image y = f(x) Y. However, it need not be the case that for each y Y there is a unique x X such that f(x) = y; that is, it is not necessarily true that every y Y has exactly one preimage. In fact, it might happen that some y 1 Y has no preimages, or it might happen that some y 2 Y has at least two preimages; that is, there could exist two distinct elements x 1, x 2 X with f(x 1 ) = y 2 = f(x 2 ). For example, consider the function f : Z Z defined by f(m) = 2m 2 + 1. It is clear that f(m) is odd for all m Z; so, for instance, there is no m for which f(m) = 0. Moreover, f( 1) = 3 = f(1), and so 3 has both 1 and 1 as preimages. Some functions f : X Y satisfy the property that for each y Y there is at most one x X such that f(x) = y ; that is, each y Y has at most one preimage under f. This condition may be rephrased as follows: For all x 1, x 2 X, if f(x 1 ) = f(x 2 ), then x 1 = x 2. Definition 3.2: A function f : X Y is called one-to-one provided that the following implication holds for all x 1, x 2 X: f(x 1 ) = f(x 2 ) x 1 = x 2 It is sometimes convenient to use the condition in Definition 3.2 in its contrapositive form: For all x 1, x 2 X, x 1 x 2 f(x 1 ) f(x 2 ). When is the function f : X Y not one-to-one? Definition 3.2 yields the following statement: Taking the negation of the condition in f is not one-to-one if and only if, for some x 1, x 2 X, x 1 x 2 and f(x 1 ) = f(x 2 ) Example 3.10: Determine which of the following functions are one-to-one. (a) f 1 : {1, 2, 3} {1, 2, 3, 4}; f 1 (1) = 2, f 1 (2) = 4, f 1 (3) = 2 (b) f 2 : {1, 2, 3} {1, 2, 3, 4}; f 2 (1) = 3, f 2 (2) = 4, f 2 (3) = 1 (c) f : Z Z; f(m) = m 1 (d) g 1 : Z Z; g 1 (m) = 3m + 1 (e) h: Z Z + ; h(m) = m +1 (f) p: Q {1} Q; p(x) = x/(1 x)

3.2 One-to-One Functions and Onto Functions 143 Solution: (a) The function f 1 is not one-to-one since f 1 (1) = 2 = f 1 (3). (b) The function f 2 is one-to-one since no two elements of {1, 2, 3} have the same image under f 2. (c) The function f maps each integer to its predecessor, and it is easily seen to be one-to-one. To give a formal proof, note that, for any integers m 1 and m 2, f(m 1 ) = f(m 2 ) m 1 1 = m 2 1 m 1 = m 2 (d) The function g 1 is also one-to-one: For any integers m 1 and m 2, g 1 (m 1 ) = g 1 (m 2 ) 3m 1 + 1 = 3m 2 + 1 3m 1 = 3m 2 m 1 = m 2 (e) Let s see what happens if we try to prove that h is one-to-one. For arbitrary integers m 1 and m 2, h(m 1 ) = h(m 2 ) m 1 +1 = m 2 +1 m 1 = m 2 However, the fact that m 1 = m 2 does not imply that m 1 = m 2, which leads us to suspect that h is not one-to-one. Indeed, if we let m 1 = 1 and m 2 = 1, then we see that h( 1) = 2 = h(1), which shows that h is not one-to-one. (f) For x 1, x 2 Q {1}, we have the following string of implications: This shows that p is a one-to-one function. p(x 1 ) = p(x 2 ) x 1 1 x 1 = x 2 1 x 2 x 1 (1 x 2 ) = x 2 (1 x 1 ) x 1 x 1 x 2 = x 2 x 1 x 2 x 1 = x 2 Suppose we have a function f : X Y, where both the domain X and the codomain Y are subsets of the set R of real numbers. Is there a way to determine from the graph of f whether f is one-to-one? Well, if f is not one-to-one, then there exist distinct elements x 1, x 2 X such that f(x 1 ) = f(x 2 ). Letting y 1 = f(x 1 ), we have the two distinct points (x 1, y 1 ) and (x 2, y 1 ) that are both on the graph of f and that are also both on the horizontal line y = y 1. Conversely, if some horizontal line intersects the graph of f in more than one point, then f is not one-to-one. This yields the horizontal line test, which is stated as follows: f is one-to-one if and only if every horizontal line intersects the graph of f in at most one point Example 3.11: Apply the horizontal line test to determine which of the functions defined in Example 3.8 are one-to-one. (See Figure 3.1.)

144 Chapter 3 Functions Solution: (a) The function f : R R defined by f(x) = 4 2x is one-to-one by the horizontal line test. (b) The function g: (0, ) (0, ) defined by g(x) = 1/x is also seen to be one-to-one. (c) The function h: R [ 4, ) defined by h(x) = x 2 2x 3 fails the horizontal line test. For example, the line y = 0 (the x axis) intersects the graph in the points ( 1, 0) and (3, 0). Thus, f is not one-to-one. Please be cautioned that the horizontal line test, as well as the vertical line test mentioned in Section 3.1, apply only when both the domain and codomain of the function f under consideration are subsets of R. Given a function f : X Y, what can be said about im f? Having no specific information about f, all that can be said is that im f is a subset of Y. One extreme possibility is provided by the example g: X Y defined by g(x) = y 0, where y 0 is a fixed element of Y. In this case, im f = {y 0 }, and g is called a constant function (the value of g is constant at y 0 ). The other extreme case is that of a function f : X Y for which im f = Y. Definition 3.3: A function f : X Y is called onto provided im f = Y. Observe that a function f : X Y is onto provided, for each y Y, there exists an x X such that f(x) = y. In other words, f is onto if and only if each y Y has at least one preimage under f. This condition provides a common method for proving that a given function f : X Y is onto. We choose an arbitrary element y Y, set f(x) = y, and then attempt to solve this equation for x in terms of y. If a solution x exists and is in X, then f is onto. On the other hand, if for some y Y there is no solution x X to the equation f(x) = y, then f is not onto. This method is illustrated in the next example. Example 3.12: Determine which of the following functions are onto. (a) h 1 : {1, 2, 3, 4} {1, 2, 3}; h 1 (1) = 2, h 1 (2) = 3, h 1 (3) = 2, h 1 (4) = 3 (b) h 2 : {1, 2, 3, 4} {1, 2, 3}; h 2 (1) = 3, h 2 (2) = 1, h 2 (3) = 2, h 2 (4) = 1 (c) f : Z Z; f(m) = m 1 (d) g 1 : Z Z; g 1 (m) = 3m + 1 (e) h: Z Z + ; h(m) = m +1 (f) p: Q {1} Q; p(x) = x/(1 x) (g) g 2 : Q Q; g 2 (x) = 3x + 1 Solution: (a) The function h 1 is not onto since im h 1 = {2, 3} {1, 2, 3}. (b) The function h 2 is onto since im h 2 = {1, 2, 3}, the codomain of h 2. (c) The function f is onto since, for any m Z, f(m + 1) = (m + 1) 1 = m

3.2 One-to-One Functions and Onto Functions 145 (d) Note that im g 1 = {3m + 1 m Z} = {..., 5, 2, 1, 4, 7,...} Since im g 1 Z, g 1 is not onto. (e) For n Z +, h(m) = n m +1 = n m = n 1 m = n 1 or m = 1 n Thus, each n 2 is the image of two integers, namely, n 1 and 1 n. Also, 1 is the image of 0. This shows that h is onto. (f) For y Q, p(x) = y x 1 x = y x = y xy x + xy = y x(1 + y) = y x = y 1 + y Thus, if y 1, then x = y/(1 + y) Q {1} and p(x) = y. However, there does not exist x Q {1} such that p(x) = 1. Therefore, im p = Q { 1}, and the function p just misses being onto. (g) Note that the function g 2 has the same rule as the function g 1 of part (d), but the domain and codomain have been changed from Z to Q. Let s see what happens. Let y Q; we wish to find x Q such that g 2 (x) = y. Now, g 2 (x) = y 3x + 1 = y x = y 1 3 This shows that g 2 is onto; for each rational number y, the image of the rational number x = (y 1)/3 is y. This example illustrates the important point that whether a given function is onto depends not only on the defining formula of the function, but on the domain and codomain as well. We have seen examples of functions that are one-to-one and not onto, and the reverse possibility, functions that are onto but not one-to-one. Under what conditions does the existence of one condition imply the other? One very important case is supplied by the following theorem. Theorem 3.1: Let X and Y be nonempty finite sets and let f be a function from X to Y. 1. If f is one-to-one, then X Y. 2. If f is onto, then X Y. 3. If f is one-to-one and onto, then X = Y. 4. If X = Y, then f is one-to-one if and only if f is onto. (That is, if X = Y, then either f is both one-to-one and onto, or f is neither one-to-one nor onto.)

146 Chapter 3 Functions Proof: We prove part 4. You are asked to prove parts 1 and 2 in Exercise 14; note that part 3 follows immediately from parts 1 and 2. For part 4, let X = Y = n; assume X = {x 1, x 2,..., x n }. Under this assumption, we must prove the following two implications: (1) If f is one-to-one, then f is onto. (2) If f is onto, then f is one-to-one. To prove (1), assume f is one-to-one. Note that the image of f is the set im f = {f(x) x X} = {f(x 1 ), f(x 2 ),..., f(x n )} Suppose f(x i ) = f(x j ) for some i and j. Since f is one-to-one, f(x i ) = f(x j ) implies that x i = x j, and hence that i = j. This shows that f(x 1 ), f(x 2 ),..., f(x n ) are distinct elements of Y. Thus, we have both im f Y and im f = Y. We may conclude that im f = Y, thus proving that f is onto. To prove (2), assume that f is onto. Then im f = Y. Thus, {f(x 1 ), f(x 2 ),..., f(x n )} = Y and Y = n, so it follows that f(x 1 ), f(x 2 ),..., f(x n ) are distinct elements. Hence, x i x j implies that f(x i ) f(x j ), which shows that f is one-to-one. Theorem 3.1, part 3, is often applied to prove that two finite sets X and Y have the same cardinality. To show that X = Y, it suffices, by Theorem 3.1, part 3, to construct a one-to-one and onto function from X to Y. This may seem like a rather roundabout way to do things, but it is often quite enlightening. Such a proof is called a bijective proof, and several examples of such proofs are given in Chapter 5. The following example illustrates the application of Theorem 3.1, part 4. Example 3.13: Consider the function f : Z 30 Z 30 defined by f(x) = 7x. Let x 1, x 2 Z 30 ; the following steps show that f is one-to-one: f(x 1 ) = f(x 2 ) 7x 1 = 7x 2 7x 1 mod 30 = 7x 2 mod 30 30 (7x 1 7x 2 ) (by Theorem 2.6) 30 [ 7(x 1 x 2 ) ] 30 (x 1 x 2 ) (since gcd(7, 30) = 1) x 1 mod 30 = x 2 mod 30 (by Theorem 2.6) x 1 = x 2 We now obtain that f is onto with no additional work; we simply apply Theorem 3.1, part 4! It should be emphasized that to apply Theorem 3.1, part 4, to a function f, the domain and codomain of f must be finite sets with the same cardinality. For example, define f and g on Z by f(m) = 2m and g(m) = m/2. It can then be checked that f is one-to-one but not onto, whereas g is onto but not one-to-one. (Remember, the set Z is an infinite set!) Now let X = {x 1, x 2,..., x n } and suppose that f : X X is a one-to-one function. Then it follows that the n-tuple (f(x 1 ), f(x 2 ),..., f(x n )) is simply an ordered arrangement of the elements

3.2 One-to-One Functions and Onto Functions 147 of X. Indeed, in this sense any one-to-one and onto function on a set can be regarded as selecting the elements of the set in some order, or permuting the elements of the set. Definition 3.4: Let X and Y be nonempty sets. A function f : X Y that is both one-to-one and onto is called a bijection from X to Y. If X = Y, then f is called a permutation of X. Example 3.14: Define the function f on {1, 2, 3, 4} by f(1) = 3, f(2) = 2, f(3) = 4, and f(4) = 1. It is easily checked that f is one-to-one and onto, and so f is a permutation of {1, 2, 3, 4}; note that (f(1), f(2), f(3), f(4)) = (3, 2, 4, 1). Consider again the functions in Examples 3.10 and 3.12. The function f : Z Z defined by f(m) = m 1 is a permutation of Z. In Example 3.12, part (g), we showed that the function g 2 : Q Q defined by g 2 (x) = 3x + 1 is onto. It can also be shown that g 2 is one-to-one. Therefore, g 2 is a permutation of Q. Lastly, consider the function p of part (f); if we modify the function p by changing its codomain to Q { 1}, that is, if we define p: Q {1} Q { 1} by p(x) = x/(1 x), then p is a bijection from Q {1} to Q { 1}. Suppose now that f is a function from X to Y ; recall that im f = {f(x) x X}. It seems natural to write im f = f(x). More generally, for any subset A of X, we define the image of A under f to be the set f(a) = {f(x) x A} Similarly, for any subset B of Y, it is helpful to be able to easily refer to the set of preimages of elements of B. Formally, we define the preimage (or inverse image) of B under f to be the set f 1 (B) = {x X f(x) B} Symbolically, note that, for y Y, y f(a) x A(y = f(x)) and for x X, x f 1 (B) f(x) B Example 3.15: Define f : {1, 2, 3, 4, 5,6,7} {1, 2, 3, 4, 5} by f(1) = 2 = f(3) = f(6), f(2) = 1, f(4) = 5 = f(7), and f(5) = 4. Let Find each of the following: A 1 = {1, 2, 3, 4}, A 2 = {2, 3, 7}, B 1 = {2, 4}, B 2 = {3, 4, 5} (a) f(a 1 A 2 ) (b) f(a 1 ) f(a 2 ) (c) f 1 (B 1 B 2 ) (d) f 1 (B 1 ) f 1 (B 2 ) (e) f(a 1 A 2 ) (f) f(a 1 ) f(a 2 ) (g) f 1 (B 1 B 2 ) (h) f 1 (B 1 ) f 1 (B 2 ) (i) f(a 1 A 2 ) (j) f(a 1 ) f(a 2 ) (k) f 1 (B 1 B 2 ) (l) f 1 (B 1 ) f 1 (B 2 )

148 Chapter 3 Functions Solution: For part (a) we have the following: And for part (b) we obtain: f(a 1 A 2 ) = f({1, 2, 3, 4} {2, 3, 7}) = f({1, 2, 3, 4, 7}) = {1, 2, 5} f(a 1 ) f(a 2 ) = f({1, 2, 3, 4}) f({2, 3, 7}) = {1, 2, 5} {1, 2, 5} = {1, 2, 5} Note that f(a 1 A 2 ) = f(a 1 ) f(a 2 ). For parts (c) and (d) we obtain the following: f 1 (B 1 B 2 ) = f 1 ({2, 4} {3, 4, 5}) = f 1 ({2, 3, 4, 5}) = {1, 3, 4, 5, 6,7} f 1 (B 1 ) f 1 (B 2 ) = f 1 ({2, 4}) f 1 ({3, 4, 5}) = {1, 3, 5, 6} {4, 5, 7} = {1, 3, 4, 5, 6,7} Note that f 1 (B 1 B 2 ) = f 1 (B 1 ) f 1 (B 2 ). For parts (e) and (f) we have: f(a 1 A 2 ) = f({1, 2, 3, 4} {2, 3, 7}) = f({2, 3}) = {1, 2} f(a 1 ) f(a 2 ) = f({1, 2, 3, 4}) f({2, 3, 7}) = {1, 2, 5} {1, 2, 5} = {1, 2, 5} Here we see that f(a 1 A 2 ) f(a 1 ) f(a 2 ), although it is the case that f(a 1 A 2 ) is a subset of f(a 1 ) f(a 2 ). Computing the sets for parts (g) and (h) we find that: f 1 (B 1 B 2 ) = f 1 ({2, 4} {3, 4, 5}) = f 1 ({4}) = {5} f 1 (B 1 ) f 1 (B 2 ) = f 1 ({2, 4}) f 1 ({3, 4, 5}) = {1, 3, 5, 6} {4, 5, 7} = {5} Thus, we see that f 1 (B 1 B 2 ) and f 1 (B 1 ) f 1 (B 2 ) are equal in this example. Next, for parts (i) and (j), observe that: f(a 1 A 2 ) = f({1, 2, 3, 4} {2, 3, 7}) = f({1, 4}) = {2, 5} f(a 1 ) f(a 2 ) = f({1, 2, 3, 4}) f({2, 3, 7}) = {1, 2, 5} {1, 2, 5} = So f(a 1 A 2 ) and f(a 1 ) f(a 2 ) are not equal in this example, although it is true that f(a 1 ) f(a 2 ) is a subset of f(a 1 A 2 ). Finally, for parts (k) and (l) we find that: f 1 (B 1 B 2 ) = f 1 ({2, 4} {3, 4, 5}) = f 1 ({2}) = {1, 3, 6} f 1 (B 1 ) f 1 (B 2 ) = f 1 ({2, 4}) f 1 {3, 4, 5} = {1, 3, 5, 6} {4, 5, 7} = {1, 3, 6} So, it turns out that f 1 (B 1 B 2 ) = f 1 (B 1 ) f 1 (B 2 ) in this case. Example 3.16: Let g be the permutation of Q defined by g(x) = 3x + 1. Find the following images and preimages. (a) g(z) (c) g 1 (Z + ) (b) g(2z) (d) g 1 (2Z)

3.2 One-to-One Functions and Onto Functions 149 Solution: (a) For m Z, g(m) = 3m + 1. Thus, g(z) = {3m + 1 m Z} = {..., 5, 2, 1, 4, 7,...} that is, g(z) is the set of integers that yield a remainder of 1 when divided by 3, namely, 1 + 3Z. (b) Here we find that y g(2z) y = g(2m) (for some m Z) y = 3(2m) + 1 y = 6m + 1 Hence, g(2z) = {6m + 1 m Z} = {..., 11, 5, 1, 7, 13,...} = 1 + 6Z. (c) For this part we have that It follows that x g 1 (Z + ) g(x) Z + 3x + 1 = n (for some n Z + ) x = n 1 3 g 1 (Z + ) = {(n 1)/3 n Z + } = {0, 1 3, 2 3, 1, 4 3, 5 } 3, 2,... (d) Proceeding in a similar manner for this part, we find that: x g 1 (2Z) g(x) 2Z 3x + 1 = 2m + 1 (for some m Z) x = 2m 3 It follows that g 1 (2Z) = {2m/3 m Z} = {..., 4 3, 2 3, 0, 2 3, 4 } 3,... Example 3.15 illustrates some of the general properties of images and preimages with respect to the set operations of union, intersection, and difference. These properties, along with two others, are listed in the following theorem. Theorem 3.2: Given f : X Y, let A 1 and A 2 be subsets of X and let B 1 and B 2 be subsets of Y. Then the following properties hold: 1. (a) f(a 1 A 2 ) = f(a 1 ) f(a 2 ) (b) f 1 (B 1 B 2 ) = f 1 (B 1 ) f 1 (B 2 ) 2. (a) f(a 1 A 2 ) f(a 1 ) f(a 2 ) (b) f 1 (B 1 B 2 ) = f 1 (B 1 ) f 1 (B 2 ) 3. (a) f(a 1 ) f(a 2 ) f(a 1 A 2 ) (b) f 1 (B 1 ) f 1 (B 2 ) = f 1 (B 1 B 2 ) 4. (a) If A 1 A 2, then f(a 1 ) f(a 2 ). (b) If B 1 B 2, then f 1 (B 1 ) f 1 (B 2 ).

150 Chapter 3 Functions Proof: We prove 1(a) and 3(b), and leave the remaining parts for you to prove in Exercise 2. To show that f(a 1 A 2 ) = f(a 1 ) f(a 2 ), we show that each side is a subset of the other. If y f(a 1 A 2 ), then there is some x A 1 A 2 such that y = f(x). This element x is such that x A 1 or x A 2. If x A 1, then y = f(x) f(a 1 ). Similarly, if x A 2, then y f(a 2 ). Hence, y f(a 1 ) or y f(a 2 ), that is, y f(a 1 ) f(a 2 ). This shows that f(a 1 A 2 ) f(a 1 ) f(a 2 ). To show the reverse inclusion, suppose y f(a 1 ) f(a 2 ). Then y f(a 1 ) or y f(a 2 ). This means that y = f(x), where x A 1 or x A 2. Thus, x A 1 A 2, which shows that y f(a 1 A 2 ). Therefore, f(a 1 ) f(a 2 ) f(a 1 A 2 ), and this completes the proof of this part. The proof that f 1 (B 1 ) f 1 (B 2 ) = f 1 (B 1 B 2 ) is easily done using a string of biconditionals as follows: x f 1 (B 1 ) f 1 (B 2 ) x f 1 (B 1 ) and x / f 1 (B 2 ) f(x) B 1 and f(x) / B 2 Therefore, f 1 (B 1 ) f 1 (B 2 ) = f 1 (B 1 B 2 ). f(x) B 1 B 2 x f 1 (B 1 B 2 ) Exercise Set 3.2 1. Each part gives a function; determine whether it is one-to-one. (a) f : Z Z + ; f(m) = m 2 + 1 (b) g: Q Q; g(x) = x 3 (c) h: R R; h(x) = x 3 x (d) p: Q R; p(x) = 2 x (e) the cardinality function k from P({1, 2,..., n}) (where n is a fixed positive integer) to {0, 1,..., n}; k(x) = X (f) the complement function c on P({1, 2,..., n}) (where n is a fixed positive integer); c(x) = X 2. Prove the remaining parts of Theorem 3.2: (a) part 1(b) (c) part 2(b) (e) part 4(a) (b) part 2(a) (d) part 3(a) (f) part 4(b) 3. For each of the functions in Exercise 1, determine whether it is onto. 4. List all the one-to-one functions from {1, 2} to {1, 2, 3, 4}. (Note: A function with domain {1, 2,..., n} may be specified by giving its images in a list: (f(1), f(2),..., f(n)).) 5. Each part gives sets X and Y and a function from X to Y. Determine whether the function is one-to-one. (a) X = {1, 2, 3, 4}, Y = {1, 2, 3}; f 1 (1) = 2, f 1 (2) = 3, f 1 (3) = 1 = f 1 (4) (b) X = {1, 2, 3}, Y = {1, 2, 3, 4}; f 2 (1) = 3, f 2 (2) = 2, f 2 (3) = 1 (c) X = Y = {1, 2, 3, 4}; f 3 (1) = 2 = f 3 (3), f 3 (2) = 1 = f 3 (4) (d) X = Y = {1, 2, 3, 4}; f 4 (1) = 3, f 4 (2) = 4, f 4 (3) = 1, f 4 (4) = 2 (e) X = Y = Z; f 5 (m) = m

3.2 One-to-One Functions and Onto Functions 151 (f) X = Y = Z; (g) X = Y = Z + ; (h) X = Y = Z + ; f 7 (n) = f 6 (m) = f 8 (n) = { 3m if m < 0 2m if m 0 { (n + 1)/2 if n is odd n/2 if n is even { n + 1 if n is odd n 1 if n is even 6. List all the functions from {1, 2, 3, 4} onto {1, 2}. 7. For each of the functions in Exercise 5, determine whether it is onto. 8. Each part gives a set; list the permutations of that set. (a) {1} (b) {1, 2} (c) {1, 2, 3} 9. Each part gives a function; determine whether it is one-to-one. (a) f 1 : Z 10 Z 10 ; f 1 (x) = 3 x (b) f 2 : Z 10 Z 10 ; f 2 (x) = 5 x (c) f 3 : Z 36 Z 36 ; f 3 (x) = 3 x (d) f 4 : Z 36 Z 36 ; f 4 (x) = 5 x (e) f 5 : Z 10 Z 10 ; f 5 (x) = x + 5 (f) f 6 : Z 10 Z 10 ; f 6 (x) = (3 x) + 5 (g) f 7 : Z 12 Z; f 7 (x) = 2 x (h) f 8 : Z 8 Z 12 ; f 8 (x) = 3 x (i) f 9 : Z 6 Z 12 ; f 9 (x) = 2 x (j) f 0 : Z 12 Z 36 ; f 0 (x) = 6 x 10. Let n be a positive integer and let k Z n. Define f : Z n Z n by f(x) = k x. Give a necessary and sufficient condition on k for f to be a permutation of Z n. 11. For each of the functions in Exercise 9, determine whether it is onto. 12. Each part gives a function on Z 12. You are to determine whether the function is a permutation. Also, find the image of A = {1, 5, 7, 11} and the preimage of B = {4, 8}. (a) f 1 (x) = 2 x (b) f 2 (x) = 4 x (c) f 3 (x) = 5 x (d) f 4 (x) = x + 5 13. Give an example of a function on Z + that is: (a) neither one-to-one nor onto (c) onto but not one-to-one (b) one-to-one but not onto (d) both one-to-one and onto 14. Prove Theorem 3.1: (a) part 1 (b) part 2 15. Give an example of a function on (the closed interval) [ 1, 1 ] that is: (a) neither one-to-one nor onto (c) onto but not one-to-one (b) one-to-one but not onto (d) both one-to-one and onto

152 Chapter 3 Functions 16. Let X and Y be nonempty sets and let f be a function from X to Y. Complete each of the following statements by inserting the correct relation:,, or =. (a) f is one-to-one if and only if f 1 ({y}) 1 for every y Y. (b) f is onto if and only if f 1 ({y}) 1 for every y Y. (c) f is a bijection if and only if f 1 ({y}) 1 for every y Y. 17. Each of the following parts refers to the function defined in the corresponding part of Exercise 5. You are given a subset A of X and a subset B of Y ; find the image of A and the preimage of B. (a) A = {1, 2} = B (b) A = {1, 3}, B = {2, 4} (c) A = {1, 3}, B = {1} (d) A = {2} = B (e) A = 2Z, B = Z + (f) A = Z +, B = 2Z (g) A = B = 2Z + (h) A = B = 2Z + 3.3 INVERSE FUNCTIONS AND COMPOSITION Let X and Y be nonempty sets and f be a function from X to Y. Suppose that f is a bijection (that is, f is both one-to-one and onto). Since f is onto, given any y Y, there is an element x X such that f(x) = y. Moreover, since f is one-to-one, this element x is uniquely determined. Thus, for each y Y, there is exactly one x X such that y = f(x). (See Exercise 16 in Exercise Set 3.2.) We can then define a new function g: Y X as follows: For y Y, g(y) = x if and only if f(x) = y In other words, g(y) is that unique element x X for which f(x) = y. Definition 3.5: Let f : X Y be a bijection. The function g: Y X defined by g(y) = x if and only if f(x) = y is called the inverse function of f and is denoted by f 1. The situation of a function f : X Y and its inverse function g = f 1 : Y X is depicted in Figure 3.3, where f(x 0 ) = y 0. In this situation, suppose that B is a subset of Y. At this point in our discussion of functions, we have two possible interpretations for the notation f 1 (B): one is that f 1 (B) denotes the preimage of B under f, and the other is that f 1 (B) denotes the image of B under f 1. In Exercise 2, you are asked to show that these two sets are, in fact, the same, and so there is no problem. It should be pointed out, however, that if f is not a bijection, then f 1 (B) can mean only the preimage of B under f. Theorem 3.3: If f : X Y is a bijection, then the inverse function f 1 : Y X is also a bijection. Proof: We first show that f 1 is one-to-one. Suppose f 1 (y 1 ) = x = f 1 (y 2 ) for some y 1, y 2 Y and x X. Then, by definition, y 1 = f(x) and y 2 = f(x). Since f is a function, x has a unique image under f, and it follows that y 1 = y 2. Thus, f 1 is one-to-one.

3.3 Inverse Functions and Composition 153 Figure 3.3 A function and its inverse Next we show that f 1 is onto. Let x X, and let y = f(x). Then, by the definition of f 1, it follows that x = f 1 (y). This shows that any x X has a preimage under f 1, and so f 1 is onto. Corollary 3.4: Let X be a nonempty set. If f is a permutation of X, then f 1 is also a permutation of X. Example 3.17: Define f : {1, 2, 3, 4, 5} {1, 2, 3, 4,5} by f(1) = 3, f(2) = 4, f(3) = 5, f(4) = 1, and f(5) = 2, that is, f is the permutation (3, 4, 5, 1, 2) of {1, 2, 3, 4, 5}. Find f 1. Solution: Since f(1) = 3, we know that f 1 (3) = 1. Similarly, f 1 (4) = 2, f 1 (5) = 3, f 1 (1) = 4, and f 1 (2) = 5. Therefore, f 1 : {1, 2, 3, 4, 5} {1, 2, 3, 4, 5} is defined by f 1 (1) = 4, f 1 (2) = 5, f 1 (3) = 1, f 1 (4) = 2, f 1 (5) = 3 that is, f 1 is the permutation (4, 5, 1, 2, 3) of {1, 2, 3, 4, 5}. If f : X Y is a bijection, how do we find its inverse function? For example, given f : Q Q defined by f(x) = 3x + 1, let s attempt to find f 1. Given y Q, we want to find x Q such that f 1 (y) = x. This means that y = f(x), so that y = 3x + 1. Solving for x we obtain x = (y 1)/3. Thus, f 1 : Q Q is defined by f 1 (y) = y 1 3

154 Chapter 3 Functions In general, given a bijection y = f(x), we solve for x in terms of y to obtain x = f 1 (y) Example 3.18: We saw previously that the function p: Q {1} Q { 1}, defined by p(x) = x/(1 x), is a bijection. Find p 1. Solution: If y Q { 1} and p 1 (y) = x, where x Q {1}, then p(x) = y. We then proceed algebraically as follows: x y = y x = y xy x + xy = y x(1 + y) = y x = 1 x 1 + y Therefore, p 1 : Q { 1} Q {1} is given by p 1 (y) = y 1 + y Example 3.19: We saw in Example 3.13 that the function f : Z 30 Z 30 defined by f(x) = 7x is a permutation of Z 30. Find f 1. Solution: If y Z 30 and f 1 (y) = x, where x Z 30, then f(x) = y, that is, 7x = y. We want to solve this equation for x. We do this by multiplying both sides of the equation by the reciprocal of 7 in Z 30 (since gcd(7, 30) = 1, the element 7 has a reciprocal in Z 30 ): 7 x = y 7 1 (7 x) = 7 1 y (7 1 7) x = 7 1 y 1 x = 7 1 y x = 7 1 y Thus, f 1 : Z 30 Z 30 is defined by f 1 (y) = 7 1 y. To complete the problem, we need to find 7 1. Recall that this can be done by using the extended Euclidean algorithm. Using this algorithm, we find that 1 = 7(13) + 30t for some integer t. Therefore, 7 1 = 13, and so f 1 (y) = 13 y. There are various ways in which two functions may be combined to produce a third function. One of the more common and important operations on functions is called composition. Suppose f is a function from X to Y and g is a function from Y to Z. For any x X, there is a unique y Y such that y = f(x). Then, for this element y, there is a unique z Z such that z = g(y) = g(f(x)). Hence, for each x X, there is associated a unique element z Z, namely, z = g(f(x)). This association allows us to define a new function h: X Z by h(x) = g(f(x)). This situation is depicted in Figure 3.4.

3.3 Inverse Functions and Composition 155 Figure 3.4 Composition of functions Definition 3.6: Given f : X Y and g: Y Z, the composition of f followed by g (or composite function) is the function g f : X Z defined by (g f)(x) = g(f(x)) Example 3.20: Define f : Z 2Z by f(m) = 2m, and define g: 2Z Z + by g(m) = m /2 + 1. Then g f : Z Z + is given by (g f)(m) = g(f(m)) = g(2m) = 2m 2 + 1 = m +1 Example 3.21: Define f : Q {0} Q {1} by f(x) = (x + 1)/x and g: Q {1} Q {2} by g(x) = 3x 1. Then g f : Q {0} Q {2} is given by ( ) x + 1 (g f)(x) = g(f(x)) = g x ( ) x + 1 = 3 1 x 3(x + 1) = x x x = 2x + 3 x

156 Chapter 3 Functions Example 3.22: Define f : Z Z by f(m) = m + 3 and g: Z Z by g(m) = m. Then f g: Z Z is given by whereas g f : Z Z is given by (f g)(m) = f(g(m)) = f( m) = m + 3 (g f)(m) = g(f(m)) = g(m + 3) = (m + 3) = m 3 Note that f g g f; also note that f, g, f g, and g f are all permutations of Z. Let f and g be two functions from X to Y. When is it the case that f = g? Since f and g are functions, each is a subset of X Y, and we already know when two sets are equal. Thus, we say that f = g provided the condition f(x) = g(x) holds for every x X. There are several interesting results that involve composition of functions and the properties onto and one-to-one. For example, suppose f : X Y is a bijection; then f 1 : Y X exists. Given x X with f(x) = y, we have that f 1 (y) = x and, hence, f 1 (f(x)) = x. So the composite function f 1 f : X X satisfies the property (f 1 f)(x) = x for all x X. In a similar fashion, we can determine that f f 1 : Y Y satisfies the condition (f f 1 )(y) = y for every y Y. Note that both of f f 1 and f 1 f are functions of the type h: A A, where h(a) = a for all a A. Definition 3.7: For any nonempty set A, the function i A : A A defined by i A (a) = a is called the identity function on A. In view of the preceding discussion, if f : X Y is a bijection, then f 1 f = i X and f f 1 = i Y. A very basic and easily verified property of identity functions is contained in the following theorem, whose proof is left to Exercise 4. Theorem 3.5: Let X and Y be nonempty sets. For any function f : X Y, i Y f = f and f i X = f Theorem 3.6: Given f : X Y and g: Y Z, the following properties hold: 1. If f and g are both one-to-one, then g f is one-to-one. 2. If f and g are both onto, then g f is onto. Proof: We prove part 2; you are asked to prove part 1 in Exercise 6.

3.3 Inverse Functions and Composition 157 Assume f and g are both onto. To prove that g f is onto, we begin with an arbitrary element z 0 Z. Since g is onto, there is an element y 0 Y such that g(y 0 ) = z 0. Then, since y 0 Y and f is onto, there is some element x 0 X such that f(x 0 ) = y 0. Thus, (g f)(x 0 ) = g(f(x 0 )) = g(y 0 ) = z 0 and it follows that g f is onto. Corollary 3.7: If f : X Y and g: Y Z are both bijections, then the function g f : X Z is also a bijection. In particular, if X = Y = Z so that f and g are both permutations of X, then g f is a permutation of X. For each of the statements in Theorem 3.6, the converse is false (see Exercises 8 and 10). However, a partial converse does hold. Theorem 3.8: Given f : X Y and g: Y Z, the following properties hold: 1. If g f is one-to-one, then f is one-to-one. 2. If g f is onto, then g is onto. Proof: We prove part 1; you are asked to prove part 2 in Exercise 12. Assume g f is one-to-one, and suppose that f(x 1 ) = f(x 2 ) for some x 1, x 2 X. Then, since f(x 1 ) Y, we have g(f(x 1 )) = g(f(x 2 )), that is, (g f)(x 1 ) = (g f)(x 2 ). Then, since g f is one-to-one, it may be concluded that x 1 = x 2. Therefore, f is one-to-one. Given functions f : A B, g: B C, and h: C D, notice that h g is a function from B to D and that g f is a function from A to C. Thus, (h g) f and h (g f) are both functions from A to D. In fact, they are equal functions. In other words, the associative property holds for composition of functions. Theorem 3.9: Given f : A B, g: B C, and h: C D, the following property holds: (h g) f = h (g f) Proof: Both (h g) f and h (g f) have domain A and codomain D. Hence, to show equality, we must show that the two functions have the same value at each x A. Proceeding, we obtain the following: [ (h g) f ] (x) = (h g) [ f(x) ] = h(g(f(x))) = h [ (g f)(x) ] = [ h (g f) ] (x)

158 Chapter 3 Functions Therefore, (h g) f = h (g f). Exercise Set 3.3 1. Find the inverse of each of the following functions. (a) f 1 : Q Q; f 1 (x) = 4x + 2 (b) f 2 : Q {1} Q {2}; f 2 (x) = 2x/(x 1) (c) f 3 : Z 12 Z 12 ; f 3 (x) = 5 x (d) f 4 : Z 39 Z 39 ; f 4 (x) = (5 x) + 2 (e) f 5 : Z Z; f 5 (m) = m + 1 { 2m 1 if m > 0 (f) f 6 : Z {0, 1, 2, 3,...}; f 6 (m) = 2m if m 0 (g) f 7 : {1, 2, 3, 4} {1, 2, 3, 4}; f 7 (1) = 4, f 7 (2) = 1, f 7 (3) = 2, f 7 (4) = 3 (h) f 8 : {1, 2, 3, 4} {1, 2, 3, 4}; f 8 (1) = 3, f 8 (2) = 4, f 8 (3) = 1, f 8 (4) = 2 2. Let f : X Y be a bijection and let B be a subset of Y. Let A 1 be the preimage of B under f, and let A 2 be the image of B under f 1. Show that A 1 = A 2. 3. Find g f. (a) f : Z Z + ; f(m) = m +1, g: Z + Q + ; g(n) = 1/n (b) f : R (0, 1); f(x) = 1/(x 2 + 1), g: (0, 1) (0, 1); g(x) = 1 x (c) f : Q {2} Q {0}; f(x) = 1/(x 2), g: Q {0} Q {0}; g(x) = 1/x (d) f : R [1, ); f(x) = x 2 + 1, g: [1, ) [0, ); g(x) = x 1 (e) f : Q {10/3} Q {3}; f(r) = 3r 7, g: Q {3} Q {2}; g(r) = 2r/(r 3) (f) f : Z Z 5 ; f(m) = m mod 5, g: Z 5 Z 5 ; g(m) = m + 1 (g) f : Z 8 Z 12 ; f(m) = 3 m, g: Z 12 Z 6 ; g(m) = 2 m (h) f, g: {1, 2, 3, 4} {1, 2, 3, 4}; 4. Prove Theorem 3.5. f(1) = 4 f(2) = 1 f(3) = 2 f(4) = 3 g(1) = 3 g(2) = 4 g(3) = 1 g(4) = 2 5. Given the permutations f and g, find f 1, g 1, f g, (f g) 1, and g 1 f 1. (a) f : Z Z; f(m) = m + 1, g: Z Z; g(m) = 2 m (b) f : Z 7 Z 7 ; f(m) = m + 3, g: Z 7 Z 7 ; g(m) = 2 m (c) f, g: {1, 2, 3, 4} {1, 2, 3, 4}; (d) f, g: {1, 2, 3, 4} {1, 2, 3, 4}; f(1) = 4 f(2) = 1 f(3) = 2 f(4) = 3 g(1) = 3 g(2) = 4 g(3) = 1 g(4) = 2 f(1) = 2 f(2) = 4 f(3) = 3 f(4) = 1 g(1) = 1 g(2) = 3 g(3) = 4 g(4) = 2 (e) f : Q Q; f(x) = 4x, g: Q Q; g(x) = (x 3)/2 (f) f : Q {1} Q {1}; f(x) = 2x 1, g: Q {1} Q {1}; g(x) = x/(x 1)

Chapter Problems 159 6. Prove Theorem 3.6, part 1. 7. For the permutations f and g given in Exercise 5, find g f and f 1 g 1. 8. Give an example of sets X, Y, and Z, and of functions f : X Y and g: Y Z, such that g f and f are both one-to-one, but g is not one-to-one. 9. Define the functions f and g on your (maternal) family tree by f(x) = the mother of x and g(x) = the eldest child of the mother of x. Describe each of these functions. (a) f f (c) g f (b) f g (d) g g 10. Give an example of sets X, Y, and Z, and of functions f : X Y and g: Y Z, such that g f and g are both onto, but f is not onto. 11. Let f : X Y be a bijection. Prove that (f 1 ) 1 = f. 12. Prove Theorem 3.8, part 2. 13. Let f : X Y and g: Y Z be bijections. Prove that (g f) 1 = f 1 g 1 14. Let f : X Y and g: Y X be bijections. Prove: If g f = i X (or f g = i Y ), then g = f 1. CHAPTER PROBLEMS 1. Define f : R R by f(x) = x 3 + 2. (a) Show that f is a permutation of R. (b) Find f 1. (c) Suppose the domain and codomain of f are changed from R to Q. Is f a permutation of Q? 2. Show that there are infinitely many pairs of distinct functions f and g on Q such that none of f, g, nor f g is the identity function on Q and f g = g f. (Hint: Consider linear functions.) 3. Define f : R R by f(x) = 4x + 1. (a) Show that f is a permutation of R. (b) Find f 1. (c) Suppose the domain and codomain of f are changed from R to Q. Is f a permutation of Q? (d) Suppose the domain and codomain of f are changed from R to Z. Is f a permutation of Z? 4. Let X and Y be nonempty sets and let f : X Y be a function. Prove that, if the condition f(a 1 A 2 ) = f(a 1 ) f(a 2 ) holds for all subsets A 1 and A 2 of X, then f is one-to-one, and conversely. (Hint: For necessity, by Theorem 3.2, part 2(a), it suffices to prove that, if f is one-to-one, then f(a 1 ) f(a 2 ) f(a 1 A 2 ); for sufficiency, prove the contrapositive.)

160 Chapter 3 Functions 5. Let f : X Y, where X and Y are subsets of R. The function f is said to be increasing provided the following condition holds for all x 1, x 2 X: x 1 < x 2 f(x 1 ) < f(x 2 ) Similarly, f is said to be decreasing provided the following condition holds for all x 1, x 2 X: x 1 < x 2 f(x 1 ) > f(x 2 ) If f is either increasing or decreasing, then we say that f is monotonic. (a) Prove that a monotonic function is one-to-one. (b) Define f : ( 1, 1) R by f(x) = x/(1 x 2 ). Apply the result of part (a) to show that f is one-to-one. (c) Define g: R R by g(x) = x 3 + x 2. Apply the result of part (a) to show that g is one-to-one. (Hint: Show that g (x) > 0 and apply a result from calculus.) 6. Let X and Y be nonempty sets and let f : X Y be a function. Prove the following results. (a) If the condition f(f 1 (B)) = B holds for every subset B of Y, then f is onto, and conversely. (b) If the condition f 1 (f(a)) = A holds for every subset A of X, then f is one-to-one, and conversely. (Hint: In both parts, prove necessity directly and sufficiency by contrapositive. Also, recall that to prove two sets V and W are equal, it suffices to prove that both V W and W V.) 7. Let f, g, and h be functions on Z defined as follows: f(m) = m + 1, g(m) = 2m, and { 0 if m is even h(m) = 1 if m is odd Determine the following composite functions. (a) f g (c) f h (e) g h (g) g g (b) g f (d) h f (f) h g (h) h f g 8. Let U be a nonempty universal set. For A U, define the function χ A : U {0, 1} by { 0 if x / A χ A (x) = 1 if x A The function χ A is called the characteristic function of A. For A, B P(U), let C = A B, D = A B, and E = A B. Prove that the following relations hold for all x U: (a) χ C (x) = χ A (x) χ B (x) (b) χ D (x) = χ A (x) + χ B (x) [χ A (x) χ B (x)] (c) χ U (x) = 1 (d) χ (x) = 0 (e) χ B (x) = 1 χ B (x) (f) χ E (x) = χ A (x) [1 χ B (x)]

Chapter Problems 161 9. Define f : Z 119 Z 119 by f(x) = 15 x. Show that f is a permutation of Z 119 and find f 1. 10. Let X be a nonempty set, let i denote the identity function on X, and let f be a function on X. Define f 0 = i, f 1 = f, f 2 = f f, f 3 = f f f, and so on. (Recursively, f 0 = i and f n = f f n 1, for n 1.) In particular, take the case X = Z; give an example of a function f : Z Z such that: (a) f i but f 2 = i (b) f 2 i but f 3 = i (Hint: Define f by f(1) = 2, f(2) = 3, f(3) = 1, and f(x) = x for x / {1, 2, 3}.) (c) Generalize parts (a) and (b); for each n > 1, give an example of a function f : Z Z such that f i,..., f n 1 i, but f n = i. 11. Define f : Q {1/4} Q {0} by f(x) = 1 4x and g: Q {0} Q {3/2} by g(x) = (3x 1)/(2x). Determine each of these functions. (a) g f (c) f 1 (e) f 1 g 1 (b) (g f) 1 (d) g 1 12. Let F denote the set of functions on R, let C = {f F f is continuous}, and let D = {f F f is differentiable}. Consider the function : D F that maps each function f D to its derivative f in F; that is, (f) = f. (a) Is the function one-to-one? (b) Let f D. What is 1 ({f })? (c) Show that C im. 13. Give an example of a function f : (a) neither one-to-one nor onto (c) onto but not one-to-one [ 1, 1 ] [ 0, 4 ] that is: (b) one-to-one but not onto (d) both one-to-one and onto 14. Let m and n be positive integers, and let A = {0, 1,..., m 1}, B = {0, 1,..., n 1}, and C = {0, 1,..., mn 1}. Construct a bijection f : A B C. (Hint: First try a special case, such as m = 2 and n = 3; then try to generalize your construction.) [ ] [ ] 15. Give an example of a function f : 0, 4 1, 1 that is: (a) neither one-to-one nor onto (c) onto but not one-to-one (b) one-to-one but not onto (d) both one-to-one and onto 16. Construct a bijection: (a) from ( 1, 1) to R (b) from Z to Z + 17. Let c and d be real numbers with c < d. Construct a bijection from (0, 1) to (c, d). 18. Construct a function f : Q + Z + such that f is one-to-one. 19. Given real numbers a, b, c, and d such that a < b and c < d, construct a bijection from (a, b) to (c, d). 20. For any set X, prove (by contradiction) that there does not exist a bijection from X to P(X).

162 Chapter 3 Functions 21. Construct a bijection from Z to 2Z. 22. Let A 1, B 1, A 2, and B 2 be nonempty sets such that A 1 B 1 = = A 2 B 2. Given bijections f : A 1 A 2 and g: B 1 B 2, construct a bijection h: A 1 B 1 A 2 B 2. 23. Construct a bijection from 1 + 2Z to 3Z +. 24. Let A 1, B 1, A 2, and B 2 be nonempty sets. Given bijections f : A 1 A 2 and g: B 1 B 2, construct a bijection h: A 1 B 1 A 2 B 2. 25. Define the function f : Z Z by f(m) = 5m + 2. (a) Either prove that f is one-to-one or give an example to show that f is not one-to-one. (b) Either prove that f is onto or give an example to show that f is not onto. (c) Find f(2z). (d) Find f 1 (3Z + ). 26. Let X be a nonempty subset of R. Given two functions f and g from X to R, we define functions f + g: X R and f g: X R, called the sum and product of f and g, respectively, as follows: (f + g)(x) = f(x) + g(x) (f g)(x) = f(x)g(x) Each part gives a subset X of R and two functions f and g from X to R; find f + g and f g. (a) X = Z + ; f(x) = x 2 and g(x) = 2x 1 (b) X = Q; f(x) = x/3 and g(x) = 3x + 2 (c) X = R {0}; f(x) = (x 2 + 1)/x and g(x) = x/(x 2 + 1) (d) X = R; f(x) = x 2 2x + 3 and g(x) = x 2 + 2x 3 27. Define the function f : R [ 1, ) by f(x) = x 2 + 1. (a) Either prove that f is one-to-one or give an example to show that f is not one-to-one. (b) Either prove that f is onto or give an example to show that f is not onto. (c) Find f( [ 0, 2 ] ). (d) Find f 1 ( [ 1, 3 ] ). (e) Find f 1 ( [ 2, 5 ] ). 28. Determine f g and g f. (a) f : R R; f(x) = x 2 + x, g: R R; g(x) = 3x + 4 (b) f : (0, ) (0, ); f(x) = x/(x 2 + 1), g: (0, ) (0, ); g(x) = 1/x 29. Define f : R {1} R {2} by f(x) = (x 3 + 7)/4 and g: R {2} R {1} by g(x) = x/(x 2). Determine these functions. (a) g f (c) f g (b) (g f) 1 (d) (f g) 1