Congruence

call it modulus (german: Modul)
( for some )
In words: is congruent to modulo if divides the difference of and , i.e. their difference is an integer multiple of .

Examples

(4/2 = 2, 0 remainder)
,

Usage example:

congruence class

residue / congruence class

The congruence class of is an equivalence class.
is the set of all rest classes (factor group).
E.g. for :
→ the set of even numbers.
→ the set of odd numbers.

So basically, is the set of all numbers that are divisible by , and is the set of all numbers that have a remainder of 1 when divided by etc.

Proof:
(division with remainder)


In words: any integer divided by is congruent to the remainder . The rest class is the rest class of .

In words: two rest classes are either identical or have nothing in common (“disjoint”; no element of is in ; = empty set).
Proof:
Assumption: (see the definition of rest class above, then the implication is apparent)
(just rewrite with definition of divisibility)

WLOG: (the underlined things lead to the implication, the boxed thing is a contradiction)

Operations in Let We can translate these two congruences to: → We can add/sub and the congruence stays: → Same for multiplication: ( differs from by a multiple of → definition of congruence)

Some congruences:
, (odd, i.e. in )
(even, i.e. in )

(still odd)
(still even)
Note: , i.e. the congruence is still true.

Here’s why we can do this:

Link to original

From the operation rules earlier:

(one can proove by induction)

(n as a decimal number)



In words: a number is divisible by 3 if the sum of its digits is divisible by 3.
The same works for too.


(we can directly operate on the rest classes)
E.g. , (even + even = even, odd + even = odd)

Operation table (always read row column) for addition:

Operation table for multiplication:

Properties of

commutative, associativity, distributive property hold for the operations in .
There is also a neutral element: for addition, for multiplication.
(; elements are invertible – already present in the operation table, just represented without a minus.)
wrong (not all elements are invertible for multiplication; no division by zero)
Example: Multiplication table for : (see that is not invertible)

In words: is invertible in if and only if and are coprime.
Proof:
(assumption; going left to right)
( and only differ by a multiple of )



E.g. Find



Division and divisibility


Since and are coprime, we can divide by , aka multiply by :

If we have:

We can’t divide by , because the modul contains it, they are not coprime, there is no inverse.
However, if


In words: If there is a common divisor on the left side, the right side, and in the modulo, we can cancel it out / divide by it.


In words: All rest classes with a prime modulus (except for ) have a multiplicative inverse.

ISBN

(since there are no , it’s a concatenation of digits, “multiplikation im Monoid der Strings”)

Prüfziffer (check digit):
( is treated as )

Theorem: Single errors and transpositions of two digits can be detected (but not corrected).

Proof for single errors:
Let’s assume there is some error at position :
,
,
We check whether the sum is congruent modulo for the original and the changed number:

Since all possible are coprime and thus invertible modulo , we can divide by :

Since are less than the modulo, they have to be equal, else the congruence would not hold.

Proof for single transpositions:
(transposition of two digits):
,






(same reason as before)
→ The code can only be correct if the sum is congruent modulo .

Link to original