# Fermat’s theorem proof

Consider the sequence $a,\mathrm{\hspace{0.17em}2}a,\mathrm{\dots},(p-1)a$.

They are all different (modulo $p$), because if $ma=na$ with $$ then $0=a(m-n)$, and since $p\nmid a$, we get $p\mid (m-n)$, which is impossible.

Now, since all these numbers are different, the set $\{a,\mathrm{\hspace{0.17em}2}a,\mathrm{\hspace{0.17em}3}a,\mathrm{\dots},(p-1)a\}$ will have the $p-1$ possible congruence classes (although not necessarily in the same order) and therefore

$$a\cdot 2a\cdot 3a\mathrm{\cdots}(p-1)a\equiv (p-1)!{a}^{p-1}\equiv (p-1)!\phantom{\rule{veryverythickmathspace}{0ex}}(modp)$$ |

and using $\mathrm{gcd}((p-1)!,p)=1$ we get

$${a}^{p-1}\equiv 1\phantom{\rule{veryverythickmathspace}{0ex}}(modp).$$ |

Title | Fermat’s theorem proof |
---|---|

Canonical name | FermatsTheoremProof |

Date of creation | 2013-03-22 11:46:10 |

Last modified on | 2013-03-22 11:46:10 |

Owner | drini (3) |

Last modified by | drini (3) |

Numerical id | 11 |

Author | drini (3) |

Entry type | Proof |

Classification | msc 11-00 |

Classification | msc 37B55 |

Related topic | EulerFermatTheorem |

Related topic | FermatsLittleTheorem |

Related topic | ProofOfEulerFermatTheoremUsingLagrangesTheorem |

Related topic | FermatsLittleTheoremProofInductive |