Metamath Proof Explorer


Theorem modadd2mod

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

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

Proof

Step Hyp Ref Expression
1 recn B B
2 1 3ad2ant2 A B M + B
3 modcl A M + A mod M
4 3 recnd A M + A mod M
5 4 3adant2 A B M + A mod M
6 2 5 addcomd A B M + B + A mod M = A mod M + B
7 6 oveq1d A B M + B + A mod M mod M = A mod M + B mod M
8 modaddmod A B M + A mod M + B mod M = A + B mod M
9 recn A A
10 addcom A B A + B = B + A
11 9 1 10 syl2an A B A + B = B + A
12 11 oveq1d A B A + B mod M = B + A mod M
13 12 3adant3 A B M + A + B mod M = B + A mod M
14 7 8 13 3eqtrd A B M + B + A mod M mod M = B + A mod M