Polynomals John Stalker What s a polynomal? If you thnk you already know what a polynomal s then skp ths secton. Just be aware that I consstently wrte thngs lke p = c z j =0 nstead of p(z) = c z. =0 You can regard ths smply as an eccentrcty, or as an abbrevaton. So you re stll readng? Well, as t turns out, you probably don t don t know what a polynomal s. If you contnue readng then you wll fnd out, possbly after beng confused brefly, but t won t make any dfference as far as ths module s concerned, so feel free to skp ahead. A polynomal s a sequence of numbers 2, ndexed by the non-negatve ntegers, only Copyrght 207 Really, a unvarate polynomal, probably more famlar to you as a polynomal n one varable. 2 What sort of numbers are allowed? Certanly ratonals, reals or complex numbers are allowed. For much of what follows, ntegers would work as well, not for everythng. If you know abstract algebra then my assumpton s smply that elements of the fntely many of whose elements are non-zero. A non-zero polynomal has a last ndex for whch the correspondng element s non-zero, and ths s called the degree of the polynomal. Polynomals of degree zero have a sngle non-zero element, the one wth ndex zero, and we dentfy them wth ths element. We defne addton of polynomals as you would expect: the k th element of p + q s the sum of the k th elements of p and q. (α 0, α, α 2,...) + (β 0, β, β 2,...) = (α 0 + β 0, α + β, α 2 + β 2,...). Multplcaton by a number s also defned as you would expect: the k th element of αp s α tmes the k th element of p. α(β 0, β, β 2,...) = (αβ 0, αβ, αβ 2,...) Multplcaton s not however defned n the way you mght expect. The k th element of pq s defned to be the sum of the products of the th element of p and the j th element of q, the sum beng taken over all pars (, ) such that + = k. There are only fntely many such pars, so there s no problem n defnng ths sum. (α 0, α, α 2,...)(β 0, β, β 2,...) = (α 0 β 0, α 0 β + α β 0, α 0 β 2 + α β + α 2 β 0,...). Later t wll be conve- sequence belong to a feld. nent to assume more.
Ths defnton s consstent wth our earler dentfcaton of polynomals of degree zero wth numbers and our defnton of the product of a number and a polynomal. It s not mmedately obvous that the usual commutatve, assocatve and dstrbutve laws hold for polynomals, but they do. There s a specal polynomal, whch we call z, wth zeroes for all elements except the element wth ndex, whch s a : z = (0,, 0, 0, ) Because of the way multplcaton s defned, z k has all elements zero except for the k th, whch s. We can therefore wrte (α 0, α, α 2,...) = α 0 + α z + α 2 z 2 +. The sum s, despte appearances, fnte, snce we can stop after the z d term, where d s the degree of the polynomal. From now on we wll never wrte polynomals explctly as sequences and wll nstead always wrte them as a sum of coeffcents tmes powers of z. Normally these are wrtten wth the powers lsted n descendng order. That s purely a matter of conventon, but we wll follow that conventon from now on. Why do we not defne just defne polynomals as functons of the form d =0 α z j? After all, that s the motvaton behnd our defntons of addton and multplcaton, whch were so chosen that and (p + q)(z) = p(z) + q(z) (pq)(z) = p(z)q(z) for any choce of Z for whch they make sense. There are a few reasons why defnng polynomals as functons s problematc. It s not obvous whether dfferent sequences of coeffcents can gve rse to the same functon. If the sequence α 0, α, α 2... sn t unquely determned by the functon d =0 α z j then t doesn t make sense to defne the degree to be d, the constant term to be α 0, the leadng term to be α d, etc. For real or complex polynomals t s possble to show that the sequence of coeffcents s unquely determned by the values of the correspondng functon, but ths requres work, and that work s avoded by adoptng the defnton of a polynomal as a sequence of coeffcents. Another reason to avod the functonal defnton s that we want to be flexble n our choce of Z. We want to allow not just numbers as arguments to the functon but also square matrces. More generally we may want to allow Z to be an endomorphsm of a vector space, possbly nfnte dmensonal. In general we want to mantan the opton of takng t to be anythng whch can meanngfully be added, rased to powers and multpled by numbers. If p s a functon then we are forced to choose ts doman, and f we later change ths doman we could concevable dscover that polynomal denttes proved earler wth a dfferent choce are no longer vald. Wth the sequence defnton we can be sure that any denttes proved for polynomals wll also hold for the correspondng functons, no matter what choce of doman we make. A further reason s the we want our results to apply n more exotc contexts, lke 2
fnte felds. That s rrelevant to our applcatons n ths module, but mportant n other areas of mathematcs, lke number theory or algebrac geometry. If our coeffcents belong to a fnte feld and the doman s the same fnte feld then t s no longer true that the functon determnes the coeffcents unquely. Then many thngs start to go wrong f we ve dentfed polynomals wth functons. It s no longer true, for example that the product of non-zero polynomals s non-zero. Z 2 + Z = (Z + )Z = 0, for example, for all Z n the feld wth two elements, even though nether Z nor Z + s dentcally zero. Ths doesn t happen f we defne polynomals as sequences. In that case z 2 + z s the sequence (0,,, 0, 0,...), whch s non-zero. 2 Matrces Computatonally t s often convenent to us matrces to perform polynomal calculatons. The central observaton whch makes ths work s essental trval. It s just that z d α z. = ( α d α α 0 ) =0 z. Polynomals of degree at most d are thus just row vectors tmes the fxed column vector z d. x = z. The coeffcents of the polynomal are the entres of the row vector. Because of the way matrx multplcaton s defned, f we multply x from the rght by a matrx A nstead of a column vector c then we get a column vector whose entres are polynomals, wth each entry havng coeffcents gven by the correspondng row of A. Dvson We can dvde polynomals n much the same way we dvde ntegers. For example, to dvde z 5 + z + z 2 + z + by z 2 z + we frst dvde the leadng terms, z 5 /z 2 = z. It follows that z tmes z 2 z + equals z 5 + x 4 + z + z 2 + z + plus terms of lower order: z 5 + z 4 + z + z 2 + z + = z (z 2 z + ) + 2z 4 + z 2 + z +. Dvdng the leadng term of 2z 4 + z 2 + z + by that of z 2 z + gves 2z 2, and 2z 4 + z 2 + z + = 2z 2 (z 2 z + ) + 2z z 2 + z +. Dvdng leadng terms agan gves 2z and 2z z 2 + z + = 2z(z 2 z + ) + z 2 z +. Dvdng one fnal tme gves and It follows that z 2 z + = (z 2 z + ). z 5 + z 4 + z + z 2 + z + = (z + 2z 2 + 2z + )(z 2 z + ).
In general we expect to get a remander, of course, just as we do when dvdng ntegers. Here we ddn t, because z 2 z + happens to be a factor of z 5 + z 4 + z + z 2 + z +. The remander wll always be of lower order than the dvsor. There s an alternate way to do ths calculaton, whch doesn t have an analogue for ntegers. We solve ya = c where 0 0 0 0 0 0 A = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 and Ths gves c = ( ). y = ( 2 2 0 0 ). To see why ths works, multply both sdes of the equaton ya = c from the rght by the row vector z 5 z 4 z z 2, z as descrbed n the precedng paragraph. Ths sn t really an alternate method. It s n fact a repackagng of the prevous method. The steps n dvson correspond exactly to the steps n Gaussan elmnaton. The arthmetc s the same, but we don t need to wrte the powers of z everywhere. In general we can dvde a polynomal p of degree d by a polynomal p 2 of degree d 2, wth d d 2, obtanng a quotent q of degree d d 2 and a remander r of degree less than d 2 : p = p 2 q + r. We can always perform ths dvson usng matrx algebra. We form a (d + ) (d + ) matrx A whose th row, for d d 2 + and j th column, for j d + s coeffcent of z d j+ n z d d 2 + p 2. The frst d d 2 + rows are thus shfted versons of the coeffcents of p 2, always wth the leadng coeffcent on the man dagonal. The fnal d 2 rows are the same as the correspondng rows of the dentty matrx. We form a row vector c whose entres are the coeffcents of p. The soluton to the equaton ya = c s then a row vector y whose frst d d 2 + entres are to coeffcents of the quotent q and whose last d 2 rows are the coeffcents of the remander r. Ths works because ya = c f and only f yax = cx where x s a row vector whose entres are decreasng powers of z and the equaton yax = cx s just p = p 2 q + r n matrx form. The equaton ya = c s solvable because A s upper trangular and ts dagonal entres are non-zero, so t s nvertble. For a further example, let s dvde z 4 +2z + z 2 + 4z + 4 by 6z 2 + 7z + 8. 6 7 8 0 0 0 6 7 8 0 A = 0 0 6 7 8, 0 0 0 0 0 0 0 0 c = ( 2 4 5 ), 4
The soluton to ya = c s so y = ( 6 5 6 25 26 449 26 880 ), 26 z 4 + 2z + z 2 + 4z + 4 ( = 6 z2 + 5 6 z + 25 ) (6z 2 + 7z + 8 ) 26 + 449 26 z + 880 26, as you can check drectly. 4 GCDs, Resultants, etc. Once we know how to dvde polynomals we can carry over many famlar notons from ntegers, lke least common multples and greatest common dvsors. We can fnd the greatest common dvsor by repeated dvson, just as n the case of ntegers. It follows from ths constructon that f r s the greatest common dvsor of p and q then r = sp + tq for some polynomals s and t wth the degree of s less than the degree of q and the degree of t less than the degree of p. As an example, suppose Dvdng, p = z, q = z 2 + z +. z 2 + z + = (z + 2)(z ) + Really, a greatest common dvsor, unless we normalse them, for example by choosng the leadng coeffcent to be. so we get a remander of, whch s the least common denomnator. From the calculaton t follows that = (z 2 + z + ) + ( z 2)(z ). Normally we have to dvde more than once. For example, wth we have so Then so p = z 2 + z +, q = z 2 + z 2 + z + = (z 2 + ) + z, z = (z 2 + z + ) + ( )(z 2 + ). z 2 + z + = (z + )z +, = (z 2 + z + ) + ( z )z = z(z 2 + z + ) + (z + )(z 2 + ). Polynomals whose greatest common dvsor s constant, as n the examples above, are called relatvely prme. Suppose p and q are relatvely prme and let d p and d q be ther degrees. Then ρ = up + vq. for some polynomals u and v. Suppose the degree of r s less than d p + d q then r = ru ρ p + rv ρ q 5
Dvde ru/ρ by q, ru ρ = wq + s where the degree of s s less than d q. Then where r = sp + tq t = rv ρ q wp. The degree of t must be less than d p because otherwse the rght hand sde of the equaton r = sp + tq would have hgher degree than the left hand sde. In ths way we see the p and q are relatvely prme f and only f the equaton r = sp + tq s solvable for s and t for any r, the degrees beng less than d q, d p and d q +d r, respectvely. The equaton r = sp + tq can be wrtten n matrx form c = ya where y s a row vector consstng of the coeffcents of s followed by those of t, c s a row vector consstng of the coeffcents of r, and A s a matrx consstng of shfted versons of p and q. More precsely, the th entry of c s the coeffcent of z dp+dq n c, the th entry of y s the coeffcent of z dq of s for d q and s the coeffcent of z dp+dq n t for d q + d p + d q, and the entry n the th row j th column of A s the coeffcent of z dp+dq j n z dq p for d q s the coeffcent of z dp+dq j d q + d p + d q. For example, the equaton n z dpdq q for = z(z 2 + z + ) + (z + )(z 2 + ) n matrx from s c = ya where and c = ( 0 0 0 ), y = ( 0 ), 0 0 A = 0 0. 0 0 The precedng consderatons lead us to the concluson that p and q are relatvely prme f and only f A s nvertble. The happens f and only f the determnant of A s non-zero. Ths determnant has a name. It s called the resultant of the polynomals p and q. A partcularly mportant case s the resultant of p and p, where p and p are related by p = α z, =0 d p = ( + )α + z. =0 In ths case the resultant of p and p s known as the dscrmnant of p. If p looks famlar, n the case of real or complex polynomals ths s the dervatve of p. The defnton makes sense n general though. 4 4 There s however one werd thng whch can happen for felds of non-zero characterstc: the dervatve of a non-constant polynomal may be zero. 6
A polynomal wth no non-constant factors of lower degree s called rreducble. 5 If a polynomal s not rreducble then t must have a factor of lower degree. We can repeatedly dvde out such factors untl we are left wth an rreducble polynomal. The process must termnate after fntely many steps, snce the degree s reduced wth each dvson. Ths sounds smple enough, but ths procedure s, unlke absolutely everythng else n ths set of notes, not constructve. In any case, we can, at least n theory, factor any monc 6 polynomal nto a product of powers of dstnct rreducble monc factors. Ths factorsaton s unque. Both the statement and proof here mrror those for postve ntegers. 7 5 Partal Fractons Suppose p = m = p e where each p s rreducble and p and p j are relatvely prme for j,.e. ther greatest common dvsor s constant. Let d be the degree of p. Defne q,j,k = z d k p e j l l, 5 Snce the termnology for polynomals otherwse mrrors that for ntegers t would have been better to call such polynomals prme rather than rreducble. 6 Monc means wth leadng coeffcent. 7 Ths ncludes the fact that factorng, whle easy n prncple, may be hard n practce. At least we hope t s hard, so much of modern cryptography reles on the dffculty of factorng large ntegers. so that or, equvalently, z d k p = p j q,j,k q,j,k p = zd k p j for all m, j < e, k d. The degree of p s m d = d e, = whch s just the number of polynomals q,j,k. We form a d d matrx A as follows. Each row wll correspond to one of the q,j,k and each column to a power z d l of z. We order the rows by ncreasng values of, then by ncreasng values of j wth that, and by ncreasng values of k wthn that. We order the columns by ncreasng values of l, n other words by decreasng powers of z. So each row represents a polynomal and each column a power of z. The entry n that row and column s then the coeffcent of that power of z n that polynomal. Another way of sayng ths s that Ax = b, where x s the column vector consstng of decreasng powers of z, as before, and b s the column vector whose entres are the polynomals q,j,k. For example, z 4 z z + = (z ) 2 (z 2 + z + ), so the correspondng p, e, q,j,k and A are p = z, e = 2, p 2 = z 2 + z +, e 2 =, 7
and q,, = z, q,2, = z 2 + z +, q 2,, = z 2z 2 + z, q 2,,2 = z 2 2z +, 0 0 0 A = 2 0 0 2 Multplyng A from the rght by a column vector x = gves the column vector z z 2 z q,, q b = Ax =,2, q 2,,. q 2,,2 If we re workng over the complex numbers then we can factor any polynomal nto lnear factors. For example, ( z 4 z z + = (z ) 2 z + 2 + ) ( 2 z + 2 ), 2 so p = z, e = 2, p 2 = z + 2 + 2, e2 =, p = z + 2 2, e =, q,, = z, q,2, = z 2 + z +, ( q 2,, = z 2 + 2 ) z 2 q,, = z + z + 2 2, ( 2 2 ) z 2 z + 2 + 2, and 2 0 0 2 A = 0 2 2 2 2 2 2 2 + 2 +. We return now to the general case. Consder the equaton ya = c. Snce A has a row for each polynomal q,j,k and a column for each power z d we have an entry n y correspondng to each q,j,k and an entry n c correspondng to each z d. A polynomal s zero f and only f all ts coeffcents are, so ya = c f and only f.e. f yax = cx, m e d η,j,k q,j,k = γ d l z d l = j= k= l= where η,j,k s the entry of y n the poston correspondng to q,j,k and γ d l s the entry n c n the poston correspondng to z d l. Defnng the polynomals r and s,j by r = γ d l z d l l= 8
and s,j = d k= η,j,k z d k, the equaton above becomes r = m e = j= s,j p e j l l. Ths equaton n polynomals s equvalent to the equaton r p = m e = j= s,j p j, for ratonal functons, where the polynomals r and s,j are defned by In other words, solvng ya = c s equvalent to computng the partal fracton decomposton of the ratonal functon r/p. Can ths equaton be solved for all column vectors c? Snce A s a square matrx we know from elementary lnear algebra that ether ts range s everythng or ts null space s nonzero. So to show that ths equaton s solvable for all c t suffces to show that there s no non-zero y such that ya = 0. In terms of polynomals, we want to show that f m e = j= s,j p e j l l = 0 then s,j = 0 for all and j. Assume otherwse. Then there s a last value of for whch there s a non-zero s,j and for ths value of there s a last j for whch s,j. But then all the other summands above are dvsble by p e j+ l l. Snce 0 s also dvsble by ths we fnd that s,j p e j l l s dvsble by the same factor. Dvdng by, we then fnd that p e j s,j l l s dvsble by p. None of the p l are dvsble by p, so s,j s dvsble by p. But s,j s of degree at most d, so t must then be zero, contrary to our assumpton. So our assumpton that there s a non-zero s,j n the expanson m e = j= s,j p e j l l = 0 cannot be correct. The matrx A therefore has non-zero null space and hence full range. We conclude that for any polynomal r of degree lower than d there are unque polynomals s,j of degree less than d such that r p = m e = j= s,j p j. Thus the partal fracton expanson of a proper ratonal functon exsts and s unque. Furthermore t can be found explctly by matrx arthmetc. Of course f we have an mproper ratonal functon t/p then we can fnd the quotent and remander t = pq + r 9
and obtan an expanson t p = q + m e = j= s,j p j, smlar to the prevous one, but wth an extra polynomal summand. As an example, we compute the partal fracton expanson of the ratonal functon z 4 z z +. The results wll be dfferent dependng on whether we re workng over the real or complex numbers. Over the reals, we have, as we found before, 0 0 0 A = 2 0. 0 2 Its nverse s 2 A = 0 0 0. Our numerator s, whch s represented by the column vector c = ( 0 0 0 ), so we need to compute y = ca = ( ). Our partal fracton expanson s then z 4 z z +. = (z ) + (z ) 2 + z + z 2 + z +. Over the complex numbers we have 2 0 0 2 A = 0 2 2 2 2 2 2 2 + 2 +, 2 6 + A = 6 6 + 8 0 6 2 2 6 6 +, and y = ( + 8 8 ). The partal fracton expanson s therefore z 4 z z + = z + (z ) 2 + 8 + z + + 2 2 8 + z +. 2 2 In theory complex numbers are smpler to deal wth because all polynomals factor completely but they are often harder to deal wth n practce, as n ths example. 6 The CRT A useful result n elementary number theory s the Chnese Remander Theorem, whch allows us to solve smultaneous congruences. There s a smlar result for polynomals, whch we can now prove. Suppose, as n the prevous secton, that p = m = p e 0
where each p s monc rreducble and p and p j are relatvely prme for j, and that d be the degree of p. For any set of polynomals r k of degree less than d k e k there s a polynomal t of degree less than d such that t r k (mod p e k k ). To see ths let s,j,k be the unque soluton to r k = m e = j= s,j,k p e j l l, whch we know exsts because of the prevous secton. Then e j= for k, so s,j,k p e j l l 0 (mod p e k k ) r k t k (mod p e k k ). where t k = We note that e k j= s k,j,k p e k j k l k l. t k 0 (mod l ) for l k. Also the degree of t k s less than d, so m m e k t = t k = s,j, p e j k= = j= s the polynomal we re seekng. l l.