Metamath Proof Explorer


Theorem modeqmodmin

Description: A real number equals the difference of the real number and a positive real number modulo the positive real number. (Contributed by AV, 3-Nov-2018)

Ref Expression
Assertion modeqmodmin A M + A mod M = A M mod M

Proof

Step Hyp Ref Expression
1 modid0 M + M mod M = 0
2 1 adantl A M + M mod M = 0
3 modge0 A M + 0 A mod M
4 2 3 eqbrtrd A M + M mod M A mod M
5 simpl A M + A
6 rpre M + M
7 6 adantl A M + M
8 simpr A M + M +
9 modsubdir A M M + M mod M A mod M A M mod M = A mod M M mod M
10 5 7 8 9 syl3anc A M + M mod M A mod M A M mod M = A mod M M mod M
11 4 10 mpbid A M + A M mod M = A mod M M mod M
12 2 eqcomd A M + 0 = M mod M
13 12 oveq2d A M + A mod M 0 = A mod M M mod M
14 modcl A M + A mod M
15 14 recnd A M + A mod M
16 15 subid1d A M + A mod M 0 = A mod M
17 11 13 16 3eqtr2rd A M + A mod M = A M mod M