Metamath Proof Explorer


Theorem modmuladdim

Description: Implication of a decomposition of an integer into a multiple of a modulus and a remainder. (Contributed by AV, 14-Jul-2021)

Ref Expression
Assertion modmuladdim A M + A mod M = B k A = k M + B

Proof

Step Hyp Ref Expression
1 zre A A
2 modelico A M + A mod M 0 M
3 1 2 sylan A M + A mod M 0 M
4 3 adantr A M + A mod M = B A mod M 0 M
5 eleq1 A mod M = B A mod M 0 M B 0 M
6 5 adantl A M + A mod M = B A mod M 0 M B 0 M
7 4 6 mpbid A M + A mod M = B B 0 M
8 simpll A M + B 0 M A
9 simpr A M + B 0 M B 0 M
10 simpr A M + M +
11 10 adantr A M + B 0 M M +
12 modmuladd A B 0 M M + A mod M = B k A = k M + B
13 8 9 11 12 syl3anc A M + B 0 M A mod M = B k A = k M + B
14 13 biimpd A M + B 0 M A mod M = B k A = k M + B
15 14 impancom A M + A mod M = B B 0 M k A = k M + B
16 7 15 mpd A M + A mod M = B k A = k M + B
17 16 ex A M + A mod M = B k A = k M + B