Metamath Proof Explorer


Theorem modsubmod

Description: The difference of a real number modulo a positive real number and another real number equals the difference of the two real numbers modulo the positive real number. (Contributed by Alexander van der Vekens, 17-May-2018)

Ref Expression
Assertion modsubmod A B M + A mod M B mod M = A B mod M

Proof

Step Hyp Ref Expression
1 modcl A M + A mod M
2 1 3adant2 A B M + A mod M
3 simp1 A B M + A
4 simp2 A B M + B
5 simp3 A B M + M +
6 modabs2 A M + A mod M mod M = A mod M
7 6 3adant2 A B M + A mod M mod M = A mod M
8 eqidd A B M + B mod M = B mod M
9 2 3 4 4 5 7 8 modsub12d A B M + A mod M B mod M = A B mod M