ConceptComplete

Congruences - Core Definitions

The theory of congruences, introduced by Carl Friedrich Gauss in his groundbreaking 1801 work Disquisitiones Arithmeticae, provides a powerful framework for studying divisibility and remainders. Congruence arithmetic forms the foundation of modern cryptography and coding theory.

DefinitionCongruence Modulo n

Let nn be a positive integer. Two integers aa and bb are said to be congruent modulo nn, written: ab(modn)a \equiv b \pmod{n} if n(ab)n \mid (a - b), that is, if ab=kna - b = kn for some integer kk.

The integer nn is called the modulus of the congruence.

The notation ab(modn)a \equiv b \pmod{n} should be read as "aa is congruent to bb modulo nn." This relation captures the idea that aa and bb leave the same remainder when divided by nn.

ExampleBasic Congruences
  • 175(mod12)17 \equiv 5 \pmod{12} because 175=12=12117 - 5 = 12 = 12 \cdot 1
  • 37(mod10)-3 \equiv 7 \pmod{10} because 37=10=10(1)-3 - 7 = -10 = 10 \cdot (-1)
  • 1000(mod25)100 \equiv 0 \pmod{25} because 1000=100=254100 - 0 = 100 = 25 \cdot 4

Note that 1717 and 55 both leave remainder 55 when divided by 1212, and 3-3 and 77 both leave remainder 77 when divided by 1010.

TheoremProperties of Congruence

Congruence modulo nn is an equivalence relation on Z\mathbb{Z}:

  1. Reflexivity: aa(modn)a \equiv a \pmod{n} for all aa
  2. Symmetry: If ab(modn)a \equiv b \pmod{n}, then ba(modn)b \equiv a \pmod{n}
  3. Transitivity: If ab(modn)a \equiv b \pmod{n} and bc(modn)b \equiv c \pmod{n}, then ac(modn)a \equiv c \pmod{n}

Moreover, congruence is compatible with arithmetic operations:

  • If ab(modn)a \equiv b \pmod{n} and cd(modn)c \equiv d \pmod{n}, then a+cb+d(modn)a + c \equiv b + d \pmod{n}
  • If ab(modn)a \equiv b \pmod{n} and cd(modn)c \equiv d \pmod{n}, then acbd(modn)ac \equiv bd \pmod{n}

These properties allow us to perform arithmetic with congruences much like we do with equations, making congruence arithmetic extremely practical for computation.

DefinitionResidue Classes

The equivalence class of an integer aa modulo nn is called the residue class of aa modulo nn: [a]n={a+kn:kZ}[a]_n = \{a + kn : k \in \mathbb{Z}\}

The set of all residue classes modulo nn is denoted Z/nZ\mathbb{Z}/n\mathbb{Z} or Zn\mathbb{Z}_n, and contains exactly nn elements: Z/nZ={[0]n,[1]n,[2]n,,[n1]n}\mathbb{Z}/n\mathbb{Z} = \{[0]_n, [1]_n, [2]_n, \ldots, [n-1]_n\}

A complete system of residues modulo nn is a set containing exactly one representative from each residue class.

ExampleResidue Classes Modulo 5

The residue classes modulo 55 are:

  • [0]5={,10,5,0,5,10,}[0]_5 = \{\ldots, -10, -5, 0, 5, 10, \ldots\}
  • [1]5={,9,4,1,6,11,}[1]_5 = \{\ldots, -9, -4, 1, 6, 11, \ldots\}
  • [2]5={,8,3,2,7,12,}[2]_5 = \{\ldots, -8, -3, 2, 7, 12, \ldots\}
  • [3]5={,7,2,3,8,13,}[3]_5 = \{\ldots, -7, -2, 3, 8, 13, \ldots\}
  • [4]5={,6,1,4,9,14,}[4]_5 = \{\ldots, -6, -1, 4, 9, 14, \ldots\}

The set {0,1,2,3,4}\{0, 1, 2, 3, 4\} is the standard complete system of residues modulo 55, but {2,1,0,1,2}\{-2, -1, 0, 1, 2\} or {1,2,3,4,5}\{1, 2, 3, 4, 5\} would work equally well.

The algebraic structure (Z/nZ,+,)(\mathbb{Z}/n\mathbb{Z}, +, \cdot) forms a commutative ring, which becomes a field precisely when nn is prime.