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

Theorem cshwsublen 12726
Description: Cyclically shifting a word is invariant regarding subtraction of the word's length. (Contributed by AV, 3-Nov-2018.)
Assertion
Ref Expression
cshwsublen  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `  W
) ) ) )

Proof of Theorem cshwsublen
StepHypRef Expression
1 oveq2 6290 . . . . . 6  |-  ( (
# `  W )  =  0  ->  ( N  -  ( # `  W
) )  =  ( N  -  0 ) )
2 zcn 10865 . . . . . . . 8  |-  ( N  e.  ZZ  ->  N  e.  CC )
32subid1d 9915 . . . . . . 7  |-  ( N  e.  ZZ  ->  ( N  -  0 )  =  N )
43adantl 466 . . . . . 6  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( N  -  0 )  =  N )
51, 4sylan9eq 2528 . . . . 5  |-  ( ( ( # `  W
)  =  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( N  -  ( # `  W
) )  =  N )
65eqcomd 2475 . . . 4  |-  ( ( ( # `  W
)  =  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  N  =  ( N  -  ( # `  W ) ) )
76oveq2d 6298 . . 3  |-  ( ( ( # `  W
)  =  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `
 W ) ) ) )
87ex 434 . 2  |-  ( (
# `  W )  =  0  ->  (
( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `  W
) ) ) ) )
9 zre 10864 . . . . . . . . 9  |-  ( N  e.  ZZ  ->  N  e.  RR )
109adantl 466 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  N  e.  RR )
1110adantl 466 . . . . . . 7  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  N  e.  RR )
12 lencl 12524 . . . . . . . . . 10  |-  ( W  e. Word  V  ->  ( # `
 W )  e. 
NN0 )
13 elnnne0 10805 . . . . . . . . . . . 12  |-  ( (
# `  W )  e.  NN  <->  ( ( # `  W )  e.  NN0  /\  ( # `  W
)  =/=  0 ) )
14 nnrp 11225 . . . . . . . . . . . 12  |-  ( (
# `  W )  e.  NN  ->  ( # `  W
)  e.  RR+ )
1513, 14sylbir 213 . . . . . . . . . . 11  |-  ( ( ( # `  W
)  e.  NN0  /\  ( # `  W )  =/=  0 )  -> 
( # `  W )  e.  RR+ )
1615ex 434 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN0  ->  ( ( # `
 W )  =/=  0  ->  ( # `  W
)  e.  RR+ )
)
1712, 16syl 16 . . . . . . . . 9  |-  ( W  e. Word  V  ->  (
( # `  W )  =/=  0  ->  ( # `
 W )  e.  RR+ ) )
1817adantr 465 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( ( # `  W
)  =/=  0  -> 
( # `  W )  e.  RR+ ) )
1918impcom 430 . . . . . . 7  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( # `
 W )  e.  RR+ )
2011, 19jca 532 . . . . . 6  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( N  e.  RR  /\  ( # `
 W )  e.  RR+ ) )
21 modeqmodmin 12020 . . . . . 6  |-  ( ( N  e.  RR  /\  ( # `  W )  e.  RR+ )  ->  ( N  mod  ( # `  W
) )  =  ( ( N  -  ( # `
 W ) )  mod  ( # `  W
) ) )
2220, 21syl 16 . . . . 5  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( N  mod  ( # `  W
) )  =  ( ( N  -  ( # `
 W ) )  mod  ( # `  W
) ) )
2322oveq2d 6298 . . . 4  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  ( N  mod  ( # `
 W ) ) )  =  ( W cyclShift  ( ( N  -  ( # `  W ) )  mod  ( # `  W ) ) ) )
24 cshwmodn 12725 . . . . 5  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  mod  ( # `  W
) ) ) )
2524adantl 466 . . . 4  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  mod  ( # `
 W ) ) ) )
26 simpl 457 . . . . . . 7  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  W  e. Word  V )
2712nn0zd 10960 . . . . . . . . 9  |-  ( W  e. Word  V  ->  ( # `
 W )  e.  ZZ )
28 zsubcl 10901 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  ( # `  W )  e.  ZZ )  -> 
( N  -  ( # `
 W ) )  e.  ZZ )
2927, 28sylan2 474 . . . . . . . 8  |-  ( ( N  e.  ZZ  /\  W  e. Word  V )  ->  ( N  -  ( # `
 W ) )  e.  ZZ )
3029ancoms 453 . . . . . . 7  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( N  -  ( # `
 W ) )  e.  ZZ )
3126, 30jca 532 . . . . . 6  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W  e. Word  V  /\  ( N  -  ( # `
 W ) )  e.  ZZ ) )
