Metamath Proof Explorer


Theorem moddi

Description: Distribute multiplication over a modulo operation. (Contributed by NM, 11-Nov-2008)

Ref Expression
Assertion moddi A + B C + A B mod C = A B mod A C

Proof

Step Hyp Ref Expression
1 rpcn A + A
2 1 3ad2ant1 A + B C + A
3 recn B B
4 3 3ad2ant2 A + B C + B
5 rpre C + C
6 5 adantl B C + C
7 refldivcl B C + B C
8 6 7 remulcld B C + C B C
9 8 recnd B C + C B C
10 9 3adant1 A + B C + C B C
11 2 4 10 subdid A + B C + A B C B C = A B A C B C
12 rpcnne0 C + C C 0
13 12 3ad2ant3 A + B C + C C 0
14 rpcnne0 A + A A 0
15 14 3ad2ant1 A + B C + A A 0
16 divcan5 B C C 0 A A 0 A B A C = B C
17 4 13 15 16 syl3anc A + B C + A B A C = B C
18 17 fveq2d A + B C + A B A C = B C
19 18 oveq2d A + B C + A C A B A C = A C B C
20 rpcn C + C
21 20 3ad2ant3 A + B C + C
22 rerpdivcl B C + B C
23 reflcl B C B C
24 23 recnd B C B C
25 22 24 syl B C + B C
26 25 3adant1 A + B C + B C
27 2 21 26 mulassd A + B C + A C B C = A C B C
28 19 27 eqtr2d A + B C + A C B C = A C A B A C
29 28 oveq2d A + B C + A B A C B C = A B A C A B A C
30 11 29 eqtrd A + B C + A B C B C = A B A C A B A C
31 modval B C + B mod C = B C B C
32 31 3adant1 A + B C + B mod C = B C B C
33 32 oveq2d A + B C + A B mod C = A B C B C
34 rpre A + A
35 remulcl A B A B
36 34 35 sylan A + B A B
37 36 3adant3 A + B C + A B
38 rpmulcl A + C + A C +
39 modval A B A C + A B mod A C = A B A C A B A C
40 37 38 39 3imp3i2an A + B C + A B mod A C = A B A C A B A C
41 30 33 40 3eqtr4d A + B C + A B mod C = A B mod A C