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

Theorem cshwsublen 12728
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 6240 . . . . . 6  |-  ( (
# `  W )  =  0  ->  ( N  -  ( # `  W
) )  =  ( N  -  0 ) )
2 zcn 10828 . . . . . . . 8  |-  ( N  e.  ZZ  ->  N  e.  CC )
32subid1d 9874 . . . . . . 7  |-  ( N  e.  ZZ  ->  ( N  -  0 )  =  N )
43adantl 464 . . . . . 6  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( N  -  0 )  =  N )
51, 4sylan9eq 2461 . . . . 5  |-  ( ( ( # `  W
)  =  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( N  -  ( # `  W
) )  =  N )
65eqcomd 2408 . . . 4  |-  ( ( ( # `  W
)  =  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  N  =  ( N  -  ( # `  W ) ) )
76oveq2d 6248 . . 3  |-  ( ( ( # `  W
)  =  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `
 W ) ) ) )
87ex 432 . 2  |-  ( (
# `  W )  =  0  ->  (
( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `  W
) ) ) ) )
9 zre 10827 . . . . . . . . 9  |-  ( N  e.  ZZ  ->  N  e.  RR )
109adantl 464 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  N  e.  RR )
1110adantl 464 . . . . . . 7  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  N  e.  RR )
12 lencl 12519 . . . . . . . . . 10  |-  ( W  e. Word  V  ->  ( # `
 W )  e. 
NN0 )
13 elnnne0 10768 . . . . . . . . . . . 12  |-  ( (
# `  W )  e.  NN  <->  ( ( # `  W )  e.  NN0  /\  ( # `  W
)  =/=  0 ) )
14 nnrp 11190 . . . . . . . . . . . 12  |-  ( (
# `  W )  e.  NN  ->  ( # `  W
)  e.  RR+ )
1513, 14sylbir 213 . . . . . . . . . . 11  |-  ( ( ( # `  W
)  e.  NN0  /\  ( # `  W )  =/=  0 )  -> 
( # `  W )  e.  RR+ )
1615ex 432 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN0  ->  ( ( # `
 W )  =/=  0  ->  ( # `  W
)  e.  RR+ )
)
1712, 16syl 17 . . . . . . . . 9  |-  ( W  e. Word  V  ->  (
( # `  W )  =/=  0  ->  ( # `
 W )  e.  RR+ ) )
1817adantr 463 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( ( # `  W
)  =/=  0  -> 
( # `  W )  e.  RR+ ) )
1918impcom 428 . . . . . . 7  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( # `
 W )  e.  RR+ )
2011, 19jca 530 . . . . . 6  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( N  e.  RR  /\  ( # `
 W )  e.  RR+ ) )
21 modeqmodmin 12008 . . . . . 6  |-  ( ( N  e.  RR  /\  ( # `  W )  e.  RR+ )  ->  ( N  mod  ( # `  W
) )  =  ( ( N  -  ( # `
 W ) )  mod  ( # `  W
) ) )
2220, 21syl 17 . . . . 5  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( N  mod  ( # `  W
) )  =  ( ( N  -  ( # `
 W ) )  mod  ( # `  W
) ) )
2322oveq2d 6248 . . . 4  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  ( N  mod  ( # `
 W ) ) )  =  ( W cyclShift  ( ( N  -  ( # `  W ) )  mod  ( # `  W ) ) ) )
24 cshwmodn 12727 . . . . 5  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  mod  ( # `  W
) ) ) )
2524adantl 464 . . . 4  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  mod  ( # `
 W ) ) ) )
26 simpl 455 . . . . . . 7  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  W  e. Word  V )
2712nn0zd 10924 . . . . . . . . 9  |-  ( W  e. Word  V  ->  ( # `
 W )  e.  ZZ )
28 zsubcl 10865 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  ( # `  W )  e.  ZZ )  -> 
( N  -  ( # `
 W ) )  e.  ZZ )
2927, 28sylan2 472 . . . . . . . 8  |-  ( ( N  e.  ZZ  /\  W  e. Word  V )  ->  ( N  -  ( # `
 W ) )  e.  ZZ )
3029ancoms 451 . . . . . . 7  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( N  -  ( # `
 W ) )  e.  ZZ )
3126, 30jca 530 . . . . . 6  |-  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W  e. Word  V  /\  ( N  -  ( # `
 W ) )  e.  ZZ ) )
