MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  modcyc Structured version   Unicode version

Theorem modcyc 11727
Description: The modulo operation is periodic. (Contributed by NM, 10-Nov-2008.)
Assertion
Ref Expression
modcyc  |-  ( ( A  e.  RR  /\  B  e.  RR+  /\  N  e.  ZZ )  ->  (
( A  +  ( N  x.  B ) )  mod  B )  =  ( A  mod  B ) )

Proof of Theorem modcyc
StepHypRef Expression
1 zre 10638 . . . . . . . 8  |-  ( N  e.  ZZ  ->  N  e.  RR )
2 rpre 10985 . . . . . . . 8  |-  ( B  e.  RR+  ->  B  e.  RR )
3 remulcl 9355 . . . . . . . 8  |-  ( ( N  e.  RR  /\  B  e.  RR )  ->  ( N  x.  B
)  e.  RR )
41, 2, 3syl2an 474 . . . . . . 7  |-  ( ( N  e.  ZZ  /\  B  e.  RR+ )  -> 
( N  x.  B
)  e.  RR )
5 readdcl 9353 . . . . . . 7  |-  ( ( A  e.  RR  /\  ( N  x.  B
)  e.  RR )  ->  ( A  +  ( N  x.  B
) )  e.  RR )
64, 5sylan2 471 . . . . . 6  |-  ( ( A  e.  RR  /\  ( N  e.  ZZ  /\  B  e.  RR+ )
)  ->  ( A  +  ( N  x.  B ) )  e.  RR )
763impb 1176 . . . . 5  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( A  +  ( N  x.  B ) )  e.  RR )
8 simp3 983 . . . . 5  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  B  e.  RR+ )
9 modval 11694 . . . . 5  |-  ( ( ( A  +  ( N  x.  B ) )  e.  RR  /\  B  e.  RR+ )  -> 
( ( A  +  ( N  x.  B
) )  mod  B
)  =  ( ( A  +  ( N  x.  B ) )  -  ( B  x.  ( |_ `  ( ( A  +  ( N  x.  B ) )  /  B ) ) ) ) )
107, 8, 9syl2anc 654 . . . 4  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  mod  B )  =  ( ( A  +  ( N  x.  B ) )  -  ( B  x.  ( |_ `  ( ( A  +  ( N  x.  B ) )  /  B ) ) ) ) )
11 recn 9360 . . . . . . . . . . . 12  |-  ( A  e.  RR  ->  A  e.  CC )
12113ad2ant1 1002 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  A  e.  CC )
134recnd 9400 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  B  e.  RR+ )  -> 
( N  x.  B
)  e.  CC )
14133adant1 999 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( N  x.  B )  e.  CC )
15 rpcnne0 10996 . . . . . . . . . . . 12  |-  ( B  e.  RR+  ->  ( B  e.  CC  /\  B  =/=  0 ) )
16153ad2ant3 1004 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( B  e.  CC  /\  B  =/=  0 ) )
17 divdir 10005 . . . . . . . . . . 11  |-  ( ( A  e.  CC  /\  ( N  x.  B
)  e.  CC  /\  ( B  e.  CC  /\  B  =/=  0 ) )  ->  ( ( A  +  ( N  x.  B ) )  /  B )  =  ( ( A  /  B
)  +  ( ( N  x.  B )  /  B ) ) )
1812, 14, 16, 17syl3anc 1211 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  /  B )  =  ( ( A  /  B )  +  ( ( N  x.  B )  /  B
) ) )
19 zcn 10639 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  N  e.  CC )
20 divcan4 10007 . . . . . . . . . . . . . 14  |-  ( ( N  e.  CC  /\  B  e.  CC  /\  B  =/=  0 )  ->  (
( N  x.  B
)  /  B )  =  N )
21203expb 1181 . . . . . . . . . . . . 13  |-  ( ( N  e.  CC  /\  ( B  e.  CC  /\  B  =/=  0 ) )  ->  ( ( N  x.  B )  /  B )  =  N )
2219, 15, 21syl2an 474 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  B  e.  RR+ )  -> 
( ( N  x.  B )  /  B
)  =  N )
23223adant1 999 . . . . . . . . . . 11  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( N  x.  B
)  /  B )  =  N )
2423oveq2d 6096 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  /  B
)  +  ( ( N  x.  B )  /  B ) )  =  ( ( A  /  B )  +  N ) )
2518, 24eqtrd 2465 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  /  B )  =  ( ( A  /  B )  +  N ) )
2625fveq2d 5683 . . . . . . . 8  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( |_ `  ( ( A  +  ( N  x.  B ) )  /  B ) )  =  ( |_ `  (
( A  /  B
)  +  N ) ) )
27 rerpdivcl 11006 . . . . . . . . . 10  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  -> 
( A  /  B
)  e.  RR )
28273adant2 1000 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( A  /  B )  e.  RR )
29 simp2 982 . . . . . . . . 9  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  N  e.  ZZ )
30 fladdz 11654 . . . . . . . . 9  |-  ( ( ( A  /  B
)  e.  RR  /\  N  e.  ZZ )  ->  ( |_ `  (
( A  /  B
)  +  N ) )  =  ( ( |_ `  ( A  /  B ) )  +  N ) )
3128, 29, 30syl2anc 654 . . . . . . . 8  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( |_ `  ( ( A  /  B )  +  N ) )  =  ( ( |_ `  ( A  /  B
) )  +  N
) )
3226, 31eqtrd 2465 . . . . . . 7  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( |_ `  ( ( A  +  ( N  x.  B ) )  /  B ) )  =  ( ( |_ `  ( A  /  B
) )  +  N
) )
3332oveq2d 6096 . . . . . 6  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( B  x.  ( |_ `  ( ( A  +  ( N  x.  B
) )  /  B
) ) )  =  ( B  x.  (
( |_ `  ( A  /  B ) )  +  N ) ) )
34 rpcn 10987 . . . . . . . 8  |-  ( B  e.  RR+  ->  B  e.  CC )
35343ad2ant3 1004 . . . . . . 7  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  B  e.  CC )
36 reflcl 11630 . . . . . . . . . 10  |-  ( ( A  /  B )  e.  RR  ->  ( |_ `  ( A  /  B ) )  e.  RR )
3736recnd 9400 . . . . . . . . 9  |-  ( ( A  /  B )  e.  RR  ->  ( |_ `  ( A  /  B ) )  e.  CC )
3827, 37syl 16 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  -> 
( |_ `  ( A  /  B ) )  e.  CC )
39383adant2 1000 . . . . . . 7  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( |_ `  ( A  /  B ) )  e.  CC )
40193ad2ant2 1003 . . . . . . 7  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  N  e.  CC )
4135, 39, 40adddid 9398 . . . . . 6  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( B  x.  ( ( |_ `  ( A  /  B ) )  +  N ) )  =  ( ( B  x.  ( |_ `  ( A  /  B ) ) )  +  ( B  x.  N ) ) )
42 mulcom 9356 . . . . . . . . . 10  |-  ( ( N  e.  CC  /\  B  e.  CC )  ->  ( N  x.  B
)  =  ( B  x.  N ) )
4319, 34, 42syl2an 474 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  B  e.  RR+ )  -> 
( N  x.  B
)  =  ( B  x.  N ) )
44433adant1 999 . . . . . . . 8  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( N  x.  B )  =  ( B  x.  N ) )
4544eqcomd 2438 . . . . . . 7  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( B  x.  N )  =  ( N  x.  B ) )
4645oveq2d 6096 . . . . . 6  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( B  x.  ( |_ `  ( A  /  B ) ) )  +  ( B  x.  N ) )  =  ( ( B  x.  ( |_ `  ( A  /  B ) ) )  +  ( N  x.  B ) ) )
4733, 41, 463eqtrd 2469 . . . . 5  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( B  x.  ( |_ `  ( ( A  +  ( N  x.  B
) )  /  B
) ) )  =  ( ( B  x.  ( |_ `  ( A  /  B ) ) )  +  ( N  x.  B ) ) )
4847oveq2d 6096 . . . 4  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  -  ( B  x.  ( |_ `  ( ( A  +  ( N  x.  B
) )  /  B
) ) ) )  =  ( ( A  +  ( N  x.  B ) )  -  ( ( B  x.  ( |_ `  ( A  /  B ) ) )  +  ( N  x.  B ) ) ) )
4934adantl 463 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  ->  B  e.  CC )
5049, 38mulcld 9394 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  -> 
( B  x.  ( |_ `  ( A  /  B ) ) )  e.  CC )
51503adant2 1000 . . . . 5  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( B  x.  ( |_ `  ( A  /  B
) ) )  e.  CC )
5212, 51, 14pnpcan2d 9745 . . . 4  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  -  ( ( B  x.  ( |_
`  ( A  /  B ) ) )  +  ( N  x.  B ) ) )  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) ) )
5310, 48, 523eqtrd 2469 . . 3  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  mod  B )  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) ) )
54 modval 11694 . . . 4  |-  ( ( A  e.  RR  /\  B  e.  RR+ )  -> 
( A  mod  B
)  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B ) ) ) ) )
55543adant2 1000 . . 3  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  ( A  mod  B )  =  ( A  -  ( B  x.  ( |_ `  ( A  /  B
) ) ) ) )
5653, 55eqtr4d 2468 . 2  |-  ( ( A  e.  RR  /\  N  e.  ZZ  /\  B  e.  RR+ )  ->  (
( A  +  ( N  x.  B ) )  mod  B )  =  ( A  mod  B ) )
57563com23 1186 1  |-  ( ( A  e.  RR  /\  B  e.  RR+  /\  N  e.  ZZ )  ->  (
( A  +  ( N  x.  B ) )  mod  B )  =  ( A  mod  B ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    /\ w3a 958    = wceq 1362    e. wcel 1755    =/= wne 2596   ` cfv 5406  (class class class)co 6080   CCcc 9268   RRcr 9269   0cc0 9270    + caddc 9273    x. cmul 9275    - cmin 9583    / cdiv 9981   ZZcz 10634   RR+crp 10979   |_cfl 11624    mod cmo 11692
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1594  ax-4 1605  ax-5 1669  ax-6 1707  ax-7 1727  ax-8 1757  ax-9 1759  ax-10 1774  ax-11 1779  ax-12 1791  ax-13 1942  ax-ext 2414  ax-sep 4401  ax-nul 4409  ax-pow 4458  ax-pr 4519  ax-un 6361  ax-cnex 9326  ax-resscn 9327  ax-1cn 9328  ax-icn 9329  ax-addcl 9330  ax-addrcl 9331  ax-mulcl 9332  ax-mulrcl 9333  ax-mulcom 9334  ax-addass 9335  ax-mulass 9336  ax-distr 9337  ax-i2m1 9338  ax-1ne0 9339  ax-1rid 9340  ax-rnegex 9341  ax-rrecex 9342  ax-cnre 9343  ax-pre-lttri 9344  ax-pre-lttrn 9345  ax-pre-ltadd 9346  ax-pre-mulgt0 9347  ax-pre-sup 9348
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 959  df-3an 960  df-tru 1365  df-ex 1590  df-nf 1593  df-sb 1700  df-eu 2258  df-mo 2259  df-clab 2420  df-cleq 2426  df-clel 2429  df-nfc 2558  df-ne 2598  df-nel 2599  df-ral 2710  df-rex 2711  df-reu 2712  df-rmo 2713  df-rab 2714  df-v 2964  df-sbc 3176  df-csb 3277  df-dif 3319  df-un 3321  df-in 3323  df-ss 3330  df-pss 3332  df-nul 3626  df-if 3780  df-pw 3850  df-sn 3866  df-pr 3868  df-tp 3870  df-op 3872  df-uni 4080  df-iun 4161  df-br 4281  df-opab 4339  df-mpt 4340  df-tr 4374  df-eprel 4619  df-id 4623  df-po 4628  df-so 4629  df-fr 4666  df-we 4668  df-ord 4709  df-on 4710  df-lim 4711  df-suc 4712  df-xp 4833  df-rel 4834  df-cnv 4835  df-co 4836  df-dm 4837  df-rn 4838  df-res 4839  df-ima 4840  df-iota 5369  df-fun 5408  df-fn 5409  df-f 5410  df-f1 5411  df-fo 5412  df-f1o 5413  df-fv 5414  df-riota 6039  df-ov 6083  df-oprab 6084  df-mpt2 6085  df-om 6466  df-recs 6818  df-rdg 6852  df-er 7089  df-en 7299  df-dom 7300  df-sdom 7301  df-sup 7679  df-pnf 9408  df-mnf 9409  df-xr 9410  df-ltxr 9411  df-le 9412  df-sub 9585  df-neg 9586  df-div 9982  df-nn 10311  df-n0 10568  df-z 10635  df-uz 10850  df-rp 10980  df-fl 11626  df-mod 11693
This theorem is referenced by:  modcyc2  11728  modxai  14080  wilthlem1  22291  wilthlem2  22292  lgsdir2lem1  22547  lgsdir2lem5  22551  lgseisenlem1  22573
  Copyright terms: Public domain W3C validator