Skip to main content

Proof: a natural number n is a prime if b^(n−1) = 1 (mod n) for every integer b between 1 and n-1

Prove or disprove: A natural number n ≥ 2 is a prime if bn11(modn) for every integer b between 1 and n − 1.

Proof #

Suppose not. Suppose that there is a natural number n2, which is a not prime but bn11(modn) for all 1bn1.

Because n is not a prime, there must be integers r and s both greater than 1 such that n=rs. Because 1<r<n, it follows that rn11(modn) by our assumption. By the definition of congruence modulo n, there exists k such that rn11=kn. Thus, rn1kn=1 and 1=rn1krs=r(rn2ks). But this is impossible since r>1. Thus, our supposition is false, and any natural number n2 such that bn11(modn) for all 1bn1 is a prime. Q.E.D.

In my failed attempts to prove this statement, I accidentally proved the following two theorems. Since the results are pretty nice, I'll include it here.

Cancellation Law in Modular Arithmetic #

If k, r, and s are integers, n is a prime, and k is not divisible by n and krks(modn), then rs(modn).

Proof: Let k, r, s, and n be integers such that gcd(n,k)=1 and krks(modn). By the definition of congruence modulo n, n(krks) or that nk(rs). By Euclid's lemma (for all integers a, b, and c, if gcd(a,c)=1 and a|bc, then a|b), n(rs) since gcd(n,k)=1. Thus by the definition of congruence modulo n, rs(modn). Q.E.D.

Fermat's Little Theorem #

If a is an integer and b is a prime, then ab11(modb).

Proof: Let a be any integer and b be any prime. Then a ≠ 0 because otherwise gcd(a,b)=b.

Consider a set P=a,2a,3a,(b1)a. Suppose kama(modb) for some integers k and m such that 1 ≤ k < m ≤ b. Since gcd(a,b)=1, latexkm(modb) by the cancellation law. By the definition of congruence modulo b, b|(km). But this is impossible since 0<km<b. Thus, every element in P belongs to a distinct equivalence class defined by congruence modulo b.

Now let us define a function F from P to a Q=1,2,3,(b1) defined as F(p)=p,mod,b. Then F is one-to-one because every element in P belongs to a distinct equivalence class defined by congruence modulo b, and Q is simply a set of the class representatives. Furthermore, F is onto because because F is one-to-one and P and Q have the same cardinality.

Thus, ab1(b1)!ab1i=1b1ii=1b1i(modb) by the commutative law of modular arithmetic. Because b is a prime, gcd(i=1b1i,b)=1. Applying the cancellation law yields: ab11(modb) as desired. Q.E.D.

References #

Fermat's Little Theorem - Wikipedia, the free encyclopedia

% reference discrete_math -l 625-627 %