Metamath Proof Explorer


Theorem modmulnn

Description: Move a positive integer in and out of a floor in the first argument of a modulo operation. (Contributed by NM, 2-Jan-2009)

Ref Expression
Assertion modmulnn N A M N A mod N M N A mod N M

Proof

Step Hyp Ref Expression
1 nnre N N
2 reflcl A A
3 remulcl N A N A
4 1 2 3 syl2an N A N A
5 4 3adant3 N A M N A
6 remulcl N A N A
7 1 6 sylan N A N A
8 reflcl N A N A
9 7 8 syl N A N A
10 9 3adant3 N A M N A
11 nnmulcl N M N M
12 11 nnred N M N M
13 12 3adant2 N A M N M
14 nncn N N
15 nnne0 N N 0
16 14 15 jca N N N 0
17 nncn M M
18 nnne0 M M 0
19 17 18 jca M M M 0
20 mulne0 N N 0 M M 0 N M 0
21 16 19 20 syl2an N M N M 0
22 21 3adant2 N A M N M 0
23 5 13 22 redivcld N A M N A N M
24 reflcl N A N M N A N M
25 23 24 syl N A M N A N M
26 13 25 remulcld N A M N M N A N M
27 nnnn0 N N 0
28 flmulnn0 N 0 A N A N A
29 27 28 sylan N A N A N A
30 29 3adant3 N A M N A N A
31 5 10 26 30 lesub1dd N A M N A N M N A N M N A N M N A N M
32 11 nnrpd N M N M +
33 modval N A N M + N A mod N M = N A N M N A N M
34 5 32 33 3imp3i2an N A M N A mod N M = N A N M N A N M
35 modval N A N M + N A mod N M = N A N M N A N M
36 10 32 35 3imp3i2an N A M N A mod N M = N A N M N A N M
37 7 3adant3 N A M N A
38 fldiv N A N M N A N M = N A N M
39 37 11 38 3imp3i2an N A M N A N M = N A N M
40 fldiv A M A M = A M
41 40 3adant3 A M N A M = A M
42 2 recnd A A
43 divcan5 A M M 0 N N 0 N A N M = A M
44 42 19 16 43 syl3an A M N N A N M = A M
45 44 fveq2d A M N N A N M = A M
46 recn A A
47 divcan5 A M M 0 N N 0 N A N M = A M
48 46 19 16 47 syl3an A M N N A N M = A M
49 48 fveq2d A M N N A N M = A M
50 41 45 49 3eqtr4rd A M N N A N M = N A N M
51 50 3comr N A M N A N M = N A N M
52 39 51 eqtrd N A M N A N M = N A N M
53 52 oveq2d N A M N M N A N M = N M N A N M
54 53 oveq2d N A M N A N M N A N M = N A N M N A N M
55 36 54 eqtrd N A M N A mod N M = N A N M N A N M
56 31 34 55 3brtr4d N A M N A mod N M N A mod N M