Skip to content
The Lumenary
Early undergraduateNumberPlanned

Congruences

Congruence modulo n as an equivalence relation compatible with addition and multiplication; linear congruences, inverses modulo n, the Chinese remainder theorem, and the theorems of Fermat, Euler and Wilson.

math.number.congruences

The lesson for this topic has not been written yet. The outline below is part of the curriculum map and has not been reviewed.

Builds on

Required prerequisites, all the way down: 13

You will learn to

  • Prove that congruence modulo n is an equivalence relation compatible with + and ×.
  • Solve linear congruences ax ≡ b (mod n) and systems of congruences using the Chinese remainder theorem.
  • Prove Fermat's little theorem and Euler's theorem and use them to compute large powers modulo n.

Definition

  • a ≡ b (mod n) means that n divides a − b.
  • Euler's totient φ(n) is the number of integers in {1, …, n} that are coprime to n.
  • An inverse of a modulo n is an integer b with ab ≡ 1 (mod n).

Theorem

  • a has an inverse modulo n if and only if gcd(a, n) = 1.
  • Chinese remainder theorem: if m and n are coprime, the system x ≡ a (mod m), x ≡ b (mod n) has a solution, unique modulo mn.
  • Fermat: if p is prime and p does not divide a, then a^(p−1) ≡ 1 (mod p).
  • Euler: if gcd(a, n) = 1 then a^φ(n) ≡ 1 (mod n).
  • Wilson: (p − 1)! ≡ −1 (mod p) for every prime p.

Common misconceptions

  • Cancelling a factor that is not coprime to n: 2 · 3 ≡ 2 · 9 (mod 12), but 3 ≢ 9 (mod 12).
  • Assuming the converse of Fermat's theorem: the Carmichael number 561 = 3 · 11 · 17 satisfies a^560 ≡ 1 (mod 561) for every a coprime to 561.

Leads to

Optional discoveries

Further reading

  • Kenneth Ireland and Michael Rosen, A Classical Introduction to Modern Number Theory
  • Carl Friedrich Gauss, Disquisitiones Arithmeticae (1801)