Metamath Proof Explorer


Theorem modmulmodr

Description: The product of an integer and a real number modulo a positive real number equals the product of the integer and the real number modulo the positive real number. (Contributed by Alexander van der Vekens, 9-Jul-2021)

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

Proof

Step Hyp Ref Expression
1 zcn A A
2 1 3ad2ant1 A B M + A
3 simp2 A B M + B
4 simp3 A B M + M +
5 3 4 modcld A B M + B mod M
6 5 recnd A B M + B mod M
7 2 6 mulcomd A B M + A B mod M = B mod M A
8 7 oveq1d A B M + A B mod M mod M = B mod M A mod M
9 modmulmod B A M + B mod M A mod M = B A mod M
10 9 3com12 A B M + B mod M A mod M = B A mod M
11 recn B B
12 1 11 anim12ci A B B A
13 12 3adant3 A B M + B A
14 mulcom B A B A = A B
15 13 14 syl A B M + B A = A B
16 15 oveq1d A B M + B A mod M = A B mod M
17 8 10 16 3eqtrd A B M + A B mod M mod M = A B mod M