Metamath Proof Explorer


Theorem modabsdifz

Description: Divisibility in terms of modular reduction by the absolute value of the base. (Contributed by Stefan O'Rear, 26-Sep-2014)

Ref Expression
Assertion modabsdifz N M M 0 N N mod M M

Proof

Step Hyp Ref Expression
1 simp1 N M M 0 N
2 simp2 N M M 0 M
3 2 recnd N M M 0 M
4 simp3 N M M 0 M 0
5 3 4 absrpcld N M M 0 M +
6 moddifz N M + N N mod M M
7 1 5 6 syl2anc N M M 0 N N mod M M
8 absidm M M = M
9 3 8 syl N M M 0 M = M
10 9 oveq2d N M M 0 N N mod M M = N N mod M M
11 1 5 modcld N M M 0 N mod M
12 1 11 resubcld N M M 0 N N mod M
13 12 recnd N M M 0 N N mod M
14 3 abscld N M M 0 M
15 14 recnd N M M 0 M
16 5 rpne0d N M M 0 M 0
17 13 15 16 absdivd N M M 0 N N mod M M = N N mod M M
18 13 3 4 absdivd N M M 0 N N mod M M = N N mod M M
19 10 17 18 3eqtr4d N M M 0 N N mod M M = N N mod M M
20 19 eleq1d N M M 0 N N mod M M N N mod M M
21 12 14 16 redivcld N M M 0 N N mod M M
22 absz N N mod M M N N mod M M N N mod M M
23 21 22 syl N M M 0 N N mod M M N N mod M M
24 12 2 4 redivcld N M M 0 N N mod M M
25 absz N N mod M M N N mod M M N N mod M M
26 24 25 syl N M M 0 N N mod M M N N mod M M
27 20 23 26 3bitr4d N M M 0 N N mod M M N N mod M M
28 7 27 mpbid N M M 0 N N mod M M