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

Theorem cshwidxm1 12831
Description: The symbol at index ((n-N)-1) of a word of length n (not 0) cyclically shifted by N positions is the symbol at index (n-1) of the original word. (Contributed by AV, 23-May-2018.) (Revised by AV, 21-May-2018.) (Revised by AV, 30-Oct-2018.)
Assertion
Ref Expression
cshwidxm1  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( W cyclShift  N ) `
 ( ( (
# `  W )  -  N )  -  1 ) )  =  ( W `  ( (
# `  W )  -  1 ) ) )

Proof of Theorem cshwidxm1
StepHypRef Expression
1 simpl 455 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  ->  W  e. Word  V )
2 elfzoelz 11857 . . . 4  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  N  e.  ZZ )
32adantl 464 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  ->  N  e.  ZZ )
4 ubmelm1fzo 11943 . . . 4  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( # `  W )  -  N )  - 
1 )  e.  ( 0..^ ( # `  W
) ) )
54adantl 464 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  N
)  -  1 )  e.  ( 0..^ (
# `  W )
) )
6 cshwidxmod 12828 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ZZ  /\  (
( ( # `  W
)  -  N )  -  1 )  e.  ( 0..^ ( # `  W ) ) )  ->  ( ( W cyclShift  N ) `  (
( ( # `  W
)  -  N )  -  1 ) )  =  ( W `  ( ( ( ( ( # `  W
)  -  N )  -  1 )  +  N )  mod  ( # `
 W ) ) ) )
71, 3, 5, 6syl3anc 1230 . 2  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( W cyclShift  N ) `
 ( ( (
# `  W )  -  N )  -  1 ) )  =  ( W `  ( ( ( ( ( # `  W )  -  N
)  -  1 )  +  N )  mod  ( # `  W
) ) ) )
8 elfzoel2 11856 . . . . . . . 8  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( # `  W
)  e.  ZZ )
98zcnd 11008 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( # `  W
)  e.  CC )
102zcnd 11008 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  N  e.  CC )
11 1cnd 9641 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  1  e.  CC )
12 nnpcan 9877 . . . . . . 7  |-  ( ( ( # `  W
)  e.  CC  /\  N  e.  CC  /\  1  e.  CC )  ->  (
( ( ( # `  W )  -  N
)  -  1 )  +  N )  =  ( ( # `  W
)  -  1 ) )
139, 10, 11, 12syl3anc 1230 . . . . . 6  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( ( # `  W
)  -  N )  -  1 )  +  N )  =  ( ( # `  W
)  -  1 ) )
1413oveq1d 6292 . . . . 5  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( ( ( # `  W )  -  N
)  -  1 )  +  N )  mod  ( # `  W
) )  =  ( ( ( # `  W
)  -  1 )  mod  ( # `  W
) ) )
1514adantl 464 . . . 4  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( ( ( # `  W
)  -  N )  -  1 )  +  N )  mod  ( # `
 W ) )  =  ( ( (
# `  W )  -  1 )  mod  ( # `  W
) ) )
16 elfzo0 11893 . . . . . . . 8  |-  ( N  e.  ( 0..^ (
# `  W )
)  <->  ( N  e. 
NN0  /\  ( # `  W
)  e.  NN  /\  N  <  ( # `  W
) ) )
17 nnre 10582 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  NN  ->  ( # `  W
)  e.  RR )
18 peano2rem 9921 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  RR  ->  ( ( # `
 W )  - 
1 )  e.  RR )
1917, 18syl 17 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN  ->  ( ( # `
 W )  - 
1 )  e.  RR )
20 nnrp 11273 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN  ->  ( # `  W
)  e.  RR+ )
2119, 20jca 530 . . . . . . . . 9  |-  ( (
# `  W )  e.  NN  ->  ( (
( # `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ ) )
22213ad2ant2 1019 . . . . . . . 8  |-  ( ( N  e.  NN0  /\  ( # `  W )  e.  NN  /\  N  <  ( # `  W
) )  ->  (
( ( # `  W
)  -  1 )  e.  RR  /\  ( # `
 W )  e.  RR+ ) )
2316, 22sylbi 195 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( # `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ ) )
24 nnm1ge0 10971 . . . . . . . . 9  |-  ( (
# `  W )  e.  NN  ->  0  <_  ( ( # `  W
)  -  1 ) )
25243ad2ant2 1019 . . . . . . . 8  |-  ( ( N  e.  NN0  /\  ( # `  W )  e.  NN  /\  N  <  ( # `  W
) )  ->  0  <_  ( ( # `  W
)  -  1 ) )
2616, 25sylbi 195 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  0  <_  ( ( # `  W
)  -  1 ) )
27 zre 10908 . . . . . . . . 9  |-  ( (
# `  W )  e.  ZZ  ->  ( # `  W
)  e.  RR )
2827ltm1d 10517 . . . . . . . 8  |-  ( (
# `  W )  e.  ZZ  ->  ( ( # `
 W )  - 
1 )  <  ( # `
 W ) )
298, 28syl 17 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( ( # `
 W )  - 
1 )  <  ( # `
 W ) )
