Contents - Student subdomain for University of Bath
Contents - Student subdomain for University of Bath
Contents - Student subdomain for University of Bath
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
120 CHAPTER 4. MODULAR METHODS<br />
<strong>of</strong> the g.c.d. modulo 3, and modulo 3 B has degree 4, so the gc.d. must have<br />
degree at most 4.<br />
Can this be generalised, in particular can we update our estimate “on the<br />
fly” as upper bounds on the degree <strong>of</strong> the g.c.d change, and is it worth it? In<br />
view <strong>of</strong> the ‘early success’ strategies discussed later, the answer to the last part<br />
is probably negative.<br />
4.1.4 Computing the g.c.d.: several small primes<br />
While algorithm 13 does give us some control on the size <strong>of</strong> the numbers being<br />
considered, we are still <strong>of</strong>ten using numbers larger than those which hindsight<br />
would show to be necessary. For example, in (4.1), (4.2) we could deduce coprimeness<br />
using the prime 5, rather than 1021 from (4.4) or 149 from (4.5). If<br />
instead we consider (x − 1)A and (x − 1)B, the norms change, giving 812.35 in<br />
(4.4) (a prime <strong>of</strong> 1627) and 116.05 in (4.5) (a prime <strong>of</strong> 239). Yet primes such<br />
as 5, 11, 13 etc. will easily show that the result is x − 1. Be<strong>for</strong>e we leap ahead<br />
and use such primes, though, we should reflect that, had we taken (x − 10)A<br />
and (x − 10)B, 5 would have suggested x as the gcd, 11 would have suggested<br />
x + 1, 13 would have suggested x + 3 and so on.<br />
The answer to this comes in observing that the smallest polynomial (in terms<br />
<strong>of</strong> coefficient size) which is congruent to x modulo 5 and to x + 1 modulo 11 is<br />
x−10 (it could be computed by algorithm 40). More generally, we can apply the<br />
Chinese Remainder Theorem (Theorem 35) to enough primes <strong>of</strong> good reduction,<br />
as follows. We assume that find_prime(g) returns a prime not dividing g, a<br />
different one each time. The algorithm is given in Figure 4.3, with a diagram<br />
in Figure 4.4.<br />
Observation 4 The reader may think that Algorithm 14 is faulty: line (*)<br />
in Figure 4.3 iterates until n ≥ 2M, which would be fine if we were actually<br />
computing the g.c.d. But we have <strong>for</strong>ced the leading coefficient to be g, which<br />
may be overkill. Hence aren’t we in danger <strong>of</strong> trying to recover g times the true<br />
g.c.d., whose coefficients may be greater than 2M?<br />
In fact there is not a problem. The pro<strong>of</strong> <strong>of</strong> Corollary 8 relies on estimating<br />
the leading coefficient <strong>of</strong> gcd(A, B) by g, and so the bound is in fact a bound <strong>for</strong><br />
the coefficients after this leading coefficient has been imposed.<br />
Having said that, we can’t “mix and match”. If we decide that Corollary<br />
9 provides a better lower bound than Corollary 8, then we must go <strong>for</strong> “imposed<br />
trailing coefficients” rather than “imposed leading coefficients”, or, more<br />
pragmatically, compute the g.c.d. <strong>of</strong> Â and ˆB, and reverse that.<br />
We should note the heavy reliance on Corollary 10 to detect bad reduction. We<br />
impose g as the leading coefficient throughout, and make the result primitive<br />
at the end as in the large prime variant.