Metamath Proof Explorer


Theorem congr

Description: Definition of congruence by integer multiple (see ProofWiki "Congruence (Number Theory)", 11-Jul-2021, https://proofwiki.org/wiki/Definition:Congruence_(Number_Theory) ): An integer A is congruent to an integer B modulo M if their difference is a multiple of M . See also the definition in ApostolNT p. 104: "... a is congruent to b modulo m , and we write a == b (mod m ) if m divides the difference a - b ", or Wikipedia "Modular arithmetic - Congruence", https://en.wikipedia.org/wiki/Modular_arithmetic#Congruence , 11-Jul-2021,: "Given an integer n > 1, called a modulus, two integers are said to be congruent modulo n, if n is a divisor of their difference (i.e., if there is an integer k such that a-b = kn)". (Contributed by AV, 11-Jul-2021)

Ref Expression
Assertion congr A B M A mod M = B mod M n n M = A B

Proof

Step Hyp Ref Expression
1 moddvds M A B A mod M = B mod M M A B
2 1 3coml A B M A mod M = B mod M M A B
3 simp3 A B M M
4 3 nnzd A B M M
5 zsubcl A B A B
6 5 3adant3 A B M A B
7 divides M A B M A B n n M = A B
8 4 6 7 syl2anc A B M M A B n n M = A B
9 2 8 bitrd A B M A mod M = B mod M n n M = A B