Contemporary Abstract Algebra Textbooks in Mathematics Series editors: Al Boggess, Kenneth H. Rosen Mathematical Modeling in the Age of the Pandemic William P. Fox Linear Algebra James R. Kirkwood, Bessie H. Kirkwood Real Analysis With Proof Strategies Daniel W. Cunningham Train Your Brain Challenging Yet Elementary Mathematics Bogumil Kaminski, Pawel Pralat Contemporary Abstract Algebra, Tenth Edition Joseph A. Gallian Geometry and Its Applications Walter J. Meyer Linear Algebra What You Need to Know Hugo J. Woerdeman Introduction to Real Analysis, 3rd Edition Manfred Stoll Discovering Dynamical Systems Through Experiment and Inquiry Thomas LoFaro, Jeff Ford Functional Linear Algebra Hannah Robbins Introduction to Financial Mathematics With Computer Applications Donald R. Chambers, Qin Lu Linear Algebra An Inquiry-based Approach Jeff Suzuki Contemporary Abstract Algebra TENTH EDITION Joseph A. Gallian University of Minnesota Duluth Cover image by John Stembridge 2-dimensional representation of E8 Lie group First edition published 1986 D. C. Heath and Company 6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742 and by CRC Press 2 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN 10th edition © 2021 Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, LLC Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, access www.copyright.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. For works that are not available on CCC please contact HYPERLINK “mailto:mpkbookspermissions@tandf.co.uk” mpkbookspermissions@tandf.co.uk Trademark notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging‑in‑Publication Data ISBN: 978-0-367-65178-7 (hbk) ISBN: 978-1-003-14233-1 (ebk) Typeset in Computer Modern font by KnowledgeWorks Global Ltd. To Char, Krissy, and Joey Contents Notations Preface xiii xvii 0 Preliminaries 1 Properties of Integers 1 | Modular Arithmetic 5 | Complex Numbers 10 | Mathematical Induction 12 | Equivalence Relations 15 | Functions (Mappings) 18 Exercises 21 1 Introduction to Groups 27 Symmetries of a Square 27 | The Dihedral Groups 30 Biography of Niels Abel 38 2 Groups 39 Definition and Examples of Groups 39 | Elementary Properties of Groups 47 | Historical Note 50 Exercises 52 3 Finite Groups; Subgroups 59 Terminology and Notation 59 | Subgroup Tests 61 | Examples of Subgroups 64 Exercises 69 4 Cyclic Groups 77 Properties of Cyclic Groups 77 | Classification of Subgroups of Cyclic Groups 83 Biography of James Joseph Sylvester 96 5 Permutation Groups 97 Definitions and Notation 97 | Cycle Notation 100 | Properties of Permutations 103 | A Check-Digit Scheme Based on D5 115 vii viii Contents Biography of Augustin Cauchy 125 Biography of Alan Turing 126 6 Isomorphisms 127 Motivation 127 | Definition and Examples 127 | Properties of Isomorphisms 131 | Automorphisms 134 | Cayley’s Theorem 138 Exercises 141 Biography of Arthur Cayley 147 7 Cosets and Lagrange’s Theorem 149 Properties of Cosets 149 | Lagrange’s Theorem and Consequences 153 | An Application of Cosets to Permutation Groups 158 | The Rotation Group of a Cube and a Soccer Ball 160 | An Application of Cosets to the Rubik’s Cube 163 Exercises 163 Biography of Joseph Lagrange 170 8 External Direct Products 171 Definition and Examples 171 | Properties of External Direct Products 173 | The Group of Units Modulo n as an External Direct Product 176 | Applications 178 Exercises 184 Biography of Leonard Adleman 191 9 Normal Subgroups and Factor Groups 193 Normal Subgroups 193 | Factor Groups 196 | Applications of Factor Groups 200 | Internal Direct Products 203 Exercises 209 Biography of Évariste Galois 204 10 Group Homomorphisms 219 Definition and Examples 219 | Properties of Homomorphisms 221 | The First Isomorphism Theorem 225 Exercises 232 Biography of Camille Jordan 239 11 Fundamental Theorem of Finite Abelian Groups 241 The Fundamental Theorem 241 | The Isomorphism Classes of Abelian Groups 242 | Proof of the Fundamental Theorem 246 Exercises 249 Contents 12 Introduction to Rings ix 255 Motivation and Definition 255 | Examples of Rings 256 | Properties of Rings 257 | Subrings 259 Exercises 261 Biography of I. N. Herstein 266 13 Integral Domains 267 Definition and Examples 267 | Fields 268 | Characteristic of a Ring 271 Exercises 273 14 Ideals and Factor Rings 279 Ideals 279 | Factor Rings 280 | Prime Ideals and Maximal Ideals 284 Exercises 286 Biography of Richard Dedekind 293 Biography of Emmy Noether 294 15 Ring Homomorphisms 295 Definition and Examples 295 | Properties of Ring Homomorphisms 298 | The Field of Quotients 301 Exercises 303 16 Polynomial Rings 311 Notation and Terminology 311 | The Division Algorithm and Consequences 314 Exercises 319 17 Factorization of Polynomials 325 Reducibility Tests 325 | Irreducibility Tests 328 | Unique Factorization in Z[x] 334 | Weird Dice: An Application of Unique Factorization 335 Exercises 338 Biography of Serge Lang 342 18 Divisibility in Integral Domains 343 Irreducibles, Primes 343 | Historical Discussion of Fermat’s Last Theorem 346 | Unique Factorization Domains 350 | Euclidean Domains 353 Exercises 356 Biography of Sophie Germain 361 x Contents Biography of Andrew Wiles 362 Biography of Pierre de Fermat 363 19 Extension Fields 365 The Fundamental Theorem of Field Theory 365 | Splitting Fields 367 | Zeros of an Irreducible Polynomial 374 Exercises 379 Biography of Leopold Kronecker 383 20 Algebraic Extensions 385 Characterization of Extensions 385 | Finite Extensions 387 | Properties of Algebraic Extensions 392 Exercises 394 Biography of Ernst Steinitz 400 21 Finite Fields 401 Classification of Finite Fields 401 | Structure of Finite Fields 402 | Subfields of a Finite Field 408 Exercises 410 Biography of L. E. Dickson 416 Biography of E. H. Moore 417 22 Geometric Constructions 419 Historical Discussion of Geometric Constructions 419 | Constructible Numbers 420 | Angle-Trisectors and CircleSquarers 422 Exercises 423 23 Sylow Theorems 427 Conjugacy Classes 427 | The Class Equation 428 | The Sylow Theorems 430 | Applications of Sylow Theorems 436 Exercises 440 Biography of Ludwig Sylow 445 24 Finite Simple Groups 447 Historical Background 447 | Nonsimplicity Tests 453 | The Simplicity of A5 458 | The Fields Medal 460 | The Cole Prize 461 Exercises 461 Biography of Michael Aschbacher 464 Biography of Daniel Gorenstein 465 Biography of John Thompson 466 Contents 25 Generators and Relations xi 467 Motivation 467 | Definitions and Notation 468 | Free Group 469 | Generators and Relations 471 | Classification of Groups of Order Up to 15 475 | Characterization of Dihedral Groups 476 Exercises 479 Biography of Marshall Hall, Jr. 482 26 Symmetry Groups 483 Isometries 483 | Classification of Finite Plane Symmetry Groups 485 | Classification of Finite Groups of Rotations in R3 487 Exercises 488 27 Symmetry and Counting 491 Motivation 491 | Burnside’s Theorem 492 | Applications 494 | Group Action 498 Exercises 499 Biography of William Burnside 501 28 Cayley Digraphs of Groups 503 Motivation 503 | The Cayley Digraph of a Group 503 | Hamiltonian Circuits and Paths 507 | Some Applications 514 Exercises 518 Biography of William Rowan Hamilton 522 Biography of Paul Erdős 523 29 Introduction to Algebraic Coding Theory 525 Motivation 525 | Linear Codes 530 | Parity-Check Matrix Decoding 536 | Coset Decoding 539 | Historical Note 543 Exercises 546 Biography of Richard W. Hamming 551 Biography of Jessie MacWilliams 552 Biography of Vera Pless 553 30 An Introduction to Galois Theory 555 Fundamental Theorem of Galois Theory 555 | Solvability of Polynomials by Radicals 562 | Insolvability of a Quintic 568 Exercises 569 xii Contents 31 Cyclotomic Extensions 573 Motivation 573 | Cyclotomic Polynomials 574 | The Constructible Regular n-gons 579 Exercises 581 Biography of Carl Friedrich Gauss 583 Biography of Manjul Bhargava 584 Selected Answers Index 629 585 Notations SET THEORY SPECIAL SETS FUNCTIONS AND ARITHMETIC ALGEBRAIC SYSTEMS ∩i∈I Si ∪i∈I Si [a] |s| intersection of sets Si , i ∈ I union of sets Si , i ∈ I {x ∈ S|x ∼ a}, equivalence class of S containing a, 16 number of elements in the set of S Z Q Q+ F∗ R R+ C integers, additive groups of integers, ring of integers rational numbers, field of rational numbers multiplicative group of positive rational numbers set of nonzero elements of F real numbers, field of real numbers multiplicative group of positive real numbers complex numbers f −1 t|s t-s gcd(a, b) lcm(a, b) |a + b| φ(a) φ:A→B gf, αβ inverse of the function f t divides s, 1 t does not divide s, 1 greatest common divisor of the integers a and b, 3 least common multiple of the integers a and b, 5 √ a2 + b2 , 10 image of a under φ, 19 mapping of A to B, 19 composite function, 19 D4 Dn e Zn det A U (n) dihedral group of order, 29 dihedral group of order 2n, 30 identity element, 40 group {0, 1, . . . , n−1} under addition modulo n, 41 the determinant of A, 42 group of units modulo n (that is, the set of integers less than n and relatively prime to n under multiplication modulo n), 43 xiii xiv Notations Rn SL(2, F ) GL(2, F ) g −1 −g |G| |g| H≤G H<G hai hSi Z(G) C(a) C(H) φ(n) Sn An G≈G φa Aut(G) Inn(G) aH aHa−1 |G : H| HK stabG (i) orbG (i) G1 ⊕ G2 ⊕ · · · ⊕ Gn Uk (n) H /G G/H H ×K H1 × H2 × · · · × Hn Ker φ φ−1 (g 0 ) φ−1 (K) Z[x] M2 (Z) R1 ⊕ R2 ⊕ · · · ⊕ Rn nZ Z[i] U (R) {(a1 , a2 , . . . , an )|a1 , a2 , . . . , an ∈ R}, 45 group of 2 × 2 matrices over F with determinant 1, 45 2 × 2 matrices of nonzero determinants with coefficients from the field F (the general linear group), 46 multiplicative inverse of g, 49 additive inverse of g, 49 order of the group G, 59 order of the element g, 59 subgroup inclusion, 60 subgroup H 6= G, 61 {an |n ∈ Z}, cyclic group generated by a, 64 subgroup generated by the set S, 66 {a ∈ G|ax = xa for all x in G}, the center of G, 67 {g ∈ G|ga = ag}, the centralizer of a in G, 68 {x ∈ G|xh = hx for all h ∈ H}, the centralizer of H, 72 Euler phi function of n, 86 group of one-to-one functions from {1, 2, . . . , n} to itself, 99 alternating group of degree n, 110 G and G are isomorphic, 128 mapping given by φa (x) = axa−1 for all x, 135 group of automorphisms of the group G, 135 group of inner automorphisms of G, 135 {ah|h ∈ H}, 149 {aha−1 |h ∈ H}, 149 the index of H in G, 154 {hk|h ∈ H, k ∈ K}, 156 {φ ∈ G|φ(i) = i}, the stabilizer of i under the permutation group G, 158 {φ(i)|φ ∈ G}, the orbit of i under the permutation group G, 158 external direct product of groups G1 , G2 , . . . , Gn , 171 {x ∈ U (n)|x mod k = 1}, 176 H is a normal subgroup of G, 193 factor group, 196 internal direct product of H and K, 203 internal direct product of H1 , . . . , Hn , 205 kernel of the homomorphism φ, 220 inverse image of g 0 under φ, 221 inverse image of K under φ, 222 ring of polynomials with integer coefficients, 256 ring of all 2 × 2 matrices with integer entries, 256 direct sum of rings, 257 ring of multiples of n, 259 ring of Gaussian integers, 260 group of units of the ring R, 262 Notations char R hai ha1 , a2 , . . . , an i R/A A+B AB Ann(A) N (A) F (x) R[x] deg f (x) Φp (x) F (a1 , a2 , . . . , an ) f 0 (x) [E:F ] GF(pn ) GF(pn )∗ cl(a) np W (S) ha1 , a2 , . . . , an |w1 = w2 = · · · = wt i Q4 Q6 D∞ fix(φ) Cay(S : G) k ∗ (a, b, . . . , c) (n, k) Fn d(u, v) wt(u) Gal(E/F ) EH Φn (x) xv characteristic of R, 271 principal ideal generated by a, 280 ideal generated by a1 , a2 , . . . , an , 280 factor ring, 280 sum of ideals A and B, 287 product of ideals A and B, 287 annihilator of A, 291 nil radical of A, 291 field of quotients of F [x], 302 ring of polynomials over R, 311 degree of the polynomial, 313 pth cyclotomic polynomial, 330 extension of F by a1 , a2 , . . . , an , 367 the derivative of f (x), 374 degree of E over F, 387 Galois field of order pn , 402 nonzero elements of GF(pn ), 403 {xax−1 |x ∈ G}, the conjugacy class of a, 427 the number of Sylow p-subgroups of a group, 434 set of all words from S, 468 group with generators a1 , a2 , . . . , an and relations w1 = w2 = . . . = wt , 471 quarternions, 476 dicyclic group of order 12, 476 infinite dihedral group, 476 {i ∈ S|φ(i) = i}, elements fixed by φ, 493 Cayley digraph of the group G with generating set S, 503 concatenation of k copies of (a, b, . . . , c), 511 linear code, k -dimensional subspace of F n , 530 F ⊕ F ⊕ · · · ⊕ F , direct product of n copies of the field F, 530 Hamming distance between vectors u and v, 531 the number of nonzero components of the vector u (the Hamming weight of u), 531 the automorphism group of E fixing F, 556 fixed field of H, 556 nth cyclotomic polynomial, 574 Preface Set your pace to a stroll. Stop whenever you want. Interrupt, jump back and forth, I won’t mind. This book should be as easy as laughter. It is stuffed with small things to take away. Please help yourself. Willis Goth Regier, In Praise of Flattery, 2007 Although I wrote the first edition of this book more than thirty years ago, my goals for it remain the same. I want students to receive a solid introduction to the traditional topics. I want readers to come away with the view that abstract algebra is a contemporary subject–that its concepts and methodologies are being used by working mathematicians, computer scientists, physicists, and chemists. I want students to see the connections between abstract algebra and number theory and geometry. I want students to be able to do computations and to write proofs. I want students to enjoy reading the book. And I want to convey to the reader my enthusiasm for this beautiful subject. Educational research has shown that an effective way of learning mathematics is to interweave worked-out examples and practice problems. Thus, I have made examples and exercises the heart of the book. The examples elucidate the definitions, theorems, and proof techniques. The exercises facilitate understanding, provide insight, and develop the ability of the students to do proofs. There is a large number of exercises ranging from straightforward to difficult and enough at each level so that instructors have plenty to choose from that are most appropriate for their students. The exercises often foreshadow definitions, concepts, and theorems to come. Many exercises focus on special cases and ask the reader to generalize. Generalizing is a skill that students should develop but rarely do. Even if an instructor chooses not to spend class time on the applications in the book, I feel that having them there demonstrates to students the utility of the theory. xvii xviii Preface Changes for the tenth edition include new exercises, new examples, new quotes, and a freshening of the discussion portions. These changes accentuate and enhance the hallmark features that have made previous editions of the book a comprehensive, lively, and engaging introduction to the subject: • Extensive coverage of groups, rings, and fields, plus a variety of non-traditional special topics • A good mixture of approximately 1900 computational and theoretical exercises appearing in each chapter that synthesize concepts from multiple chapters • Back-of-the-book skeleton solutions and hints to the oddnumbered exercises • Approximately 300 worked-out examples ranging from routine computations to quite challenging • Computer exercises that utilize interactive software available on my website that stress guessing and making conjectures • Many of applications from scientific and computing fields, as well as some from everyday life • Numerous historical notes and biographies that spotlight the people and events behind the mathematics • Motivational and humorous quotations • Hundreds of figures, photographs, and tables The Student Solutions Manual (ISBN: 9780367766801) is available from CRC Press. It has detailed solutions for all oddnumbered exercises and a large number of even-numbered exercises. Instructor resources are available from CRC Press for qualified adopters. Please go to https://www.routledge.com/ Contemporary-Abstract-Algebra/Gallian/p/book/9780367651787. The website www.d.umn.edu/∼jgallian also offers a wealth of additional online resources supporting the book, including: • True/false questions with comments • Flash cards • Essays on learning abstract algebra, doing proofs, and reasons why abstract algebra is a valuable subject to learn • Links to abstract algebra-related websites and software packages and much, much more. I wish to express my gratitude to Robert Ross for the opportunity to publish this edition with CRC Press. I am greatly indebted to Shahriyar Roshan Zamir, Shashi Kumar, and Scott Martin for creating the LaTex files for this edition. John Stembridge kindly granted permission to use his spectacular image of the simple Lie group E8 on the cover. 0 Preliminaries When we see it [modular arithmetic] for the first time, it looks so abstract that it seems impossible something like this could have any real-world applications. Edward Frenkel, Love and Math: The Heart of Hidden Reality The whole of science is nothing more than a refinement of everyday thinking. Albert Einstein, Physics and Reality Properties of Integers It should not come as a surprise that much of abstract algebra involves properties of integers and sets. In this chapter we collect the properties we need for future reference. An important property of the integers, which we will often use, is the so-called Well Ordering Principle. Since this property cannot be proved from the usual properties of arithmetic, we will take it as an axiom. Well Ordering Principle Every nonempty set of positive integers contains a smallest member. The concept of divisibility plays a fundamental role in the theory of numbers. We say a nonzero integer t is a divisor of an integer s if there is an integer u such that s = tu. In this case, we write t | s (read “t divides s”). When t is not a divisor of s, we write t - s. A prime is a positive integer greater than 1 whose only positive divisors are 1 and itself. We say an integer s is a multiple of an integer t if there is an integer u such that s = tu or, equivalently, if t is a divisor of s. 1 2 Integers and Equivalence Relations As our first application of the Well Ordering Principle, we establish a fundamental property of integers that we will use often. Theorem 0.1 Division Algorithm Let a and b be integers with b > 0. Then there exist unique integers q and r with the property that a = bq + r, where 0 ≤ r < b. We begin with the existence portion of the theorem. Consider the set S = {a − bk | k is an integer and a − bk ≥ 0}. If 0 ∈ S, then b divides a and we may obtain the desired result with q = a/b and r = 0. Now assume 0 ∈ / S. Since S is nonempty [if a > 0, a − b · 0 ∈ S; if a < 0, a − b(2a) = a(1 − 2b) ∈ S; a 6= 0 since 0 ∈ / S], we may apply the Well Ordering Principle to conclude that S has a smallest member, say r = a − bq. Then a = bq + r and r ≥ 0, so all that remains to be proved is that r < b. If r ≥ b, then a − b(q + 1) = a − bq − b = r − b ≥ 0, so that a − b(q + 1) ∈ S. But a − b(q + 1) < a − bq, and a − bq is the smallest member of S. So, r < b. To establish the uniqueness of q and r, let us suppose that there are integers q, q 0 , r, and r0 such that PROOF a = bq + r, 0 ≤ r < b, and a = bq 0 + r0 , 0 ≤ r0 < b. For convenience, we may also suppose that r0 ≥ r. Then bq + r = bq 0 + r0 and b(q − q 0 ) = r0 − r. So, b divides r0 − r and 0 ≤ r0 − r ≤ r0 < b. It follows that r0 − r = 0, and therefore r0 = r and q = q 0 . The integer q in the division algorithm is called the quotient upon dividing a by b; the integer r is called the remainder upon dividing a by b. EXAMPLE 1 For a = 17 and b = 5, the division algorithm gives 17 = 5 · 3 + 2; for a = −23 and b = 6, the division algorithm gives −23 = 6(−4) + 1. There are many instances in this book where there are integers a and b and we will want to show that a is divisible by b. In such cases it is usually best to proceed by writing a = bq + r, where 0 ≤ r < b and use properties of a and b to show that r = 0. The proof of Theorem 0.2 is one such instance. 0 | Preliminaries 3 Definitions Greatest Common Divisor, Relatively Prime Integers The greatest common divisor of two nonzero integers a and b is the largest of all common divisors of a and b. We denote this integer by gcd(a, b). When gcd(a, b) = 1, we say a and b are relatively prime. The following property of the greatest common divisor of two integers plays a critical role in abstract algebra. The proof provides an application of the division algorithm and our second application of the Well Ordering Principle. Theorem 0.2 GCD is a Linear Combination For any nonzero integers a and b, there exist integers s and t such that gcd(a, b) = as + bt. Moreover, gcd(a, b) is the smallest positive integer of the form as + bt. PROOF Consider the set S = {am + bn | m, n are integers and am + bn > 0}. Since S is obviously nonempty (if some choice of m and n makes am + bn < 0, then replace m and n by −m and −n), the Well Ordering Principle asserts that S has a smallest member, say, d = as + bt. We claim that d = gcd(a, b). To verify this claim, use the division algorithm to write a = dq + r, where 0 ≤ r < d. If r > 0, then r = a − dq = a − (as + bt)q = a − asq − btq = a(1 − sq) + b(−tq) ∈ S, contradicting the fact that d is the smallest member of S. So, r = 0 and d divides a. Analogously (or, better yet, by symmetry), d divides b as well. This proves that d is a common divisor of a and b. Now suppose d0 is another common divisor of a and b and write a = d0 h and b = d0 k. Then d = as + bt = (d0 h)s + (d0 k)t = d0 (hs + kt), so that d0 is a divisor of d. Thus, among all common divisors of a and b, d is the greatest. The special case of Theorem 0.2 when a and b are relatively prime is so important in abstract algebra that we single it out as a corollary. Corollary Integers a and b are relatively prime if and only if there exist integers s and t such that as + bt = 1. 4 Integers and Equivalence Relations EXAMPLE 2 gcd(4, 15) = 1; gcd(4, 10) = 2; gcd(22 · 32 · 5, 2 · 33 · 72 ) = 2 · 32 . Note that 4 and 15 are relatively prime, whereas 4 and 10 are not. Also, 4 · 4 + 15(−1) = 1 and 4(−2) + 10 · 1 = 2. The corollary of Theorem 0.2 provides a convenient method to show that two integers represented by polynomial expressions are relatively prime. EXAMPLE 3 For any integer n the integers n + 1 and n2 + n + 1 are relatively prime. To verify this we observe that n2 + n + 1 − n(n + 1) = 1. The next lemma is frequently used. It appeared in Euclid’s Elements. Euclid’s Lemma p | ab Implies p | a or p | b Lemma 0.1 If p is a prime that divides ab, then p divides a or p divides b. PROOF Suppose p is a prime that divides ab but does not divide a. We must show that p divides b. Since p does not divide a, there are integers s and t such that 1 = as+pt. Then b = abs+ptb, and since p divides the right-hand side of this equation, p also divides b. Note that Euclid’s Lemma may fail when p is not a prime, since 6 | (4 · 3) but 6 - 4 and 6 - 3. Why are primes important? Our next property shows that the primes are the building blocks for all integers. We will often use this property without explicitly saying so. Theorem 0.3 Fundamental Theorem of Arithmetic Every integer greater than 1 is a prime or a product of primes. This product is unique, except for the order in which the factors appear. That is, if n = p1 p2 · · · pr and n = q1 q2 · · · qs , where the p’s and q’s are primes, then r = s and, after renumbering the q’s, we have pi = qi for all i. We will prove the existence portion of Theorem 0.3 later in this chapter (Example 14). The uniqueness portion is a consequence of Euclid’s Lemma (Exercise 31). Here is a fun application of Theorem 0.3. 0 | Preliminaries EXAMPLE 4√ Let n be any integer greater than 1, 5 √ n 2 is irrational. For if 2 = a/b where a and b are integers, and a/b is in lowest terms, then an = 2bn . By Theorem 0.3 we know 2 divides a, say a = 2c. Then 2n cn = 2bn and therefore 2n−1 cn = bn . But this implies that 2 divides b. This contradicts our assumption that a/b was in lowest terms. n Another concept that frequently arises is that of the least common multiple of two integers. Definition Least Common Multiple The least common multiple of two nonzero integers a and b is the smallest positive integer that is a multiple of both a and b. We will denote this integer by lcm(a, b). We leave it as an exercise (Exercise 10) to prove that every common multiple of a and b is a multiple of lcm(a, b). EXAMPLE 5 lcm(4, 6) = 12; lcm(4, 8) = 8; lcm(10, 12) = 60; lcm(6, 5) = 30; lcm(22 · 32 · 5, 2 · 33 · 72 ) = 22 · 33 · 5 · 72 . Modular Arithmetic Another application of the division algorithm that will be important to us is modular arithmetic. Modular arithmetic is an abstraction of a method of counting that you often use. For example, if it is now September, what month will it be 25 months from now? Of course, the answer is October, but the interesting fact is that you didn’t arrive at the answer by starting with September and counting off 25 months. Instead, without even thinking about it, you simply observed that 25 = 2 · 12 + 1, and you added 1 month to September. Similarly, if it is now Wednesday, you know that in 23 days it will be Friday. This time, you arrived at your answer by noting that 23 = 7 · 3 + 2, so you added 2 days to Wednesday instead of counting off 23 days. If your electricity is off for 26 hours, you must advance your clock 2 hours, since 26 = 2 · 12 + 2. Surprisingly, this simple idea has numerous important applications in mathematics and computer science. You will see a few of them in this section. We shall see many more in later chapters. The following notation is convenient. When a = qn + r, where q is the quotient and r is the remainder upon dividing a by n, we 6 Integers and Equivalence Relations write a mod n = r. Thus, 3 mod 2 = 1 since 3 = 1 · 2 + 1, 6 mod 2 = 0 since 6 = 3 · 2 + 0, 11 mod 3 = 2 since 11 = 3 · 3 + 2, 62 mod 85 = 62 since 62 = 0 · 85 + 62, −2 mod 15 = 13 since − 2 = (−1)15 + 13. In general, if a and b are integers and n is a positive integer, then a mod n = b mod n if and only if n divides a − b (Exercise 9). In our applications, we will use addition and multiplication mod n. When you wish to compute ab mod n or (a + b) mod n, and a or b is greater than n, it is easier to “mod first.” For example, to compute (27 · 36) mod 11, we note that 27 mod 11 = 5 and 36 mod 11 = 3, so (27 · 36) mod 11 = (5 · 3) mod 11 = 4. (See Exercise 11.) Modular arithmetic is often used in assigning an extra digit to identification numbers for the purpose of detecting forgery or errors. We present two such applications. EXAMPLE 6 The United States Postal Service money order shown in Figure 0.1 has an identification number consisting of 10 digits together with an extra digit called a check. The check digit is the 10-digit number modulo 9. Thus, the number 3953988164 has the check digit 2, since 3953988164 mod 9 = 2.1 If the number 39539881642 were incorrectly entered into a computer (programmed to calculate the check digit) as, say, 39559881642 (an error in the fourth position), the machine would calculate the check digit as 4, whereas the entered check digit would be 2. Thus, the error would be detected. The method used by the Postal Service does not detect all single-digit errors (see Exercise 41). However, detection of all 1 The value of N mod 9 is easy to compute with a calculator. If N = 9q + r, where r is the remainder upon dividing N by 9, then on a calculator screen N ÷ 9 appears as q.rrrrr . . ., so the first decimal digit is the check digit. For example, 3953988164 ÷ 9 = 439332018.222, so 2 is the check digit. If N has too many digits for your calculator, replace N by the sum of its digits and divide that number by 9. Thus, 3953988164 mod 9 = 56 mod 9 = 2. The value of 3953988164 mod 9 can also be computed by searching Google for “3953988164 mod 9.” 0 | Preliminaries 7 Figure 0.1 Postal money order. single-digit errors, as well as nearly all errors involving the transposition of two adjacent digits, is easily achieved. One method that does this is the one used to assign the so-called Universal Product Code (UPC) to most retail items (see Figure 0.2). A UPC identification number has 12 digits. The first six digits identify the manufacturer, the next five identify the product, and the last is a check. (For many items, the 12th digit is not printed, but it is always bar-coded.) In Figure 0.2, the check digit is 8. Figure 0.2 UPC bar code. To explain how the check digit is calculated, it is convenient to introduce the dot product notation for two k -tuples: (a1 , a2 , . . . , ak ) · (w1 , w2 , . . . , wk ) = a1 w1 + a2 w2 + · · · + ak wk . An item with the UPC identification number a1 a2 · · · a12 satisfies the condition (a1 , a2 , . . . , a12 ) · (3, 1, 3, 1, . . . , 3, 1) mod 10 = 0. 8 Integers and Equivalence Relations To verify that the number in Figure 0.2 satisfies this condition, we calculate (0 · 3 + 2 · 1 + 1 · 3 + 0 · 1 + 0 · 3 + 0 · 1 + 6 · 3 + 5 · 1 + 8 · 3 + 9 · 1 + 7 · 3 + 8 · 1) mod 10 = 90 mod 10 = 0. The fixed k -tuple used in the calculation of check digits is called the weighting vector. Now suppose a single error is made in entering the number in Figure 0.2 into a computer. Say, for instance, that 021000958978 is entered (notice that the seventh digit is incorrect). Then the computer calculates 0·3+2·1+1·3+0·1+0·3+0·1+9·3 + 5 · 1 + 8 · 3 + 9 · 1 + 7 · 3 + 8 · 1 = 99. Since 99 mod 10 6= 0, the entered number cannot be correct. In general, any single error will result in a sum that is not 0 modulo 10. The advantage of the UPC scheme is that it will detect nearly all errors involving the transposition of two adjacent digits as well as all errors involving one digit. For doubters, let us say that the identification number given in Figure 0.2 is entered as 021000658798. Notice that the last two digits preceding the check digit have been transposed. But by calculating the dot product, we obtain 94 mod 10 6= 0, so we have detected an error. In fact, the only undetected transposition errors of adjacent digits a and b are those where |a − b| = 5. To verify this, we observe that a transposition error of the form a1 a2 · · · ai ai+1 · · · a12 → a1 a2 · · · ai+1 ai · · · a12 is undetected if and only if (a1 , a2 , . . . , ai+1 , ai , . . . , a12 ) · (3, 1, 3, 1, . . . , 3, 1) mod 10 = 0. That is, the error is undetected if and only if (a1 , a2 , . . . , ai+1 , ai , . . . , a12 ) · (3, 1, 3, 1, . . . , 3, 1) mod 10 = (a1 , a2 , . . . , ai , ai+1 , . . . , a12 ) · (3, 1, 3, 1, . . . , 3, 1) mod 10. This equality simplifies to either (3ai+1 + ai ) mod 10 = (3ai + ai+1 ) mod 10 0 | Preliminaries 9 or (ai+1 + 3ai ) mod 10 = (ai + 3ai+1 ) mod 10, depending on whether i is even or odd. Both cases reduce to 2(ai+1 − ai ) mod 10 = 0. It follows that |ai+1 − ai | = 5, if ai+1 6= ai . In 2005, United States companies began to phase in the use of a 13th digit to be in conformance with the 13-digit product identification numbers used in Europe. The weighting vector for 13-digit numbers is (1, 3, 1, 3, . . . , 3, 1). Identification numbers printed on bank checks (on the bottom left between the two colons) consist of an eight-digit number a1 a2 · · · a8 and a check digit a9 , so that (a1 , a2 , . . . , a9 ) · (7, 3, 9, 7, 3, 9, 7, 3, 9) mod 10 = 0. As is the case for the UPC scheme, this method detects all single-digit errors and all errors involving the transposition of adjacent digits a and b except when |a − b| = 5. But it also detects most errors of the form · · · abc · · · → · · · cba · · · , whereas the UPC method detects no errors of this form. In Chapter 5, we will examine more sophisticated means of assigning check digits to numbers. Modular arithmetic is often used to verify the validity of statements about divisibility regarding all positive integers by checking only finitely many cases. EXAMPLE 7 Consider the statement, “The sum of the cubes of any three consecutive integers is divisible by 9.” This statement is equivalent to checking that the equation (n3 + (n + 1)3 + (n + 2)3 ) mod 9 = 0 is true for all integers n. Because of properties of modular arithmetic, to prove this, all we need to do is check the validity of the equation for n = 0, 1, . . . , 8. You do the math. Modular arithmetic is occasionally used to show that certain equations have no rational number solutions. EXAMPLE 8 We use mod 4 arithmetic to show that there are no integers x and y such that x2 − y 2 = 1002. To see this, suppose that there are such integers. Then, taking both sides modulo 4, there is an integer solution to x2 − y 2 mod 4 = 2. Note that for any integer n, if n mod 4 = 0 or 2, then n2 mod 4 = 0 and if n mod 4 = 1 or 3 mod 4, then n2 mod 4 = 1. But then the only 10 Integers and Equivalence Relations differences of squares of integers modulo 4 are 0, 1, and −1 = 3, which gives a contradiction. At the dawn of the 20th century no one would have thought that strings of 0s and 1s added modulo 2 would provide the underpinning for a revolution in business, industry, technology, and science. The next example is an application of mod 2 arithmetic to circuit design. More applications of mod 2 arithmetic are given in later chapters. EXAMPLE 9 Logic Gates In electronics a logic gate is a device that accepts as inputs two possible states (on or off) and produces one output (on or off). This can be conveniently modeled using 0 and 1 and modulo 2 arithmetic. The AND gate outputs 1 if and only if both inputs are 1; the OR (inclusive or) gate outputs 1 if at least one input is 1; the XOR (exclusive or) outputs 1 if and only if exactly one input is 1; MAJ (majority) takes three inputs and outputs 1 if and only if at least two inputs are 1. These and others can be conveniently modeled as functions using 0 and 1 and modulo 2 arithmetic as follows: x AND y xy x OR y x + y + xy x XOR y x+y MAJ(x, y, z) xz + xy + yz. Complex Numbers Recall√ that complex numbers C are expressions of the √ form a + b −1, where a and b are real numbers. The number −1 √ 2 is defined to have √ the property −1 = −1. It is customary to use i to denote −1. Then, i2 = −1. Complex numbers written in the form a + bi are said to be in standard form. In some instances it is convenient to write a complex number a + bi in another form. To do this we represent a + bi as the point (a, b) in a plane coordinatized by a horizontal axis called the real axis and a vertical i axis called the imaginary axis . The distance from the point a + bi √ to the origin is r = a2 + b2 and is often denoted by |a + bi| and called the norm of a+bi. If we draw the line segment from the origin to a + bi and denote the angle formed by the line segment and the positive real axis by θ, we can write a + bi as r(cos θ + i sin θ). 0 | Preliminaries 11 This form of a + bi is called the polar form. An advantage of the polar form is demonstrated in parts 5 and 6 of Theorem 0.4. Theorem 0.4 Properties of Complex Numbers 1. Closure under addition: (a + bi) + (c + di) = (a + c) + (b + d)i 2. Closure under multiplication: (a + bi)(c + di) = (ac) + (ad)i + (bc)i + (bd)i2 = (ac − bd) + (ad + bc)i (a + bi) 3. Closure under division: (c + di 6= 0) : (c + di) (a + bi) (c − di) (ac + bd) + (bc − ad)i = = = (c + di) (c − di) c2 + d2 (ac + bd) (bc − ad) + 2 i 2 2 c +d c + d2 4. Complex conjugation: (a + bi)(a − bi) = a2 + b2 5. Inverses: For every nonzero complex number a + bi there is a complex number c + di such that (a + bi)(c + di) = 1 (i.e., (a + bi)−1 exists in C). 6. Powers: For every complex number a + bi = r(cos θ + i sin θ) and every positive integer n, we have (a+bi)n = (r(cos θ + i sin θ))n = r n (cos n θ + i sin n θ). 7. nth -roots of a + bi: For any positive integer n the n distinct nth roots of a + bi = r(cos θ + i sin θ) are √ θ+2πk n r(cos n + i sin θ+2πk ) for k = 0, 1, . . . n − 1. n PROOF Parts 1 and 2 are definitions. Part 4 follows from part 2. Part 6 is proved in Example 15 in the next section of this chapter. Part 7 follows from part 6. The next two examples illustrate properties of complex numbers. EXAMPLE 10 (3 + 5i) + (−5 + 2i) = −2 + 7i; (3 + 5i)(−5 + 2i) = −25 + (−19)i = −25 − 19i; 3 + 5i 3 + 5i −2 − 7i 29 − 31i 29 −31 = = = + i; −2 + 7i −2 + 7i −2 − 7i 53 53 53 (3 + 5i)(3 − 5i) = 9 + 25 = 34; 3 5 (3 + 5i)−1 = − i. 34 34 12 Integers and Equivalence Relations EXAMPLE 11 (−1 + √ i)4 = √ 3π 3π 2 cos + i sin 4 4 4 = 4 · 3π 4 · 3π = 4(cos 3π + i sin 3π) = −4. + i sin 4 4 π π The three cube roots of i = cos + i sin are 2 2 √ π π 3 1 cos + i sin = + i 6 6 2 2 √ π 2π π 2π 3 1 cos + i sin =− + + + i 6 3 6 3 2 2 π 4π π 4π + + i sin + = −i. cos 6 3 6 3 24 cos Mathematical Induction There are two forms of proof by mathematical induction that we will use. Both are equivalent to the Well Ordering Principle. The explicit formulation of the method of mathematical induction came in the 16th century. Francisco Maurolico (1494–1575), a teacher of Galileo, used it in 1575 to prove that 1 + 3 + 5 + · · · + (2n − 1) = n2 , and Blaise Pascal (1623–1662) used it when he presented what we now call Pascal’s triangle for the coefficients of the binomial expansion. The term mathematical induction was coined by Augustus De Morgan. Theorem 0.5 First Principle of Mathematical Induction Let S be a set of integers containing a. Suppose S has the property that whenever some integer n ≥ a belongs to S, then the integer n + 1 also belongs to S. Then, S contains every integer greater than or equal to a. PROOF The proof is left as an exercise (Exercise 33). So, to use induction to prove that a statement involving positive integers is true for every positive integer, we must first verify that the statement is true for the integer 1. We then assume the statement is true for the integer n and use this assumption to prove that the statement is true for the integer n + 1. Our next example uses some facts about plane geometry. Recall that given a straightedge and compass, we can construct a right angle. 0 | Preliminaries 13 EXAMPLE 12 We use induction to prove that given a straight- edge, a compass, and a unit length, we can construct a line segment √ of length n for every positive integer n. The case when n = 1 is given. Now we assume that we can construct a line segment of √ length n. Then use the straightedge and compass to construct a √ right triangle with height 1 and base n. The hypotenuse of the √ triangle has length n + 1. So, by induction, we can construct a √ line segment of length n for every positive integer n. EXAMPLE 13 DeMoivre’s Theorem We use induction to prove that for every positive integer n and every real number n θ, (cos θ + √ i sin θ) = cos nθ + i sin nθ, where i is the complex number −1. Obviously, the statement is true for n = 1. Now assume it is true for n. We must prove that (cos θ + i sin θ)n+1 = cos(n + 1)θ + i sin(n + 1)θ. Observe that (cos θ + i sin θ)n+1 = (cos θ + i sin θ)n (cos θ + i sin θ) = (cos nθ + i sin nθ)(cos θ + i sin θ) = cos nθ cos θ + i(sin nθ cos θ + sin θ cos nθ) − sin nθ sin θ. Now, using trigonometric identities for cos(α + β) and sin(α + β), we see that this last term is cos(n + 1)θ + i sin(n + 1)θ. So, by induction, the statement is true for all positive integers. In many instances, the assumption that a statement is true for an integer n does not readily lend itself to a proof that the statement is true for the integer n + 1. In such cases, the following equivalent form of induction may be more convenient. Some authors call this formulation the strong form of induction. Theorem 0.6 Second Principle of Mathematical Induction Let S be a set of integers containing a. Suppose S has the property that n belongs to S whenever every integer less than n and greater than or equal to a belongs to S. Then, S contains every integer greater than or equal to a. PROOF The proof is left to the reader. To use this form of induction, we first show that the statement is true for the integer a. We then assume that the statement is 14 Integers and Equivalence Relations true for all integers that are greater than or equal to a and less than n, and use this assumption to prove that the statement is true for n. EXAMPLE 14 We will use the Second Principle of Mathematical Induction with a = 2 to prove the existence portion of the Fundamental Theorem of Arithmetic. Let S be the set of integers greater than 1 that are primes or products of primes. Clearly, 2 ∈ S. Now we assume that for some integer n, S contains all integers k with 2 ≤ k < n. We must show that n ∈ S. If n is a prime, then n ∈ S by definition. If n is not a prime, then n can be written in the form ab, where 1 < a < n and 1 < b < n. Since we are assuming that both a and b belong to S, we know that each of them is a prime or a product of primes. Thus, n is also a product of primes. This completes the proof. Notice that it is more natural to prove the Fundamental Theorem of Arithmetic with the Second Principle of Mathematical Induction than with the First Principle. Knowing that a particular integer factors as a product of primes does not tell you anything about factoring the next larger integer. (Does knowing that 5280 is a product of primes help you to factor 5281 as a product of primes?) The following problem appeared in the “Brain Boggler” section of the January 1988 issue of the science magazine Discovery.2 Problems like this one are often called chicken McNugget problems, postage stamp problems, or Frobenius coin problems. Originally, McDonald’s sold its chicken nuggets in packs of 9 and 20. The largest number of nuggets that could not have been bought with these packs is 151. EXAMPLE 15 The Quakertown Poker Club plays with blue chips worth $5.00 and red chips worth $8.00. What is the largest bet that cannot be made? To gain insight into this problem, we try various combinations of blue and red chips and obtain 5, 8, 10, 13, 15, 16, 18, 20, 21, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40. It appears that the answer is 27. But how can we be sure? Well, we need only prove that every integer greater than 27 can be written 2 “Brain Boggler” by Maxwell Carver. Copyright c 1988 by Discover Magazine. Used by permission. 0 | Preliminaries 15 in the form a·5+b·8, where a and b are nonnegative integers. This will solve the problem, since a represents the number of blue chips and b the number of red chips needed to make a bet of a · 5 + b · 8. For the purpose of contrast, we will give two proofs—one using the First Principle of Mathematical Induction and one using the Second Principle. Let S be the set of all integers greater than or equal to 28 of the form a · 5 + b· 8, where a and b are nonnegative. Obviously, 28 ∈ S. Now assume that some integer n ∈ S, say, n = a · 5 + b · 8. We must show that n + 1 ∈ S. First, note that since n ≥ 28, we cannot have both a and b less than 3. If a ≥ 3, then n + 1 = (a · 5 + b · 8) + (−3 · 5 + 2 · 8) = (a − 3) · 5 + (b + 2) · 8. (Regarding chips, this last equation says that we may increase a bet from n to n + 1 by removing three blue chips from the pot and adding two red chips.) If b ≥ 3, then n + 1 = (a · 5 + b · 8) + (5 · 5 − 3 · 8) = (a + 5) · 5 + (b − 3) · 8. (The bet can be increased by 1 by removing three red chips and adding five blue chips.) This completes the proof. To prove the same statement by the Second Principle, we note that each of the integers 28, 29, 30, 31, and 32 is in S. Now assume that for some integer n > 32, S contains all integers k with 28 ≤ k < n. We must show that n ∈ S. Since n − 5 ∈ S, there are nonnegative integers a and b such that n − 5 = a · 5 + b · 8. But then n = (a + 1) · 5 + b · 8. Thus n is in S. Equivalence Relations In mathematics, things that are considered different in one context may be viewed as equivalent in another context. We have already seen one such example. Indeed, the sums 2 + 1 and 4 + 4 are certainly different in ordinary arithmetic, but are the same under modulo 5 arithmetic. Congruent triangles that are situated differently in the plane are not the same, but they are often considered to be the same in plane geometry. In physics, vectors of the same magnitude and direction can produce different effects—a 16 Integers and Equivalence Relations 10-pound weight placed 2 feet from a fulcrum produces a different effect than a 10-pound weight placed 1 foot from a fulcrum. But in linear algebra, vectors of the same magnitude and direction are considered to be the same. What is needed to make these distinctions precise is an appropriate generalization of the notion of equality; that is, we need a formal mechanism for specifying whether or not two quantities are the same in a given setting. This mechanism is an equivalence relation. Definition Equivalence Relation An equivalence relation on a set S is a set R of ordered pairs of elements of S such that 1. (a, a) ∈ R for all a ∈ S (reflexive property). 2. (a, b) ∈ R implies (b, a) ∈ R (symmetric property). 3. (a, b) ∈ R and (b, c) ∈ R imply (a, c) ∈ R (transitive property). When R is an equivalence relation on a set S, it is customary to write aRb instead of (a, b) ∈ R. Also, since an equivalence relation is just a generalization of equality, a suggestive symbol such as ≈, ≡, or ∼ is usually used to denote the relation. Using this notation, the three conditions for an equivalence relation become a ∼ a; a ∼ b implies b ∼ a; and a ∼ b and b ∼ c imply a ∼ c. If ∼ is an equivalence relation on a set S and a ∈ S, then the set [a] = {x ∈ S | x ∼ a} is called the equivalence class of S containing a. EXAMPLE 16 Let S be the set of all triangles in a plane. If a, b ∈ S, define a ∼ b if a and b are similar—that is, if a and b have corresponding angles that are the same. Then ∼ is an equivalence relation on S. EXAMPLE 17 Let S be the set of all polynomials with real coefficients. If f, g ∈ S, define f ∼ g if f 0 = g 0 , where f 0 is the derivative of f. Then ∼ is an equivalence relation on S. Since two polynomials with equal derivatives differ by a constant, we see that for any f in S, [f ] = {f + c | c is real}. EXAMPLE 18 Let S be the set of integers and let n be a positive integer. If a, b ∈ S, define a ≡ b if a mod n = b mod n (i.e., if a−b is divisible by n). Then ≡ is an equivalence relation on S and 0 | Preliminaries 17 [a] = {a+kn | k ∈ S}. Since this particular relation is important in abstract algebra, we will take the trouble to verify that it is indeed an equivalence relation. Certainly, a − a is divisible by n, so that a ≡ a for all a in S. Next, assume that a ≡ b, say, a − b = rn. Then, b − a = (−r)n, and therefore b ≡ a. Finally, assume that a ≡ b and b ≡ c, say, a − b = rn and b − c = sn. Then, we have a − c = (a − b) + (b − c) = rn + sn = (r + s)n, so that a ≡ c. EXAMPLE 19 Let ≡ be as in Example 18 and let n = 7. Then we have 16 ≡ 2; 9 ≡ −5; and 24 ≡ 3. Also, [1] = {. . . , −20, −13, −6, 1, 8, 15, . . .} and [4] = {. . . , −17, −10, −3, 4, 11, 18, . . .}. EXAMPLE 20 Let S = {(a, b) | a, b are integers, b 6= 0}. If (a, b), (c, d) ∈ S, define (a, b) ≈ (c, d) if ad = bc. Then ≈ is an equivalence relation on S. [The motivation for this example comes from fractions. In fact, the pairs (a, b) and (c, d) are equivalent if the fractions a/b and c/d are equal.] To verify that ≈ is an equivalence relation on S, note that (a, b) ≈ (a, b) requires that ab = ba, which is true. Next, we assume that (a, b) ≈ (c, d), so that ad = bc. We have (c, d) ≈ (a, b) provided that cb = da, which is true from commutativity of multiplication. Finally, we assume that (a, b) ≈ (c, d) and (c, d) ≈ (e, f ) and prove that (a, b) ≈ (e, f ). This amounts to using ad = bc and cf = de to show that af = be. Multiplying both sides of ad = bc by f and replacing cf by de, we obtain adf = bcf = bde. Since d 6= 0, we can cancel d from the first and last terms. Definition Partition A partition of a set S is a collection of nonempty disjoint subsets of S whose union is S. Figure 0.3 illustrates a partition of a set into four subsets. EXAMPLE 21 The sets {0}, {1, 2, 3, . . .}, and {. . . , −3, −2, −1} constitute a partition of the set of integers. EXAMPLE 22 The set of nonnegative integers and the set of nonpositive integers do not partition the integers, since both contain 0. The next theorem reveals that equivalence relations and partitions are intimately intertwined. 18 Integers and Equivalence Relations S Figure 0.3 Partition of S into four subsets. Theorem 0.7 Equivalence Classes Partition The equivalence classes of an equivalence relation on a set S constitute a partition of S. Conversely, for any partition P of S, there is an equivalence relation on S whose equivalence classes are the elements of P . PROOF Let ∼ be an equivalence relation on a set S. For any a ∈ S, the reflexive property shows that a ∈ [a]. So, [a] is nonempty and the union of all equivalence classes is S. Now, suppose that [a] and [b] are distinct equivalence classes. We must show that [a]∩[b] = ∅. On the contrary, assume c ∈ [a] ∩ [b]. We will show that [a] ⊆ [b]. To this end, let x ∈ [a]. We then have c ∼ a, c ∼ b, and x ∼ a. By the symmetric property, we also have a ∼ c. Thus, by transitivity, x ∼ c, and by transitivity again, x ∼ b. This proves [a] ⊆ [b]. Analogously, [b] ⊆ [a]. Thus, [a] = [b], in contradiction to our assumption that [a] and [b] are distinct equivalence classes. To prove the converse, let P be a collection of nonempty disjoint subsets of S whose union is S. Define a ∼ b if a and b belong to the same subset in the collection. We leave it to the reader to show that ∼ is an equivalence relation on S (Exercise 53). Functions (Mappings) Although the concept of a function plays a central role in nearly every branch of mathematics, the terminology and notation associated with functions vary quite a bit. In this section, we establish ours. 0 | Preliminaries 19 Definitions Function (Mapping) A function (or mapping ) φ from a set A to a set B is a rule that assigns to each element a of A exactly one element b of B. The set A is called the domain of φ, and B is called the range of φ. If φ assigns b to a, then b is called the image of a under φ. The subset of B comprising all the images of elements of A is called the image of A under φ. We use the shorthand φ : A → B to mean that φ is a mapping from A to B. We will write φ(a) = b or φ : a → b to indicate that φ carries a to b. There are often different ways to denote the same element of a set. In defining a function in such cases one must verify that the function values assigned to the elements depend not on the way the elements are expressed but on only the elements themselves. For example, the correspondence φ from the rational numbers to the integers given by φ(a/b) = a+b does not define a function since 1/2 = 2/4, but φ(1/2) 6= φ(2/4). To verify that a correspondence is a function, you assume that x1 = x2 and prove that φ(x1 ) = φ(x2 ). Definition Composition of Functions Let φ : A → B and ψ : B → C. The composition ψφ is the mapping from A to C defined by (ψφ)(a) = ψ(φ(a)) for all a in A. In calculus courses, the composition of f with g is written (f ◦g)(x) and is defined by (f ◦g)(x) = f (g(x)). When we compose functions, we omit the “circle.” Let f (x) = 2x + 3 and g(x) = x2 + 1. Then (f g)(5) = f (g(5)) = f (26) = 55; (gf )(5) = g(f (5)) = g(13) = 170. More generally, (f g)(x) = f (g(x)) = f (x2 + 1) = 2(x2 + 1) + 3 = 2x2 + 5 and (gf )(x) = g(f (x)) = g(2x + 3) = (2x + 3)2 + 1 = 4x2 + 12x + 9 + 1 = 4x2 + 12x + 10. Note that the function fg is not the same as the function gf. EXAMPLE 23 There are several kinds of functions that occur often enough to be given names. Definition One-to-One Function A function φ from a set A is called one-to-one if for every a1 , a2 ∈ A, φ(a1 ) = φ(a2 ) implies a1 = a2 . The term one-to-one is suggestive, since the definition ensures that one element of B can be the image of only one element of 20 Integers and Equivalence Relations A. Alternatively, φ is one-to-one if a1 6= a2 implies φ(a1 ) 6= φ(a2 ). That is, different elements of A map to different elements of B. See Figure 0.4. φ ψ a1 φ (a1) a1 a2 φ (a2) a2 ψ (a1) = ψ (a2) ψ is not one-to-one φ is one-to-one Figure 0.4 Mappings. Definition Function from A onto B A function φ from a set A to a set B is said to be onto B if each element of B is the image of at least one element of A. In symbols, φ : A → B is onto if for each b in B there is at least one a in A such that φ(a) = b. See Figure 0.5. φ ψ φ is onto ψ is not onto Figure 0.5 Functions. The next theorem summarizes the facts about functions we will need. Theorem 0.8 Properties of Functions Given functions α : A → B, β : B → C, and γ : C → D, then 1. γ(βα) = (γβ)α (associativity). 0 | Preliminaries 21 2. If α and β are one-to-one, then βα is one-to-one. 3. If α and β are onto, then βα is onto. 4. If α is one-to-one and onto, then there is a function α−1 from B onto A such that (α−1 α)(a) = a for all a in A and (αα−1 )(b) = b for all b in B. PROOF We prove only part 1. The remaining parts are left as ex- ercises (Exercise 55). Let a ∈ A. Then (γ(βα))(a) = γ((βα)(a)) = γ(β(α(a))). On the other hand, ((γβ)α)(a) = (γβ)(α(a)) = γ(β(α(a))). So, γ(βα) = (γβ)α. It is useful to note that if α is one-to-one and onto, the function α−1 described in part 4 of Theorem 0.8 has the property that if α(s) = t, then α−1 (t) = s. That is, the image of t under α−1 is the unique element s that maps to t under α. In effect, α−1 “undoes” what α does. EXAMPLE 24 Let Z denote the set of integers, R the set of real numbers, and N the set of nonnegative integers. The following table illustrates the properties of one-to-one and onto. Domain Z R Z Z Range Z R N Z Rule x → x3 x → x3 x → |x| x → x2 One-to-One Yes Yes No No Onto No Yes Yes No To verify that x → x3 is one-to-one in the first two cases, notice that if x3 = y 3 , we may take the cube roots of both sides of the equation to obtain x = y. Clearly, the mapping from Z to Z given by x → x3 is not onto, since 2 is the cube of no integer. However, x → x3 defines an onto function from R√to R, since every real number is the cube of its cube root (i.e., 3 b → b). The remaining verifications are left to the reader. Exercises I was interviewed in the Israeli Radio for five minutes and I said that more than 2000 years ago, Euclid proved that there are infinitely many primes. Immediately the host interrupted me and asked: “Are there still infinitely many primes?” Noga Alon 1. For n = 5, 8, 12, 20, and 25, find all positive integers less than n and relatively prime to n. 22 Integers and Equivalence Relations 2. Determine a. gcd(2,10) b. gcd(20,8) c. gcd(12,40) d. gcd(21,50) e. gcd(p2 q 2 , pq 3 ) primes lcm(2,10) lcm(20,8) lcm(12,40) lcm(21,50) lcm(p2 q 2 , pq 3 ) where p and q are distinct 3. Determine 51 mod 13, 342 mod 85, 62 mod 15, 10 mod 15, (82·73) mod 7, (51+68) mod 7, (35·24) mod 11, and (47+68) mod 11. 4. Find integers s and t such that 1 = 7 · s + 11 · t. Show that s and t are not unique. 5. Prove that every integer that is a common multiple of every member of a finite set of integers is a multiple of the least common multiple of those integers. 6. Prove that for any three consecutive integers n, n + 1, n + 2 one must be divisible by 3. 7. Show that if a and b are positive integers, then ab = lcm(a, b) · gcd(a, b). 8. Suppose a and b are integers that divide the integer c. If a and b are relatively prime, show that ab divides c. Show, by example, that if a and b are not relatively prime, then ab need not divide c. 9. If a and b are integers and n is a positive integer, prove that a mod n = b mod n if and only if n divides a − b. 10. Let d = gcd(a, b). If a = da0 and b = db0 , show that gcd(a0 , b0 ) = 1. 11. Let n be a fixed positive integer greater than 1. If a mod n = a0 and b mod n = b0 , prove that (a+b) mod n = (a0 +b0 ) mod n and (ab) mod n = (a0 b0 ) mod n. (This exercise is referred to in Chapters 6, 8, 10, and 15.) 12. Let a and b be positive integers and let d = gcd(a, b) and m = lcm(a, b). If t divides both a and b, prove that t divides d. If s is a multiple of both a and b, prove that s is a multiple of m. 13. Let n and a be positive integers and let d = gcd(a, n). Show that the equation ax mod n = 1 has a solution if and only 0 | Preliminaries 23 if d = 1. (This exercise is referred to in Chapter 2.) 14. Show that 5n + 3 and 7n + 4 are relatively prime for all n. 15. Suppose that m and n are relatively prime and r is any integer. Show that there are integers x and y such that mx+ ny = r. 16. Let p, q, and r be primes other than 3. Show that 3 divides p2 + q 2 + r2 . 17. Prove that every prime greater than 3 can be written in the form 6n + 1 or 6n + 5. 18. Determine 71000 mod 6 and 61001 mod 7. 19. Let a, b, s, and t be integers. If a mod st = b mod st, show that a mod s = b mod s and a mod t = b mod t. What condition on s and t is needed to make the converse true? (This exercise is referred to in Chapter 8.) 20. If n is an integer greater than 1 and (n − 1)! = 1 mod n, prove that n is prime. 21. Show that gcd(a, bc) = 1 if and only if gcd(a, b) = 1 and gcd(a, c) = 1. (This exercise is referred to in Chapter 8.) 22. Let p1 , p2 , . . . , pn be primes. Show that p1 p2 · · · pn + 1 is divisible by none of these primes. 23. Prove that there are infinitely many primes. (Hint: Use Exercise 22.) 24. For any complex numbers z1 and z2 , prove that |z1 z2 | = |z1 ||z2 |. 25. Give an “if and only if” statement that describes when the logic gate x NAND y modeled by 1 + xy is 1. Give an “if and only if” statement that describes when the logic gate x XNOR y modeled by 1 + x + y is 1. 26. For inputs of 0 and 1 and mod 2 arithmetic describe the output of the formula z + xy + xz in the form “If x . . . , else . . ..” 27. For every positive integer n, prove that a set with exactly n elements has exactly 2n subsets (counting the empty set and the entire set). 28. Prove that 2n 32n − 1 is always divisible by 17. 24 Integers and Equivalence Relations 29. Prove that there is some positive integer n such that n, n + 1, n + 2, . . . , n + 200 are all composite. 30. (Generalized Euclid’s Lemma) If p is a prime and p divides a1 a2 . . . an , prove that p divides ai for some i. 31. Use the Generalized Euclid’s Lemma (see Exercise 30) to establish the uniqueness portion of the Fundamental Theorem of Arithmetic. 32. What is the largest bet that cannot be made with chips worth $7.00 and $9.00? Verify that your answer is correct with both forms of induction. 33. Prove that the First Principle of Mathematical Induction is a consequence of the Well Ordering Principle. 34. The Fibonacci numbers are 1, 1, 2, 3, 5, 8, 13, 21, 34, . . . . In general, the Fibonacci numbers are defined by f1 = 1, f2 = 1, and for n ≥ 3, fn = fn−1 + fn−2 . Prove that the nth Fibonacci number fn satisfies fn < 2n . 35. Prove by induction on n that for all positive integers n, n3 + (n + 1)3 + (n + 2)3 is a multiple of 9. 36. Suppose that there is a statement involving a positive integer parameter n and you have an argument that shows that whenever the statement is true for a particular n it is also true for n + 2. What remains to be done to prove the statement is true for every positive integer? Describe a situation in which this strategy would be applicable. 37. In the cut “As” from Songs in the Key of Life, Stevie Wonder mentions the equation 8 × 8 × 8 = 4. Find all integers n for which this statement is true, modulo n. 38. Prove that for every integer n, n3 mod 6 = n mod 6. 39. If it is 2:00 a.m. now, what time will it be 3736 hours from now? 40. Determine the check digit for a money order with identification number 7234541780. 41. Suppose that in one of the noncheck positions of a money order number, the digit 0 is substituted for the digit 9 or vice versa. Prove that this error will not be detected by the check digit. Prove that all other errors involving a single position are detected. 0 | Preliminaries 25 42. Suppose that a money order identification number and check digit of 21720421168 is erroneously copied as 27750421168. Will the check digit detect the error? 43. A transposition error involving distinct adjacent digits is one of the form . . . ab . . . → . . . ba . . . with a 6= b. Prove that the money order check-digit scheme will not detect such errors unless the check digit itself is transposed. 44. Explain why the check digit for a money order for the number N is the repeated decimal digit in the real number N ÷9. 45. The 10-digit International Standard Book Number (ISBN10) a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 has the property (a1 , a2 , . . . , a10 )· (10, 9, 8, 7, 6, 5, 4, 3, 2, 1) mod 11 = 0. The digit a10 is the check digit. When a10 is required to be 10 to make the dot product 0, the character X is used as the check digit. Verify the check digit for the ISBN-10 assigned to this book. 46. Suppose that an ISBN-10 has a smudged entry where the question mark appears in the number 0-716?-2841-9. Determine the missing digit. 47. Suppose three consecutive digits abc of an ISBN-10 are scrambled as bca. Which such errors will go undetected? 48. Let S be the set of real numbers. If a, b ∈ S, define a ∼ b if a − b is an integer. Show that ∼ is an equivalence relation on S. Describe the equivalence classes of S. 49. Let S be the set of integers. If a, b ∈ S, define aRb if ab ≥ 0. Is R an equivalence relation on S ? 50. Let S be the set of integers. If a, b ∈ S, define aRb if a + b is even. Prove that R is an equivalence relation and determine the equivalence classes of S. 51. Complete the proof of Theorem 0.7 by showing that ∼ is an equivalence relation on S. 52. Prove that 3, 5, and 7 are the only three consecutive odd integers that are prime. Computer Exercises Computer exercises for this chapter are available at the website: http://www.d.umn.edu/∼jgallian References Max Born, My Life: Recollections of a Nobel Laureate, New York: Charles Scribner’s Sons, 1978. J. Mehra and H. Rechenberg, The Historical Development of Quantum Theory, Vol. 3, New York: Springer-Verlag, 1982. J.-F. Mestre, R. Schoof, L. Washington, D. Zagier, “Quotient homophones des groupes libres [Homophonic Quotients of Free Groups],” Experimental Mathematics 2 (1993): 153–155. H. C. Whitford, A Dictionary of American Homophones and Homographs, New York: Teachers College Press, 1966.