3231adantl 466 . . . . 5  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W  e. Word  V  /\  ( N  -  ( # `  W
) )  e.  ZZ ) )
33 cshwmodn 12725 . . . . 5  |-  ( ( W  e. Word  V  /\  ( N  -  ( # `
 W ) )  e.  ZZ )  -> 
( W cyclShift  ( N  -  ( # `  W ) ) )  =  ( W cyclShift  ( ( N  -  ( # `  W ) )  mod  ( # `  W ) ) ) )
3432, 33syl 16 . . . 4  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  ( N  -  ( # `
 W ) ) )  =  ( W cyclShift  ( ( N  -  ( # `  W ) )  mod  ( # `  W ) ) ) )
3523, 25, 343eqtr4d 2518 . . 3  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `
 W ) ) ) )
3635ex 434 . 2  |-  ( (
# `  W )  =/=  0  ->  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `  W
) ) ) ) )
378, 36pm2.61ine 2780 1  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `  W
) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1379    e. wcel 1767    =/= wne 2662   ` cfv 5586  (class class class)co 6282   RRcr 9487   0cc0 9488    - cmin 9801   NNcn 10532   NN0cn0 10791   ZZcz 10860   RR+crp 11216    mod cmo 11960   #chash 12369  Word cword 12496   cyclShift ccsh 12718
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1601  ax-4 1612  ax-5 1680  ax-6 1719  ax-7 1739  ax-8 1769  ax-9 1771  ax-10 1786  ax-11 1791  ax-12 1803  ax-13 1968  ax-ext 2445  ax-rep 4558  ax-sep 4568  ax-nul 4576  ax-pow 4625  ax-pr 4686  ax-un 6574  ax-cnex 9544  ax-resscn 9545  ax-1cn 9546  ax-icn 9547  ax-addcl 9548  ax-addrcl 9549  ax-mulcl 9550  ax-mulrcl 9551  ax-mulcom 9552  ax-addass 9553  ax-mulass 9554  ax-distr 9555  ax-i2m1 9556  ax-1ne0 9557  ax-1rid 9558  ax-rnegex 9559  ax-rrecex 9560  ax-cnre 9561  ax-pre-lttri 9562  ax-pre-lttrn 9563  ax-pre-ltadd 9564  ax-pre-mulgt0 9565  ax-pre-sup 9566
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1382  df-ex 1597  df-nf 1600  df-sb 1712  df-eu 2279  df-mo 2280  df-clab 2453  df-cleq 2459  df-clel 2462  df-nfc 2617  df-ne 2664  df-nel 2665  df-ral 2819  df-rex 2820  df-reu 2821  df-rmo 2822  df-rab 2823  df-v 3115  df-sbc 3332  df-csb 3436  df-dif 3479  df-un 3481  df-in 3483  df-ss 3490  df-pss 3492  df-nul 3786  df-if 3940  df-pw 4012  df-sn 4028  df-pr 4030  df-tp 4032  df-op 4034  df-uni 4246  df-int 4283  df-iun 4327  df-br 4448  df-opab 4506  df-mpt 4507  df-tr 4541  df-eprel 4791  df-id 4795  df-po 4800  df-so 4801  df-fr 4838  df-we 4840  df-ord 4881  df-on 4882  df-lim 4883  df-suc 4884  df-xp 5005  df-rel 5006  df-cnv 5007  df-co 5008  df-dm 5009  df-rn 5010  df-res 5011  df-ima 5012  df-iota 5549  df-fun 5588  df-fn 5589  df-f 5590  df-f1 5591  df-fo 5592  df-f1o 5593  df-fv 5594  df-riota 6243  df-ov 6285  df-oprab 6286  df-mpt2 6287  df-om 6679  df-1st 6781  df-2nd 6782  df-recs 7039  df-rdg 7073  df-1o 7127  df-oadd 7131  df-er 7308  df-en 7514  df-dom 7515  df-sdom 7516  df-fin 7517  df-sup 7897  df-card 8316  df-pnf 9626  df-mnf 9627  df-xr 9628  df-ltxr 9629  df-le 9630  df-sub 9803  df-neg 9804  df-div 10203  df-nn 10533  df-n0 10792  df-z 10861  df-uz 11079  df-rp 11217  df-fz 11669  df-fzo 11789  df-fl 11893  df-mod 11961  df-hash 12370  df-word 12504  df-concat 12506  df-substr 12508  df-csh 12719
This theorem is referenced by:  2cshwcshw  12752  cshwcsh2id  12755
  Copyright terms: Public domain W3C validator