Page 246 - HOW TO PROVE IT: A Structured Approach, Second Edition
P. 246

P1: Oyk/
                   0521861241c05  CB996/Velleman  October 19, 2005  0:16  0 521 86124 1  Char Count= 0






                                   232                        Functions
                                   derived in Theorem 5.1.5. Note that because functions are just relations of a
                                   special kind, everything we have proven about composition of relations ap-
                                   plies to composition of functions. In particular, by Theorem 4.2.5, we know
                                   that composition of functions is associative.


                                   Example 5.1.6. Here are some examples of compositions of functions.
                                   1. Let C and N be the sets of all cities and countries, respectively, and let
                                     L : C → N be the function defined in part 3 of Example 5.1.2. Thus, for
                                     every city c, L(c) = the country in which c is located. Let B be the set
                                     of all buildings located in cities, and define F : B → C by the formula
                                     F(b) = the city in which the building b is located. Then L ◦ F : B → N.
                                     For example, F(Eiffel Tower) = Paris, so according to the formula derived
                                     in Theorem 5.1.5,
                                                 (L ◦ F)(Eiffel Tower) = L(F(Eiffel Tower))

                                                                   = L(Paris) = France.
                                     In general, for every building b ∈ B,

                                           (L ◦ F)(b) = L(F(b)) = L(the city in which b is located)
                                                              = the country in which b is located.
                                     A diagram of this function is shown in Figure 2.




















                                                              Figure 2


                                   2. Let g : Z → R be the function from part 2 of Example 5.1.3, which
                                     was defined by the formula g(x) = 2x + 3. Let f : Z → Z be defined
                                                          2
                                     by the formula f (n) = n − 3n + 1. Then g ◦ f : Z → R. For example,
   241   242   243   244   245   246   247   248   249   250   251