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

Theorem cshwidxm1 12562
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 457 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  ->  W  e. Word  V )
2 elfzoelz 11671 . . . 4  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  N  e.  ZZ )
32adantl 466 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  ->  N  e.  ZZ )
4 ubmelm1fzo 11741 . . . 4  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( # `  W )  -  N )  - 
1 )  e.  ( 0..^ ( # `  W
) ) )
54adantl 466 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  N
)  -  1 )  e.  ( 0..^ (
# `  W )
) )
6 cshwidxmod 12559 . . 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 1219 . 2  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( W cyclShift  N ) `
 ( ( (
# `  W )  -  N )  -  1 ) )  =  ( W `  ( ( ( ( ( # `  W )  -  N
)  -  1 )  +  N )  mod  ( # `  W
) ) ) )
8 elfzoel2 11670 . . . . . . . 8  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( # `  W
)  e.  ZZ )
98zcnd 10860 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( # `  W
)  e.  CC )
102zcnd 10860 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  N  e.  CC )
11 ax-1cn 9452 . . . . . . . 8  |-  1  e.  CC
1211a1i 11 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  1  e.  CC )
13 nnpcan 9744 . . . . . . 7  |-  ( ( ( # `  W
)  e.  CC  /\  N  e.  CC  /\  1  e.  CC )  ->  (
( ( ( # `  W )  -  N
)  -  1 )  +  N )  =  ( ( # `  W
)  -  1 ) )
149, 10, 12, 13syl3anc 1219 . . . . . 6  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( ( # `  W
)  -  N )  -  1 )  +  N )  =  ( ( # `  W
)  -  1 ) )
1514oveq1d 6216 . . . . 5  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( ( ( # `  W )  -  N
)  -  1 )  +  N )  mod  ( # `  W
) )  =  ( ( ( # `  W
)  -  1 )  mod  ( # `  W
) ) )
1615adantl 466 . . . 4  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( ( ( # `  W
)  -  N )  -  1 )  +  N )  mod  ( # `
 W ) )  =  ( ( (
# `  W )  -  1 )  mod  ( # `  W
) ) )
17 elfzo0 11705 . . . . . . . 8  |-  ( N  e.  ( 0..^ (
# `  W )
)  <->  ( N  e. 
NN0  /\  ( # `  W
)  e.  NN  /\  N  <  ( # `  W
) ) )
18 nnre 10441 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  NN  ->  ( # `  W
)  e.  RR )
19 peano2rem 9787 . . . . . . . . . . 11  |-  ( (
# `  W )  e.  RR  ->  ( ( # `
 W )  - 
1 )  e.  RR )
2018, 19syl 16 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN  ->  ( ( # `
 W )  - 
1 )  e.  RR )
21 nnrp 11112 . . . . . . . . . 10  |-  ( (
# `  W )  e.  NN  ->  ( # `  W
)  e.  RR+ )
2220, 21jca 532 . . . . . . . . 9  |-  ( (
# `  W )  e.  NN  ->  ( (
( # `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ ) )
23223ad2ant2 1010 . . . . . . . 8  |-  ( ( N  e.  NN0  /\  ( # `  W )  e.  NN  /\  N  <  ( # `  W
) )  ->  (
( ( # `  W
)  -  1 )  e.  RR  /\  ( # `
 W )  e.  RR+ ) )
2417, 23sylbi 195 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( # `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ ) )
25 nnm1ge0 10822 . . . . . . . . 9  |-  ( (
# `  W )  e.  NN  ->  0  <_  ( ( # `  W
)  -  1 ) )
26253ad2ant2 1010 . . . . . . . 8  |-  ( ( N  e.  NN0  /\  ( # `  W )  e.  NN  /\  N  <  ( # `  W
) )  ->  0  <_  ( ( # `  W
)  -  1 ) )
2717, 26sylbi 195 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  0  <_  ( ( # `  W
)  -  1 ) )
28 zre 10762 . . . . . . . . 9  |-  ( (
# `  W )  e.  ZZ  ->  ( # `  W
)  e.  RR )
2928ltm1d 10377 . . . . . . . 8  |-  ( (
# `  W )  e.  ZZ  ->  ( ( # `
 W )  - 
1 )  <  ( # `
 W ) )
308, 29syl 16 . . . . . . 7  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( ( # `
 W )  - 
1 )  <  ( # `
 W ) )