3023, 26, 29jca32 533 . . . . . 6  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( ( # `  W
)  -  1 )  e.  RR  /\  ( # `
 W )  e.  RR+ )  /\  (
0  <_  ( ( # `
 W )  - 
1 )  /\  (
( # `  W )  -  1 )  < 
( # `  W ) ) ) )
3130adantl 464 . . . . 5  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( (
# `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ )  /\  ( 0  <_ 
( ( # `  W
)  -  1 )  /\  ( ( # `  W )  -  1 )  <  ( # `  W ) ) ) )
32 modid 12057 . . . . 5  |-  ( ( ( ( ( # `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ )  /\  (
0  <_  ( ( # `
 W )  - 
1 )  /\  (
( # `  W )  -  1 )  < 
( # `  W ) ) )  ->  (
( ( # `  W
)  -  1 )  mod  ( # `  W
) )  =  ( ( # `  W
)  -  1 ) )
3331, 32syl 17 . . . 4  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  mod  ( # `  W ) )  =  ( ( # `  W
)  -  1 ) )
3415, 33eqtrd 2443 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( ( ( # `  W
)  -  N )  -  1 )  +  N )  mod  ( # `
 W ) )  =  ( ( # `  W )  -  1 ) )
3534fveq2d 5852 . 2  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( W `  (
( ( ( (
# `  W )  -  N )  -  1 )  +  N )  mod  ( # `  W
) ) )  =  ( W `  (
( # `  W )  -  1 ) ) )
367, 35eqtrd 2443 1  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( W cyclShift  N ) `
 ( ( (
# `  W )  -  N )  -  1 ) )  =  ( W `  ( (
# `  W )  -  1 ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 367    /\ w3a 974    = wceq 1405    e. wcel 1842   class class class wbr 4394   ` cfv 5568  (class class class)co 6277   CCcc 9519   RRcr 9520   0cc0 9521   1c1 9522    + caddc 9524    < clt 9657    <_ cle 9658    - cmin 9840   NNcn 10575   NN0cn0 10835   ZZcz 10904   RR+crp 11264  ..^cfzo 11852    mod cmo 12032   #chash 12450  Word cword 12581   cyclShift ccsh 12813
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1639  ax-4 1652  ax-5 1725  ax-6 1771  ax-7 1814  ax-8 1844  ax-9 1846  ax-10 1861  ax-11 1866  ax-12 1878  ax-13 2026  ax-ext 2380  ax-rep 4506  ax-sep 4516  ax-nul 4524  ax-pow 4571  ax-pr 4629  ax-un 6573  ax-cnex 9577  ax-resscn 9578  ax-1cn 9579  ax-icn 9580  ax-addcl 9581  ax-addrcl 9582  ax-mulcl 9583  ax-mulrcl 9584  ax-mulcom 9585  ax-addass 9586  ax-mulass 9587  ax-distr 9588  ax-i2m1 9589  ax-1ne0 9590  ax-1rid 9591  ax-rnegex 9592  ax-rrecex 9593  ax-cnre 9594  ax-pre-lttri 9595  ax-pre-lttrn 9596  ax-pre-ltadd 9597  ax-pre-mulgt0 9598  ax-pre-sup 9599
This theorem depends on definitions:  df-bi 185  df-or 368  df-an 369  df-3or 975  df-3an 976  df-tru 1408  df-ex 1634  df-nf 1638  df-sb 1764  df-eu 2242  df-mo 2243  df-clab 2388  df-cleq 2394  df-clel 2397  df-nfc 2552  df-ne 2600  df-nel 2601  df-ral 2758  df-rex 2759  df-reu 2760  df-rmo 2761  df-rab 2762  df-v 3060  df-sbc 3277  df-csb 3373  df-dif 3416  df-un 3418  df-in 3420  df-ss 3427  df-pss 3429  df-nul 3738  df-if 3885  df-pw 3956  df-sn 3972  df-pr 3974  df-tp 3976  df-op 3978  df-uni 4191  df-int 4227  df-iun 4272  df-br 4395  df-opab 4453  df-mpt 4454  df-tr 4489  df-eprel 4733  df-id 4737  df-po 4743  df-so 4744  df-fr 4781  df-we 4783  df-xp 4828  df-rel 4829  df-cnv 4830  df-co 4831  df-dm 4832  df-rn 4833  df-res 4834  df-ima 4835  df-pred 5366  df-ord 5412  df-on 5413  df-lim 5414  df-suc 5415  df-iota 5532  df-fun 5570  df-fn 5571  df-f 5572  df-f1 5573  df-fo 5574  df-f1o 5575  df-fv 5576  df-riota 6239  df-ov 6280  df-oprab 6281  df-mpt2 6282  df-om 6683  df-1st 6783  df-2nd 6784  df-wrecs 7012  df-recs 7074  df-rdg 7112  df-1o 7166  df-oadd 7170  df-er 7347  df-en 7554  df-dom 7555  df-sdom 7556  df-fin 7557  df-sup 7934  df-card 8351  df-cda 8579  df-pnf 9659  df-mnf 9660  df-xr 9661  df-ltxr 9662  df-le 9663  df-sub 9842  df-neg 9843  df-div 10247  df-nn 10576  df-2 10634  df-n0 10836  df-z 10905  df-uz 11127  df-rp 11265  df-fz 11725  df-fzo 11853  df-fl 11964  df-mod 12033  df-hash 12451  df-word 12589  df-concat 12591  df-substr 12593  df-csh 12814
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator