Math Proofs for Beginners
Math Proofs for Beginners
Version 0.2.6
             
Steven
             c       Furino
I Introduction 11
1 In the beginning                                                                                                                                                 12
  1.1 What Makes a Mathematician a Mathematician?                                                      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   12
  1.2 How The Course Works . . . . . . . . . . . . . .                                                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   12
  1.3 Why do we reason formally? . . . . . . . . . . . .                                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   14
  1.4 Reading and Lecture Schedule . . . . . . . . . . .                                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   16
       1.4.1 Lecture Schedule . . . . . . . . . . . . . .                                              .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   16
       1.4.2 Reading Schedule . . . . . . . . . . . . . .                                              .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   17
3 Discovering Proofs                                                                                                                                               26
  3.1 Objectives . . . . . . . .               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   26
  3.2 Discovering a Proof . . .                .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   26
  3.3 Reading A Proof . . . .                  .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   29
  3.4 The Division Algorithm                   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   30
  3.5 Practice . . . . . . . . .               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   31
II Foundations 33
4 Truth Tables                                                                                                                                                     34
  4.1 Objectives . . . . . . . . . . . . . . . . . . . .                                       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   34
  4.2 Truth Tables as Definitions . . . . . . . . . .                                          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   34
  4.3 Truth Tables to Evaluate Logical Expressions                                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   36
  4.4 Contrapositive and Converse . . . . . . . . .                                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   39
  4.5 More Examples . . . . . . . . . . . . . . . . .                                          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   40
  4.6 Practice . . . . . . . . . . . . . . . . . . . . .                                       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   40
5 Introduction to Sets                                                                                                                                             41
  5.1 Objectives . . . . . . . .               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   41
  5.2 Describing a Set . . . .                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   41
  5.3 Set Operations . . . . .                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   45
       5.3.1 Venn Diagrams .                   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   47
  5.4 Comparing Sets . . . . .                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   47
       5.4.1 Sets of Solutions                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   47
       5.4.2 An Example . .                    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   48
                                                                       2
Section 0.0   CONTENTS                                                                                                                                                            3
5.5 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
                   6 More on Sets                                                                                                                                                50
                     6.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                    50
                     6.2 Showing Two Sets Are Equal . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                          50
                     6.3 More Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                       51
                   7 Quantifiers                                                                                                                                                 54
                     7.1 Objectives . . . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   54
                     7.2 Quantifiers . . . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   54
                     7.3 The Object Method .             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   57
                     7.4 The Construct Method            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   58
                     7.5 The Select Method . .           .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   61
                     7.6 Sets and Quantifiers .          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   62
                     7.7 A Non-Proof . . . . .           .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   63
                   8 Nested Quantifiers                                                                                                                                          65
                     8.1 Objectives . . . . . . . . . . . . . . . .                          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   65
                     8.2 Onto (Surjective) Functions . . . . . .                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   65
                         8.2.1 Definition of Function . . . . .                              .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   65
                         8.2.2 Definition of Onto (Surjective)                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   66
                         8.2.3 Reading . . . . . . . . . . . . .                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   68
                         8.2.4 Discovering . . . . . . . . . . .                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   69
                         8.2.5 A Difficult Proof . . . . . . . .                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   71
                     8.3 Limits . . . . . . . . . . . . . . . . . .                          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   72
                         8.3.1 Definition . . . . . . . . . . . .                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   72
                         8.3.2 Reading A Limit Proof . . . .                                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   73
                         8.3.3 Discovering a Limit Proof . . .                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   75
                         8.3.4 A Harder Proof . . . . . . . . .                              .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   78
                     8.4 Summary . . . . . . . . . . . . . . . .                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   79
                   10 Simple Induction                                                                                                                                           84
                      10.1 Objectives . . . . . . . . . . . . . . . . . .                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   84
                      10.2 Notation . . . . . . . . . . . . . . . . . . .                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   84
                           10.2.1 Summation Notation . . . . . . . .                                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   84
                           10.2.2 Product Notation . . . . . . . . . .                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   86
                           10.2.3 Recurrence Relations . . . . . . . .                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   86
                      10.3 Introduction to Induction . . . . . . . . .                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   87
                      10.4 Principle of Mathematical Induction . . .                                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   87
                           10.4.1 Why Does Induction Work? . . . .                                   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   88
                           10.4.2 Two Examples of Simple Induction                                   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   88
                           10.4.3 A Different Starting Point . . . . .                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   90
                      10.5 An Interesting Example . . . . . . . . . .                                .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   92
                      10.6 Practice . . . . . . . . . . . . . . . . . . .                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   94
4                                                                                                                      Chapter 0               CONTENTS
    11 Strong Induction                                                                                                                                             96
       11.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                    96
       11.2 Strong Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                      96
       11.3 Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                                   100
    13 Negation                                                                                                                                                    107
       13.1 Objectives . . . . . . . . . . . . . . . .                         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   107
       13.2 Negating Statements . . . . . . . . . .                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   107
       13.3 Negating Statements with Quantifiers                               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   109
            13.3.1 Counterexamples . . . . . . . .                             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   110
       13.4 Practice . . . . . . . . . . . . . . . . .                         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   112
    14 Contradiction                                                                                                                                               113
       14.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . .                                               .   .   .   .   .   .   .   .   .   .   113
       14.2 How To Use Contradiction . . . . . . . . . . . . . . . . . .                                                   .   .   .   .   .   .   .   .   .   .   113
            14.2.1 When To Use Contradiction . . . . . . . . . . . . .                                                     .   .   .   .   .   .   .   .   .   .   114
            14.2.2 Reading a Proof by Contradiction . . . . . . . . .                                                      .   .   .   .   .   .   .   .   .   .   114
            14.2.3 Discovering and Writing a Proof by Contradiction                                                        .   .   .   .   .   .   .   .   .   .   115
    15 Contrapositive                                                                                                                                              118
       15.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                         .   .   .   .   .   118
       15.2 The Contrapositive . . . . . . . . . . . . . . . . . . . . . . . . . . .                                                           .   .   .   .   .   118
            15.2.1 When To Use The Contrapositive . . . . . . . . . . . . . . .                                                                .   .   .   .   .   118
       15.3 Reading a Proof That Uses the Contrapositive . . . . . . . . . . .                                                                 .   .   .   .   .   118
            15.3.1 Discovering and Writing a Proof Using The Contrapositive                                                                    .   .   .   .   .   120
    16 Uniqueness                                                                                                                                                  122
       16.1 Objectives . . . . . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   122
       16.2 Introduction . . . . . . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   122
       16.3 Showing X = Y . . . . .            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   123
       16.4 Finding a Contradiction            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   124
       16.5 The Division Algorithm             .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   125
    17 Elimination                                                                                                                                                 128
       17.1 Objectives . . . . . . . . . . . . . . . .                         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   128
       17.2 When to Use the Elimination Method                                 .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   128
       17.3 How to Use the Elimination Method .                                .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   128
       17.4 Reading . . . . . . . . . . . . . . . . .                          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   129
       17.5 Writing and Discovering . . . . . . . .                            .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   130
                   23 Congruence                                                                                                                                      165
                      23.1 Objectives . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   165
                      23.2 Congruences . . . . . . . . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   165
                           23.2.1 Definition of Congruences           .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   165
                      23.3 Elementary Properties . . . . . .          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   166
                      23.4 Practice . . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   170
                   32 Counting                                                                                                                                                225
                      32.1 Objectives . . . . . . . . . . . . .               .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   225
                      32.2 African Shepherds . . . . . . . .                  .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   225
                      32.3 What Does It Mean To Count? .                      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   226
                      32.4 Showing That A Bijection Exists                    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   226
                      32.5 Finite Sets . . . . . . . . . . . . .              .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   227
    47 Trees                                                                                     295
       47.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
       47.2 Properties of Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
                   56 Appendix                                                                                                                                            342
Preface
These notes are the script for the online lectures of MATH 135 at the University of Waterloo
in Fall 2012. The script has been supplemented by worked examples and exercises.
These notes are very much a work in progress. Please send any corrections or suggestions
to Steven Furino at scfurino@uwaterloo.ca
                                            10
   Part I
Introduction
     11
Chapter 1
In the beginning
      He who seeks for methods without having a definite problem in mind seeks for
      the most part in vain.
      David Hilbert
                                            12
Section 1.2   How The Course Works                                                                        13
                     formula. The fourth problem relies on a profound theorem proved by Carl Friedrich Gauss,
                     the greatest mathematician of the modern age. Here are the four problems.
                     How do we secure internet commerce? Have you ever bought a song or movie over
                         iTunes? Have you ever done your banking over the web? How do you make sure
                         that your credit card number and personal information are not intercepted by bad
                         guys? Number theory allows us to enable secure web transactions. And that theory
                         is backed by proof.
                     What does it mean to count? You probably learned to count before you went to school.
                        But how do you count to infinity? And is there only one infinity?
                     How do we factor polynomials? You have factored integers into a product of prime
                         numbers. There is also a need in mathematics to factor polynomials, expressions like
                         ax4 + bx3 + cx2 + dx + e into the polynomial equivalent of prime numbers.
                     The course notes contain two other problems if you would like to see the power of proof
                     displayed in very different contexts.
                     How do we find the shortest path from one point to another? How does a telecom-
                         munications company route your cell phone call? How does Google find the quickest
                         route on Google maps? How does a courier company route your package? All of these
                         tasks are completed using a shortest path algorithm. And how do we know we have
                         found the shortest path? Proof.
                     To work with these problems we will need to learn about congruences, modular arithmetic,
                     complex numbers and polynomials. And to work with these topics, we must learn some
                     foundational mathematics such as logical expressions and sets, and, most importantly, we
                     must learn how to recognize and use proof techniques.
14                                                                  Chapter 1   In the beginning
     But why do we reason so formally at all? Many people believe that humans already know
     enough mathematics so Why bother with proofs? There are quite a few reasons.
     To prevent silliness. In solving quadratic equations with non-real roots, some of you will
         have encountered the number i which has the special property that i2 = 1. But
         then,                                                     
                         1 = i2 = i  i = 1 1 = 1  1 = 1 = 1
           Clearly, something is amiss.
     To understand better. How would most of us answer the question Whats a real num-
         ber? We would probably say that any number written as a decimal expansion is a
         real number and any two different expansions represent different numbers. But then
         what about this?
                                      Let x = 0.9 = 0.999 . . . .
           Multiplying by 10 and subtracting gives
                                                   10x = 9.9
                                                    x = 0.9
                                                    9x = 9
1 1 + 1 1 + 1 1 + 1 1 + ...
           If we pair up the first two terms we get zero and every successive pair of terms also
           gives us 0 so the sum is zero.
                                     z }| { z }| { z }| { z }| {
                                     1  1+1  1+1  1+1  1+...
           On the other hand, if we pair up the second and third term we get 0 and all successive
           pairs of terms give 0 so the sum is 1.
                                      z }| { z }| { z }| { z }| {
                                    1 1 + 1 1 + 1 1 + 1 1 + 1 + . . .
           Or suppose we wanted to resolve Zenos paradox. Zeno was a famous ancient Greek
           philosopher who posed the following problem. Suppose the Greek hero Achilles was
           going to race against a tortoise and suppose, in recognition of the slowness of the
           tortoise, that the tortoise gets a 100m head start. By the time Achilles has run half
           the distance between he and the tortoise, the tortoise has moved ahead. And now
           again, by the time Achilles has run half the remaining distance between he and the
           tortoise, the tortoise has moved ahead. No matter how fast Achilles runs, the tortoise
           will always be ahead! You might object that your eyes see Achilles pass the tortoise,
           but what is logically wrong with Zenos argument?
Section 1.3   Why do we reason formally?                                                                          15
                      To discover solutions. Formal reasoning provides a set of tools that allow us to think
                           rationally and carefully about problems in mathematics, computing, engineering, sci-
                           ence, economics and any discipline in which we create models.
                           Poor reasoning can be very expensive. Inaccurate application of financial models led
                           to losses of hundreds of billions of dollars during the financial crisis of 2008.
                      To experience joy. Mathematics can be beautiful, just as poetry can be beautiful. But
                           to hear the poetry of mathematics, one must first understand the language.
16                                                                 Chapter 1   In the beginning
                      Since one of the goals of this course is to help you become comfortable reading mathematics,
                      there are several short chapters for you to read. After you have completed the reading, an
                      online assignment will help you consolidate what you know.
                       Ch.    Topic                               Before Lecture
                        4.    Truth Tables                        3. Discovering Proofs
                        5.    Introduction to Sets                3. Discovering Proofs
                       13.    Negation                            6. PPP: Quantifiers and Sets
                       14.    Contradiction                       10. Greatest Common Divisor
                       15.    Contrapositive                      10. Greatest Common Divisor
                       16.    Uniqueness                          11. Extended Euclidean Algorithm
                       17.    Elimination                         12. Properties of the GCD
                       30.    Private Key Cryptography (30.2)    22. The RSA Scheme
Chapter 2
2.1 Objectives
1. Define divisibility.
                                             18
Section 2.2   The Language                                                                                      19
                     One of the goals of this course is to learn proof techniques. Our broad objectives for this
                     goal are simple.
                        1. Explain and categorize proof techniques that can be used in any proof. This course
                           will teach not only how a technique works, but when it is most likely to be used and
                           why it works.
                        2. Learn how to read a proof. This will require you to identify the techniques of the first
                           objective.
                        3. Discover your own proofs. Knowledge of technique is essential but inadequate. Or,
                           as we would say in the language of mathematics, technique is necessary but not
                           sufficient. Discovering your own proof requires not only technique but also under-
                           standing, creativity, intuition and experience. This course will help with the technique
                           and experience. Understanding, creativity, and intuition come with time. Talent helps
                           of course.
                        4. Write your own proofs. Having discovered a proof, you must distill your discovery
                           into mathematical prose that is targeted at a specific audience.
                     Hopefully, in the previous lecture, I convinced you of why we need to prove things. Now
                     what is it that mathematicians prove? Mathematicians prove statements.
1. 2 + 2 = 4. (A true statement.)
2. 2 + 2 = 5. (A false statement.)
1. x > 0.
                     These are statements only if we have an appropriate value for x in the first sentence and
                     appropriate instances of 4ABC and 4P QR in the second sentence. For example, if x is
                     the number 5, then the sentence 5 > 0 is a statement since the sentence is true. If x is
                     the number 5, then the sentence 5 > 0 is also a statement since the sentence is false.
                     The key point is that a statement is a sentence which must be true or false. If x is the
                     English word algebra, then the sentence algebra > 0 is not a statement since the sentence
                     is neither true nor false. Sentences like the two above are called open sentences.
20                                                                                 Chapter 2    Our First Proof
                         each variable has values that come from a designated set called the domain of the
                          variable, and
                         where the sentence is either true or false whenever values from the respective domains
                          of the variables are substituted for the variables.
                   For example, if the domain of x is the set of real numbers, then for any real number chosen
                   and substituted for x, the sentence x > 0 is a statement.
                   In this course, we will treat all open sentences as statements under the assumption that the
                   values of the variables always come from a suitable domain.
2.3 Implications
Definition 2.3.1   The most common type of statement we will prove is an implication. Implications have
     Implication   the form
                                               If A is true , then B is true
                   where A and B are themselves statements. An implication is more commonly read as
If A, then B
                   or
                                                            A implies B
                   and is written symbolically as
                                                              AB
Definition 2.3.2   An implication is a compound statement, that is, it is made up of more than one state-
     Compound      ment.
     Statement
Definition 2.3.3   The statement A is called the hypothesis. The statement B is called the conclusion.
     Hypothesis,
     Conclusion
Section 2.4   Our First Proof                                                                                 21
                      REMARK
                      To prove the implication A implies B, you assume that A is true and you use this
                      assumption to show that B is true. Statement A is what you start with. Statement B is
                      where you must end up.
                      To use the implication A implies B, you must first establish that A is true. After you
                      have established that A is true, then you can invoke B.
                      It is crucial that you are able to identify
1. the hypothesis
2. the conclusion
Example 4 Let f (x) = x sin(x). Then f (x) = x for some real number x with 0 x 2.
Definition 2.4.1      An integer m divides an integer n, and we write m | n, if there exists an integer k so that
    Divisibility      n = km.
22                                                                                  Chapter 2      Our First Proof
Example 6
Definition 2.4.2   A proposition is a true statement that has been proved by a valid argument.
     Proposition
                   REMARK
                   You will encounter several variations on the word proposition. A theorem is a particularly
                   significant proposition. A lemma is a subsidiary proposition, or more informally, a helper
                   proposition, that is used in the proof of a theorem. A corollary is a proposition that follows
                   almost immediately from a theorem.
                   There are particular statements that may look like propositions but are more foundational.
                   An axiom is a statement that is assumed to be true. No proof is given. From axioms we
                   derive propositions and theorems. Obviously, choosing axioms has to be done very carefully.
                   When one first encounters a proposition, it often helps to work through some examples to
                   understand the proof.
Section 2.4   Our First Proof                                                                                   23
                      Though this is a simple proof, other proofs can be difficult to read because of the habits
                      of writing for professional audiences. Many proofs share the following properties which can
                      be frustrating for students.
                         1. Proofs are economical. That is, a proof includes what is needed to verify the truth of
                            a proposition but nothing more.
                         2. Proofs do not usually identify the hypothesis and the conclusion.
                         3. Proofs sometimes omit or combine steps.
                         4. Proofs do not always explicitly justify steps.
                         5. Proofs do not reflect the process by which the proof was discovered.
                      The reader of the proof must be conscious of the hypothesis and conclusion, fill in the
                      omitted parts and justify each step.
                      REMARK
                      When you are reading a proof of an implication, do the following.
                         1. Explicitly identify the hypothesis and the conclusion. If the hypothesis contains no
                            statements write No explicit hypothesis. At the end of the proof, you should be
                            able to identify where each part of the hypothesis has been used.
                         2. Explicitly identify the core proof technique. When reading a proof, the reader usually
                            works forward from the hypothesis until the conclusion is reached. Specific techniques
                            will be covered later in the course.
                         3. Record any preliminary material needed, usually definitions or propositions that have
                            already been proved. Judgement is needed here about how much to include.
                         4. Justify each step with reference to the definitions, previously proved propositions or
                            techniques used.
                         5. Add missing steps where necessary and justify these steps with reference to the defi-
                            nitions, previously proved propositions or techniques used.
24                                                                   Chapter 2   Our First Proof
     Lets analyze the proof of the Transitivity of Divisibility in detail because it will give us
     some sense of how to analyze proofs in general. First, observe that If a | b and b | c, then
     a | c. is an open sentence, and that the domains for the variables a, b and c are specified
     in the first sentence, Let a, b and c be integers.
     Professional mathematicians do all of these things implicitly but for the first part of this
     course, we will do these things explicitly.
     We will do a line by line analysis, so to make our work easier, we will write each sentence
     on a separate line.
Proof: (For reference, each sentence of the proof is written on a separate line.)
4. Since sr is an integer, a | c.
     Lets analyze the proof. What we do now will seem like overkill but it serves two purposes.
     It gives practice at justifying every line of a proof, and it gives us a structure that we
     can use for other proofs. Lastly, recall that the author is proving an implication. The
     author assumes that the hypothesis is true, and uses the hypothesis to demonstrate that
     the conclusion is true. Here goes.
Analysis of Proof We begin by explicitly identifying the hypothesis and the conclusion.
                      At the end of each proof, you should be able to identify where each part of the hypothesis
                      was used. It is obvious where a | b and b | c were used. The hypothesis a, b and c are
                      integers was needed to allow the author to use the definition of divides.
                      This completes the analysis of our first proof. Between the readings, lectures, quizzes,
                      assignments and tests, you will work your way through roughly one hundred proofs.
                Chapter 3
Discovering Proofs
3.1 Objectives
2. Write a proof.
3. Read a proof.
                Discovering a proof of a statement is generally hard. There is no recipe for this, but there
                are some tips that may be useful, and as we go on through the course, you will learn specific
                techniques. Consider the following proposition.
                                                               26
Section 3.2   Discovering a Proof                                                                                27
     Example 1         Suppose a = 3, b = 6 and c = 27. Then, for any integers x and y, 3 | (6x + 27y). That is, 3
                       divides any integer combination of 6 and 27. You might say, Thats obvious. Just take a
                       common factor of 3 from 6x + 27y. That is
                                                          6x + 27y = 3(2x + 9y)
                       That observation is very suggestive of the proof of the Divisibility of Integer Combinations.
                       The very first thing to do when proving a statement is to explicitly identify the hypothesis
                       and the conclusion. Lets do that for the Divisibility of Integer Combinations.
Hypothesis: a, b, c Z, a | b and a | c. x, y Z
                       Since we are proving a statement, not using a statement, we assume that the hypothesis
                       is true, and then demonstrate that the conclusion is true. This straightforward approach
                       is called Direct Proof. However, in actually discovering a proof we do not need to work
                       only forwards from hypothesis. We can work backwards from the conclusion and meet
                       somewhere in the middle. When writing the proof we must ensure that we begin with the
                       hypothesis and end with the conclusion.
                       Whether working forwards or backwards, I find it best to proceed by asking questions.
                       When working backwards, I ask
                       The answer tells me what to look for or gives me another statement I can work backwards
                       from. In this case the answer would be
                       Note that the answer makes use of the definition of divides. Lets record this statement as
                       part of a proof in progress.
                       Proof in Progress
1. To be completed.
     The answer is not obvious so lets turn to working forwards from the hypothesis. In this
     case my standard two questions are
     I have seen a | b in an hypothesis before. Twice actually, once in the proof of the Transitivity
     of Divisibility and once in the prior example. Just as was done in the proof of the Transitivity
     of Divisibility, I can use a | b and the definition of divisibility to assert that
I also know that a | c so I can use the definition of divisibility again to assert that
     Hmmm, what now? Lets look again at the last sentence. There is a bx + cy in the last
     sentence and an algebraic expression for b and c in the first two sentences. Substituting
     gives
                                     bx + cy = (ra)x + (sa)y
     and factoring out the a gives
                                 bx + cy = (ra)x + (sa)y = a(rx + sy)
     Does this look familiar? We factored in our numeric example and we are factoring here.
     If we let k = rx + sy then, because multiplying integers gives integers and adding integers
     gives integers, k is an integer. Hence, there exists an integer k so that bx + cy = ak. That
     is, a | (bx + cy).
     We are done. Almost. We have discovered a proof but this is rough work. We must now
     write a formal proof. Just like any other writing, the amount of detail needed in expressing
     your thoughts depends upon the audience. A proof of a statement targeted at an audience
     of professional specialists in algebra will not look the same as a proof targeted at a high
     school audience. When you approach a proof, you should first make a judgement about the
     audience. Write for your peers. That is, write your proof so that you could hand it to a
     classmate and expect that they would understand the proof.
Section 3.3   Reading A Proof                                                                                     29
                      Proof: Since a | b, there exists an integer r such that b = ra. Since a | c, there exists an
                      integer s such that c = sa. Let x and y be any integers. Now bx + cy = (ra)x + (sa)y =
                      a(rx + sy). Since rx + sy is an integer, it follows from the definition of divisibility that
                      a | (bx + cy).
                      Note that this proof does not reflect the discovery process, and it is a Direct Proof. It
                      begins with the hypothesis and ends with the conclusion.
                      Before we leave this proposition, lets consider the significance of the hypothesis x and y
                      are integers. Suppose, as in our numeric example, a = 3, b = 6 and c = 27. If we choose
                      x = 3/2 and y = 1/4, ax + by = 45/4 which is not even an integer! This simple example
                      emphasizes the importance of the hypothesis.
Exercise 1 Prove the following statement. Let a, b, c and d be integers. If a | c and b | d, then ab | cd.
Lets analyze this proof. First, we will rewrite the proof line by line.
Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
2. Since b 6= 0, q 6= 0.
3. But if q 6= 0, |q| 1.
                 Analysis of Proof As usual, we begin by explicitly identifying the hypothesis and the
                     conclusion.
                 Sentence 2 Since b 6= 0, q 6= 0.
                       If q were zero, then b = qa would imply that b is zero. Since b is not zero, q cannot
                       be zero.
                 As you have known since grade school, not all integers are divided evenly by other integers.
                 There is usually a remainder. We record this as the Division Algorithm.
a = qb + r where 0 r < b.
                 We will not prove this statement now. You will see a proof of the uniqueness part later
                 on and a complete proof is available in the appendix. [Incomplete: Add to appendix.]
                 Lets see some examples before a few remarks.
Section 3.5   Practice                                                                                             31
                                                                 a=qb+r
                                                                20 = 2  7 + 6
                                                                21 = 3  7 + 0
                                                              20 = 3  7 + 1
REMARK
                             Though the proposition is commonly known as the Division Algorithm, it is not really
                              an algorithm since it doesnt provide a finite sequence of steps that will construct q
                              and r.
                         It turns out that the Division Algorithm is remarkably useful. To see how, we must first
                         define the greatest common divisor, which we do soon.
3.5 Practice
2. Prove the following statement. Let x be an integer. If 2 | (x2 1), then 4 | (x2 1).
                               (a) The following proof of the statement is incorrect. Describe what is wrong with
                                   the proof.
                                   Proof: Let a be a divisor of 60. Since a can only contain the prime factors 2, 3,
                                   and 5, and since all of these integers are factors of 30 as well, a | 30.
        (a) Suppose a is even. Then a2 is even, so both a2 + 3 and a2 + 7 are odd. Since 32
            is even, 32 - ((a2 + 3)(a2 + 7)).
        (b) Let a = 1. Then 32|((a2 +3)(a2 +7)), but a is not even. This is a counterexample
            to the statement.
        (c) Suppose 32 - ((a2 + 3)(a2 + 7)). Since 2|32, 2 - ((a2 + 3)(a2 + 7)). This means that
            (a2 + 3)(a2 + 7) must be odd, so both a2 + 3 and a2 + 7 must be odd. Therefore,
            a2 is even, and hence a is even.
        (d) Prove the statement.
  Part II
Foundations
     33
                   Chapter 4
Truth Tables
4.1 Objectives
1. Define not, and, or, implies and if and only if using truth tables.
                     3. Use truth tables to establish the equivalence of logical expressions and particularly
                        the equivalence of the contrapositive and the non-equivalence of the converse.
Definition 4.2.2   All of the statements we need to prove will be compound statements, that is, statements
   Compound,       composed of several individual statements called component statements.
   Component
If a | b and b | c, then a | c.
                         a | b,
                         b | c, and
                         a|c
                                                               34
Section 4.2   Truth Tables as Definitions                                                                       35
If a | b and b | c, then a | c.
becomes
X and Y imply Z.
                       If we knew the truth values of X, Y and Z, then we would be able to determine the truth
                       value of the compound statement X and Y imply Z. And that is where truth tables come
                       in. Truth tables contain all possible values of the component statements and determine the
                       truth value of the compound statement.
                       Truth tables can be used to define the truth value of a statement or evaluate the truth
                       value of a statement. For logical operations like not, and, or, implies and if and only if,
                       truth tables are used to define the truth value of the compound statement.
                       In prose, if the statement A is true, then the statement NOT A is false. If the statement
                       A is false, then the statement NOT A is true.
                       Two very important and common logical connectives are AND and OR. Note that these do
                       not always coincide with our use of the words and and or in the English language!
                      tea, you interpret that to mean that you may have coffee or tea but not both. However,
                      the logical A  B results in a true statement when A is true, B is true or both are true. In
                      mathematics, or is inclusive.
                      The first two rows in the table make sense. The last two make less sense. How can a false
                      hypothesis result in a true statement? The basic idea is that if one is allowed to assume an
                      hypothesis which is false, any conclusion can be derived.
                      We will shortly see that implies is closely related to if and only if.
                      We can construct truth tables for compound statements by evaluating parts of the compound
                      statement separately and then evaluating the larger statement. Consider the following truth
                      table which shows the truth values of (AB) for all possible combinations of truth values of
                      the component statements A and B. (Brackets serve the same purpose in logical expressions
                      as they do in arithmetic. They specify the order of operation. In logic the order is: brackets,
                      , , , ,  ,  with evaluation from left to right.)
                                                        A   B A  B (A  B)
                                                        T   T   T      F
                                                        T   F   T      F
                                                        F   T   T      F
                                                        F   F   F      T
Section 4.3   Truth Tables to Evaluate Logical Expressions                                                       37
                       In the first row of the table A and B are true, so using the definition of or, the statement
                       A  B is true. Since the negation of a true statement is false, (A  B) is false, which
                       appears in the last column of the first row. Take a minute to convince yourself that each of
                       the remaining rows is correct.
                       Here is another example.
                                                    A   B    C B  C A  (B  C)
                                                    T   T    T   T        T
                                                    T   T    F   T        T
                                                    T   F    T   T        T
                                                    T   F    F   F        F
                                                    F   T    T   T        T
                                                    F   T    F   T        T
                                                    F   F    T   T        T
                                                    F   F    F   F        T
Exercise 1
                         1. If A, B, C are statements, and A and B are true, and C is false, what is the truth
                            value of
                             (a) A  (B  C)?
                             (b) A  (B  C)?
                             (c) A  (B  C)?
                             (d) (A  B)  C?
Definition 4.3.1       Two compound statements are logically equivalent if they have the same truth values for
     Logically         all combinations of their component statements. We write S1  S2 to mean S1 is logically
    equivalent         equivalent to S2 .
                       REMARK
                       Equivalent statements are enormously useful in proofs. Suppose you wish to prove S1 but
                       are having difficulty. If there is a simpler statement S2 and S1  S2 , then you can prove S2
                       instead. In proving S2 , you will have proved S1 as well.
38                                                                                Chapter 4   Truth Tables
     Example 3   Construct a single truth table for (A  B) and (A)  (B). Are these statements logically
                 equivalent?
                                    A B A  B (A  B) A B (A)  (B)
                                    T T        T         F        F    F        F
                                    T F        T         F        F    T        F
                                    F T        T         F        T    F        F
                                    F F        F         T        T    T        T
                 Since the columns representing (A  B) and (A)  (B) are identical,
                 we can conclude that (A  B)  (A)  (B).
1. (A B) (A) (B)
2. (A B) (A) (B)
                 REMARK
                 The next example shows the equivalence of A  B and (A  B)  (B  A). This is
                 particularly important for proofs. Because A  B is equivalent to (A  B)  (B  A),
                 to prove a statement of the form A  B, we could prove
1. A B and
2. B A.
                                A   B A  B         A  B B  A (A  B)  (B  A)
                                T   T    T             T     T           T
                                T   F    F             F     T           F
                                F   T    F             T     F           F
                                F   F    T             T     T           T
                      Two particular statements, the contrapositive and the converse, which are derived from
                      A  B, occur frequently in mathematics.
                                                 A   B AB         B A B  A
                                                 T   T  T           F F     T
                                                 T   F  F           T F     F
                                                 F   T  T           F  T    T
                                                 F   F  T           T  T    T
                      Since the columns representing A  B and B  A are identical, we can conclude that
                      A  B  B  A.
                      REMARK
                      The logical equivalence of a statement and its contrapositive is extremely useful. If proving
                      A  B seems difficult, we could try to prove B  A instead. It may be easier!
                                                         A   B AB BA
                                                         T   T  T   T
                                                         T   F  F   T
                                                         F   T  T   F
                                                         F   F  T   T
                      Since the columns representing A  B and B  A are not identical, we can conclude that
                      A  B 6 B  A.
                      REMARK
                      It is a common mistake for beginning mathematicians to assume that A  B and B  A
                      are the same. They are not! Consider the following statement.
                      This is a true statement (assuming Lassie has had no amputations or birth defects). The
                      contrapositive of this statement is
                      which is clearly false. Many animals other than dogs have four legs.
40                                                                      Chapter 4   Truth Tables
                  A   B   C   BC      A  (B  C) A  B A  C         (A  B)  (A  C)
                  T   T   T    T            T        T     T                   T
                  T   T   F    F            T        T     T                   T
                  T   F   T    F            T        T     T                   T
                  T   F   F    F            T        T     T                   T
                  F   T   T    T            T        T     T                   T
                  F   T   F    F            F        T     F                   F
                  F   F   T    F            F        F     T                   F
                  F   F   F    F            F        F     F                   F
           Since the columns associated with the statements A(B C) and (AB)(AC) are
           identical, the two statements are equivalent. That is, A  (B  C)  (A  B)  (A  C).
4.6 Practice
      1. Use truth tables to show that for statements A, B and C, the Associativity Laws
         hold. That is
           (a) A  (B  C)  (A  B)  C
           (b) A  (B  C)  (A  B)  C
      2. Use truth tables to show that for statements A, B and C, the Distributivity Laws
         hold. That is
           (a) A  (B  C)  (A  B)  (A  C)
           (b) A  (B  C)  (A  B)  (A  C)
Introduction to Sets
5.1 Objectives
                     1. Define and gain experience with set, element, set-builder notation, defining property,
                        subset, superset, equality of sets, empty set, universal set, complement, cardinality,
                        union, intersection and difference.
Definition 5.2.1   A set is a collection of objects. The objects that make up a set are called its elements (or
  Set, Element     members).
                   Sets can contain any type of object. Since this is a math course, we frequently use sets of
                   numbers. But sets could contain letters, the letters of the alphabet for example, or books,
                   such as those in a library collection.
                   It is customary to use uppercase letters (A, B, C . . .) to represent sets and lowercase letters
                   (a, b, c, . . .) to represent elements. If a is an element of the set A, we write a  A. If a is
                   not an element of the set A, we write a 6 A.
                   Small sets can be explicitly listed. For example, the set of even numbers less than 10 is
{2, 4, 6, 8}
Definition 5.2.2   An integer p > 1 is called a prime if its only positive divisors are 1 and p; otherwise it is
     Prime         called composite.
                                                                 41
42                                                                                Chapter 5    Introduction to Sets
                 When explicitly listing sets, we use curly braces, {}, and separate elements with a comma.
                 Many sets are either too large to be listed (the set of all primes less than 10,000) or are
                 defined by a rule. In these cases, we employ set-builder notation which makes use of a
                 defining property of the set. For example, the set of all real numbers between 1 and 2
                 inclusive could be written as
                                                      {x  R | 1  x  2}
                 The part of the description following the bar (|) is the defining property of the set. Some
                 authors use a colon (:) instead of a bar and write
                                                        {x  R : 1  x  2}
                 As when explicitly listing sets, we use curly braces, {}.
                 Some letters have become associated with specific sets.
                                           N    natural numbers, 1, 2, 3, . . .
                                           Z    integers
                                           Q    rational numbers, { pq | p, q  Z, q 6= 0}
                                           Q    irrational numbers
                                           R    real numbers
                                           C    complex numbers {x + yi | x, y  R}
                    4. In calculus, we often use intervals of real numbers. The closed interval [a, b] is
                       defined as the set
                                                       {x  R | a  x  b}
Section 5.2    Describing a Set                                                                                43
Definition 5.2.3        A set A is called a subset of a set B, and is written A  B, if every element of A belongs
      Subset            to B. Symbolically, we write
A B means x A x B
                        or equivalently
                                                   A  B means For all x  A, x  B
                        We sometimes say that A is contained in B.
     Example 2
                                                           {1, 2, 3}  {1, 2, 3, 4}
Definition 5.2.4        A set A is called a proper subset of a set B, and written A  B, if every element of A
  Proper Subset         belongs to B and there exists an element in B which does not belong to A.
     Example 3
                                                           {1, 2, 3}  {1, 2, 3, 4}
Definition 5.2.5        A set A is called a superset of a set B, and written A  B, if every element of B belongs
     Superset           to A. A  B is equivalent to B  A.
     Example 4
                                                           {1, 2, 3, 4}  {1, 2, 3}
Definition 5.2.6        As before, a set A is called a proper superset of a set B, and written A  B, if every
  Proper Subset         element of B belongs to A and there exists an element in A which does not belong to B.
     Example 5
                                                           {1, 2, 3, 4}  {1, 2, 3}
Definition 5.2.7        Saying that two sets A and B are equal, and writing A = B, means that A and B have
   Set Equality         exactly the same elements. The usual way of showing A = B is to show mutual inclusion,
                        that is, show A is contained in B and B is contained in A. Symbolically, we write
                                                    A = B means A  B AND B  A
 44                                                                              Chapter 5   Introduction to Sets
 Definition 5.2.8     There is a special set, called the empty set and denoted by , which contains no elements.
       Empty Set      The empty set is a subset of every set.
 Definition 5.2.9     When we discuss sets, we are often concerned with subsets of some implicit or specified set
      Universal Set   U , called the universal set. In our work on divisibility and greatest common divisors, we
                      will be concerned with integers as the universal set, even when we dont explicitly say so.
Definition 5.2.10     Relative to a universal set U , the complement of a subset A of U , written A, is the set of
 Set Complement       all elements in U but not in A. Symbolically, we write
A = {x | x U AND x 6 A} = {x | (x U ) (x 6 A)}
Definition 5.2.11     Lastly, the cardinality of a set A, written |A|, is the number of elements in the set.
      Cardinality
        Example 6     For example, if A = {1, 2, 3, 4}, then |A| = 4. Heres a pair of mind-blowing questions.
                      What is the cardinality of N? How much larger is Q than N?
                      Solution:
                                    
                        1. S = { 2,  2}. |S| = 2.
                        2. T = . |T | = 0.
                                       
                        3. , { 2}, { 2}, S
Section 5.3   Set Operations                                                                                        45
     Example 8        Let the universal set for this question be U , the set of natural numbers less than twenty.
                      Let T be the set of integers divisible by three and F be the set of integers divisible by five.
                         1. Describe T by explicitly listing the set and by using set-builder notation in at least
                            two ways.
Solution:
                         1. Explicitly listing the set gives T = {3, 6, 9, 12, 15, 18}. Two set-builder descriptions of
                            the set are T = {n  N : 3 | n, n < 20} and T = {3k | k  N, 3k < 20}
Definition 5.3.1      The union of two sets A and B, written A  B, is the set of all elements belonging to either
      Union           set A or set B. Symbolically we write
A B = {x | x A OR x B} = {x | (x A) (x B)}
                      Note that when we say set A or set B we mean the mathematical use of or. That is, the
                      element can belong to A, B or both A and B.
Definition 5.3.2      The intersection of two sets A and B, written A  B, is the set of all elements belonging
   Intersection       to both set A and set B. Symbolically we write
                                        A  B = {x | x  A AND x  B} = {x | (x  A)  (x  B)}
46                                                                             Chapter 5    Introduction to Sets
Definition 5.3.3   The difference of two sets A and B, written A  B (or A \ B), is the set of all elements
     Difference    belonging to A but not B. Symbolically we write
A B = {x | x A AND x 6 B} = {x | (x A) (x 6 B)}
      Example 9    Let the universal set for this question be U , the set of natural numbers less than or equal
                   to twelve. Let T be the set of integers divisible by three, F be the set of integers divisible
                   by five and P the set of primes. Determine each of the following.
1. T F
2. T F
3. P
4. P (T F )
5. T F
6. (T F ) P
Solution:
2. T F =
4. P (T F ) = {3, 5}
                      Venn diagrams can serve as useful illustrations of set relationships. In Figure 5.3.1 below,
                      the universal set is U = {a, b, c, d, e, w}, the set A = {a, b, c, d} and the set B = {d, e}.
                      The element d lies in the intersection of sets A and B. Since d is the only such element,
                      A  B = {d}. The element w does not lie in either set A or B.
                                                                       w
                                                   A                                    B
                                                            b
                                                                       d
                                                                                 e
                                                        a       c
                      One common use of sets is to describe values which are solutions to an equation, but care
                      in expression is required here. The following two sentences mean different things.
ax2 + bx + c = 0
                            are                                             
                                                                     b     b2  4ac
                                                                x=
                                                                            2a
                        2. Let a, b, c  R, a 6= 0 and b2  4ac  0. Then
                                                                       
                                                                  b  b2  4ac
                                                             x=
                                                                        2a
                            are solutions to the quadratic equation
ax2 + bx + c = 0
                  This point can be confusing. Statements about solutions are often implicitly divided into
                  two sets: the set S of all solutions and a set T of proposed solutions. One must be careful
                  to determine whether the statement is equivalent to S = T or T  S. Phrases like the
                  solution or complete solution or all solutions indicate S = T . Phrases like a solution or are
                  solutions indicate T  S.
                  Similar confusion arises when showing that sets have more than one representation. For
                  example, a circle centred at the origin O is often defined geometrically as the set of points
                  equidistant from O. Others define a circle algebraically in the Cartesian plane as the set of
                  points satisfying x2 + y 2 = r2 . To show that the two definitions describe the same object,
                  one must show that the two sets of points are equal.
5.4.2 An Example
                  Given a set S and a set T , there are two very frequent tasks one must perform: one must
                  show S  T or S = T . In fact, the second task is usually just two instances of the first
                  task: to show S = T one can show S  T and T  S.
                  So, the important message here is that mathematicians must become skilled at demonstrat-
                  ing that S  T . The plan in all cases is the same: choose a generic element of S and show
                  that it belongs to T . Symbolically
                                                  S  T means x  S  x  T
                  or equivalently
                                                S  T means For all x  S, x  T
                  The element chosen must be completely generic and could, if forced, be instantiated as any
                  element of the set S. Showing that a specific element of S belongs to T is inadequate.
Solution:
                    1. Let S be the set of all roots of f (x) = (x2  1) sin x. (We could write S more
                       symbolically as S = {x  R | f (x) = 0}.) Let T be the set of integer multiples of .
                       (We could also write T more symbolically as T = {n | n  Z}).
                    2. To show that S = T we must show T  S and S  T . Since sin(n) = 0 for all
                       integers n, we know that f (n) = 0. Now, the defining property of S is that a real
                       number x belongs to S if f (x) = 0. Since f (n) = 0, n  S. This is equivalent to: if
                       n  T then n  S, or equivalently, T  S. Now consider x = 1. The value x = 1 is
                       a solution to (x2  1) sin x = 0 and so belongs to S, but it is not an integer multiple
                       of , so it does not belong to T . That is, S 6 T and so the two sets are not equal.
                    3. The statement is true. The statement only claims that T  S, not S = T .
Section 5.5   Practice                                                                                        49
5.5 Practice
More on Sets
6.1 Objectives
                Lets take a look at two proofs of the same statement about sets. The first uses a chain of
                if and only if statements, the second uses mutual inclusion.
A (B C) = (A B) (A C)
                Proof: This proof uses a chain of if and only if statements to show that both A  (B  C)
                and (A  B)  (A  C) have exactly the same elements. Let x  A  (B  C). Then
                      x  A  (B  C)
                         (x  A)  (x  (B  C))                                 definition of union
                         (x  A)  ((x  B)  (x  C))                     definition of intersection
                         ((x  A)  (x  B))  ((x  A)  (x  C))        Distributive Law of logic
                         (x  A  B)  (x  A  C)                               definition of union
                         x  ((A  B)  (A  C))                           definition of intersection
Proof: This proof uses mutual inclusion. That is, we will show
1. A (B C) (A B) (A C)
                                                            50
Section 6.3   More Examples                                                                                    51
2. A (B C) (A B) (A C)
The first of these two proofs also uses mutual inclusion. Do you see how?
                     REMARK
                     Which technique is better for proving the equality of two sets: a chain of if and only if
                     statements or mutual inclusion? Though some of the choice is personal style, the choice is
                     primarily determined by the reversibility of each step in the proof. A chain of if and only
                     if statements only works if each step in the chain is reversible. Thats pretty unusual. Most
                     of the time when you are proving two sets are equal, you will need to use mutual inclusion.
U (S T ) = (U S) (U T )
Solution:
       i. If x  U  (S  T ), then x  (U  S)  (U  T ), and
      ii. If x  (U  S)  (U  T ), then x  U  (S  T ).
     In the first case, let x  U  (S  T ). By the definition of set intersection, x  U
     AND x  S  T . If x  S, then x  U  S and so x  (U  S)  (U  T ). If x  T ,
     then x  U  T and so x  (U  S)  (U  T ). In either case, x  (U  S)  (U  T )
     as needed.
     In the second case, let x  (U  S)  (U  T ). By the definition of set union
     x  U  S OR x  U  T . If x  U  S, then by the definition of set intersection
     x  U AND x  S. But then x  U and x  S  T so x  U  (S  T ). If
     x  U  T , then by the definition of set intersection x  U AND x  T . So again,
     x  U and x  S  T so x  U  (S  T ). In either case, x  x  U  (S  T ).
    Part III
Proof Techniques
       53
Chapter 7
Quantifiers
7.1 Objectives
7.2 Quantifiers
Not all mathematical statements are obviously in the form If A, then B. You will en-
counter statements of the form there is, there are, there exists, it has or for all, for each, for
every, for any. The first four are all examples of the existential quantifier there is and
the final four are all examples of the universal quantifier for all. The word existence is
used to make it clear that we are looking for or looking at a particular mathematical object.
The word universal is used to make it clear that we are looking for or looking at a set of
objects all of which share some desired behaviour.
REMARK
All statements which use quantifiers are similar to one of the following two statements,
though some elements of the sentence may be implicit or appear in a different order.
Some mathematicians prefer a more symbolic approach. The symbol  stands for the
English expression there exists. The symbol  stands for the English expression for all.
Symbolically, the two quantified sentences above are written as:
                                          x  S, P (x)
                                          x  S, P (x)
                                               54
Section 7.2   Quantifiers                                                                                          55
                       REMARK
                       All statements which use quantifiers share a basic structure.
                       It is crucial that you be able to identify the four parts in the structure of quantified state-
                       ments.
Here are some examples. Lets begin with something we have already seen.
Example 1
                                     Quantifier:       
                                     Variable:         x
                                     Domain:           R
                                     Open sentence:    f (x) = 0
                               This is a good point to illustrate the influence of the domain. Suppose in this example
                               we are interested in the specific function f (x) = x2  2. Then the statement
          The sentence might appear as 2n > n2 for all integers n > 5. The order is different
          but the meaning is the same.
                 Quantifier:       
                 Variable:         an angle 
                 Domain:           R, inferred from the context
                 Open sentence:    sin() = 1
          Note that in this example, the domain is implicit. Note also that there can be many
          objects, many angles , which satisfy the statement.
                 Quantifier:       
                 Variable:         
                 Domain:           R, inferred from context
                 Open sentence:    sin2 () + cos2 () = 1
       6. If f is continuous on [a, b] and differentiable on (a, b) and f (a) = f (b), then there
          exists a real number c  (a, b) such that f 0 (c) = 0.
          The conclusion of this implication uses an existential quantifier. The hypothesis and
          the conclusion are:
          For the conclusion, the parts of the quantified statement are given below.
                 Quantifier:       
                 Variable:         c
                 Domain:           (a, b)  R
                 Open sentence:    f 0 (c) = 0
     It takes practice to become fluent in reading and writing statements that use quantifiers.
Section 7.3   The Object Method                                                                                  57
                      REMARK
                      We use the Object Method when an existential quantifier occurs in the hypothesis. Suppose
                      that we must prove A implies B and A uses an existential quantifier. That is, A looks
                      like
                      We proceed exactly as the English language interpretation would suggest - we assume that
                      the object x exists. We should:
                         2. Assume that a mathematical object x exists within the set S so that the statement
                            P (x) is true.
For example, lets look at the proof of the Transitivity of Divisibility again.
                      You might ask Where is the existential quantifier?. It isnt obvious  yet. But recall the
                      definition of divisibility.
                      The sentence there exists an integer k so that n = km uses the existential quantifier. It
                      is very common in mathematics that sentences contain implicit quantifiers and you should
                      be alert for them. Returning to divisibility, we have already identified the four parts of the
                      quantified sentence.
                             Quantifier:        
                             Variable:          k
                             Domain:            Z
                             Open sentence:     n = km
58                                                                                      Chapter 7   Quantifiers
                 How would the Object Method work? Consider the statement a | b. It uses an implicit
                 existential quantifier. Since a | b occurs in the hypothesis, we assume the existence of an
                 integer, say r, so that ra = b. And if you return to examine our proof of Transitivity of
                 Divisibility, this is precisely what appears in the first sentence of the proof. Similarly, the
                 Object Method can be used with b | c to assert that there exists an integer s so that sb = c.
                 Together, the first two sentences of the proof allow us to derive the third sentence.
                 REMARK
                 We use the Construct Method when an existential quantifier occurs in the conclusion.
                 Suppose that we must prove A implies B and B uses an existential quantifier. That is,
                 B looks like
                 We proceed exactly as the English language interpretation would suggest - we show that
                 the object x exists, that x is in the set S, and that P (x) is true. We should:
3. Show that x S.
Proposition 2 If n is of the form 4` + 1 for some positive integer `, then 8 | (n2 1).
                 As usual, let us begin by explicitly identifying the hypothesis, the conclusion and the core
                 proof technique.
                 Core Proof Technique: Since the definition of divisibility contains an existential quan-
                     tifier, and 8 | (n2  1) occurs in the conclusion, we will use the Construct Method.
                 What, precisely should we construct? Again, thinking of the definition of divisibility and
                 the requirement of the Construct Method, we should construct a k and then show that k is
                 an integer and that 8k = n2  1. We can record this as a proof in progress.
Section 7.4   The Construct Method                                                                                   59
Proof in Progress
                      Where is this k going to come from? Lets start with the hypothesis, n is of the form 4` + 1
                      for some integer `. Substituting n = 4` + 1 into n2  1 gives
1. Let n = 4` + 1.
3. Construct k.
5. Show that 8k = n2 1.
                      It seems that a suitable choice for k would be 2`2 + `. Since ` is an integer and the product
                      of integers is an integer and the sum of integers is an integer, k is an integer. It is also clear
                      from the equation above that 8k = n2  1.
                      A proof might look like the following.
                      Note that the proof does not explicitly name the Construct Method.
                      Our next proposition may seem unusual because it does not have an explicit hypothesis.
     Even before we see a proof we should be able to guess at the structure of the proof. As usual,
     we begin with the hypothesis, conclusion, core proof technique and preliminary material.
Hypothesis: None.
     Core Proof Technique: Since there is an existential quantifier in the conclusion, we use
         the Construct Method.
Since we are working with a quantifier, lets be very clear about the four parts.
            Quantifier:           
            Variable:             
            Domain:               [0, 2]
            Open sentence:        sin  = cos 
     Following from the remarks at the beginning of this section, the proof will probably look
     like
     Proof in Progress
2. Since . . . [0, 2] This is where we show that the constructed object is in the domain.
       3. Now we show that sin  = cos  This is where we show that the constructed object
          satisfies the open sentence.
     Here is a proof. Take a minute to read it and see how closely it matches the expected
     structure. Also observe that no indication is given of how  was constructed.
                             
     Proof: Consider  =       . Clearly,   [0, 2]. Since
                             4
                                               1                  1
                              sin  = sin     =  and cos  = cos = 
                                            4    2               4    2
     sin  = cos  as required.
Section 7.5   The Select Method                                                                               61
                      REMARK
                      We use the Select Method whenever a universal quantifier occurs. Suppose a statement
                      looks like
                      We proceed exactly as the English language interpretation would suggest - we show that
                      whenever an object x in the set S exists, P (x) is true. We should:
                             Quantifier:        
                             Variable:          n
                             Domain:            odd integers
                             Open sentence:     4 | (n2 + 4n + 3)
                      Now we select a representative mathematical object from the set. Lets call the odd integer
                      that we selected n0 . We could certainly call it n. I am using n0 to emphasize that we have
                      selected a representative element. Now we must show that 4 | (n20 + 4n0 + 3). This much is
                      already very representative of a typical proof using the Select Method.
                      Proof in Progress
                 Proof: Let n0 be an odd integer. We can write n0 as 2m+1 for some integer m. Substituting
                 n0 = 2m + 1 into n20 + 4n0 + 3 gives
                 The same proof would work if we converted the universal statement into an If ... then 
                 form. The equivalent statement would be
                 It is important to emphasize the connection between sets and quantifiers. The basic struc-
                 tures of all quantified statements use sets.
                 To correctly prove or use quantified statements, you must first correctly identify the set
                 being used.
                 Also, quantifiers frequently appear in the defining property of a set. For example, the set
                 of even integers
                                                        {n  Z : 2 | n}
                 uses an implicit existential quantifier in the definition of divides.
                 To show that S  T , we use the universally quantified statement
x S, x T
7.7 A Non-Proof
                      Making mistakes is easy. Lets take a look at a proof which is not a proof. Lets find out
                      why it fails.
                                                                                                        1
  Proposition 6       If r is a positive real number with r 6= 1, then there is an integer n such that 2 n < r.
Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
                                                                 1
                        1. Let n be any integer with n >               .
                                                              log2 (r)
                                                  1
                        2. It then follows that     < log2 (r).
                                                  n
                                    1
                        3. Hence 2 n < 2log2 (r) = r.
                      Analysis of Proof Lets begin by identifying the hypothesis and the conclusion. An in-
                          terpretation of sentences 1 through 3 will follow.
                      Even the analysis looks good. What went wrong? Lets look again at Sentence 2. Here we
                      used the statement
64                                                                                     Chapter 7   Quantifiers
                   A proof seems pretty straightforward  divide both sides of a < b by ab. Except that
                   the statement is false. Consider the case a = 2 and b = 4. 2 < 4 but 41  2
                                                                                                1
                                                                                                  . Our
                   proposition really should be
                   Now we can find the problem in our proof. Choose r so that 0 < r < 1, say r = 1/2. That
                   will make log2 (r) negative and hence 1/ log2 (r) negative. Choose n = 1. Now Sentence 1 is
                   satisfied but Sentence 2 fails.
                   Can you think of any way to correct the proposition or the proof?
                    Chapter 8
Nested Quantifiers
8.1 Objectives
Definition 8.2.1    Let S and T be two sets. A function f from S to T , denoted by f : S  T , is a rule that
Function, Domain,   assigns to each element s  S a unique element f (s)  T . The set S is called the domain
 Codomain, Value    of the function and the set T is called the codomain. The element f (s) is called the value
                    of the function f at s.
                                                                  65
66                                                                                Chapter 8   Nested Quantifiers
Definition 8.2.2    The set of values of the function is called the image of f and is denoted by f (S). The set
      Image         f (S) is often a proper subset of the codomain, not the entire codomain.
f (S) = {f (s) | s S} T
                    Some authors use range instead of image, but since other authors use range to mean
                    codomain, we will avoid the word range entirely.
     Example 1      The familiar function sin x is often defined with domain R, codomain R and image [1, 1].
                    The floor function, denoted by bxc, maps a real number x to the largest integer less than
                    or equal to x. For example,
1. b3.14c = 3.
2. b3.99c = 3.
                      3. b3.14c = 4. Since the floor of x is the largest integer less than or equal to x, 3
                         cannot be the floor of 3.14 since 3 > 3.14.
Definition 8.2.3    Let S and T be two sets. A function f : S  T is onto (or surjective) if and only if for
 Onto, Surjective   every y  T there exists an x  S so that f (x) = y.
                            Quantifier:      
                            Variable:        y
                            Domain:          T
                            Open sentence:   there exists an x  S so that f (x) = y
                    The open sentence itself contains a quantifier! So we can again identify the four parts of
                    this quantifier.
                            Quantifier:      
                            Variable:        x
                            Domain:          S
                            Open sentence:   f (x) = y
Section 8.2   Onto (Surjective) Functions                                                                          67
                       REMARK
                       Because the existential quantifier is nested within the universal quantifier, this definition
                       is an example of nested quantifiers. There are really two basic principles for working
                       with nested quantifiers.
1. Process quantifiers from left to right. (This captures the nested structure.)
2. Use Object, Construct and Select methods as you proceed from left to right.
x y, y > x
                       Translated into prose, this statement can be read as Given any integer x, there exists a
                       larger integer y. This is a true statement. Now lets make a small modification. We will
                       just change the order of the quantifiers. Our new statement is
y x, y > x
                       A translation for this statement would be There exists an integer y which is larger than
                       all integers. A very different, and false, statement.
                       Lets return to the definition of onto. We should be able to determine the structure of any
                       proof that a function is onto. Lets keep the definition in mind.
                       A proof in progress that captures the structure of an onto proof is given below.
68                                                                             Chapter 8     Nested Quantifiers
Proof in Progress
3. First, we show that x S. We show that the constructed object is within the domain.
4. Now we show that f (x) = y. We show that the open sentence is satisfied.
8.2.3 Reading
Lets work through an example. Notice how closely the proof follows our proof in progress.
 Proposition 1   Let m 6= 0 and b be fixed real numbers. The function f : R  R defined by f (x) = mx + b
                 is onto.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let y R.
2. Consider x = (y b)/m.
3. Since y R, x R.
                 Sentence 1 Let y  R.
                      The first quantifier in the definition of onto is a universal quantifier so the author uses
                      the Select Method. That is, the author chooses an element (y) in the domain (R).
                      The author must now show that the open sentence is satisfied (there exists an x  R
                      so that f (x) = y).
Section 8.2   Onto (Surjective) Functions                                                                          69
                       Sentence 3 Since y  R, x  R.
                             Because this step is usually straightforward, it is often omitted. It is included here to
                             emphasize that the constructed object lies in the appropriate domain.
8.2.4 Discovering
                       We can begin with the basic proof structure that we discussed earlier.
                       Proof in Progress
y = x2 + 3
                   It is not immediately obvious that x  [1, 2]. Some arithmetic manipulation with inequalities
                   helps us here. Since y  [4, 7], we know that
4y7
                     3. Now                                                      p
                                         4y 71y341                        y321x2
                   Substitution will give us the last step. Here is a complete proof. Note that techniques are
                   not named and the steps in the arithmetic are not explicitly justified. These are left to the
                   reader.
                                                               
                   Proof: Let y  [4, 7]. Consider x =             y  3. Now
                                                                                p
                                   4y 71y341                             y321x2
                   Since
                                                       f (x) = x2 + 3 = ( y  3)2 + 3 = y
                                                                         p
f is onto.
                   The choice of the domain and codomain for the function is important. Consider the state-
                   ment
                   This is very similar to the proposition we just proved, and you might think that the same
                   proof would work. But it doesnt. Consider the choice y = 0  R. What value of x maps to
                   0? Since f (x) = x2 + 3  3 for all real numbers x, there is no choice of x so that f (x) = 0,
                   and Statement 3 is false.
Section 8.2   Onto (Surjective) Functions                                                                         71
                       Mathematics makes great use of the composition of functions. The next proposition, whose
                       proof may be intimidating the first time you see it, states that the composition of onto
                       functions is also onto.
                       There are three instances of onto in the proposition. Two occur in the hypothesis and are
                       associated with the functions f and g. The third occurs in the conclusion and is associated
                       with the function f  g. That is the one that interests us right now. The definition of onto
                       begins with a universal qualifier. So we will use the Select Method applied to f  g. Using
                       our proof template we have the following.
                       Proof in Progress
1. Let y U .
                       Constructing x seems difficult. We do not know what the sets S, T and U are and we have
                       no idea what the functions f and g look like. But we have not made use of our hypotheses
                       at all so lets see if they can give us any ideas.
                       Since f : T  U is onto, we know that for any u  U , there exists a t  T so that f (t) = u.
                       Since g : S  T is onto, we know that for any t  T , there exists an s  S so that g(s) = t.
                       How does y fit in? Observe that y  U . But f : T  U and is onto, so there exists a
                       t0  T so that f (t0 ) = y. Since t0  T and g : S  T is onto, there exists an s0  S so that
                       g(s0 ) = t0 .
                       But what have we constructed? If we let x = s0 then we have an element that maps from
                       S to T and then from T to U for which f (g(s0 )) = y. Lets record these thoughts.
72                                                                                 Chapter 8   Nested Quantifiers
Proof in Progress
                     1. Let y  U .
                     2. Since f : T  U is onto, there exists a t0  T so that f (t0 ) = y.
                     3. Since t0  T and g : S  T is onto, there exists an s0  S so that g(s0 ) = t0 .
                     4. Hence, there exists s0  S so that f (g(s0 )) = f (t0 ) = y.
                     5. Hence, there exists x  S so that f (g(x)) = y.
                   Notice that our last two lines are essentially duplicates. When doing rough work, this
                   is common. However, when writing up a proof, such duplications should be removed,
                   consistent notation should be enforced and omitted steps should be included. In this case,
                   the proof is almost done for us.
8.3 Limits
8.3.1 Definition
                   Almost everyone who takes a calculus course encounters the notion of a limit. When we
                   write
                                                       lim f (x) = L
                                                            xa
                   we informally mean that we can make the values of f (x) arbitrarily close to L by taking
                   x sufficiently close to, but not equal to a. But formally we need to be more explicit about
                   what arbitrarily and sufficiently mean. That leads to the infamous    definition of
                   a limit.
Definition 8.3.1   The limit of f (x), as x approaches a, equals L means that for every real number  > 0
     Limit         there exists a real number  > 0 such that
Lets carefully parse the definition beginning with the universal quantifier For every.
                           Quantifier:      
                           Variable:        
                           Domain:          real numbers > 0
                           Open sentence:   there exists a real number  > 0 such that
                   The open sentence itself contains a quantifier, so we must again identify the four parts of
                   the quantifier.
Section 8.3   Limits                                                                                              73
                               Quantifier:      
                               Variable:        
                               Domain:          real numbers > 0
                               Open sentence:   0 < |x  a| <   |f (x)  L| < 
                       It is vitally important to observe that the open sentence is an implication. Because the
                       existential quantifier is nested within the universal quantifier, this definition is another
                       example of nested quantifiers.
                       We should take a minute here to think about x. The definition of limit began with the
                       expression The limit of f (x), as x approaches a so x is a real number. The implication
                       in the definition could be more explicitly phrased as
                                            If x  R and 0 < |x  a| < , then |f (x)  L| < 
                       Keeping in mind our earlier remarks about implications with variables in the hypothesis
                       being equivalent to quantifiers, we could replace the implication by the quantified statement
                                             x  {x  R : 0 < |x  a| < }, |f (x)  L| < 
                       which would be a third level of nesting! Well stay with the implication form because its
                       simpler.
                       Before we begin our example, we should be able to determine the structure of any limit
                       proof. The order of quantifiers is
                       The choice of  will depend on the choice of  and so  will be a function of . The Construct
                       Method identifies a mathematical object, shows that the object is within the appropriate
                       domain, and that the object satisfies the corresponding open sentence. The open sentence in
                       this case is an implication with hypothesis 0 < |x  a| < () and conclusion |f (x)  L| < .
                       We assume that the hypothesis is true and show that the conclusion is true. So a limit
                       proof will look like the following.
                       Proof in Progress
                         1. Let  > 0 be a real number. This comes from the Select Method.
                         2. Consider the real number () = . . .. This comes from the Construct Method. Most
                            texts will use simply . Here we use () to emphasize that  is a function of .
                         3. First, we show that () > 0. This shows  is within the domain.
                         4. Now let 0 < |xa| < (). This is the hypothesis of the open sentence in the definition
                            of limit.
                         5. We show that |f (x)  L| < . This is the conclusion of the open sentence.
                       The difficulty lies in finding a suitable choice of (). Lets analyze a proof where someone
                       else has made the choice of () for us.
74                                                                            Chapter 8     Nested Quantifiers
Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
as required.
Analysis of Proof As usual, we begin with the hypothesis and the conclusion.
                                                                       
                       Sentence 3 Since  > 0 and |m| > 0, () =         > 0.
                                                                      |m|
                             After an object is constructed, the Construct Method requires that the object be in
                             the domain and that it satisfy the open sentence. Sentence 3 of the proof shows that
                              is in the domain, the set of real numbers greater than zero.
                       Sentence 4 Now . . .
                             Sentence 4 demonstrates that  satisfies the open sentence. The hypothesis of the
                             open sentence is 0 < |x  a| < () and the conclusion is |f (x)  L| < . The chain
                             of reasoning begins with the hypothesis, and after arithmetic manipulation, arrives at
                             the conclusion.
We will prove
Hypothesis: f (x) = x2
                       This is a standard limit proof so we use our proof in progress to provide a structure.
                       Proof in Progress
4. Now let 0 < |x| < (). (This is just 0 < |x a| < () with a = 0.)
5. We show that |x2 | < . (This is just |f (x) L| < with f (x) = x2 and L = 0.)
                       The problem is: How do we construct a suitable ? Because  is not numerically specified,
                       our construction for  will be a function of . Now is the time to go to scrap paper. Since
                       we need
                                                                 |x2 | < 
                       we begin there and work backwards to get to 0 < |x| < (). Since |x2 | = x2 , we have
                                                                  x2 < 
76                                                                            Chapter 8   Nested Quantifiers
                 Sentence 3 will follow directly from  > 0. Sentence 5 will follow from Step 4 by squaring
                 the terms. A complete proof follows.
                                                                                           
                 Proof: Let  > 0 be a real number. Consider the real number () =            . Since  > 0,
                 
                    > 0. Now                
                                   0 < |x| <   0 < |x|2 <   |x|2 <   |x2 | < 
                 as needed.
                 This proof was relatively easy, in part because a was 0. Lets consider a slightly more
                 complicated setting.
4. Now let 0 < |x 3| < (). (This is just 0 < |x a| < () with a = 3.)
                    5. We show that |x2  9| < . (This is just |f (x)  L| <  with f (x) = x2 and L = 9.)
Section 8.3   Limits                                                                                                      77
                       Lets try what we did before and see how far we get. Since we need
                                                                |x2  9| < 
                       we begin there and work backwards to get to 0 < |x  3| < (). In the previous case, we
                       took the square root, but the square root of |x2  9| will be hard to work with. Lets try
                       another way.
                                     |x2  9| <   |(x  3)(x + 3)| <                           (factor)
                                                   |x  3||x + 3| <                       (|ab| = |a||b|)
                       We have the |x  3| we need. What do we do with the |x + 3|? We could divide by the
                       |x + 3| to get
                                                                            
                                                               |x  3| <
                                                                         |x + 3|
                                          
                       and let () =          . But  is a function of , not  and x. Somehow we need to make a
                                       |x + 3|
                       choice of  that does not involve x. Lets be a little more careful about the range of values
                       x can take.
                       The notion of limit applies only when x is close to a, say |x  a| < 1. In our particular case
                       this means |x  3| < 1. This implies
                                             |x  3| < 1  1 < x  3 < 1  5 < x + 3 < 7
                       Lets look again at
                                                              |x  3||x + 3| < 
                                                                                                                   
                       We know that x + 3 < 7 so |x  3||x + 3| < 7|x  3|. If we were to choose  so that x  3 <
                                                                                                                   7
                       then
                                                                          
                                                         |x  3||x + 3| <  7 = 
                                                                          7
                       which is exactly what we need.
                                                                                      
                       But now we have two restrictions, |x  3| < 1 and |x  3| < so it makes sense to choose
                                                                                      7
                       the smallest of the two as our .
                                                                        n o
                                                            () = min 1,
                                                                            7
                       This complicates our proof somewhat because we have two cases to check in the fifth step
                       of the proof. Here is a complete proof.
                                                                                             n o
                       Proof: Let  > 0 be a real number. Consider the real number () = min 1,   . Since
                                                                                                 7
                        > 0, () > 0. Observe that
                                             |x  3| < 1  1 < x  3 < 1  5 < x + 3 < 7
                       Suppose () = 1. Then
                          0 < |x  a| < ()  |x  3| < 1                         (hypothesis in definition of limit)
                                              |x  3||x + 3| < |x + 3|                         (multiply by |x + 3|)
                                              |(x  3)(x + 3)| < |x + 3|                               (|a||b| = |ab|)
                                              |x2  9| < 7                    (x + 3 < 7 from observation above)
                                                                                                      
                                              |x2  9| <                                       (1   7  )
                                                                                                      7
78                                                                              Chapter 8    Nested Quantifiers
                 as needed.
                                            
                 Now suppose that () =    7   then
                                                   
                   0 < |x  a| < ()  |x  3| <                          (hypothesis in definition of limit)
                                                   7
                                                          
                                        |x  3||x + 3| <  |x + 3|                     (multiply by |x + 3|)
                                                          7
                                                            
                                        |(x  3)(x + 3)| <  7           (x + 3 < 7 from observation above)
                                                            7
                                        |x2  9| < 
as needed.
We will prove
                                 2
 Proposition 8   If f (x) = e1/x , then
                                                         lim f (x) = 0.
                                                         x0
                 You might object that the function is not even defined at 0, which is true. But the definition
                 of limxa f (x) does not require f to be defined at a. As usual, we begin by explicitly
                 identifying our hypothesis and conclusion.
                                                2
                 Hypothesis: f (x) = e1/x
                   4. Now let 0 < |x| < (). (This is just 0 < |x  a| < () with a = 0.)
                                           2                                                      2
                   5. We show that |e1/x | < . (This is just |f (x)L| <  with f (x) = e1/x and L = 0.)
                 The problem is: How do we construct a suitable ? Because  is not numerically specified,
                 our construction for  will be a function of . Now is the time to go to scrap paper. Since
                 we need
                                                                2
                                                         |e1/x | < 
                                                                                        2
                 we begin there and work backwards to get to 0 < |x| < (). e1/x > 0 for all x so we do
                 not need the absolute value signs.
                                                         1
                                                             <
                                                       e 2
                                                        1/x
Section 8.4   Summary                                                                                              79
                                                                                                            2
                    Now divide by  (we are using the hypothesis that  6= 0) and multiply by e1/x (we are
                                            2
                    using the fact that e1/x > 0) to get the following.
                                                              1       2
                                                                < e1/x
                                                              
                    Taking the natural log gives                
                                                                1    1
                                                            ln     < 2
                                                                   x
                    This is hopeful. We can invert the fractions to get
                                                                      1
                                                            x2 <
                                                                   ln(1/)
                    This looks great. Unfortunately, we have made a dangerous assumption, that is ln(1/) > 0.
                    This is only true when  < 1. However, it is mathematical practice to consider  as small,
                    much smaller than one. We will adopt standard practice and ignore the case   1 though
                    details could be given for it as well.
                    We have already worked out the math so now we are in a position to write out the proof.
                    Take a minute to read the proof.
                                                                                          q
                                                                                                 1
                    Proof: Let  > 0. Since  is small, we assume  < 1. Consider  =         ln(1/) .   Since  < 1,
                    1/ > 1 which implies ln(1/) > 0 and so  > 0. Now
                                s                                    
                                     1                    1          1    1  1      2        2
                      0 < |x| <            0<x <  2
                                                                ln     < 2  < e1/x  |e1/x | < 
                                  ln(1/)              ln(1/)          x   
as required.
8.4 Summary
                        1. For each quantifier encountered from left to right, identify the quantifier, variable,
                           domain and open sentence.
                        2. Apply the appropriate Construct or Select Methods based on the order of the quan-
                           tifiers as they appear from left to right.
            Chapter 9
9.1 Objectives
This class provides an opportunity to practice working with quantifiers and sets.
Example 1   For each of the following definitions, identify each quantifier, its parts and the proof tech-
            niques that you would use to prove that a specific object satisfies the definition.
              1. Saying that the function f of one real variable is bounded above means that there
                 is a real number y such that for every real number x, f (x)  y.
                  Solution: We begin with the first quantifier
                        Quantifier:       
                        Variable:         y
                        Domain:           R
                        Open sentence:    for every real number x, f (x)  y
                  which contains a nested quantifier
                        Quantifier:       
                        Variable:         x
                        Domain:           R
                        Open sentence:    f (x)  y
                                                         80
Section 9.2   Worked Examples                                                                                      81
                        2. Saying that the function f of one real variable is continuous at the point x means
                           that for every real number  > 0 there is a real number  > 0 such that, for all real
                           numbers y with |x  y| < , |f (x)  f (y)| < .
                           Solution: There are three quantifiers in this definition. The first is
                                 Quantifier:        
                                 Variable:          
                                 Domain:            {  R |  > 0}
                                 Open sentence:     there is a real number  > 0 such that,
                                                    for all real numbers y with |x  y| < , |f (x)  f (y)| < 
                           which contains a nested quantifier
                                 Quantifier:        
                                 Variable:          
                                 Domain:            {  R |  > 0}
                                 Open sentence:     for all real numbers y with |x  y| < , |f (x)  f (y)| < 
                           which, in turn, contains the nested quantifier
                                 Quantifier:        
                                 Variable:          y
                                 Domain:            {y  R : |x  y| < }
                                 Open sentence:     |f (x)  f (y)| < 
                           A proof should use the Select Method (with ), followed by the Construct Method
                           (for ) followed by the Select Method (for y).
     Example 2       For each of the following statements, identify each quantifier (including implicit quantifiers),
                     its parts and your approach to a proof of the statement.
x1 , x2 , x3 , . . . , xn , . . .
                 A sequence {xi } converges to L if, for every  > 0 there is a corresponding integer N so
                 that n > N implies |xn  L| < .
                                                            1
                 Consider the sequence {xi } defined by xi = .
                                                            i
                           (a) Let  > 0. Use the Select Method corresponding to the universal quantifier.
                           (b) Consider N = . . .. Use the Construct Method corresponding to the existential
                               quantifier.
                           (c) Since . . . , N  Z. The Construct Method requires that we show that the con-
                               structed object is in the required domain.
                           (d) Let n > N . The open sentence of the existential quantifier contains the implica-
                               tion If n > N , then |xn  L| < . This sentence corresponds to the hypothesis
                               of this implication. The remainder of the proof demonstrates the conclusion.
                           (e) Hence, |xn  L| < . To be completed.
                                     1                                       1                  1
                          Since xn =   and L is zero, |xn  L| <  becomes     <  which implies < n. For
                                     n                                       n                  
                                                                                1
                          our N we can choose any integer which is greater than . A complete proof is given
                                                                                
                          below.
                                                                                            1           1
                          Proof: Let  > 0. For N , choose any integer which is greater than . Since N > ,
                                                                                                       
                             1
                           > . Now let n > N . Then
                             N
                                                                   
                                                              1     1       1
                                                  |xn  L| =   0 = <       <
                                                                n       n    N
                          as required.
                    Chapter 10
Simple Induction
10.1 Objectives
                      1. Learn how to use sum and product notation, and recognize recurrence relations.
                      2. Learn how to use Simple Induction.
10.2 Notation
                    A number of examples we will discuss use sum, product and recursive notation that you
                    may not be familiar with.
                                                                 84
Section 10.2   Notation                                                                                       85
     Example 1
                                                       7
                                                       X
                                                             i2 = 32 + 42 + 52 + 62 + 72
                                                       i=3
                                            3
                                            X
                                                  sin(k) = sin(0) + sin() + sin(2) + sin(3)
                                            k=0
                                                       n
                                                       X 1       1 1        1
                                                          2
                                                            = 1 + + +  + 2
                                                         i       4 9       n
                                                       i=1
                      This notation is often generalized to an arbitrary logical condition, and the sum runs over
                      all values satisfying the condition.
                      is the sum of f (x) over all elements x in the set S. The expression
                                                                   X
                                                                        d
                                                                      d|n,d>0
                          1. Multiplying by a constant
                                                     n
                                                     X               n
                                                                     X
                                                           cxi = c         xi where c is a constant
                                                     i=m             i=m
                      The first three properties require indices with the same upper and lower bounds. The last
                      property allows us to change the bounds of the index of summation, which is often useful
                      when combining summation expressions.
 86                                                                                   Chapter 10   Simple Induction
                                                      xm  xm+1  xm+2      xn
                                         Q
                      The product symbol, , is the upper case Greek letter pi. The index i and the upper and
                      lower bounds m and n behave just as they do for sums.
      Example 3                       n                                
                                      Y     1      1      1       1           1
                                         1 2 = 1     1     1       1  2
                                           i       4      9      16          n
                                      i=2
                      You are accustomed to seeing mathematical expressions in one of two ways: iterative and
                      closed form. For example, the sum of the first n integers can be expressed iteratively as
1 + 2 + 3 + + n
                      or in closed form as
                                                               n(n + 1)
                                                                  2
                      There is a third way.
Definition 10.2.3     A recurrence relation is an equation that defines a sequence of numbers and which is
Recurrence Relation   generated by one or more initial terms, and expressions involving prior terms.
You are probably familiar with the Fibonacci sequence which is a recurrence relation.
                                                       f (1) = 1 and
                                                      f (n) = f (n  1) + n for n > 1
                        Induction is a common and powerful technique and should be a consideration whenever you
                        encounter a statement of the form
                        Often the clause For every integer n  1 is implied and does not actually appear in the
                        proposition, as in the following version of the same theorem.
                                                                      n(n + 1)(2n + 1)
   Proposition 3        The sum of the first n perfect squares is                      .
                                                                             6
Definition 10.4.1       An axiom of a mathematical system is a statement that is assumed to be true. No proof
      Axiom             is given. From axioms we derive propositions and theorems.
                        Sometimes axioms are described as self-evident, though many are not. Axioms are defining
                        properties of mathematical systems. The Principle of Mathematical Induction is one such
                        axiom.
88                                                                                     Chapter 10   Simple Induction
                 The structure of a proof by induction models the Principle of Mathematical Induction. The
                 three parts of the structure are as follows.
                 Base Case Verify that P (1) is true. This is usually easy. You will often see the statement
                     It is easy to see that the statement is true for n = 1. It is best to write this step
                     out completely.
                 Inductive Hypothesis Assume that P (k) is true for some integer k  1. It is best to
                     write out the statement P (k).
                 Inductive Conclusion Using the assumption that P (k) is true, show that P (k + 1) is
                     true. Again, it is best to write out the statement P (k + 1) before trying to prove it.
                 The basic idea is simple. We show that P (1) is true. We then use P (1) to show that P (2)
                 is true. And then we use P (2) to show that P (3) is true and continue indefinitely. That is
                                      P (1)  P (2)  P (3)  . . .  P (k)  P (k + 1)  . . .
Our first example is very typical and uses an equation containing the integer n.
                      Base Case We verify that P (1) is true where P (1) is the statement
                                                                     1
                                                                     X              1(1 + 1)(2  1 + 1)
                                                         P (1) :             i2 =                       .
                                                                                             6
                                                                       i=1
                            As in most base cases involving equations, we can evaluate the expressions on the
                            left hand side and right hand side of the equals sign. The left hand side expression
                            evaluates to
                                                               X1
                                                                   i2 = 12 = 1
                                                                             i=1
                            and the right hand side expression evaluates to
                                                                    1(1 + 1)(2  1 + 1)
                                                                                        = 1.
                                                                             6
                            Since both sides equal each other, P (1) is true.
                      Inductive Hypothesis We assume that the statement P (k) is true for some integer k  1.
                                                                        k
                                                                        X            k(k + 1)(2k + 1)
                                                             P (k) :          i2 =                    .
                                                                                            6
                                                                        i=1
                            This is the difficult part. When working with equations, you can often start with the
                            more complicated expression and decompose it into an instance of P (k) with some
                            leftovers. Thats what we will do here.
                               k+1         k
                                                !
                               X         X
                                   i2 =       i2 + (k + 1)2
                                                             
                                                                              (partition into P (k) and other)
                               i=1           i=1
                                                           
                                           k(k + 1)(2k + 1)
                                                              + (k + 1)2
                                                                         
                                     =                                                          (use the inductive hypothesis)
                                                  6
                                         k(k + 1)(2k + 1) + 6(k + 1)2
                                     =                                                                (algebraic manipulation)
                                                       6
                                         (k + 1) 2k 2 + 7k + 6
                                                               
                                     =                                                     (factor out k + 1, expand the rest)
                                                    6
                                         (k + 1)(k + 2)(2k + 3)
                                     =                                                                                (factor)
                                                    6
                                         (k + 1)((k + 1) + 1)(2(k + 1) + 1)
                                     =
                                                         6
                            The result is true for n = k +1, and so holds for all n by the Principle of Mathematical
                            Induction.
Proof: Base Case We verify that P (1) is true where P (1) is the statement
                       We can enumerate all of the sets of S1 easily. They are { } and {1}, exactly two as
                       required.
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 1.
                       The subsets of Sk+1 can be partitioned into two sets. The set A in which no subset
                       contains the element k+1, and the complement of A, A, in which every subset contains
                       the element k + 1. Now A is just the subsets of Sk and so, by the inductive hypothesis,
                       has 2k subsets of Sk . A is composed of the subsets of Sk to which the element k + 1
                       is added. So, again by our inductive hypothesis, there are 2k subsets of A. Since
                       A and A are disjoint and together contain all of the subsets of Sk+1 , there must be
                       2k + 2k = 2k+1 subsets of Sk+1 .
                       The result is true for n = k +1, and so holds for all n by the Principle of Mathematical
                       Induction.
                 Some true statements cannot start with for all integers n, n  1. For example, 2n > n2 
                 is false for n = 2, 3, and 4 but true for n  5. But the basic idea holds. If we can show
                 that a statement is true for some base case n = b, and then show that
P (b) P (b + 1) P (b + 2) . . . P (k) P (k + 1) . . .
                 this is also induction. Perhaps this is not surprising because we can always recast a state-
                 ment For every integer n  b, P (n) as an equivalent statement For every integer m  1,
                 P (m). For example,
                 is equivalent to
Section 10.4   Principle of Mathematical Induction                                                                91
                      the only changes we need to make are that our base case is P (b) rather than P (1), and that
                      in our inductive hypothesis we assume P (k) is true for k  b rather than k  1.
                      Here is an example.
As usual, lets be very clear about what our statement P (n) is.
P (n): n2 > 2n + 1.
Proof: Base Case We verify that P (3) is true where P (3) is the statement
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 3.
P (k): k 2 > 2k + 1
                      The first inequality follows from the inductive hypothesis and the second inequality uses
                      the fact that k > 0.
                      Since the result is true for n = k + 1, and so holds for all n by the Principle of Mathematical
                      Induction.
                            P (n): 2n > n2 .
92                                                                             Chapter 10   Simple Induction
Proof: Base Case We verify that P (5) is true where P (5) is the statement
P (5): 25 > 52
Inductive Hypothesis We assume that the statement P (k) is true for some integer k 5.
P (k): 2k > k 2
                      We will use the fact that for k  5, k 2 > 2k + 1 which follows from the previous
                      proposition.
                 The result is true for n = k + 1, and so holds for all n by the Principle of Mathematical
                 Induction.
Proposition 9 A 2n 2n grid of squares with one square removed can be covered by triominoes.
                           Note that our inductive hypothesis covers every possible position for the empty square
                           within the grid.
                                P (k + 1): A 2k+1  2k+1 grid of squares with one square removed can be
                                covered by triominoes.
                           The missing square occurs in one of the four 2k  2k subgrids formed. Well start by
                           placing one tile around the centre of the grid, not covering any of the 2k  2k subgrids
                           where the square is missing:
                           We can now view the grid as being made up of four 2k  2k subgrids, each with one
                           square missing. The Inductive Hypothesis tells us that each of these can be covered
                           by triominoes. Together with one more triomino in the centre, the whole 2k+1  2k+1
                           grid can be covered. The result is true for n = k + 1, and so holds for all n by the
                           Principle of Mathematical Induction.
94                                                                           Chapter 10   Simple Induction
10.6 Practice
                          5. Let y = ln x.
                                             dy d2 y d3 y d4 y
                              (a) Determine    ,     ,    ,     .
                                             dx dx2 dx3 dx4
                                                               dn y
                              (b) Conjecture an expression for      .
                                                               dxn
                              (c) Use induction to prove your conjecture.
                          6. An integer n is perfect if the sum of all of its positive divisors (including 1 and itself)
                             is 2n.
Strong Induction
11.1 Objectives
                Sometimes Simple Induction doesnt work where it looks like it should. We then need to
                change our approach a bit. The following example is similar to examples that weve done
                earlier. Lets try to make Simple Induction work and see where things go wrong.
Proposition 1   Let the sequence {xn } be defined by x1 = 0, x2 = 30 and xm = xm1 + 6xm2 for m  3.
                Then
                                             xn = 2  3n + 3  (2)n for n  1.
                The proposition is saying that the recursive definition of xn implies the closed form of xn .
                This seems like a classic case for induction since the conclusion clearly depends on the
                integer n. Lets begin with our statement P (n).
P (n): xn = 2 3n + 3 (2)n .
Proof: Base Case We verify that P (1) is true where P (1) is the statement
P (1): x1 = 2 31 + 3 (2)1 .
                     From the definition of the sequence x1 = 0. The right side of the statement P (1)
                     evaluates to 0 so P (1) is true.
                                                              96
Section 11.2   Strong Induction                                                                                        97
P (k): xk = 2 3k + 3 (2)k .
                      Now two problems are exposed. The more obvious problem is what do we do with xk1 ?
                      The more subtle problem is whether we can even validly write the first line. When k + 1 = 2
                      we get
                                                          x2 = x1 + 6x0
                      and x0 is not even defined.
                      The basic principle that earlier instances imply later instances is sound. We need to
                      strengthen our notion of induction in two ways. First, we need to allow for more than
                      one base case so that we avoid the problem of undefined terms. Second, we need to allow
                      access to any of the statements P (1), P (2), P (3), ... , P (k) when showing that P (k + 1) is
                      true. This may seem like too strong an assumption but is, in fact, quite acceptable. This
                      practice is based on the Principle of Strong Induction.
1. P (1), P (2), . . . , P (b) are true for some positive integer b, and
2. P (1), P (2), . . . , P (k) are all true implies P (k + 1) is true for all k N,
Base Cases Verify that P (1), P (2), . . . , P (b) are all true. This is usually easy.
                      Inductive Hypothesis Assume that P (1), P (2), . . . , P (k) are true for some k  b. This is
                          sometimes written as Assume that P (i) is true for i = 1, 2, 3, . . . , k, k  b or Assume
                          that P (i) is true for 1  i  k, k  b.
                      Inductive Conclusion Using the assumption that P (1), P (2), . . . , P (k) are true,
                          show that P (k + 1) is true.
98                                                                                      Chapter 11    Strong Induction
                 As a rule of thumb, use Strong Induction when the general case depends on more than one
                 previous case. Though we could use Strong Induction all the time, Simple Induction is often
                 easier.
                 Lets return to our previous proposition.
 Proposition 2   Let the sequence {xn } be defined by x1 = 0, x2 = 30 and xm = xm1 + 6xm2 for m  3.
                 Then
                                              xn = 2  3n + 3  (2)n for n  1.
P (n): xn = 2 3n + 3 (2)n .
Proof: Base Case We verify that P (1) and P (2) are true.
P (1): x1 = 2 31 + 3 (2)1 .
                      From the definition of the sequence x1 = 0. The right side of the statement P (1)
                      evaluates to 0 so P (1) is true.
P (2): x2 = 2 32 + 3 (2)2 .
                      From the definition of the sequence x2 = 30. The right side of the statement P (2)
                      evaluates to 30 so P (2) is true.
P (i): xi = 2 3i + 3 (2)i .
                      The result is true for n = k + 1, and so holds for all n by the Principle of Strong
                      Induction.
Section 11.3   Strong Induction                                                                                 99
Proposition 3 Every integer n 9 can be written in the form 3x + 4y for positive integers x and y.
                                                              x   y 3x + 4y
                                                              3   0       9
                                                              2   1      10
                                                              1   2      11
                                                              4   0      12
                                                              3   1      13
                                                              2   2      14
                      There seems to be a pattern. After every group of three integers n, we can generate the
                      next group of three integers by adding one to the preceding values of x. Since this is a case
                      where previous values allow us to generate later values, induction may work.
                      Our first task is to come up with a suitable statement P (n).
                      Proof: Base Case We verify that P (9), P (10) and P (11) are true. We repeat the table
                          above for the required values of 9, 10 and 11. Note that x and y are positive integers.
                                                                  x   y 3x + 4y
                                                                  3   0       9
                                                                  2   1      10
                                                                  1   2      11
                            The result is true for n = k + 1, and so holds for all n by the Principle of Strong
                            Induction.
100                                                                  Chapter 11    Strong Induction
11.3 Practice
                 as required. Since the result is true for n = k + 1, and so holds for all n by the
                 Principle of Mathematical Induction.
3. You know that the sum of the interior angles of a triangle is 180 .
             (a) Use this fact about triangles to determine the sum of the interior angles of a
                 convex quadrilateral. (A polygon is convex if every line segment joining non-
                 adjacent vertices lies wholly inside the polygon.)
             (b) Use (a) and the fact about triangles to determine the sum of the interior angles
                 of a convex pentagon.
             (c) Conjecture a value for the sum of the interior angles of a convex polygon with n
                 sides.
             (d) Use induction to prove your conjecture.
Binomial Theorem
12.1 Objectives
                                                    (a + b)2 = a2 + 2ab + b2
                                                    (a + b)3 = a3 + 3a2 b + 3ab2 + b3
                       The obvious question is: what is the expansion of (a + b)n for a positive integer n?
                       The expansion of (a + b)n uses binomial coefficients.
                                                                   102
Section 12.2   Binomial Theorem                                                                                 103
     Example 1                                             
                                                           6    6!
                                                              = 2!4! = 15
                                                           2
                                                          
                                                          10    10!
                                                              =     1!9! = 10
                                                           1
                                                           
                                                            a   a!
                                                              = 0!a! = 1
                                                            0
                      Proof:
                                       
                                   n     n              n!               n!
                                       +    =                     +
                                  r1    r    (r  1)!(n  r + 1)! r!(n  r)!
                                                        n!           r        n!       nr+1
                                            =                      +               
                                              (r  1)!(n  r + 1)! r r!(n  r)! n  r + 1
                                              r(n!) + (n  r + 1)(n!)
                                            =
                                                   r!(n  r + 1)!
                                               (n + 1)(n!)
                                            =                     (factor n! out in the numerator)
                                              r!(n  r + 1)!
                                                 (n + 1)!
                                            =
                                              r!(n  r + 1)!
                                                     
                                                n+1
                                            =
                                                  r
      Example 2
                                              3  
                                        3
                                              X  3
                               (x + y) =                  x3r y r
                                                     r
                                              r=0
                                                                     
                                               3 30 0  3 31 1   3 32 2  3 33 3
                                            =    x y +     x y +    x y +     x y
                                               0        1         2        3
                                            = x3 + 3x2 y + 3xy 2 + y 3
      Example 3
                                            3  
                                            X
                                              33
                                 (2x  3) =      (2x)3r (3)r = 8x3  36x2 + 54x  27
                                               r
                                                    r=0
                  Base Case We verify that P (1) is true where P (1) is the statement
                                                                           1  
                                                                       1
                                                                           X  1 1r r
                                                         P (n) : (x + y) =      x y .
                                                                              r
                                                                             r=0
                       Since
                                  1                
                                  X  1 1r r  1 10 0  1 11 1
                                       x y =    x y +    x y = x + y = (x + y)1
                                     r        0        1
                                  r=0
                           The result is true for n = k +1, and so holds for all n by the Principle of Mathematical
                           Induction.
106                                                                             Chapter 12   Binomial Theorem
       1. Expand
                                                                3 4
                                                                 
                                                           2x +
                                                                y
          Solution:
                 4 X 4              r
                3          4       4r    3
           2x +     =        (2x)
                y     r=0
                           r              y
                                            1           2           3    4
                        4     4      4       3  3     4      2  3    4       1  3    4   3
                    =     (2x) +        (2x)        +    (2x)      +    (2x)       +
                        0            1          y     2         y    3          y    4   y
                                 3          2
                             96x       216x     216x  81
                    = 16x4 +        +         + 3 + 4
                               y         y2       y   y
          Solution:                                                      12
                                                                      4
                                                               x2 +
                                                                      x
          The i-th term in the expansion is
                                                              i  
                                         12           2 12i
                                                               4    12 i 243i
                                                  x                =    4x
                                          i                     x     i
          The term containing x3 corresponds to the term generated when i = 7. The coefficient is
                                                    
                                                     12 7
                                                        4
                                                     7
12.4 Practice
             (a)                                                
                                                           n    n
                                                             =
                                                           k   nk
             (b) Using induction, prove that
                                          
                                          n
                                             is an integer for 0  r  n
                                          r
                    Chapter 13
Negation
13.1 Objectives
Definition 13.2.1   The negation of the statement A is the statement NOT A. Because statements cannot be
    Negation        both true and false, exactly only one of A and NOT A can be true.
                    Thus, (A) = A. Two negatives are a positive, or equivalently, one NOT cancels another
                    NOT. For example,
                                                                 107
108                                                                                   Chapter 13    Negation
                  You have already seen DeMorgans Laws when we worked with truth tables. DeMorgans
                  Laws tell us how to negate statements containing AND and OR.
1. (A B) (A) (B)
2. (A B) (A) (B)
                  REMARK
                  From DeMorgans Laws, there is a specific rule applied when negating a statement contain-
                  ing the word AND.
                       A: B AND C
                       NOT A: (NOT B) OR (NOT C)
                  Note that the connecting word has changed from AND to OR and that each term in the
                  expression has been negated. The brackets are not needed because NOT precedes OR in
                  logical evaluation, but the brackets are useful to emphasize the change. Here is a specific
                  example.
                       A: a | b and a | c.
                       NOT A: a - b or a - c.
                  REMARK
                  Similar to the conjunctive AND, DeMorgans Laws provide a specific rule when negating a
                  statement containing the word OR.
                       A: B OR C
                       NOT A: (NOT B) AND (NOT C)
Section 13.3   Negating Statements with Quantifiers                                                         109
                      Note that the connecting word has changed from OR to AND and, again, each term in the
                      expression has been negated. As before, the brackets are not needed because NOT precedes
                      AND in logical evaluation, but the brackets are useful to emphasize the change. Here is an
                      example.
                            A: a | b or a | c.
                            NOT A: a - b and a - c.
Negating statements that contains quantifiers is more complicated. We first observe that:
                      REMARK
                      A statement with an existential quantifier looks like
Its negation is
Its negation is
                  REMARK
                  To negate a statement using nested quantifiers, do the following.
                  Step 2 Move the NOT from left to right replacing quantifiers by their opposites and in
                       each case place the NOT just before the open sentence. Repeat until there are no
                       quantifiers to the right of NOT.
                  Step 3 When all of the quantifiers are to the left of NOT, incorporate the NOT into the
                       open sentence.
                        (a) NOT [There exists x  S such that for every f  F , f (x) = 0.]
                        (b) For every x  S, NOT [for every f  F , f (x) = 0].
                            For every x  S there exists a f  F , NOT [f (x) = 0].
                        (c) For every x  S there exists a f  F , f (x) 6= 0.
13.3.1 Counterexamples
                  So far in the course, we have worked on proving that statements are true. How do we prove
                  that a statement is false? In principle, this is relatively easy. To show that the statement
                  A is false, we only need to prove that the statement NOT A is true.
 Section 13.4   Negating Statements with Quantifiers                                                           111
This statement is very similar to our first example. NOT A is the statement
                       In this case, NOT A is easy to prove using our construction method. If I consider x = 0, I
                       know that 0  [, ] and sin(x) = 1 6= 0. The number 0 is a counterexample.
Definition 13.3.1      In general, if we wish to prove that a universal statement A is false, we show that its
 Counterexample        negation, which is an existential statement, is true. The particular object which we use to
                       show that the existential statement is true is called a counterexample of statement A.
                       The same idea arises when we want to show that a statement of the form A implies B
                       is false. It is enough to show a particular instance where A is true and B is false, or
                       equivalently NOT B is true. For example, consider the following statement.
The hypothesis is
B: a | b and a | c.
                       To show that S is false, we must find a specific instance where A is true and B is false. To
                       show that B is false we must show that NOT B is true.
NOT B: a - b or a - c.
13.4 Practice
       1. Consider the following statement. For all a, b, c  Z, there exists an integer solution
          to ax2 + by 2 = c whenever gcd(a, b) | c.
       3. For each of the following statements, either prove the statement or disprove it using
          a counterexample.
Contradiction
14.1 Objectives
We have mostly used the Direct Method to discover proofs, often in conjunction with one
of the methods associated with quantifiers. There are times when this is difficult. A proof
by contradiction provides a new method.
Suppose that we wish to prove that the statement A implies B is true. We assume that A
is true. We must show that B is true. What would happen if B were true, but we assumed
it was false and continued our reasoning based on the assumption that B was false? Since a
mathematical statement cannot be both true and false, it seems likely we would eventually
encounter a mathematically non-sensical statement. Then we would ask ourselves How
did we arrive at this nonsense? and the answer would have to be that our assumption that
B was false was wrong and B is, in fact, true.
                                            113
114                                                                                  Chapter 14     Contradiction
                  REMARK
                  A proof by contradiction of the statement A implies B structures proofs in exactly this
                  way. Proceed as follows.
                  Unfortunately, it is not always clear what contradiction to find, or how to find it. What is
                  more clear is when to use contradiction.
                  The general rule of thumb is to use contradiction when the statement NOT B gives you
                  useful information. There are typically two instances when this is useful. The first instance
                  is when the statement B is one of only two alternatives. For example, if the conclusion B
                  is the statement f (x) = 0 then the only two possibilities are f (x) = 0 and f (x) 6= 0. NOT
                  B is the statement f (x) 6= 0 which could be useful to you. The second instance is when B
                  contains a negation. As we saw earlier, NOT B eliminates the negation.
      Example 1   The integers 2, 3, 5 and 7 are primes and each is a product unto itself, that is, it is a product
                  consisting of one factor. The integers 4 = 2  2, 6 = 2  3 and 8 = 2  2  2 have been
                  factored as products of primes.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                    1. Let N be the smallest integer, greater than 1, that cannot be written as a product of
                       primes.
3. Since r and s are less than N , they can be written as a product of primes.
                      Sentence 1 Let N be the smallest integer, greater than 1, that cannot be written as a
                           product of primes.
                           The first sentence of a proof by contradiction usually gives the specific form of NOT
                           B that the author is going to work with. In this case, the author identifies that this is
                           a proof by contradiction by assuming the existence of an object which contradicts the
                           conclusion, an integer N which cannot be written as a product of primes. Moreover,
                           of all such candidates for N the author chooses the smallest one. Though it may not
                           be obvious when first encountering the proof why the author would stipulate such a
                           condition, it always has to do with something needed later in the argument.
                           Once you know that this is a proof by contradiction, look ahead to find the contra-
                           diction. In this case, the contradiction appears in Sentence 4.
                      Sentence 3 Since r and s are less than N , they can be written as a product of primes.
                           This sentence makes it clear why N needs to be the smallest integer that cannot be
                           written as a product of primes. In order to generate the contradiction, r and s must
                           be written as products of primes. If it were the case that N was not the smallest such
                           integer, it might be the case that neither r nor s could be written as a product of
                           primes.
                      Since our reasoning is correct, it must be the case that our assumption that there is an
                      integer which cannot be written as a product of primes is incorrect. That is, every integer
                      can be written as a product of primes.
                      Discovering a proof by contradiction can be difficult and often requires several attempts at
                      finding the path to a contradiction. Lets see how we might discover a proof to a famous
                      theorem recorded by Euclid.
                      We should always be clear about our hypothesis and conclusion. There is no explicit hy-
                      pothesis in this case and the conclusion is the statement
116                                                                        Chapter 14   Contradiction
2. To be completed.
      Now comes the tough part. What do we do from here? How do we generate a contradiction?
      Well, if the number of primes is finite, could we somehow use that assumption to find a
      new prime not in our finite list of primes? Our candidate should not have any of the
      finite primes as a factor. At this point, it sounds like we need to list our primes.
      Proof in Progress
3. To be completed.
4. To be completed.
      Clearly N is larger than any of the pi so, by the first sentence, N cannot be in the list of
      primes. Thus
      Proof in Progress
        5. To be completed.
Section 14.2   How To Use Contradiction                                                                                117
                      And this is where we can find our contradiction. N has no non-trivial factors since dividing
                      N by any of the pi leaves a remainder of 1. But that means N cannot be written as a
                      product of primes, which contradicts the previous proposition. The contradiction in this
                      proof arises from a result which is inconsistent with something else we have proved.
                      Proof in Progress
                      Proof: Assume that there are only a finite number of primes, say p1 , p2 , p3 , . . . , pn . Consider
                      the integer N = p1 p2 p3    pn + 1. Since N > pi for all i, N is not a prime. But N = pi q + 1
                      for each of the primes pi , so no pi is a factor of N . Hence N cannot be written as a product
                      of primes, which contradicts our previous proposition.
                    Chapter 15
Contrapositive
15.1 Objectives
                    The logical equivalence between a statement and its contrapositive gives us another proof
                    technique. Instead of proving A implies B we prove  NOT B implies NOT A using
                    any of the existing techniques.
                    This is very similar to contradiction. Use the contrapositive when the statement NOT A
                    or the statement NOT B gives you useful information. This is most likely to occur when
                    A or B contains a negation or is one of two possible choices. When both A and B contain
                    negations, it is highly likely that using the contrapositive will be productive.
                                                               118
Section 15.3   Reading a Proof That Uses the Contrapositive                                                     119
Proof: (For reference, each sentence of the proof is written on a separate line.)
3. Substitution gives
                         4. Since one of k 2 + k + 1 or k 2 + k + 2 must be even, and the last line above shows that
                            a factor of 16 already exists disjoint from (k 2 + k + 1)(k 2 + k + 2), (a2 + 3)(a2 + 7)
                            must contain a factor of 32. That is 32 | ((a2 + 3)(a2 + 7)).
                      Analysis of Proof Since the hypothesis of the proposition contains a negation, and the
                          conclusion is one of two possible choices, it makes sense to consider the contrapositive.
                            How would we know that the author was using the contrapositive if this sentence were
                            omitted? The clause If a is odd is NOT B so the author is using one of only two
                            proof techniques that begin this way, contradiction or contrapositive. Looking ahead
                            to the last line, we see that the author concludes with NOT A, so this is a proof of
                            the contrapositive. Had the author concluded with a contradiction, we would know
                            that this is a proof by contradiction.
 120                                                                                   Chapter 15     Contrapositive
                    Sentence 4 Since one of k 2 +k +1 or k 2 +k +2 must be even, and the last line above shows
                         that a factor of 16 already exists disjoint from (k 2 + k + 1)(k 2 + k + 2), (a2 + 3)(a2 + 7)
                         must contain a factor of 32. That is 32 | ((a2 + 3)(a2 + 7)).
                          These sentences establish the conclusion of the contrapositive. Since the contrapositive
                          is true, the original statement is true.
                    The important observation here is that once you decide to use the contrapositive, all of your
                    existing skills apply. The difficulty is in deciding whether or not to use the contrapositive.
                    For our example, we will begin with a definition.
Definition 15.3.1   A set S of real numbers is bounded if there is a real number M > 0 such that, for all
       Bounded      elements x  S, |x| < M .
   Proposition 2    Suppose that S and T are sets of real numbers with S  T . If S is not bounded, then T is
                    not bounded.
                    Since both the hypothesis and conclusion are negated, it makes sense to try to prove the
                    contrapositive If T is bounded, then S is bounded. This gives us two statements in our
                    proof.
                    Proof in Progress
2. To be completed.
                    Working backwards from the conclusion we can ask How do we show that S is bounded?
                    Using the definition of bounded, we can write
Section 15.3   Reading a Proof That Uses the Contrapositive                                                  121
Proof in Progress
2. To be completed.
                      Now the question becomes Where can we find such an M 0 ? If we use the definition of
                      bounded and work forward from the hypothesis we can write
                      Proof in Progress
                         2. Since T is bounded, there exists a real number M 0 > 0 such that, for all x  T ,
                            |x| < M 0 .
3. To be completed.
                      Next, we need to connect the two sets and show that the M 0 of the set T is the same as the
                      M 0 of the set S. But we know
Since x S and S T , x T .
                      Proof: We will prove the contrapositive. Suppose that T is bounded. Hence, there exists
                      a real number M 0 > 0 such that, for all x  T , |x| < M 0 . Let x  S. Since S  T , x  T
                      and so |x| < M 0 . But then S is bounded as required.
                      Sometimes, the contrapositive can make an apparently difficult proof quite easy. Try the
                      following exercise.
Uniqueness
16.1 Objectives
                  1. Learn how to prove an implication where a statement about uniqueness occurs in the
                     conclusion.
16.2 Introduction
                You have already encountered statements that contain the adjective unique. Instead of the
                word unique you may see one and only one or exactly one or distinct.
                Prior to this course you have probably seen statements like the following.
Example 1
1. Two lines in the plane which are not parallel will intersect in one and only one point.
a = qb + r where 0 r < b.
                                                            122
Section 16.3   Showing X = Y                                                                                    123
If . . ., then there is a unique object x in the set S such that P (x) is true.
                        1. Demonstrate that there is at least one object in the set S that satisfies P . Assume
                           that there are two objects X and Y in the set S such that P (X) and P (Y ) are true.
                           Show that X = Y .
                        2. Demonstrate that there is at least one object in the set S that satisfies P . Assume
                           that there are two distinct objects X and Y in the set S such that P (X) and P (Y )
                           are true. Derive a contradiction.
16.3 Showing X = Y
1. Demonstrate that there is at least one object in the set S that satisfies P .
                        2. Assume that there are two objects X and Y in the set S such that P (X) and P (Y )
                           are true.
3. Show that X = Y .
Proposition 2 If a and b are integers with a 6= 0 and a | b, then there is a unique integer k so that b = ka.
                     The appearance of unique in the conclusion tells us to use one of the two approaches
                     described in the previous section. In this case, we will assume the existence of two integers
                     k1 and k2 and show that k1 = k2 . But first, we need to show that at least one integer k
                     exists, and this follows immediately from the definition of divisibility.
                     Proof in Progress
                   2. Let k1 and k2 be integers such that b = k1 a and b = k2 a. (Note how closely this
                      follows the standard pattern. k1 corresponds to X. k2 corresponds to Y . Both come
                      from the set of integers and if P (x) is the statement b = xa, then P (X) and P (Y )
                      are assumed to be true.)
3. To be completed.
4. Hence, k1 = k2 .
k1 a = k2 a
k1 = k2
                 Proof: Since a | b, by the definition of divisibility there exists an integer k so that b = ka.
                 Now let k1 and k2 be integers such that b = k1 a and b = k2 a. But then k1 a = k2 a and
                 dividing by a gives k1 = k2 .
1. Demonstrate that there is at least one object in the set S that satisfies P .
                   2. Assume that there are two distinct objects X and Y in the set S such that P (X)
                      and P (Y ) are true.
3. Derive a contradiction.
                      The appearance of unique in the conclusion tells us to use one of the two approaches
                      described in the previous section. In this case, we will assume the existence of two distinct
                      points of intersection and derive a conclusion.
                      Proof in Progress
                      Suppose that in a proof of the Division Algorithm it has already been established that
                      integers q and r exist and only uniqueness remains. A proposed proof of uniqueness follows.
                                                         a = qb + r where 0  r < b
126                                                                       Chapter 16    Uniqueness
Proof: (For reference, each sentence of the proof is written on a separate line.)
4. (q1 q2 )b = r2 r1 .
5. Hence b | (r2 r1 ).
      Sentence 4 (q1  q2 )b = r2  r1 .
           This follows from equating a = q1 b + r1 and a = q2 b + r2 .
                                                b  r2  r1 < b
Section 16.5   The Division Algorithm                                                                      127
Elimination
17.1 Objectives
If A, then B or C.
             or symbolically,
                                                      ABC
             Lets interpret what these logical equivalences are telling us. The first equivalence says that
             to prove A  B  C it is enough to prove A  B or A  C. We do not need to prove
             both. And what if we cannot prove A  B? The second equivalence tells us that we can
             use A and B to show that C is true.
             And this makes sense. If we want to prove A  B  C and we can show that A  B, then
             we are done. But if A  B is false, then B must be false so we must show that C is true
             when A is true and B is false.
                                                          128
Section 17.4   Reading                                                                                       129
                         REMARK
                         Thus, to prove
If A, then B or C.
If A and B, then C.
The Elimination Method gets its name by eliminating one of the cases to consider.
17.4 Reading
Proposition 1 If x2 7x + 12 0, then x 3 or x 4.
Proof: (For reference, each sentence of the proof is written on a separate line.)
5. x 4 as desired.
                         Analysis of Proof Since the word or appears in the conclusion, it would make sense for
                             the author to use the Elimination Method. The statements corresponding to A, B
                             and C are:
                                  A: x2  7x + 12 > 0
                                  B: x  3
                                  C: x  4
The Elimination Method assumes A and B and uses these assumptions to prove C.
                 Sentence 5 x  4 as desired.
                      The author makes one small step from x  4  0 to get C.
ST ST
This may be mystifying. The word or does not appear. But lets rephrase the statement as
If x S T , then x S T
                 or
                                             If x  S  T , then x  S or x  T
                 Now the use of the word or is apparent. As usual, we begin by identifying the hypothesis,
                 conclusion, core proof technique and preliminary material.
Hypothesis: x S T
Conclusion: x S or x T
                 Core Proof Technique: Since or occurs in the conclusion, we will use the Elimination
                     Method.
                 Since we will use the Elimination Method, we will negate the first part of the conclusion
                 and establish the second part of the conclusion.
Section 17.5   Writing and Discovering                                                                         131
Proof in Progress
1. Suppose x S T and x 6 S.
2. To be completed.
3. Hence, x T .
1. Suppose x S T and x 6 S.
2. Since x S T , x 6 S T .
3. Since x 6 S, x S.
4. To be completed.
5. Hence, x T .
            132
                    Chapter 18
18.1 Objectives
Definition 18.2.1   Let a and b be integers, not both zero. An integer d > 0 is the greatest common divisor
 Greatest Common    of a and b, written gcd(a, b), if and only if
      Divisor
Example 1
gcd(24, 30) = 6
gcd(17, 25) = 1
gcd(12, 0) = 12
gcd(12, 12) = 12
gcd(0, 0) =??
                                                                 133
 134                                                                 Chapter 18    The Greatest Common Divisor
Definition 18.2.2   For a 6= 0, the definition implies that gcd(a, 0) = |a| and gcd(a, a) = |a|. We define gcd(0, 0)
       gcd(0, 0)    as 0. This may sound counterintuitive, since all integers are divisors of 0, but it is consistent
                    with gcd(a, 0) = |a| and gcd(a, a) = |a|.
       Example 2    Suppose a = 72 and b = 30. Now 72 = 230+12 so the proposition GCD With Remainders
                    asserts that gcd(72, 30) = gcd(30, 12). And this is true. The gcd(72, 30) and gcd(30, 12) is
                    6.
                    How would we discover a proof for GCD With Remainders? Lets try the usual approach:
                    identify the hypothesis and conclusion, and begin asking questions.
                    My first question typically starts with the conclusion and works backward. What is a
                    suitable first question? How about How do we show that two integers are equal? There
                    are lots of possible answers: show that their difference is zero, their ratio is one, each is
                    less than or equal the other. However, here we are working with gcds rather than generic
                    integers so perhaps a better question would be How do we show that a number is a gcd?
                    The broad answer is relatively easy. Use the definition of gcd. After all, right now it is
                    the only thing we have! A specific answer is less easy. Do we want to focus on gcd(a, b) or
                    gcd(b, r)? Here is an easy way to do both. Let d = gcd(a, b). Then show that d = gcd(b, r).
                    That gets us two statements in our proof.
                    Proof in Progress
2. To be completed.
                    But how do we show that d = gcd(b, r)? Use the definition. Our proof can expand to
                    Proof in Progress
2. We will show
3. To be completed.
                      For the first part of the definition, we ask How do we show that one number divides another
                      number? Interestingly enough, there are two different answers - one for b and one for r,
                      though that is not obvious. For b there is already a connection between d and b in the first
                      sentence. Since d = gcd(a, b), we know from the definition of gcd that d | b.
                      What about r? Using the definition of divisibility seems problematic. What propositions
                      could we use? Transitivity of Divisibility doesnt seem to apply. How about using the
                      Divisibility of Integer Combinations? Recall
                      Observe that r = a  qb. Since d | a and d | b, d divides any integer combination of a and
                      b by the Divisibility of Integer Combinations. That is, d | (a(1) + b(q)) so d | r. Lets
                      extend our proof in progress.
                      Proof in Progress
2. We will show
5. To be completed.
                      That leaves us with the greatest part of greatest common divisor. This second part of the
                      definition is itself an implication, so we assume that c | b and c | r and we must show c  d.
                      How do we show one number is less than or equal to another number? There doesnt seem
                      to be anything obvious but ask Have I seen this anywhere before?. Yes, we have. In the
                      second part of the definition of gcd. But then you might ask Isnt that assuming what we
                      have to prove? Lets be precise about what we are saying. We can use d for one inequality.
                      Since d = gcd(a, b), for any c where c | a and c | b, c  d.
                      What we need to show is: if c | b and c | r then c  d.
136                                                    Chapter 18    The Greatest Common Divisor
      These two statements are close, but not the same. Make sure that you see the difference.
      In one, we are using the fact that d = gcd(a, b). In the other, we are showing that any
      common factor of b and r is less than or equal to d.
      If we assume that c | b and c | r, then c | (b(q) + r(1)) by the Divisibility of Integer
      Combinations (again). Since a = qb + r, c | a. And now, since d = gcd(a, b) and c | a and
      c | b, c  d as needed. Lets add that to our proof in progress.
      Proof in Progress
2. We will show
      Having discovered a proof, we should now write the proof. Whenever you write, you should
      have an audience in mind. You actually have two audiences to keep in mind: your peers with
      whom you collaborate, and the markers. You do not need to specify each proof technique,
      since your peers and markers know all of them. It does help to provide an overall plan if
      you can. Also, proofs tend to work much more forwards than backwards because that helps
      to emphasize the notion of starting with hypotheses and ending with the conclusion. Here
      is one possible proof.
      Proof: Let d = gcd(a, b). We will use the definition of gcd to show that d = gcd(b, r).
      Since d = gcd(a, b), d | b. Observe that r = a  qb. Since d | a and d | b, d | (a  qb) by the
      Divisibility of Integer Combinations. Hence d | r, and d is a common divisor of b and r.
      Let c be a divisor of b and r. Since c | b and c | r, c | (qb + r) by the Divisibility of Integer
      Combinations. Now a = qb + r, so c | a. Because d = gcd(a, b) and c | a and c | b, c  d.
REMARK
        1. If a = b = 0 this proposition is also true since the only possible choices for b and r are
           b = r = 0.
        3. The proof may records steps in a different order than their appearance in the discovery
           process.
Section 18.3   Certificate of Correctess                                                                          137
5. Be sure that you can identify where each of the hypotheses was used in the proof.
                       Suppose we wanted to compute gcd(1386, 322). We could factor both numbers, find their
                       common factors and select the greatest. In general, this is very slow.
                       Repeated use of GCD With Remainders allows us to efficiently compute gcds. For example,
                       lets compute gcd(1386, 322).
     Example 3
                                       Since   1386 = 4  322 + 98,    gcd(1386, 322) = gcd(322, 98).
                                       Since   322 = 3  98 + 28,      gcd(322, 98) = gcd(98, 28).
                                       Since   98 = 3  28 + 14,       gcd(98, 28) = gcd(28, 14).
                                       Since   28 = 2  14 + 0,        gcd(28, 14) = gcd(14, 0).
                       Since gcd(14, 0) = 14, the chain of equalities from the column on the right gives us
gcd(1386, 322) = gcd(322, 98) = gcd(98, 28) = gcd(28, 14) = gcd(14, 0) = 14.
      Exercise 1       Randomly pick two positive integers and compute their gcd using the Euclidean Algorithm.
                       How do you know that you have the correct answer? Keep your work. Youll need it soon.
                       Because mistakes happen when performing arithmetic by hand, and mistakes happen when
                       programming computers, it would be very useful if there were a way to certify that an
                       answer is correct. Think of a certificate of correctness this way. You are a manager. You
                       ask one of your staff to solve a problem. The staff member comes back with the proposed
                       solution and a certificate of correctness that can be used to verify that the proposed solution
                       is, in fact, correct. The certificate has two parts: a theorem which you have already proved
                       and which relates to the problem in general, and data which relates to this specific problem.
                       For example, heres a proposition that allows us to produce a certificate for gcd(a, b).
                       Our certificate would consist of this theorem along with integers x and y. If our proposed
                       solution was d and d | a, d | b and ax + by = d, then we could conclude without doubt that
                       d = gcd(a, b).
138                                                   Chapter 18   The Greatest Common Divisor
      In Example 3 above, the proposed gcd of 1386 and 322 is 14. Our certificate of correctness
      consists of the GCD Characterization Theorem and the integers d = 14, x = 10 and y = 43.
      Note that 14 | 1386 and 14 | 322 and 1386  10 + 322  (43) = 14, so we can conclude
      that 14 = gcd(1386, 322).
      Here is a proof of the GCD Characterization Theorem.
Proof: (For reference, each sentence of the proof is written on a separate line.)
      Analysis of Proof As usual, we will begin by explicitly identifying the hypothesis and
          the conclusion.
                        1. Use the definition of gcd to prove the following statement. (Hint: Use the proof of
                           the GCD With Remainders proposition as a model.)
                          Let x, y  Z and let d = gcd(x, y). Then d = gcd(x, 3x + y).
                          Proof: We will show that d satisfies the definition of gcd for the pair x and 3x + y.
                          Specifically, we must show that
                          Since d = gcd(x, y), d | x. Also, since d | x and d | y, d divides any integer combination
                          of x and y, hence d | (3x + y).
                          Now suppose that c | x and c | (3x + y). Then c divides the integer combination
                          x(3) + (3x + y)(1)), that is, c | y. But since c | x and c | y and d = gcd(x, y), c  d.
                          All of the conditions of the definition of the gcd are satisfied so d = gcd(x, 3x + y).
140                                                    Chapter 18       The Greatest Common Divisor
18.5 Practice
Proof: Let a Z. By ,
(b) If gcd(x, y) = d, express gcd(18x + 3y, 3x) in terms of d. Justify your answer.
       4. Two integers a and b are coprime if gcd(a, b) = 1. Consider the following proposition
          and proof: If a and b are consecutive integers, then a and b are co-prime.
          Proof: (For reference purposes, each sentence of the proof is written on a separate
          line.)
19.1 Objectives
                    Given two positive integers, a and b, the EEA is an efficient way to compute not only
                    d = gcd(a, b) but the data x and y for the certificate. Well begin with an example and
                    then formally state the algorithm.
                    First though, we need to know what the floor of a number is.
Definition 19.2.1   The floor of x, written bxc, is the largest integer less than or equal to x.
      floor
Example 1
1. b9.713c = 9.
2. b9.025c = 9.
3. b9c = 9.
                      4. b9.713c = 10. Since the floor of x is the largest integer less than or equal to x, 9
                         cannot be the floor of 9.713 since 9 > 9.713.
                          
                          7
                      5.     = 3.
                          2
                                                                 141
142                                                  Chapter 19           The Extended Euclidean Algorithm
      Lets compute gcd(1386, 322) using the EEA. We begin by creating four columns labelled
      x, y, r (for remainder) and q (for quotient). We will construct a sequence of rows that will
      tell us the gcd and provide a certificate. For the i-th row we will label the column entries
      xi , yi , ri and qi . There is something very important to observe about the table. If we are
      computing gcd(a, b), in each row of the table
axi + byi = ri
                                                    x y r q
                                                    1 0 a 0
                                                    0 1 b 0
                                                x y   r  q
                                                1 0 1386 0
                                                0 1 322 0
      We construct each of the remaining rows by using the two preceding rows. To generate the
      third row we must first compute a quotient q3 using the formula
                                                       
                                                   ri2
                                            qi 
                                                   ri1
      Here we get                                                
                                              r1               1386
                                         q3 =                =        =4
                                              r2               322
      To construct the next row we use the formula
      When i = 3 we get
                                         Row3  Row1  q3 Row2
      With q3 = 4 we get
                                        Row3  Row1  4  Row2
      Writing this in the table gives
                                                  x y   r  q
                                        Row1      1 0 1386 0
                                        4  Row2 0 1  322 0
                                        = Row3    1 4 98 4
      In a similar fashion we get the fourth row. To generate the fourth row we must first compute
      a quotient q4 using the formula                     
                                                      ri2
                                               qi 
                                                      ri1
      Here we get                                                     
                                                    r2               322
                                         q4 =                =             =3
                                                    r3               98
Section 19.2   The Extended Euclidean Algorithm (EEA)                                                       143
                      When i = 4 we get
                                                      Row4  Row2  q4 Row3
                      With q4 = 3 we get
                                                     Row4  Row2  3  Row3
                      and so
                                                                x  y    r  q
                                                                 1  0 1386 0
                                                   Row2          0  1  322 0
                                                   3  Row3     1 4 98 4
                                                   = Row4       3 13  28 3
                                                          x  y    r  q
                                                          1   0 1386 0
                                                          0   1 322 0
                                                          1  4  98 4
                                                         3  13  28 3
                                                         10 43 14 3
                                                         23 99   0  2
                      We stop when the remainder is 0. The second last row provides the desired d, x and
                      y. The gcd d is the entry in the r column, x is the entry in the x column and y is the
                      entry in the y column. Hence, d = 14 (as before), and we can check the conditions of the
                      GCD Characterization Theorem to certify correctness. Since 14 | 1386 and 14 | 322 and
                      1386  10 + 322  (43) = 14, we can conclude that 14 = gcd(1386, 322).
                      If a or b is negative, apply the EEA to gcd(|a|, |b|) and then change the signs of x and y
                      after the EEA is complete. If a < b, simply swap their places in the algorithm. This works
                      because gcd(a, b) = gcd(b, a).
144                                                          Chapter 19    The Extended Euclidean Algorithm
                   We treat the EEA as a proposition where the preconditions of the algorithm are the hy-
                   potheses and the postconditions of the algorithm are the conclusions. Lets record the
                   algorithm in the form of a theorem.
                   A proof of the correctness of the EEA is available in the appendix. [Incomplete: Add to
                   appendix.]
      Exercise 1   Earlier you computed the gcd of two numbers. Repeat that exercise using the EEA and
                   verify that you can produce a certificate of correctness for your proposed gcd.
                          (a) Use the Extended Euclidean Algorithm to compute d and provide a certificate
                              that d is correct.
                          (b) Using part (a) , find d1 = gcd(231, 660) and provide a certificate that d1 is
                              correct.
                          (c) Using part (a) of this question, find d2 = gcd(231, 660) and provide a certifi-
                              cate that d2 is correct.
Section 19.3   More Examples                                                                               145
Solution:
                           (a)
                                                               x   y    r q
                                                                1  0  660 0
                                                                0  1  231 0
                                                                1 2 198 2
                                                               1  3   33 1
                                                                7 20 0 6
                                 By the EEA, d = 33. Our certificate consists of the GCD Characterization
                                 Theorem together with d = 33 (d is positive and divides both 660 and 231), and
                                 the integers 1 and 3 (since 660(1) + 231(3) = 33).
                           (b) Since gcd(231, 660) = gcd(231, 660), d1 = 33. Our certificate consists of the
                               GCD Characterization Theorem together with d1 = 33 (d1 is positive and divides
                               both 660 and 231), and the integers 1 and 3 (since 660(1) + 231(3) = 33).
                           (c) Since gcd(231, 660) = gcd(231, 660), d2 = 33. Our certificate consists of the
                               GCD Characterization Theorem together with d2 = 33 (d2 is positive and divides
                               both 660 and 231), and the integers 1 and 3 (since 660(1)231(3) = 33).
                        2. What is the complete solution to the linear Diophantine equation 1950x  770y = 30?
                          We begin with the EEA applied to 1950 and 770. We will adjust the signs later.
                                                             x   y    r q
                                                             1   0 1950 0
                                                             0   1  770 0
                                                             1  2 410 2
                                                            1   3  360 1
                                                             2  5   50 1
                                                            15 38   10 7
                                                             77 195  0  5
                                                             x = 45  77n
                                                             y = 114  195n
                          for n  Z.
                          Check: 1950x770y = 1950(4577n)770(114195n) = 1950(45)1950(77n)+
                          770(114) + 770(195n) = 1950(45) + 770(114) = 87750 + 87780 = 30.
                    Chapter 20
Properties Of GCDs
20.1 Objectives
                      1. Define coprime.
                      2. Discover a proof of Coprimeness and Divisibility.
                      3. Discover a proof of GCD Of One
                      4. Exercise: Discover a proof of Division by the GCD.
                      5. Exercise: Discover a proof of Primes and Divisibility.
                    This proposition has two implicit existential quantifiers, one in the hypothesis and one in
                    the conclusion. You might object and ask Where? They are hidden - in the definition of
                    divides. Recall the definition. An integer m divides an integer n if there exists an integer k
                    so that n = km.
                    We treat an existential quantifier in the hypothesis differently from an existential quantifier
                    in the conclusion. Recall the following remarks from the chapter on quantifiers.
                                                                  146
Section 20.2   Some Useful Propositions                                                                          147
                      REMARK
                      When proving that A implies B and A uses an existential quantifier, use the
                      Object Method.
                         1. Identify the four parts of the quantified statement there exists an x in the set S such
                            that P (x) is true.
                         2. Assume that a mathematical object x exists within the domain S so that the statement
                            P (x) is true.
                      When proving that A implies B and B uses an existential quantifier, use the
                      Construct Method.
                         1. Identify the four parts of the quantified statement. there exists an x in the set S
                            such that P (x) is true.
3. Show that x S.
                      With all of this in mind, how do we go about discovering a proof for Coprimeness and
                      Divisibility? As usual, we will begin by explicitly identifying the hypothesis, the conclusion,
                      the core proof technique and any preliminary material we think we might need.
Conclusion: c | b.
                      Core Proof Technique: We use the Object Method because of the existential quantifier
                          in the hypothesis, and the Construct Method because of the existential quantifier in
                          the conclusion.
                      Lets work backwards from the conclusion by asking the question How do we show that
                      one integer divides another? We can answer with the definition of divisibility. We must
                      construct an integer k so that b = ck. We will record this as follows.
                      Proof in Progress
1. To be completed.
                         2. Since b = kc, c | b.
148                                                             Chapter 20    Properties Of GCDs
      The problem is that it is not at all clear what k should be. Lets work forwards from the
      hypothesis.
      Somehow we need an equation with a b alone on one side of the equality sign. We cant
      start there but we can get an equation with a b. Since gcd(a, c) = 1, the EEA guarantees
      that we can find integers x and y so that ax + cy = 1. We could multiply this equation by
      b. Lets record these forward statements.
      Proof in Progress
        1. Since gcd(a, c) = 1, the EEA guarantees that we can find integers x and y so that
           ax + cy = 1 (1).
3. To be completed.
4. Since b = kc, c | b.
      If we could factor the left hand side of (2), wed be able to get a c and other stuff that we
      could treat as our k. But the first term has no c. Or maybe it does. Since c | ab there
      exists an integer h so that ch = ab. Substituting ch for ab in (2) gives chx + cby = b (3).
      We record this as
      Proof in Progress
        1. Since gcd(a, c) = 1, the EEA guarantees that we can find integers x and y so that
           ax + cy = 1 (1).
4. To be completed.
5. Since b = kc, c | b.
      Now factor.
      Proof in Progress
        1. Since gcd(a, c) = 1, the EEA guarantees that we can find integers x and y so that
           ax + cy = 1 (1).
        6. Since b = kc, c | b.
Section 20.2   Some Useful Propositions                                                                         149
Here is a proof.
                      Proof: By the Extended Euclidean Algorithm and the hypothesis gcd(a, c) = 1, there exist
                      integers x and y so that ax + cy = 1. Multiplying by b gives abx + cby = b. Since c | ab
                      there exists an integer h so that ch = ab. Substituting ch for ab gives chx + cby = b. Lastly,
                      factoring produces (hx + by)c = b. Since hx + by is an integer, c | b.
      Exercise 1      Prove Primes and Divisibility. Because of the or in the conclusion, you will need to use
                      the Elimination Method.
                      This proposition has similar elements to the one we just proved, so it wont be a surprise if
                      we use similar reasoning.
                      REMARK
                      The important difference is that this statement is an if and only if statement. To prove
                      A if and only if B we must prove two statements:
1. If A, then B.
2. If B, then A.
                  Proof: Since gcd(a, b) = 1, the EEA assures the existence of integers x and y so that
                  ax + by = 1. Statement 1 is proved.
                  Now, 1 | a and 1 | b. Also, by the hypothesis of Statement 2, there exist integers x and y so
                  that ax + by = 1. These are exactly the hypotheses of the GCD Characterization Theorem,
                  so we can conclude that gcd(a, b) = 1 and Statement 2 is proved.
                  REMARK
                  This proof illustrates the connection between the GCD Characterization Theorem and the
                  Extended Euclidean Algorithm. Both assume integers a and b. The GCD Characterization
                  Theorem starts with an integer d where d | a, d | b and integers x and y so that ax + by = d
                  and concludes that d = gcd(a, b). The Extended Euclidean Algorithm computes a d so that
                  d = gcd(a, b), hence it produces a d so that d | a and d | b, and also computes integers x
                  and y so that ax + by = d.
                  So, if we encounter a gcd in the conclusion, we can try the GCD Characterization Theorem.
                  If we encounter a gcd in the hypothesis, we can try the Extended Euclidean Algorithm.
As we often do, lets get a sense of the proposition by using numeric examples.
                                                     
                                                a b                                                      a     b
      Example 1   First, observe that gcd        ,        is meaningful. Since d | a and d | b, both       and   are
                                                d d                                                      d     d
                  integers.
                  Now gcd(18, 24) = 6. By the proposition Division by the GCD,
                                                                
                                                           18 24
                                                    gcd      ,     =1
                                                           6 6
                          Proof: We will use the GCD Characterization Theorem. Since gcd(a, b) = d, the EEA
                          assures the existence of integers x and y so that ax + by = d. Dividing by d gives
                                                                   a   b
                                                                     x+ y =1
                                                                   d   d
                                              a   b
                          Since 1 divides both and , the GCD Characterization Theorem implies that
                                            d   d
                                a b
                          gcd    ,    = 1.
                                d d
20.3 Practice
                               Proof: (For reference purposes, each sentence of the proof is written on a separate
                               line.)
                                 (a) What proposition or definition should be cited in line (i) of the proof?
                                 (b) What proposition or definition should be cited in line (ii) of the proof?
                                 (c) What proposition or definition should be cited in line (iv) of the proof?
                               Proof: Since gcd(a, b) = 1, we know that there exist integers x and y so that
                               ax + by = 1 (1). Since c | a, there exists an integer k so that a = ck. Substituting
                               this expression for a into Equation (1) gives c(kx) + b(y) = 1. Since kx is an integer,
                               gcd(b, c) = 1.
                               Justify each line of the proof by writing down each definition or proposition used.
                               Write down the entire definition or proposition, not just the name. For propositions,
                               show that the assumptions of the proposition are satisfied. If only arithmetic is used,
                               write down By arithmetic.
152                                                              Chapter 20   Properties Of GCDs
      3. Let a, b  Z. For each of the following statements, either prove the statement or
         disprove it using a counterexample.
      4. Prove the following statement. If gcd(a, b) = 1, then gcd(a, bc) = gcd(a, c). (Hint:
         Let d = gcd(a, c) and let e = gcd(a, bc).)
                    Chapter 21
21.1 Objectives
                    In high school, you looked at linear equations that involved real numbers. We will look at
                    linear equations involving only integers.
Definition 21.2.1   Equations with integer co-efficients for which integer solutions are sought, are called
   Diophantine      Diophantine equations after the Greek mathematician, Diophantus of Alexandria, who
    Equations       studied such equations. Diophantine equations are called linear if each term in the equation
                    is a constant or a constant times a single variable of degree 1.
ax = b
ax + by = c
                                                                153
                                                                    Chapter 21   Linear Diophantine Equations:
154                                                                                              One Solution
ax + by = c
Before we study a proof of this theorem, lets see how it works in practice.
1. 33x + 18y = 10
2. 33x + 18y = 15
Solution:
                     1. Since gcd(33, 18) = 3, and 3 does not divide 10, the first equation has no integer
                        solutions.
                     2. Since gcd(33, 18) = 3, and 3 does divide 15, the second equation does have an integer
                        solution.
                  But how do we find a solution? Here are two simple steps that will allow us to find a
                  solution.
1. Use the Extended Euclidean Algorithm to find d = gcd(a, b) and x1 and y1 where
                                                     c
                     2. Multiply Equation 21.1 by k = to get akx1 + bky1 = kd = c. A solution is x = kx1
                                                     d
                        and y = ky1 .
Applying these two steps to Part 2 of the example, the Extended Euclidean Algorithm gives
                                                           x   y   r q
                                                            1  0  33 0
                                                            0  1  18 0
                                                            1 1 15 1
                                                           1  2  3 1
                                                            6 11 0 5
                  hence
                                                         33  1 + 18  2 = 3
Section 21.2   Linear Diophantine Equations                                                                     155
                                           c   15
                      Multiplying by k =     =    = 5 gives
                                           d   3
                                                          33  5 + 18  10 = 15
Proof: (For reference, each sentence of the proof is written on a separate line.)
                         1. First, suppose that the linear Diophantine equation ax+by = c has an integer solution
                            x = x0 , y = y0 . That is, ax0 + by0 = c.
6. Now, by the Extended Euclidean Algorithm, there exist integers x1 and y1 so that
ax1 + by1 = d.
                                                                 c
                         7. Multiplying this equation by k =       gives
                                                                 d
                                                              akx1 + bky1 = kd = c
Analysis of Proof This is an if and only if statement so we must prove two statements.
                      Sentence 1 First, suppose that the linear Diophantine equation ax + by = c has an integer
                           solution x = x0 , y = y0 . That is, ax0 + by0 = c.
                            The author does not explicitly rephrase the if and only if as two statements. Rather,
                            Sentence 1 indicates which of the two implicit statements will be proved by stating the
                            hypothesis of Statement 1. Moreover, the first statement uses an existential quantifier
                            in the hypothesis. The hypothesis of the first statement could be restated as
                                                      Chapter 21   Linear Diophantine Equations:
156                                                                                One Solution
      Sentence 3 But then, by the Divisibility of Integer Combinations, d | (ax0 + by0 ). That is
           d | c.
           Since the hypotheses of DIC (a, b and d are integers, and d | a and d | b) are satisfied,
           the author can invoke the conclusion of DIC (d | (ax0 + by0 )). And from Sentence 1,
           ax0 + by0 = c so d | c.
                  Quantifier:       
                  Variable:         x, y
                  Domain:           Z
                  Open sentence:    ax + by = c.
      Sentence 6 Now, by the Extended Euclidean Algorithm, there exist integers x1 and y1 so
           that
                                           ax1 + by1 = d.
                           This is where the solution is constructed, x = kx1 and y = ky1 , and where the
                           open sentence is verified. The author does not explicitly check that kx1 and kx2 are
                           integers, though we must when we analyse the proof.
            Chapter 22
22.1 Objectives
            LDET 1 tells us when solutions exist and how to construct a solution. It does not find all
            of the solutions. That happens next.
                                                        158
Section 22.2   Finding All Solutions to ax + by = c                                                              159
33x + 18y = 33(5 + 6n) + 18(10 11n) = 165 + 198n + 180 198n = 15
                       This check does not verify that we have found all solutions. It verifies that all of the pairs
                       of integers we have found are solutions.
                       The expression complete integer solution in the statement of LDET 2 hides the use of
                       sets. Lets be explicit about what those sets are and what we need to do with them. There
                       are, in fact, two sets in the conclusion, the set of solutions, and the set of x and y pairs.
                       We define them formally as follows.
1. S T and
2. T S
                              Quantifier:       
                              Variable:         s
                              Domain:           S
                              Open sentence:    sT
                                                                 Chapter 22       Linear Diophantine Equations:
160                                                                                                All Solutions
Let us discover a proof. We must keep in mind that we have two things to prove
1. S T and
2. T S
                                            b         a
                      Let n0  Z. Then (x0 + n0 , y0  n0 )  T .
                                            d         d
                 To show that this element is in S we must show that the element satisfies the defining
                 property of S, that is, the element is a solution.
                                                 
                                                b              a 
                          ax + by = a x0 + n0 + b y0  n0
                                               d                d
                                                  ab       ab
                                   = ax0 + by0 + n0  n0
                                                   d        d
                                   = ax0 + by0
                                   =c     (by hypothesis, x = x0 and y = y0 is an integer solution)
To show that S T we will need to recall the proposition Division by the GCD.
                       Let (x, y) be an arbitrary solution. Then (x, y)  S and we must show (x, y)  T . Let
                       (x0 , y0 ) be a particular solution to the linear Diophantine equation ax + by = c. The
                       existence of (x0 , y0 ) is assured by the hypothesis. Lets do the obvious thing and substitute
                       both solutions into the equation.
                                                              ax + by = c
                                                             ax0 + by0 = c
a(x x0 ) = b(y y0 )
                                                                                  a   b
                       We know that d = gcd(a, b) is a common factor of a and b so and are both integers.
                                                                                  d   d
                       Dividing the previous equation by d gives
                                                        a              b
                                                          (x  x0 ) =  (y  y0 )                         (22.1)
                                                        d              d
                                                              
                                                           a b                b         a
                       Using Division by the GCD, gcd       ,     = 1. Since     divides (x  x0 ) we know from
                                                           d d               d          d
                       Coprimeness and Divisibility that
                                                                     
                                                                 b   
                                                                      (x  x0 )
                                                                 d   
                                                                     b           b
                                                        x  x0 = n      x = x0 + n
                                                                     d           d
                                        b
                       Substituting n     for x  x0 in Equation (22.1) yields
                                        d
                                                                        a
                                                                y = y0  n
                                                                        d
                                                                        b       a
                                                          (x, y) = (x0 + n, y0  n)
                                                                        d       d
and so
(x, y) T
                       A very condensed proof of Linear Diophantine Equation Theorem, Part 2 might look like
                       the following. Notice the lack of mention of sets.
                                                                     Chapter 22     Linear Diophantine Equations:
162                                                                                                  All Solutions
                                                                                 b          a
                   Proof: Substitution shows that integers of the form x = x0 + n , y = y0  n, n  Z are
                                                                                 d          d
                   solutions.
                   Now, let (x, y) be an arbitrary solution and let (x0 , y0 ) be a particular solution to the linear
                   Diophantine equation ax + by = c. Then
                                                          ax + by = c
                                                         ax0 + by0 = c
1. 35x + 21y = 28
2. 35x 21y = 28
                      1. Prove the following statement. If k and ` are coprime positive integers, then the
                         linear Diophantine equation kx  `y = c has infinitely many solutions in the positive
                         integers.
                         Proof: Since k and ` are coprime, gcd(k, `) = 1. By the EEA there exist integers x0 ,
                         y0 such that
                                                           kx0 + `y0 = 1
                         Equivalently
                                                             kx0  `(y0 ) = 1
                         Multiplying by c gives
                                                           k(cx0 )  `(cy0 ) = c
Section 22.4   Practice                                                                                                    163
                          22.4     Practice
                           1. Solve the following problems.
                                 (a)   Find the complete solution to 7x + 11y = 3.
                                 (b)   Find the complete solution to 35x  42y = 14.
                                 (c)   Find the complete solution to 28x + 60y = 10.
                                 (d)   For what value of c does 8x + 5y = c have exactly one solution where both x and
                                       y are strictly positive?
                           2. Let a, b, c  Z. Consider the following statement:
                             For every integer x0 , there exists an integer y0 such that ax0 + by0 = c.
                                 (a) Determine conditions on a, b, c such that the statement is true if and only if these
                                     conditions hold. State and prove this if and only if statement.
                                 (b) Using part (a), write down one set of values for a, b, c for which the statement is
                                     false.
                                 (c) Write down the negation of the statement without using any form of the word
                                     not (the symbol 6= is acceptable).
                                 (d) Prove that the negated statement of part (c) is true for the set of values you have
                                     chosen in part (b).
Congruence
23.1 Objectives
5. Do examples.
23.2 Congruences
                    One of the difficulties in working out properties of divisibility is that we dont have an
                    arithmetic of divisibility. Wouldnt it be nice if we could solve problems about divisibility
                    in much the same way that we usually do arithmetic: add, subtract, multiply and divide?
                    Carl Friedrich Gauss (1777  1855) was the greatest mathematician of the last two cen-
                    turies. In a landmark work, Disquisitiones Arithmeticae, published when Gauss was 23, he
                    introduced congruences and provided a mechanism to treat divisibility with arithmetic.
Definition 23.2.1   Let m be a fixed positive integer. If a, b  Z we say that a is congruent to b modulo m,
    Congruent       and write
                                                          a  b (mod m)
                    if m | (a  b). If m - (a  b), we write a 6 b (mod m).
                                                                 165
166                                                                                  Chapter 23    Congruence
1. 20 2 (mod 6)
2. 2 20 (mod 6)
3. 20 8 (mod 6)
4. 20 4 (mod 6)
5. 24 0 (mod 6)
6. 5 6 3 (mod 7)
                 REMARK
                 One already useful trait of this definition is the number of equivalent ways we have to work
                 with it.
                                                        a  b (mod m)
                                                    m | (a  b)
                                                    k  Z 3 a  b = km
                                                    k  Z 3 a = km + b
                 Another extraordinarily useful trait of this definition is that it behaves a lot like equality.
                 Equality is an equivalence relation. That is, it has the following three properties:
                   1. reflexivity, a = a.
                   2. symmetry, If a = b then b = a.
                   3. transitivity, If a = b and b = c, then a = c.
                 Most relationships that you can think of do not have these three properties. The relation
                 greater than fails reflexivity. The relation divides fails symmetry. The non-mathematical
                 relation is a parent of fails transitivity.
1. a a (mod m).
                      These may seem obvious but as the earlier examples showed, many relations do not have
                      these properties. So, a proof is needed. We will give a proof for all of them, and then an
                      analysis for part 3.
                         3. Since a  b (mod m), m | (a  b). Since b  c (mod m), m | (b  c). Now, by the
                            Divisibility of Integer Combinations, m | ((1)(a  b) + (1)(b  c)) so m | (a  c). By
                            the definition of congruence, a  c (mod m).
1. a + b a0 + b0 (mod m)
2. a b a0 b0 (mod m)
                         3. ab  a0 b0 (mod m)
168                                                                      Chapter 23   Congruence
Conclusion: ab a0 b0 (mod m)
      Lets consider the question How do we show that two numbers are congruent to one
      another? The obvious abstract answer is Use the definition of congruent. We may want
      to keep in mind, however, that there are several equivalent forms.
                                            a  b (mod m)
                                        m | (a  b)
                                        k  Z 3 a  b = km
                                        k  Z 3 a = km + b
      It is not at all clear which is best or whether, in fact, several could work. Since the
      conclusion of part three involves the arithmetic operation of multiplication, and we dont
      have multiplication properties for equivalence or divisibility, it makes sense to consider
      either the third or fourth of the equivalent forms. There isnt much to separate them. Ill
      choose the last form and see how it works. So, the answer to How do we show that two
      numbers are congruent to one another? in the notation of this proof is We must find an
      integer k so that ab = km + a0 b0 . Lets record that.
      Proof in Progress
1. To be completed.
      The problem is how to find k. There is no obvious way backwards here so lets start working
      forward. The two hypotheses a  a0 (mod m) and b  b0 (mod m) can be restated in any
      of their equivalent forms. Since we have already decided that we would work backwards
      with the fourth form, it makes sense to use the same form working forwards. That gives
      two statements.
      Proof in Progress
3. To be completed.
                      But now there seems to be a rather direct way to produce an ab and an a0 b0 which we want
                      for the conclusion. Just multiply equations (1) and (2) together. Doing that produces
                                       ab = m2 jh + mjb0 + a0 mh + a0 b0 = (mjh + jb0 + a0 h)m + a0 b0
                      If we let k = mjh + jb0 + a0 h then k is an integer and satisfies the property we needed in
                      the last line of the proof, that is ab = km + a0 b0 . Lets record this.
                      Proof in Progress
                      Lastly, we write a proof. Note that the reader of the proof is expected to be familiar with
                      the equivalent forms.
                      Proof: Since a  a0 (mod m), there exists an integer j such that a = mj + a0 (1). Since
                      b  b0 (mod m), there exists an integer h such that b = mh + b0 (2). Multiplying (1) by (2)
                      gives
                                   ab = m2 jh + mjb0 + a0 mh + a0 b0 = (mjh + jb0 + a0 h)m + a0 b0 .
                      Since mjh + jb0 + a0 h is an integer, ab  a0 b0 (mod m).
                      There are four arithmetic operations with integers, but analogues to only three have been
                      given. It turns out that division is problematic. A statement of the form
                                                  ab  ab0   (mod m)  b  b0      (mod m)
                      seems natural enough, simply divide by a. This works with the integer equation ab = ab0 .
                      But consider the case where m = 12, a = 6, b = 3 and b0 = 5. It is indeed true that
                                                             18  30    (mod 12)
                      and so
                                                         6365          (mod 12)
                      But dividing by 6 gives the clearly false statement
                                                             35       (mod 12).
Division works only under the specific conditions of the next proposition.
1. 8 7 17 7 (mod 3) 8 17 (mod 3)
Proof: (For reference, each sentence of the proof is written on a separate line.)
23.4 Practice
24.1 Objectives
                Because this proposition is an if and only if proposition, there are two parts to the proof:
                a statement and its converse. We can restate the proposition to make the two parts more
                explicit.
1. If a b (mod m), then a and b have the same remainder when divided by m.
2. If a and b have the same remainder when divided by m, then a b (mod m).
                In practice, the two statements are not usually written out separately. The author assumes
                that you do that whenever you read if and only if. Many if and only if proofs begin
                with some preliminary material that will help both parts of the proof. For example, they
                often introduce notation that will be used in both parts.
                Lets look at a proof of the Congruent Iff Same Remainder proposition. Before we do an
                analysis, make sure that you can identify
                                                             171
172                                                     Chapter 24     Congruence and Remainders
a = q1 m + r1 , where 0 r1 < m
b = q2 m + r2 , where 0 r2 < m
a = q1 m + r1 , where 0 r1 < m
b = q2 m + r2 , where 0 r2 < m
                      Analysis of Proof In many if and only if statements one direction is much easier than
                          the other. In this particular case, we are starting with the harder of the two directions.
Sentence 2 Hence
                  REMARK
                  The proposition Congruent Iff Same Remainder gives us another part to our chain of equiv-
                  alent statements.
                                          a  b (mod m)
                                   m | (a  b)
                                   k  Z 3 a  b = km
                                   k  Z 3 a = km + b
                                   a and b have the same remainder when divided by m
                  The propositions covered in this lecture are surprisingly powerful. Consider the following
                  example.
                                                        347  7q + r   (mod 7)
                                                           r    (mod 7)
                  Thus, the remainder when 347 is divided by 7 is just 347 (mod 7). Now observe that
                  32  2 (mod 7) and 33  27  6  1 (mod 7). But then
                                                            521  7q + r    (mod 7)
                                                                r     (mod 7)
                     Thus,
                                                              347 6 521   (mod 7)
                             Thus, by the proposition Congruent Iff Same Remainder, 2271 3314 has remainder 4
                             when divided by 7.
                     24.4       Practice
                        1. This question deals with divisibility by nine.
                             (a) Let n = 387144 and d be the sum of the digits of n.
                                    i. Determine the value of d.
                                   ii. Does 9 | d?
                                  iii. Does 9 | n?
                             (b) Let n = 6532422 and d be the sum of the digits of n.
                                    i. Determine the value of d.
                                   ii. Does 9 | d?
                                  iii. Does 9 | n?
                              (c) Prove the following statement.
                                  Let n be a positive integer and let d be the sum of the digits of n. Then n is
                                  divisible by 9 if and only if d is divisible by 9.
                                  Hint: Let the decimal representation of n be ar ar1 ar2 . . . a1 a0 . Then
Modular Arithmetic
25.1 Objectives
                      2. Construct Zm and perform modular arithmetic. Highlight the role of additive and
                         multiplicative identities, and additive and multiplicative inverses.
In this section we will see the creation of a number system which will likely be new to you.
Definition 25.2.1   The congruence class modulo m of the integer a is the set of integers
 Congruence Class
                                                  [a] = {x  Z | x  a (mod m)}
                                                                 176
 Section 25.2   Modular Arithmetic                                                                               177
                       REMARK
                       Note that congruence classes have more than one representation. In the example above
                       [0] = [4] = [8] and, in fact [0] has infinitely many representations. If this seems strange to
                       you, remember that fractions are another example of where one number has infinitely many
                       representations. For example 1/2 = 2/4 = 3/6 =    .
                                                               [a] + [b] = [a + b]
                                                                [a]  [b] = [a  b]
                       Though the definition of these operations may seem obvious there is a fair amount going
                       on here.
                         1. Sets are being treated as individual numbers. Modular addition and multiplication
                            are being performed on congruence classes which are sets.
                         2. The addition and multiplication symbols on the left of the equals signs are in Zm and
                            those on the right are operations in the integers.
                         3. We are assuming that the operations are well-defined. That is, we are assuming
                            that these operations make sense even when there are multiple representatives of a
                            congruence class.
                       REMARK
                       Since
                                                     [a] = {x  Z | x  a (mod m)}
                       we can extend our list of equivalent statements to
                                             [a] = [b] in Zm
                                         a  b (mod m)
                                         m | (a  b)
                                         k  Z 3 a  b = km
                                         k  Z 3 a = km + b
                                         a and b have the same remainder when divided by m
                       Just as there were addition and multiplication tables in grade school for the integers, we
                       have addition and multiplication tables in Zm .
178                                                                                         Chapter 25     Modular Arithmetic
                   Note that all of the entries have representatives between 0 and 3. Even though there are
                   many representatives for each congruence class, we usually choose a representative between
                   0 and m  1.
25.2.1 [0] Zm
By looking at the tables for Z4 and Z5 it seems that [0] Zm behaves just like 0 Z. In Z
                                                                 a  Z, a + 0 = a
                                                                  a  Z, a  0 = 0
and in Zm
25.2.2 [1] Zm
                   In a similar fashion, by looking at the multiplication tables for Z4 and Z5 it seems that
                   [1]  Zm behaves just like 1  Z. In Z
a Z, a 1 = a
and in Zm
                       Many of us think of subtraction and division as independent from the other arithmetic
                       operations of addition and multiplication. In fact, subtraction is just addition of the inverse.
                       Now, whats an inverse? To answer that question we must first define an identity.
Definition 25.2.3      Given a set and an operation, an identity is, informally, something that does nothing.
     Identity          More formally, given a set S and an operation designated by , an identity is an element
                       e  S so that
                                                           a  S, a  e = a
                       The element e has no effect. Having something that does nothing is extremely useful 
                       though parents might not say that of teenagers.
The set of integers with the operation of addition has the identity 0.
                           The set of rational numbers excluding 0 with the operation of multiplication has the
                            identity 1.
                           The set of real valued functions with the operation of function composition has the
                            identity f (x) = x.
                           The set of integers modulo m with the operation of modular addition has the identity
                            [0].
                           Under the operation of addition, the integer 3 has inverse 3 since 3 + (3) = (3) +
                            3 = 0.
                                                                                               3                 4
                           Under the operation of multiplication, the rational number         4   has inverse   3   since
                            3 4     4 3
                            4  3 = 3  4 = 1.
                           Under the operation of function composition ln x has the inverse ex since ln(ex ) =
                            eln x = x
                           Under the operation of modular addition, [3] has the inverse [3] in Z7 since [3] +
                            [3] = [3] + [3] = [0].
                    a1 as the reciprocal. This works for real or rational multiplication but fails in other contexts
                    like function composition. We will use a to mean the inverse of a under addition and a1
                    to mean the inverse under all other operations.
25.2.4 Subtraction in Zm
                    That is, every element [a]  Zm has an additive inverse, [a]. This allows us to define
                    subtraction in Zm .
25.2.5 Division in Zm
                    Division is related to multiplication in the same way that subtraction is related to addition.
                    So first, we must identify the multiplicative identity in Zm . Since
                      1.
            Chapter 26
26.1 Objectives
            Pierre de Fermat proved a useful result called Fermats Little Theorem. This should not
            be confused with one of the great conjectures, now theorem, of the last 400 years, Fermats
            Last Theorem.
ap1 1 (mod p)
Lets begin by understanding what the theorem is saying by using a numeric example.
Example 1   Suppose p = 29 and a = 18. Computing 1828 and reducing it modulo 29 is difficult without
            the aid of a computer. However, by Fermats Little Theorem we know that
                                                       181
182                                                                 Chapter 26       Fermats Little Theorem
Proof: (For reference, each sentence of the proof is written on a separate line.)
        3. Since gcd(a, p) = 1, Congruences and Division tells us that r  s mod p, but this is
           not possible when 1  r < s  p  1.
        4. Because a, 2a, 3a, . . . , (p  1)a are all distinct mod p, it must be the case that these
           integers are equivalent to the integers 1, 2, 3, . . . , p  1 in some order.
                              a  2a  3a    (p  1)a  1  2  3    (p  1)   (mod p)
                                                     p1
                                         (p  1)!a          (p  1)!   (mod p)
ap1 1 (mod p)
Lets analyze the proof. As usual, we begin by identifying the hypothesis and the conclusion.
      Analysis of Proof This is the most complicated proof in the course so far, so we will be
          very thorough. In fact, this proof contains a proof within a proof.
      Sentence 1 If p - a, we first show that the integers a, 2a, 3a, . . . , (p  1)a are all distinct
           modulo p.
            The reason for this sentence is not at all obvious. The sentence is needed, but not
            until Sentence 4. The word distinct should alert us to a need to prove uniqueness.
                      Sentence 3 Since gcd(a, p) = 1, Congruences and Division tells us that r  s mod p, but
                           this is not possible when 1  r < s  p  1.
                            The statement gcd(a, p) = 1 is not one of the hypotheses. Where did it come from?
                            Since p is a prime and p - a, it must be the case that gcd(a, p) = 1. It is always useful
                            to identify where the hypotheses of a proposition are used in a proof. The hypotheses
                            of Fermats Little Theorem are used right here.
                            To invoke Congruences and Division, we must show that its hypotheses are satisfied.
                            One of those hypotheses is ra  sa mod p. The other is gcd(a, p) = 1. Invoking CD
                            gives r  s mod p. But r and s are distinct, positive integers less than p, so this is not
                            possible. This concludes the proof of distinctness of the integers a, 2a, 3a, . . . , (p  1)a.
                      Sentence 4 Because a, 2a, 3a, . . . , (p  1)a are all distinct mod p, it must be the case that
                           these integers are equivalent to the integers 1, 2, 3, . . . , p  1 in some order.
                            The set {a, 2a, 3a, . . . , (p  1)a} is a set of p  1 integers all distinct mod p. The set
                            {1, 2, 3, . . . , p  1} is a set of p  1 integers all distinct mod p. Thus, the two sets must
                            be the same modulo p.
                                              a  2a  3a    (p  1)a  1  2  3    (p  1)   (mod p)
                                                                     p1
                                                         (p  1)!a          (p  1)!   (mod p)
                      Sentence 6 Since gcd(p, (p  1)!) = 1, Congruences and Division (again) tells us that
                           ap1  1 (mod p).
                            The second of the congruences above is almost what we need. If we could divide out
                            the (p  1)! we would be done. But Congruences and Division allows us to do exactly
                            that.
ap a (mod p)
                      Proof: Let a  Z and let p be a prime. If p - a, then ap1  1 (mod p). Multiplying both
                      sides of the equivalence by a gives ap  a (mod p). If p | a, then a  0 (mod p) and ap  0
                      (mod p). Thus ap  a (mod p).
                    Analysis of Proof There are two important items to note: the use of nested quantifiers
                        and the use of cases.
                    This corollary is equivalent to stating that every non-zero element of Zp has an inverse.
                    Lets discover a proof. As usual, we begin by identifying the hypothesis and the conclusion.
                    Three points are salient. First, the corollary only states that an inverse exists. It doesnt tell
                    us what the inverse is or how to compute the inverse. Second, there are three quantifiers.
                       1. Let p be a prime number is equivalent to For all primes p. Since this is an instance
                          of a universal quantifier we would expect to use the Select Method.
Proof in Progress
                      The third salient point is that this statement is a corollary of Fermats Little Theorem. Now
                      Fermats Little Theorem uses congruences, not congruence classes. But we could restate
                      Fermats Little Theorem with congruence classes as
[ap1 ] = [1] in Zp
                      Now an analogy to real numbers provides the final step. In the reals ap1 = a  ap2 so why
                      not let [b] = [ap2 ]? This would give
                      Proof in Progress
                      Now we can invoke Fermats Little Theorem but first we need to make sure the hypotheses
                      are satisfied.
                      Proof in Progress
                      Proof: Let p be a prime number. Let [a] be a non-zero element in Zp . Consider [b] = [ap2 ].
                      Since [a] 6= [0] in Zp , p - a and so by Fermats Little Theorem
                                                        [a][b] = [a][ap2 ] = [ap1 ] = [1]
186                                                                            Chapter 26   Fermats Little Theorem
                   REMARK
                   In summary, if p is a prime number and [a] is any non-zero element in Zp , then
[a]1 = [ap2 ]
                     1. For each of the given elements, determine its inverse, if an inverse exists. Express the
                        inverse as [b] where 1  b < m.
Solution:
                          (a) Finding [5]1  Z10 is equivalent to solving [5][b] = [1] in Z10 . Since gcd(5, 10) =
                              5 and 5 - 1, this equation has no solution by LCT 2.
                          (b) Finding [5]1  Z47 is equivalent to solving [5][b] = [1] in Z47 . Since gcd(5, 47) =
                              1 and 1 | 1, this equation has a solution by LCT 2. Now, solving [5][b] = [1] in
                              Z47 is equivalent to solving 5b + 47y = 1. We can use the EEA to find a solution.
                                                                  b y   r q
                                                                 1   0 47 0
                                                                 0   1 5 0
                                                                 1  9 2 9
                                                                 2 19 1 2
                                                                 5 47 0 2
                                (Note that the x of the EEA has been written as b to be consistent with the linear
                                Diophantine equation.) The EEA gives 5(19) + 47(2) = 1 and so [5]1 = [19]
                                in Z47 .
                        26.4        Practice
                          (a)     i. Prove that: if a | c and b | c and gcd(a, b) = 1, then ab | c.
                                 ii. Show that the following statement is false. If a | c and b | c, then ab | c.
                                iii. Prove that: For all integers n, 21 | (3n7 + 7n3 + 11n).
                    Chapter 27
Linear Congruences
27.1 Objectives
3. Do examples.
                    The problem for this lecture is to determine when linear congruences have solutions and
                    how to find them.
                    Recalling our table of statements equivalent to a  b (mod m) we see that
                                                               187
188                                                                              Chapter 27   Linear Congruences
REMARK
                  Moreover, the Linear Diophantine Equation Theorem, Part 2 tells us what the solutions to
                  ax + by = c look like.
                                                                                                             m
                  Note that there are d = gcd(a, m) distinct solutions modulo m and one solution modulo        .
                                                                                                             d
                  We record this discussion as the following theorem.
Section 27.2   The Problem                                                                               189
                     solving
                                                               ax  c (mod m)
                     is equivalent to finding a congruence class [x0 ]  Zm that solves
[a][x] = [c] in Zm
Thus
Putting all of this together we have several views of the same problem.
REMARK
27.4 Examples
3x 5 (mod 6)
4x 6 (mod 10)
                     Solution: Since gcd(4, 10) = 2 and 2 | 6, we would expect to find two solutions to 4x  6
                     (mod 10). Since ten is a small modulus, we can simply test all possibilities modulo 10.
                                            x (mod 10)    0     1   2    3   4   5   6   7   8   9
                                           4x (mod 10)    0     4   8    2   6   0   4   8   2   6
3x 5 (mod 76)
                     Solution: Since gcd(3, 76) = 1 and 1 | 5, we would expect to find one solution to 3x  5
                     (mod 76). We could try all 76 possibilities but there is a more efficient way. Thinking of
                     our list of equivalencies, solving 3x  5 (mod 76) is equivalent to solving 3x + 76y = 5 and
                     that we know how to do that using the Extended Euclidean Algorithm.
                                                          x   y   r q
                                                           1  0  76 0
                                                           0  1  3 0
                                                           1 25 1 25
                                                          3 76 0 3
                     From the second last row, 76(1) + 3(25) = 1, or to match up with the order of the original
                     equation, 3(25) + 76(1) = 1. Multiplying the equation by 5 gives 3(125) + 76(5) = 5.
                     Hence
                                                     x  125  27 (mod 76)
                                           x   y   r q
                                            1  0  29 0
                                            0  1  13 0
                                            1 2 3 2
                                           4  9  1 4
                                           13 29 0 3
      From the second last row, 29(4) + 13(9) = 1, or to match up with the order of the original
      equation, 13(9) + 29(4) = 1. Hence
27.5 Practice
1. For each linear congruence, determine the complete solution, if a solution exists.
        2. For each of the given elements, determine its inverse, if an inverse exists. Express the
           inverse as [b] where 1  b < m.
3. This question asks you to carefully examine the properties of linear congruences.
28.1 Objectives
The following problem was posed, likely in the third century CE, by Sun Zi in his Math-
ematical Manual and republished in 1247 by Qin Jiushao in the Mathematical Treatise in
Nine Sections.
The word problem asks us to find an integer n that simultaneously satisfies the following
three linear congruences.
                                     n2     (mod 3)
                                     n3     (mod 5)
                                     n2     (mod 7)
Before we solve this problem with three simultaneous linear congruences, we will begin with
two simultaneous congruences whose moduli are coprime.
                                           193
194                                                                   Chapter 28    Chinese Remainder Theorem
Example 1 Solve
                                                          n2      (mod 5)
                                                          n9      (mod 11)
n = 5x + 2 where x Z (28.1)
                  Have we seen anything like this before? Of course, this is just a linear congruence and
                  we solved those in the previous chapter. Since gcd(5, 7) = 1, there is exactly one solution
                  modulo 11,
                                                      x  8 (mod 11)
                  Now x  8 (mod 11) is equivalent to
                  which is equivalent to
                                                         n  42    (mod 55)
We can check by substitution. If n = 55y + 42, then n 2 (mod 5) and n 9 (mod 11).
                                                         n  a1    (mod m1 )
                                                         n  a2    (mod m2 )
                                                        n  n0    (mod m1 m2 )
Section 28.3   Chinese Remainder Theorem                                                                           195
                      Before we begin our discovery of a solution, lets be clear that there are two things to prove.
                      First, that a solution exists and second, what a complete solution looks like.
                      With regard to the first part lets identify, as usual, the hypothesis and the conclusion.
                      Hypothesis: gcd(m1 , m2 ) = 1.
                      Conclusion: For any choice of integers a1 and a2 , there exists a solution to the simulta-
                          neous congruences
                                                               n  a1    (mod m1 )
                                                               n  a2    (mod m2 )
                      Since there is an existential quantifier in the conclusion, we use the Construct Method and
                      construct a solution. There is nothing obvious from the statement of the theorem that will
                      help us, but we have already solved such a problem once in Example 1. Perhaps we could
                      mimic what we did there.
                      From the first linear congruence
n = a1 + m1 x for some x Z
The next thing we did was substitute this expression into the second congruence.
                                                    a1 + m 1 x  a2          (mod m2 )
                                                          m 1 x  a2  a1    (mod m2 )
Have we seen anything like this before? Of course, this is just a linear congruence!
                           Since gcd(m1 , m2 ) = 1, the Linear Congruence Theorem tells us that this con-
                           gruence has a solution, say x = b and that the complete solution is
x = b + m2 y for all y Z
                      Now lets consider the second part, a complete solution. Following on what we have done
                      above, an integer n satisfies the simultaneous congruences if and only if
                                               n = a1 + m1 x
                                                  = a1 + m1 (b + m2 y)
                                                  = (a1 + m1 b) + m1 m2 y      for all y  Z
                      But these are the elements of exactly one congruence class modulo m1 m2 . That is, all of
                      the solutions belong to a single congruence class modulo m1 m2 . Therefore, if n = n0 is one
                      solution, the complete solution is
                                                         n  n0     (mod m1 m2 )
196                                                                  Chapter 28   Chinese Remainder Theorem
Exercise 1 Using the analysis above, write a proof for the Chinese Remainder Theorem.
Exercise 2 Solve
                                                         n2    (mod 3)
                                                         n3    (mod 5)
n = 3x + 2 where x Z (28.3)
3x + 2 3 (mod 5) 3x 1 (mod 5)
x2 (mod 5)
x = 5y + 2 where y Z (28.4)
                   which is equivalent to
                                                         n8   (mod 15)
                   We can check by substitution. If n = 15y + 8, then n  2 (mod 3) and n  3 (mod 5).
      Exercise 3   Solve
                                                         n2   (mod 3)
                                                         n3   (mod 5)
                                                         n4   (mod 11)
                   Solution: The first two of the three linear congruences were solved above so we can replace
                                                         n2    (mod 3)
                                                         n3    (mod 5)
                   by
                                                         n8   (mod 15)
                   This reduces a problem of three linear congruences to a problem in two linear congruences.
                                                         n8   (mod 15)
                                                         n4   (mod 11)
                   We leave the remainder of the exercise to the reader.
Section 28.5   More Examples                                                                                       197
                     The exercises above make it clear that we can solve more than two simultaneous linear
                     congruences simply by solving pairs of linear congruences successively. We record this as
                                                           n  a1    (mod m1 )
                                                           n  a2    (mod m2 )
                                                            ..
                                                             .
                                                           n  ak    (mod mk )
n n0 (mod m1 m2 . . . mk )
                     You should ask yourself What happens if the moduli are not coprime? That investigation
                     is left as an exercise.
Exercise 4 Solve the problem posed by Sun Zi that began this lecture.
1. What is the complete solution to the following pair of simultaneous linear congruences?
                                                               x3      (mod 7)
                                                               x5      (mod 12)
                           Solution: Since gcd(7, 12) = 1, we know by the Chinese Remainder Theorem that
                           a solution to this pair of linear congruences exists. Rewriting x  3 (mod 7) as
                           x = 7y + 3 (1) for y  Z and substituting into the second linear congruence gives
                           7y + 3  5 (mod 12). This reduces to 7y  2 (mod 12) and the solution is y  2
                           (mod 12). Rewriting y  2 (mod 12) as y = 12z + 2 for z  Z and substituting in
                           Equation 1 gives x = 7(12z + 2) + 3 = 17 + 84z for z  Z, or, equivalently,
x 17 (mod 84)
28.5 Practice
         (a)
                                                 x7      (mod 11)
                                                 x5      (mod 12)
         (b)
                                            3x  2  7     (mod 11)
                                                  5  4x  1    (mod 9)
      2. The Chinese Remainder Theorem deals with the case where the moduli are coprime.
         We now investigate what happens if the moduli are not coprime.
29.1 Objectives
1. Computational practice.
                                                  y   x   r q
                                                  1   0  60 0
                                                  0   1  13 0
                                                  1  4 8 4
                                                 1   5   5 1
                                                  2  9 3 1
                                                 3  14   2 1
                                                  5  23 1 1
                                                 13 60   0 2
                                                        199
200                                                     Chapter 29     Practice, Practice, Practice: Congruences
                  Though we have efficient means to solve linear congruences, we have no equivalent means
                  to solve polynomial congruences.
                                            x (mod 8)      0   1   2   3       4       5       6       7
                                            x2 (mod 8)     0   1   4   1       0       1       4       1
      Example 3   Solve 36x47 + 5x9 + x3 + x2 + x + 1  2 (mod 5). Reduce terms and use Fermats Little
                  Theorem or its corollaries before substitution.
                  Solution: Since 36  1 (mod 5) the term 36x47 reduces to x47 (mod 5).
                  Since 5  0 (mod 5) the term 5x9 reduces to 0 (mod 5). Thus,
                  reduces to
                                                x47 + x3 + x2 + x + 1  2          (mod 5)
                  Now observe that x  0 (mod 5) cannot be a solution, otherwise we have 1  2 (mod 5)
                  by substitution in the preceding equation. Since 5 is a prime and 5 - x, we can use Fermats
                  Little Theorem which implies that x4  1 (mod 5) and so
x3 + x3 + x2 + x + 1 2 (mod 5)
                                                  x (mod 5)                0       1       2       3       4
                                          2x3     x2
                                                + + x + 1 (mod 5)          1       0       3       2       4
                  is
                                                         x3       (mod 5)
Section 29.2   Worked Examples                                                                               201
                     Solution: We could try all 35 possibilities but even then, computing something like 2037
                     is a problem. Perhaps there is another way. Observing that 35 = 5  7 and both factors are
                     relatively prime, maybe we could split the problem into two linear congruences and then
                     apply the Chinese Remainder Theorem. Unfortunately, the polynomial is not linear. Lets
                     see what happens anyway.
                     If n0 is a solution to
                                                 n37 + 10n8 + 14n7 + 1  5              (mod 35)
                     Well, have we seen anything like these before? Indeed, we have. The previous example
                     solved congruences just like these. Well solve each of the polynomial congruences individ-
                     ually. As in the previous example, we can reduce terms and use Fermats Little Theorem
                     or its corollaries to simplify the congruence before substitution. Lets start with Equation
                     (29.1).
                     reduces to
                                                          n37 + 4n7 + 1  0       (mod 5)
                     This looks like progress! Now observe that n0  0 (mod 5) cannot be a solution, otherwise
                     we have 1  0 (mod 5) by substitution in the preceding equation. Since 5 is a prime and
                     5 - n0 , we use Fermats Little Theorem to get n4  1 (mod 5). Hence
                     and
                                                           n7  n4 n3  n3        (mod 5)
n + 4n3 + 1 0 (mod 5)
                                                     n (mod 5)                0     1    2    3   4
                                                n + 4n3 + 1 (mod 5)           1     1    0    2   1
202                                         Chapter 29   Practice, Practice, Practice: Congruences
      is
                                              x2   (mod 5)
      This is a linear congruence so that supports the idea of using the Chinese Remainder
      Theorem. Now lets examine Equation (29.2) repeated below.
      and
                                      n8  n6 n2  n2        (mod 7)
      Thus, Equation (29.2) reduces to
n + 3n2 + 1 5 (mod 7)
                                 n (mod 7)          0    1     2   3    4    5   6
                            n + 3n2 + 1 (mod 7)     1    5     1   3    4    4   3
      is
                                              n1   (mod 7)
                                              n2   (mod 5)
                                              n1   (mod 7)
      Since the moduli are coprime, we know by the Chinese Remainder Theorem that a solution
      exists. The proof of CRT gave us a way to solve two simultaneous linear congruences.
      The first congruence is equivalent to
n = 5x + 2 where x Z (29.3)
                              5x + 2  1      (mod 7)  5x  6         (mod 7)
Section 29.2   Worked Examples                                                                                  203
x4 (mod 7)
x = 7y + 4 where y Z (29.4)
                     which is equivalent to
                                                              n  22   (mod 35)
                                                        n3  127  1         (mod 3)
                                                        n3  127  2         (mod 5)
                                                          3
                                                        n  127  6          (mod 11)
                     Lets consider each of the three congruences separately. In the case n3  1 (mod 3) we
                     can use a corollary to Fermats Little Theorem. Since n3  n (mod 3) by Fermats Little
                     Theorem, n3  1 (mod 3) reduces to n  1 (mod 3) which is just the solution to the first
                     congruence.
                     For the case n3  2 (mod 5) we will use a table.
                                                      n (mod 5)        0     1   2   3   4
                                                      n3 (mod 5)       0     1   3   2   4
                        n (mod 11)     0    1    2   3   4   5   6   7    8   9    10
                        n3 (mod 11)    0    1    8   5   9   4   7   2    6   3    10
      Though these could be solved by eye (note that n  8 (mod 55) is a solution to the last
      two) we will solve these, for practice, by writing out and substituting equations.
      From n  1 (mod 3) we have
                                       n = 3x + 1 where x  Z                                 (29.5)
      Substituting into the second congruence we get
                     3x + 1  3   (mod 5)  3x  2       (mod 5)  x  4          (mod 5)
      Now x  4 (mod 5) is equivalent to
                                        x = 5y + 4 where y  Z                                (29.6)
      Substituting Equation (29.6) into Equation (29.5) gives the solution to the first two linear
      congruences.
                             n = 3(5y + 4) + 1 = 15y + 13 for all y  Z
      which is equivalent to
                                            n  13   (mod 15)
                      REMARK
                      Lets summarize what we have learned from these examples.
                          One approach that sometimes works when the modulus is composite, is to break the
                           problem into parts, solve each of the parts, and then combine the partial solutions to
                           get a complete solution. Specifically,
                              1. Create a new polynomial congruence for each prime factor of the modulus.
                              2. Solve each of these new polynomial congruences by reducing coefficients, applying
                                 Fermats Little Theorem to reduce exponents (which is why we need to use prime
                                 factors), and then using observation, the Linear Congruence Theorem or a table
                                 of values.
                              3. If the original problem has a solution, this process will give at least one linear
                                 congruence for each factor. Use the Chinese Remainder Theorem to combine
                                 these solutions into a solution for the original problem.
                      This exercise will help us understand the implementation of the RSA scheme which we will
                      look at next. In commercial practice the numbers chosen are large but here, choose numbers
                      small enough to work with by hand.
                      I will give an example. You follow along but use your own numbers.
                         1. Choose two distinct primes p and q and let n = pq. I will choose p = 7 and q = 11 so
                            n = 77.
                         2. Select an integer e so that gcd(e, (p  1)(q  1)) = 1 and 1 < e < (p  1)(q  1). I will
                            choose e = 13 which satisfies gcd(13, 60) = 1 and 1 < 13 < 60.
                         3. Solve
                                                         ed  1   (mod (p  1)(q  1))
                            for an integer d where 1 < d < (p  1)(q  1). In my case, I must solve
30.1 Objectives
1. Illustrate the difference between private key and public key cryptography.
30.2.1 Introduction
The need for secret communications has been known for millenia. And equally, the oppor-
tunities that would arise from the ability to read someone elses secret communications have
also been known for millenia. In the modern world, the need for secret communication is
much larger than it was even in the recent past. Certainly the traditional areas of military
and diplomatic continue, but the credit card, debit card and web transactions of modern
commerce, as well as privacy concerns for health, citizenship and other electronic records,
have raised the need for secure communications and storage dramatically.
In its most elemental form, the objective of any secret communication scheme is to allow two
parties, usually referred to as Alice (for person A) and Bob (for person B), to communicate
over an insecure channel so that an opponent, often called Oscar, cannot understand what
is being communicated. In wartime, a general (Alice) wishes to provide orders to a field
commander (Bob) over the radio (insecure channel) so that enemy radio operators (Oscar)
cannot understand the orders. When you order a book from Amazon, you (Alice) provide
your order to Amazon (Bob) through a web connection (insecure channel) so that hackers
(Oscar) cannot get your credit card information.
The information Alice wishes to communicate is called the message or the plaintext. The
act of transforming the plaintext into a ciphertext is called enciphering or encryption.
The rules for enciphering make use of a key, which is an input to the algorithm. The
act of transforming the ciphertext to plaintext using the key is called deciphering or
decryption.
                                            206
Section 30.2   Private Key Cryptography                                                                           207
                      In a substitution cipher, one letter of the alphabet used in the cipher text replaces one
                      letter of the alphabet used in the plaintext. We simply permute the alphabet. For example,
                      consider the substitution rule below.
                                           A    B    C    D    E   F    G   H    I    J   K    L   M
                                           Q    M    W    N    B   E    R   V    T    C   Y    X   U
                                            N   O    P   Q    R    S   T    U   V    W    X    Y   Z
                                            Z   I    L   O    K    P   H    A   G    S    F    J   D
                      This table acts as the key. The algorithm for encryption is simple: for each letter in the
                      plaintext, replace it with the letter below it to produce the ciphertext. For example, the
                      plaintext:
                      We shall fight on the beaches,
                      We shall fight on the landing grounds,
                      We shall fight in the fields and in the streets,
                      We shall fight in the hills;
                      We shall never surrender
                      (from Winston Churchills speech, Blood, Sweat and Tears, 4 June 1940)
                      corresponds to the cipher text (with punctuation removed and converted to uppercase):
                      SB   PVQXX   ETRVH   IZ HVB MBQWVBP
                      SB   PVQXX   ETRVH   IZ HVB XQZNIZG GKIAZNP
                      SB   PVQXX   ETRVH   TZ HVB ETBXNP QZN TZ HVB PHKBBHP
                      SB   PVQXX   ETRVH   TZ HVB VTXXP
                      SB   PVQXX   ZBHBK   PAKKBZNBK
                      The algorithm for decryption is equally simple: for each letter in the ciphertext, replace it
                      with the letter above it to produce the plaintext.
                      Now suppose we had somehow gotten hold of this particular ciphertext and wanted to
                      reconstruct the original message. Also suppose that we knew the message was in English,
                      and that a substitution cipher had been used. We could use a computer to try all possible
                      substitutions. Since there are 26 letters, there are 26! possible substitutions or permutations.
                      Even for modern computers, this is too large a number to reasonably attempt.
                      But careful observation should help. First, spaces between words were left in and this makes
                      our task much easier. Consider the following observations.
208                                                                 Chapter 30   The RSA Scheme
Many words are repeated. In particular, each phrase begins the same way.
      These hints alone are probably enough to make great headway. The most common three
      letter word in the English language is THE so HVB probably corresponds to THE.
      Working with this assumption we assume that H maps to T, V maps to E and B
      maps to E. Now look at the word SB that begins each of the phrases. We know that
      B corresponds to E so we are looking at a two letter word of the form  E. There are
      more choices than we might think: BE or HE or ME or RE or WE. But ME
      and RE are unlikely to begin phrases so that leaves us with BE or HE or WE.
      Though we may not yet be able to choose, the ciphertext letter S will likely map to B,
      H or W.
      Lets look at the other two letter words IZ and TZ. There are many two letter words but
      not that many that end in the same letter and can precede the word THE. Two obvious
      pairs of candidates are IN and ON, and TO and DO. Lets work with the first pair.
      We would map Z to N. Now consider the remaining three letter word, QZN which
      maps, so far, to  N . Almost certainly this will be the word AND and so we can map
      Q to A and N to D. Intuitively, most of us know that E is the most common
      letter and that other letters like S, T, R, A, O , I are also common, though not as common
      as E. We do know that S commonly ends words. Since P is both common and at the
      end of many words, it makes sense to guess that P maps to S.
                          A   B   C   D    E   F   G   H    I   J   K    L   M
                              E                        T
                         N    O   P   Q   R    S   T   U    V   W    X   Y   Z
                         D        S   A                     H                N
      Now consider the word ETBXNP which, so far, maps to  IE DS or  OE DS. Persis-
      tence, and access to a dictionary, will go a long way now.
      The important part of this exercise was to recognize that patterns alone can go a long way
      to allowing us to break the code. Despite the vast numbers of possible keys, it did not
      take us too long to make considerable progress.
      Suppose that the sender of the message was more cautious and removed all of the spaces (or
      randomly inserted characters into the spaces) and blocked all of the characters into groups
      of five. The ciphertext then becomes
      SBPVQ XXETR VHIZH VBMBQ WVBPS BPVQXX ETRVH IZHVB XQZNI ZGGKI AZNPS BPVQX XETRV
      HTZHV BETBX NPQZN TZHVB PHKBB HPSBP VQXXET RVHTZ HVBVT XXPSB PVQXX ZBHBK PAKKB
      ZNBK
      Our previous analysis fails here. The lesson: Oscar looks for patterns and Alice and Bob
      wish to eliminate patterns.
Section 30.2   Private Key Cryptography                                                                                           209
                      Earlier, we made use of our intuitive sense of the English language. E was a very common
                      letter. S was common but not as common as E. Z is a rare letter. THE is a
                      very common three letter word. If we compute the relative frequency of the letters of the
                      alphabet in many reasonably long passages, a very consistent pattern of relatively frequency
                      occurs. The table below replicates a table by Beker and Piper [Incomplete: reference]
                      of percentages that each character appears in a collection of passages. The passages had all
                      punctuation and spaces removed.
                          A        B        C       D        E       F      G      H         I      J      K       L        M
                         8.17     1.49     2.78    4.25    12.70    2.23   2.02   6.09     6.97    0.15   0.77    4.03     2.41
                           N        O        P      Q       R        S      T      U        V      W       X       Y        Z
                          6.75     7.51     1.93   0.10    5.99     6.33   9.06   2.76     0.98   2.36    0.15    1.97     0.07
The letters fall into distinct groups. In order of relative frequency the letters are:
T, A, O, I, N, S, H, R
D, L
C, U, M, W, F, G, Y, P, B
V, K, J, X, Q, Z
                      The ten most common combinations of two and three letters, and their relative frequencies
                      are also given below.
                                  TH       HE       IN       ER        AN      RE         ED       ON      ES       ST
                                 3.015    3.004    1.872    1.860     1.419   1.353      1.305    1.182   1.170    1.147
                                 THE      ING      AND      HER       ERE     ENT        THA      NTH     WAS      ETH
                                 2.032    0.747    0.667    0.547     0.448   0.376      0.353    0.353   0.336    0.312
210                                                                                             Chapter 30              The RSA Scheme
      Now lets return to our ciphertext and see, even without spaces, if we can make progress.
      In this particular case, its important to note that the passage is shorter than we would
      like. It is also not typical of normal discourse and so the distribution of letters is unusual.
      Nonetheless, lets tally up the instances of each letter in the ciphertext.
                            A        B        C        D    E    F   G    H        I        J    K    L        M
                            2        19       0        0    0    5   2    12       4        0    5    0        1
                            N    O        P        Q       R    S    T    U    V        W        X        Y        Z
                            5    0        12       8       4    5    9    0    16       1        14       0        10
      The letter B looks like it should map to E, though V is also a possibility. There
      are many pairs and triples of letters that are relatively frequent, and this is unexpected
      given the usual distributions. Nonetheless, the triple HVB, or  E partially decrypted,
      occurs as often as any other triple and so it would make sense, in a first attempt, to guess
      that HVB corresponds to THE. With H, V and B, and hence T, H and
      E dealt with, it is likely that the remaining common letters H, P, Q, T, X,
      and Z map to A, O, I, N, S and R. We leave it to the reader to continue
      experimenting.
      Substitution ciphers have a grave weakness. Given any reasonably long ciphertext, patterns
      of distribution can be used to break them. A Vigenere cipher is intended to make the
      frequency distribution more uniform. Heres how it works. First, we treat the alphabet as
      numbers modulo 26. Thus, we have the correspondence given in the table below.
                            A        B        C    D        E   F    G    H    I        J       K     L       M
                            0        1        2    3        4   5    6    7    8        9       10    11      12
                       N        O        P        Q        R    S    T    U        V        W        X        Y         Z
                       13       14       15       16       17   18   19   20       21       22       23       24        25
      We choose as our key any text string and also treat each of the characters in the string as
      integers modulo 26. For encryption we add, character by character modulo 26, our key to
      the message. For decryption we subtract, character by character modulo 26, our key from
      the ciphertext. If the key is shorter than the message, we repeat the key. We assume that
      all punctuation and spacing has been removed from the message text, and that the message
      text is blocked into groups of five characters. For example, the source text (from Moby
      Dick by Herman Melville )
      CALL ME ISHMAEL
      becomes the plaintext
      CALLM EISHM AEL
      We add the key
      HERMAN
      as follows
Section 30.2   Private Key Cryptography                                                                                                 211
                                       C     A     L     L    M       E     I      S     H    M           A       E    L
                                       H     E     R     M    A       N     H      E     R    M           A       N    H
                                       J     E     C     X    M       R     P      W     Y    Y           A       R    S
                                                                      noting that
                                       2     0     11    11   12       4      8     18       7      12        0       4    11
                                  +    7     4     17    12    0       13     7      4       17     12        0       13    7
                                      9     4     2     23   12       17     15    22       24     24        0       17   18
      In a private key cryptographic scheme, like the substitution cipher or Vigenere cipher that
      you have already learned about, participants share a common key. This raises the problem
      of how to distribute a large number of keys between users, especially if these keys need to
      be changed frequently. For example, there are almost 200 countries in the world. If Canada
      maintains an embassy in each country and allows Canadian embassies to communicate with
      one another, the embassiesmust exchange a common key between each pair of embassies.
      That means there are 200  2  = 19, 900 keys to exchange. Worse yet, for security reasons,
      keys should be changed frequently and so 19, 900 keys might need to be exchanged daily.
      In a public key cryptographic scheme, keys are divided into two parts: a private decryption
      key held secretly by each participant, and a public encryption key, derived from the private
      key, which is shared in an open repository of some sort. For user A to send a private message
      to user B, A would look up Bs public key, encrypt the message and send it to B. Since
      B is the only person who possesses the secret key required for decryption, only B can read
      the message.
      Such an arrangement solves the key distribution problem. The public keys do not need to
      be kept secret and only one per participant needs to be available. Thus, in our embassy
      example previously, only 200 keys need to be published.
      The possibility of public key cryptography was first published in 1976 in a paper by Diffie,
      Hellman and Merkle. The RSA scheme, named after its discoverers Rivest, Shamir and
      Adleman is an example of a commercially implemented public key scheme.
      RSA is now widely deployed. The following protocols and products, which embed RSA, are
      used by many of us daily. SSL (Secure Sockets Layer) is the most commonly used protocol
      for secure communication over the web. It is frequently used to encrypt payment data
      before sending that data to a server. PGP (Pretty Good Privacy) is used by individuals
      and businesses to encrypt and authenticate messages. It was originally intended for email
      messages and attachments but is now also used for encrypting files, folders or entire hard
      drives. EMV (Europay, MasterCard and VISA) is a global standard for authenticating
      credit and debit card transactions at point of sale (POS) or automated teller machines
      (ATM).
Section 30.4   Implementing RSA                                                                                 213
                     In RSA, messages are integers. How does one get an integer from plaintext? In much the
                     same way we did with a Vigenere cipher, assign a number to each letter of the alphabet
                     and then concatenate the digits together.
2. Select an integer e so that gcd(e, (p 1)(q 1)) = 1 and 1 < e < (p 1)(q 1).
                        3. Solve
                                                          ed  1    (mod (p  1)(q  1))
                           for an integer d where 1 < d < (p  1)(q  1).
To send a message:
4. Send C.
To decrypt a message:
30.4.4 Example
Setting up RSA
        2. Select an integer e so that gcd(e, (p  1)(q  1)) = 1 and 1 < e < (p  1)(q  1).
           Now (p  1)(q  1) is
           6443903609 8539423089 8003779070 0502485677
           1034536313 8360840952 3666750800 6340495008
           2897684191 1341266752.
           Choose e as
           9573596212 0300597326 2950869579 7174556955
           8757345310 2344121731.
           It is indeed the case that gcd(e, (p  1)(q  1)) = 1 and 1 < e < (p  1)(q  1).
        3. Solve
                                       ed  1   (mod (p  1)(q  1))
           for an integer d where 1 < d < (p  1)(q  1). Solving this LDE gives d as
           5587652122 6351022927 9795248536 5522717791
           7285682675 6100082011 1849030646 3274981250
           2583120946 4072548779.
Sending a Message
To send a message:
                             Computing gives C
                             4006696554 3080815610 2814019838 8509626485
                             8151054441 5245547382 5506759308 1333888622
                             4491394825 3742205367.
4. Send C.
Receiving a Message
To decrypt a message:
30.5 Does M = R?
     Theorem 1       (RSA)
                     If
2. n = pq
4. 0 M < n
5. M e C (mod n)
then R = M .
                     The proof is long and can appear intimidating but, in fact, it is structurally straightforward
                     if we break it into pieces. The proof is done in four parts.
216                                                                      Chapter 30   The RSA Scheme
R M M k(p1)(q1) (mod n)
2. Show that R M (mod p). We will do this in two cases: (i) p - M and (ii) p | M .
R M M k(p1)(q1) (mod n)
ed = 1 + k(p 1)(q 1)
Now
                                     R  Cd      (mod n)
                                               e d
                                         (M )        (mod n)
                                         M ed       (mod n)
                                               1+k(p1)(q1)
                                        M                      (mod n)
                                         M M k(p1)(q1)       (mod n)
      Second, we will show that R  M (mod p). Suppose that p - M . By Fermats Little
      Theorem,
                                     M p1  1 (mod p)
      Hence
M M k(p1)(q1) M (mod p)
      Since
                     R  M M k(p1)(q1)     (mod n)  R  M M k(p1)(q1)       (mod p)
      we have
                                              RM       (mod p)
      Now suppose that p | M . But then M  0 (mod p) and so M M k(p1)(q1)  0 (mod p).
      That is,
                                 M M k(p1)(q1)  M (mod p)
      Again, since
                      we have
                                                           RM       (mod p)
                                                           RM       (mod p)
                                                           RM       (mod q)
Since gcd(p, q) = 1 we can invoke the Chinese Remainder Theorem and conclude that
RM (mod pq)
                      Since pq = n we have
                                                           RM       (mod n)
                      Now, R and M are both integers congruent to each other modulo n, and both lie between
                      0 and n  1, so R = M .
                      The basic idea behind RSA is that multiplying large integers is easy and factoring large
                      integers is difficult. Despite enormous efforts, both theoretically and computationally, no
                      efficient method of factoring has been discovered. In practice, the risk of successful attack
                      against an RSA user usually lies with implementation details, not in the underlying theory.
        Part V
          218
                    Chapter 31
31.1 Objectives
1. Define injection.
3. Define bijection.
31.2.1 Definition
                    The definition of onto or surjective functions contained nested quantifiers that were different.
                    The next definition uses nested quantifiers that are the same.
Definition 31.2.1   Let S and T be two sets. A function f : S  T is one-to-one (or injective) if and only if
   One-to-one,      for every x1  S and every x2  S, f (x1 ) = f (x2 ) implies that x1 = x2 .
    Injective
                    Just as with onto functions, lets parse the definition beginning with the universal quan-
                    tifier For every. Recall that we must identify the quantifier, variable, domain and open
                    sentence.
                           Quantifier:        
                           Variable:          x1
                           Domain:            S
                           Open sentence:     for every x2  S, f (x1 ) = f (x2 ) implies that x1 = x2
                    The open sentence itself contains a quantifier. We can again identify the four parts of this
                    quantifier.
                                                                  219
220                                                                     Chapter 31   Injections and Bijections
                        Quantifier:       
                        Variable:         x2
                        Domain:           S
                        Open sentence:    f (x1 ) = f (x2 ) implies that x1 = x2
                 The Select Method selects a representative mathematical object within the appropriate
                 domain, and shows that the object satisfies the corresponding open sentence. So a one-to-
                 one proof will look like this.
                 Proof in Progress
                   3. Suppose that f (s1 ) = f (s2 ). This is the hypothesis of the open sentence. Since we
                      wish to show that the open sentence is true, we assume the hypothesis is true.
                   4. Now we show that s1 = s2 . This is the conclusion of the open sentence. Since we
                      wish to show that the open sentence is true, we must show the conclusion is true.
31.2.2 Reading
                 Lets work through an example. Notice how closely the proof follows the structure of a
                 one-to-one proof.
 Proposition 1   Let m 6= 0 and b be fixed real numbers. The function f : R  R defined by f (x) = mx + b
                 is one-to-one.
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. Let x1 , x2 S.
                       Sentence 1 Let x1 , x2  R.
                             The author combines the first two sentences of the structure of a one-to-one proof into
                             a single sentence. This works because both of the first two quantifiers in the definition
                             are universal quantifiers and so the author uses the Select Method twice. That is, the
                             author chooses elements (x1 and x2 ) in the domain (R). The author must now show
                             that the open sentence is satisfied (f (x1 ) = f (x2 ) implies that x1 = x2 ).
31.2.3 Discovering
                       We can begin with the basic proof structure that we discussed earlier.
                       Proof in Progress
                    The obvious starting point is to write down f (x1 ) = f (x2 ) and see if algebraic manipulation
                    can take us to x1 = x2 . And that is indeed the case.
                    We need to be careful here since x21 = x22 does not generally imply x1 = x2 . For example,
                    x1 = 5 and x2 = 5 satisfy x21 = x22 but not x1 = x2 . However, in this case because
                    the domain is [1, 2] we are justified in taking the positive square root and concluding that
                    x1 = x2 . Here is a complete proof.
                    Proof: Let x1 , x2  [1, 2]. Suppose that f (x1 ) = f (x2 ). But then x21 + 3 = x22 + 3 and
                    so x21 = x22 . Since x1 , x2  [1, 2] we can take the positive square root of both sides to get
                    x1 = x2 .
                    Just as with onto functions, the choice of the domain and codomain for the function is
                    important. Consider the statement
                    This is very similar to the proposition we just proved, but this statement is false. It is easier
                    to see why by working with the contrapositive of f (x1 ) = f (x2 )  x1 = x2 . Recall that the
                    contrapositive is logically equivalent to the original statement. For one-to-one functions, we
                    can make the following statement which is equivalent to the definition.
      Statement 4   Let S and T be two sets. A function f : S  T is one-to-one (or injective) if and only if
                    for every x1  S and every x2  S, if x1 6= x2 , then f (x1 ) 6= f (x2 ).
The next proposition asserts that the composition of one-to-one functions is also one-to-one.
                         There are three instances of one-to-one in the proposition. Two occur in the hypothesis
                         and are associated with the functions f and g. The third occurs in the conclusion and is
                         associated with the function f  g. Lets use the structure of a one-to-one proof as our
                         starting point.
                         Proof in Progress
1. Let x1 , x2 S.
4. To be completed.
5. Hence, x1 = x2 as required.
                         Since f and g are not specified, this may seem impossible. But lets follow our nose and
                         see what happens. Since (f  g)(x1 ) = (f  g)(x2 ), we know that f (g(x1 )) = f (g(x2 )).
                         But since f is one-to-one, we know that g(x1 ) = g(x2 ). If this seems confusing, since f is
                         one-to-one, f (y1 ) = f (y2 ) implies y1 = y2 . In this case, y1 = g(x1 ) and y2 = g(x2 ). Now
                         back to g(x1 ) = g(x2 ). Since g is one-to-one, we know that x1 = x2 , which is exactly what
                         we needed to show.
                         A proof might look like the following.
31.3 Bijections
Definition 31.3.1        A function f : S  T is bijective if and only if f is both surjective and injective.
     Bijective
      Example 1          We have already shown that for m 6= 0 and b a fixed real numbers, the function f : R  R
                         defined by f (x) = mx + b is both surjective and injective. Hence, f is bijective.
      REMARK
      Suppose f is a rule that defines a mapping from set S to set T .
          f is surjective if, for each element t  T , there is at least one element s  S so that
           f (s) = t.
          f is injective if, for each element t  T , there is at most one element s  S so that
           f (s) = t.
          f is bijective if, for each element t  T , there is exactly one element s  S so that
           f (s) = t.
      Bijections are commonly used in calculus to identify invertible functions. Bijections are
      used in linear algebra and group theory to show that two algebraic structures, which may
      look very different, are essentially the same. We will use bijections to count.
31.4 Practice
        1. For each of the following mappings f , first determine whether or not f is a function.
           If f is a function, determine whether or not f is surjective, injective or bijective. In
           all cases, provide reasons for your answer.
             (a) Let S be the set of words in the English language. Let T be the English alphabet,
                 that is, T = {a, b, c, . . . , z}. The mapping f : S  T maps a word to the words
                 first letter. For example, f (mathematics) = m.
             (b) Let f : N  N be defined by                 X
                                                   f (n) =         d
                                                             d|n
Counting
32.1 Objectives
1. Define what it means for two sets to have the same cardinality.
Many, many years ago, I lived high up in the mountains of southern Africa. Herd boys
would be sent with their flocks of sheep and goats to the high pastures to allow the animals
to graze. The herd boys were uneducated, and very few knew how to count. So, how did
they know if they had the right number of animals at any given time? An animal might
get lost at night, be out of sight among the ridges during the day, or be taken by jackals.
Before the herd boys were sent out from their family compounds they would be given a
very small bag that contained pebbles, one pebble for each animal. So, to count the
animals, they would simply match up a pebble against each animal they could see. If there
were more pebbles than animals, an animal was missing. If there were more animals than
pebbles, another animal had joined their flock, presumably from a nearby herd. If there
was exactly one pebble for each animal, the herd boy had the correct number of animals.
The herd boys counted by forming a bijection between the set of pebbles in their bag
and the set of animals in their flock. When we count by saying 1, 2, 3, . . . we are creating
a bijection between a subset of the integers and the set of objects we are counting. Now,
how do we formalize this idea?
                                            225
 226                                                                                         Chapter 32     Counting
                     Recall that we used the notation |S| to mean the cardinality, or number of elements, in the
                     set S. Now it is time to be clear about what that really means.
Definition 32.3.1    If there exists a bijection between the sets S and T , we say that the sets have the same
   Cardinality       cardinality and we write |S| = |T |.
Let Nn denote the set of all natural numbers less than or equal to n.
N0 =
N1 = {1}
N2 = {1, 2}
N3 = {1, 2, 3}
Nn = {1, 2, 3, . . . , n}
Definition 32.3.2    If there exists a bijection between a set S and Nn , we say that the number of elements
    Number of        in S is n, and we write |S| = n. Moreover, we also say that S is a finite set. If no bijection
 Elements, Finite,   exists between a set S and Nn , we say that S is an infinite set.
     Infinite
                     This formal definition corresponds exactly to what herd boys do with pebbles, what children
                     do when counting on fingers, and what we do when counting with the words one, two,
                     three. This definition extends the bijection notion to infinite sets as well, but that extension
                     brings some weirdness which we will see next lecture.
                     The presence of an existential quantifier in the conclusion suggests we use the Construct
                     Method. Lets begin by identifying the parts of the quantified sentence.
                            Quantifier:          
                            Variable:            f
                            Domain:              all functions from S to T
                            Open sentence:       f : S  T is a bijection.
 Section 32.5   Finite Sets                                                                                         227
                        To show that the open sentence is true, we must show that f is a bijection, that is, we must
                        show that f is surjective and injective. So any proof that |S| = |T | which uses bijections
                        will have the following structure.
                        Proof in Progress
                        Since we already know how to handle Sentences 2  4, we can produce a more complete
                        structure.
                        Proof in Progress
                              2. We show that f is a function. Since a function is defined by unique values for elements
                                 in the domain, we use either of the uniqueness methods. For example: Let s  S and
                                 let t1 = f (s) and t2 = f (s) where t1 6= t2 . Derive a contradiction.
                              4. We show that f is injective. Let s1 , s2  S and suppose that f (s1 ) = f (s2 ). Now we
                                 show that s1 = s2 to be completed.
                        The structure contains three parts which are, in themselves, proofs: a proof that f is a
                        function, a proof that f is surjective, and a proof that f is injective.
                        We should emphasize that bijections are not the only way to show that two sets have the
                        same cardinality. We can use bijections to establish propositions which are simpler to work
                        with, and then use the propositions.
                        We begin by proving two fundamental theorems about counting and sets for which you
                        probably already have an intuitive understanding but may never have proved.
|S T | = |S| + |T |
                 A simple example can be taken from any room in any building. If S is a set of m chairs in
                 the room, and T is a set of n tables in the room, then the number of tables and chairs is
                 m + n.
                 Before we read a proof of the Cardinality of Disjoint Sets, it is important to keep two things
                 in mind. First, we are proving a statement about set cardinality, not a statement about
                 set equality. Second, to establish basic properties of set cardinality we must work with
                 bijections.
                 The intuitive idea underlying the proof is very simple. Count the first m elements in S, and
                 then continue counting the next n elements in T . As you will see, a formal proof is more
                 complicated. Note how closely the proof follows the structure described in the previous
                 section.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                             7. Thus
                                                |S  T | = |Nm+n | = m + n = |Nm | + |Nn | = |S| + |T |
Analysis of Proof As usual, we begin with the hypothesis and the conclusion.
                       Sentence 1 Since S is a finite set, there exists a bijection f : S  Nm for some non-
                            negative integer m, and |S| = m.
                               This makes use of the hypothesis and the definition of Nm . The second sentence is
                               similar.
                       Sentence 2 Since T is a finite set, there exists a bijection g : T  Nn for some non-
                            negative integer n, and |T | = n.
                       Sentence 3 Before looking at Sentence 3, we are going to skip ahead to the last sentence.
                            Fortunately, when reading a proof we are free to do that. This last sentence drives
                            what we need to do. Sentence 3 constructs a rule h : S  T  Nm+n . How are we
                            going to use h?
                               The first equality sign relies on the bijection h. All of the remaining equality signs
                               can be justified from the definition of N` or Sentences 1 and 2. The difficult part is
                               constructing h and then establishing that h is a bijection. Sentence 3 constructs a
                               mapping h : S  T  Nm+n as follows.
                                                                   
                                                                     f (x)       if x  S
                                                            h(x) =
                                                                     g(x) + m if x  T
                               Notice that h is defined in terms of f and g. Note also that elements in the set S will
                               be mapped to the integers 1, 2, . . . , m and the elements in the set T will be mapped
                               to the integers m + 1, m + 2, . . . , m + n.
                               Having defined a mapping h, the author must still establish
                                  h is a function
230                                                                                    Chapter 32    Counting
                          h is surjective
                          h is injective
This occurs in the next three paragraphs, each of which is a proof in its own right.
|S T | = |S| + |T | |S T |
                 After having just endured an arduous proof, you might be disinclined to go looking for a
                 complicated mapping and then proving that it is a bijection. Thats sensible. What we can
                 do in this case is to use the Cardinality of Disjoint Sets by writing S  T and T as the union
                 of disjoint sets.
                 Proof in Progress
3. To be completed.
                 But now that we have the unions of finite disjoint sets we can invoke the Cardinality of
                 Disjoint Sets.
                 Proof in Progress
5. To be completed.
                       Subtracting the two cardinality equations and rearranging will give us what we need. Take
                       a minute to read a complete proof.
S T = S (T S)
|S T | = |S| + |T S|
T = (S T ) (T S)
|T | = |S T | + |T S|
|S T | |T | = |S| |S T |
                       hence
                                                               |S| + |T |  |S  T |
                       as required.
                Chapter 33
33.1 Objectives
                With respect to counting, finite sets behave pretty much as we expect. For example, if S is
                a proper subset of T , then |S| < |T |.
                The proof uses the same partitioning idea that was used in the proof of the Cardinality of
                Intersecting Sets.
S (T S) = T
|S| + |T S| = |S (T S)| = |T |
                                                              232
Section 33.2   Infinite Sets Are Weird                                                                             233
This is not the case for infinite sets. Consider the following proposition.
                       Lets be clear about what this proposition is saying. Even though the set of positive even
                       numbers is a proper subset of the set of natural numbers, and even though there are infinitely
                       many odd numbers excluded from the set even numbers, the cardinality of the sets of even
                       numbers and all natural numbers is the same!
                       How would we prove this? Two sets have the same cardinality if and only if there exists a
                       bijection between the two sets. So we can use the same proof structure that was used in
                       the previous chapter to build a bijection between two sets.
                       Proof in Progress
                                                             N  1 2 3 4 ...
                                                                   
                                                             2N 2 4 6 8 . . .
                   There are infinitely many rational numbers between the natural numbers 1 and 2 so it is
                   a real shock to most people that the cardinality of the positive rational numbers and the
                   natural numbers is the same.
                   To prove this we will make use of the following proposition, which is not difficult to prove,
                   but requires some facts not yet covered in the course.
Example 1 Here are some examples of the Even-Odd Factorization of Natural Numbers.
                                                           60 = 22  15
                                                           64 = 26  1
                                                           65 = 20  65
                   Here is a proof that |Q>0 | = |N|. Notice how closely it follows the proof structure that we
                   have been using.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                     2. We show that f is a function. Let a/b  Q>0 and let t1 = f (a/b) and t2 = f (a/b)
                        where t1 6= t2 . Since gcd(a, b) = 1, a/b is the unique representative of fractions equal
                        to a/b. Hence, t1 = f (a/b) = 2a1 (2b  1) = t2 , contradicting the assumption that
                        t1 6= t2 .
Section 33.4   Not All Infinite Sets Have The Same Cardinality                                                   235
You might well ask, do all infinite sets have the same size? The surprising answer is no.
                      Recall that (0, 1) denotes the open interval of real numbers between 0 and 1. That is
                                                      (0, 1) = {x  R | 0 < x < 1}
                      Proof: By way of contradiction, assume that |N| = |(0, 1)|. But then some bijection
                      f : N  |(0, 1)| must exist. Write each element of |(0, 1)| as an infinite decimal and list all
                      of the real numbers in (0, 1) as follows.
                                                        f (1) = 0.a11 a12 a13 a14 . . .
                                                        f (2) = 0.a21 a22 a23 a24 . . .
                                                        f (3) = 0.a31 a32 a33 a34 . . .
                                                             ..
                                                              .
                                                        f (n) = 0.an1 an2 an3 an4 . . .
                                                             ..
                                                              .
                      Construct the real number c = 0.c1 c2 c3 c4 . . . as follows. For ci , choose any digit from
                      1, 2, 3, . . . , 8 with the property that ci 6= aii . The number c does not end in an infinite
                      sequence of 0s or 9s so has only one decimal representation (a subtlety that requires its
                      own explanation in another course). The real number c appears nowhere in the list since it
                      differs from f (i) in position i for every i.
                      But then f is not surjective, hence not bijective which contradicts our assumption.
236                                                       Chapter 33      Cardinality of Infinite Sets
          Can we say that the cardinality of one infinite set is less than or greater than another
           infinite set?
          Can there be infinite sets whose cardinality lies between that of other infinite sets of
           distinct cardinalities?
      These are very interesting questions with even more interesting answers. Unfortunately, the
      questions and answers will have to be left to another course.
            Chapter 34
34.1 Objectives
This class provides an opportunity to practice working with bijections and cardinality.
Example 1   For each of the following functions, determine if the function is a surjection, injection, or
            bijection.
              1. f : R  R defined by f (x) = ex .
                 Solution: This function is not surjective. Consider the real number 1. Since
                 f (x) > 0 for all x  R, there is no real number x0 so that f (x0 ) = 1. To show
                 that this function is injective, let x1 , x2  R and suppose that ex1 = ex2 . Taking the
                 natural log of both sides gives ln(ex1 ) = ln(ex2 ) which implies that x1 = x2 . Since f
                 is not surjective, it is not bijective.
                                                         237
238                                       Chapter 34    Practice, Practice, Practice: Bijections and Cardinality
      Example 2   Let S denote the set of all finite subsets of the natural numbers. Let D(n) denote the set of
                  all natural number divisors of n. Thus, D(12) = {1, 2, 3, 4, 6, 12}. Is the function f : N  S
                  defined by D(n) a surjection?
                  Solution: D is not a surjection. Consider any set without the element 1, T = {2, 3} for
                  example. Suppose there exists an integer n so that D(n) = T . Since 1 | n, 1 must be in T ,
                  but it is not. Hence, no natural number can map to T .
            239
Chapter 35
Complex Numbers
35.1 Objectives
1. N Z Q R C
When humans first counted, we tallied. We literally made notches on sticks, stones and
bones. Thus the natural numbers, N, were born. But it wouldnt be long before the
necessity of fractions became obvious. One animal to be shared by four people (we will
assume uniformly) meant that we had to develop the notion of 1/4. Though it would not
have been expressed this way, the equation
4x = 1
does not have a solution in N and so we would have had to extend our notion of numbers
to include fractions, the rationals.
                                      n a                  o
                                   Q=      a, b  Z, b 6= 0
                                          
                                        b
This is an overstatement historically, because recognition of zero and negative numbers
which are permitted in Q were very slow to come. But even these new numbers would not
help solve equations of the form
                                         x2 = 2
which would arise naturally from isosceles right angled triangles. For this, the notion
of number had to be extended to include irrational numbers, which combined with the
rationals, give us the real numbers.
                                          240
 Section 35.3   Complex Numbers                                                                               241
                      Eventually, via Hindu and Islamic scholars, western mathematics began to recognize and
                      accept both zero and negative numbers. Otherwise, equations like
3x = 5x
                      or
                                                              2x + 4 = 0
                      have no solution. Thus, mathematicians recognized that
NZQR
x2 + 1 = 0
Definition 35.3.1     A complex number z in standard form is an expression of the form x+yi where x, y  R.
 Complex Number       The set of all complex numbers is denoted by
C = {x + yi | x, y R}
      Example 1       Some examples are 3 + 4i, 0 + 5i (usually written 5i), 7  0i (usually written 7) and 0 + 0i
                      (usually written 0).
Definition 35.3.2     For a complex number z = x + yi, the real number x is called the real part and is written
    Real Part,        <(z) and the real number y is called the imaginary part and is written =(z).
  Imaginary Part
                      So <(3 + 4i) = 3 and =(3 + 4i) = 4. If z is a complex number where =(z) = 0, we will treat
                      z as a real number and we will not write the term containing i. For example, z = 3 + 0i
                      will be treated as a real number and will be written z = 3. Thus
RC
                      and so
                                                         NZQRC
One has to wonder how much further the number system needs to be extended!
Definition 35.3.3     The complex numbers z = x + yi and w = u + vi are equal if and only if x = u and y = v.
     Equality
 242                                                                                  Chapter 35     Complex Numbers
        Example 2
                                            (1 + 7i) + (2  3i) = (1 + 2) + (7  3)i = 3 + 4i
                     This property that i2 = 1 is what gives complex numbers their strangeness and their
                     strength. In the next example, note that the definition of multiplication coincides exactly
                     with the usual binomial multiplication where i2 is replaced by 1.
1. u + v
2. u v
3. uv
4. u2 v
                       5. u3
                          v
                       6.    (write the solution in the form x + yi where x, y  R)
                          u
Solution:
1. u + v = (3 + i) + (2 7i) = 5 6i
2. u v = (3 + i) (2 7i) = 1 + 8i
                       6.
                                             v   2  7i   2  7i 3  i   1  23i   1 23
                                               =        =             =          =    +    i
                                             u   3+i      3+i 3i           10      10   10
Exercise 2 Compute
Solution:
                       1. Associativity of addition: (u + v) + z = u + (v + z)
                       2. Commutativity of addition: u + v = v + u
                       3. Additive identity: 0 = 0 + 0i has the property that z + 0 = z
                       4. Additive inverses: If z = x + yi then there exists an additive inverse of z, written z
                          with the property that z+(z) = 0. The additive inverse of z = x+yi is z = xyi.
                       5. Associativity of multiplication: (u  v)  z = u  (v  z)
                       6. Commutativity of multiplication: u  v = v  u
                       7. Multiplicative identity: 1 = 1 + 0i has the property that z  1 = z whenever z 6= 0.
                       8. Multiplicative inverses: If z = x + yi 6= 0 then there exists a multiplicative inverse
                          of z, written z 1 , with the property that z  z 1 = 1. The multiplicative inverse of
                          z = x + yi is z 1 = xxyi
                                                 2 +y 2 .
                       9. Distributivity: z  (u + v) = z  u + z  v
244                                                                  Chapter 35    Complex Numbers
                                                      x  yi
      Proof: We only need to demonstrate that                  is well-defined and that
                                                      x2 + y 2
                                                      x  yi
                                           x + yi             =1
                                                      x2 + y 2
                                            x  yi
      Since z 6= 0, x2 + y 2 6= 0 and so             is well-defined. Now we simply use complex
                                            x2 + y 2
      arithmetic.
                                   x  yi   x2 + xy  xy  y 2 i2  x2 + y 2
                        x + yi     2   2
                                          =        2    2
                                                                  = 2       =1
                                   x +y           x +y             x + y2
Section 35.4   More Examples                                                                                 245
1. Let z = 3 + 4i, u = 1 2i and w = 3i. Express each of the following in standard form.
                            (a) z + 3u  wi
                            (b) z/u
Solution:
36.1 Objectives
36.2 Conjugate
1. z + w = z + w
2. zw = z w
3. z = z
4. z + z = 2<(z)
5. z z = 2i=(z)
We will prove the first of these properties and leave the remainder as exercises.
                                                                 246
Section 36.2   Conjugate                                                                                   247
Exercise 1 Prove each of the remaining parts of the Properties of Conjugates proposition.
     Example 1        Prove: Let z  C. The complex number z is a real number if and only if z = z.
                      Solution: Let z = x + yi.
      Exercise 2      Prove: Let z  C and z 6= 0. The complex number z is purely imaginary (<(z) = 0) if and
                      only if z = z.
                                        w is real  w = w
                                                                  
                                                    z+i       z+i
                                                        =
                                                    zi       zi
                                                    z+i     zi
                                                        =
                                                    zi     z+i
                                                  zz  1 + (z + z)i = zz  1  (z + z)i
                                                  2i(z + z) = 0
                                                  z + z = 0
                                                  2<(z) = 0
                                                  <(z) = 0
                                                  z is zero or purely imaginary
36.3 Modulus
Definition 36.3.1   The modulus of the complex number z = x + yi is the non-negative real number
       Modulus                                                   p
                                                 |z| = |x + yi| = x2 + y 2
                                                         p               
        Example 3   The modulus of z = 2  5i is |z| =    (22 ) + (5)2 = 29.
                    Given two real numbers, say x1 and x2 , we can write either x1  x2 or x2  x1 . However,
                    given two complex numbers, z1 and z2 , we cannot meaningfully write z1  z2 or z2  z1 .
                    But since the modulus of a complex number is a real number, we can meaningfully write
                    |z1 |  |z2 |. The modulus gives us a means to compare the magnitude of two complex
                    numbers, but not compare the numbers themselves.
                    If =(z) = 0, then the modulus corresponds to the absolute values of real numbers.
Section 36.4   More Examples                                                                           249
2. |z| = |z|
3. zz = |z|2
4. |zw| = |z||w|
                                                                     x = x2  y 2
                                                                    y = 2xy
                                             x = x2  x2  x = 0  x(x  1) = 0  x = 0 or x = 1
                                    1
                           If x =    2   then the first equation gives
                                                                          
                                                       1  1  2  2 3        3
                                                          = y y = y =
                                                       2   4       4       2
                           Thus, the solutions are                              
                                                                  1     3 1      3
                                                            0, 1,    +    i,        i
                                                                   2   2     2   2
250                                                Chapter 36    Properties Of Complex Numbers
36.5 Practice
1. Let z be a complex number. Prove that |z|n = |z n | for any positive integer n.
             (a) z 2 + 2z + 1 = 0
             (b) z 2 + 2z + 1 = 0
                       1+i
             (c) z 2 =      .
                       1i
                                                                             1 1 1
       3. Let a, b, c  C. Prove: If |a| = |b| = |c| = 1, then a + b + c =    + + .
                                                                             a b c
                                             z
       4. Let z  C, z 6= i. Prove that          is real if and only if z is real or |z| = 1.
                                           1 + z2
                    Chapter 37
                    Graphical Representations of
                    Complex Numbers
37.1 Objectives
Definition 37.2.1   The notation z = x + yi suggests a non-algebraic representation. Each complex number
  Complex Plane     z = x + yi can be thought of as a point (x, y) in a plane with orthogonal axes. Label one
                    axis the real axis and the other axis the imaginary axis. The complex number z = x + yi
                    then corresponds to the point (x, y) in the plane. This interpretation of the plane is called
                    the complex plane or the Argand plane.
                                                                251
252                                             Chapter 37    Graphical Representations of Complex Numbers
1. 4 + i
2. 2 + 3i
3. 2 i
37.2.2 Modulus
                   Recall that the modulus of the complex number z = x + yi is the non-negative real number
                                                                   p
                                                   |z| = |x + yi| = x2 + y 2
                   There are a couple of geometric points to note about the modulus of z = x + yi. The
                   Pythagorean Theorem is enough to prove that |z| is the distance from the origin to z in
                   p complex plane, and that the distance between z and w = u + vi is just |z  w| =
                   the
                     (x  u)2 + (y  v)2 .
Exercise 2 Sketch all of the points in the complex plane with modulus 1.
                   There is another way to represent points in a plane which is very useful when working with
                   complex numbers. Instead of beginning with the origin and two orthogonal axes, we begin
                   with the origin O and a polar axis which is a ray leaving from the origin. The point P (r, )
                   is plotted so that the distance OP is r, and the counter clockwise angle of rotation from
                   the polar axis, measured in radians, is .
                   Note that this allows for multiple representations since (r, ) identifies the same point as
                   (r,  + 2k) for any integer k.
                   The obvious problem is how to go from one to the other.
Section 37.4   Converting Between Representations                                                              253
Given the polar coordinates (r, ), the corresponding Cartesian coordinates (x, y) are
                                                               x = r cos 
                                                               y = r sin 
                      Given the Cartesian coordinates (x, y), the corresponding polar coordinates are determined
                      by
                                                                   p
                                                               r = x2 + y 2
                                                                   x
                                                           cos  =
                                                                   r
                                                                   y
                                                           sin  =
                                                                   r
254                                                Chapter 37     Graphical Representations of Complex Numbers
Example 1 Here are points in standard form, Cartesian coordinates and polar coordinates.
      Exercise 3   For each of the following polar coordinates, plot the point and convert to Cartesian coordi-
                   nates.
1. (1, 0)
2. (2, /2)
3. (3, )
4. (2, 7/2)
5. (4, /4)
6. (4, 4/3)
      Exercise 4   For each of the following Cartesian coordinates, plot the point and convert to polar coordi-
                   nates.
1. (1, 0)
2. (0, 1)
3. (1, 0)
4. (0, 1)
5. (1, 1)
                        6. (1, 1)
                                 
                        7. (2, 2 3)
From our earlier description of conversions, we can write the complex number
z = x + yi
                   as
                                                z = r cos  + ri sin  = r(cos  + i sin )
 Section 37.4    Converting Between Representations                                                                      255
Example 2 The following are representations of complex numbers in both standard and polar form.
                           1. 1 = cos 0 + i sin 0
                                        
                                                                 
                                                  3          3
                           2. 1 + i = 2 cos          + i sin
                                                   4           4
                                   
                                                                  
                                                   4          4
                           3. 1  3i = 2 cos          + i sin
                                                    3            3
                        One of the advantages of polar representation is that multiplication becomes very straight-
                        forward.
      Example 3
                                                
                                                                                               
                                                        3         3              4          4
                                                  2 cos    + i sin        2 cos       + i sin
                                                         4          4               3           3
                                                    
                                                                                           
                                                             3 4                    3 4
                                                 = 2 2 cos        +        + i sin       +
                                                               4      3                4     3
                                                    
                                                                                 
                                                             25               25
                                                 = 2 2 cos           + i sin
                                                               12               12
                                                                        
                                                 = 2 2 cos         + i sin
                                                            12              12
Proof:
De Moivres Theorem
38.1 Objectives
                                                           256
Section 38.2   De Moivres Theorem                                                                                 257
1. n = 0
2. n > 0
3. n < 0
                      For the case n = 0, DeMoivres Theorem reduces to (cos  + i sin )0 = cos 0 + i sin 0. By
                      convention z 0 = 1 so the left hand side of the equation is 1. Since cos 0 = 1 and sin 0 = 0,
                      the right hand side also evaluates to 1.
                      For the case n > 0 we will use induction.
Base Case We verify that P (1) is true where P (1) is the statement
Inductive Hypothesis We assume that the statement P (k) is true for some k 1.
                           (cos  + i sin )k+1 = (cos  + i sin )k (cos  + i sin )   (by separating out one factor)
                                                = (cos k + i sin k)(cos  + i sin ) (by the Inductive Hypothesis)
                                                = cos(k + 1) + i sin(k + 1)                    (Polar Multiplication)
                      Since P (k+1) is true, P (n) is true for all natural numbers n by the Principle of Mathematical
                      Induction.
                      Lastly, for the case n < 0 we will use complex arithmetic. Since n < 0, n = m for some
                      m  N.
z n = rn (cos n + i sin n)
                     If you were asked to find a real-valued function y with the property that
                                                     dy
                                                        = ky and y = 1 when x = 0
                                                     dx
                     for some constant k, you would choose
y = ekx
                     And if you were asked to find the derivative of f () = cos  + i sin  where i was treated as
                     any other constant you would almost certainly write
                                                         df ()
                                                                =  sin  + i cos 
                                                           d
                     but then
                                           df ()
                                                  =  sin  + i cos  = i(cos  + i sin ) = if ()
                                             d
                     and so
                                                 df ()
                                                        = if () and f () = 1 when  = 0
                                                   d
                                                       ei  ei = ei(+)
                                                         n
                                                         ei = ein           n  Z
z = rei
                     Out of this arises one of the most stunning formulas in mathematics. Setting r = 1 and
                      =  we get
                                                 ei = cos  + i sin  = 1 + 0i = 1
                     That is
                                                              ei + 1 = 0
                     Who would have believed that e, i, , 1 and 0 would have such a wonderful connection!
                          Solution:
                            (a) Using the Binomial Theorem we have
                                             4  
                                       4
                                            X     4  4r r
                                ( 3 + y) =           ( 3) i
                                            r=0
                                                  r
                                              4  40 0          4  41 1    4  42 2    4  43 3    4  44 4
                                                                                                
                                          =      ( 3) i +           ( 3) i +     ( 3) i +     ( 3) i +     ( 3) i
                                              0                  1            2            3            4
                                                                    
                                          = 9 + 4  3 3i  6  3  4i 3 + 1
                                                    
                                          = 8 + 8 3i
                                                                                
                            (b) Using De
                                       q Moivres Theorem we have First, write 3 + i in polar form. The modulus
                                          2                                     
                                is r =    3 + 12 = 2. An argument is 6 . Thus, 3 + i = 2(cos 6 + i sin 6 ). By De
                                Moivres Theorem
                                                                                                
                                                               4     4       4         4
                                                   2 cos + i sin       = 2 cos        + i sin
                                                         6       6                  6          6
                                                                                                
                                                                                   2         2
                                                                       = 16 cos       + i sin
                                                                                    3          3
                                                                                       !
                                                                               1      3i
                                                                       = 16        +
                                                                                2      2
                                                                                  
                                                                       = 8 + 8 3i
                     38.5      Practice
                                     
                        1. Compute ( 3  3i)4 twice: once using the Binomial Theorem and once using De
                           Moivres Theorem. Write your answer in standard form.
                    Chapter 39
39.1 Objectives
1. State and prove the Complex n-th Roots Theorem and do examples.
Definition 39.2.1   If a is a complex number, then the complex numbers that solve
  Complex Roots
                                                              zn = a
                    are called the complex n-th roots. De Moivres Theorem gives us a straightforward way
                    to find complex n-th roots of a.
                                
                    The modulus n r is the unique non-negative n-th root of r. This theorem asserts that any
                    complex number, including the reals, has exactly n different complex n-th roots.
                                                                260
Section 39.2   Complex n-th Roots                                                                                      261
                                                                                                             
                                                                                                             4
                      Note that the solutions are uniformly distributed around a circle whose radius is          16.
262                                                                           Chapter 39          Roots of Complex Numbers
      Proof: As usual, when showing that a complete solution exists we work with two sets: the
      set S of solutions and the set T of specific representation of the solution. We then show
      that S = T by mutual inclusion. Our two sets are
S = {z C | z n = a}
      and
                          
                                                                                                             
                          n
                                                 + 2k                      + 2k     
                                                                                         k = 0, 1, 2, . . . , n  1
                T =           r       cos                     + i sin
                                                   n                           n        
                         n            + 2k n
                                                
                     n
                    t = n r cos
                                          n
                         = r(cos( + 2k) + i sin( + 2k))                            De Moivres Theorem
                         = r(cos  + i sin )                   trigonometry
                         =a
                                                      wn = a
                  (s(cos  + i sin ))n = r(cos  + i sin )
                 sn (cos n + i sin n) = r(cos  + i sin )                                De Moivres Theorem
      Now two complex numbers in polar form are equal if and only if their moduli are equal and
      their arguments differ by an integer multiple of 2. So
                                                          
                                           sn = r  s = n r
      and
                                                            + 2k
                                                     n   = 2k   =
                                                              n
      where k  Z. Hence, the n-th roots of a are of the form
                     
                                                         
                      n
                                 + 2k               + 2k
                        r cos              + i sin                                                  for k  Z
                                   n                    n
                                                                k0  k1    (mod n)
                                                      k0  k1 = n`                       for some `  Z
                                             2k0  2k1 = 2n`                             for some `  Z
                                                2k0 2k1
                                                        = 2`                            for some `  Z
                                                 n      n
                                          + 2k0  + 2k1
                                                        = 2`                            for some `  Z
                                            n         n
      Exercise 1          An n-th root of unity is a complex number that solves z n = 1. Find all of the sixth roots
                          of unity. Express them in standard form and graph them in the complex plane.
      Exercise 2          Find the square roots of 2i. Express them in standard form and graph them in the complex
                          plane.
39.3 Practice
                            1. Find all of the cube roots of unity. Write them in standard form and plot the solutions
                               in the complex plane.
                                 (a) For each n = 1, 2, 3, 6, list all the primitive n-th roots of unity. (You may express
                                     your answers in standard, polar form or exponential form.)
                                 (b) Let z be a primitive n-th root of unity. Prove the following statements.
                                       i. For any k  Z, z k = 1 if and only if n | k.
                                      ii. For any m  Z, if gcd(m, n) = 1, then z m is a primitive n-th root of unity.
                                 (a) square
                                 (b) regular pentagon
                                 (c) regular hexagon in the complex plane.
            Chapter 40
40.1 Objectives
This class provides an opportunity to practice working with quantifiers and sets.
            By De Moivres Theorem,
                                                
                                        (1 +       3i)17 = 217 (cos 5/3 + i sin 5/3)17
                                                         = 217 (cos 85/3 + i sin 85/3)
                                                         = 217 (cos /3 + i sin /3)
                                                                    
                                                         = 217 (1 + 3i)
                                                                264
Section 40.2   Worked Examples                                                                        265
                     or
                                                 (x2  y 2 + 2x + 1) + (2xy  2y)i = 0
                     Equating real and imaginary parts we have
                                                         x2  y 2 + 2x + 1 = 0
                                                                    2xy  2y = 0
2xy 2y = 0 2y(x 1) = 0 y = 0 or x = 1
x2 + 2x + 1 = 0 x = 1
1 y 2 + 2 + 1 = 0 y 2 = 4 y = 2
Factoring Polynomials
          266
Chapter 41
An Introduction to Polynomials
41.1 Objectives
     1. Define polynomial, coefficient, F[x], degree, zero polynomial, linear polynomial, quadratic
        polynomial, cubic polynomial, equal, sum, difference, product, quotient, remainder, di-
        vides and factor.
4. Do examples.
41.2 Polynomials
Our number systems were developed in response to the need to find solutions to real poly-
nomials. We are now able to solve all equations of the form
a2 x2 + a1 x + a0 = 0
or
                                           xn  a0 = 0
whether the coefficients are real or complex. In fact, a great deal more is known.
Let F be a field. Roughly speaking, a field is a set of numbers that allows addition, subtrac-
tion, multiplication and division. The rational numbers Q, the real numbers R, the complex
numbers C and the integers modulo a prime p, Zp , are all fields. The integers are not a field
because we cannot divide 2 by 4 and get an integer. Since division is just multiplication by
an inverse, Z6 is not a field since [3] has no inverse.
                                                267
 268                                                                   Chapter 41     An Introduction to Polynomials
Example 1
1. x2 + 7x 1 R[x]
                    then the polynomial is said to have degree n. The zero polynomial has all of its coefficients
                    zero and its degree is not defined. Polynomials of degree 1 are called linear polynomials,
                    of degree 2, quadratic polynomials, and of degree 3 cubic polynomials.
Definition 41.3.1   The polynomials f (x) and g(x) are equal if and only if ai = bi for all i.
       Equal
Definition 41.3.2       The sum of the polynomials f (x) and g(x) is defined as
       Sum
                                                                         max(n,m)
                                                                           X
                                                        f (x) + g(x) =            (ai + bi )xi
                                                                           i=0
where deg(f (x)) = n, deg(g(x)) = m, and any missing terms have coefficient zero.
Example 2
                           3. In Z7 [x], if f (x) = [3]x5 + [2]x3 + [6] and g(x) = [2]x4 + [5]x3 + [2]x2 + [4] then
                              f (x) + g(x) = [3]x5 + [2]x4 + [2]x2 + [3].
Definition 41.3.3       The difference of the polynomials f (x) and g(x) is defined as
    Difference
                                                                         max(n,m)
                                                                           X
                                                        f (x)  g(x) =            (ai  bi )xi
                                                                           i=0
where deg(f (x)) = n, deg(g(x)) = m, and any missing terms have coefficient zero.
Exercise 1 Find the difference of each of the pairs of polynomials given in Example 2.
The definition of the product of two polynomials looks more complicated than it is.
Definition 41.3.4       The product of the polynomials f (x) and g(x) is defined as
     Product
                                                                               m+n
                                                                               X
                                                              f (x)  g(x) =         ci xi
                                                                               i=0
                        where
                                                                                                i
                                                                                                X
                                             ci = a0 bi + a1 bi1 +    + ai1 b1 + ai b0 =         aj bij
                                                                                                j=0
                        Though the definition of multiplication looks complicated, it is just collecting all of the
                        terms xi that we would get through long multiplication.
 270                                                                Chapter 41   An Introduction to Polynomials
                                                               x2 +    7x      1
                                                                      3x     + 2
                                                             2x2    + 14x      2
                                                   3x3    + 21x2     3x
                                                   3x3    + 23x2    + 11x      2
                    The x2 column simply displays the combinations of terms from f (x) and g(x) whose product
                    gives x2 , that is x2  2, 7x  3x and 0  1, which is exactly what the definition would give.
1. Let f (x) and g(x) be the real polynomials f (x) = 2x4 + 6x3 x + 4 and g(x) = x2 + 3.
                      2. Let f (z) and g(z) be the complex polynomials f (z) = iz 2 + (3  i)z + 2i and
                         g(z) = iz + (2  2i).
                    Now we run into the same issue we had with the integers, division. Though it makes sense
                    to say that x  3 divides x2  9 since x2  9 = (x  3)(x + 3), what do we do when there is a
                    remainder? Just as we had a division algorithm for integers, we have a division algorithm
                    for polynomials.
f (x) = q(x)g(x) + r(x) where deg r(x) < deg g(x) or r(x) = 0
Definition 41.3.5   The polynomial q(x) is called the quotient polynomial. The polynomial r(x) is called the
    Quotient,       remainder polynomial. If r(x) = 0, we say that g(x) divides f (x) or f (x) is a factor
    Remainder       of g(x) and we write g(x) | f (x).
                                                                          3x2 + x  7
                                           x2 + 1           3x4 + x3     4x2  x + 5
                                                            3x4         + 3x2
                                                                  x3     7x2  x
                                                                  x3          + x
                                                                            2
                                                                         7x  2x + 5
                                                                         7x2       7
                                                                               2x + 12
                      Thus, the quotient polynomial is q(x) = 3x2 + x  7 and the remainder polynomial is
                      r(x) = 2x + 12 and f (x) = q(x)g(x) + r(x).
                                                                      z2    +             6z + (11 + 9i)
                                iz + (2  2i)        iz 3   + (2 + 4i)z 2   +       (3  i)z + (40  4i)
                                                     iz 3   + (2  2i)z 2
                                                                    6iz 2   +       (3  i)z
                                                                    6iz 2   +    (12  12i)z
                                                                                (9 + 11i)z + (40  4i)
                                                                                (9 + 11i)z + (40  4i)
                                                                                                      0
                      Thus, the quotient polynomial is q(z) = z 2 +6z +(11+9i) and the remainder is 0. Therefore,
                      g(z) divides f (z).
Exercise 3 For each f (x) and g(x), find the quotient and remainder polynomials.
                         1. Let f (x) and g(x) be the real polynomials f (x) = 2x4 + 6x3  x + 4 and g(x) = x2 + 3.
                         2. Let f (z) and g(z) be the complex polynomials
                            f (z) = iz 3 + z 2  (1 + i)z + 10 and g(z) = z + 2i.
                      Chapter 42
Factoring Polynomials
42.1 Objectives
                      which will often be written as f (x) = 0. An element c  F is called a root or zero of the
                      polynomial f (x) if f (c) = 0. That is, c is a solution of the polynomial equation f (x) = 0.
                      The history of mathematics is replete with exciting and sometimes bizarre stories of math-
                      ematicians as they looked, in vain, for an algorithm that would find a root of an arbitrary
                      polynomial. We can now prove that no such algorithm exists. It is known though, that a
                      root exists for every complex polynomial. This was proved in 1799 by the brilliant mathe-
                      matician Karl Friedrich Gauss.
                                                                    272
Section 42.2   Polynomial Equations                                                                             273
                      Ironically, we can prove a root exists, we just cant construct one in general. The proof
                      of this fact and the Fundamental Theorem of Algebra are both demanding and are left for
                      later courses.
                      We can use the Division Algorithm for Polynomials to help find roots though. Recall
f (x) = q(x)g(x) + r(x) where deg r(x) < deg g(x) or r(x) = 0
We can use the Division Algorithm for Polynomials to prove a very useful theorem.
                      Proof: By the Division Algorithm for Polynomials, there exist unique polynomials q(x)
                      and r(x) such that
                      Therefore, the remainder r(x) is a constant (which could be zero) which we will write as
                      r0 . Hence
                                                       f (x) = q(x)(x  c) + r0
                      Substituting x = c into this equation gives f (c) = r0 .
                      Equivalently,
274                                                                            Chapter 42       Factoring Polynomials
                    Induction, together with the Fundamental Theorem of Algebra and the Factor Theorems,
                    allow us to prove the following very useful corollary.
                    How do we go about actually factoring polynomials? In general, this is hard to do. There
                    are no formulas for roots if the polynomial has degree five or more. But if the polynomial
                    has integer coefficients, we have a good starting point.
                    In order to find a rational root of f (x), we only need to examine a finite set of rational
                    numbers, those whose numerator divides the constant term and those whose denominator
                    divides the leading coefficient. Note that the theorem only suggests those rational numbers
                    that might be roots. It does not guarantee that any of these numbers are roots.
                                                      1
                    Thus, the only rational root is      .
                                                       2
Section 42.2   Polynomial Equations                                                                               275
                                  p
                      Proof: If     is a root of f (x) then
                                  q
                                          n         n1               2       
                                          p           p                   p         p
                                      an      + an1        +    + a2      + a1     + a0 = 0
                                          q           q                   q         q
Multiplying by q n gives
an pn + an1 pn1 q + + a2 p2 q n2 + a1 pq n1 + a0 q n = 0
                      and
                                      an pn = q an1 pn1 +    + a2 p2 q n3 + a1 pq n2 + a0 q n1
                                                                                                             
                      Since all of the symbols in this equation are integers, both the right hand side and left hand
                      side are integers. Since q divides the the right hand side, q divides the left hand side, that
                      is
                                                                 q | an p n
                      Since gcd(p, q) = 1 we can repeatedly use the proposition on Coprimeness and Divisibility
                      to show that q | an . In a similar way, we can show that p | a0 .
      Exercise 2      Is x + 1 a factor of x10 + 1, of x9 + 1? When does x + 1 divide (or not divide) x2n + 1 for n a
                      positive integer? When does x + 1 divide (or not divide) x2n+1 + 1 for n a positive integer?
                                                          
      Exercise 3      Prove that if p is a prime, then    n   p is irrational for any integer n > 1.
                      The next, very useful theorem is like a two for one special. If you find one complex root
                      of a real polynomial, you get another one for free.
     Example 3        Let f (x) = x4  x3  5x2  x  6. Given that i is a root of f (x), factor f (x).
                      Solution: Since f (x) is a polynomial with real coefficients, we can use the Conjugate Roots
                      Theorem. Thus, i and i are both roots and, by the Factor Theorem 2, (x  i) and (x + i)
                      are factors of f (x). The product of these two factors is x2 + 1. Dividing f (x) by x2 + 1
                      yields x2  x  6 which factors as (x  3)(x + 2). Thus
an cn + an1 cn1 + + a1 c + a0 = 0
an cn + an1 cn1 + + a1 c + a0 = 0
an cn + an1 cn1 + + a1 c + a0 = 0
an cn + an1 cn1 + + a1 c + a0 = 0
                    that is,
                                                                   f (c) = 0
                    and so c is a root of f (x).
       Exercise 4   If x + (2 + i) is a factor of f (x) = x4 + 4x3 + 2x2  12x  15, factor f (x) into products of
                    real polynomials and complex polynomials of lowest degree.
                    Proof: Let c  C, =(c) 6= 0, be a root of f (x). By the Conjugate Roots Theorem, c is also
                    a root of f (x). Consider
                    where the last equality follows from Properties of Conjugates and Properties of Modulus.
                    Since 2<(c)  R and |c|2  R, q(x) is a real quadratic polynomial with c as a root.
                    Proof: Complex polynomials of degree n have n roots. Those roots which are real cor-
                    respond to real linear factors. Those roots which are not real come in conjugate pairs
                    (Conjugate Roots Theorem) and give rise to real quadratic polynomials (Real Quadratic
                    Factors). Since real and not real roots exhaust all possible choices of roots, real linear and
                    real quadratic factors exhaust all possible types of factors.
            Chapter 43
43.1 Objectives
Example 1   For each of the following, you are given several roots of a polynomial f (x). Find a polynomial
            of lowest degree in F[x] that has the given roots.
                             
              1. R[x]: 3 +       2i, 5
                 Solution: Since we are looking for a polynomial
                                                                    in R[x], we can use the Conjugate
                 Roots
                      Theorem for complex   roots. Hence, 3+   2i 
                                                                   6  R will be paired with its conjugate
                 3  2i. The product of the corresponding factors will produce a real quadratic.
                 Hence,
                                                                      
                                    f (x) = (x  (3 + 2i))(x  (3  2i))(x  5)
                                            = (x2  6x + 11)(x  5)
                                            = x3  11x2 + 41x  55
                             
              2. C[x]: 3 +       2i, 5
                                                 
                 Solution: Since both 3 +         2i and 5 are complex numbers, the corresponding linear
                 factors are in C[x] so
                                                                                             
                             f (x) = (x  (3 +       2i))(x  5) = x2 + (8 +    2i)x + (15 + 5 2i)
                             
              3. R[x]: 1        5, 2i, 0
                 Solution: Since we are looking for a polynomial in R[x], we can use the Conjugate
                 Roots Theorem for complex roots. The only root not in R is 2i so we need to pair this
                                                             277
                                                                           Chapter 43   Practice, Practice, Practice:
278                                                                                                     Polynomials
                       root with its conjugate 2i. The product of the corresponding factors will produce a
                       real quadratic. Hence,
                                                           
                                          f (x) = (x  (1  5))(x  2i)(x + 2i)(x  0)
                                                           
                                                = (x  (1  5))(x2 + 4)x
                                                           
                                                = (x  (1  5))(x3 + 4x)
                                                                                  
                                                = x4 + (1 + 5)x3 + 4x2 + 4(1 + 5)x
      Example 2   For each of the following polynomials f (x)  F[x], factor f (x) into factors with degree
                  as small as possible over F[x]. Cite appropriate propositions to justify each step of your
                  reasoning.
                    1. f (x) = x2  x  6  Q[x]
                       Solution: The quadratic formula gives the roots 3 and 2. These are values in Q so
                       there are linear factors x  3 and x + 2 by Factor Theorem 2. Hence,
f (x) = (x 3)(x + 2)
                    2. f (x) = x2  x + 6  Q[x]
                       Solution: The quadratic formula gives only complex roots in this instance. Since
                       complex numbers do not belong to Q there are no linear factors in Q[x], hence
                       f (x) = x2  x + 6 cannot be factored any further in Q[x].
                                                       f (x) 3 5 10 30 5/2            0
Section 43.2   Worked Examples                                                                               279
                           Thus,
                                                                          !!                     !!
                                                                     3 3 3                   3 3 3
                                        f (x) = x(x + 3) x            +   i  x                  i
                                                                     2   2                   2   2
Chapter 44
44.1 Objectives
This chapter provides some suggestions on starting a proof and provides an opportunity to
practice using problems from throughout the course.
In all cases, justify your work by citing appropriate definitions and propositions.
[Incomplete: This chapter continues on the next page. At this point of the
development of the notes, this chapter is incomplete and does not yet cover the
whole course.]
                                            280
Section 44.3   Suggestions On How To Start A Proof                                                             281
                         5. Once you have chosen an approach and a basic structure for the proof, ask the fol-
                            lowing questions.
                               Have I seen this before? If so, try to use a similar approach.
                               What mathematical fact would allow me to deduce the conclusion? Working
                                backwards from the conclusion narrows the set of possibilities to examine.
                               What mathematical fact can I deduce from what I already know? Working
                                forwards from the hypothesis allows you to generate a range of possible paths
                                towards the conclusion.
282                                       Chapter 44     Practice, Practice, Practice: Course Review
44.3 Exercises
             (i) Identify each of the explicit quantifiers in S together with the associated variable,
                 domain and open sentence.
             (ii) For each explicit quantifier, identify which proof technique (Object, Select, Choose)
                  would be associated with the quantifier.
          (iii) Negate S. Recall that the negation of A  B is A  B.
          (iv) Only one of S or S can be true. Identify which of S or S is true and give a
               proof.
             (v) Where possible, give a counter-example to the statement which is false.
                               (j) S: For every odd integer n and every integer k, 0  k  n, there exists an integer
                                   h 6= k so that                      
                                                                      n       n
                                                                          =
                                                                      k       h
1 + w + w2 + . . . + wn1 = 0
                              (d) If integers a and b are coprime, then the integers ab and a + b are coprime.
        Part VIII
           284
Chapter 45
45.1 Objectives
2. Formulate an algorithm.
Suppose you are living in downtown Toronto (the pink dot on the map on the next page) on
a co-op work term and you want to escape the intense July heat by going to Sibbald Point
Provincial Park (the blue dot on the map) to swim in Lake Simcoe. See Figure 45.2.1.
You could take Highway 404 past the 401, past the 407 up to the end of Highway 404, and
then take a minor road to Highway 48 and go north from there. But perhaps it would be
better to take Lakeshore Drive to Highway 48 and go straight north.
Your task is to find an algorithm, a strategy, to find the shortest route between downtown
Toronto and Sibbald Point Provincial Park.
                                           285
286                             Chapter 45     The Shortest Path Problem
45.3 Abstraction
                      Lets focus on whats important in the problem. Looking at the map there is, for our
                      purpose, lots of information that is not important: colours, parking locations, where the
                      Green Belt is, towns not along the way. What is really important are locations where we
                      might change directions, routes between those locations, and distances. Well highlight
                      important locations on the map as grey dots and connections between locations as solid
                      teal lines. See Figure 45.3.1.
      But since we dont need the rest of the detail, lets omit it and include only locations,
      connections and distances. See Figure 45.3.2.
20
45
15
120
                                                      60
                                  60
10
                                                           10
                                       10        10              30
                                                      5
                                       20
25
45.4 Algorithm
      Draw a random map and attempt to discover an algorithm that will find the shortest route
      from one location to another. Compare your algorithm to those created by others. Which
      algorithms work? Which algorithms are efficient?
45.5 Extensions
      This problem is set as minimal distances between two points. But perhaps instead of
      distance we could use time or cost. And instead of a person travelling we could have
      couriers delivering packages, or electrical signals carrying phone calls. In fact, there are
      surprising uses as well including managing cutting stock in steel mills and finding optimal
      schedules for construction projects.
                    Chapter 46
46.1 Objectives
3. Observe: Any walk can be decomposed into at most one path and a collection of cycles.
Definition 46.2.1   A graph G is a pair (V, E) where V is a finite, nonempty set, and E is a set of unordered
     Graph          pairs of elements of V . The elements of V are called vertices and the elements of E called
                    edges.
                    It is often very useful to represent a graph as a drawing where vertices correspond to points
                    and edges correspond to lines between vertices. Graphs may be represented by more than
                    one diagram as illustrated in Example 1.
                                                                289
 290                                                                            Chapter 46          Paths, Walks, Cycles and Trees
E = {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 1}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}} .
                                                                                                       7
                                   1                    2
                           6                7                    3
                                                                         1          2           3           4      5        6
5 4
Definition 46.2.2    If edge e = {u, v}, then we say that u and v are adjacent vertices, and that edge e is
Adjacent, Incident   incident with vertices u and v. We can also say that the edge e joins u and v. Vertices
                     adjacent to a vertex u are called neighbours of u.
                     A graph is completely specified by the pairs of vertices that are adjacent, and the only
                     function of a line in the diagram is to indicate that two vertices are adjacent.
                     Since vi1 and vi uniquely determine an edge e of a walk, we will usually just list the
                     vertices. Thus
                                                 W = v0 , v1 , v2 , v3 , . . . , vn1 , vn .
Definition 46.2.4    If v0 = s and vn = t in the walk W , we call W an st-walk. If no vertex in the walk is
       Path          repeated, that is, if v0 , v1 , v2 , . . . , vn are all distinct, then W is called a path.
Definition 46.2.5    If v0 = vn and v0 , v1 , v2 , . . . , vn1 are all distinct, then W is called a cycle.
       Cycle
 Section 46.2   The Basics                                                                                          291
1 2
6 7 3
5 4
1 2
6 7 3
5 4
1 2
6 7 3
5 4
Definition 46.2.6      By a collection we mean a family of objects where repetition is allowed. Let W be an
    Collection,        st-walk. If s = t, we say that W can be decomposed into a collection C of cycles if, for
   Decomposed          every edge e the number of times e occurs in W is the same as the number of times e occurs
                       in cycles of C. If s 6= t, we say that W can be decomposed into an st-path P and a
                       collection C of cycles if, for every edge e the number of times e occurs in W is the same as
 292                                                                  Chapter 46   Paths, Walks, Cycles and Trees
                    You may wonder what the difference is between the definition of decomposition and the
                    proposition Walk Decomposition. The definition allows for the possibility that some walks
                    cannot be decomposed. The proposition states that all walks can be decomposed.
Definition 46.2.7   To say that a graph G is connected means that there is a path between any two vertices of
       Connected    G. We will assume for this course that all of our graphs are connected, though in general,
                    that is not a safe assumption.
46.3 Trees
1 2
6 7 3
5 4
                    We will prove several propositions about trees starting with this one.
Section 46.3   Trees                                                                                                293
                       We normally begin our proofs by explicitly identifying the hypothesis and the conclusion.
                       Unique Paths in Trees is not in If A, then B. form, so lets first restate it. Recall that
                       the hypothesis is what we get to start with, and the conclusion is what we must show. We
                       start with a tree. Call it T . We must show that there is a unique path between every pair
                       of vertices in T . Hence, we could restate Unique Paths in Trees as
                       Working forwards and backwards to prove this proposition will be problematic. So, its time
                       for a different technique, proof by contradiction. Normally, when we wish to prove that the
                       statement A implies B is true, we assume that A is true and show that B is true. What
                       would happen if B were true, but we assumed it was false and continued our reasoning
                       based on the assumption that B was false? Since a mathematical statement cannot be both
                       true and false, it seems likely we would eventually encounter a mathematically non-sensical
                       statement. Then we would ask ourselves How did we arrive at this nonsense? and the
                       answer would have to be that our assumption that B was false was wrong and B is, in fact,
                       true.
                       Proofs by contradiction have the following structure.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                         3. Now suppose that there are two distinct uv-paths, P1 = u, x1 , x2 , . . . , xn1 , v and
                            P2 = u, y1 , y2 , . . . , ym1 , v.
                         4. We can construct a walk W beginning with u and ending at u that consists of walk-
                            ing from u to v in P1 , then from v to u backwards in P2 . More specifically,
6. But then the tree T contains cycles, contradicting the definition of a tree.
      Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclu-
          sion.
            Hypothesis: T is a tree.
            Conclusion: There is a unique path between every pair of vertices in T .
            Core Proof Technique: Contradiction.
            Preliminary Material: Definition of tree.
      Sentence 3 Now suppose that there are two distinct uv-paths, P1 = u, x1 , x2 , . . . , xn1 , v
           and P2 = u, y1 , y2 , . . . , ym1 , v.
            The author is negating the conclusion and so is going to use one of two techniques,
            Contradiction or Contrapositive. Since the author hasnt indicated which, it is useful
            to look ahead in the proof to find out. The last sentence of the proof makes it clear
            that the author is using Contradiction.
      Sentence 4 We can construct a walk W beginning with u and ending at u that consists of
           walking from u to v in P1 , then from v to u backwards in P2 . More specifically,
Sentence 6 But then the tree T contains cycles, contradicting the definition of a tree.
Trees
47.1 Objectives
1. Define degree.
Definition 47.2.1   Let G be a graph. The number of edges incident with a vertex v is called the degree of v
     Degree         and is denoted by deg(v). In Figure 47.2.1, vertex a has degree 3 and vertex b has degree 2.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                      2. Since any edge in the tree constitutes a path, P must contain at least one edge so
                         u 6= v.
3. Thus, the vertex wn1 in the path is adjacent to v but distinct from v.
                                                                 295
296                                                                               Chapter 47   Trees
s i
                                                            f               b
                                            e
                                                                d
                                                    c
4. If deg(v) > 1, there must be another vertex, w, distinct from wn1 and adjacent to v.
        5. If w is in P , then a cycle would exist but trees do not have cycles. Hence, w is not in
           P.
        6. If w is not in P , then we could add edge {v, w} to P to get a path longer than P ,
           contradicting the assumption that P is a longest path in T .
7. Hence, deg(v) = 1.
      Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclu-
          sion.
                       Sentence 2 Since any edge in the tree constitutes a path, P must contain at least one edge
                            so u 6= v.
                             Given that the author intends to show that u and v are distinct vertices of degree one,
                             the author must first establish that u 6= v. Also, the following argument will require
                             that the path contain an edge.
                       Sentence 3 Thus, the vertex wn1 in the path is adjacent to v but distinct from v.
                             The author is setting up the contradiction, though it is not at all clear from here how
                             that contradiction will be displayed.
                       Sentence 4 If deg(v) > 1, there must be another vertex, w, distinct from wn1 and adja-
                            cent to to v.
                             From the analysis of the first sentence, the author intends to show that v has degree
                             one. That means this sentence indicates the author is going to proceed by contradic-
                             tion.
                       Sentence 5 If w is in P , then a cycle would exist but trees do not have cycles. Hence, w
                            is not in P .
                             This is a miniature proof by contradiction of the statement If deg(v) > 1 and w
                             is adjacent to v, then w is not in P . Sentence 5 begins with the negation of the
                             conclusion and finds a contradiction quickly. If w is in P , then the walk constructed
                             by taking the subpath from w to v in P and adding the edge {v, w} yields a cycle,
                             but trees do not contain cycles by definition.
                       Sentence 6 If w is not in P , then we could add edge {v, w} to P to get a path longer than
                            P , contradicting the assumption that P is a longest path in T .
                             This is another miniature proof by contradiction, this time of the statement If
                             deg(v) > 1 and w is adjacent to v, then w is in P .
                 Since V is an integer, we could consider all trees with one vertex, two vertices, three vertices
                 and so on, this seems like a perfect case for induction. Lets be very clear about what our
                 statement P (n) is.
Proof: Base Case We verify that P (1) is true where P (1) is the statement
                       This is equivalent to stating that |E| = 0. Since a tree with one vertex has no edges,
                       the base case is true.
                       By Two Vertices of Degree One, we know that there is at least one vertex of degree
                       one in T . Lets call such a vertex v. Since deg(v) = 1, v is adjacent to only one vertex,
                       say u. Deleting the vertex v and the edge {u, v} creates a new tree T 0 where T 0 has
                       k vertices and |E|  1 edges. By our Inductive Hypothesis therefore,
k = (|E| 1) + 1 k = |E|.
k + 1 = |E| + 1
                       as required.
                       The result is true for n = k +1, and so holds for all n by the Principle of Mathematical
                       Induction.
Chapter 48
Dijkstras Algorithm
48.1 Objectives
Lets look at a formal expression for solving the shortest path problem.
                                             299
300                                                                                                     Chapter 48   Dijkstras Algorithm
      We can think of the Require statement as the pre-conditions to the algorithm, or the
      hypothesis to a proposition. In this case, we require a graph with non-negative weights on
      the edges, and a starting vertex s. We can think of the Ensure statement as the post-
      conditions to the algorithm or the conclusion of a proposition. In this case, the algorithm
      should terminate with a tree of shortest paths rooted at s, and the distances of a shortest
      path from s to each node.
      Though our original problem talked about distances, the values we assign to the edges of
      the graph could also be time or capacity or costs. The convention is to call these values
      weights, which is why the function from the edges to the real numbers is named w.
      Lets watch the algorithm in operation. Our example appears in Figure 48.2.1.
                                                                                    3
                                                            s                                           a
                                                    1
                                                                    9                           2
                                            b                                       c
                                                            3
4 1
      The initialization steps of the algorithm set the distance to s at 0, and the provisional
      distances to all other vertices at infinity. By abuse of notation, we will treat infinity as a
      real number. We will record distances as numeric labels in blue near the vertices. The set
      V 0 initially contains only s and E 0 is empty. We will show the nodes in V 0 as bold circles
      and the edges in E 0 as bold lines. Note that at every stage of the algorithm, T 0 = (V 0 , E 0 )
      is a tree of shortest paths to the vertices in V 0 . See Figure 48.2.2
                                                                0                                           
                                                                                        3
                                                                s                                           a
                                                        1
                                                                        9                           2
                                               b                                       c   
                                                                3
4 1
      Now the algorithm examines each edge with one vertex in V 0 and one vertex not in V 0 . If
      using the edge creates a shorter path to a vertex not in V 0 , then the provisional distance to
Section 48.2   Dijkstras Algorithm                                                                                                     301
                       that vertex is updated. Figure 48.2.3 shows the results of the update. Edges and distances
                       involved in the updates are shown in green. The infinite values previously assigned to
                       vertices a, b and c have been crossed out.
                                                                               0
                                                                                                       3
                                                                               s                                           a       3
                                                                       1
                                                                                       9                           2
                                                      1       b                                       c       9
                                                                               3
4 1
                       Continuing with the update, choose the vertex not in V 0 with the smallest provisional
                       distance. In this iteration, the choice is b. Add b to V 0 and {s, b} to E 0 . This update is
                       shown in Figure 48.2.4. The nodes in V 0 are shown as bold circles and the edges in E 0 as
                       bold lines. Note that T 0 = (V 0 , E 0 ) is a tree of shortest paths to the vertices in V 0 .
                                                                                   0                                           3
                                                                                                           3
                                                                                   s                                           a
                                                                           1
                                                                                           9                           2
                                                           1       b                                       c   9
                                                                                   3
4 1
                                                    0                         3
                                                                 3
                                                    s                         a
                                                1
                                                         9                2
                                        1   b                    c   94
                                                    3
4 1
                                                    0                         3
                                                                 3
                                                    s                         a
                                                1
                                                         9                2
                                        1   b                    c   4
                                                    3
4 1
                                                    d
                                                    5
      continue. Again, the algorithm examines each edge with one vertex in V 0 and one vertex
      not in V 0 . If using the edge creates a shorter path to a vertex in V 0 , then the provisional
      distance to that vertex is updated. In this iteration, no updates to provisional distances
      took place. Figure 48.2.7 shows the results of the update. Edges and distances involved in
      the updates are shown in green.
                                                    0                         3
                                                                 3
                                                    s                         a
                                                1
                                                         9                2
                                        1   b                    c   4
                                                    3
4 1
                                                    d
                                                    5
                       Now choose the vertex not in V 0 with the smallest provisional distance. In this iteration,
                       the choice is c. Add c to V 0 and {b, c} to E 0 . This update is shown in Figure 48.2.8. Again,
                       note that T 0 = (V 0 , E 0 ) is a tree of shortest paths to the vertices in V 0 .
                                                                      0                       3
                                                                                  3
                                                                      s                       a
                                                                  1
                                                                          9               2
                                                          1   b                   c   4
                                                                      3
4 1
                                                                      d
                                                                      5
                                                                      0                       3
                                                                                  3
                                                                      s                       a
                                                                  1
                                                                          9               2
                                                          1   b                   c   4
                                                                      3
4 1
                                                                      d
                                                                      5
                       Now choose the vertex not in V 0 with the smallest provisional distance. In this iteration,
                       the choice is d. Add d to V 0 . But now both and {b, d} and {c, d} match the condition to be
                       added to E 0 . Which one should be added or should both be added? It is only necessary to
                       choose one, say {b, d}. This update is shown in Figure 49.3.1. Again, note that T 0 = (V 0 , E 0 )
                       is a tree of shortest paths to the vertices in V 0 .
                       Now, finally V = V 0 and the algorithm terminates.
304                                                                                       Chapter 48   Dijkstras Algorithm
                                                                  0                       3
                                                                              3
                                                                  s                       a
                                                              1
                                                                      9               2
                                                      1   b                   c   4
                                                                  3
4 1
                                                                  d
                                                                  5
      Exercise 1   Create a small random graph, say of 6 or 7 vertices, and run Dijkstras algorithm on your
                   graph.
                   Based on our experiments when we began this section, the example we did together, and
                   your own examples, it seems that we have lots of empirical evidence that Dijkstras algorithm
                   works. But evidence is not a proof. Moreover, if a colleague were to provide us with a graph,
                   edge weights and a proposed tree of shortest paths, it would be nice to have a certificate
                   of optimality. Simply running the algorithm again might reproduce an existing error in the
                   computer program that runs the algorithm.
                   Lets consider the two objects the algorithm is supposed to produce.
                   We wont prove that Dijkstras algorithm produces these two objects, though we will cer-
                   tainly think about it. In the next lecture we will prove a theorem that allows us to certify
                   that the output of Dijkstras algorithm is, in fact, correct.
                   Lets look at the algorithm more closely. Would we expect the algorithm to always produce
                   a tree? That is, is T 0 = (V 0 , E 0 ) a tree in every iteration? If there is some iteration where
                   a cycle is produced the T 0 is not a tree, and the end product will not be a tree because the
                   algorithm only adds edges. The algorithm never deletes edges.
                   The algorithm will have |V |1 iterations because we add a vertex to V 0 at each iteration and
                   V 0 begins with s. We also add an edge at each iteration so we end up with |V 0 | = |E 0 | + 1.
                   The proposition Number Of Vertices In A Tree is suggestive but not conclusive. It says
                   that for a tree T = (V, E), |V | = |E| + 1. It does not say that |V | = |E| + 1 implies that
                   the graph (V, E) is a tree.
                   Lets consider the construction of T 0 . A tree is defined as a connected graph with no cycles
                   so lets ask ourselves Can the algorithm create a cycle in T 0 ? Suppose that it did and the
Section 48.3   Certificate of Optimality                                                                           305
                       cycle occurred when the edge {u, v} was added. That means both u and v already had to
                       exist in V 0 , but the edge that is added always contains a vertex not in V 0 . Hence, no cycles
                       exist in T 0 . As for connectedness, this makes sense since, at each iteration an edge is added
                       to an already connected graph constructed in the previous iteration.
                       More problematic is guaranteeing that T 0 is a tree of shortest paths.
                       Lets look at d more closely. Suppose {u, v}  E 0 and the path in E 0 from s encounters u
                       before it encounters v. Then d(u) = d(v) + w({u, v}). That is not a surprise. That is how
                       the algorithm adds edges to E 0 . Now look at the exercise that you just completed. Examine
                       any edge at all in E, say {x, y}. My guess is that you will see d(y)  d(x) + w({x, y}).
                       This is what will help us generate a certificate of optimality.
Chapter 49
49.1 Objectives
  1. Define weight, distance potentials, feasible distance potentials, equality edges and tree
     of shortest paths.
Recall that a certificate consists of a theorem and data. If the data satisfy the hypothesis
of the theorem, the theorem guarantees that the desired property holds.
The data will be a tree T and a function d : V  R, exactly what is produced by Dijkstras
algorithm. Our task is to find a theorem that will say If the data satisfy a certain property,
then
                                             306
 Section 49.3   Weighted Graphs                                                                               307
                       Suppose that G = (V, E) is a connected graph with weights w : E  R. Let us also suppose
                       that w({u, v})  0, for every edge of E.
Definition 49.3.1      Let W = v0 v1 v2 . . . vn be a walk in G. We define the weight of W to be the sum of the
 Weight of a Walk      weights of all arcs in W . If the edge {u, v} occurs more than once in W , its weight is
                       counted for each occurrence in W . More formally,
                                                                     n1
                                                                     X
                                                          w(W ) =          w({vi , vi+1 })
                                                                     i=0
                       We have been using this definition implicitly. The distance of a trip from downtown Toronto
                       to Sibbald Point Provincial Park is the sum of the distances of each part of the trip.
                       Dijkstras algorithm also uses this definition implicitly.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                       Analysis of Proof As usual, we will begin by explicitly identifying the hypothesis and
                           the conclusion.
                                   Quantifier:        
                                   Variable:          A path P
                                   Domain:            All paths in G = (V, E)
                                   Open sentence:     w(P )  w(W )
                             The author must construct an st-path P and does so using Part 3 of Proposition Walk
                             Decomposition. The author will now show that w(P )  w(W ).
                       Sentence 2 Now
                                                                              r
                                                                              X
                                                           w(W ) = w(P ) +          w(Ci ).
                                                                              i=1
                       The proof is very simple and relies very heavily on the fact that w(Ci )  0 for all i =
                       1, 2, 3, . . . , r. What if the hypothesis non-negative real weights were simply non-negative
                       real weights?
       Exercise 1      Show the necessity of non-negative in the hypothesis of a Path Shorter Than A Walk.
                       That is, find a counter-example to the statement:
                       Let G = (V, E) be a connected graph with non-negative real weights. Let W be an st-walk
                       with s 6= t. Then there exists an st-path with w(P )  w(W ).
                       You might argue that this is irrelevant because you never encounter negative distances.
                       This may be true of distances, but this is not true of costs. Subsidies and rebates do, in
                       fact, create negative cost edges in models.
Definition 49.3.2      Let G = (V, E) be a connected graph with non-negative weights w : E  R and d : V  R.
Potentials, Equality   The components of d are called distance potentials. We say that distance potentials are
      Edges            feasible when
                                                d(u) + w({u, v})  d(v) for all uv  E.
                       Edges for which d(u) + w({u, v}) = d(v) are called equality edges.
Section 49.3   Weighted Graphs                                                                                            309
Proof: (For reference, each sentence of the proof is written on a separate line.)
                        4. This simplifies to
                                                               d(v0 ) + w(W )  d(vk )
                           or
                                                                w(W )  d(t)  d(s).
                        5. Moreover, w(W )  d(t)d(s) if and only if every inequality above holds with equality,
                           that is, every edge in W is an equality edge.
                      Before we examine the proof, lets see how the theorem works as part of the certificate. Re-
                      call the tree and function d that resulted from our example of running Dijkstras algorithm.
310                                                         Chapter 49           Certificate of Optimality - Path
                                                    0                        3
                                                                 3
                                                    s                        a
                                                1
                                                        9                2
                                       1    b                    c   4
                                                    3
4 1
                                                    d
                                                    5
      The dark edges indicate the tree and the blue labels adjacent to the vertices give d. Observe
      the sd-path P = sbd. All of the hypotheses of Certificate of Optimality for a Path are
      satisfied. G is a connected graph with non-negative weights. A vertex s has been designated.
      P = sbd is an sd-path. By examining each edge of G we can confirm that d are feasible
      distance potentials. By examining each edge of P we can confirm that every edge of P is an
      equality edge. Hence, by the Certificate of Optimality for a Path, P is a shortest sd-path.
      Now to the proof.
Proof: (For reference, each sentence of the proof is written on a separate line.)
        1. By the first part of the conclusion of Feasible Potentials, every st-walk has weight at
           least w(t)  w(s).
2. By the second part of the conclusion of Feasible Potentials, w(P ) = w(t) w(s).
        3. Since the weight of every walk W is bounded below by w(t)  w(s), and P is a path
           that achieves that bound, P must be a shortest st-path.
      Analysis of Proof We will begin by explicitly identifying the hypothesis and the conclu-
          sion.
                      Sentence 1 By the first part of the conclusion of Feasible Potentials, every st-walk has
                           weight at least w(t)  w(s).
                           Since is is a form of the existential quantifier, the hypothesis P is an st-path allows
                           the author to assume the existence of P . What the author must show is not that
                           P exists, or that P is an st-path, but rather that P is a shortest st-path. The first
                           sentence of the proof places an upper bound on w(P ).
                      Sentence 2 By the second part of the conclusion of Feasible Potentials, w(P ) = w(t)w(s).
                           The hypotheses of the current theorem include There exist feasible distance potentials
                           d : V  R such that every edge of P is an equality edge. The existential quantifier in
                           this hypothesis allows the author to assume the existence of feasible distance potentials
                           and equality edges. These are needed to invoke Feasible Potentials.
                      Sentence 3 Since the weight of every walk W is bounded below by w(t)  w(s), and P is
                           a path that achieves that bound, P must be a shortest st-path.
                           Since no walk, and hence no path, can be shorter than w(t)  w(s), and w(P ) =
                           w(t)  w(s), P must be a shortest st-path.
Proof: (For reference purposes, each sentence of the proof is written on a separate line.)
                        1. By contradiction, suppose that d are not feasible distance potentials. Then there
                           exists {u, v}  E such that d(u) + w({u, v}) < d(v).
3. Consider the walk W constructed by appending the edge {u, v} to the path P .
4. By a Path Shorter Than A Walk, there exists an sv-path P 0 with w(P 0 ) w(W ).
5. But w(W ) = w(P ) + w({u, v}) = d(u) + w({u, v}) < d(v).
                        6. But then w(P 0 ) < d(v) so d(v) cannot be the length of a shortest sv-path, a contra-
                           diction.
Now we show that the converse of the certificate of optimality for paths also holds.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                    1. Let d : V  R be defined as the length of a shortest path from s to v for all vertices in
                       V . By Shortest Paths Give Feasible Potentials, these are feasible distance potentials.
3. But then Feasible Potentials implies that every edge of P is an equality edge.
                  Together, the theorem on the optimality of paths (Certificate of Optimality for Paths)
                  and the existence of feasible distance potentials (Feasible Distance Potentials and Equality
                  Edges) gives
                  We have dealt so far with paths, but Dijkstras algorithm produces a tree, not a path.
                  Fortunately, similar theorems hold.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                    1. Let us assume that there exist feasible distance potentials such that every edge of T
                       is an equality edge.
                  The proposition Trees of Shortest Paths requires a spanning tree, feasible potentials and
                  equality arcs. How do we know that these exist?
Section 49.4   Certificate of Optimality - Tree                                                                    313
Proof: (For reference, each sentence of the proof is written on a separate line.)
1. For every node v V , let P (v) be a shortest st-path in G and let d(v) = w(P (v)).
                          2. Since d(v) is the length of a shortest path to v, Shortest Paths Give Feasible Potentials,
                             tells us that d is a set of feasible distance potentials.
                          3. We know from Feasible Distance Potentials and Equality Edges that every edge in
                             a shortest sv-path is an equality arc. So, every edge of P (v) is an equality edge for
                             every v  V .
                          4. Let                                         [
                                                                  E0 =         P (v).
                                                                         vV
                          6. But then Trees of Shortest Paths applies and T is a tree of shortest paths rooted at
                             s.
            Part IX
               314
                    Chapter 50
Introduction to Primes
50.1 Objectives
The second problem that the course focuses on is Fermats Last Theorem.
xn + y n = z n
                    To make progress on this problem, we need to work with prime numbers. Recall our
                    definition of prime number.
Definition 50.2.1   An integer p > 1 is called a prime if its only divisors are 1 and p, and composite otherwise.
 Prime, Composite
                                                                   315
316                                                                               Chapter 50   Introduction to Primes
                  We have already proved three propositions about primes, one of which is a consequence of
                  Coprimeness and Divisibility, and the other two were proved in the chapter on contradiction.
50.3 Induction
Base Cases Verify that P (1), P (2), . . . , P (b) are all true.
                  Inductive Conclusion Using the assumption that P (1), P (2), . . . , P (k) are true,
                      show that P (k + 1) is true.
Section 50.4   Fundamental Theorem of Arithmetic                                                                317
Proof: Base Case We verify P (2). Recall that the base case does not need to start at 1.
This is trivially true a prime written by itself is a product with one factor.
                      In grade school you used prime numbers to write the prime factorization of any positive
                      integer greater than one. You probably never worried about the possibility that there might
                      be more than one way to do this. However, in some sets prime factorization is not unique.
                                                                                            
                      Consider the set S = {a + b 5 | a, b  Z}. In S, the
                                                                         number 4 = 4 + 0 5 can be factored
                                                                                                           
                      in two different ways, 4 = 2  2 and 4 = ( 5 + 1)( 5  1). Moreover, 2, 5 + 1 and 5  1
                      are all prime numbers in S!
                      Since multiplication in the integers is commutative, the prime factorizations can be written
                      in any order. For example 12 = 2  2  3 = 2  3  2 = 3  2  2. However, up to the
                      order of the factors, the factorization of integers is unique. This property is so basic it is
                      referred to as the Fundamental Theorem of Arithmetic. It is also referred to as the Unique
                      Factorization Theorem.
318                                                                                    Chapter 50   Introduction to Primes
Proof: (For reference, each sentence of the proof is written on a separate line.)
                    1. That n can be written as a product of prime factors follows from the proposition
                       Prime Factorization.
n = p1 p2 . . . pk = q1 q2 . . . q` (50.1)
3. Since p1 | n, p1 | q1 q2 . . . q` .
                    4. By repeatedly applying the proposition Primes and Divisibility, p1 must divide one of
                       the qs. If necessary, rearrange the qs so that p1 | q1 .
p2 p3 . . . pk = q2 q3 . . . q` (50.2)
                    7. By continuing in this way, we see that each p must be paired off with one of the qs
                       until there are no factors on either side.
                    8. Hence k = ` and, apart from the order of the factors, the two expressions for n are
                       the same.
                  Lets perform an analysis of the proof. As usual, we begin with the hypothesis and the
                  conclusion.
                      Sentence 1 That n can be written as a product of prime factors follows from the proposition
                           Prime Factorization.
                            The first of the two parts of the conclusion is just the conclusion of a previous propo-
                            sition.
n = p1 p2 . . . pk = q1 q2 . . . q`
p2 p3 . . . pk = q2 q3 . . . q`
                            By continuing in this way, we see that each p must be paired off with one of the qs
                            until there are no factors on either side.
                            This continues the authors plan of showing that the two representations of n are
                            equal by showing that they have identical factors.
                      Sentence 8 Hence k = ` and, apart from the order of the factors, the two expressions for
                           n are the same.
                            This is a typical conclusion to the Uniqueness Method. The two representations of
                            the same object are identical.
                      The previous proposition does not provide an algorithm for finding the prime factors of a
                      positive integer n. The next proposition shows that we do not have to check all of the prime
                      factors less than n, only those less than or equal to the square root of n.
Proof: (For reference, each sentence of the proof is written on a separate line.)
                  Analysis of Proof Since or appears in the conclusion, we will use Proof By Elimination.
                      The equivalent statement that is proved is:
                            If n is an integer greater than 1 and n is not prime, then n contains a prime
                                                          
                            factor less than or equal to n.
                       The word a should alert us to the presence of an existential quantifier. We could
                       reword the statement as
                            If n is an integer greater than 1 and n is not prime, then there exists a
                                                                            
                            prime factor of n which is less than or equal to n.
                       This is the statement that will actually be proved.
                      Sentence 3 Since n is composite we can write n = ab where a and b are integers such that
                           1 < a, b < n.
                            By the hypotheses of the restated proposition, n > 1 and n is not prime, so n is
                            composite and can be factored.
                      The next proposition, which we will state but not prove, gives us a means to list all of the
                      divisors of a positive integer. A proof is available in the Appendix. [Incomplete: Add
                      proof.]
72 = 23 32
                                                 20 30 = 1 21 30 = 2 22 30 = 4 23 30 = 8
                                                 20 31 = 3 21 31 = 6 22 31 = 12 23 31 = 24
                                                 20 32 = 9 21 32 = 18 22 32 = 36 23 32 = 72
      Exercise 1      Using Divisors From Prime Factorization, list all of the positive factors of 45.
322                                                                                          Chapter 50   Introduction to Primes
Exercise 2 How many positive divisors are there to the integer a whose prime factorization is
a = p1 1 p2 2 pk k
                   Though this method works well enough on small examples, it is much slower than the
                   Extended Euclidean Algorithm for computing gcds.
Exercise 4 Use the definition of gcd to prove GCD From Prime Factorization.
Solution:
(a)
                                                                12936 = 23 31 72 111
                                                                16380 = 22 51 32 71 131
50.8 Problems
                          2. Let n >= 0. What is the power of 2 in the prime factorization of (2n )! ? Prove that
                             you have the correct value.
                          3. Note that k divides n! + k for each k <= n. Use this fact to show that, for all positive
                             integers m, there exist consecutive primes which are at least m apart.
Chapter 51
51.1 Objectives
  2. Define gcd(x, y, z), trivial solutions, Pythagorean triple and primitive Pythagorean
     triple.
Pierre de Fermat (1601 (?)  1635) was a brilliant French mathematician. It was his habit
to make notes in the margins of his books and one such note is famous. Fermat possessed
a copy of Bachets translation of Diophantus Arithmetica. Problem II.8 of the Arithmetica
reads
Diophantus did not require the squares to be integers so we might write Problem II.8 as
x2 + y 2 = z 2
satisfied?
                                           324
 Section 51.2   History of Fermats Last Theorem                                                                  325
                       Adjacent to Problem II.8, and in the margin of his copy of Arithmetica, Fermat wrote
                       (translated)
                             It is impossible to separate a cube into two cubes, or a fourth power into two
                             fourth powers, or in general, any power higher than the second, into two like
                             powers. I have discovered a truly marvellous proof of this, which this margin is
                             too narrow to contain.
                       No proof was ever published by Fermat, or found among his notes after his death. It seems
                       very unlikely that he did have a proof and it was not until Andrew Wiles publications in
                       1994 that the Theorem, conjecture really, was proved. Fermat did prove the case n = 4, as
                       we shall do.
                       First though, we will clarify our language. Clearly there are solutions to xn + y n = z n . One
                       solution is x = y = z = 0, another solution is x = 0, y = z.
Definition 51.2.1      We will say that any solution to xn + y n = z n for which at least one of x, y or z is zero, is
      Trivial          trivial.
x2 + y 2 = z 2 (51.1)
                       You will recognize this as the equation of the Pythagorean Theorem. Our task is to identify
                       all positive integer solutions to Equation 51.1.
 326                                                          Chapter 51     Introduction to Fermats Last Theorem
Definition 51.3.1    A Pythagorean triple is an ordered triple of non-zero integers (x, y, z) such that
Pythagorean Triple   x2 + y 2 = z 2 .
Definition 51.3.2    Let a, b and c be integers, not all zero. An integer d > 0 is the greatest common divisor
 Greatest Common     of a, b and c, written gcd(a, b, c), if and only if
      Divisor
2. if e | a and e | b and e | c then e d (this captures the greatest part of the definition).
Example 1 Both (6, 8, 10) and (3, 4, 5) are Pythagorean triples. However
       Example 2     (6, 8, 10) is a Pythagorean triple since 62 +82 = 102 . Since gcd(6, 8, 10) = 2, by the Multiples
                     of Pythagorean Triples, (3, 4, 5) is a Pythagorean triple.
                     Also, if (3, 4, 5) is a Pythagorean triple, then (3d, 4d, 5d) is a Pythagorean triple.
Section 51.3   Pythagorean Triples                                                                                  327
                      This is a simple if and only if proof that can be proved using a chain of if and only if
                      statements.
                      Proof:
                                     (x, y, z) is a Pythagorean triple
                                x2 + y 2 = z 2                                 (defn of Pythagorean triple)
                                     x2    y2    z2
                                    + 2 = 2                                                   (divide by d2 )
                                  d2     d      d
                                x21 + y12 = z12                                                (substitution)
                                (x1 , y1 , z1 ) is a Pythagorean triple        (defn of Pythagorean triple)
                      Take ten minutes to prove the following proposition and then compare your proof with the
                      proof that follows.
                      Proof: We will show that gcd(x, y) = 1. The other pairs are similar. Suppose to the
                      contrary that gcd(x, y) = d > 1. Then there exists a prime p so that p | d. Since p | x and
                      p | y, p | (x2 + y 2 ) by the Divisibility of Integer Combinations. Since x2 + y 2 = z 2 , p | z 2
                      and so p | z by Primes and Divisibility. But then gcd(x, y, z)  p > 1 which contradicts the
                      hypothesis that (x, y, z) is a primitive Pythagorean triple.
                      The next proposition identifies a very simple but useful attribute of primitive Pythagorean
                      triples.
                      First, notice that this implies that z is odd. (Why?) Second, lets check this against our
                      experience.
                         2. The Pythagorean triple (6, 8, 10) has no odd elements, but the proposition does not
                            apply to the Pythagorean triple (6, 8, 10) since it is not primitive.
3. In the primitive Pythagorean triple (8, 15, 17), 8 is even and 15 is odd.
Proof: (For reference, each sentence of the proof is written on a separate line.)
        1. We will proceed by contradiction using two cases: x and y are both even, and x and
           y are both odd.
2. Consider the first case. Suppose that x and y are both even.
4. Consider the second case. Suppose that x and y are both odd.
z 2 = x2 + y 2 2 (mod 4)
        6. But this is impossible since the square of any integer can only be congruent to 0 or 1
           modulo 4.
        7. Since the two integers cannot both be even or odd, exactly one must be even and one
           must be odd.
      As usual, we will begin our analysis by identifying the hypothesis, conclusion, core proof
      techniques and preliminary material.
      Core Proof Technique: There are only three possible cases: x and y are both even, x and
          y are both odd or x and y have opposite parity. The first two cases will be eliminated
          leaving the third as the only possible outcome. Each of the first two cases is dealt with
          using contradiction. The use of contradiction several times within a proof is common.
      Sentence 1. We will proceed by contradiction eliminating two cases: x and y are both even,
           and x and y are both odd.
           The author indicates the plan of the proof, always a good idea. There are only three
           possible cases: x and y are both even, x and y are both odd or x and y have opposite
           parity. The author will disprove the first two cases using contradiction, hence by
           elimination leaving only opposite parity.
      Sentence 2. Consider the first case. Suppose that x and y are both even.
           This sentence begins the first of the two embedded proofs by contradiction.
Section 51.3   Pythagorean Triples                                                                              329
                      Sentence 4. Consider the second case. Suppose that x and y are both odd.
                            This sentence begins the second of the two embedded proofs by contradiction.
Sentence 5. This implies that x2 1 (mod 4) and y 2 1 (mod 4) which in turn implies
z 2 = x2 + y 2 2 (mod 4)
                      Sentence 6. But this is impossible since the square of any integer can only be congruent
                           to 0 or 1 modulo 4.
                            This part of proof is quite different from the earlier part. Since any odd integer a can
                            be written in the form 2t + 1, a2 has the form 4t2 + 4t + 1 which is congruent to
                            1 (mod 4). Thus z 2 = x2 + y 2  1 + 1  2 (mod 4). But how could this be? If z were
                            odd, z 2  1 (mod 4), and if z were even, z 2  0 (mod 4).
                      Sentence 7. Since the two integers cannot both be even or odd, exactly one must be even
                           and one must be odd.
                            Since the cases of x and y both even or x and y both odd have been eliminated, all
                            that remains is that x and y have opposite parity.
                      REMARK
                      If (x, y, z) is a Pythagorean triple, we will assume as a convention that x is even and y is
                      odd.
                      We conclude with a small proposition that is very useful. The proof appears in the Ap-
                      pendix.
     Example 4        Consider 592, 704 which is just 843 . With n = 3, c = 84, a = 64 and b = 9261, the
                      hypotheses of the proposition are satisfied. Hence, there exist integers a1 and b1 so that
                      a = 64 = an1 and b = 9261 = bn1 . So a1 = 4 and b1 = 21, and 43 213 = 843 .
                      Notice that our choice of a and b satisfied gcd(a, b) = 1. With a = 8 = 23 and b = 74088 =
                      423 , even though ab = cn is still true, the proposition does not apply since gcd(a, b) 6= 1
            Chapter 52
            Characterization of Pythagorean
            Triples
52.1 Objectives
            We are now able to characterize all non-trivial, primitive Pythagorean triples. The proof
            in this section follows that done by David Burton in Elementary Number Theory, Seventh
            Edition.
x2 + y 2 = z 2
is given by
                                                    x = 2st
                                                     y = s2  t2
                                                     z = s2 + t2
for integers s > t > 0 such that gcd(s, t) = 1 and s 6 t (mod 2).
            Lets understand what the theorem is saying. Every choice of s and t satisfying integers
            s > t > 0 such that gcd(s, t) = 1 and s 6 t (mod 2) does produce a non-trivial, primitive
            Pythagorean triple and these are the only non-trivial, primitive Pythagorean triples.
                                                         330
Section 52.2   Pythagorean Triples                                                                              331
                      The table below lists some primitive Pythagorean triples arising from small values of s and
                      t.
                                                       s    t     x         y          z
                                                                2st   s2  t2    s2 + t2
                                                       2    1     4         3          5
                                                       3    2    12         5        13
                                                       4    1     8       15         17
                                                       4    3    24         7        25
                                                       5    2    20       21         29
                                                       5    4    40         9        41
                      Before we read the proof, lets do some analysis. The expression complete set obviously
                      indicates that we are working with sets. So, the first step is to identify which sets are used
                      and what their relationship is.
                      One set is the collection of primitive Pythagorean triples and can be defined by
S = {(x, y, z) | x, y, z N, x2 + y 2 = z 2 , gcd(x, y, z) = 1, 2 | x}
                                           T = {(x, y, z) |x, y, z  N, s, t  N,
                                                            x = 2st, y = s2  t2 , z = s2 + t2 ,
                                                            s > t, gcd(s, t) = 1, s 6 t   (mod 2)}
2. where each of the elements that define set membership are satisfied,
                         3. where each of the elements that define set membership are used.
332                                          Chapter 52     Characterization of Pythagorean Triples
      Proof: Let (x, y, z) be a primitive Pythagorean triple. Since x is even and y and z are odd,
      z  y and z + y are even. Suppose z  y = 2u and z + y = 2v. Then
                                             zy         z+y
                                        u=       and v =
                                              2           2
      and
                                         v  u = y and v + u = z
      and the equation x2 + y 2 = z 2 may be rewritten as
x2 = z 2 y 2 = (z y)(z + y)
      We claim that gcd(u, v) = 1. Suppose this were not so and gcd(u, v) = d > 1. Then
      d | (v  u) and d | (v + u). But v  u = y and v + u = z so d | y and d | z which contradicts
      the fact that y and z are relatively prime. Now we can use our proposition on Decomposing
      n-th Powers to conclude that u and v are perfect squares. Hence, for some natural numbers
      s and t
                                                  u = t2
                                                   v = s2
                                  z = v + u = s2 + t2
                                  y = v  u = s2  t2
                                 x2 = (z  y)(z + y) = 4s2 t2  x = 2st
      We can safely assume s > t, otherwise we simply switch values. We claim that gcd(s, t) = 1.
      If d > 1 were a common factor of s and t, d would be a common factor of y and z
      contradicting the fact that gcd(y, z) = 1. Finally, if s and t are both even or both odd, then
      y and z are even, a contradiction. Hence, exactly one of s and t is odd, the other is even.
      Symbolically, s 6 t (mod 2).
      Conversely, let the natural numbers s and t satisfy s > t, gcd(s, t) = 1, s 6 t (mod 2).
      Using the provided formulas for x, y and z we have
53.1 Objectives
53.2 n=4
            Having completely resolved the case of Pythagorean triples, we can now turn our attention
            to the one instance of FLT proved by Fermat. Actually, we will prove a slightly stronger
            result and the case n = 4 will follow as a corollary. The approach in this section mostly
            follows Elementary Number Theory, Seventh Edition by David Burton.
                                                        333
334                                                              Chapter 53       Fermats Theorem for n = 4
        3. Using the Characterization of Pythagorean Triples the author finds various algebraic
           expressions involving s and t.
        4. The author uses these algebraic expressions to construct another non-trivial primitive
           Pythagorean triple.
      But that means that x20 , y02 and z0 are non-trivial primitive solutions of a2 + b2 = c2 so we
      can make use of the Characterization of Pythagorean Triples. In particular, we know that
      one of x20 and y02 is even. We can assume that x20 is even, hence x0 is even, and that there
      exist integers s and t so that s > t > 0 and gcd(s, t) = 1 and s 6 t (mod 2) satisfying
                                                   x20 = 2st
                                                   y02 = s2  t2
                                                   z0 = s2 + t2
      Since s 6 t (mod 2), exactly one of s and t are even. Suppose s is even and t is odd. Now
      consider the equation y02 = s2  t2 modulo 4. Because y02 is odd,
                                                                         t = 2uv
                                                                     y0 = u2  v 2
                                                                         s = u2 + v 2
                      and so
                                                                     z12 = x41 + y14
                      That is, x1 , y1 , z1 is a solution to x4 + y 4 = z 2 . Since z1 and t are positive
                      That is,
                                                                          z1 < z0
                      But recall that x0 , y0 , z0 is a solution to x4 + y 4 = z 2 with the smallest possible value of z.
                      But x1 , y1 , z1 is a solution to x4 + y 4 = z 2 with a smaller value of z!
                      We have just seen that this equation has no positive integer solution.
336                                                                 Chapter 53   Fermats Theorem for n = 4
                  In the second case, n = pk for some k  1 and the equation xn + y n = z n can be rewritten
                  as                                p  p  p
                                                    xk + y k = z k
xp + y p = z p
53.4 History
54.1 Objectives
54.2 x4 y 4 = z 2
                Proof: Suppose that there exists a non-trivial solution to x4 y 4 = z 2 . Of all such solutions
                x0 , y0 , z0 , choose any one in which x0 is smallest. Choosing x0 as small as possible forces
                x0 to be odd. (Why?)
                We now show that we can also assume that gcd(x0 , y0 ) = 1. Suppose gcd(x0 , y0 ) = d > 1.
                Then writing dx1 = x0 and dy1 = y0 and substituting into x4  y 4 = z 2 we get d4 (x41  y14 ) =
                z02 . So d4 | z02 , hence d2 | z0 . Thus z0 = d2 z1 for some integer z1 . But then
                then                                                2           2
                                                      z02 + y02          = x20
                                                                   337
338                                                             Chapter 54      Problems Related to FLT
      and we see that (z0 , y02 , x20 ) constitute a primitive Pythagorean triple.
      From here there are two cases: y0 odd and y0 even. Consider the case where y0 is odd. The
      Characterization of Pythagorean Triples asserts that there exist integers s and t so that
      s > t > 0 and gcd(s, t) = 1 and s 6 t (mod 2) satisfying
x20 = s2 + t2
      Observe that
                               s4  t4 = (s2 + t2 )(s2  t2 ) = x20 y02 = (x0 y0 )2
      so s, t, x0 y0 is a positive solution to x4  y 4 = z 2 . But
                                                    p
                                            0 < s < s2 + t2 = x0
      Because of the symmetry of expressions for s and t, we may assume that s is even and t is
      odd. Consider the relation
                                              y02 = 2st
      Since gcd(s, t) = 1 and s is even, we know that gcd(2s, t) = 1. This allows us to invoke the
      proposition on Decomposing n-th Powers. That is, 2s and t are each squares of positive
      integers, say 2s = w2 and t = v 2 . Because w must be even, set w = 2u to get s = 2u2 .
      Therefore
                                         x20 = s2 + t2 = 4u4 + v 4
      and so (2u2 , v 2 , x0 ) form a Pythagorean triple. Since gcd(2u2 , v 2 ) = gcd(s, t) = 1,
      gcd(2u2 , v 2 , x0 ) = 1 and so the Pythagorean triple is primitive. The Characterization
      of Pythagorean Triples asserts that there exist integers a and b so that a > b > 0 and
      gcd(a, b) = 1 and a 6 b (mod 2) satisfying
                                                  2u2 = 2ab
                                                   v 2 = a2  b2
                                                   x0 = a2 + b2
      Now 2u2 = 2ab implies u2 = ab which implies, by the proposition on Decomposing n-th
      Powers, that a and b are perfect squares. Say a = c2 and b = d2 . And here we use a pattern
      we have seen before. Since
                                         v 2 = a2  b2 = c4  d4
      c, d, v is a positive integer solution to x4  y 4 = z 2 . But
                                                 
                                         0 < c = a < a2 + b2 = x0
 Section 54.3   Pythagorean Triangles                                                                              339
                       This proposition has an unexpected use in a statement about the areas of Pythagorean
                       triangles.
Definition 54.3.1      A Pythagorean triangle is a right triangle whose sides are of integral length.
   Pythagorean
     Triangle
                       The familiar 3  4  5 triangle is an example of a Pythagorean triangle. In the margin of
                       his copy of Diophantus Arithmetica, Fermat stated and proved a proposition equivalent to
                       the following.
Proposition 2 The area of a Pythagorean triangle can never be equal to a perfect square.
x2 + y 2 = z 2 (54.1)
                       The area of 4ABC is (1/2)xy and if this were a square we could write (1/2)xy = u2 . This
                       gives
                                                             2xy = 4u2                                   (54.2)
                       Now Equation (54.1) plus Equation (54.2) gives
                       or                                            2
                                                          x2  y 2        = z 4  (2u)4
                       But we know by our proposition on the Squares From the Difference of Quartics that no
                       non-trivial solution to this equation is possible, hence a contradiction.
Chapter 55
55.1 Objectives
This class provides an opportunity to practice working with primes and non-linear Dio-
phantine Equations.
55.2 Practice
  1. (Burton, Elementary Number Theory) From the examples we have done in class, it
     may seem that all non-linear Diophantine equations have no non-trivial solutions.
     This is not so, as the following example demonstrates.
  2. Joseph Louis Lagrange (1736  1813) was a brilliant French mathematician who
     worked mostly in the 18th century. He worked on the Sum of Squares problem, that
     is: What is the smallest value of n such that every positive integer can be written as
     the sum of not more than n squares?
                                             340
Section 55.2   Practice                                                                                         341
                                                                     n2  1      n2 + 1
                                                                                         
                                                                            , n,
                                                                        2           2
                                  is a Pythagorean triple.
                             (b) If n  3 is an even integer, then
                                                                     n2      n2
                                                                                  
                                                                  n,     1,    +1
                                                                     4       4
                                  is a Pythagorean triple.
                              (c) If n  2 (mod 4), then there is no primitive Pythagorean triple (x, y, z) in which
                                  x or y equals n.
                             (d) If n 6 2 (mod 4), then there is a primitive Pythagorean triple (x, y, z) in which
                                 x or y equals n.
                              (e) For all integers n  3, there is a Pythagorean triple (not necessarily primitive)
                                  having n as one of its members.
                          5. For each of the following statements, determine whether the statement is true or false.
                             For true statements give a proof. For false statements, give a counter-example.
                          6. Let a < b < c, where a  N and b and c are odd primes. Prove that if a | (3b + 2c) and
                             a | (2b + 3c) then a = 1 or a = 5. Give examples to show that both of these values
                             for a are possible.
                Chapter 56
Appendix
Proof: Without loss of generality, we may assume that a > 1 and b > 1. If
                are the prime factorizations of a and b, then no px can occur among the qy otherwise the
                gcd(a, b) > 1. As a result, the prime factorization of ab is
                This implies that each px and qy equals some uh and that the corresponding exponents are
                equal. That is kx = nlh (or jy = nlh ). This implies that all of the exponents of the px and
                qy are divisible by n. Thus, we can choose
                                                                k /n k /n
                                                       a = p1 1 p2 2             pkr r /n
                                                                j /n j /n
                                                       b = q11 q22               qsjs /n
342