Let \(a \in \mathbb{Z}\) be an integer and \(p \in \mathbb{P}\) a prime number.
The fermat's small theorem tells us that:
$$ a^p \equiv a \hspace{0.2em} \bigl[p\bigr] \qquad (Fermat) $$
And only if \( p \nmid a \):
$$ p \nmid a \Longrightarrow a^{p-1} \equiv 1 \hspace{0.2em} \bigl[p\bigr] \qquad \bigl(Fermat \enspace (corollary)\bigr) $$
Let \(a \in \mathbb{Z}\) be an integer and \(p \in \mathbb{P}\) a prime number with \( p \nmid a \).
This demonstration being a bit long, we have splitted it into several steps.
As \(p \) is a prime number and \( p \nmid a \),
We know by the coprimity link between a prime number and an integer that:
So:
Let consider a \(E \) set of \( e_i \) numbers with:
Having \(p \) not dividing any numbers lower thant it, then:
As \(p \) is prime and \(p \nmid e_i \), so still with the coprimity link between a prime number and an integer, \(p \) and \(e_i\) are coprimes.
Thanks to both relations \( (1) \) and \( (2) \), we do have:
$$ \Biggl \{ \begin{align*} a \wedge p = 1 \qquad (1) \\ \forall e_i, \enspace e_i \wedge p = 1 \qquad (2) \end{align*} $$
Now, by the Bézout's theorem corollary, we do know that:
$$ \Biggl \{ \begin{align*} a \wedge n = 1 \\ b \wedge n = 1 \end{align*} \hspace{0.2em} \Longrightarrow \hspace{0.2em} ab \wedge n = 1 $$
Consequently:
We now consider a new set, called \(aE\), of \( a e_i \) numbers which are all coprimes with \( p \).
Let match for each number \( a e_i \), a \( R_i\) remainder of the Euclidian division by \( p \).
And as \(p \nmid ae_i\),
Thanks to the properties of the \( GCD \), we do have:
In our case, it gave us the folloning equivalence:
So,
But, thanks to \( (3)\) :
Therefore, thanks to \( (3)\) and \( (5)\),
The number \( p\) is also coprime with each \( R_i\) remainder.
Well, we have seen above with \( (4)\) that:
So then: \( R_i \in E\).
Let take two distincts elements \( ae_i \) and \( ae_j \) of the \( aE \) set. We do have the following implication:
$$ ae_i \neq ae_j \hspace{0.2em} \Longrightarrow \hspace{0.2em} \Biggl \{ \begin{align*} ae_i \equiv R_i \hspace{0.2em} \bigl[p\bigr] \\ ae_j \equiv R_j \hspace{0.2em} \bigl[p\bigr] \end{align*} $$
Let absurdly assume that \( R_i = R_j\). In this case:
But, as we know thanks to \( (1) \) that:
From The Gauss' theorem, we know that:
With our hypotheses, this would mean that:
Well, as:
$$ \Biggl \{ \begin{align*} 1 \leqslant e_i \leqslant (p-1) \\ 1 \leqslant e_j \leqslant (p-1) \end{align*} \hspace{0.2em} \Longrightarrow \hspace{0.2em} (-p + 2) \leqslant e_i - e_j \leqslant (p-2) $$
And we have seen it with \( (2) \):
Therefore \( p \) does not divide any number on the following interval: \( [\![1, (p-1) ]\!] \), and in fact none of its mirror interval: \( [\![ -(p -1), -1 ]\!] \).
At thsi stage, the only possibility to satisfy \( (6)\) would be:
Which is impossible because it would refute our beginning hypothesis which was that: \( ae_i \neq ae_j\).
As a result, we do have the following conclusion:
Each \(R_i\) remainders are all distincts.
We have seen above that each \( R_i \) remainder as each \( e_i \) elements belonged to the \( E \) set.
$$ \Biggl \{ \begin{align*} e_i \in E\\ R_i \in E \end{align*} \hspace{0.2em} $$
Morover, with \( (7) \) we found out that each distinct \( e_i \) matched a distinct \( R_i \).
This means that it exists a bijection (one-to-one relationship in both directions) between \( e_i\) and \( R_i\) elements.
For each \( e_i \) corresponds a \( R_i \) elements, But not necessarily in the right order.
For example, for the values: \( p = 7, a = 9\) :
Thus a one-to-one correspondance between \(e_i\) and \( R_i\) elements:
Let write again the expression \( (4) \):
So, a such serie of congruences:
We know from the properties of congruences que :
$$ \enspace \Biggl \{ \begin{gather*} a \equiv b \hspace{0.2em} [n] \\ a' \equiv b' \hspace{0.2em} [n] \end{gather*} \hspace{0.2em} \Longrightarrow \hspace{0.2em} a a' \equiv b b' \hspace{0.2em} [n] $$
In our case, performing both \( ae_i \) and \( R_i \) inner elements products:
Having \((p-1)\) distincts elements inside the \(E\) set for \(e_i\), and \((p-1)\) distincts elements inside the same \(E\) set for \(R_i\):
Finally, with \( (8) \) and the properties of congruences, it is clear that \(p / (a^{p-1} - 1)(p-1)! \).
But as \(p \nmid (p-1)! \) (because it does not anu common divisor with any of the \(e_i \) of the \(E \) set), therefore \(p / (a^{p-1} -1) \).
So,
And finally,
$$ p \nmid a \Longrightarrow a^{p-1} \equiv 1 \hspace{0.2em} \bigl[p\bigr] $$
Let \(a \in \mathbb{Z}\) be an integer and \(p \in \mathbb{P}\) a prime number.
Two cases arise:
So, with the Fermat's small theorem, we do have:
But, from the properties of congruences we know that:
$$ \enspace \Biggl \{ \begin{gather*} a \equiv b \hspace{0.2em} [n] \\ a' \equiv b' \hspace{0.2em} [n] \end{gather*} \hspace{0.2em} \Longrightarrow \hspace{0.2em} a a' \equiv b b' \hspace{0.2em} [n] $$
Multiplying both members by \( a \):
In this case,
In any case,
$$ a^p \equiv a \hspace{0.2em} \bigl[p\bigr] $$
Let \(a \in \mathbb{Z}\) be an integer and \(p \in \mathbb{P}\) a prime number.
Let show that the following statement \((P_a)\) is true:
$$ a^p \equiv a \hspace{0.2em} \bigl[p\bigr] \qquad (P_a) $$
Let verify if is true for the first term, that is to say for \( a = 0 \).
\((S_0)\) is true.
Let \( k \in \mathbb{N} \) be a natural number.
Let us assume that \((S_k)\) is true for all \( k \).
We will verify that is also the case for \((S_{k + 1})\).
Let us calculate \( (k+1)^p\).
With the Newton's binomial, we know that:
So,
Well, for all \( p, i \), with \( 1 \leqslant i \leqslant p \) we can apply the binomial's pawn formula :
But, we know by the Gauss' theorem that:
In our case,
If \( p \) divides the \( \binom{p}{i} \) binom, then \( p \) also divides the central member of \( (1) \).
So,
And as our recurrence hypothesis is:
These are all the congruences for the \( (k+1)^p \) calculation:
We then have by addition of the congruences:
Thus, \((S_{k + 1})\) est vraie.
Here, we have to prove it in the contrary direction, to verify if it is still true inside the \( \mathbb{Z}\) set.
In other words, let verify that \((P_{k - 1})\) is true.
Let us calculate \( (k-1)^p \).
\(p\) being a prime number by hypothesis, it will always be odd, and then:
Likewise, if \( p \) divise the \( \binom{p}{i} \) binom, then \( p \) also divides the central member of \( (1') \) :
Even if this central member contains an alternance of positive and negative numbers, its general quotient \( Q \) remains inside the \( \mathbb{Z} \) set.
We will also, like previously:
So these are all the congruences for the \( (k-1)^p \) calculation:
And finally,
\((P_{k - 1})\) est vraie.
The statement \((P_a)\) is true for its fisrt term \(a_0 = 0\) and it's hereditary from terms to terms for all \(k \in \mathbb{Z}\), upwards and downwards.
By the recurrence principle, that statement is true for all \(a \in \mathbb{Z}\).
And finally,
$$ a^p \equiv a \hspace{0.2em} \bigl[p\bigr] $$
We then have the following equivalence:
Now, factorizing by \(a\),
If we add the extra hypothesis that \( p \nmid a \):
We know by the coprimity link between a prime number and an integer that:
So,
Moreover, with Gauss' theorem, we know that:
In our case, \( (2) \) combined with \( (3) \) gives:
And finally,
$$ p \nmid a \Longrightarrow a^{p-1} \equiv 1 \hspace{0.2em} \bigl[p\bigr] $$