10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

198 Chapter 4 PRIMALITY PROVING<br />

Remark. We may omit the condition F ≥ √ n and use Algorithm 4.2.11 for<br />

the divisor search. The algorithm will remain fast if F ≥ n 1/3 .<br />

Theorem 4.4.6. Algorithm 4.4.5 correctly identifies prime and composite<br />

inputs. The running time is bounded by (ln n) c ln ln ln n for some positive<br />

constant c.<br />

Proof. We first note that a declaration of prime or composite in Step<br />

[Preparation] is certainly correct. That a declaration of composite in Step<br />

[Probable-prime computation] is correct follows from Lemma 4.4.2. If the gcd<br />

calculation in Step [Coprime check] is not 1, it reveals a proper factor of n,<br />

so it is correct to declare n composite. It is obvious that a declaration of<br />

composite is correct in step [Divisor search], so what remains to be shown is<br />

that composite numbers which have survived the prior steps must be factored<br />

in Step [Divisor search] and so declared composite there.<br />

Suppose n is composite with least prime factor r, and suppose n has<br />

survived steps 1–4. We first show that<br />

p w(p) |r p−1 − 1 for each prime p|I. (4.21)<br />

This is clear if w(p) = 1, so assume w(p) ≥ 2. Suppose some l(p, q) = 0.Then<br />

by Lemma 4.4.3<br />

G(p, q) pw(p) up ≡ ζ l(p,q)<br />

p<br />

≡ 1(modn),<br />

sothesameistrue(modr), using Lemma 4.4.3. Let h be the multiplicative<br />

order of G(p, q) modulo r, sothatp w(p)+1 |h. But Lemma 4.4.2 implies that<br />

h|p(r p−1 − 1), so that p w(p) |r p−1 − 1, as claimed. So suppose that each<br />

l(p, q) = 0. Then from the calculation in Step [Coprime check] we have<br />

G(p, q0) pw(p) up ≡ 1(modr), G(p, q0) pw(p)−1 up ≡ ζ j p (mod r)<br />

for all j. Again with h the multiplicative order of G(p, q0) modulo r, wehave<br />

p w(p) |h. Also,G(p, q0) m ≡ ζ j p (mod r) for some integers m, j implies that<br />

ζ j p = 1. Lemma 4.4.2 then implies that G(p, q0) rp−1 −1 ≡ 1(modr) sothat<br />

h|r p−1 − 1andp w(p) |h. This completes the proof of (4.21).<br />

For each prime p|I, (4.21) implies there are integers ap,bp with<br />

r p−1 − 1<br />

p w(p) up<br />

= ap<br />

, bp≡1(modp). (4.22)<br />

bp<br />

Let a be such that a ≡ ap (mod p) for each prime p|I. We now show that<br />

r ≡ l a (mod F ), (4.23)<br />

from which our assertion about Step [Divisor search] follows. Indeed, since<br />

F ≥ √ n ≥ r and F = r, wehaver equal to the least positive residue of l a<br />

(mod F ), so that the proper factor r of n will be discovered in Step [Divisor<br />

search].

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!