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

P1: Oyk/
                   0521861241c06  CB996/Velleman  October 20, 2005  1:8  0 521 86124 1  Char Count= 0






                                                       Recursion                       279
                                such that ∀x ∈ A 1 ( f (x) = c 1 ). If we can show that f (a 1 ) = c 1 then we
                                will be done, since then it will follow that ∀x ∈ A( f (x) = c 1 ).
                                  Let a 2 be an element of A that is different from a 1 , and let A 2 = A \
                                {a 2 }. Applying the inductive hypothesis again, we can choose a number
                                c 2 ∈ R such that ∀x ∈ A 2 ( f (x) = c 2 ). Notice that sincea 1  = a 2 ,a 1 ∈ A 2 ,
                                so f (a 1 ) = c 2 . Now let a 3 be an element of A that is different from both
                                a 1 and a 2 . Then a 3 ∈ A 1 and a 3 ∈ A 2 ,so f (a 3 ) = c 1 and f (a 3 ) = c 2 .
                                Therefore c 1 = c 2 ,so f (a 1 ) = c 1 , as required.


                                                    6.3. Recursion


                            In Chapter 3 we learned to prove statements of the form ∀nP(n) by letting n
                            be arbitrary and proving P(n). In this chapter we’ve learned another method
                            for proving such statements, when n ranges over the natural numbers: Prove
                            P(0), and then prove that for any natural number n,if P(n) is true then so is
                            P(n + 1). Once we have proven these statements, we can run through all the
                            natural numbers in order and see that P must be true of all of them.
                              We can use a similar idea to introduce a new way of defining functions. In
                            Chapter 5, we usually defined a function f by saying how to compute f (n) for
                            any n in the domain of f. If the domain of f is the set of all natural numbers, an
                            alternative method to define f would be to say what f (0) is and then, for any
                            natural number n, say how we could compute f (n + 1) if we already knew the
                            value of f (n). Such a definition would enable us to run through all the natural
                            numbers in order computing the image of each one under f.
                              For example, we might use the following equations to define a function f
                            with domain N:

                                          f (0) = 1;
                                          for every n ∈ N, f (n + 1) = (n + 1) · f (n).
                            The second equation tells us how to compute f (n + 1), but only if we already
                            know the value of f (n). Thus, although we cannot use this equation to tell us
                            directly what the image of any number is under f,we can use it to run through
                            all the natural numbers in order and compute their images.
                              We start with f (0), which we know from the first equation is equal to 1.
                            Plugginginn = 0inthesecondequation,weseethat f (1) = 1 · f (0) = 1 · 1 =
                            1, so we’ve determined the value of f (1). But now that we know that f (1) = 1,
                            we can use the second equation again to compute f (2). Plugging in n = 1inthe
                            second equation, we find that f (2) = 2 · f (1) = 2 · 1 = 2. Similarly, setting
                            n = 2 in the second equation we get f (3) = 3 · f (2) = 3 · 2 = 6. Continuing
   288   289   290   291   292   293   294   295   296   297   298