Eulers Theorem
Eulers Theorem
Eulers theorem is a fundamental result in number theory that generalizes Fermats little theorem. It establishes a relationship between modular exponentiation and the totient function, with profound applications in cryptography and computational number theory.
Named after Leonhard Euler, this theorem is the mathematical foundation underlying the RSA cryptosystem.
The Euler Totient Function
Before stating the theorem, we need the Euler totient function , which counts the positive integers up to that are relatively prime to :
Examples
(only is counted)
(only and are coprime to )
(all of , , , , , are coprime to the prime )
(the numbers , , , are coprime to )
Formula for Totient
For a prime :
For a prime power:
For coprime integers m and n, the totient is multiplicative:
Using the prime factorization, we get the general formula:
Statement of Eulers Theorem
Theorem: If and are positive integers with , then:
In words: if is coprime to , then raised to the power leaves remainder when divided by .
Proof Outline
The proof uses the group of units modulo . Let be the set of integers between and that are coprime to . This forms a group under multiplication modulo , with .
Consider the map on . Since this is a bijection. Therefore:
The left side equals to the times the product of all . Canceling the product from both sides (valid since each is coprime to gives:
Fermats Little Theorem as a Special Case
When is prime, , and Eulers theorem becomes Fermats little theorem:
for
Equivalently, for any integer :
This version holds even when is divisible by .
Applications
Computing Modular Inverses
If , then a has a multiplicative inverse modulo . From Eulers theorem:
So the inverse of a modulo is a to the power . This provides one method for computing modular inverses.
RSA Cryptography
The RSA algorithm uses Euler's theorem directly. Given (product of two large primes), we have . Public and private keys and satisfy:
For any message with , encryption and decryption work because:
Reducing Large Exponents
Eulers theorem allows us to reduce exponents in modular arithmetic. To compute to a large power modulo :
This dramatically simplifies computations with very large exponents.
Carmichael Function
The Carmichael function is the smallest positive integer such that for all coprime to . It divides and often equals it, but can be smaller.
For example, while . The Carmichael function provides the tightest bound for the exponent in modular arithmetic.
Generalizations
Euler's theorem can be generalized in several ways. For any group , the order of any element divides the order of the group. When is the group of units modulo , this gives Euler's theorem.
The theorem also extends to polynomial rings and other algebraic structures, forming part of the broader theory of groups and rings.
Computing the Totient Function
To compute , first find the prime factorization . Then:
For example, phi(12) = phi(4) times phi(3) = 2 times 2 = 4, or equivalently 12 times (1 - 1/2) times (1 - 1/3) = 12 times 1/2 times 2/3 = 4.
Historical Note
Euler published this theorem in 1763, generalizing Fermats little theorem from 1640. The proof demonstrates Eulers mastery of combining algebraic and number-theoretic ideas.
The theorem remains central to computational number theory and is one of the most practically important results in mathematics, securing trillions of dollars in electronic transactions through its role in RSA encryption.