TheoremComplete

Congruences - Main Theorem

Fermat's Little Theorem and its generalization, Euler's Theorem, are cornerstones of modern number theory and cryptography. These results describe the behavior of powers in modular arithmetic and form the mathematical foundation of the RSA encryption system.

TheoremFermat's Little Theorem

Let pp be a prime number, and let aa be an integer not divisible by pp. Then: apβˆ’1≑1(modp)a^{p-1} \equiv 1 \pmod{p}

Equivalently, for any integer aa: ap≑a(modp)a^p \equiv a \pmod{p}

Fermat's Little Theorem, first stated by Pierre de Fermat in 1640, provides a simple yet powerful relationship between exponentiation and prime moduli. It has numerous applications, from primality testing to cryptographic protocols.

ExampleFermat's Little Theorem in Action

Let p=7p = 7 and a=2a = 2. Then pβˆ’1=6p - 1 = 6, and: 26=64=9β‹…7+1≑1(mod7)2^6 = 64 = 9 \cdot 7 + 1 \equiv 1 \pmod{7}

For a=3a = 3: 36=729=104β‹…7+1≑1(mod7)3^6 = 729 = 104 \cdot 7 + 1 \equiv 1 \pmod{7}

Using the second form, 27=128=18β‹…7+2≑2(mod7)2^7 = 128 = 18 \cdot 7 + 2 \equiv 2 \pmod{7}.

TheoremEuler's Theorem

Let nn be a positive integer, and let aa be an integer with gcd⁑(a,n)=1\gcd(a, n) = 1. Then: aΟ•(n)≑1(modn)a^{\phi(n)} \equiv 1 \pmod{n} where Ο•(n)\phi(n) is Euler's totient function.

Euler's Theorem generalizes Fermat's Little Theorem to arbitrary moduli. When n=pn = p is prime, we have Ο•(p)=pβˆ’1\phi(p) = p - 1, recovering Fermat's result.

ExampleEuler's Theorem

Consider n=10n = 10. We have Ο•(10)=Ο•(2β‹…5)=Ο•(2)Ο•(5)=1β‹…4=4\phi(10) = \phi(2 \cdot 5) = \phi(2)\phi(5) = 1 \cdot 4 = 4.

For a=3a = 3 (with gcd⁑(3,10)=1\gcd(3, 10) = 1): 34=81=8β‹…10+1≑1(mod10)3^4 = 81 = 8 \cdot 10 + 1 \equiv 1 \pmod{10}

For a=7a = 7: 74=2401=240β‹…10+1≑1(mod10)7^4 = 2401 = 240 \cdot 10 + 1 \equiv 1 \pmod{10}

This explains why the last digit of 7n7^n cycles with period 44: 7,9,3,1,7,9,…7, 9, 3, 1, 7, 9, \ldots

Remark

Euler's Theorem provides the basis for the RSA cryptosystem. In RSA, we choose distinct primes pp and qq, set n=pqn = pq, and use the fact that: aΟ•(n)≑1(modn)a^{\phi(n)} \equiv 1 \pmod{n} to construct encryption and decryption exponents ee and dd satisfying ed≑1(modΟ•(n))ed \equiv 1 \pmod{\phi(n)}. The security relies on the difficulty of factoring nn.

TheoremWilson's Theorem

Let pp be a prime number. Then: (pβˆ’1)!β‰‘βˆ’1(modp)(p-1)! \equiv -1 \pmod{p}

Conversely, if (nβˆ’1)!β‰‘βˆ’1(modn)(n-1)! \equiv -1 \pmod{n} for some integer n>1n > 1, then nn is prime.

Wilson's Theorem provides a characterization of prime numbers, though it is not practical for primality testing due to the computational cost of computing large factorials.

ExampleWilson's Theorem

For p=5p = 5: 4!=24=5β‹…5βˆ’1β‰‘βˆ’1(mod5)4! = 24 = 5 \cdot 5 - 1 \equiv -1 \pmod{5}

For p=7p = 7: 6!=720=103β‹…7βˆ’1β‰‘βˆ’1(mod7)6! = 720 = 103 \cdot 7 - 1 \equiv -1 \pmod{7}

For the composite number n=6n = 6: 5!=120=20β‹…6≑0β‰‘ΜΈβˆ’1(mod6)5! = 120 = 20 \cdot 6 \equiv 0 \not\equiv -1 \pmod{6}

This confirms that 66 is not prime.

These classical theorems illuminate the deep arithmetic structure underlying modular exponentiation and continue to find new applications in modern mathematics and computer science.