Two integers are related under congruence if their difference is evenly divisible by a third fixed positive integer.
Definition of congruence
Let , with . is said to be congruent to modulo , denoted mod , if . In this form, is said to be the modulus of the congruence. Conversely, mod denotes that is not congruent to modulo .
Congruence modulo is an equivalence relation on
Let . Since any integer divides , , therefore and mod . That makes congruence reflexive on .
Let . Assume that mod . That’s , or equivalently Distribute the for . This shows that mod \implies mod , so congruence is symmetric.
Let . Assume that mod and that mod . Then and . Therefore, . Congruence mod is hence transitive.
Because congruence mod is reflexive, symmetric, and transitive, it’s an equivalence relation on .
is partitioned into equivalence classes under congruence mod
Denote as the equivalence class containing .
Consider under congruence modulo . We’ll find equivalence classes:
- mod
- mod
- mod
- mod
We can express the equivalence class , for example, as:
- mod
- for some
- for some
Complete residue systems
A set of integers such that every integer is congruent modulo to exactly one integer of the set is said to be a complete residue system mod .
is a complete residue system mod
We’ll first show that every integer is congruent mod to at least one integer in . Let . By the division algorithm, there exist such that , with .
, so , or mod .
Furthermore, , so every integer is congruent mod to at least one in the set. To complete the proof, we need to show that it’s equivalent to at most one.
Let and let . Assume that mod and that mod . Then mod , which implies .
Recall that . This means that . Since , we have that or . So every integer is congruent modulo to at most one integer in .
The set of least nonnegative residues mod
The set is said to be the set of least nonnegative residues mod .
Some arithmetic properties of the congruence relation
Let such that mod and mod . This implies:
: mod : mod
Since mod and mod , we have that and that . This means that , which is equivalent to , implying mod .
For the second part, note that implies . Conversely, implies . So , which is equivalent to , from which mod .
In terms of equivalence classes,
: :
One final note is that the cancellation law of multiplication does not hold in general for congruence modulo . In other words, mod does not imply that mod .
Let . Then mod iff mod .
Assume that mod and let = . We have . Divide both sides by for . We have , so and mod .
For the and only if direction, let and assume mod . Then so . So and mod as desired.