3124, 27, 30jca32 535 . . . . . 6  |-  ( N  e.  ( 0..^ (
# `  W )
)  ->  ( (
( ( # `  W
)  -  1 )  e.  RR  /\  ( # `
 W )  e.  RR+ )  /\  (
0  <_  ( ( # `
 W )  - 
1 )  /\  (
( # `  W )  -  1 )  < 
( # `  W ) ) ) )
3231adantl 466 . . . . 5  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( (
# `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ )  /\  ( 0  <_ 
( ( # `  W
)  -  1 )  /\  ( ( # `  W )  -  1 )  <  ( # `  W ) ) ) )
33 modid 11850 . . . . 5  |-  ( ( ( ( ( # `  W )  -  1 )  e.  RR  /\  ( # `  W )  e.  RR+ )  /\  (
0  <_  ( ( # `
 W )  - 
1 )  /\  (
( # `  W )  -  1 )  < 
( # `  W ) ) )  ->  (
( ( # `  W
)  -  1 )  mod  ( # `  W
) )  =  ( ( # `  W
)  -  1 ) )
3432, 33syl 16 . . . 4  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( # `  W )  -  1 )  mod  ( # `  W ) )  =  ( ( # `  W
)  -  1 ) )
3516, 34eqtrd 2495 . . 3  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( ( ( ( ( # `  W
)  -  N )  -  1 )  +  N )  mod  ( # `
 W ) )  =  ( ( # `  W )  -  1 ) )
3635fveq2d 5804 . 2  |-  ( ( W  e. Word  V  /\  N  e.  ( 0..^ ( # `  W
) ) )  -> 
( W `  (
( ( ( (
# `  W )  -  N )  -  1 )  +  N )  mod  ( # `  W
) ) )  =  ( W `  (
( # `  W )  -  1 ) ) )
377, 36eqtrd 2495 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 369    /\ w3a 965    = wceq 1370    e. wcel 1758   class class class wbr 4401   ` cfv 5527  (class class class)co 6201   CCcc 9392   RRcr 9393   0cc0 9394   1c1 9395    + caddc 9397    < clt 9530    <_ cle 9531    - cmin 9707   NNcn 10434   NN0cn0 10691   ZZcz 10758   RR+crp 11103  ..^cfzo 11666    mod cmo 11826   #chash 12221  Word cword 12340   cyclShift ccsh 12544
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1710  ax-7 1730  ax-8 1760  ax-9 1762  ax-10 1777  ax-11 1782  ax-12 1794  ax-13 1955  ax-ext 2432  ax-rep 4512  ax-sep 4522  ax-nul 4530  ax-pow 4579  ax-pr 4640  ax-un 6483  ax-cnex 9450  ax-resscn 9451  ax-1cn 9452  ax-icn 9453  ax-addcl 9454  ax-addrcl 9455  ax-mulcl 9456  ax-mulrcl 9457  ax-mulcom 9458  ax-addass 9459  ax-mulass 9460  ax-distr 9461  ax-i2m1 9462  ax-1ne0 9463  ax-1rid 9464  ax-rnegex 9465  ax-rrecex 9466  ax-cnre 9467  ax-pre-lttri 9468  ax-pre-lttrn 9469  ax-pre-ltadd 9470  ax-pre-mulgt0 9471  ax-pre-sup 9472
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1703  df-eu 2266  df-mo 2267  df-clab 2440  df-cleq 2446  df-clel 2449  df-nfc 2604  df-ne 2650  df-nel 2651  df-ral 2804  df-rex 2805  df-reu 2806  df-rmo 2807  df-rab 2808  df-v 3080  df-sbc 3295  df-csb 3397  df-dif 3440  df-un 3442  df-in 3444  df-ss 3451  df-pss 3453  df-nul 3747  df-if 3901  df-pw 3971  df-sn 3987  df-pr 3989  df-tp 3991  df-op 3993  df-uni 4201  df-int 4238  df-iun 4282  df-br 4402  df-opab 4460  df-mpt 4461  df-tr 4495  df-eprel 4741  df-id 4745  df-po 4750  df-so 4751  df-fr 4788  df-we 4790  df-ord 4831  df-on 4832  df-lim 4833  df-suc 4834  df-xp 4955  df-rel 4956  df-cnv 4957  df-co 4958  df-dm 4959  df-rn 4960  df-res 4961  df-ima 4962  df-iota 5490  df-fun 5529  df-fn 5530  df-f 5531  df-f1 5532  df-fo 5533  df-f1o 5534  df-fv 5535  df-riota 6162  df-ov 6204  df-oprab 6205  df-mpt2 6206  df-om 6588  df-1st 6688  df-2nd 6689  df-recs 6943  df-rdg 6977  df-1o 7031  df-oadd 7035  df-er 7212  df-en 7422  df-dom 7423  df-sdom 7424  df-fin 7425  df-sup 7803  df-card 8221  df-pnf 9532  df-mnf 9533  df-xr 9534  df-ltxr 9535  df-le 9536  df-sub 9709  df-neg 9710  df-div 10106  df-nn 10435  df-2 10492  df-n0 10692  df-z 10759  df-uz 10974  df-rp 11104  df-fz 11556  df-fzo 11667  df-fl 11760  df-mod 11827  df-hash 12222  df-word 12348  df-concat 12350  df-substr 12352  df-csh 12545
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator