Math 2.0

Number theory Proof

Proof of Fermat's little theorem in the form a^p = a

Builds on Fermat's little theoremPrime numberCongruence modulo nDivisibilityCongruence is compatible with multiplication

Proof

We argue by cases on whether pp divides aa.

  1. Let pp be a prime number and let aa be an integer.
  2. Case p∣ap \mid a. Write a=psa = p s with an integer ss. Since p≥2p \ge 2, we have ap−a=ps(ap−1−1)a^p - a = p s (a^{p-1} - 1).
  3. So pp divides ap−aa^p - a, and ap≡a(modp)a^p \equiv a \pmod p by the definition of congruence.
  4. Case p∤ap \nmid a. By Fermat's little theorem, ap−1≡1(modp)a^{p-1} \equiv 1 \pmod p.
  5. Since a≡a(modp)a \equiv a \pmod p, compatibility with multiplication gives ap−1⋅a≡1⋅a(modp)a^{p-1} \cdot a \equiv 1 \cdot a \pmod p, that is, ap≡a(modp)a^p \equiv a \pmod p.
  6. In both cases, ap≡a(modp)a^p \equiv a \pmod p.

Idea

When pp divides aa, both sides are multiples of pp. Otherwise, multiply Fermat's congruence ap−1≡1a^{p-1} \equiv 1 by aa.

Reading path

To understand this page from the ground up, read these 33 pages in order. The foundations come first. The path takes the proofs Proof of Bézout's identity, Proof of the generalized Euclid's lemma, Proof of the commutativity of addition by induction, Proof of Fermat's little theorem by rearrangement, Proof of Euclid's lemma, Proof of strong induction from ordinary induction, Proof that congruence is compatible with multiplication, Proof of the well-ordering principle from strong induction, Proof of the division algorithm.

Show the path as a graph
Definition by recursion, concept, no evidence levelDefinition by recursi…conceptDivisibility, definition, no evidence levelDivisibilitydefinitionMathematical induction, concept, no evidence levelMathematical inductionconceptNatural numbers, object, no evidence levelNatural numbersobjectPeano axioms, concept, no evidence levelPeano axiomsconceptCongruence modulo n, definition, no evidence levelCongruence modulo ndefinitionGreatest common divisor, definition, no evidence levelGreatest common divis…definitionPrime number, definition, no evidence levelPrime numberdefinitionSuccessor function, definition, no evidence levelSuccessor functiondefinitionProof that congruence is compatible with multiplication, proof, no evidence levelProof that congruence…proofCoprime integers, definition, no evidence levelCoprime integersdefinitionAddition of natural numbers, definition, no evidence levelAddition of natural n…definitionThe successor function is injective, statement, no evidence levelThe successor functio…statementZero is not a successor, statement, no evidence levelZero is not a success…statementCongruence is compatible with multiplication, statement, no evidence levelCongruence is compati…statementProof of the commutativity of addition by induction, proof, no evidence levelProof of the commutat…proofOrder on the natural numbers, definition, no evidence levelOrder on the natural …definitionCommutativity of addition, statement, no evidence levelCommutativity of addi…statementProof of strong induction from ordinary induction, proof, no evidence levelProof of strong induc…proofStrong induction, statement, no evidence levelStrong inductionstatementProof of the well-ordering principle from strong induction, proof, no evidence levelProof of the well-ord…proofWell-ordering principle, statement, no evidence levelWell-ordering princip…statementProof of the division algorithm, proof, no evidence levelProof of the division…proofDivision algorithm, statement, no evidence levelDivision algorithmstatementProof of Bézout's identity, proof, no evidence levelProof of Bézout's ide…proofBézout's identity, statement, no evidence levelBézout's identitystatementProof of the generalized Euclid's lemma, proof, no evidence levelProof of the generali…proofGeneralized Euclid's lemma, statement, no evidence levelGeneralized Euclid's …statementProof of Euclid's lemma, proof, no evidence levelProof of Euclid's lem…proofEuclid's lemma, statement, no evidence levelEuclid's lemmastatementProof of Fermat's little theorem by rearrangement, proof, no evidence levelProof of Fermat's lit…proofFermat's little theorem, statement, no evidence levelFermat's little theor…statementProof of Fermat's little theorem in the form a^p = a, proof, no evidence levelProof of Fermat's lit…proof
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Definition by recursion concept
  2. Divisibility definition
  3. Mathematical induction concept
  4. Natural numbers object
  5. Peano axioms concept
  6. Congruence modulo n definition
  7. Greatest common divisor definition
  8. Prime number definition
  9. Successor function definition
  10. Proof that congruence is compatible with multiplication proof
  11. Coprime integers definition
  12. Addition of natural numbers definition
  13. The successor function is injective statement
  14. Zero is not a successor statement
  15. Congruence is compatible with multiplication statement
  16. Proof of the commutativity of addition by induction proof
  17. Order on the natural numbers definition
  18. Commutativity of addition statement
  19. Proof of strong induction from ordinary induction proof
  20. Strong induction statement
  21. Proof of the well-ordering principle from strong induction proof
  22. Well-ordering principle statement
  23. Proof of the division algorithm proof
  24. Division algorithm statement
  25. Proof of Bézout's identity proof
  26. Bézout's identity statement
  27. Proof of the generalized Euclid's lemma proof
  28. Generalized Euclid's lemma statement
  29. Proof of Euclid's lemma proof
  30. Euclid's lemma statement
  31. Proof of Fermat's little theorem by rearrangement proof
  32. Fermat's little theorem statement
  33. Proof of Fermat's little theorem in the form a^p = a proof

Where this leads

8 pages build on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Fermat%27s_little_theorem, lead section
About this page
TagETNHNE0358
URIm2://ETNHNE0358
Kindproof
WritingW0 stub
MSC11A07
ProvesFermat's little theorem in the form a^p = a
UsesFermat's little theorem, Prime number, Congruence modulo n, Divisibility, Congruence is compatible with multiplication
MethodsProof by cases
Changed4 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.