Metamath Proof Explorer


Theorem modmul1

Description: Multiplication property of the modulo operation. Note that the multiplier C must be an integer. (Contributed by NM, 12-Nov-2008)

Ref Expression
Assertion modmul1 A B C D + A mod D = B mod D A C mod D = B C mod D

Proof

Step Hyp Ref Expression
1 modval A D + A mod D = A D A D
2 modval B D + B mod D = B D B D
3 1 2 eqeqan12d A D + B D + A mod D = B mod D A D A D = B D B D
4 3 anandirs A B D + A mod D = B mod D A D A D = B D B D
5 4 adantrl A B C D + A mod D = B mod D A D A D = B D B D
6 oveq1 A D A D = B D B D A D A D C = B D B D C
7 5 6 syl6bi A B C D + A mod D = B mod D A D A D C = B D B D C
8 rpcn D + D
9 8 ad2antll A C D + D
10 zcn C C
11 10 ad2antrl A C D + C
12 rerpdivcl A D + A D
13 12 flcld A D + A D
14 13 zcnd A D + A D
15 14 adantrl A C D + A D
16 9 11 15 mulassd A C D + D C A D = D C A D
17 9 11 15 mul32d A C D + D C A D = D A D C
18 16 17 eqtr3d A C D + D C A D = D A D C
19 18 oveq2d A C D + A C D C A D = A C D A D C
20 recn A A
21 20 adantr A C D + A
22 8 adantl A D + D
23 22 14 mulcld A D + D A D
24 23 adantrl A C D + D A D
25 21 24 11 subdird A C D + A D A D C = A C D A D C
26 19 25 eqtr4d A C D + A C D C A D = A D A D C
27 26 adantlr A B C D + A C D C A D = A D A D C
28 8 ad2antll B C D + D
29 10 ad2antrl B C D + C
30 rerpdivcl B D + B D
31 30 flcld B D + B D
32 31 zcnd B D + B D
33 32 adantrl B C D + B D
34 28 29 33 mulassd B C D + D C B D = D C B D
35 28 29 33 mul32d B C D + D C B D = D B D C
36 34 35 eqtr3d B C D + D C B D = D B D C
37 36 oveq2d B C D + B C D C B D = B C D B D C
38 recn B B
39 38 adantr B C D + B
40 8 adantl B D + D
41 40 32 mulcld B D + D B D
42 41 adantrl B C D + D B D
43 39 42 29 subdird B C D + B D B D C = B C D B D C
44 37 43 eqtr4d B C D + B C D C B D = B D B D C
45 44 adantll A B C D + B C D C B D = B D B D C
46 27 45 eqeq12d A B C D + A C D C A D = B C D C B D A D A D C = B D B D C
47 7 46 sylibrd A B C D + A mod D = B mod D A C D C A D = B C D C B D
48 oveq1 A C D C A D = B C D C B D A C D C A D mod D = B C D C B D mod D
49 zre C C
50 remulcl A C A C
51 49 50 sylan2 A C A C
52 51 adantrr A C D + A C
53 simprr A C D + D +
54 simprl A C D + C
55 13 adantrl A C D + A D
56 54 55 zmulcld A C D + C A D
57 modcyc2 A C D + C A D A C D C A D mod D = A C mod D
58 52 53 56 57 syl3anc A C D + A C D C A D mod D = A C mod D
59 58 adantlr A B C D + A C D C A D mod D = A C mod D
60 remulcl B C B C
61 49 60 sylan2 B C B C
62 61 adantrr B C D + B C
63 simprr B C D + D +
64 simprl B C D + C
65 31 adantrl B C D + B D
66 64 65 zmulcld B C D + C B D
67 modcyc2 B C D + C B D B C D C B D mod D = B C mod D
68 62 63 66 67 syl3anc B C D + B C D C B D mod D = B C mod D
69 68 adantll A B C D + B C D C B D mod D = B C mod D
70 59 69 eqeq12d A B C D + A C D C A D mod D = B C D C B D mod D A C mod D = B C mod D
71 48 70 syl5ib A B C D + A C D C A D = B C D C B D A C mod D = B C mod D
72 47 71 syld A B C D + A mod D = B mod D A C mod D = B C mod D
73 72 3impia A B C D + A mod D = B mod D A C mod D = B C mod D