3231adantl 464 . . . . 5  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W  e. Word  V  /\  ( N  -  ( # `  W
) )  e.  ZZ ) )
33 cshwmodn 12727 . . . . 5  |-  ( ( W  e. Word  V  /\  ( N  -  ( # `
 W ) )  e.  ZZ )  -> 
( W cyclShift  ( N  -  ( # `  W ) ) )  =  ( W cyclShift  ( ( N  -  ( # `  W ) )  mod  ( # `  W ) ) ) )
3432, 33syl 17 . . . 4  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  ( N  -  ( # `
 W ) ) )  =  ( W cyclShift  ( ( N  -  ( # `  W ) )  mod  ( # `  W ) ) ) )
3523, 25, 343eqtr4d 2451 . . 3  |-  ( ( ( # `  W
)  =/=  0  /\  ( W  e. Word  V  /\  N  e.  ZZ ) )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `
 W ) ) ) )
3635ex 432 . 2  |-  ( (
# `  W )  =/=  0  ->  ( ( W  e. Word  V  /\  N  e.  ZZ )  ->  ( W cyclShift  N )  =  ( W cyclShift  ( N  -  ( # `  W
) ) ) ) )
378, 36pm2.61ine 2714 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 367    = wceq 1403    e. wcel 1840    =/= wne 2596   ` cfv 5523  (class class class)co 6232   RRcr 9439   0cc0 9440    - cmin 9759   NNcn 10494   NN0cn0 10754   ZZcz 10823   RR+crp 11181    mod cmo 11945   #chash 12357  Word cword 12488   cyclShift ccsh 12720
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1637  ax-4 1650  ax-5 1723  ax-6 1769  ax-7 1812  ax-8 1842  ax-9 1844  ax-10 1859  ax-11 1864  ax-12 1876  ax-13 2024  ax-ext 2378  ax-rep 4504  ax-sep 4514  ax-nul 4522  ax-pow 4569  ax-pr 4627  ax-un 6528  ax-cnex 9496  ax-resscn 9497  ax-1cn 9498  ax-icn 9499  ax-addcl 9500  ax-addrcl 9501  ax-mulcl 9502  ax-mulrcl 9503  ax-mulcom 9504  ax-addass 9505  ax-mulass 9506  ax-distr 9507  ax-i2m1 9508  ax-1ne0 9509  ax-1rid 9510  ax-rnegex 9511  ax-rrecex 9512  ax-cnre 9513  ax-pre-lttri 9514  ax-pre-lttrn 9515  ax-pre-ltadd 9516  ax-pre-mulgt0 9517  ax-pre-sup 9518
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 973  df-3an 974  df-tru 1406  df-ex 1632  df-nf 1636  df-sb 1762  df-eu 2240  df-mo 2241  df-clab 2386  df-cleq 2392  df-clel 2395  df-nfc 2550  df-ne 2598  df-nel 2599  df-ral 2756  df-rex 2757  df-reu 2758  df-rmo 2759  df-rab 2760  df-v 3058  df-sbc 3275  df-csb 3371  df-dif 3414  df-un 3416  df-in 3418  df-ss 3425  df-pss 3427  df-nul 3736  df-if 3883  df-pw 3954  df-sn 3970  df-pr 3972  df-tp 3974  df-op 3976  df-uni 4189  df-int 4225  df-iun 4270  df-br 4393  df-opab 4451  df-mpt 4452  df-tr 4487  df-eprel 4731  df-id 4735  df-po 4741  df-so 4742  df-fr 4779  df-we 4781  df-ord 4822  df-on 4823  df-lim 4824  df-suc 4825  df-xp 4946  df-rel 4947  df-cnv 4948  df-co 4949  df-dm 4950  df-rn 4951  df-res 4952  df-ima 4953  df-iota 5487  df-fun 5525  df-fn 5526  df-f 5527  df-f1 5528  df-fo 5529  df-f1o 5530  df-fv 5531  df-riota 6194  df-ov 6235  df-oprab 6236  df-mpt2 6237  df-om 6637  df-1st 6736  df-2nd 6737  df-recs 6997  df-rdg 7031  df-1o 7085  df-oadd 7089  df-er 7266  df-en 7473  df-dom 7474  df-sdom 7475  df-fin 7476  df-sup 7853  df-card 8270  df-cda 8498  df-pnf 9578  df-mnf 9579  df-xr 9580  df-ltxr 9581  df-le 9582  df-sub 9761  df-neg 9762  df-div 10166  df-nn 10495  df-2 10553  df-n0 10755  df-z 10824  df-uz 11044  df-rp 11182  df-fz 11642  df-fzo 11766  df-fl 11877  df-mod 11946  df-hash 12358  df-word 12496  df-concat 12498  df-substr 12500  df-csh 12721
This theorem is referenced by:  2cshwcshw  12754  cshwcsh2id  12757
  Copyright terms: Public domain W3C validator