Articles

3.3: Multiplicative Order and Applications - Mathematics


In this section we prove two very useful results called Euler’s Theorem and Fermat’s Little Theorem (a special case of Euler’s). We do not follow the proof strategy of Euler and Fermat, however, instead using an approach inspired by abstract algebra and Lagrange’s Theorem in that subject.

First we need the

[def:multorder] Suppose (ninNN) and (ainZ) satisfy (nge2) and (gcd(a,n)=1). Then we define the multiplicative order of (a) in mod (n) (called just the order when the multiplicative and (n) can be understood from context) to be the smallest (kinNN) such that (a^kequiv1pmod{n}). The order of (a) in mod (n) is written (ord_n(a)).

Let us verify something which should probably always be checked for a new definition:

[prop:orderwelldefined] Given relatively prime numbers (ninNN) and (ainZ) with (nge2), (ord_n(a)) is well-defined.

The problem in the definition of (ord_n(a)) might be that there might not be any value of (kinNN) at all for which (a^kequiv1pmod{n}).

But notice that this is a congruence, so we are really only concerned with the elements (a^k) up to their congruence class.

So look at ({[a^p]_nmid pinNN}) and imagine putting the natural numbers (pinNN) into different boxes based on what is the corresponding congruence class ([a^p]inZ/nZ). Since there are infinitely many elements in (NN) and only (n) elements in (Z/nZ) – (n) boxes – by the Pigeonhole Principle (Theorem [thm:pigeonhole]) there must be two (actually, infinitely many pairs of) distinct values (p,qinNN) such that (p) and (q) end up in the same box, meaning ([a^p]=[a^q]). Assume without loss of generality that (p>q), so (p-qinNN).

We are given that (gcd(a,n)=1), so by Corollary [cor:modinv], (a^{-1}) exists in mod (n). Thus [a^{p-q}equiv a^p,(a^{-1})^qequiv a^q,(a^{-1})^qequiv a^0equiv1pmod{n}] (replacing (a^p) with (a^q) in the middle of this congruence since we know that ([a^p]=[a^q]), which means (a^pequiv a^qpmod{n})) and therefore the set of (kinNN) for which (a^kequiv1pmod{n}) is non-empty. The order is the smallest such value, which exists by the Well-Ordering Principle.

Here now is a theorem from abstract algebra (Lagrange’s Theorem) translated into the current context:

[thm:orddividesphi] Given relatively prime numbers (ninNN) and (ainZ), (ord_n(a)midphi(n)).

Start by looking at the congruence classes ([a],[a^2],[a^3]dots). They go up to ([a^{ord_n(a)}]=[1]) and then start to repeat, so the set [left={[a^j]mid jinNN, jleord_n(a)}] is a set of (ord_n(a)) elements of (Z/nZ) (in group theory, this set (left) is called the cyclic subgroup of ((Z/nZ)^*) generated by (a)). Notice that because (a^{ord_n(a)}equiv1pmod{n}), ([1]inleft). Also, since if (a^{-1}) is the inverse of (a) mod (n), ((a^{-1})^k) is the inverse of (a^k) for (kinNN), we see that (leftsubseteq(Z/nZ)^*).

To finish, we shall show that ((Z/nZ)^*) is made up of some number, say (m), of pieces, which we shall call cosets, each of which is bijective with (left). These pieces will thus all have (ord_n(a)) elements, so (mcdotord_n(a)=#left((Z/nZ)^* ight)=phi(n)), from which our desired result follows.

A coset of (left) is a set of the form [xleft={[x]cdot[a^j]=[x,a^j]mid jinNN, jleord_n(a)}] where ([x]in(Z/nZ)^*). We have observed that ([1]inleft), so (forall [x]in(Z/nZ)^*), ([x]in xleft), meaning that every congruence class ([x]in(Z/nZ)^*) is in some coset, i.e., [Z/nZsubseteqigcup_{[x]in(Z/nZ)^*}xleft .]

In fact, each coset (xleft) is bijective with (left). The bijection is the map (f_x:left o xleft) defined by (f_x([a^j])=[x a^j]) for (jinNN) with (jleord_n(a)). This map is a bijection because it has an inverse (f_{x^{-1}}), coming from the inverse mod (n) of (x).

Now suppose (xleft) and (yleft) are two cosets. I claim that either (xleft=yleft) or (xleftigcap yleft=emptyset). For this, suppose (xleftigcap yleft eqemptyset), so (exists [z]in xleftigcap yleft). That means that (exists j,kinNN) such that (jleord_n(a)), (kleord_n(a)), and ([xa^j]=[z]=[ya^k]). In other words, [xa^jequiv ya^kpmod{n} .] Without loss of generality, assume (jle k). Then if we multiply both sides of the above congruence by ((a^{-1})^j), we have (xequiv ya^{k-j}pmod{n}). But this means that every element ([x a^p]in xleft) is can be expressed as ([y a^{p+k-j}]in yleft), and every element ([y a^q]in yleft) is can be expressed as ([x a^{q+j-k}]in xleft). Thus (xleft=yleft).

That was a lot of work, but now we get the famous theorems of Fermat’s Little and of Euler very easily.

[thm:eulers]Euler’s Theorem Say (ainZ) and (ninNN) satisfy (gcd(a,n)=1). Then (a^{phi(n)}equiv1pmod{n}).

The previous theorem, [thm:orddividesphi], told us that (ord_n(a)midphi(n)), so (exists minZ) such that (mcdotord_n(a)=phi(n)). By the definition of order, this means [a^{phi(n)}equiv a^{mord_n(a)}equivleft(a^{ord_n(a)} ight)^mequiv1^mequiv1pmod{n} .]

[cor:FLT]Fermat’s Little Theorem If (p) is a prime and (ainZ) satisfies (gcd(p,a)=1) then (a^{p-1}equiv1pmod{p}).

We have seen that for primes (p), (phi(p)=p-1), so there is very little to do here.

Sometimes one sees Fermat’s Little Theorem in the following, different form:

[thm:altFLT] If (p) is a prime then (forall ainZ), (a^pequiv apmod{p}).

If (gcd(a,p)=1), then by Fermat’s Little, (a^{p-1}equiv1pmod{p}). Multiplying both sides of this congruence by (a) yields the desired result.

If instead (gcd(a,p) eq1), it must be that (gcd(a,p)=p) since that gcd is a divisor of (p), which is prime. The gcd is also a divisor of (a), so in fact (pmid a). But then (a) and all its powers are congruent mod (p) to (0), so (a^pequiv0equiv apmod{p}).

Exercises for §3

What are the remainder when (15!) is divided by (17) and the remainder when (2cdot(26!)) is divided by (29)?

We know (17) is prime (it’s just a wonderful number, isn’t it?). But just to be sure, use Wilson’s Theorem to prove it.

Can we build a test for primality out of Fermat’s Little Theorem? If so, would it be better (more efficient) than one based on Wilson’s Theorem? How would it work? Write a clear, formal statement of your proposed primality test.

If you know a programming language, write some code to try out your primality test. If not (or, in any case, after the programming), do a little research to see if this question has already been investigated and, if so, what was the conclusion. Give either a formal statement of the test and formal result describing its efficacy or a counter-example to your test that you found in the literature.

Suppose (p) is an odd prime. Prove that if the quadratic congruence (x^2+1equiv0pmod{p}) has a solution, then (pequiv1pmod{4}). [Hint: Apply Fermat’s Little Theorem to a solution (a) of the congruence, then multiply and divide by (2) in the power.]


Watch the video: Multiplicative Subgroup of a Field is Cyclic (December 2021).