Research Article On Degrees of Modular Common Divisors and...
Transcript of Research Article On Degrees of Modular Common Divisors and...
Research ArticleOn Degrees of Modular Common Divisors andthe Big Prime gcd Algorithm
Vahagn Mikaelian12
1Yerevan State University Alex Manoogian 1 0025 Yerevan Armenia2American University of Armenia 40 Marshal Baghramyan Ave 0019 Yerevan Armenia
Correspondence should be addressed to Vahagn Mikaelian vmikaelianysuam
Received 6 July 2016 Accepted 28 August 2016
Academic Editor Nawab Hussain
Copyright copy 2016 Vahagn Mikaelian This is an open access article distributed under the Creative Commons Attribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited
We consider a few modifications of the Big prime modular gcd algorithm for polynomials in Z[119909] Our modifications are basedon bounds of degrees of modular common divisors of polynomials on estimates of the number of prime divisors of a resultantand on finding preliminary bounds on degrees of common divisors using auxiliary primesThese modifications are used to suggestimproved algorithms for gcd calculation and for coprime polynomials detection To illustrate the ideas we apply the constructedalgorithms on certain polynomials in particular on polynomials from Knuthrsquos example of intermediate expression swell
1 Introduction
This work is one of the articles in which we would like topresent parts from new introduction to computer algebra [1]that currently is under preparation In [1] we try to give aldquomore algebraicrdquo and detailed view on some of the areas ofcomputer algebra such as algorithms on the Euclidean ringsextensions of fields operators in spaces on finite fields andfactorization in UFDs
The Big prime modular gcd algorithm is one of the firstandmost popular algorithms of computer algebra In its clas-sical form it allows calculating the greatest common divisorgcd(119891(119909) 119892(119909)) for any nonzero polynomials 119891(119909) 119892(119909) isin
Z[119909]There are a fewmodifications of this algorithm for otherUFDs such asmultivariate polynomial rings Attention to thegcd calculation is partially explained by the first examples thatwere built to explain importance of application of algebraicmethods to computer science In particular Knuthrsquos well-known example of intermediate expression swell discussesthe polynomials
119891 (119909) = 1199098+ 1199096minus 31199094minus 31199093+ 81199092+ 2119909 minus 5
119892 (119909) = 31199096+ 51199094minus 41199092minus 9119909 + 21
(1)
and it shows that calculation of gcd(119891(119909) 119892(119909)) by traditionalEuclidean algorithm on rational numbers generates very
large integers to deal with whereas consideration of thesepolynomials modulo 119901 that is consideration of their imagesunder ring homomorphism 120593
119901 Z[119909] rarr Z
119901[119909] (where
Z119901[119909] is the polynomial ring over the residue ring Z
119901cong
Z119901Z) very easily shows that gcd(119891(119909) 119892(119909)) = 1 (see [2] andalso [3ndash6]) We are going to use polynomials (1) as examplesbelow to apply the algorithms below (see Examples 16 18 2225 27 and 29)
The main idea of the Big prime modular gcd algorithmis that for the given polynomials 119891(119909) 119892(119909) isin Z[119909] onemay first consider their images 119891
119901(119909) = 120593
119901(119891(119909)) 119892
119901(119909) =
120593119901(119892(119909)) isin Z
119901[119909] under 120593
119901 Unlike Z[119909] the ring Z
119901[119909] is
an Euclidean domain since it is a polynomial ring over a fieldso gcd(119891
119901(119909) 119892119901(119909)) can be computed in it by the well-known
Euclidean algorithm There remains ldquoto liftrdquo a certain fold119905 sdot gcd(119891
119901(119909) 119892119901(119909)) of it to the ring Z[119909] to reconstruct the
preimage gcd(119891(119909) 119892(119909)) The ldquoliftingrdquo procedure consistsof selecting the suitable value for prime 119901 then finding inZ[119909] an appropriate preimage for gcd(119891
119901(119909) 119892119901(119909)) and then
checking if that preimage divides both 119891(119909) and 119892(119909) If yesit is gcd(119891(119909) 119892(119909)) we are looking for If not then a new119901 need be selected to repeat the process Arguments basedon resultants and on Landau-Mignotte bounds show that wecan effectively choose 119901 such that the number of requiredrepetitions is ldquosmallrdquo
Hindawi Publishing CorporationInternational Journal of Mathematics and Mathematical SciencesVolume 2016 Article ID 3262450 13 pageshttpdxdoiorg10115520163262450
2 International Journal of Mathematics and Mathematical Sciences
The first aim of this work is to present in Sections 2ndash5 a slightly modified argumentation of the algorithm basedon comparison of the degrees of common divisors of 119891(119909)and 119892(119909) in Z[119909] and of 119891
119901(119909) and 119892
119901(119909) in Z
119901[119909] (see
Algorithm 2) This approach allows some simplification ofa step of the algorithm for some primes 119901 we need notreconstruct the preimage of 119905 sdot gcd(119891
119901(119909) 119892119901(119909)) but we
immediately get an indication that this prime is not suitableand we should proceed to a new 119901 (see Remark 15)
Then in Section 6 we discuss the problem if the Big primemodular gcd algorithm could output the correct answer usingjust one prime 119901 or not The answer is positive but for somereasons it should not be used to improve the algorithm (tomake it work with one 119901) because it evolves a very largeprime (see Remark 19) Instead we show that we can estimatethe maximal number of 119901 (repetitions of steps) that may beused in traditional Big prime modular gcd algorithm Forexample for polynomials (1) of Knuthrsquos example this numberis at most 31 Estimates of this type can be found in literatureelsewhere We just make the bound considerably smaller (seeRemark 23)
The obtained bounds on the number of primes 119901 areespecially effective when we are interested not in gcd but justin detection if the polynomials119891(119909) 119892(119909) isin Z[119909] are coprimeor not We consider this in Section 7 (see Algorithm 3)
In Section 8 we consider four other ideas to modify theBig prime modular gcd algorithm Two first ideas are basedon checking the number of primes 119901 The third idea is basedon using an auxiliary prime 119902 to estimate the degree ofgcd(119891(119909) 119892(119909)) by means of the degree of gcd(119891
119902(119909) 119892119902(119909))
(see Algorithm4) Example 27 shows howmuch better resultswe may get by this modification The fourth idea combinesboth approaches it uses a set of auxiliary primes 119902
1 119902
119896+1
to correctly find the degree of gcd(119891(119909) 119892(119909)) and thenwe use a modified version of Landau-Mignotte bound tofind a single big prime 119901 by which we can calculate thegcd(119891
119901(119909) 119892119901(119909))
The arguments used here can be generalized for thecase of polynomials on general UFDs From the uniquefactorization in a UFD it easily follows that gcd alwaysexists and it is easy to detect if the given common divisorof maximal degree is gcd or not The less simple part is tofind ways to compute gcd (without having the prime-powerfactorization) That can be done for some classes of UFDssuch as multivariate polynomials on fields
2 gcd in Polynomial Rings and the Degrees ofCommon Divisors
Theproblem of finding the greatest common divisor gcd(119886 119887)of any nonzero elements 119886 119887 in a ring 119877 can be separated totwo tasks
(1) Finding out if gcd(119886 119887) in general exists for 119886 119887 isin 119877(2) Finding an effective way to calculate gcd(119886 119887)
The Euclidean algorithm gives an easy answer to bothof these tasks in any Euclidean domain that is an integritydomain119877 possessingEuclidean norm 120575 1198770 rarr Ncup0 such
that 120575(119886119887) ge 120575(119886) hold for any nonzero elements 119886 119887 isin 119877 andfor any 119886 119887 isin 119877 where 119887 = 0 there exist elements 119902 119903 isin 119877such that 119886 = 119902119887 + 119903 where either 119903 = 0 or 119903 = 0 and120575(119903) lt 120575(119887) [4 5 7ndash10] The Euclidean algorithm works forany polynomial ring119870[119909] over a field119870 such asQ[119909]R[119909]C[119909] and Z
119901[119909] because these rings can easily be turned to
an Euclidean domain by defining 120575(119891(119909)) = deg119891(119909) for anynonzero 119891(119909) isin 119870[119909]
The situation is less simple in non-Euclidean domainseven in such a widely used ring as the ring Z[119909] of polyno-mials with integer coefficients That Z[119909] is not an Euclideandomain easy to show by elements 119909 2 isin Z[119909] IfZ[119909]were anEuclidean domain it would contain elements 119906(119909) V(119909) suchthat 119909 sdot 119906(119909) + 2 sdot V(119909) = gcd(119909 2) = plusmn1 which is not possible
The first of two tasks mentioned above namely existenceof gcd can be accomplished for Z[119909] by proving that Z[119909] isa UFD that is an integrity domain in which every nonzeroelement 119886 has a factorization 119886 = 120598 119901
1sdot sdot sdot 119901119896 where 120598 isin 119877
lowast
is a unit (invertible) element in 119877 the elements 119901119894are prime
for all 119894 = 1 119896 and the factorization above is uniquein the sense that if 119886 has another factorization of that type120579 1199021sdot sdot sdot 119902119904 where 120579 isin 119877
lowast and the elements 119902119894are prime then
119896 = 119904 and (perhaps after some reordering of the prime factors)the respective prime elements are associated 119901
119894asymp 119902119894for all
119894 = 1 119896 For briefness in the sequel we will often omit thephrase ldquoperhaps after some reordering of the prime factorsrdquoand this will cause no confusion
After merging the associated prime elements together weget a unique factorization into prime-power elements
119886 = ] 1199011205721
1sdot sdot sdot 119901120572119899
119899
] isin 119877lowast 120572119894isin N 119901
119894asymp 119901119895for any 119894 = 119895 119894 119895 = 1 119899
(2)
(in some arguments below we may admit that some of thefactors 119901120572119894
119894participate with degrees 120572
119894= 0 this makes some
notations simpler) From this it is easy to see that in a UFD119877 gcd(119886 119887) exists for any nonzero elements 119886 119887 isin 119877 Assume119887 isin 119877 has the factorization
119887 = 120581 1199011205721015840
1
1sdot sdot sdot 1199011205721015840
119899
119899 120581 isin 119877
lowast (3)
(we use the same primes 119901119894in both factorizations because
if eg 119901119894is not actually participating in one of those
factorizations we can add it as 119901120572119894119894with 120572
119894= 0) Then
gcd (119886 119887) = 119889 = 1199011205741
1sdot sdot sdot 119901120574119899
119899 (4)
where 120574119894= min120572
119894 1205721015840
119894 This follows from uniqueness of
factorization in UFD For if ℎ is a common divisor of 119886 119887 andif 119901119894is a prime divisor of ℎ then it also is a prime divisor of 119886
and of 119887 The elements 119901119894cannot participate in factorization
of ℎ by a power greater than min120572119894 1205721015840
119894 because then 119886 (or
119887) would have an alternative factorization in which 119901119894occurs
more than 120572119894(or 1205721015840119894) times
The shortest way to see that Z[119909] is a UFD is to applyGaussrsquos theorem if the ring 119877 is a UFD then the polynomialring 119877[119909] also is a UFD [4 7 8 10 11] SinceZ is a UFD (thatfact is known as ldquothe fundamental theorem of arithmeticrdquo)Z[119909] also is a UFD
International Journal of Mathematics and Mathematical Sciences 3
Clearly gcd(119886 119887) is defined up to a unit multiplier from119877lowast For integers from 119877 = Z or for polynomials from
119877 = Z[119909] this unit multiplier can be just minus1 or 1 So tosay gcd(119886 119887) is defined ldquoup to the sign plusmn1rdquo because Zlowast =
Z[119909]lowast
= minus1 1 And for polynomials from 119877 = Z119901[119909]
gcd(119886 119887) is defined up to any nonzero multiplier 119905 isin Zlowast119901=
1 119901minus1 Taking this into account we can use gcd(119886 119887) =1 and gcd(119886 119887) asymp 1 as equivalent notations since associatedelements are defined up to a unit multiplier Notice that insome sources they prefer to additionally introduce a normalform of gcd to distinguish one fixed instance of gcd Insteadof using that extra term we will just in a few places refer tothe ldquopositive gcdrdquo meaning that we take for example 2 =
gcd(6 8) and not minus2Furthermore since the content cont(119891(119909)) of a poly-
nomial 119891(119909) is gcd for some elements (coefficients of thepolynomials) the constant and the primitive part pp(119891(119909)) =119891(119909)cont(119891(119909)) can also be considered up to a unit multi-plier For a nonzero polynomial 119891(119909) isin Z[119909] we can choosecont(119891(119909)) so that sgn cont(119891(119909)) = sgn lc(119891(119909)) that isthe cont(119891(119909)) has the same sign as the leading coefficientof 119891(119909) Then the leading coefficient lc(pp(119891(119909))) of theprimitive part pp(119891(119909)) = 119891(119909)cont(119891(119909)) will be positiveWe will use this below without special notification
Now we would like to little restrict the algebraic back-ground we use Two main algebraic systems used in the Bigprimemodular gcd algorithm are the Euclidean domains andthe UFDs However their usage is ldquoasymmetricrdquo in the sensethat the Euclidean domains and Euclidean algorithm areused in many parts of the Big prime modular gcd algorithmwhereas the UFDs are used just to prove that gcd does existMoreover it is easy to understand that (2) and (4) mayhardly be effective tools to calculate gcd since they are usingfactorization of elements to primes while finding such afactorization is amore complicated task than finding just gcdThus it is reasonable to drop the UFDs from considerationand to obtain (2) directly using Gaussrsquos lemma on primitivepolynomials in Z[119909] (a polynomial 119891(119909) isin Z[119909] is primitiveif cont(119891(119909)) asymp 1 that is pp(119891(119909)) = 119891(119909)cont(119891(119909)) asymp
119891(119909))ByGaussrsquos lemma a product of twoprimitive polynomials
is primitive in Z[119909] [4 7 8 10 11] So if
119891 (119909) = cont (119891 (119909)) sdot pp (119891 (119909))
119892 (119909) = cont (119892 (119909)) sdot pp (119892 (119909)) (5)
thencont (119891 (119909) sdot 119892 (119909)) = cont (119891 (119909)) sdot cont (119892 (119909))
pp (119891 (119909) sdot 119892 (119909)) = pp (119891 (119909)) sdot pp (119892 (119909)) (6)
The following is easy to deduce from Gaussrsquos lemma
Lemma 1 If 119891(119909) 119905(119909) isin Z[119909] and 119905(119909) is primitive then if119905(119909) divides 119891(119909) in the ring Q[119909] and then 119905(119909) also divides119891(119909) in Z[119909]
The unique factorization of any nonzero 119891(119909) isin Z[119909]
is easy to obtain from decompositions (6) above and from
Lemma 1 Let us just outline it the details can be found in [1 45 7 8] By the fundamental theoremof arithmetic cont(119891(119909))can in a unique way be presented as a product of powers ofprimes cont(119891(119909)) = ] 119901
1205721
1sdot sdot sdot 119901120572119899
119899 So if deg119891(119909) = 0 then
we are doneAssume deg119891(119909) gt 0 If 119891(119909) is not prime then by
repeatedly splitting it to products of factors of lower degree asmany times as needed we will eventually get a presentationof 119891(119909) as a product of cont(119891(119909)) and of some finitely manyprimitive prime polynomials 119902
119894(119909) of degrees greater than 0
We do not yet have the uniqueness of this decomposition butwe can still group the associated elements together to get thepresentation
119891 (119909) = cont (119891 (119909)) sdot pp (119891 (119909))
= ] 1199011205721
1sdot sdot sdot 119901120572119899
119899sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
(7)
If119891(119909) has another alternative presentation of this sort and if119905(119909) is one of the primitive prime factors (of degree greaterthan 0) of that presentation then product (7) is divisibleby 119905(119909) By Lemma 1 119905(119909) divides 119891(119909) also in Z[119909] Since119905(119909) is prime it is associated with one of 119902
119894(119909) Eliminate
one instance of this 119902119894(119909) in (7) and consider 119891(119909)119902
119894(119909) If
119891(119909)119902119894(119909) also is divisible by 119902
119894(119909) we repeat the process
If not we turn to other primitive prime polynomials (ofdegree greater than 0) dividing what remains from (7)after elimination After finitely many steps (7) will become] 1199011205721
1sdot sdot sdot 119901120572119899
119899 and also from the other alternative presentation
a constant should be left only So we apply the fundamentaltheorem of arithmetic one more time to get that (7) is theunique factorization
We see that (7) is a particular case of (2) The proof aboveavoided usage of Gaussrsquos theorem and the formal definitionsof the UFDs And we see that the prime elements ofZ[119909] areof two types prime numbers and primitive prime polynomialsof degrees greater than 0
Existence of gcd(119891(119909) 119892(119909)) for any two nonzero poly-nomials in 119891(119909) 119892(119909) isin Z[119909] can be deduced from (7) inanalogy with (4) If
119892 (119909) = ]1015840 1199011205721015840
1
1sdot sdot sdot 1199011205721015840
119899
119899sdot 1199021205731015840
1
1(119909) sdot sdot sdot 119902
1205731015840
119898
119898(119909) (8)
then
gcd (119891 (119909) 119892 (119909)) = 120581 1199011205741
1sdot sdot sdot 119901120574119899
119899sdot 1199021205751
1(119909) sdot sdot sdot 119902
120575119898
119898(119909) (9)
where 120581 = plusmn1 120574119894= min120572
119894 1205721015840
119894 and 120575
119895= min120573
119895 1205731015840
119895
(119894 = 1 119899 119895 = 1 119898) However like we admittedearlier (4) and (9) are no effective tools to calculate gcd Wewill turn to gcd calculation algorithm in the next sections (seeAlgorithms 4 and 5)
Equations (4) and (9) allow us to get some informationthat will be essential later Observe that the following defi-nition of gcd often used in elementary mathematics is nolonger true for general polynomial rings ldquo119889(119909) is the greatestcommon divisor of 119891(119909) and 119892(119909) if it is their common divisorof maximal degreerdquo For example for 119891(119909) = 12119909
2+ 24119909 + 12
and 119892(119909) = 8119909 + 8 the maximum of degree of their common
4 International Journal of Mathematics and Mathematical Sciences
divisors is 1 Nevertheless ℎ(119909) = 119909+1 is not gcd(119891(119909) 119892(119909))although ℎ(119909) | 119891(119909) ℎ(119909) | 119892(119909) and deg ℎ(119909) = 1 For 119909+1is not divisible by the common divisor 2119909 + 2 We can detectthe cases when the divisor of highest degree is gcd
Lemma 2 For polynomials 119891(119909) 119892(119909) isin Z[119909] their commondivisor of maximal degree ℎ(119909) is their gcd if and only ifcont(ℎ(119909)) asymp gcd(cont(119891(119909)) cont(119892(119909)))
The lemma easily follows from (7) (8) and (9) We seethat in example above the condition was missing cont(119909 +
1) = 1 but gcd(cont(119891(119909)) cont(119892(119909))) = gcd(12 8) asymp 4 asymp 1In fact gcd(119891(119909) 119892(119909)) asymp 4119909 + 4
Corollary 3 For primitive polynomials 119891(119909) 119892(119909) isin Z[119909]their common divisor of maximal degree ℎ(119909) is their gcd ifand only if ℎ(119909) is primitive
In the case if polynomials are over a field the situation issimpler For any field 119870 the polynomial ring 119870[119909] is a UFD(and even an Euclidean domain) Any nonzero 119891(119909) isin 119870[119909]
has a factorization
119891 (119909) = 120579 sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
120579 isin 119870lowast deg 119902
119894(119909) gt 0 119894 = 1 119898
(10)
which is unique in the sense mentioned above Since allnonzero scalars in119870 are units what we in (7) above had as aproduct of some prime numbers actually ldquomergesrdquo in 119870 intoa unit
] sdot 11990112057211sdot sdot sdot 119901120572119899
119899= 120579 isin 119870
lowast= 119870 0 (11)
Comparing factorizations of type (10) for any nonzeropolynomials 119891(119909) 119892(119909) isin 119870[119909] we easily get the following
Lemma 4 For any nonzero polynomials 119891(119909) 119892(119909) isin 119870[119909]
over a field119870 their common divisor of maximal degree ℎ(119909) istheir gcd
This in particular is true for rings mentioned aboveQ[119909] R[119909] C[119909] and Z
119901[119909] We will use this fact later
to construct the Big prime modular gcd algorithm and itsmodifications
The analog of Lemma 4 was not true for Z[119909] becausein factorization (9) we have the nonunit prime-power fac-tors 119901
120574119894
119894which do participate in factorization of 119889(119909) =
gcd(119891(119909) 119892(119909)) but which add nothing to the degree of 119889(119909)This is why maximality of the degree is no longer the onlycriterion in Z[119909] to detect if the given ℎ(119909) is gcd or not
3 Some Notations for Modular Reductions
The following notations adopted from [1] are to make ourarguments shorter and more uniform when we deal withnumerals polynomials and matrices As above letZ
119901be the
residue ring (finite Galois field Z119901= F119901= 0 119901 minus 1) and
let
120593119901 Z 997888rarr Z
119901 (12)
be the rings homomorphism mapping each 119911 isin Z to theremainder after division of 119911 by 119901 That is 120593
119901(119911) equiv 119911(mod
119901) and 120593119901(119911) isin Z
119901
Weuse the same symbol120593119901to denote the homomorphism
120593119901 Z [119909] 997888rarr Z
119901 [119909] (13)
where Z119901[119909] is the ring of polynomials over Z
119901and 120593
119901is
mapping each of the coefficients 119886119894of 119891(119909) isin Z[119909] to the
remainder after division of 119886119894by 119901
Similarly we define the homomorphism of matrix rings
120593119901 119872119898119899 (Z) 997888rarr 119872
119898119899(Z119901) (14)
which maps each of the elements 119886119894119895of a matrix119860 isin 119872
119898119899(Z)
to the remainder after division of 119886119894119895by 119901
Using the same symbol 120593119901for numeric polynomial
and matrix homomorphisms causes no misunderstandingbelow and it is more comfortable for some reasons Thesehomomorphisms are called ldquomodular reductionsrdquo or justldquoreductionsrdquo We can also specify these homomorphisms asldquonumeric modular reductionrdquo ldquopolynomial modular reduc-tionrdquo or ldquomatrix modular reductionrdquo where needed [1]
For 119886 isin Z denote 120593119901(119886) = 119886
119901 For 119891(119909) isin Z[119909] denote
120593119901(119891(119909)) = 119891
119901(119909) isin Z
119901[119909] So if
119891 (119909) = 1198860119909119899+ sdot sdot sdot + 119886
119899 (15)
then119891119901(119909) = 120593
119901(119891 (119909)) = 120593
119901(1198860) 119909119899+ sdot sdot sdot + 120593
119901(119886119899)
= 1198860119901119909119899+ sdot sdot sdot + 119886
119899119901isin Z119901 [119909]
(16)
And for a matrix 119860 isin 119872119898119899
(Z) denote 120593119901(119860) = 119860
119901isin
119872119898119899
(Z119901) If 119860 = 119886
119894119895119898times119899
then 119860119901
= 120593119901(119886119894119895)119898times119899
=
119886119894119895119901
119898times119899
4 Problems at Lifting the Modular gcd to Z[119909]
Now we turn to the second task mentioned earlier effectivecalculation of the actual gcd(119891(119909) 119892(119909)) for the given nonzeropolynomials 119891(119909) 119892(119909) isin Z[119909]
The ring Z119901[119909] is an Euclidean domain unlike the ring
Z[119909] So we can use the Euclidean algorithm to calcu-late gcd for any nonzero polynomials in Z
119901[119909] including
the modular images 119891119901(119909) and 119892
119901(119909) Since the notation
gcd(119891119901(119909) 119892119901(119909)) is going to be used repeatedly for brief-
ness denote by 119890119901(119909) gcd calculated by Euclidean algorithm
for 119891119901(119909) 119892119901(119909) Let us stress that gcd(119891
119901(119909) 119892119901(119909)) is not
determined uniquely since for any nonzero 119905 isin Z119901the
product 119905 sdot gcd(119891119901(119909) 119892119901(119909)) also is gcd for 119891
119901(119909) 119892119901(119909) We
are denoting just one of these gcdrsquos (namely that computedby the Euclidean algorithm) by 119890
119901(119909) This 119890
119901(119909) is unique
since at each step of the Euclidean algorithmwe have a uniqueaction to take (to see this just consider the steps of ldquolongdivisionrdquo used to divide 119891
119901(119909) by 119892
119901(119909) on field Z
119901)
The main idea of the algorithm is to calculate 119890119901(119909) asymp
gcd(119891119901(119909) 119892119901(119909)) for some suitable 119901 and to reconstruct
119889(119909) = gcd(119891(119909) 119892(119909)) by it We separate the process to fourmain problems that may occur and show how to overcomeeach one to arrive to a correctly working algorithm
International Journal of Mathematics and Mathematical Sciences 5
41 Problem 1 Avoiding the Eliminating Coefficients Afterreduction 120593
119901 some of the coefficients of 119891(119909) and 119892(119909) may
change or even be eliminated So their images 119891119901(119909) =
120593119901(119891(119909)) and 119892
119901(119909) = 120593
119901(119892(119909)) may keep very little
information to reconstruct 119889(119909) based on 119890119901(119909)
Example 5 If 119891(119909) = 71199092+ 22 and 119892(119909) = 49119909
3+ 154119909
then for 119901 = 7 we get 119891119901(119909) = 1 and 119892
119901(119909) = 0 So
these values contain no reliable information to reconstructgcd(119891(119909) 119892(119909))
The first simple idea to avoid such elimination is to take119901 larger than the absolute value of all coefficients of 119891(119909) and119892(119909) This however is not enough since a divisor ℎ(119909) of apolynomial 119891(119909) may have coefficients larger than those of119891(119909) Moreover using the cyclotomic polynomials for largeenough 119899
120601119899(119909) = prod
119896=1119899(119896119899)=1
(119909 minus 1198902119894120587119896119899
) (17)
one can get divisors of 119891(119909) = 119909119899minus 1 which have a coefficient
larger than any pregiven number [1 4 8] Since we do notknow the divisors of 119891(119909) and 119892(119909) we cannot be sure ifthe abovementioned large 119901 will be large enough to preventelimination of coefficients of ℎ(119909) To overcome this one canuse the Landau-Mignotte bounds (in different sources thebounds on coefficients of the divisors are called differentlyassociating them with names of L Landau or M Mignotteor with both of them these authors have different roles indevelopment of the formulas which in turn are consequenceof a formula by A L Cauchy) as done in [4ndash6] For apolynomial 119891(119909) given by (15) denote its norm by 119891(119909) =
radicsum119899
119894=01198862119894
Theorem6 (L LandauMMignotte) Let119891(119909) = 1198860119909119899+sdot sdot sdot+
119886119899and ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896be nonzero polynomials in Z[119909]
If ℎ(119909) is a divisor of 119891(119909) then
119899
sum119894=0
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot10038161003816100381610038161003816100381610038161003816
1198880
1198860
10038161003816100381610038161003816100381610038161003816sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (18)
The proof is based on calculations on complex numbersand it can be found for example in [1 4] We are going to usethe Landau-Mignotte bounds in the following two shapes
Corollary 7 In notations of Theorem 6 there is the followingupper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891= 2119899minus1 1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (19)
Proof To obtain this from (18) first notice that |11988801198860| le 1
Next if 119896 = deg ℎ(119909) = deg119891(119909) = 119899 then 119891(119909) = 119903 sdot
ℎ(119909) where 119903 is a nonzero integer Then |119888119894| le max|119888
119894| | 119894 =
0 119899 le max|119886119894| | 119894 = 0 119899 le 119891(119909)
Finally if 119896 = deg ℎ(119909) le 119899 minus 1 (119896 is unknown to us) thenwe can simply replace in (18) the value 2119896 by 2119899minus1
Remark 8 In literature they use the rather less accuratebound |119888
119894| le 2119899119891(119909) but the second paragraph of our proof
above allows replacing 2119899 by 2119899minus1 See also Remark 23
Corollary 9 In notations ofTheorem 6 if ℎ(119909) also is a divisorof the polynomial 119892(119909) = 119887
0119909119898+ sdot sdot sdot + 119887
119898 then there is the
following upper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891119892
= 2min119899119898
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(20)
Proof To obtain this from (18) just notice that if ℎ(119909)
is a common divisor for 119891(119909) and 119892(119909) then its leadingcoefficient 119888
0divides both 119886
0and 1198870
Formula (20) provides the hint to overcome Problem1 about eliminating coefficients mentioned at the start ofthis subsection Although the divisors ℎ(119909) of 119891(119909) and119892(119909) are yet unknown we can compute 119873
119891119892and take
119901 gt 119873119891119892 If we apply the reduction 120593
119901for this 119901 we can
be sure that none of the coefficients of ℎ(119909) has changedldquomuchrdquo under that homomorphism for 120593
119901does not alter
the nonnegative coefficients of ℎ(119909) and it just adds 119901 to allnegative coefficients of ℎ(119909) The same holds true for 119889(119909) =gcd(119891(119909) 119892(119909))
42 Problem 2 Negative Coefficients and Reconstruction ofthe Preimage The reduction 120593
119901is not a bijection and 119889
119901(119909)
has infinitely many preimages in Z[119909] But the relativelyuncomplicated relationship between coefficients of 119889(119909) and119889119901(119909) obtained in previous subsection may allow us to
reconstruct 119889(119909) if we know 119889119901(119909) The condition 119901 gt 119873
119891119892
puts a restriction on the preimage 119889(119909) the coefficients of119889(119909) either are equal to respective coefficients of119889
119901(119909) (if they
are nonnegative) or are the respective coefficients of 119889119901(119909)
minus 119901 (if they are negative) Reconstruction may causeproblems connected with negative coefficients
Example 10 If for some polynomials 119891(119909) 119892(119909) we have119873119891119892
= 15 we can take the prime say 119901 = 17 gt 119873119891119892 Assume
we have somehow calculated 11988917(119909) = 12119909
3+ 3119909 + 10 we
can be sure that 119889(119909) is not the preimage 291199093 minus 171199092 + 20119909+27 because 119889(119909) cannot have coefficients greater than 15 byabsolute value But we still cannot be sure if the preimage119889(119909)is 121199093 +3119909+10 or minus51199093 +3119909+10 or maybe minus51199093 minus14119909minus7
It is easy to overcome this by just taking a larger value
119901 gt 2 sdot 119873119891119892 (21)
If the coefficient 119888119894of 119889(119909) is nonnegative then 120593
119901(119888119894) =
119888119894lt 1199012 and if it is negative then 120593
119901(119888119894) = 119888119894+ 119901 gt 1199012
This provides us with the very simple method as shown inAlgorithm 1 to reconstruct 119889(119909) if we have already computed119889119901(119909) for sufficiently large prime 119901
6 International Journal of Mathematics and Mathematical Sciences
Input For an unknown polynomial 119889(119909) isin Z[119909] we knowthe upper bound119873 of absolute values of its coefficientsand for arbitrarily large prime number 119901 we have themodular image 119889
119901(119909) = 119887
0119901119909119896+ sdot sdot sdot + 119887
119896119901isin Z119901[119909]
Reconstruct the polynomial 119889(119909)(01) Choose any prime 119901 gt 2 sdot 119873(02) Set 119896 = deg 119889
119901(119909)
(03) Set 119894 = 0(04) While 119894 le 119896
(05) if 119887119894119901
lt 1199012
(06) set 119887119894= 119887119894119901
(07) else(08) set 119887
119894= 119887119894119901
minus 119901(10) set 119894 = 119894 + 1(11) Output 119889(119909) = 119887
0119909119896+ sdot sdot sdot + 119887
119896
Algorithm 1 The polynomial reconstruction by modular image
43 Problem 3 Finding the Correct Fold of the Modular gcdof Right Degree Now additionally assume the polynomials119891(119909) 119892(119909) isin Z[119909] to be primitive Since cont(119891(119909)) andcont(119892(119909)) are defined up to the sign plusmn1 we can without lossof generality admit the leading coefficients of119891(119909) 119892(119909) to bepositive
Below in Problem 4 we will see that for some 119901 thepolynomial 119890
119901(119909) computed by the Euclidean algorithm in
Z119901[119909] may not be the image of 119889(119909) and moreover its
degree may be different from that of 119889(119909) This means thatby applying Algorithm 1 to 119890
119901(119909) we may not obtain 119889(119909)
Assume however we have 119901 which meets the condition 119901 gt
2 sdot 119873119891119892
and for which
deg 119889 (119909) = deg 119890119901(119909) (22)
By Corollary 3 a common divisor of 119891(119909) 119892(119909) is 119889(119909) =
gcd(119891(119909) 119892(119909)) if and only if it is primitive and if its degreeis the maximum of degrees of all common divisors Since120593119901does not change the degree of 119889(119909) we get by Lemma 4
(applied for the field119870 = Z119901) that119889
119901(119909) is gcd of119891
119901(119909) 119892119901(119909)
in Z119901[119909] This correspondence surely is not one-to-one
because in Z[119909] gcd is calculated up to the unit element ofZ[119909] which is plusmn1 whereas in Z
119901[119909] gcd is calculated up to
the unit element ofZ119901[119909] which can be any nonzero number
119905 isin Zlowast119901= 1 119901minus1 So the polynomial 119890
119901(119909) calculated by
the Euclidean algorithmmay not be the image 119889119901(119909) of 119889(119909)
Example 11 For 119891(119909) = 1199092+ 4119909 + 3 and 119892(119909) = 119909
2+ 2119909 + 1
whichever prime 119901 gt 4 we take we will get by the Euclideanalgorithm
119890119901(119909) = gcd (119891
119901(119909) 119892
119901(119909)) = 2119909 + 2 isin Z
119901 [119909] (23)
But in Z[119909] we have 119889(119909) = 119909 + 1 So regardless how large 119901we choose we will never get 120593
119901(119909 + 1) = 2119909 + 2
In other words we are aware that the image 119889119901(119909) is one
of the folds 119905 sdot 119890119901(119909) of 119890
119901(119909) for some 119905 isin 1 119901 minus 1 but
we are not aware which 119905 is that
The leading coefficient 1198880= lc(119889(119909)) of 119889(119909) can also be
assumed to be positive Denote by 119908 the positive gcd(1198860 1198870)
Since both 1198880and 119908 are not altered by 120593
119901 their fraction 119908119888
0
also is not altered Take such 119905 that
lc (119905 sdot 119890119901(119909)) = 119908 (24)
Even if 119905 sdot 119890119901(119909) is not the image 119889
119901(119909) it is the image of 119897 sdot
119889(119909) where 119897 divides1199081198880 If we calculate the preimage 119896(119909) isin
Z[119909] of 119905 sdot 119890119901(119909) by Algorithm 1 we will get a polynomial
which is either 119889(119909) or some fold of 119889(119909) Since 119891(119909) 119892(119909)are primitive it remains to go to the primitive part 119889(119909) =
pp(119896(119909))The general case when 119891(119909) 119892(119909) may not be primi-
tive can easily be reduced to the following for arbitrary119891(119909) 119892(119909) take their decompositions by formula (5) and set
119903 = gcd (cont (119891 (119909)) cont (119892 (119909))) isin Z (25)
Then assign 119891(119909) = pp(119891(119909)) 119892(119909) = pp(119892(119909)) and do thesteps above for these new polynomials After 119889(119909) = pp(119896(119909))is computed we get the final answer as 119903 sdot 119889(119909) = 119903 sdot pp(119896(119909))
Notice that for Algorithm 1 we need 119901 to be greater thanany coefficient |119888
119894| of the polynomial we reconstruct The
bound 119901 gt 2 sdot 119873119891119892
assures that 119901 meets this condition for119889(119909) We however reconstruct not 119889(119909) but 119897 sdot 119889(119909) whichmay have larger coefficients One could overcome this pointby taking 119901 gt 119908 sdot 2 sdot 119873
119891119892 but this is not necessary because
as we see later while the Big prime modular gcd algorithmworks the value of 119901 will grow and this issue will be covered
44 Problem 4 Finding the Right Degree for the Modular gcdAs we saw one can reconstruct 119889(119909) if we find 119901 gt 2 sdot 119873
119891119892
such that condition (22) holds Consider an example to seethat (22) may actually not hold for some 119901 even if 120593
119901is not
altering the coefficients of 119891(119909) and 119892(119909)
Example 12 For 119891(119909) = 1199092+ 1 and 119892(119909) = 119909 + 1 we have
119889(119909) = gcd(119891(119909) 119892(119909)) = 1 Taking 119901 = 2 we get 1198912(119909) =
1199092+ 1 and 119892
2(119909) = 119909 + 1 In Z
2[119909] we have 119891
2(119909) = 119909
2+ 1 =
1199092+12= (119909+1)(119909+1) thus 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) = 119909+1
We get that 1 = deg(119909 + 1) gt deg(119909) = 0 In particularwhatever 119905 we take 119905 sdot (119909 + 1) is not the image of 119889(119909) = 1
under 1205932
The idea to overcome this problem is to show that thenumber of primes 119901 for which (22) falsifies is ldquosmallrdquo Soif the selected 119901 is not suitable we take another 119901 and do thecalculation again by the new prime And we will not have torepeat these steps for many times (we will turn to this pointin Section 6)
The proof of the following theorem and the definition ofthe resultant res(119891(119909) 119892(119909)) (ie of the determinant of theSylvestermatrix 119878
119891119892of polynomials119891(119909) 119892(119909)) can be found
for example in [1 4 7 10]The resultant is a comfortable toolto detect if the given polynomials are coprime
Theorem 13 Let 119877 be an integrity domain The polynomials119891(119909) 119892(119909) isin 119877[119909] are coprime if and only if res(119891(119909) 119892(119909)) =
0
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
2 International Journal of Mathematics and Mathematical Sciences
The first aim of this work is to present in Sections 2ndash5 a slightly modified argumentation of the algorithm basedon comparison of the degrees of common divisors of 119891(119909)and 119892(119909) in Z[119909] and of 119891
119901(119909) and 119892
119901(119909) in Z
119901[119909] (see
Algorithm 2) This approach allows some simplification ofa step of the algorithm for some primes 119901 we need notreconstruct the preimage of 119905 sdot gcd(119891
119901(119909) 119892119901(119909)) but we
immediately get an indication that this prime is not suitableand we should proceed to a new 119901 (see Remark 15)
Then in Section 6 we discuss the problem if the Big primemodular gcd algorithm could output the correct answer usingjust one prime 119901 or not The answer is positive but for somereasons it should not be used to improve the algorithm (tomake it work with one 119901) because it evolves a very largeprime (see Remark 19) Instead we show that we can estimatethe maximal number of 119901 (repetitions of steps) that may beused in traditional Big prime modular gcd algorithm Forexample for polynomials (1) of Knuthrsquos example this numberis at most 31 Estimates of this type can be found in literatureelsewhere We just make the bound considerably smaller (seeRemark 23)
The obtained bounds on the number of primes 119901 areespecially effective when we are interested not in gcd but justin detection if the polynomials119891(119909) 119892(119909) isin Z[119909] are coprimeor not We consider this in Section 7 (see Algorithm 3)
In Section 8 we consider four other ideas to modify theBig prime modular gcd algorithm Two first ideas are basedon checking the number of primes 119901 The third idea is basedon using an auxiliary prime 119902 to estimate the degree ofgcd(119891(119909) 119892(119909)) by means of the degree of gcd(119891
119902(119909) 119892119902(119909))
(see Algorithm4) Example 27 shows howmuch better resultswe may get by this modification The fourth idea combinesboth approaches it uses a set of auxiliary primes 119902
1 119902
119896+1
to correctly find the degree of gcd(119891(119909) 119892(119909)) and thenwe use a modified version of Landau-Mignotte bound tofind a single big prime 119901 by which we can calculate thegcd(119891
119901(119909) 119892119901(119909))
The arguments used here can be generalized for thecase of polynomials on general UFDs From the uniquefactorization in a UFD it easily follows that gcd alwaysexists and it is easy to detect if the given common divisorof maximal degree is gcd or not The less simple part is tofind ways to compute gcd (without having the prime-powerfactorization) That can be done for some classes of UFDssuch as multivariate polynomials on fields
2 gcd in Polynomial Rings and the Degrees ofCommon Divisors
Theproblem of finding the greatest common divisor gcd(119886 119887)of any nonzero elements 119886 119887 in a ring 119877 can be separated totwo tasks
(1) Finding out if gcd(119886 119887) in general exists for 119886 119887 isin 119877(2) Finding an effective way to calculate gcd(119886 119887)
The Euclidean algorithm gives an easy answer to bothof these tasks in any Euclidean domain that is an integritydomain119877 possessingEuclidean norm 120575 1198770 rarr Ncup0 such
that 120575(119886119887) ge 120575(119886) hold for any nonzero elements 119886 119887 isin 119877 andfor any 119886 119887 isin 119877 where 119887 = 0 there exist elements 119902 119903 isin 119877such that 119886 = 119902119887 + 119903 where either 119903 = 0 or 119903 = 0 and120575(119903) lt 120575(119887) [4 5 7ndash10] The Euclidean algorithm works forany polynomial ring119870[119909] over a field119870 such asQ[119909]R[119909]C[119909] and Z
119901[119909] because these rings can easily be turned to
an Euclidean domain by defining 120575(119891(119909)) = deg119891(119909) for anynonzero 119891(119909) isin 119870[119909]
The situation is less simple in non-Euclidean domainseven in such a widely used ring as the ring Z[119909] of polyno-mials with integer coefficients That Z[119909] is not an Euclideandomain easy to show by elements 119909 2 isin Z[119909] IfZ[119909]were anEuclidean domain it would contain elements 119906(119909) V(119909) suchthat 119909 sdot 119906(119909) + 2 sdot V(119909) = gcd(119909 2) = plusmn1 which is not possible
The first of two tasks mentioned above namely existenceof gcd can be accomplished for Z[119909] by proving that Z[119909] isa UFD that is an integrity domain in which every nonzeroelement 119886 has a factorization 119886 = 120598 119901
1sdot sdot sdot 119901119896 where 120598 isin 119877
lowast
is a unit (invertible) element in 119877 the elements 119901119894are prime
for all 119894 = 1 119896 and the factorization above is uniquein the sense that if 119886 has another factorization of that type120579 1199021sdot sdot sdot 119902119904 where 120579 isin 119877
lowast and the elements 119902119894are prime then
119896 = 119904 and (perhaps after some reordering of the prime factors)the respective prime elements are associated 119901
119894asymp 119902119894for all
119894 = 1 119896 For briefness in the sequel we will often omit thephrase ldquoperhaps after some reordering of the prime factorsrdquoand this will cause no confusion
After merging the associated prime elements together weget a unique factorization into prime-power elements
119886 = ] 1199011205721
1sdot sdot sdot 119901120572119899
119899
] isin 119877lowast 120572119894isin N 119901
119894asymp 119901119895for any 119894 = 119895 119894 119895 = 1 119899
(2)
(in some arguments below we may admit that some of thefactors 119901120572119894
119894participate with degrees 120572
119894= 0 this makes some
notations simpler) From this it is easy to see that in a UFD119877 gcd(119886 119887) exists for any nonzero elements 119886 119887 isin 119877 Assume119887 isin 119877 has the factorization
119887 = 120581 1199011205721015840
1
1sdot sdot sdot 1199011205721015840
119899
119899 120581 isin 119877
lowast (3)
(we use the same primes 119901119894in both factorizations because
if eg 119901119894is not actually participating in one of those
factorizations we can add it as 119901120572119894119894with 120572
119894= 0) Then
gcd (119886 119887) = 119889 = 1199011205741
1sdot sdot sdot 119901120574119899
119899 (4)
where 120574119894= min120572
119894 1205721015840
119894 This follows from uniqueness of
factorization in UFD For if ℎ is a common divisor of 119886 119887 andif 119901119894is a prime divisor of ℎ then it also is a prime divisor of 119886
and of 119887 The elements 119901119894cannot participate in factorization
of ℎ by a power greater than min120572119894 1205721015840
119894 because then 119886 (or
119887) would have an alternative factorization in which 119901119894occurs
more than 120572119894(or 1205721015840119894) times
The shortest way to see that Z[119909] is a UFD is to applyGaussrsquos theorem if the ring 119877 is a UFD then the polynomialring 119877[119909] also is a UFD [4 7 8 10 11] SinceZ is a UFD (thatfact is known as ldquothe fundamental theorem of arithmeticrdquo)Z[119909] also is a UFD
International Journal of Mathematics and Mathematical Sciences 3
Clearly gcd(119886 119887) is defined up to a unit multiplier from119877lowast For integers from 119877 = Z or for polynomials from
119877 = Z[119909] this unit multiplier can be just minus1 or 1 So tosay gcd(119886 119887) is defined ldquoup to the sign plusmn1rdquo because Zlowast =
Z[119909]lowast
= minus1 1 And for polynomials from 119877 = Z119901[119909]
gcd(119886 119887) is defined up to any nonzero multiplier 119905 isin Zlowast119901=
1 119901minus1 Taking this into account we can use gcd(119886 119887) =1 and gcd(119886 119887) asymp 1 as equivalent notations since associatedelements are defined up to a unit multiplier Notice that insome sources they prefer to additionally introduce a normalform of gcd to distinguish one fixed instance of gcd Insteadof using that extra term we will just in a few places refer tothe ldquopositive gcdrdquo meaning that we take for example 2 =
gcd(6 8) and not minus2Furthermore since the content cont(119891(119909)) of a poly-
nomial 119891(119909) is gcd for some elements (coefficients of thepolynomials) the constant and the primitive part pp(119891(119909)) =119891(119909)cont(119891(119909)) can also be considered up to a unit multi-plier For a nonzero polynomial 119891(119909) isin Z[119909] we can choosecont(119891(119909)) so that sgn cont(119891(119909)) = sgn lc(119891(119909)) that isthe cont(119891(119909)) has the same sign as the leading coefficientof 119891(119909) Then the leading coefficient lc(pp(119891(119909))) of theprimitive part pp(119891(119909)) = 119891(119909)cont(119891(119909)) will be positiveWe will use this below without special notification
Now we would like to little restrict the algebraic back-ground we use Two main algebraic systems used in the Bigprimemodular gcd algorithm are the Euclidean domains andthe UFDs However their usage is ldquoasymmetricrdquo in the sensethat the Euclidean domains and Euclidean algorithm areused in many parts of the Big prime modular gcd algorithmwhereas the UFDs are used just to prove that gcd does existMoreover it is easy to understand that (2) and (4) mayhardly be effective tools to calculate gcd since they are usingfactorization of elements to primes while finding such afactorization is amore complicated task than finding just gcdThus it is reasonable to drop the UFDs from considerationand to obtain (2) directly using Gaussrsquos lemma on primitivepolynomials in Z[119909] (a polynomial 119891(119909) isin Z[119909] is primitiveif cont(119891(119909)) asymp 1 that is pp(119891(119909)) = 119891(119909)cont(119891(119909)) asymp
119891(119909))ByGaussrsquos lemma a product of twoprimitive polynomials
is primitive in Z[119909] [4 7 8 10 11] So if
119891 (119909) = cont (119891 (119909)) sdot pp (119891 (119909))
119892 (119909) = cont (119892 (119909)) sdot pp (119892 (119909)) (5)
thencont (119891 (119909) sdot 119892 (119909)) = cont (119891 (119909)) sdot cont (119892 (119909))
pp (119891 (119909) sdot 119892 (119909)) = pp (119891 (119909)) sdot pp (119892 (119909)) (6)
The following is easy to deduce from Gaussrsquos lemma
Lemma 1 If 119891(119909) 119905(119909) isin Z[119909] and 119905(119909) is primitive then if119905(119909) divides 119891(119909) in the ring Q[119909] and then 119905(119909) also divides119891(119909) in Z[119909]
The unique factorization of any nonzero 119891(119909) isin Z[119909]
is easy to obtain from decompositions (6) above and from
Lemma 1 Let us just outline it the details can be found in [1 45 7 8] By the fundamental theoremof arithmetic cont(119891(119909))can in a unique way be presented as a product of powers ofprimes cont(119891(119909)) = ] 119901
1205721
1sdot sdot sdot 119901120572119899
119899 So if deg119891(119909) = 0 then
we are doneAssume deg119891(119909) gt 0 If 119891(119909) is not prime then by
repeatedly splitting it to products of factors of lower degree asmany times as needed we will eventually get a presentationof 119891(119909) as a product of cont(119891(119909)) and of some finitely manyprimitive prime polynomials 119902
119894(119909) of degrees greater than 0
We do not yet have the uniqueness of this decomposition butwe can still group the associated elements together to get thepresentation
119891 (119909) = cont (119891 (119909)) sdot pp (119891 (119909))
= ] 1199011205721
1sdot sdot sdot 119901120572119899
119899sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
(7)
If119891(119909) has another alternative presentation of this sort and if119905(119909) is one of the primitive prime factors (of degree greaterthan 0) of that presentation then product (7) is divisibleby 119905(119909) By Lemma 1 119905(119909) divides 119891(119909) also in Z[119909] Since119905(119909) is prime it is associated with one of 119902
119894(119909) Eliminate
one instance of this 119902119894(119909) in (7) and consider 119891(119909)119902
119894(119909) If
119891(119909)119902119894(119909) also is divisible by 119902
119894(119909) we repeat the process
If not we turn to other primitive prime polynomials (ofdegree greater than 0) dividing what remains from (7)after elimination After finitely many steps (7) will become] 1199011205721
1sdot sdot sdot 119901120572119899
119899 and also from the other alternative presentation
a constant should be left only So we apply the fundamentaltheorem of arithmetic one more time to get that (7) is theunique factorization
We see that (7) is a particular case of (2) The proof aboveavoided usage of Gaussrsquos theorem and the formal definitionsof the UFDs And we see that the prime elements ofZ[119909] areof two types prime numbers and primitive prime polynomialsof degrees greater than 0
Existence of gcd(119891(119909) 119892(119909)) for any two nonzero poly-nomials in 119891(119909) 119892(119909) isin Z[119909] can be deduced from (7) inanalogy with (4) If
119892 (119909) = ]1015840 1199011205721015840
1
1sdot sdot sdot 1199011205721015840
119899
119899sdot 1199021205731015840
1
1(119909) sdot sdot sdot 119902
1205731015840
119898
119898(119909) (8)
then
gcd (119891 (119909) 119892 (119909)) = 120581 1199011205741
1sdot sdot sdot 119901120574119899
119899sdot 1199021205751
1(119909) sdot sdot sdot 119902
120575119898
119898(119909) (9)
where 120581 = plusmn1 120574119894= min120572
119894 1205721015840
119894 and 120575
119895= min120573
119895 1205731015840
119895
(119894 = 1 119899 119895 = 1 119898) However like we admittedearlier (4) and (9) are no effective tools to calculate gcd Wewill turn to gcd calculation algorithm in the next sections (seeAlgorithms 4 and 5)
Equations (4) and (9) allow us to get some informationthat will be essential later Observe that the following defi-nition of gcd often used in elementary mathematics is nolonger true for general polynomial rings ldquo119889(119909) is the greatestcommon divisor of 119891(119909) and 119892(119909) if it is their common divisorof maximal degreerdquo For example for 119891(119909) = 12119909
2+ 24119909 + 12
and 119892(119909) = 8119909 + 8 the maximum of degree of their common
4 International Journal of Mathematics and Mathematical Sciences
divisors is 1 Nevertheless ℎ(119909) = 119909+1 is not gcd(119891(119909) 119892(119909))although ℎ(119909) | 119891(119909) ℎ(119909) | 119892(119909) and deg ℎ(119909) = 1 For 119909+1is not divisible by the common divisor 2119909 + 2 We can detectthe cases when the divisor of highest degree is gcd
Lemma 2 For polynomials 119891(119909) 119892(119909) isin Z[119909] their commondivisor of maximal degree ℎ(119909) is their gcd if and only ifcont(ℎ(119909)) asymp gcd(cont(119891(119909)) cont(119892(119909)))
The lemma easily follows from (7) (8) and (9) We seethat in example above the condition was missing cont(119909 +
1) = 1 but gcd(cont(119891(119909)) cont(119892(119909))) = gcd(12 8) asymp 4 asymp 1In fact gcd(119891(119909) 119892(119909)) asymp 4119909 + 4
Corollary 3 For primitive polynomials 119891(119909) 119892(119909) isin Z[119909]their common divisor of maximal degree ℎ(119909) is their gcd ifand only if ℎ(119909) is primitive
In the case if polynomials are over a field the situation issimpler For any field 119870 the polynomial ring 119870[119909] is a UFD(and even an Euclidean domain) Any nonzero 119891(119909) isin 119870[119909]
has a factorization
119891 (119909) = 120579 sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
120579 isin 119870lowast deg 119902
119894(119909) gt 0 119894 = 1 119898
(10)
which is unique in the sense mentioned above Since allnonzero scalars in119870 are units what we in (7) above had as aproduct of some prime numbers actually ldquomergesrdquo in 119870 intoa unit
] sdot 11990112057211sdot sdot sdot 119901120572119899
119899= 120579 isin 119870
lowast= 119870 0 (11)
Comparing factorizations of type (10) for any nonzeropolynomials 119891(119909) 119892(119909) isin 119870[119909] we easily get the following
Lemma 4 For any nonzero polynomials 119891(119909) 119892(119909) isin 119870[119909]
over a field119870 their common divisor of maximal degree ℎ(119909) istheir gcd
This in particular is true for rings mentioned aboveQ[119909] R[119909] C[119909] and Z
119901[119909] We will use this fact later
to construct the Big prime modular gcd algorithm and itsmodifications
The analog of Lemma 4 was not true for Z[119909] becausein factorization (9) we have the nonunit prime-power fac-tors 119901
120574119894
119894which do participate in factorization of 119889(119909) =
gcd(119891(119909) 119892(119909)) but which add nothing to the degree of 119889(119909)This is why maximality of the degree is no longer the onlycriterion in Z[119909] to detect if the given ℎ(119909) is gcd or not
3 Some Notations for Modular Reductions
The following notations adopted from [1] are to make ourarguments shorter and more uniform when we deal withnumerals polynomials and matrices As above letZ
119901be the
residue ring (finite Galois field Z119901= F119901= 0 119901 minus 1) and
let
120593119901 Z 997888rarr Z
119901 (12)
be the rings homomorphism mapping each 119911 isin Z to theremainder after division of 119911 by 119901 That is 120593
119901(119911) equiv 119911(mod
119901) and 120593119901(119911) isin Z
119901
Weuse the same symbol120593119901to denote the homomorphism
120593119901 Z [119909] 997888rarr Z
119901 [119909] (13)
where Z119901[119909] is the ring of polynomials over Z
119901and 120593
119901is
mapping each of the coefficients 119886119894of 119891(119909) isin Z[119909] to the
remainder after division of 119886119894by 119901
Similarly we define the homomorphism of matrix rings
120593119901 119872119898119899 (Z) 997888rarr 119872
119898119899(Z119901) (14)
which maps each of the elements 119886119894119895of a matrix119860 isin 119872
119898119899(Z)
to the remainder after division of 119886119894119895by 119901
Using the same symbol 120593119901for numeric polynomial
and matrix homomorphisms causes no misunderstandingbelow and it is more comfortable for some reasons Thesehomomorphisms are called ldquomodular reductionsrdquo or justldquoreductionsrdquo We can also specify these homomorphisms asldquonumeric modular reductionrdquo ldquopolynomial modular reduc-tionrdquo or ldquomatrix modular reductionrdquo where needed [1]
For 119886 isin Z denote 120593119901(119886) = 119886
119901 For 119891(119909) isin Z[119909] denote
120593119901(119891(119909)) = 119891
119901(119909) isin Z
119901[119909] So if
119891 (119909) = 1198860119909119899+ sdot sdot sdot + 119886
119899 (15)
then119891119901(119909) = 120593
119901(119891 (119909)) = 120593
119901(1198860) 119909119899+ sdot sdot sdot + 120593
119901(119886119899)
= 1198860119901119909119899+ sdot sdot sdot + 119886
119899119901isin Z119901 [119909]
(16)
And for a matrix 119860 isin 119872119898119899
(Z) denote 120593119901(119860) = 119860
119901isin
119872119898119899
(Z119901) If 119860 = 119886
119894119895119898times119899
then 119860119901
= 120593119901(119886119894119895)119898times119899
=
119886119894119895119901
119898times119899
4 Problems at Lifting the Modular gcd to Z[119909]
Now we turn to the second task mentioned earlier effectivecalculation of the actual gcd(119891(119909) 119892(119909)) for the given nonzeropolynomials 119891(119909) 119892(119909) isin Z[119909]
The ring Z119901[119909] is an Euclidean domain unlike the ring
Z[119909] So we can use the Euclidean algorithm to calcu-late gcd for any nonzero polynomials in Z
119901[119909] including
the modular images 119891119901(119909) and 119892
119901(119909) Since the notation
gcd(119891119901(119909) 119892119901(119909)) is going to be used repeatedly for brief-
ness denote by 119890119901(119909) gcd calculated by Euclidean algorithm
for 119891119901(119909) 119892119901(119909) Let us stress that gcd(119891
119901(119909) 119892119901(119909)) is not
determined uniquely since for any nonzero 119905 isin Z119901the
product 119905 sdot gcd(119891119901(119909) 119892119901(119909)) also is gcd for 119891
119901(119909) 119892119901(119909) We
are denoting just one of these gcdrsquos (namely that computedby the Euclidean algorithm) by 119890
119901(119909) This 119890
119901(119909) is unique
since at each step of the Euclidean algorithmwe have a uniqueaction to take (to see this just consider the steps of ldquolongdivisionrdquo used to divide 119891
119901(119909) by 119892
119901(119909) on field Z
119901)
The main idea of the algorithm is to calculate 119890119901(119909) asymp
gcd(119891119901(119909) 119892119901(119909)) for some suitable 119901 and to reconstruct
119889(119909) = gcd(119891(119909) 119892(119909)) by it We separate the process to fourmain problems that may occur and show how to overcomeeach one to arrive to a correctly working algorithm
International Journal of Mathematics and Mathematical Sciences 5
41 Problem 1 Avoiding the Eliminating Coefficients Afterreduction 120593
119901 some of the coefficients of 119891(119909) and 119892(119909) may
change or even be eliminated So their images 119891119901(119909) =
120593119901(119891(119909)) and 119892
119901(119909) = 120593
119901(119892(119909)) may keep very little
information to reconstruct 119889(119909) based on 119890119901(119909)
Example 5 If 119891(119909) = 71199092+ 22 and 119892(119909) = 49119909
3+ 154119909
then for 119901 = 7 we get 119891119901(119909) = 1 and 119892
119901(119909) = 0 So
these values contain no reliable information to reconstructgcd(119891(119909) 119892(119909))
The first simple idea to avoid such elimination is to take119901 larger than the absolute value of all coefficients of 119891(119909) and119892(119909) This however is not enough since a divisor ℎ(119909) of apolynomial 119891(119909) may have coefficients larger than those of119891(119909) Moreover using the cyclotomic polynomials for largeenough 119899
120601119899(119909) = prod
119896=1119899(119896119899)=1
(119909 minus 1198902119894120587119896119899
) (17)
one can get divisors of 119891(119909) = 119909119899minus 1 which have a coefficient
larger than any pregiven number [1 4 8] Since we do notknow the divisors of 119891(119909) and 119892(119909) we cannot be sure ifthe abovementioned large 119901 will be large enough to preventelimination of coefficients of ℎ(119909) To overcome this one canuse the Landau-Mignotte bounds (in different sources thebounds on coefficients of the divisors are called differentlyassociating them with names of L Landau or M Mignotteor with both of them these authors have different roles indevelopment of the formulas which in turn are consequenceof a formula by A L Cauchy) as done in [4ndash6] For apolynomial 119891(119909) given by (15) denote its norm by 119891(119909) =
radicsum119899
119894=01198862119894
Theorem6 (L LandauMMignotte) Let119891(119909) = 1198860119909119899+sdot sdot sdot+
119886119899and ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896be nonzero polynomials in Z[119909]
If ℎ(119909) is a divisor of 119891(119909) then
119899
sum119894=0
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot10038161003816100381610038161003816100381610038161003816
1198880
1198860
10038161003816100381610038161003816100381610038161003816sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (18)
The proof is based on calculations on complex numbersand it can be found for example in [1 4] We are going to usethe Landau-Mignotte bounds in the following two shapes
Corollary 7 In notations of Theorem 6 there is the followingupper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891= 2119899minus1 1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (19)
Proof To obtain this from (18) first notice that |11988801198860| le 1
Next if 119896 = deg ℎ(119909) = deg119891(119909) = 119899 then 119891(119909) = 119903 sdot
ℎ(119909) where 119903 is a nonzero integer Then |119888119894| le max|119888
119894| | 119894 =
0 119899 le max|119886119894| | 119894 = 0 119899 le 119891(119909)
Finally if 119896 = deg ℎ(119909) le 119899 minus 1 (119896 is unknown to us) thenwe can simply replace in (18) the value 2119896 by 2119899minus1
Remark 8 In literature they use the rather less accuratebound |119888
119894| le 2119899119891(119909) but the second paragraph of our proof
above allows replacing 2119899 by 2119899minus1 See also Remark 23
Corollary 9 In notations ofTheorem 6 if ℎ(119909) also is a divisorof the polynomial 119892(119909) = 119887
0119909119898+ sdot sdot sdot + 119887
119898 then there is the
following upper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891119892
= 2min119899119898
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(20)
Proof To obtain this from (18) just notice that if ℎ(119909)
is a common divisor for 119891(119909) and 119892(119909) then its leadingcoefficient 119888
0divides both 119886
0and 1198870
Formula (20) provides the hint to overcome Problem1 about eliminating coefficients mentioned at the start ofthis subsection Although the divisors ℎ(119909) of 119891(119909) and119892(119909) are yet unknown we can compute 119873
119891119892and take
119901 gt 119873119891119892 If we apply the reduction 120593
119901for this 119901 we can
be sure that none of the coefficients of ℎ(119909) has changedldquomuchrdquo under that homomorphism for 120593
119901does not alter
the nonnegative coefficients of ℎ(119909) and it just adds 119901 to allnegative coefficients of ℎ(119909) The same holds true for 119889(119909) =gcd(119891(119909) 119892(119909))
42 Problem 2 Negative Coefficients and Reconstruction ofthe Preimage The reduction 120593
119901is not a bijection and 119889
119901(119909)
has infinitely many preimages in Z[119909] But the relativelyuncomplicated relationship between coefficients of 119889(119909) and119889119901(119909) obtained in previous subsection may allow us to
reconstruct 119889(119909) if we know 119889119901(119909) The condition 119901 gt 119873
119891119892
puts a restriction on the preimage 119889(119909) the coefficients of119889(119909) either are equal to respective coefficients of119889
119901(119909) (if they
are nonnegative) or are the respective coefficients of 119889119901(119909)
minus 119901 (if they are negative) Reconstruction may causeproblems connected with negative coefficients
Example 10 If for some polynomials 119891(119909) 119892(119909) we have119873119891119892
= 15 we can take the prime say 119901 = 17 gt 119873119891119892 Assume
we have somehow calculated 11988917(119909) = 12119909
3+ 3119909 + 10 we
can be sure that 119889(119909) is not the preimage 291199093 minus 171199092 + 20119909+27 because 119889(119909) cannot have coefficients greater than 15 byabsolute value But we still cannot be sure if the preimage119889(119909)is 121199093 +3119909+10 or minus51199093 +3119909+10 or maybe minus51199093 minus14119909minus7
It is easy to overcome this by just taking a larger value
119901 gt 2 sdot 119873119891119892 (21)
If the coefficient 119888119894of 119889(119909) is nonnegative then 120593
119901(119888119894) =
119888119894lt 1199012 and if it is negative then 120593
119901(119888119894) = 119888119894+ 119901 gt 1199012
This provides us with the very simple method as shown inAlgorithm 1 to reconstruct 119889(119909) if we have already computed119889119901(119909) for sufficiently large prime 119901
6 International Journal of Mathematics and Mathematical Sciences
Input For an unknown polynomial 119889(119909) isin Z[119909] we knowthe upper bound119873 of absolute values of its coefficientsand for arbitrarily large prime number 119901 we have themodular image 119889
119901(119909) = 119887
0119901119909119896+ sdot sdot sdot + 119887
119896119901isin Z119901[119909]
Reconstruct the polynomial 119889(119909)(01) Choose any prime 119901 gt 2 sdot 119873(02) Set 119896 = deg 119889
119901(119909)
(03) Set 119894 = 0(04) While 119894 le 119896
(05) if 119887119894119901
lt 1199012
(06) set 119887119894= 119887119894119901
(07) else(08) set 119887
119894= 119887119894119901
minus 119901(10) set 119894 = 119894 + 1(11) Output 119889(119909) = 119887
0119909119896+ sdot sdot sdot + 119887
119896
Algorithm 1 The polynomial reconstruction by modular image
43 Problem 3 Finding the Correct Fold of the Modular gcdof Right Degree Now additionally assume the polynomials119891(119909) 119892(119909) isin Z[119909] to be primitive Since cont(119891(119909)) andcont(119892(119909)) are defined up to the sign plusmn1 we can without lossof generality admit the leading coefficients of119891(119909) 119892(119909) to bepositive
Below in Problem 4 we will see that for some 119901 thepolynomial 119890
119901(119909) computed by the Euclidean algorithm in
Z119901[119909] may not be the image of 119889(119909) and moreover its
degree may be different from that of 119889(119909) This means thatby applying Algorithm 1 to 119890
119901(119909) we may not obtain 119889(119909)
Assume however we have 119901 which meets the condition 119901 gt
2 sdot 119873119891119892
and for which
deg 119889 (119909) = deg 119890119901(119909) (22)
By Corollary 3 a common divisor of 119891(119909) 119892(119909) is 119889(119909) =
gcd(119891(119909) 119892(119909)) if and only if it is primitive and if its degreeis the maximum of degrees of all common divisors Since120593119901does not change the degree of 119889(119909) we get by Lemma 4
(applied for the field119870 = Z119901) that119889
119901(119909) is gcd of119891
119901(119909) 119892119901(119909)
in Z119901[119909] This correspondence surely is not one-to-one
because in Z[119909] gcd is calculated up to the unit element ofZ[119909] which is plusmn1 whereas in Z
119901[119909] gcd is calculated up to
the unit element ofZ119901[119909] which can be any nonzero number
119905 isin Zlowast119901= 1 119901minus1 So the polynomial 119890
119901(119909) calculated by
the Euclidean algorithmmay not be the image 119889119901(119909) of 119889(119909)
Example 11 For 119891(119909) = 1199092+ 4119909 + 3 and 119892(119909) = 119909
2+ 2119909 + 1
whichever prime 119901 gt 4 we take we will get by the Euclideanalgorithm
119890119901(119909) = gcd (119891
119901(119909) 119892
119901(119909)) = 2119909 + 2 isin Z
119901 [119909] (23)
But in Z[119909] we have 119889(119909) = 119909 + 1 So regardless how large 119901we choose we will never get 120593
119901(119909 + 1) = 2119909 + 2
In other words we are aware that the image 119889119901(119909) is one
of the folds 119905 sdot 119890119901(119909) of 119890
119901(119909) for some 119905 isin 1 119901 minus 1 but
we are not aware which 119905 is that
The leading coefficient 1198880= lc(119889(119909)) of 119889(119909) can also be
assumed to be positive Denote by 119908 the positive gcd(1198860 1198870)
Since both 1198880and 119908 are not altered by 120593
119901 their fraction 119908119888
0
also is not altered Take such 119905 that
lc (119905 sdot 119890119901(119909)) = 119908 (24)
Even if 119905 sdot 119890119901(119909) is not the image 119889
119901(119909) it is the image of 119897 sdot
119889(119909) where 119897 divides1199081198880 If we calculate the preimage 119896(119909) isin
Z[119909] of 119905 sdot 119890119901(119909) by Algorithm 1 we will get a polynomial
which is either 119889(119909) or some fold of 119889(119909) Since 119891(119909) 119892(119909)are primitive it remains to go to the primitive part 119889(119909) =
pp(119896(119909))The general case when 119891(119909) 119892(119909) may not be primi-
tive can easily be reduced to the following for arbitrary119891(119909) 119892(119909) take their decompositions by formula (5) and set
119903 = gcd (cont (119891 (119909)) cont (119892 (119909))) isin Z (25)
Then assign 119891(119909) = pp(119891(119909)) 119892(119909) = pp(119892(119909)) and do thesteps above for these new polynomials After 119889(119909) = pp(119896(119909))is computed we get the final answer as 119903 sdot 119889(119909) = 119903 sdot pp(119896(119909))
Notice that for Algorithm 1 we need 119901 to be greater thanany coefficient |119888
119894| of the polynomial we reconstruct The
bound 119901 gt 2 sdot 119873119891119892
assures that 119901 meets this condition for119889(119909) We however reconstruct not 119889(119909) but 119897 sdot 119889(119909) whichmay have larger coefficients One could overcome this pointby taking 119901 gt 119908 sdot 2 sdot 119873
119891119892 but this is not necessary because
as we see later while the Big prime modular gcd algorithmworks the value of 119901 will grow and this issue will be covered
44 Problem 4 Finding the Right Degree for the Modular gcdAs we saw one can reconstruct 119889(119909) if we find 119901 gt 2 sdot 119873
119891119892
such that condition (22) holds Consider an example to seethat (22) may actually not hold for some 119901 even if 120593
119901is not
altering the coefficients of 119891(119909) and 119892(119909)
Example 12 For 119891(119909) = 1199092+ 1 and 119892(119909) = 119909 + 1 we have
119889(119909) = gcd(119891(119909) 119892(119909)) = 1 Taking 119901 = 2 we get 1198912(119909) =
1199092+ 1 and 119892
2(119909) = 119909 + 1 In Z
2[119909] we have 119891
2(119909) = 119909
2+ 1 =
1199092+12= (119909+1)(119909+1) thus 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) = 119909+1
We get that 1 = deg(119909 + 1) gt deg(119909) = 0 In particularwhatever 119905 we take 119905 sdot (119909 + 1) is not the image of 119889(119909) = 1
under 1205932
The idea to overcome this problem is to show that thenumber of primes 119901 for which (22) falsifies is ldquosmallrdquo Soif the selected 119901 is not suitable we take another 119901 and do thecalculation again by the new prime And we will not have torepeat these steps for many times (we will turn to this pointin Section 6)
The proof of the following theorem and the definition ofthe resultant res(119891(119909) 119892(119909)) (ie of the determinant of theSylvestermatrix 119878
119891119892of polynomials119891(119909) 119892(119909)) can be found
for example in [1 4 7 10]The resultant is a comfortable toolto detect if the given polynomials are coprime
Theorem 13 Let 119877 be an integrity domain The polynomials119891(119909) 119892(119909) isin 119877[119909] are coprime if and only if res(119891(119909) 119892(119909)) =
0
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
International Journal of Mathematics and Mathematical Sciences 3
Clearly gcd(119886 119887) is defined up to a unit multiplier from119877lowast For integers from 119877 = Z or for polynomials from
119877 = Z[119909] this unit multiplier can be just minus1 or 1 So tosay gcd(119886 119887) is defined ldquoup to the sign plusmn1rdquo because Zlowast =
Z[119909]lowast
= minus1 1 And for polynomials from 119877 = Z119901[119909]
gcd(119886 119887) is defined up to any nonzero multiplier 119905 isin Zlowast119901=
1 119901minus1 Taking this into account we can use gcd(119886 119887) =1 and gcd(119886 119887) asymp 1 as equivalent notations since associatedelements are defined up to a unit multiplier Notice that insome sources they prefer to additionally introduce a normalform of gcd to distinguish one fixed instance of gcd Insteadof using that extra term we will just in a few places refer tothe ldquopositive gcdrdquo meaning that we take for example 2 =
gcd(6 8) and not minus2Furthermore since the content cont(119891(119909)) of a poly-
nomial 119891(119909) is gcd for some elements (coefficients of thepolynomials) the constant and the primitive part pp(119891(119909)) =119891(119909)cont(119891(119909)) can also be considered up to a unit multi-plier For a nonzero polynomial 119891(119909) isin Z[119909] we can choosecont(119891(119909)) so that sgn cont(119891(119909)) = sgn lc(119891(119909)) that isthe cont(119891(119909)) has the same sign as the leading coefficientof 119891(119909) Then the leading coefficient lc(pp(119891(119909))) of theprimitive part pp(119891(119909)) = 119891(119909)cont(119891(119909)) will be positiveWe will use this below without special notification
Now we would like to little restrict the algebraic back-ground we use Two main algebraic systems used in the Bigprimemodular gcd algorithm are the Euclidean domains andthe UFDs However their usage is ldquoasymmetricrdquo in the sensethat the Euclidean domains and Euclidean algorithm areused in many parts of the Big prime modular gcd algorithmwhereas the UFDs are used just to prove that gcd does existMoreover it is easy to understand that (2) and (4) mayhardly be effective tools to calculate gcd since they are usingfactorization of elements to primes while finding such afactorization is amore complicated task than finding just gcdThus it is reasonable to drop the UFDs from considerationand to obtain (2) directly using Gaussrsquos lemma on primitivepolynomials in Z[119909] (a polynomial 119891(119909) isin Z[119909] is primitiveif cont(119891(119909)) asymp 1 that is pp(119891(119909)) = 119891(119909)cont(119891(119909)) asymp
119891(119909))ByGaussrsquos lemma a product of twoprimitive polynomials
is primitive in Z[119909] [4 7 8 10 11] So if
119891 (119909) = cont (119891 (119909)) sdot pp (119891 (119909))
119892 (119909) = cont (119892 (119909)) sdot pp (119892 (119909)) (5)
thencont (119891 (119909) sdot 119892 (119909)) = cont (119891 (119909)) sdot cont (119892 (119909))
pp (119891 (119909) sdot 119892 (119909)) = pp (119891 (119909)) sdot pp (119892 (119909)) (6)
The following is easy to deduce from Gaussrsquos lemma
Lemma 1 If 119891(119909) 119905(119909) isin Z[119909] and 119905(119909) is primitive then if119905(119909) divides 119891(119909) in the ring Q[119909] and then 119905(119909) also divides119891(119909) in Z[119909]
The unique factorization of any nonzero 119891(119909) isin Z[119909]
is easy to obtain from decompositions (6) above and from
Lemma 1 Let us just outline it the details can be found in [1 45 7 8] By the fundamental theoremof arithmetic cont(119891(119909))can in a unique way be presented as a product of powers ofprimes cont(119891(119909)) = ] 119901
1205721
1sdot sdot sdot 119901120572119899
119899 So if deg119891(119909) = 0 then
we are doneAssume deg119891(119909) gt 0 If 119891(119909) is not prime then by
repeatedly splitting it to products of factors of lower degree asmany times as needed we will eventually get a presentationof 119891(119909) as a product of cont(119891(119909)) and of some finitely manyprimitive prime polynomials 119902
119894(119909) of degrees greater than 0
We do not yet have the uniqueness of this decomposition butwe can still group the associated elements together to get thepresentation
119891 (119909) = cont (119891 (119909)) sdot pp (119891 (119909))
= ] 1199011205721
1sdot sdot sdot 119901120572119899
119899sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
(7)
If119891(119909) has another alternative presentation of this sort and if119905(119909) is one of the primitive prime factors (of degree greaterthan 0) of that presentation then product (7) is divisibleby 119905(119909) By Lemma 1 119905(119909) divides 119891(119909) also in Z[119909] Since119905(119909) is prime it is associated with one of 119902
119894(119909) Eliminate
one instance of this 119902119894(119909) in (7) and consider 119891(119909)119902
119894(119909) If
119891(119909)119902119894(119909) also is divisible by 119902
119894(119909) we repeat the process
If not we turn to other primitive prime polynomials (ofdegree greater than 0) dividing what remains from (7)after elimination After finitely many steps (7) will become] 1199011205721
1sdot sdot sdot 119901120572119899
119899 and also from the other alternative presentation
a constant should be left only So we apply the fundamentaltheorem of arithmetic one more time to get that (7) is theunique factorization
We see that (7) is a particular case of (2) The proof aboveavoided usage of Gaussrsquos theorem and the formal definitionsof the UFDs And we see that the prime elements ofZ[119909] areof two types prime numbers and primitive prime polynomialsof degrees greater than 0
Existence of gcd(119891(119909) 119892(119909)) for any two nonzero poly-nomials in 119891(119909) 119892(119909) isin Z[119909] can be deduced from (7) inanalogy with (4) If
119892 (119909) = ]1015840 1199011205721015840
1
1sdot sdot sdot 1199011205721015840
119899
119899sdot 1199021205731015840
1
1(119909) sdot sdot sdot 119902
1205731015840
119898
119898(119909) (8)
then
gcd (119891 (119909) 119892 (119909)) = 120581 1199011205741
1sdot sdot sdot 119901120574119899
119899sdot 1199021205751
1(119909) sdot sdot sdot 119902
120575119898
119898(119909) (9)
where 120581 = plusmn1 120574119894= min120572
119894 1205721015840
119894 and 120575
119895= min120573
119895 1205731015840
119895
(119894 = 1 119899 119895 = 1 119898) However like we admittedearlier (4) and (9) are no effective tools to calculate gcd Wewill turn to gcd calculation algorithm in the next sections (seeAlgorithms 4 and 5)
Equations (4) and (9) allow us to get some informationthat will be essential later Observe that the following defi-nition of gcd often used in elementary mathematics is nolonger true for general polynomial rings ldquo119889(119909) is the greatestcommon divisor of 119891(119909) and 119892(119909) if it is their common divisorof maximal degreerdquo For example for 119891(119909) = 12119909
2+ 24119909 + 12
and 119892(119909) = 8119909 + 8 the maximum of degree of their common
4 International Journal of Mathematics and Mathematical Sciences
divisors is 1 Nevertheless ℎ(119909) = 119909+1 is not gcd(119891(119909) 119892(119909))although ℎ(119909) | 119891(119909) ℎ(119909) | 119892(119909) and deg ℎ(119909) = 1 For 119909+1is not divisible by the common divisor 2119909 + 2 We can detectthe cases when the divisor of highest degree is gcd
Lemma 2 For polynomials 119891(119909) 119892(119909) isin Z[119909] their commondivisor of maximal degree ℎ(119909) is their gcd if and only ifcont(ℎ(119909)) asymp gcd(cont(119891(119909)) cont(119892(119909)))
The lemma easily follows from (7) (8) and (9) We seethat in example above the condition was missing cont(119909 +
1) = 1 but gcd(cont(119891(119909)) cont(119892(119909))) = gcd(12 8) asymp 4 asymp 1In fact gcd(119891(119909) 119892(119909)) asymp 4119909 + 4
Corollary 3 For primitive polynomials 119891(119909) 119892(119909) isin Z[119909]their common divisor of maximal degree ℎ(119909) is their gcd ifand only if ℎ(119909) is primitive
In the case if polynomials are over a field the situation issimpler For any field 119870 the polynomial ring 119870[119909] is a UFD(and even an Euclidean domain) Any nonzero 119891(119909) isin 119870[119909]
has a factorization
119891 (119909) = 120579 sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
120579 isin 119870lowast deg 119902
119894(119909) gt 0 119894 = 1 119898
(10)
which is unique in the sense mentioned above Since allnonzero scalars in119870 are units what we in (7) above had as aproduct of some prime numbers actually ldquomergesrdquo in 119870 intoa unit
] sdot 11990112057211sdot sdot sdot 119901120572119899
119899= 120579 isin 119870
lowast= 119870 0 (11)
Comparing factorizations of type (10) for any nonzeropolynomials 119891(119909) 119892(119909) isin 119870[119909] we easily get the following
Lemma 4 For any nonzero polynomials 119891(119909) 119892(119909) isin 119870[119909]
over a field119870 their common divisor of maximal degree ℎ(119909) istheir gcd
This in particular is true for rings mentioned aboveQ[119909] R[119909] C[119909] and Z
119901[119909] We will use this fact later
to construct the Big prime modular gcd algorithm and itsmodifications
The analog of Lemma 4 was not true for Z[119909] becausein factorization (9) we have the nonunit prime-power fac-tors 119901
120574119894
119894which do participate in factorization of 119889(119909) =
gcd(119891(119909) 119892(119909)) but which add nothing to the degree of 119889(119909)This is why maximality of the degree is no longer the onlycriterion in Z[119909] to detect if the given ℎ(119909) is gcd or not
3 Some Notations for Modular Reductions
The following notations adopted from [1] are to make ourarguments shorter and more uniform when we deal withnumerals polynomials and matrices As above letZ
119901be the
residue ring (finite Galois field Z119901= F119901= 0 119901 minus 1) and
let
120593119901 Z 997888rarr Z
119901 (12)
be the rings homomorphism mapping each 119911 isin Z to theremainder after division of 119911 by 119901 That is 120593
119901(119911) equiv 119911(mod
119901) and 120593119901(119911) isin Z
119901
Weuse the same symbol120593119901to denote the homomorphism
120593119901 Z [119909] 997888rarr Z
119901 [119909] (13)
where Z119901[119909] is the ring of polynomials over Z
119901and 120593
119901is
mapping each of the coefficients 119886119894of 119891(119909) isin Z[119909] to the
remainder after division of 119886119894by 119901
Similarly we define the homomorphism of matrix rings
120593119901 119872119898119899 (Z) 997888rarr 119872
119898119899(Z119901) (14)
which maps each of the elements 119886119894119895of a matrix119860 isin 119872
119898119899(Z)
to the remainder after division of 119886119894119895by 119901
Using the same symbol 120593119901for numeric polynomial
and matrix homomorphisms causes no misunderstandingbelow and it is more comfortable for some reasons Thesehomomorphisms are called ldquomodular reductionsrdquo or justldquoreductionsrdquo We can also specify these homomorphisms asldquonumeric modular reductionrdquo ldquopolynomial modular reduc-tionrdquo or ldquomatrix modular reductionrdquo where needed [1]
For 119886 isin Z denote 120593119901(119886) = 119886
119901 For 119891(119909) isin Z[119909] denote
120593119901(119891(119909)) = 119891
119901(119909) isin Z
119901[119909] So if
119891 (119909) = 1198860119909119899+ sdot sdot sdot + 119886
119899 (15)
then119891119901(119909) = 120593
119901(119891 (119909)) = 120593
119901(1198860) 119909119899+ sdot sdot sdot + 120593
119901(119886119899)
= 1198860119901119909119899+ sdot sdot sdot + 119886
119899119901isin Z119901 [119909]
(16)
And for a matrix 119860 isin 119872119898119899
(Z) denote 120593119901(119860) = 119860
119901isin
119872119898119899
(Z119901) If 119860 = 119886
119894119895119898times119899
then 119860119901
= 120593119901(119886119894119895)119898times119899
=
119886119894119895119901
119898times119899
4 Problems at Lifting the Modular gcd to Z[119909]
Now we turn to the second task mentioned earlier effectivecalculation of the actual gcd(119891(119909) 119892(119909)) for the given nonzeropolynomials 119891(119909) 119892(119909) isin Z[119909]
The ring Z119901[119909] is an Euclidean domain unlike the ring
Z[119909] So we can use the Euclidean algorithm to calcu-late gcd for any nonzero polynomials in Z
119901[119909] including
the modular images 119891119901(119909) and 119892
119901(119909) Since the notation
gcd(119891119901(119909) 119892119901(119909)) is going to be used repeatedly for brief-
ness denote by 119890119901(119909) gcd calculated by Euclidean algorithm
for 119891119901(119909) 119892119901(119909) Let us stress that gcd(119891
119901(119909) 119892119901(119909)) is not
determined uniquely since for any nonzero 119905 isin Z119901the
product 119905 sdot gcd(119891119901(119909) 119892119901(119909)) also is gcd for 119891
119901(119909) 119892119901(119909) We
are denoting just one of these gcdrsquos (namely that computedby the Euclidean algorithm) by 119890
119901(119909) This 119890
119901(119909) is unique
since at each step of the Euclidean algorithmwe have a uniqueaction to take (to see this just consider the steps of ldquolongdivisionrdquo used to divide 119891
119901(119909) by 119892
119901(119909) on field Z
119901)
The main idea of the algorithm is to calculate 119890119901(119909) asymp
gcd(119891119901(119909) 119892119901(119909)) for some suitable 119901 and to reconstruct
119889(119909) = gcd(119891(119909) 119892(119909)) by it We separate the process to fourmain problems that may occur and show how to overcomeeach one to arrive to a correctly working algorithm
International Journal of Mathematics and Mathematical Sciences 5
41 Problem 1 Avoiding the Eliminating Coefficients Afterreduction 120593
119901 some of the coefficients of 119891(119909) and 119892(119909) may
change or even be eliminated So their images 119891119901(119909) =
120593119901(119891(119909)) and 119892
119901(119909) = 120593
119901(119892(119909)) may keep very little
information to reconstruct 119889(119909) based on 119890119901(119909)
Example 5 If 119891(119909) = 71199092+ 22 and 119892(119909) = 49119909
3+ 154119909
then for 119901 = 7 we get 119891119901(119909) = 1 and 119892
119901(119909) = 0 So
these values contain no reliable information to reconstructgcd(119891(119909) 119892(119909))
The first simple idea to avoid such elimination is to take119901 larger than the absolute value of all coefficients of 119891(119909) and119892(119909) This however is not enough since a divisor ℎ(119909) of apolynomial 119891(119909) may have coefficients larger than those of119891(119909) Moreover using the cyclotomic polynomials for largeenough 119899
120601119899(119909) = prod
119896=1119899(119896119899)=1
(119909 minus 1198902119894120587119896119899
) (17)
one can get divisors of 119891(119909) = 119909119899minus 1 which have a coefficient
larger than any pregiven number [1 4 8] Since we do notknow the divisors of 119891(119909) and 119892(119909) we cannot be sure ifthe abovementioned large 119901 will be large enough to preventelimination of coefficients of ℎ(119909) To overcome this one canuse the Landau-Mignotte bounds (in different sources thebounds on coefficients of the divisors are called differentlyassociating them with names of L Landau or M Mignotteor with both of them these authors have different roles indevelopment of the formulas which in turn are consequenceof a formula by A L Cauchy) as done in [4ndash6] For apolynomial 119891(119909) given by (15) denote its norm by 119891(119909) =
radicsum119899
119894=01198862119894
Theorem6 (L LandauMMignotte) Let119891(119909) = 1198860119909119899+sdot sdot sdot+
119886119899and ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896be nonzero polynomials in Z[119909]
If ℎ(119909) is a divisor of 119891(119909) then
119899
sum119894=0
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot10038161003816100381610038161003816100381610038161003816
1198880
1198860
10038161003816100381610038161003816100381610038161003816sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (18)
The proof is based on calculations on complex numbersand it can be found for example in [1 4] We are going to usethe Landau-Mignotte bounds in the following two shapes
Corollary 7 In notations of Theorem 6 there is the followingupper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891= 2119899minus1 1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (19)
Proof To obtain this from (18) first notice that |11988801198860| le 1
Next if 119896 = deg ℎ(119909) = deg119891(119909) = 119899 then 119891(119909) = 119903 sdot
ℎ(119909) where 119903 is a nonzero integer Then |119888119894| le max|119888
119894| | 119894 =
0 119899 le max|119886119894| | 119894 = 0 119899 le 119891(119909)
Finally if 119896 = deg ℎ(119909) le 119899 minus 1 (119896 is unknown to us) thenwe can simply replace in (18) the value 2119896 by 2119899minus1
Remark 8 In literature they use the rather less accuratebound |119888
119894| le 2119899119891(119909) but the second paragraph of our proof
above allows replacing 2119899 by 2119899minus1 See also Remark 23
Corollary 9 In notations ofTheorem 6 if ℎ(119909) also is a divisorof the polynomial 119892(119909) = 119887
0119909119898+ sdot sdot sdot + 119887
119898 then there is the
following upper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891119892
= 2min119899119898
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(20)
Proof To obtain this from (18) just notice that if ℎ(119909)
is a common divisor for 119891(119909) and 119892(119909) then its leadingcoefficient 119888
0divides both 119886
0and 1198870
Formula (20) provides the hint to overcome Problem1 about eliminating coefficients mentioned at the start ofthis subsection Although the divisors ℎ(119909) of 119891(119909) and119892(119909) are yet unknown we can compute 119873
119891119892and take
119901 gt 119873119891119892 If we apply the reduction 120593
119901for this 119901 we can
be sure that none of the coefficients of ℎ(119909) has changedldquomuchrdquo under that homomorphism for 120593
119901does not alter
the nonnegative coefficients of ℎ(119909) and it just adds 119901 to allnegative coefficients of ℎ(119909) The same holds true for 119889(119909) =gcd(119891(119909) 119892(119909))
42 Problem 2 Negative Coefficients and Reconstruction ofthe Preimage The reduction 120593
119901is not a bijection and 119889
119901(119909)
has infinitely many preimages in Z[119909] But the relativelyuncomplicated relationship between coefficients of 119889(119909) and119889119901(119909) obtained in previous subsection may allow us to
reconstruct 119889(119909) if we know 119889119901(119909) The condition 119901 gt 119873
119891119892
puts a restriction on the preimage 119889(119909) the coefficients of119889(119909) either are equal to respective coefficients of119889
119901(119909) (if they
are nonnegative) or are the respective coefficients of 119889119901(119909)
minus 119901 (if they are negative) Reconstruction may causeproblems connected with negative coefficients
Example 10 If for some polynomials 119891(119909) 119892(119909) we have119873119891119892
= 15 we can take the prime say 119901 = 17 gt 119873119891119892 Assume
we have somehow calculated 11988917(119909) = 12119909
3+ 3119909 + 10 we
can be sure that 119889(119909) is not the preimage 291199093 minus 171199092 + 20119909+27 because 119889(119909) cannot have coefficients greater than 15 byabsolute value But we still cannot be sure if the preimage119889(119909)is 121199093 +3119909+10 or minus51199093 +3119909+10 or maybe minus51199093 minus14119909minus7
It is easy to overcome this by just taking a larger value
119901 gt 2 sdot 119873119891119892 (21)
If the coefficient 119888119894of 119889(119909) is nonnegative then 120593
119901(119888119894) =
119888119894lt 1199012 and if it is negative then 120593
119901(119888119894) = 119888119894+ 119901 gt 1199012
This provides us with the very simple method as shown inAlgorithm 1 to reconstruct 119889(119909) if we have already computed119889119901(119909) for sufficiently large prime 119901
6 International Journal of Mathematics and Mathematical Sciences
Input For an unknown polynomial 119889(119909) isin Z[119909] we knowthe upper bound119873 of absolute values of its coefficientsand for arbitrarily large prime number 119901 we have themodular image 119889
119901(119909) = 119887
0119901119909119896+ sdot sdot sdot + 119887
119896119901isin Z119901[119909]
Reconstruct the polynomial 119889(119909)(01) Choose any prime 119901 gt 2 sdot 119873(02) Set 119896 = deg 119889
119901(119909)
(03) Set 119894 = 0(04) While 119894 le 119896
(05) if 119887119894119901
lt 1199012
(06) set 119887119894= 119887119894119901
(07) else(08) set 119887
119894= 119887119894119901
minus 119901(10) set 119894 = 119894 + 1(11) Output 119889(119909) = 119887
0119909119896+ sdot sdot sdot + 119887
119896
Algorithm 1 The polynomial reconstruction by modular image
43 Problem 3 Finding the Correct Fold of the Modular gcdof Right Degree Now additionally assume the polynomials119891(119909) 119892(119909) isin Z[119909] to be primitive Since cont(119891(119909)) andcont(119892(119909)) are defined up to the sign plusmn1 we can without lossof generality admit the leading coefficients of119891(119909) 119892(119909) to bepositive
Below in Problem 4 we will see that for some 119901 thepolynomial 119890
119901(119909) computed by the Euclidean algorithm in
Z119901[119909] may not be the image of 119889(119909) and moreover its
degree may be different from that of 119889(119909) This means thatby applying Algorithm 1 to 119890
119901(119909) we may not obtain 119889(119909)
Assume however we have 119901 which meets the condition 119901 gt
2 sdot 119873119891119892
and for which
deg 119889 (119909) = deg 119890119901(119909) (22)
By Corollary 3 a common divisor of 119891(119909) 119892(119909) is 119889(119909) =
gcd(119891(119909) 119892(119909)) if and only if it is primitive and if its degreeis the maximum of degrees of all common divisors Since120593119901does not change the degree of 119889(119909) we get by Lemma 4
(applied for the field119870 = Z119901) that119889
119901(119909) is gcd of119891
119901(119909) 119892119901(119909)
in Z119901[119909] This correspondence surely is not one-to-one
because in Z[119909] gcd is calculated up to the unit element ofZ[119909] which is plusmn1 whereas in Z
119901[119909] gcd is calculated up to
the unit element ofZ119901[119909] which can be any nonzero number
119905 isin Zlowast119901= 1 119901minus1 So the polynomial 119890
119901(119909) calculated by
the Euclidean algorithmmay not be the image 119889119901(119909) of 119889(119909)
Example 11 For 119891(119909) = 1199092+ 4119909 + 3 and 119892(119909) = 119909
2+ 2119909 + 1
whichever prime 119901 gt 4 we take we will get by the Euclideanalgorithm
119890119901(119909) = gcd (119891
119901(119909) 119892
119901(119909)) = 2119909 + 2 isin Z
119901 [119909] (23)
But in Z[119909] we have 119889(119909) = 119909 + 1 So regardless how large 119901we choose we will never get 120593
119901(119909 + 1) = 2119909 + 2
In other words we are aware that the image 119889119901(119909) is one
of the folds 119905 sdot 119890119901(119909) of 119890
119901(119909) for some 119905 isin 1 119901 minus 1 but
we are not aware which 119905 is that
The leading coefficient 1198880= lc(119889(119909)) of 119889(119909) can also be
assumed to be positive Denote by 119908 the positive gcd(1198860 1198870)
Since both 1198880and 119908 are not altered by 120593
119901 their fraction 119908119888
0
also is not altered Take such 119905 that
lc (119905 sdot 119890119901(119909)) = 119908 (24)
Even if 119905 sdot 119890119901(119909) is not the image 119889
119901(119909) it is the image of 119897 sdot
119889(119909) where 119897 divides1199081198880 If we calculate the preimage 119896(119909) isin
Z[119909] of 119905 sdot 119890119901(119909) by Algorithm 1 we will get a polynomial
which is either 119889(119909) or some fold of 119889(119909) Since 119891(119909) 119892(119909)are primitive it remains to go to the primitive part 119889(119909) =
pp(119896(119909))The general case when 119891(119909) 119892(119909) may not be primi-
tive can easily be reduced to the following for arbitrary119891(119909) 119892(119909) take their decompositions by formula (5) and set
119903 = gcd (cont (119891 (119909)) cont (119892 (119909))) isin Z (25)
Then assign 119891(119909) = pp(119891(119909)) 119892(119909) = pp(119892(119909)) and do thesteps above for these new polynomials After 119889(119909) = pp(119896(119909))is computed we get the final answer as 119903 sdot 119889(119909) = 119903 sdot pp(119896(119909))
Notice that for Algorithm 1 we need 119901 to be greater thanany coefficient |119888
119894| of the polynomial we reconstruct The
bound 119901 gt 2 sdot 119873119891119892
assures that 119901 meets this condition for119889(119909) We however reconstruct not 119889(119909) but 119897 sdot 119889(119909) whichmay have larger coefficients One could overcome this pointby taking 119901 gt 119908 sdot 2 sdot 119873
119891119892 but this is not necessary because
as we see later while the Big prime modular gcd algorithmworks the value of 119901 will grow and this issue will be covered
44 Problem 4 Finding the Right Degree for the Modular gcdAs we saw one can reconstruct 119889(119909) if we find 119901 gt 2 sdot 119873
119891119892
such that condition (22) holds Consider an example to seethat (22) may actually not hold for some 119901 even if 120593
119901is not
altering the coefficients of 119891(119909) and 119892(119909)
Example 12 For 119891(119909) = 1199092+ 1 and 119892(119909) = 119909 + 1 we have
119889(119909) = gcd(119891(119909) 119892(119909)) = 1 Taking 119901 = 2 we get 1198912(119909) =
1199092+ 1 and 119892
2(119909) = 119909 + 1 In Z
2[119909] we have 119891
2(119909) = 119909
2+ 1 =
1199092+12= (119909+1)(119909+1) thus 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) = 119909+1
We get that 1 = deg(119909 + 1) gt deg(119909) = 0 In particularwhatever 119905 we take 119905 sdot (119909 + 1) is not the image of 119889(119909) = 1
under 1205932
The idea to overcome this problem is to show that thenumber of primes 119901 for which (22) falsifies is ldquosmallrdquo Soif the selected 119901 is not suitable we take another 119901 and do thecalculation again by the new prime And we will not have torepeat these steps for many times (we will turn to this pointin Section 6)
The proof of the following theorem and the definition ofthe resultant res(119891(119909) 119892(119909)) (ie of the determinant of theSylvestermatrix 119878
119891119892of polynomials119891(119909) 119892(119909)) can be found
for example in [1 4 7 10]The resultant is a comfortable toolto detect if the given polynomials are coprime
Theorem 13 Let 119877 be an integrity domain The polynomials119891(119909) 119892(119909) isin 119877[119909] are coprime if and only if res(119891(119909) 119892(119909)) =
0
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
4 International Journal of Mathematics and Mathematical Sciences
divisors is 1 Nevertheless ℎ(119909) = 119909+1 is not gcd(119891(119909) 119892(119909))although ℎ(119909) | 119891(119909) ℎ(119909) | 119892(119909) and deg ℎ(119909) = 1 For 119909+1is not divisible by the common divisor 2119909 + 2 We can detectthe cases when the divisor of highest degree is gcd
Lemma 2 For polynomials 119891(119909) 119892(119909) isin Z[119909] their commondivisor of maximal degree ℎ(119909) is their gcd if and only ifcont(ℎ(119909)) asymp gcd(cont(119891(119909)) cont(119892(119909)))
The lemma easily follows from (7) (8) and (9) We seethat in example above the condition was missing cont(119909 +
1) = 1 but gcd(cont(119891(119909)) cont(119892(119909))) = gcd(12 8) asymp 4 asymp 1In fact gcd(119891(119909) 119892(119909)) asymp 4119909 + 4
Corollary 3 For primitive polynomials 119891(119909) 119892(119909) isin Z[119909]their common divisor of maximal degree ℎ(119909) is their gcd ifand only if ℎ(119909) is primitive
In the case if polynomials are over a field the situation issimpler For any field 119870 the polynomial ring 119870[119909] is a UFD(and even an Euclidean domain) Any nonzero 119891(119909) isin 119870[119909]
has a factorization
119891 (119909) = 120579 sdot 1199021205731
1(119909) sdot sdot sdot 119902
120573119898
119898(119909)
120579 isin 119870lowast deg 119902
119894(119909) gt 0 119894 = 1 119898
(10)
which is unique in the sense mentioned above Since allnonzero scalars in119870 are units what we in (7) above had as aproduct of some prime numbers actually ldquomergesrdquo in 119870 intoa unit
] sdot 11990112057211sdot sdot sdot 119901120572119899
119899= 120579 isin 119870
lowast= 119870 0 (11)
Comparing factorizations of type (10) for any nonzeropolynomials 119891(119909) 119892(119909) isin 119870[119909] we easily get the following
Lemma 4 For any nonzero polynomials 119891(119909) 119892(119909) isin 119870[119909]
over a field119870 their common divisor of maximal degree ℎ(119909) istheir gcd
This in particular is true for rings mentioned aboveQ[119909] R[119909] C[119909] and Z
119901[119909] We will use this fact later
to construct the Big prime modular gcd algorithm and itsmodifications
The analog of Lemma 4 was not true for Z[119909] becausein factorization (9) we have the nonunit prime-power fac-tors 119901
120574119894
119894which do participate in factorization of 119889(119909) =
gcd(119891(119909) 119892(119909)) but which add nothing to the degree of 119889(119909)This is why maximality of the degree is no longer the onlycriterion in Z[119909] to detect if the given ℎ(119909) is gcd or not
3 Some Notations for Modular Reductions
The following notations adopted from [1] are to make ourarguments shorter and more uniform when we deal withnumerals polynomials and matrices As above letZ
119901be the
residue ring (finite Galois field Z119901= F119901= 0 119901 minus 1) and
let
120593119901 Z 997888rarr Z
119901 (12)
be the rings homomorphism mapping each 119911 isin Z to theremainder after division of 119911 by 119901 That is 120593
119901(119911) equiv 119911(mod
119901) and 120593119901(119911) isin Z
119901
Weuse the same symbol120593119901to denote the homomorphism
120593119901 Z [119909] 997888rarr Z
119901 [119909] (13)
where Z119901[119909] is the ring of polynomials over Z
119901and 120593
119901is
mapping each of the coefficients 119886119894of 119891(119909) isin Z[119909] to the
remainder after division of 119886119894by 119901
Similarly we define the homomorphism of matrix rings
120593119901 119872119898119899 (Z) 997888rarr 119872
119898119899(Z119901) (14)
which maps each of the elements 119886119894119895of a matrix119860 isin 119872
119898119899(Z)
to the remainder after division of 119886119894119895by 119901
Using the same symbol 120593119901for numeric polynomial
and matrix homomorphisms causes no misunderstandingbelow and it is more comfortable for some reasons Thesehomomorphisms are called ldquomodular reductionsrdquo or justldquoreductionsrdquo We can also specify these homomorphisms asldquonumeric modular reductionrdquo ldquopolynomial modular reduc-tionrdquo or ldquomatrix modular reductionrdquo where needed [1]
For 119886 isin Z denote 120593119901(119886) = 119886
119901 For 119891(119909) isin Z[119909] denote
120593119901(119891(119909)) = 119891
119901(119909) isin Z
119901[119909] So if
119891 (119909) = 1198860119909119899+ sdot sdot sdot + 119886
119899 (15)
then119891119901(119909) = 120593
119901(119891 (119909)) = 120593
119901(1198860) 119909119899+ sdot sdot sdot + 120593
119901(119886119899)
= 1198860119901119909119899+ sdot sdot sdot + 119886
119899119901isin Z119901 [119909]
(16)
And for a matrix 119860 isin 119872119898119899
(Z) denote 120593119901(119860) = 119860
119901isin
119872119898119899
(Z119901) If 119860 = 119886
119894119895119898times119899
then 119860119901
= 120593119901(119886119894119895)119898times119899
=
119886119894119895119901
119898times119899
4 Problems at Lifting the Modular gcd to Z[119909]
Now we turn to the second task mentioned earlier effectivecalculation of the actual gcd(119891(119909) 119892(119909)) for the given nonzeropolynomials 119891(119909) 119892(119909) isin Z[119909]
The ring Z119901[119909] is an Euclidean domain unlike the ring
Z[119909] So we can use the Euclidean algorithm to calcu-late gcd for any nonzero polynomials in Z
119901[119909] including
the modular images 119891119901(119909) and 119892
119901(119909) Since the notation
gcd(119891119901(119909) 119892119901(119909)) is going to be used repeatedly for brief-
ness denote by 119890119901(119909) gcd calculated by Euclidean algorithm
for 119891119901(119909) 119892119901(119909) Let us stress that gcd(119891
119901(119909) 119892119901(119909)) is not
determined uniquely since for any nonzero 119905 isin Z119901the
product 119905 sdot gcd(119891119901(119909) 119892119901(119909)) also is gcd for 119891
119901(119909) 119892119901(119909) We
are denoting just one of these gcdrsquos (namely that computedby the Euclidean algorithm) by 119890
119901(119909) This 119890
119901(119909) is unique
since at each step of the Euclidean algorithmwe have a uniqueaction to take (to see this just consider the steps of ldquolongdivisionrdquo used to divide 119891
119901(119909) by 119892
119901(119909) on field Z
119901)
The main idea of the algorithm is to calculate 119890119901(119909) asymp
gcd(119891119901(119909) 119892119901(119909)) for some suitable 119901 and to reconstruct
119889(119909) = gcd(119891(119909) 119892(119909)) by it We separate the process to fourmain problems that may occur and show how to overcomeeach one to arrive to a correctly working algorithm
International Journal of Mathematics and Mathematical Sciences 5
41 Problem 1 Avoiding the Eliminating Coefficients Afterreduction 120593
119901 some of the coefficients of 119891(119909) and 119892(119909) may
change or even be eliminated So their images 119891119901(119909) =
120593119901(119891(119909)) and 119892
119901(119909) = 120593
119901(119892(119909)) may keep very little
information to reconstruct 119889(119909) based on 119890119901(119909)
Example 5 If 119891(119909) = 71199092+ 22 and 119892(119909) = 49119909
3+ 154119909
then for 119901 = 7 we get 119891119901(119909) = 1 and 119892
119901(119909) = 0 So
these values contain no reliable information to reconstructgcd(119891(119909) 119892(119909))
The first simple idea to avoid such elimination is to take119901 larger than the absolute value of all coefficients of 119891(119909) and119892(119909) This however is not enough since a divisor ℎ(119909) of apolynomial 119891(119909) may have coefficients larger than those of119891(119909) Moreover using the cyclotomic polynomials for largeenough 119899
120601119899(119909) = prod
119896=1119899(119896119899)=1
(119909 minus 1198902119894120587119896119899
) (17)
one can get divisors of 119891(119909) = 119909119899minus 1 which have a coefficient
larger than any pregiven number [1 4 8] Since we do notknow the divisors of 119891(119909) and 119892(119909) we cannot be sure ifthe abovementioned large 119901 will be large enough to preventelimination of coefficients of ℎ(119909) To overcome this one canuse the Landau-Mignotte bounds (in different sources thebounds on coefficients of the divisors are called differentlyassociating them with names of L Landau or M Mignotteor with both of them these authors have different roles indevelopment of the formulas which in turn are consequenceof a formula by A L Cauchy) as done in [4ndash6] For apolynomial 119891(119909) given by (15) denote its norm by 119891(119909) =
radicsum119899
119894=01198862119894
Theorem6 (L LandauMMignotte) Let119891(119909) = 1198860119909119899+sdot sdot sdot+
119886119899and ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896be nonzero polynomials in Z[119909]
If ℎ(119909) is a divisor of 119891(119909) then
119899
sum119894=0
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot10038161003816100381610038161003816100381610038161003816
1198880
1198860
10038161003816100381610038161003816100381610038161003816sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (18)
The proof is based on calculations on complex numbersand it can be found for example in [1 4] We are going to usethe Landau-Mignotte bounds in the following two shapes
Corollary 7 In notations of Theorem 6 there is the followingupper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891= 2119899minus1 1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (19)
Proof To obtain this from (18) first notice that |11988801198860| le 1
Next if 119896 = deg ℎ(119909) = deg119891(119909) = 119899 then 119891(119909) = 119903 sdot
ℎ(119909) where 119903 is a nonzero integer Then |119888119894| le max|119888
119894| | 119894 =
0 119899 le max|119886119894| | 119894 = 0 119899 le 119891(119909)
Finally if 119896 = deg ℎ(119909) le 119899 minus 1 (119896 is unknown to us) thenwe can simply replace in (18) the value 2119896 by 2119899minus1
Remark 8 In literature they use the rather less accuratebound |119888
119894| le 2119899119891(119909) but the second paragraph of our proof
above allows replacing 2119899 by 2119899minus1 See also Remark 23
Corollary 9 In notations ofTheorem 6 if ℎ(119909) also is a divisorof the polynomial 119892(119909) = 119887
0119909119898+ sdot sdot sdot + 119887
119898 then there is the
following upper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891119892
= 2min119899119898
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(20)
Proof To obtain this from (18) just notice that if ℎ(119909)
is a common divisor for 119891(119909) and 119892(119909) then its leadingcoefficient 119888
0divides both 119886
0and 1198870
Formula (20) provides the hint to overcome Problem1 about eliminating coefficients mentioned at the start ofthis subsection Although the divisors ℎ(119909) of 119891(119909) and119892(119909) are yet unknown we can compute 119873
119891119892and take
119901 gt 119873119891119892 If we apply the reduction 120593
119901for this 119901 we can
be sure that none of the coefficients of ℎ(119909) has changedldquomuchrdquo under that homomorphism for 120593
119901does not alter
the nonnegative coefficients of ℎ(119909) and it just adds 119901 to allnegative coefficients of ℎ(119909) The same holds true for 119889(119909) =gcd(119891(119909) 119892(119909))
42 Problem 2 Negative Coefficients and Reconstruction ofthe Preimage The reduction 120593
119901is not a bijection and 119889
119901(119909)
has infinitely many preimages in Z[119909] But the relativelyuncomplicated relationship between coefficients of 119889(119909) and119889119901(119909) obtained in previous subsection may allow us to
reconstruct 119889(119909) if we know 119889119901(119909) The condition 119901 gt 119873
119891119892
puts a restriction on the preimage 119889(119909) the coefficients of119889(119909) either are equal to respective coefficients of119889
119901(119909) (if they
are nonnegative) or are the respective coefficients of 119889119901(119909)
minus 119901 (if they are negative) Reconstruction may causeproblems connected with negative coefficients
Example 10 If for some polynomials 119891(119909) 119892(119909) we have119873119891119892
= 15 we can take the prime say 119901 = 17 gt 119873119891119892 Assume
we have somehow calculated 11988917(119909) = 12119909
3+ 3119909 + 10 we
can be sure that 119889(119909) is not the preimage 291199093 minus 171199092 + 20119909+27 because 119889(119909) cannot have coefficients greater than 15 byabsolute value But we still cannot be sure if the preimage119889(119909)is 121199093 +3119909+10 or minus51199093 +3119909+10 or maybe minus51199093 minus14119909minus7
It is easy to overcome this by just taking a larger value
119901 gt 2 sdot 119873119891119892 (21)
If the coefficient 119888119894of 119889(119909) is nonnegative then 120593
119901(119888119894) =
119888119894lt 1199012 and if it is negative then 120593
119901(119888119894) = 119888119894+ 119901 gt 1199012
This provides us with the very simple method as shown inAlgorithm 1 to reconstruct 119889(119909) if we have already computed119889119901(119909) for sufficiently large prime 119901
6 International Journal of Mathematics and Mathematical Sciences
Input For an unknown polynomial 119889(119909) isin Z[119909] we knowthe upper bound119873 of absolute values of its coefficientsand for arbitrarily large prime number 119901 we have themodular image 119889
119901(119909) = 119887
0119901119909119896+ sdot sdot sdot + 119887
119896119901isin Z119901[119909]
Reconstruct the polynomial 119889(119909)(01) Choose any prime 119901 gt 2 sdot 119873(02) Set 119896 = deg 119889
119901(119909)
(03) Set 119894 = 0(04) While 119894 le 119896
(05) if 119887119894119901
lt 1199012
(06) set 119887119894= 119887119894119901
(07) else(08) set 119887
119894= 119887119894119901
minus 119901(10) set 119894 = 119894 + 1(11) Output 119889(119909) = 119887
0119909119896+ sdot sdot sdot + 119887
119896
Algorithm 1 The polynomial reconstruction by modular image
43 Problem 3 Finding the Correct Fold of the Modular gcdof Right Degree Now additionally assume the polynomials119891(119909) 119892(119909) isin Z[119909] to be primitive Since cont(119891(119909)) andcont(119892(119909)) are defined up to the sign plusmn1 we can without lossof generality admit the leading coefficients of119891(119909) 119892(119909) to bepositive
Below in Problem 4 we will see that for some 119901 thepolynomial 119890
119901(119909) computed by the Euclidean algorithm in
Z119901[119909] may not be the image of 119889(119909) and moreover its
degree may be different from that of 119889(119909) This means thatby applying Algorithm 1 to 119890
119901(119909) we may not obtain 119889(119909)
Assume however we have 119901 which meets the condition 119901 gt
2 sdot 119873119891119892
and for which
deg 119889 (119909) = deg 119890119901(119909) (22)
By Corollary 3 a common divisor of 119891(119909) 119892(119909) is 119889(119909) =
gcd(119891(119909) 119892(119909)) if and only if it is primitive and if its degreeis the maximum of degrees of all common divisors Since120593119901does not change the degree of 119889(119909) we get by Lemma 4
(applied for the field119870 = Z119901) that119889
119901(119909) is gcd of119891
119901(119909) 119892119901(119909)
in Z119901[119909] This correspondence surely is not one-to-one
because in Z[119909] gcd is calculated up to the unit element ofZ[119909] which is plusmn1 whereas in Z
119901[119909] gcd is calculated up to
the unit element ofZ119901[119909] which can be any nonzero number
119905 isin Zlowast119901= 1 119901minus1 So the polynomial 119890
119901(119909) calculated by
the Euclidean algorithmmay not be the image 119889119901(119909) of 119889(119909)
Example 11 For 119891(119909) = 1199092+ 4119909 + 3 and 119892(119909) = 119909
2+ 2119909 + 1
whichever prime 119901 gt 4 we take we will get by the Euclideanalgorithm
119890119901(119909) = gcd (119891
119901(119909) 119892
119901(119909)) = 2119909 + 2 isin Z
119901 [119909] (23)
But in Z[119909] we have 119889(119909) = 119909 + 1 So regardless how large 119901we choose we will never get 120593
119901(119909 + 1) = 2119909 + 2
In other words we are aware that the image 119889119901(119909) is one
of the folds 119905 sdot 119890119901(119909) of 119890
119901(119909) for some 119905 isin 1 119901 minus 1 but
we are not aware which 119905 is that
The leading coefficient 1198880= lc(119889(119909)) of 119889(119909) can also be
assumed to be positive Denote by 119908 the positive gcd(1198860 1198870)
Since both 1198880and 119908 are not altered by 120593
119901 their fraction 119908119888
0
also is not altered Take such 119905 that
lc (119905 sdot 119890119901(119909)) = 119908 (24)
Even if 119905 sdot 119890119901(119909) is not the image 119889
119901(119909) it is the image of 119897 sdot
119889(119909) where 119897 divides1199081198880 If we calculate the preimage 119896(119909) isin
Z[119909] of 119905 sdot 119890119901(119909) by Algorithm 1 we will get a polynomial
which is either 119889(119909) or some fold of 119889(119909) Since 119891(119909) 119892(119909)are primitive it remains to go to the primitive part 119889(119909) =
pp(119896(119909))The general case when 119891(119909) 119892(119909) may not be primi-
tive can easily be reduced to the following for arbitrary119891(119909) 119892(119909) take their decompositions by formula (5) and set
119903 = gcd (cont (119891 (119909)) cont (119892 (119909))) isin Z (25)
Then assign 119891(119909) = pp(119891(119909)) 119892(119909) = pp(119892(119909)) and do thesteps above for these new polynomials After 119889(119909) = pp(119896(119909))is computed we get the final answer as 119903 sdot 119889(119909) = 119903 sdot pp(119896(119909))
Notice that for Algorithm 1 we need 119901 to be greater thanany coefficient |119888
119894| of the polynomial we reconstruct The
bound 119901 gt 2 sdot 119873119891119892
assures that 119901 meets this condition for119889(119909) We however reconstruct not 119889(119909) but 119897 sdot 119889(119909) whichmay have larger coefficients One could overcome this pointby taking 119901 gt 119908 sdot 2 sdot 119873
119891119892 but this is not necessary because
as we see later while the Big prime modular gcd algorithmworks the value of 119901 will grow and this issue will be covered
44 Problem 4 Finding the Right Degree for the Modular gcdAs we saw one can reconstruct 119889(119909) if we find 119901 gt 2 sdot 119873
119891119892
such that condition (22) holds Consider an example to seethat (22) may actually not hold for some 119901 even if 120593
119901is not
altering the coefficients of 119891(119909) and 119892(119909)
Example 12 For 119891(119909) = 1199092+ 1 and 119892(119909) = 119909 + 1 we have
119889(119909) = gcd(119891(119909) 119892(119909)) = 1 Taking 119901 = 2 we get 1198912(119909) =
1199092+ 1 and 119892
2(119909) = 119909 + 1 In Z
2[119909] we have 119891
2(119909) = 119909
2+ 1 =
1199092+12= (119909+1)(119909+1) thus 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) = 119909+1
We get that 1 = deg(119909 + 1) gt deg(119909) = 0 In particularwhatever 119905 we take 119905 sdot (119909 + 1) is not the image of 119889(119909) = 1
under 1205932
The idea to overcome this problem is to show that thenumber of primes 119901 for which (22) falsifies is ldquosmallrdquo Soif the selected 119901 is not suitable we take another 119901 and do thecalculation again by the new prime And we will not have torepeat these steps for many times (we will turn to this pointin Section 6)
The proof of the following theorem and the definition ofthe resultant res(119891(119909) 119892(119909)) (ie of the determinant of theSylvestermatrix 119878
119891119892of polynomials119891(119909) 119892(119909)) can be found
for example in [1 4 7 10]The resultant is a comfortable toolto detect if the given polynomials are coprime
Theorem 13 Let 119877 be an integrity domain The polynomials119891(119909) 119892(119909) isin 119877[119909] are coprime if and only if res(119891(119909) 119892(119909)) =
0
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
International Journal of Mathematics and Mathematical Sciences 5
41 Problem 1 Avoiding the Eliminating Coefficients Afterreduction 120593
119901 some of the coefficients of 119891(119909) and 119892(119909) may
change or even be eliminated So their images 119891119901(119909) =
120593119901(119891(119909)) and 119892
119901(119909) = 120593
119901(119892(119909)) may keep very little
information to reconstruct 119889(119909) based on 119890119901(119909)
Example 5 If 119891(119909) = 71199092+ 22 and 119892(119909) = 49119909
3+ 154119909
then for 119901 = 7 we get 119891119901(119909) = 1 and 119892
119901(119909) = 0 So
these values contain no reliable information to reconstructgcd(119891(119909) 119892(119909))
The first simple idea to avoid such elimination is to take119901 larger than the absolute value of all coefficients of 119891(119909) and119892(119909) This however is not enough since a divisor ℎ(119909) of apolynomial 119891(119909) may have coefficients larger than those of119891(119909) Moreover using the cyclotomic polynomials for largeenough 119899
120601119899(119909) = prod
119896=1119899(119896119899)=1
(119909 minus 1198902119894120587119896119899
) (17)
one can get divisors of 119891(119909) = 119909119899minus 1 which have a coefficient
larger than any pregiven number [1 4 8] Since we do notknow the divisors of 119891(119909) and 119892(119909) we cannot be sure ifthe abovementioned large 119901 will be large enough to preventelimination of coefficients of ℎ(119909) To overcome this one canuse the Landau-Mignotte bounds (in different sources thebounds on coefficients of the divisors are called differentlyassociating them with names of L Landau or M Mignotteor with both of them these authors have different roles indevelopment of the formulas which in turn are consequenceof a formula by A L Cauchy) as done in [4ndash6] For apolynomial 119891(119909) given by (15) denote its norm by 119891(119909) =
radicsum119899
119894=01198862119894
Theorem6 (L LandauMMignotte) Let119891(119909) = 1198860119909119899+sdot sdot sdot+
119886119899and ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896be nonzero polynomials in Z[119909]
If ℎ(119909) is a divisor of 119891(119909) then
119899
sum119894=0
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot10038161003816100381610038161003816100381610038161003816
1198880
1198860
10038161003816100381610038161003816100381610038161003816sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (18)
The proof is based on calculations on complex numbersand it can be found for example in [1 4] We are going to usethe Landau-Mignotte bounds in the following two shapes
Corollary 7 In notations of Theorem 6 there is the followingupper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891= 2119899minus1 1003817100381710038171003817119891 (119909)
1003817100381710038171003817 (19)
Proof To obtain this from (18) first notice that |11988801198860| le 1
Next if 119896 = deg ℎ(119909) = deg119891(119909) = 119899 then 119891(119909) = 119903 sdot
ℎ(119909) where 119903 is a nonzero integer Then |119888119894| le max|119888
119894| | 119894 =
0 119899 le max|119886119894| | 119894 = 0 119899 le 119891(119909)
Finally if 119896 = deg ℎ(119909) le 119899 minus 1 (119896 is unknown to us) thenwe can simply replace in (18) the value 2119896 by 2119899minus1
Remark 8 In literature they use the rather less accuratebound |119888
119894| le 2119899119891(119909) but the second paragraph of our proof
above allows replacing 2119899 by 2119899minus1 See also Remark 23
Corollary 9 In notations ofTheorem 6 if ℎ(119909) also is a divisorof the polynomial 119892(119909) = 119887
0119909119898+ sdot sdot sdot + 119887
119898 then there is the
following upper bound for the coefficients of ℎ(119909)
10038161003816100381610038161198881198941003816100381610038161003816 le 119873119891119892
= 2min119899119898
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(20)
Proof To obtain this from (18) just notice that if ℎ(119909)
is a common divisor for 119891(119909) and 119892(119909) then its leadingcoefficient 119888
0divides both 119886
0and 1198870
Formula (20) provides the hint to overcome Problem1 about eliminating coefficients mentioned at the start ofthis subsection Although the divisors ℎ(119909) of 119891(119909) and119892(119909) are yet unknown we can compute 119873
119891119892and take
119901 gt 119873119891119892 If we apply the reduction 120593
119901for this 119901 we can
be sure that none of the coefficients of ℎ(119909) has changedldquomuchrdquo under that homomorphism for 120593
119901does not alter
the nonnegative coefficients of ℎ(119909) and it just adds 119901 to allnegative coefficients of ℎ(119909) The same holds true for 119889(119909) =gcd(119891(119909) 119892(119909))
42 Problem 2 Negative Coefficients and Reconstruction ofthe Preimage The reduction 120593
119901is not a bijection and 119889
119901(119909)
has infinitely many preimages in Z[119909] But the relativelyuncomplicated relationship between coefficients of 119889(119909) and119889119901(119909) obtained in previous subsection may allow us to
reconstruct 119889(119909) if we know 119889119901(119909) The condition 119901 gt 119873
119891119892
puts a restriction on the preimage 119889(119909) the coefficients of119889(119909) either are equal to respective coefficients of119889
119901(119909) (if they
are nonnegative) or are the respective coefficients of 119889119901(119909)
minus 119901 (if they are negative) Reconstruction may causeproblems connected with negative coefficients
Example 10 If for some polynomials 119891(119909) 119892(119909) we have119873119891119892
= 15 we can take the prime say 119901 = 17 gt 119873119891119892 Assume
we have somehow calculated 11988917(119909) = 12119909
3+ 3119909 + 10 we
can be sure that 119889(119909) is not the preimage 291199093 minus 171199092 + 20119909+27 because 119889(119909) cannot have coefficients greater than 15 byabsolute value But we still cannot be sure if the preimage119889(119909)is 121199093 +3119909+10 or minus51199093 +3119909+10 or maybe minus51199093 minus14119909minus7
It is easy to overcome this by just taking a larger value
119901 gt 2 sdot 119873119891119892 (21)
If the coefficient 119888119894of 119889(119909) is nonnegative then 120593
119901(119888119894) =
119888119894lt 1199012 and if it is negative then 120593
119901(119888119894) = 119888119894+ 119901 gt 1199012
This provides us with the very simple method as shown inAlgorithm 1 to reconstruct 119889(119909) if we have already computed119889119901(119909) for sufficiently large prime 119901
6 International Journal of Mathematics and Mathematical Sciences
Input For an unknown polynomial 119889(119909) isin Z[119909] we knowthe upper bound119873 of absolute values of its coefficientsand for arbitrarily large prime number 119901 we have themodular image 119889
119901(119909) = 119887
0119901119909119896+ sdot sdot sdot + 119887
119896119901isin Z119901[119909]
Reconstruct the polynomial 119889(119909)(01) Choose any prime 119901 gt 2 sdot 119873(02) Set 119896 = deg 119889
119901(119909)
(03) Set 119894 = 0(04) While 119894 le 119896
(05) if 119887119894119901
lt 1199012
(06) set 119887119894= 119887119894119901
(07) else(08) set 119887
119894= 119887119894119901
minus 119901(10) set 119894 = 119894 + 1(11) Output 119889(119909) = 119887
0119909119896+ sdot sdot sdot + 119887
119896
Algorithm 1 The polynomial reconstruction by modular image
43 Problem 3 Finding the Correct Fold of the Modular gcdof Right Degree Now additionally assume the polynomials119891(119909) 119892(119909) isin Z[119909] to be primitive Since cont(119891(119909)) andcont(119892(119909)) are defined up to the sign plusmn1 we can without lossof generality admit the leading coefficients of119891(119909) 119892(119909) to bepositive
Below in Problem 4 we will see that for some 119901 thepolynomial 119890
119901(119909) computed by the Euclidean algorithm in
Z119901[119909] may not be the image of 119889(119909) and moreover its
degree may be different from that of 119889(119909) This means thatby applying Algorithm 1 to 119890
119901(119909) we may not obtain 119889(119909)
Assume however we have 119901 which meets the condition 119901 gt
2 sdot 119873119891119892
and for which
deg 119889 (119909) = deg 119890119901(119909) (22)
By Corollary 3 a common divisor of 119891(119909) 119892(119909) is 119889(119909) =
gcd(119891(119909) 119892(119909)) if and only if it is primitive and if its degreeis the maximum of degrees of all common divisors Since120593119901does not change the degree of 119889(119909) we get by Lemma 4
(applied for the field119870 = Z119901) that119889
119901(119909) is gcd of119891
119901(119909) 119892119901(119909)
in Z119901[119909] This correspondence surely is not one-to-one
because in Z[119909] gcd is calculated up to the unit element ofZ[119909] which is plusmn1 whereas in Z
119901[119909] gcd is calculated up to
the unit element ofZ119901[119909] which can be any nonzero number
119905 isin Zlowast119901= 1 119901minus1 So the polynomial 119890
119901(119909) calculated by
the Euclidean algorithmmay not be the image 119889119901(119909) of 119889(119909)
Example 11 For 119891(119909) = 1199092+ 4119909 + 3 and 119892(119909) = 119909
2+ 2119909 + 1
whichever prime 119901 gt 4 we take we will get by the Euclideanalgorithm
119890119901(119909) = gcd (119891
119901(119909) 119892
119901(119909)) = 2119909 + 2 isin Z
119901 [119909] (23)
But in Z[119909] we have 119889(119909) = 119909 + 1 So regardless how large 119901we choose we will never get 120593
119901(119909 + 1) = 2119909 + 2
In other words we are aware that the image 119889119901(119909) is one
of the folds 119905 sdot 119890119901(119909) of 119890
119901(119909) for some 119905 isin 1 119901 minus 1 but
we are not aware which 119905 is that
The leading coefficient 1198880= lc(119889(119909)) of 119889(119909) can also be
assumed to be positive Denote by 119908 the positive gcd(1198860 1198870)
Since both 1198880and 119908 are not altered by 120593
119901 their fraction 119908119888
0
also is not altered Take such 119905 that
lc (119905 sdot 119890119901(119909)) = 119908 (24)
Even if 119905 sdot 119890119901(119909) is not the image 119889
119901(119909) it is the image of 119897 sdot
119889(119909) where 119897 divides1199081198880 If we calculate the preimage 119896(119909) isin
Z[119909] of 119905 sdot 119890119901(119909) by Algorithm 1 we will get a polynomial
which is either 119889(119909) or some fold of 119889(119909) Since 119891(119909) 119892(119909)are primitive it remains to go to the primitive part 119889(119909) =
pp(119896(119909))The general case when 119891(119909) 119892(119909) may not be primi-
tive can easily be reduced to the following for arbitrary119891(119909) 119892(119909) take their decompositions by formula (5) and set
119903 = gcd (cont (119891 (119909)) cont (119892 (119909))) isin Z (25)
Then assign 119891(119909) = pp(119891(119909)) 119892(119909) = pp(119892(119909)) and do thesteps above for these new polynomials After 119889(119909) = pp(119896(119909))is computed we get the final answer as 119903 sdot 119889(119909) = 119903 sdot pp(119896(119909))
Notice that for Algorithm 1 we need 119901 to be greater thanany coefficient |119888
119894| of the polynomial we reconstruct The
bound 119901 gt 2 sdot 119873119891119892
assures that 119901 meets this condition for119889(119909) We however reconstruct not 119889(119909) but 119897 sdot 119889(119909) whichmay have larger coefficients One could overcome this pointby taking 119901 gt 119908 sdot 2 sdot 119873
119891119892 but this is not necessary because
as we see later while the Big prime modular gcd algorithmworks the value of 119901 will grow and this issue will be covered
44 Problem 4 Finding the Right Degree for the Modular gcdAs we saw one can reconstruct 119889(119909) if we find 119901 gt 2 sdot 119873
119891119892
such that condition (22) holds Consider an example to seethat (22) may actually not hold for some 119901 even if 120593
119901is not
altering the coefficients of 119891(119909) and 119892(119909)
Example 12 For 119891(119909) = 1199092+ 1 and 119892(119909) = 119909 + 1 we have
119889(119909) = gcd(119891(119909) 119892(119909)) = 1 Taking 119901 = 2 we get 1198912(119909) =
1199092+ 1 and 119892
2(119909) = 119909 + 1 In Z
2[119909] we have 119891
2(119909) = 119909
2+ 1 =
1199092+12= (119909+1)(119909+1) thus 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) = 119909+1
We get that 1 = deg(119909 + 1) gt deg(119909) = 0 In particularwhatever 119905 we take 119905 sdot (119909 + 1) is not the image of 119889(119909) = 1
under 1205932
The idea to overcome this problem is to show that thenumber of primes 119901 for which (22) falsifies is ldquosmallrdquo Soif the selected 119901 is not suitable we take another 119901 and do thecalculation again by the new prime And we will not have torepeat these steps for many times (we will turn to this pointin Section 6)
The proof of the following theorem and the definition ofthe resultant res(119891(119909) 119892(119909)) (ie of the determinant of theSylvestermatrix 119878
119891119892of polynomials119891(119909) 119892(119909)) can be found
for example in [1 4 7 10]The resultant is a comfortable toolto detect if the given polynomials are coprime
Theorem 13 Let 119877 be an integrity domain The polynomials119891(119909) 119892(119909) isin 119877[119909] are coprime if and only if res(119891(119909) 119892(119909)) =
0
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
6 International Journal of Mathematics and Mathematical Sciences
Input For an unknown polynomial 119889(119909) isin Z[119909] we knowthe upper bound119873 of absolute values of its coefficientsand for arbitrarily large prime number 119901 we have themodular image 119889
119901(119909) = 119887
0119901119909119896+ sdot sdot sdot + 119887
119896119901isin Z119901[119909]
Reconstruct the polynomial 119889(119909)(01) Choose any prime 119901 gt 2 sdot 119873(02) Set 119896 = deg 119889
119901(119909)
(03) Set 119894 = 0(04) While 119894 le 119896
(05) if 119887119894119901
lt 1199012
(06) set 119887119894= 119887119894119901
(07) else(08) set 119887
119894= 119887119894119901
minus 119901(10) set 119894 = 119894 + 1(11) Output 119889(119909) = 119887
0119909119896+ sdot sdot sdot + 119887
119896
Algorithm 1 The polynomial reconstruction by modular image
43 Problem 3 Finding the Correct Fold of the Modular gcdof Right Degree Now additionally assume the polynomials119891(119909) 119892(119909) isin Z[119909] to be primitive Since cont(119891(119909)) andcont(119892(119909)) are defined up to the sign plusmn1 we can without lossof generality admit the leading coefficients of119891(119909) 119892(119909) to bepositive
Below in Problem 4 we will see that for some 119901 thepolynomial 119890
119901(119909) computed by the Euclidean algorithm in
Z119901[119909] may not be the image of 119889(119909) and moreover its
degree may be different from that of 119889(119909) This means thatby applying Algorithm 1 to 119890
119901(119909) we may not obtain 119889(119909)
Assume however we have 119901 which meets the condition 119901 gt
2 sdot 119873119891119892
and for which
deg 119889 (119909) = deg 119890119901(119909) (22)
By Corollary 3 a common divisor of 119891(119909) 119892(119909) is 119889(119909) =
gcd(119891(119909) 119892(119909)) if and only if it is primitive and if its degreeis the maximum of degrees of all common divisors Since120593119901does not change the degree of 119889(119909) we get by Lemma 4
(applied for the field119870 = Z119901) that119889
119901(119909) is gcd of119891
119901(119909) 119892119901(119909)
in Z119901[119909] This correspondence surely is not one-to-one
because in Z[119909] gcd is calculated up to the unit element ofZ[119909] which is plusmn1 whereas in Z
119901[119909] gcd is calculated up to
the unit element ofZ119901[119909] which can be any nonzero number
119905 isin Zlowast119901= 1 119901minus1 So the polynomial 119890
119901(119909) calculated by
the Euclidean algorithmmay not be the image 119889119901(119909) of 119889(119909)
Example 11 For 119891(119909) = 1199092+ 4119909 + 3 and 119892(119909) = 119909
2+ 2119909 + 1
whichever prime 119901 gt 4 we take we will get by the Euclideanalgorithm
119890119901(119909) = gcd (119891
119901(119909) 119892
119901(119909)) = 2119909 + 2 isin Z
119901 [119909] (23)
But in Z[119909] we have 119889(119909) = 119909 + 1 So regardless how large 119901we choose we will never get 120593
119901(119909 + 1) = 2119909 + 2
In other words we are aware that the image 119889119901(119909) is one
of the folds 119905 sdot 119890119901(119909) of 119890
119901(119909) for some 119905 isin 1 119901 minus 1 but
we are not aware which 119905 is that
The leading coefficient 1198880= lc(119889(119909)) of 119889(119909) can also be
assumed to be positive Denote by 119908 the positive gcd(1198860 1198870)
Since both 1198880and 119908 are not altered by 120593
119901 their fraction 119908119888
0
also is not altered Take such 119905 that
lc (119905 sdot 119890119901(119909)) = 119908 (24)
Even if 119905 sdot 119890119901(119909) is not the image 119889
119901(119909) it is the image of 119897 sdot
119889(119909) where 119897 divides1199081198880 If we calculate the preimage 119896(119909) isin
Z[119909] of 119905 sdot 119890119901(119909) by Algorithm 1 we will get a polynomial
which is either 119889(119909) or some fold of 119889(119909) Since 119891(119909) 119892(119909)are primitive it remains to go to the primitive part 119889(119909) =
pp(119896(119909))The general case when 119891(119909) 119892(119909) may not be primi-
tive can easily be reduced to the following for arbitrary119891(119909) 119892(119909) take their decompositions by formula (5) and set
119903 = gcd (cont (119891 (119909)) cont (119892 (119909))) isin Z (25)
Then assign 119891(119909) = pp(119891(119909)) 119892(119909) = pp(119892(119909)) and do thesteps above for these new polynomials After 119889(119909) = pp(119896(119909))is computed we get the final answer as 119903 sdot 119889(119909) = 119903 sdot pp(119896(119909))
Notice that for Algorithm 1 we need 119901 to be greater thanany coefficient |119888
119894| of the polynomial we reconstruct The
bound 119901 gt 2 sdot 119873119891119892
assures that 119901 meets this condition for119889(119909) We however reconstruct not 119889(119909) but 119897 sdot 119889(119909) whichmay have larger coefficients One could overcome this pointby taking 119901 gt 119908 sdot 2 sdot 119873
119891119892 but this is not necessary because
as we see later while the Big prime modular gcd algorithmworks the value of 119901 will grow and this issue will be covered
44 Problem 4 Finding the Right Degree for the Modular gcdAs we saw one can reconstruct 119889(119909) if we find 119901 gt 2 sdot 119873
119891119892
such that condition (22) holds Consider an example to seethat (22) may actually not hold for some 119901 even if 120593
119901is not
altering the coefficients of 119891(119909) and 119892(119909)
Example 12 For 119891(119909) = 1199092+ 1 and 119892(119909) = 119909 + 1 we have
119889(119909) = gcd(119891(119909) 119892(119909)) = 1 Taking 119901 = 2 we get 1198912(119909) =
1199092+ 1 and 119892
2(119909) = 119909 + 1 In Z
2[119909] we have 119891
2(119909) = 119909
2+ 1 =
1199092+12= (119909+1)(119909+1) thus 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) = 119909+1
We get that 1 = deg(119909 + 1) gt deg(119909) = 0 In particularwhatever 119905 we take 119905 sdot (119909 + 1) is not the image of 119889(119909) = 1
under 1205932
The idea to overcome this problem is to show that thenumber of primes 119901 for which (22) falsifies is ldquosmallrdquo Soif the selected 119901 is not suitable we take another 119901 and do thecalculation again by the new prime And we will not have torepeat these steps for many times (we will turn to this pointin Section 6)
The proof of the following theorem and the definition ofthe resultant res(119891(119909) 119892(119909)) (ie of the determinant of theSylvestermatrix 119878
119891119892of polynomials119891(119909) 119892(119909)) can be found
for example in [1 4 7 10]The resultant is a comfortable toolto detect if the given polynomials are coprime
Theorem 13 Let 119877 be an integrity domain The polynomials119891(119909) 119892(119909) isin 119877[119909] are coprime if and only if res(119891(119909) 119892(119909)) =
0
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
International Journal of Mathematics and Mathematical Sciences 7
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs so that sgn cont(119891(119909)) = sgn lc(119891(119909))
and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs for cont(119891(119909)) and cont(119892(119909)))
(05) Calculate the positive 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Compute the Landau-Mignotte bound119873
119891119892by (20)
(08) Choose a new prime number 119901 gt 2 sdot 119873119891119892
(09) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(10) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(11) If119863 le deg 119890119901(119909)
(12) go to step (08)(13) else(14) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(15) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(16) calculate cont(119896(119909)) in the Euclidean domain Z(17) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(18) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(19) go to step (23)(20) else(21) set119863 = deg 119890
119901(119909)
(22) go to step (08)(23) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 2 Big prime modular gcd algorithm
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Detect if 119891(119909) and 119892(119909) are coprime(01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z(02) Calculate 119903 in the Euclidean domain Z by (25)(03) If 119903 asymp 1
(04) output the result 119891(119909) and 119892(119909) are not coprime and stop(05) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
(06) Calculate 119908 = gcd(1198860 1198870) in the Euclidean domain Z
(07) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(08) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(09) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(10) Set 119894 = 1(11) While 119894 = 119896 + 1
(12) choose a new prime 119901 ∤ 119908(13) apply the reduction 120593
119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) calculate 119890119901= gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) if deg 119890119902119894= 0
(16) output the result 119891(119909) and 119892(119909) are coprime and stop(17) set 119894 = 119894 + 1(18) If 119894 lt 119896 + 1
(19) go to step (12)(20) else(21) output the result 119891(119909) and 119892(119909) are not coprime
Algorithm 3 Coprime polynomials detection modular algorithm
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
8 International Journal of Mathematics and Mathematical Sciences
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(x)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Calculate 119903 in the Euclidean domain Z by (25)(04) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(05) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(06) Set119863 = mindeg119891(119909) deg119892(119909) + 1(07) Choose a prime number 119902 ∤ 119908(08) Apply the reduction 120593
119902to calculate the modular images 119891
119902(119909) 119892
119902(119909) isin Z
119902[119909]
(09) Calculate 119890119902(119909) = gcd(119891
119902(119909) 119892
119902(119909)) in the Euclidean domain Z
119902[119909]
(10) Set 119904(119902 119891 119892) = deg 119890119902(119909)
(11) Calculate119872119902119891119892
by (40) using the value of 119904(119902 119891 119892)(12) Choose a new prime number 119901 gt 2 sdot 119872
119902119891119892
(13) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(14) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(15) If119863 le deg 119890119901(119909)
(16) go to step (12)(17) else(18) choose a 119905 such that the lc(119905 sdot 119890
119901(119909)) = 119908
(19) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(20) calculate cont(119896(119909)) in the Euclidean domain Z(21) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(22) if 119889(119909) | 119891(119909) and 119889(119909) | 119892(119909)(23) go to step (27)(24) else(25) set119863 = deg 119890
119901(119909)
(26) go to step (12)(27) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 4 Big prime modular gcd algorithm with a preliminary estimate on divisor degree
The following fact in a little different shape can be foundin [4] or [5]
Corollary 14 If the prime 119901 does not divide at least oneof the leading coefficients 119886
0 1198870of polynomials respectively
119891(119909) 119892(119909) isin Z[119909] then deg 119889(119909) le deg 119890119901(119909) If 119901 also
does not divide 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) where 119889(119909) =gcd(119891(119909) 119892(119909)) then
deg 119889 (119909) = deg 119889119901(119909) = deg gcd (119891
119901(119909) 119892
119901(119909))
= deg 119890119901(119909)
(26)
Proof Since 1198880
= lc(119889(119909)) divides 119908 = gcd(1198860 1198870) then
120593119901(1198880) = 0 by the choice of 119901 Thus deg 119889(119909) = deg 119889
119901(119909) le
deg gcd(119891119901(119909) 119892119901(119909))
Since 119889119901(119909) = 0 we can consider the fractions
119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) in Z
119901[119909] From unique factor-
izations of 119891119901(119909) and 119892
119901(119909) in UFD Z
119901[119909] it is very easy to
deduce that
119890119901 (119909) asymp gcd (119891
119901 (119909) 119892119901 (119909))
asymp 119889119901(119909) sdot gcd(
119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(27)
In particular deg 119889(119909) = deg 119889119901(119909) le deg 119890
119901(119909) And the
inequality deg119889119901(119909) = deg 119890
119901(119909)may occur only if
deg gcd(119891119901(119909)
119889119901 (119909)
119892119901(119909)
119889119901 (119909)
) gt 0 (28)
that is when 119891119901(119909)119889119901(119909) and 119892
119901(119909)119889119901(119909) are not
coprime in Z119901[119909] or by Theorem 13 when res(119891
119901(119909)
119889119901(119909) 119892119901(119909)119889119901(119909)) = 0 The latter is the determinant of
Sylvester matrix 119878119891119901119889119901119892119901119889119901
Consider the matrix rings ho-momorphism (matrix modular reduction)
120593119901 119872119898+119899
(Z) 997888rarr 119872119898+119899
(Z119901) (29)
where 119899 = deg119891(119909) 119898 = deg119892(119909) (as mentioned earlier weuse the same symbol 120593
119901for numeric polynomial and matrix
reductions) Since 120593119901(119878119891119889119892119889
) = 119878119891119901119889119901119892119901119889119901
and since thedeterminant of a matrix is a sum of products of its elementswe get
119877119901= 120593119901 (119877) = 120593
119901(res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909)))
= res(119891119901(119909)
119889119901(119909)
119892119901(119909)
119889119901(119909)
)
(30)
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
International Journal of Mathematics and Mathematical Sciences 9
Input non-zero polynomials 119891(119909) 119892(119909) isin Z[119909]Calculate their greatest common divisor gcd(119891(119909) 119892(119909)) isin Z[119909](01) Calculate cont(119891(119909)) cont(119892(119909)) in the Euclidean domain Z choose their signs
so that sgn cont(119891(119909)) = sgn lc(119891(119909)) and sgn cont(119892(119909)) = sgn lc(119892(119909))(02) Set 119891(119909) = pp(119891(119909)) and 119892(119909) = pp(119892(119909))(03) Compute the bound 119860
119891119892for polynomials 119891(119909) 119892(119909) by (32)
(04) Find the maximal 119896 for which 119901119896 le 119860
119891119892
(05) Calculate 119903 in the Euclidean domain Z by (25)(06) Set 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909)) (they are positive by our selection of signs
for cont(119891(119909)) and cont(119892(119909)))(07) Calculate the positive 119908 = gcd(119886
0 1198870) in the Euclidean domain Z
(08) Set 119904(119891 119892) = mindeg119891(119909) deg119892(119909)(09) Set 119894 = 1(10) While 119894 = 119896 + 1
(11) choose a new prime 119902119894∤ 119908
(12) apply the reduction 120593119902119894to calculate the modular images 119891
119902119894(119909) 119892
119902119894(119909) isin Z
119902119894[119909]
(13) calculate 119890119902119894= gcd(119891
119902119894(119909) 119892
119902119894(119909)) in the Euclidean domain Z
119901[119909]
(14) if deg 119890119902119894le 119904(119891 119892)
(15) set 119904(119891 119892) = deg 119890119902119894
(16) if deg 119890119902119894= 0
(17) set 119889(119909) = 1(18) go to step (32)(19) set 119894 = 119894 + 1(20) Calculate119872
119891119892by (43) using the value of 119904(119891 119892)
(21) Choose a new prime number 119901 gt 2 sdot 119872119891119892
(22) Apply the reduction 120593119901to calculate the modular images 119891
119901(119909) 119892
119901(119909) isin Z
119901[119909]
(23) Calculate 119890119901(119909) = gcd(119891
119901(119909) 119892
119901(119909)) in the Euclidean domain Z
119901[119909]
(24) If deg 119890119901= 119904(119891 119892)
(25) choose a 119905 such that the lc(119905 sdot 119890119901(119909)) = 119908
(26) call Algorithm 1 to calculate the preimage 119896(119909) of 119905 sdot 119890119901(119909)
(27) calculate cont(119896(119909)) in the Euclidean domain Z(28) set 119889(119909) = pp(119896(119909)) = 119896(119909)cont(119896(119909))(29) go to step (32)(30) else(31) go to step (21)(32) Output the result gcd(119891(119909) 119892(119909)) = 119903 sdot 119889(119909)
Algorithm 5 Big prime modular gcd algorithm with preliminary estimates on divisor degrees by multiple primes
So 119877119901can be zero if and only if 119877 is divisible by 119901 The
polynomials 119891(119909)119889(119909) and 119892(119909)119889(119909) are coprime in Z[119909]
and their resultant is not zero by Theorem 13 And 119877 cannotbe a positive integer divisible by 119901 since that contradicts thecondition of this corollary
Corollary 14 shows that if for some 119901 equality (22) doesnot hold for polynomials 119891(119909) 119892(119909) isin Z[119909] then 119901 eitherdivides 119886
0and 1198870or divides the resultant 119877 We do not know
119877 since we do not yet know 119889(119909) to calculate the resultant119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) But since the number of suchprimes 119901 is just finite we can arrive to the right 119901 after tryingthe process for a few primes We will turn to this again inSection 6
5 The Big Prime Modular gcd Algorithm
Four steps of the previous section provide us with the follow-ing procedureWe keep all the notations from Section 4 Takethe primitive polynomials 119891(119909) 119892(119909) isin Z[119909] Without loss of
generality we may assume 1198860 1198870gt 0 Take any 119901 gt 2 sdot 119873
119891119892
Then 119901 ∤ 119908 = gcd(1198860 1198870) since 119886
0 1198870le 119873119891119892 Calculate
119890119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) in Z
119901[119909] by Euclidean algorithm
Then choose 119905 so that (24) holds Construct 119896(119909) applyingAlgorithm 1 to 119905 sdot 119890
119901(119909) If the primitive part 119889(119909) = pp(119896(119909))
divides both 119891(119909) and 119892(119909) then gcd for these primitivepolynomials is found 119889(119909) = gcd(119891(119909) 119892(119909)) That followsfrom consideration about divisor degrees above if 119891(119909) 119892(119909)had a common divisor ℎ(119909) of degree greater than deg 119889(119909)then since the degree of ℎ(119909) is not altered by 120593
119901 we would
get deg ℎ119901(119909) gt deg 119889
119901(119909) = deg 119889(119909) = deg 119890
119901(119909) which
contradicts the maximality of deg 119889119901(119909) by Lemma 4
This means that if for 119901 gt 2 sdot 119873119891119892
we get 119889(119909) ∤ 119891(119909) or119889(119909) ∤ 119892(119909) we have the case when 119901 divides the resultant119877 Then we just ignore the calculated polynomial chooseanother 119901 gt 2 sdot119873
119891119892 and redo the steps for it Repeating these
steps for finitely many times we will eventually arrive to thecorrect 119889(119909) for the primitive polynomials 119891(119909) 119892(119909)
The case of arbitrary nonzero polynomials can easilybe reduced to this By arguments mentioned earlier we
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
10 International Journal of Mathematics and Mathematical Sciences
should calculate 119889(119909) for primitive polynomials pp(119891(119909)) andpp(119892(119909)) and then output the final answer as 119903 sdot 119889(119909) where 119903is defined by (25) The process we described is the traditionalform of the Big prime modular gcd algorithm
Remark 15 Since our approach in Section 4 evolved themaximality of degrees of the common divisors we canshorten some of the steps of our algorithm Let us store ina variable say 119863 the minimal value for which we alreadyknow it is not deg gcd(119891(119909) 119892(119909)) As an initial 119863 we maytake for example119863 = mindeg119891(119909) deg119892(119909)+1 Each timewe calculate 119890
119901(119909) = gcd(119891
119901(119909) 119892119901(119909)) check if deg 119890
119901(119909) is
equal to or larger than the current119863 If yes we already knowthat we have an ldquoinappropriaterdquo 119901 Then we no longer needto use Algorithm 1 to reconstruct 119896(119909) and to get 119889(119909) =
pp(119896(119909)) We just skip these steps and proceed to the next119901 Reconstruct 119889(119909) and check if 119889(119909) | 119891(119909) and 119889(119909) |
119892(119909) only when deg 119890119901(119909) lt 119863 Then if 119889(119909) does not
divide 119891(119909) or 119892(119909) we have discovered a new bound 119863 fordeg(gcd(119891(119909) 119892(119909))) So set 119863 = deg 119890
119901(119909) and proceed to
the next 119901 If in next step we get deg 119890119901(119909) ge 119863 we will
again be aware that the steps of reconstruction of 119889(119909) needbe skipped
We constructed Algorithm 2Turning back to Remark 15 notice that for some prime
numbers 119901 we skip steps (14)ndash(18) of Algorithm 2 anddirectly jump to step (08) In fact Remark 15 has mainlytheoretical purpose to display how usage of UFD propertiesand comparison of divisor degrees may reduce some of thesteps of the Big prime modular gcd algorithm In practicalexamples the set of primes we use contains few primesdividing 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) so we may notfrequently get examples where steps (14)ndash(18) are skipped
Example 16 Let us apply Algorithm 2 to polynomials (1)mentioned in Knuthrsquos example above Since 119891(119909) = radic113
and 119892(119909) = radic570
119873119891119892
= 2min86
sdot gcd (1 3) sdotminradic113
1radic570
3
lt 512
(31)
And we can take the prime 119901 = 1031 gt 2 sdot 119873119891119892 It is not
hard to compute that gcd(1198911031
(119909) 1198921031
(119909)) asymp 1 So119891(119909) and119892(119909) are coprime It is worth to compare 119901 = 1031withmuchsmaller values119901 = 67 and119901 = 37 obtained below for the samepolynomials in (1) in Example 27 usingmodifiedAlgorithm4
In [1]we also applyAlgorithm2 to other polynomialswithcases when the polynomials are not coprime
6 Estimating the Prime Divisorsof the Resultant
Although at the start of the Big primemodular gcd algorithmwe cannot compute the resultant 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909)) for the given119891(119909) 119892(119909) isin Z[119909] (we do not know 119889(119909))
we can nevertheless estimate the value of 119877 and the numberof its prime divisors Denote
119860119891119892
= radic(119899 + 1)119898(119898 + 1)
119899sdot 119873119898
119891119873119899
119892
= 22119899119898minus119899minus119898radic(119899 + 1)
119898(119898 + 1)
119899
sdot1003817100381710038171003817119891 (119909)
1003817100381710038171003817119898 1003817100381710038171003817119892 (119909)
1003817100381710038171003817119899
(32)
Lemma 17 For any polynomials 119891(119909) 119892(119909) isin Z[119909] and forany of their common divisors 119889(119909) the following holds
10038161003816100381610038161003816100381610038161003816res(
119891 (119909)
119889 (119909)119892 (119909)
119889 (119909))10038161003816100381610038161003816100381610038161003816=10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le 119860119891119892 (33)
Proof By Corollary 7 the coefficients of fractions 119891(119909)119889(119909)and119892(119909)119889(119909) are bounded respectively by119873
119891= 2119899minus1
119891(119909)
and 119873119892= 2119898minus1
119892(119909) where 119899 = deg119891(119909) 119898 = deg119892(119909)Since the numbers of summands in these fractions are atmost119899 + 1 and119898 + 1 respectively we get
10038171003817100381710038171003817100381710038171003817
119891 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119899 + 1)1198732
119891
10038171003817100381710038171003817100381710038171003817
119892 (119909)
119889 (119909)
10038171003817100381710038171003817100381710038171003817le radic(119898 + 1)1198732
119892
(34)
Applying Hadamardrsquos maximal determinant bound [4] to theSylvester matrix 119878
119891119889119892119889 we get that
|119877| =10038161003816100381610038161003816119878119891119889119892119889
10038161003816100381610038161003816le (radic(119899 + 1)119873
119891)119898
sdot (radic(119898 + 1)119873119892)119899
(35)
The bound of (32) is very rough To see this apply it topolynomials (1) of Knuthrsquos example
Example 18 For polynomials (1) we have 119891(119909) = radic113 and119892(119909) = radic570 So we can estimate 119873
119891lt 1408 119873
119892lt 768
and119873119891119892
lt 512 Thus
|119877| le radic(8 + 1)6(6 + 1)
8sdot 1408
6sdot 5708= 120596
= 16505374299582118582810249858265119890 + 48
(36)
which is a too large number to comfortably operate with
Remark 19 If in Algorithm 2 we use a prime
119901 gt 2 sdot 119860119891119892 (37)
then we will get that 119901 ∤ 119877 = res(119891(119909)119889(119909) 119892(119909)119889(119909))whatever the greatest common divisor 119889(119909) is And clearly119901 ∤ 119908 holds for 119908 = gcd(119886
0 1198870) So in this case Algorithm 2
will output the correct pp(119896(119909)) using just one 119901 and we willnot have to take another 119901 ∤ 119908 after step (18) HoweverExample 18 shows why it is not reasonable to choose 119901 by rule(37) to have in Algorithm 2 one cycle only it is easier to govia a few cycles for smaller 119901 rather than to operate with ahuge 119901 which is two times larger than the bound 120596 obtainedin Example 18
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
International Journal of Mathematics and Mathematical Sciences 11
Nevertheless the bound119860119891119892
may be useful if we remem-ber that the process in Algorithm 2 concerned not the valueof res(119891(119909)119889(119909) 119892(119909)119889(119909)) but the number of its distinctprime divisors Let us denote by 119901
119896 the product of the first
119896 primes 119901119896 = 119901
1sdot 1199012sdot sdot sdot 119901119896(where 119901
1= 2 119901
2= 3 etc)
They sometimes call 119901119896 the ldquo119896th primorialrdquoThe following is
essential
Lemma 20 The number of pairwise distinct prime divisors ofa positive integer 119899 is less than or equal tomax119896 | 119901
119896 le 119899
From Lemmas 17 and 20 we easily get the following
Corollary 21 For any polynomials 119891(119909) 119892(119909) isin Z[119909] andfor any of their common divisors 119889(119909) the number of pairwisedistinct prime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is at most119896 where 119896 is the largest number for which 119901
119896 le 119860
119891119892
Primorial (as a function on 119896) grows very rapidly Say for119896 = 10 it is more than six billions 119901
10 = 6 469 693 230
This observation allows using the bound119860119891119892
in the followingway although the value of119860
119891119892as a function on 119899 = deg119891(119909)
and 119898 = deg119892(119909) and on the coefficients of 119891(119909) and119892(119909) grows rapidly the number of its distinct prime divisorsmay not be ldquovery largerdquo thanks to the fact that 119901
119896 also
grows rapidly Consider this on polynomials and values fromExample 18
Example 22 It is easy to compute that
11990130 = 31610054640417607788145206291544119890 + 46
lt 120596
11990131 = 4014476939333036189094441199026119890 + 48
gt 120596
(38)
where 120596 is the large number from Example 18 Thismeans that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) whatever the divisor 119889(119909) is isnot greater than 30 And whichever 30 + 1 = 31 distinctprimes we take at least one of them will not be a divisorof 119877 That is Algorithm 2 for the polynomials of Knuthrsquosexample will output the correct answer in not more than 31
cycles We cannot find 31 primes 119901 ∤ 119908 so that Algorithm 2arrives to a wrong 119889(119909) = pp(119896(119909)) on step (18) for all ofthem
Remark 23 Let us stress that estimates on the number ofprime divisors of the resultant and the analog of Algorithm 3can be found elsewhere for example in [4] So the only newswe have is that here we use a slightly better value for 119873
119891
and119873119892to get 2119899+119898 times smaller bound for 119860
119891119892 Namely in
Corollary 7 we estimate |119888119894| not by 2119899119891(119909) but by 2119899minus1119891(119909)
(see (19) and Remark 8) This makes the bound 119860119891119892
informula (32) 2119899+119898 times lower since 119873
119891and 119873
119892appear 119898
and 119899 times respectively
7 An Algorithm to CheckCoprime Polynomials
The first application of the bounds found in previous sec-tion is an algorithm checking if the given polynomials119891(119909) 119892(119909) isin Z[119909] are coprime Present the polynomials as119891(119909) = cont(119891(119909)) sdot pp(119891(119909)) and 119892(119909) = cont(119892(119909)) sdotpp(119892(119909)) If 119903 = gcd(cont(119891(119909)) cont(119892(119909))) asymp 1 then119891(119909) 119892(119909) are not coprime and we do not have to check theprimitive parts at all
If 119903 asymp 1 then switch to the polynomials 119891(119909) = pp(119891(119909))and 119892(119909) = pp(119892(119909)) By Corollary 21 the number of distinctprime divisors of res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than orequal to 119896 where 119896 is the largest number for which 119901
119896 le
119860119891119892Consider any 119896 + 1 primes 119901
1 119901
119896+1 each not dividing
119908 = gcd(1198860 1198870) where 119886
0= lc(119891(119909)) and 119887
0= lc(119892(119909))
If gcd(119891119901119894
(119909) 119892119901119894
(119909)) = 1 for at least one 119901119894 then 119891(119909) and
119892(119909) are coprime because 0 = deg gcd(119891119901119894
(119909) 119892119901119894
(119909)) ge
deg gcd(119891(119909) 119892(119909)) and 119903 asymp 1And if gcd(119891
119901119894
(119909) 119892119901119894
(119909)) = 1 for all 119894 = 1 119896 + 1 then119891119901119894
(119909) and 119892119901119894
(119909) are not coprime for at least one 119901119894 which is
not dividing res(119891(119909)119889(119909) 119892(119909)119889(119909))Thismeans that119891(119909)and 119892(119909) are not coprime We got Algorithm 3
Two important advantages of this algorithm are that herewe use much smaller primes 119901 (we just require 119901 ∤ 119908 not119901 gt 2 sdot 119873
119891119892) and in Algorithm 3 unlike in Algorithm 2
we never need to find 119905 to compute the preimage 119896(119909) of 119905 sdotgcd(119891
119901(119909) 119892119901(119909)) and the primitive part pp(119896(119909))
Remark 24 As is mentioned by Knuth in [2] in a probabilis-tic sense the polynomials aremuchmore likely to be coprimethan the integer numbers So it is reasonable to first test byAlgorithm 3 if the given polynomials 119891(119909) 119892(119909) are coprimeand only after that apply Algorithm 2 to find their gcd incase if they are not coprime See also Algorithm 5 where wecombine both of these approaches with a better bound forprime 119901
Example 25 Apply Algorithm 3 to polynomials (1) fromKnuthrsquos example As we saw in Example 22 119896 = 30 For 119901 = 2we get119891
2(119909) = 119909
8+1199096+1199094+1199093+1 1198922(119909) = 119909
6+1199094+119909+1 which
are not coprime since gcd(1198912(119909) 1198922(119909)) = 119909
2+ 119909 + 1 = 1
And for 119901 = 3 we get 1198913(119909) = 119909
8+ 1199096+ 21199092+ 2119909 + 1
1198923(119909) = 2119909
4+21199092 which are coprime So gcd(119891(119909) 119892(119909)) = 1
Example 26 If119891(119909) = 1199092+2119909+1 and119892(119909) = 119909+1Then119873
119891=
2radic6119873119892= radic2 and119860
119891119892lt 39 Since 2 sdot 3 sdot 5 sdot 7 = 210 gt 39 we
get that 119896 = 3 and gcd(119891(119909) 119892(119909)) = 1 if gcd(119891119901(119909) 119892119901(119909)) =
1 for any four primes (not dividing119908) It is easy to check thatgcd(119891
119901(119909) 119892119901(119909)) = 1 for 119901 = 2 3 5 7
8 Other Modifications of Algorithms
The bounds mentioned in Section 6 can be applied to obtainmodifications of Algorithm 2 Let us outline four ideas ofwhich only the last two will be written down as algorithms
For the nonzero polynomials 119891(119909) 119892(119909) isin Z[119909] let usagain start by computing 119903 = gcd(cont(119891(119909)) cont(119892(119909)))
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
12 International Journal of Mathematics and Mathematical Sciences
and switching to the primitive parts 119891(119909) = pp(119891(119909)) and119892(119909) = pp(119892(119909)) assuming that their leading coefficients1198860and 119887
0are positive Calculate 119873
119891 119873119892by Corollary 7
119873119891119892
by Corollary 9 and 119860119891119892
by (32) Find the maximal119896 for which 119901
119896 le 119860
119891119892 Then take any 119896 + 1 primes
1199011 119901
119896+1 each greater than 2 sdot119873
119891119892 We do not know 119889(119909)
but we are aware that the number of prime divisors of 119877 =
res(119891(119909)119889(119909) 119892(119909)119889(119909)) is less than or equal to 119896 So at leastone of the primes 119901
1 119901
119896+1is not dividing 119877 To find it
compute the degrees of 119890119901119894
(119909) for all 119894 = 1 119896 + 1 Take any119901119894 for which deg 119890
119901119894
(119909) is the minimal (in case there is morethan one 119901
119894with this property take one of them preferably
the smallest of all)By our construction deg 119890
119901119894
(119909) = deg gcd(119891(119909) 119892(119909))holds So we can proceed to the next steps choose 119905 such thatlc(119905 sdot 119890
119901119894
(119909)) = 119908 = gcd(1198860 1198870) then find by Algorithm 1 the
preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) then proceed to its primitive part119889(119909) = pp(119896(119909)) and then output the final answer as 119903 sdot 119889(119909)
The advantage of this approach is thatwe donot have to govia steps (14)ndash(18) of Algorithm 2 for more than one prime119901 Also we do not have to take care of the variable 119863 Butthe disadvantage is that we have to compute 119890
119901119894
(119909) for largeprimes for 119896 + 1 times (whereas in Algorithm 2 the correctanswer could be discovered after consideration of fewerprimes) Clearly the disadvantage is a serious obstacle sincerepetitions for 119896 + 1 large primes consume more labour thansteps (14)ndash(18) of Algorithm 2 So this is just a theoreticalidea not an approach for an effective algorithm
The disadvantage can be reduced in the following way inprevious arguments after we find 119901
119896 and 119896 select the prime
numbers 1199011 119901
119896+1each satisfying the condition 119901
119894∤ 119908
This is a much weaker condition than the condition 119901119894gt
2 sdot 119873119891119892
used above so we will surely get smaller primesTake 119872 to be the minimum of all degrees deg 119890
119901119894
(119909) forall 119894 = 1 119896 + 1 Since none of the primes 119901
1 119901
119896+1
divides 119908 for any 119894 = 1 119896 + 1 we have deg 119890119901119894
(119909) ge
deg gcd(119891(119909) 119892(119909)) On the other hand since at least one ofthe primes 119901
1 119901
119896+1does not divide 119877 we know that for
that 119901119894 the degree of 119890
119901119894
(119909) is equal to deg gcd(119891(119909) 119892(119909))Combining these we get that deg gcd(119891(119909) 119892(119909)) = 119872Since we know 119872 we can take a prime 119901 gt 2 sdot 119873
119891119892and
compute 119890119901(119909) and check its degree if deg 119890
119901(119909) = 119872 then
we have a wrong 119901 (we no longer need go to steps (14)ndash(18)of Algorithm 2 to discover that)Then choose a new value for119901 and repeat the step And if deg 119890
119901(119909) = 119872 then we have
the right 119901 We calculate 119905 the preimage 119896(119909) of 119905 sdot 119890119901119894
(119909) andthen 119889(119909) = pp(119896(119909)) and output the answer 119903 sdot 119889(119909) (seeAlgorithm 5 for a better version of this idea)
The third modification not depending on 119860119891119892 can be
constructed by estimating deg gcd(119891(119909) 119892(119909)) = deg 119889(119909) bymeans of an auxiliary prime number 119902 By Landau-MignotteTheorem 6 if ℎ(119909) = 119888
0119909119896+ sdot sdot sdot + 119888
119896is any divisor of the
polynomials119891(119909) = 1198860119909119899+sdot sdot sdot+119886
119899and 119892(119909) = 119887
0119909119898+sdot sdot sdot+119887
119898
then |119888119894| le 2119896|11988801198860|119891(119909) and |119888
119894| le 2119896|11988801198870|119892(119909) Since
|11988801198860| is bounded by |gcd(119886
0 1198870)1198860| and |119888
01198870| is bounded
by |gcd(1198860 1198870)1198870| we get the following analog of (20)
10038161003816100381610038161198881198941003816100381610038161003816 le 2119896sdot gcd (119886
0 1198870) sdotmin
1003817100381710038171003817119891 (119909)1003817100381710038171003817
100381610038161003816100381611988601003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(39)
Now assume 119902 is a prime not dividing 119908 and denote119904(119902 119891 119892) = deg gcd(119891
119902(119909) 119892119902(119909)) ByCorollary 14 deg 119889(119909) le
119904(119902 119891 119892) We get for the coefficients of 119889(119909) the followingbound |119888
119894| le 119872
119902119891119892 where
119872119902119891119892
= 2119904(119902119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(40)
119872119902119891119892
is a better bound for the coefficients of 119889(119909) because2119904(119902119891119892) may be considerably less than 2
min119899119898We can improve Algorithm 2 if we preliminarily find
119904(119902 119891 119892) by calculating gcd(119891119902(119909) 119892119902(119909)) for an ldquoauxiliaryrdquo
prime 119902 ∤ 119908 and then choose the ldquomainrdquo prime 119901 by therule 119901 gt 2 sdot 119872
119902119891119892(instead of 119901 gt 2 sdot 119873
119891119892) Observe that
if 119901 gt 2 sdot 119872119902119891119892
then also 119902 ∤ 119908 = gcd(1198860 1198870) because
min119891(119909)|1198860| 119892(119909)|119887
0| ge 1 Additionally we can intro-
duce the variable 119863 to store the values deg gcd(119891119901(119909) 119892119901(119909))
that we know are greater than deg 119889(119909) We get Algorithm 4
Example 27 Let us applyAlgorithm4 to polynomials (1) fromKnuthrsquos example Since 119908 = 1 take 119902 = 2 We have alreadycomputed in Example 25 that 119890
2(119909) = gcd(119891
2(119909) 1198922(119909)) =
1199092+ 119909 + 1 Then 119904(2 119891 119892) = deg 119890
2(119909) = 2 and
1198722119891119892
= 22sdot 1 sdotmin
radic113
1radic570
3 lt 3184 (41)
Take 119901 = 67 gt 2 sdot 1198722119891119892
It is easy to calculate thatgcd(119891
67(119909) 11989267(119909)) asymp 1 Compare this with Example 16
where we had to use much larger prime 119901 = 1031 Moreoverif we take as an auxiliary 119902 say 119902 = 3 then 119904(3 119891 119892) =
deg 1198903(119909) = 0 and 119872
3119891119892le 1592 So we can take an even
smaller prime 119901 = 37 gt 2 sdot 1198723119891119892
The ideas of Algorithms 3 and 4 can be combined to workwith more than one auxiliary prime 119902 Like we mentioned inRemark 24 Knuth in [2] recommends checking first if thepolynomials 119891(119909) 119892(119909) isin Z[119909] are coprime and proceedingto their gcd calculation only after we get that they arenot coprime (this is motivated by probabilistic arguments)Compute 119860
119891119892by formula (32) and find 119896 like we did in step
(09) ofAlgorithm3 119896 is themaximal number forwhich119901119896 le
119860119891119892 Then choose any 119896 + 1 primes 119902
1 119902
119896+1not dividing
119908 and start computing the modular gcdrsquos 1198901199021
(119909) 1198901199022
(119909)
(119896 + 1 times) If at some step we find deg 119890119902119894
(119909) = 0 then weare done the polynomials 119891(119909) 119892(119909) are coprime if 119903 asymp 1 ortheir gcd is the nontrivial scalar 119903 asymp 1 And if deg 119890
119902119894
(119909) gt 0
for all 119902119894 then we know that
(1) these polynomials are not coprime(2) the positive degree of gcd(119891(119909) 119892(119909)) is theminimum
119904 (119891 119892) = min deg 1198901199021(119909) deg 119890
119902119896+1
(119909) gt 0 (42)
This exact value of 119904(119891 119892) = deg gcd(119891(119909) 119892(119909)) is a betterresult than the estimate 119904(119902 119891 119892) obtained earlier by just one119902
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
International Journal of Mathematics and Mathematical Sciences 13
Like above we can assume 119891(119909) 119892(119909) to be primitive (ifnot we can again denote 119903 = gcd(cont(119891(119909)) cont(119892(119909))) andswitch to the primitive parts 119891(119909) = pp(119891(119909)) and 119892(119909) =
pp(119892(119909))) Applying the Landau-MignotteTheorem 6 for thecoefficients 119888
119894of gcd(119891(119909) 119892(119909)) we get that |119888
119894| le 119872
119891119892
where
119872119891119892
= 2119904(119891119892)
sdot gcd (1198860 1198870)
sdotmin1003817100381710038171003817119891 (119909)
100381710038171003817100381710038161003816100381610038161198860
1003816100381610038161003816
1003817100381710038171003817119892 (119909)1003817100381710038171003817
100381610038161003816100381611988701003816100381610038161003816
(43)
Now we can take 119901 gt 2 sdot 119872119891119892
and by the Euclideanalgorithm calculate 119890
119901(119909) in Z
119901[119909] If deg 119890
119901(119909) gt 119904(119891 119892) we
drop this 119901 and choose another prime 119901 gt 2 sdot 119872119891119892 And if
deg 119890119901(119909) = 119904(119891 119892) then we proceed to the final steps we
choose 119905 then get the preimage 119896(119909) of 119905 sdot 119890119901(119909) then go to the
primitive part 119889(119909) = pp(119896(119909)) and output the final answeras gcd(119891(119909) 119892(119909)) = 119903 sdot pp(119896(119909))
Remark 28 This approach has the following advantagesFirstly the bound on primes 119901 is better than formula (40)since here we have not 2119904(119902119891119892) but 2119904(119891119892) Secondly we nolonger need to calculate the number 119905 the preimage 119896(119909) andthe primitive part 119889(119909) for more than one prime 119901 This isbecause if the selected 119901 gt 2 sdot 119872
119891119892is not appropriate we
already have an indicator of that deg 119890119901(119909) gt 119904(119891 119892)
We built Algorithm 5
Example 29 Let us apply Algorithm 5 again on polynomialsof Knuthrsquos example (1) As we saw in Example 22 119896 = 30 Sowemayhave to consider atmost 31 auxiliary primes 119902
119894 Butwe
in fact need just two of them because deg gcd(1198912(119909) 1198922(119909)) =
deg(1199092 + 119909 + 1) = 2 and deg gcd(1198913(119909) 1198923(119909)) = deg(1) = 0
(see Example 25) So in Algorithm 5 we jump from step (16)
to step (32) directly
Competing Interests
The author declares that there is no conflict of interestsregarding the publication of this paper
Acknowledgments
The author was supported in part by joint grant 15RF-054 ofRFBR and SCS MES RA (in frames of joint research projectsSCS and RFBR) and by 15T-1A258 grant of SCS MES RA
References
[1] V H Mikaelian Algorithmic Algebra Commutative Rings andFields Yerevan University Press Yerevan Armenia OfficiallyApproved by the Ministry of Higher Education and Science ofRA As Textbook for Universities 2015
[2] D Knuth ldquoThe art of computer programmingrdquo in Vol 2Seminumerical Algorithms Addison-Wesley Series in ComputerScience and Information Processing Addison-Wesley 2ndedition 1969
[3] W S Brown ldquoOn Euclidrsquos algorithm and the computation ofpolynomial greatest common divisorsrdquo Journal of the ACM vol18 pp 478ndash504 1971
[4] J von zur Gathen and J Gerhard Modern Computer AlgebraCambridge University Press Cambridge UK 3rd edition 2013
[5] J H Davenport Y Siret and E Tournier Computer AlgebraSystems and Algorithms for Algebraic Computation AcademicPress London UK 2nd edition 1993
[6] E V Pankratev Elements of Computer Algebra Study GuideBinom LZ Moscow Russia 2007
[7] S LangAlgebra RevisedThirdEdition vol 211 ofGraduate Textsin Mathematics Springer New York NY USA 2002
[8] P B Garrett Abstract Algebra Chapman amp HallCRC BocaRaton Fla USA 2008
[9] P M Cohn Introduction to RingTheory Springer London UK2000
[10] A I Kostrikin An Introduction to Algebra vol 2 of MainStructures FizMatLit Moscow Russia 2004 (Russian)
[11] P M Cohn Basic Algebra Groups Rings and Fields SpringerLondon UK 2003
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of
Submit your manuscripts athttpwwwhindawicom
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical Problems in Engineering
Hindawi Publishing Corporationhttpwwwhindawicom
Differential EquationsInternational Journal of
Volume 2014
Applied MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Mathematical PhysicsAdvances in
Complex AnalysisJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
OptimizationJournal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Operations ResearchAdvances in
Journal of
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Function Spaces
Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014
International Journal of Mathematics and Mathematical Sciences
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Algebra
Discrete Dynamics in Nature and Society
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Decision SciencesAdvances in
Discrete MathematicsJournal of
Hindawi Publishing Corporationhttpwwwhindawicom
Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014
Stochastic AnalysisInternational Journal of