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 ABMAmodM=BmodMnn M=AB

Proof

Step Hyp Ref Expression
1 moddvds MABAmodM=BmodMMAB
2 1 3coml ABMAmodM=BmodMMAB
3 simp3 ABMM
4 3 nnzd ABMM
5 zsubcl ABAB
6 5 3adant3 ABMAB
7 divides MABMABnn M=AB
8 4 6 7 syl2anc ABMMABnn M=AB
9 2 8 bitrd ABMAmodM=BmodMnn M=AB