logo
Published on

Euler's Theroem

Authors

This is a continuation of the previous blog about Euler's Totient Function, let's discuss the Euler's Theorem, yet again, it's definition and proof.

Definition

Let nn and aa be a positive integers such that they are relatively prime, i.e. gcd(a,n)=1\mathrm{gcd}(a, n) = 1, then:

aϕ(n)1 (mod n)a^{\phi(n)} \equiv 1 \ (\text{mod } n)

Where ϕ(n)\phi(n) is Euler's Totient Function.

Proof

There are famously two known proofs here, a direct argument involving multiplying all the elements together, and the other uses a group theory, we'll only discuss the first proof here.

First of all, we will use the notation (Z/n)(\mathbb{Z}/n)^*, which is the set in the definition of ϕ(n)\phi(n), consisting positive integers n\leq n which are relatively prime to nn, formally:

(Z/n)={xN:1xn,gcd(n,x)=1} (\mathbb{Z}/n)^* = \{x \in \mathbb{N}: 1 \leq x \leq n, \mathrm{gcd}(n, x) = 1\}

So ϕ(n)=(Z/n)\phi(n) = |(\mathbb{Z}/n)^*|.

Consider the elements x1,x2,,xϕ(n)x_1, x_2, \dots, x_{\phi(n)} of (Z/n)(\mathbb{Z}/n)^*.

Claim: for a(Z/n)a \in (\mathbb{Z}/n)^*, multiplication by aa makes it into a permutation of this set, that is the set {ax1,ax2,,axϕ(n)}\{ax_1, ax_2, \dots, ax_{\phi(n)}\} equals to (Z/n)(\mathbb{Z}/n)^*.

The claim is true, because the multiplication by aa is a function from the finite set (Z/n)(\mathbb{Z}/n)^* to itself has an inverse, which is the multiplication by a1 (mod n)a^{-1} \ (\text{mod } n).

For instance, let n=10n=10 then we will have:

(Z/n)={1,3,7,9}(\mathbb{Z}/n)^* = \{1, 3, 7, 9\}

Multiplication by a=3a=3 where a(Z/n)a \in (\mathbb{Z}/n)^* turns it into {3,9,1,7}\{3, 9, 1, 7\} which is permutes the element of the set. Also, multiplication by 7=31 (mod 10)7 = 3^{-1} \ (\text{mod } 10) is the inverse of this permutation.

Now, given the claim, consider the product of all the elements in (Z/n)(\mathbb{Z}/n)^*.

On one hand it is i=1ϕ(n)xi\prod_{i=1}^{\phi(n)} x_i, and on the other hand, it is i=1ϕ(n)(axi)\prod_{i=1}^{\phi(n)} (ax_i), both products are congruent modulo nn.

So we will have:

i=1ϕ(n)xii=1ϕ(n)(axi)i=1ϕ(n)xiaϕ(n)i=1ϕ(n)xi1aϕ(n)\begin{aligned} \prod_{i=1}^{\phi(n)} x_i &\equiv \prod_{i=1}^{\phi(n)} (ax_i) \\ \prod_{i=1}^{\phi(n)} x_i &\equiv a^{\phi(n)} \prod_{i=1}^{\phi(n)} x_i \\ 1 &\equiv a^{\phi(n)} \end{aligned}

where cancellation of the xix_i is allowed because they all have multiplication inverse modulo nn. _{\Box}