Secton 6.2 Dvsblty among the ntegers An nteger a ε s dvsble by b ε f there s an nteger c ε such that a = bc. Note that s dvsble by any nteger b, snce = b. On the other hand, a s dvsble by only f a = : from a = c t follows that a =. The symbolc way of wrtng " a s dvsble by b " s: b a. Instead of " a s dvsble by b " we also say that " b dvdes a ", or that " b s a dvsor of a ", or " a s a multple of b ". Note the obvous Transtvty law for dvsblty: a b and b c a c. In case b, a beng dvsble by b s the same as to say that a b s an nteger; we cannot say ths, however, f b =, snce a s meanngless. In partcular, f b a, then ether a=, or else b a ; n other words, for postve ntegers a and b such that a<b, b a s mpossble (snce then < a <1, and a b b cannot be an nteger). As far as dvsblty s concerned, any nteger a and ts negatve -a behave n the same way: b a ff b -a ff -b a. Therefore, e.g., when we want to account for all the dvsors of an nteger, we may restrct our search to the non-negatve numbers. Always, a a and a -a. Moreover, f both a a and a a hold, then ether a = a or a = -a. In what follows, varables a, b,... range over stated., the set of all ntegers, unless otherwse Gven any a and b such that b >, we may dvde a by b wth a remander: we can fnd q and r such that a = qb + r, r < b. (1) E.g., wth a = 17, b = 5, we have q = 3 and r = 2 : 19
17 = 3 5 + 2, 2 < 5. In (1), q s the quotent, r s remander when a s dvded by b. The remander beng equal to sgnfes, of course, that b dvdes a, b a. To prove the exstence of the quotent/remander representaton, frst let us assume that a. The set X of all non-negatve multples of b that are less than or equal to a s nonempty ( X ), and bounded by a ; thus, by the Greatest Number Prncple (see the last secton), t has a maxmal element, say qb. Thus we have that qb X but (q+1)b X (snce b, qb<(q+1)b ). Ths means that qb a<(q+1)b. It follows that for r=a-qb, we have the relatons n (1). For the case when a<, we wrte -a = qb+r by what we already know; from ths, a = (-q-1)b+(b-r) s the desred decomposton. The common dvsors of a and b are those ntegers that dvde both a and b. Wth any ntegers a and b, a(n nteger) lnear combnaton of a and b s any nteger of the form xa + yb, wth x and y also ntegers (although we usually say "lnear combnaton" wthout the qualfcaton "nteger", we nsst that the coeffcents should also be ntegers!). Note that a and b : any lnear combnaton of lnear combnatons of a and b s a lnear combnaton of f c = xa + yb, d = ua + vb and e = sc + td, then e = s(xa + yb) + t(ua + vb) = (sx + tu)a + (sy + tv)b. Also note that 191
any common dvsor of a and b s a dvsor of any lnear combnaton of a and b : f c a, c b, that s a = uc, b = vc, then xa + yb = xuc + yvc = (xu + yv)c. Now, f a = qb + r, (2) then a s a lnear combnaton of b and r (snce a = qb + 1 r ) and also, snce r = a - qb = 1 a + (-q)b, r s a lnear combnaton of a and b. We may conclude that are the same. under (2), the common dvsors of a and b, and the common dvsors of b and r c s a greatest common dvsor (gcd) of a and b f t s a common dvsor of a and b, and a multple of every common dvsor of a and b at the same tme; n other words, c a and c b and for all d such that d a and d b, we have d c. Another way of puttng the defnng property of c s to say the common dvsors of a and b are the same as the dvsors of (the sngle) c : for any d, d a and d b d c. Note that t s not clear, at ths pont, that any par of numbers a and b has a gcd; we wll 192
prove ths soon. However, one thng s pretty clear, namely that the gcd, f t exsts, s essentally unque: f both c and c are gcd's of a and b, then c = c or c = -c ; the reason s that, from the defnton t follows that both c c and c c hold. To make the gcd completely unque, we agree that gcd(a, b) should denote the non-negatve one of the two possble values. A remark on the name "greatest common dvsor". Assume that both a and b are postve (the only "nterestng" case for gcd(a, b) ). Then c=gcd(a, b) s certanly the greatest one among the common dvsors of a and b, snce t s postve, and t dvdes all of them. One mght then say that t s obvous that there s a greatest one among these common dvsors, as there s always a greatest one among fntely many ntegers. However, f we denote ths greatest of the common dvsors by c, t s not clear that for every common dvsor d of a and b we have d c as requred n the defnton of "gcd"; we only have that d c, whch, of course, s not enough for d c. It s mportant to realze that the defnton of "greatest common dvsor" mposes a stronger condton than t appears from the wordng of the concept. These remarks explan why, to prove the exstence of the gcd, we have to go through the consderably more sophstcated argument than just sayng "take the largest of the common dvsors". The argument that follows s not only one of the most mportant ones n all of mathematcs, but t s also one of earlest ones: t appears n Eucld's "Elements", the classc ancent Greek treatse on mathematcs. Note that f b a, then gcd(a, b) = b ; hence, gcd(, b) = b. For the proof of the exstence of the gcd, the frst remark s that f a = qb + r, then gcd(a, b) = gcd(b, r), (3) meanng that f one gcd exsts, so does the other, and they are equal. The reason s that, n ths case, the common dvsors of the par (a, b) and those of (b, r) are the same, as we noted above. Let a and b be arbtrarly gven ntegers; we want to compute gcd(a, b). We may 193
assume that b > ; f b =, then gcd(a, ) = a as sad above, and f b <, we may pass to -b : gcd(a, b) = gcd(a, -b). Now, assumng b>, we can defne, by recurson, the sequence by a, a, a,, a, a (3') 1 2 n n+1 a = a def a 1 = b def and for any, f we have already defned a and a, +1 and f a s greater than, (3") +1 a s defned as the remander of a dvded by a. In other words, the relatons +2 +1 a = q a + a, a < a (4) +1 +2 +2 +1 hold wth sutable q. When a =, we stop, that s, we do not defne a, and we +1 +2 put n = ; thus, the sequence (3') wll have been defned. Snce the a s are strctly decreasng after = 1 (see the second relaton n (4)), by the "prncple of the mpossblty of nfnte descent" (see the last secton), we must reach a stage +1 when a +2 s no longer defned, that s, the condton (3") fals, that s, a +1 =. Denote ths by n. Therefore, snce a n+1 =, we have by (4), for =n-1, that a = q a. (5) n-1 n-1 n Now, snce a n s a dvsor of a n-1, gcd(a n-1, a n ) = a n. The frst relaton n (4) tells us that gcd(a, a ) = gcd(a, a ) ( +2 n ) +1 +1 +2 (see (3)). Thus, we have that 194
gcd(a, b) = gcd(a, a ) = gcd(a, a ) =... = gcd(a, a ) = a. 1 1 2 n-1 n n We have shown that gcd(a, b) exsts, and n fact, have shown how to compute t. We can summarze the procedure ths way: we construct the sequence the frst two terms of whch are the gven numbers, and n whch every term s the remander when the prevous term dvdes the term precedng t. The constructon termnates when s reached; the term prevous to the zero term s the desred gcd. E.g., let a = 3293, b = 417. Then 3293 = 417 + 3293, 417 = 1 3293 + 814, 3293 = 4 814 + 37, 814 = 22 37. That s, n ths case, n = 3, a = 814 and a = 37, and gcd(3293, 417) = 37. 2 3 The procedure descrbed s called the Eucldean algorthm. It was known to the ancent Greeks; t appears n Eucld's "Elements". An mportant fact about t s that t s an effcent algorthm; for relatvely large numbers, t termnates qute fast. Besdes a way of computng the gcd, the Eucldean algorthm also gves us an mportant theoretcal concluson: the gcd of any two numbers a and b s a lnear combnaton of a and b. To see ths, we prove by nducton on n that a s a lnear combnaton of a and b. For = and = 1, ths s certanly true: a = 1 a + b and b = a + 1 b. 195
Assumng the result for all ndces less than +2, we have that a = a - q a (6) +2 +1 that s, a s a lnear combnaton of a and a. Snce, by the nducton hypothess, +2 +1 a and a are lnear combnatons of a and b, t follows that a s a lnear +1 +2 combnaton of a and b as desred. In the example, 37 = 3293-4 814, 814 = 417-1 3293, hence, gcd(417, 3293) = 37 = 3293-4 (417-1 3293) = (-4) 417 + 5 3293. A prme number s any nteger p whch s not a unt, that s, not 1 or -1, but whch s not dvsble by any number other than 1, -1, p and -p. Clearly, p s prme ff -p s prme; therefore, t s customary to restrct attenton to postve prmes; n what follows, by "prme number" we always mean a postve prme. Restated, p s prme f p > 1, and the only postve dvsors of p are 1 and p. A fundamental property of prmes s ths: f p s a prme, and p ab, then ether p a, or p b (or both). Indeed, assume also that p does not dvde a, to show that p b. Then gcd(p, a) = 1, snce gcd(p, a) s a dvsor of p, therefore t cannot be anythng else but 1 or p, and t cannot be p, snce then p would dvde a. Snce gcd(p, a) s a lnear combnaton of p and a, 196
1 = xp + ya for sutable ntegers x and y. Multplyng ths equalty wth b, we get b = xbp + yab. Snce, by assumpton, ab s dvsble by p, ab = zp for a sutable z, we have b = (xb + yz)p, that s, b s dvsble by p, whch s what we wanted to show. An obvous generalzaton of the last fact s ths: f p s a prme, and p a, then p a for at least one < k. <k We clam: Every non-zero, non-unt nteger has at least one prme dvsor. Let a be any nteger, a 1, a -1. We may assume that a > 1. The set X of all dvsors of a that are greater than 1 s a non-empty set; a tself s an element of t. By the LNP, let p be the least element of X. p must be prme; otherwse, there would be a dvsor x of p whch s greater than 1 but less than p ; x would be a non-unt dvsor of a smaller than p, contrary to the choce of p. Ths proves the clam. There are many prme numbers; n fact, there are nfntely many: 197
for any n ε, there s a prme number greater than n. Indeed, consder the number n! + 1, and let p be a prme dvsor of ths number. p cannot be n, snce then p would be a dvsor of n!, and hence also a dvsor of (n! + 1) - n! = 1, whch s absurd snce p s not a unt. p s a prme number greater than n. Next, we see that Every non-zero number s the product of prme numbers. Let n be any postve nteger. If n = 1, n s the empty product of prme numbers. We treat the general case by nducton, more precsely, by the WOP. Let n > 1. We know that n has at least one prme dvsor; let p one such; let m = n p. Snce m < n, we may apply the nducton hypothess, and have that m s the product of prme numbers, m = p. But then, n = m p, and n = ( p ) p, and n s also a product of prmes. <k <k Let us use the notaton p for the +1 st prme; see the end of the last secton. Wth the fxed meanng of the p, we may wrte every postve n n the form α n = p (7) <k wth sutable natural exponents α. Indeed, we know that n s the product of a certan number of prme factors; by brngng together the equal factors nto powers, and usng the exponent n case a specfc p E.g., does not occur n the product, we get the form mentoned. 2 2 2 1 2 242 = 2 121 = 2 5 11 = 2 3 5 7 11 ; 198
now, we can take k = 5. Note that, n (7), k s not unque: t can be taken any number greater than the last for whch α ; for all j, <j<k, we can then take α j =. Ths s useful, snce when we have two (or more) numbers as n, we can choose the k for the two to be the same. We have: Prme factorzaton s unque: α f n = p = p, (8) <k <k then α = for all < k. The proof s by nducton on n (va the WOP). If n = 1, t s clear that α = = for all < k. Otherwse, for some < k, say, we have that α 1 ; let p = p. p dvdes n = p, and snce p s prme, p dvdes at least one p. But f, <k p does not dvde p (why?). Thus, p must dvde p, whch mples that 1. Now, dvdng (8) by the factor p, we get α m = p = p def <k <k where α = α for, α = α -1, and smlarly for the. Clearly, m < n. By the nducton hypothess, prme factorzaton for m s unque; hence, α = for all < k. Ths means that α = for all, and α = α +1 = +1 =, that s, α = for all < k, as desred. 199
In terms of prme factorzaton, dvsblty may be characterzed as follows: α f n = p, m = p, then n m ff α for all < k. <k <k γ The reason s smple: f n m, then m = n for some ; hence, f = p (wth <k possbly a greater k ; extend the range of the α's and 's by nsertng 's), we have that α γ α +γ m = p p = p. <k <k <k By the unqueness of prme factorzaton, = α +γ ; and snce each γ, we get that α as clamed. 2