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

Theorem cshwcshid 12770
Description: A cyclically shifted word can be reconstructed by cyclically shifting it again. Lemma for erclwwlktr 24606 and erclwwlkntr 24618. (Contributed by AV, 8-Apr-2018.) (Revised by AV, 11-Jun-2018.) (Proof shortened by AV, 3-Nov-2018.)
Hypotheses
Ref Expression
cshwcshid.1  |-  ( ph  ->  y  e. Word  V )
cshwcshid.2  |-  ( ph  ->  ( # `  x
)  =  ( # `  y ) )
Assertion
Ref Expression
cshwcshid  |-  ( ph  ->  ( ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) )  ->  E. n  e.  (
0 ... ( # `  x
) ) y  =  ( x cyclShift  n )
) )
Distinct variable group:    m, n, x, y
Allowed substitution hints:    ph( x, y, m, n)    V( x, y, m, n)

Proof of Theorem cshwcshid
StepHypRef Expression
1 cshwcshid.2 . . . . . . 7  |-  ( ph  ->  ( # `  x
)  =  ( # `  y ) )
2 fznn0sub2 11789 . . . . . . . 8  |-  ( m  e.  ( 0 ... ( # `  y
) )  ->  (
( # `  y )  -  m )  e.  ( 0 ... ( # `
 y ) ) )
3 oveq2 6302 . . . . . . . . 9  |-  ( (
# `  x )  =  ( # `  y
)  ->  ( 0 ... ( # `  x
) )  =  ( 0 ... ( # `  y ) ) )
43eleq2d 2537 . . . . . . . 8  |-  ( (
# `  x )  =  ( # `  y
)  ->  ( (
( # `  y )  -  m )  e.  ( 0 ... ( # `
 x ) )  <-> 
( ( # `  y
)  -  m )  e.  ( 0 ... ( # `  y
) ) ) )
52, 4syl5ibr 221 . . . . . . 7  |-  ( (
# `  x )  =  ( # `  y
)  ->  ( m  e.  ( 0 ... ( # `
 y ) )  ->  ( ( # `  y )  -  m
)  e.  ( 0 ... ( # `  x
) ) ) )
61, 5syl 16 . . . . . 6  |-  ( ph  ->  ( m  e.  ( 0 ... ( # `  y ) )  -> 
( ( # `  y
)  -  m )  e.  ( 0 ... ( # `  x
) ) ) )
76com12 31 . . . . 5  |-  ( m  e.  ( 0 ... ( # `  y
) )  ->  ( ph  ->  ( ( # `  y )  -  m
)  e.  ( 0 ... ( # `  x
) ) ) )
87adantr 465 . . . 4  |-  ( ( m  e.  ( 0 ... ( # `  y
) )  /\  x  =  ( y cyclShift  m
) )  ->  ( ph  ->  ( ( # `  y )  -  m
)  e.  ( 0 ... ( # `  x
) ) ) )
98impcom 430 . . 3  |-  ( (
ph  /\  ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) ) )  ->  ( ( # `  y )  -  m
)  e.  ( 0 ... ( # `  x
) ) )
10 cshwcshid.1 . . . . . . . 8  |-  ( ph  ->  y  e. Word  V )
11 simpl 457 . . . . . . . . 9  |-  ( ( y  e. Word  V  /\  m  e.  ( 0 ... ( # `  y
) ) )  -> 
y  e. Word  V )
12 elfzelz 11698 . . . . . . . . . 10  |-  ( m  e.  ( 0 ... ( # `  y
) )  ->  m  e.  ZZ )
1312adantl 466 . . . . . . . . 9  |-  ( ( y  e. Word  V  /\  m  e.  ( 0 ... ( # `  y
) ) )  ->  m  e.  ZZ )
14 elfz2nn0 11778 . . . . . . . . . . 11  |-  ( m  e.  ( 0 ... ( # `  y
) )  <->  ( m  e.  NN0  /\  ( # `  y )  e.  NN0  /\  m  <_  ( # `  y
) ) )
15 nn0z 10897 . . . . . . . . . . . . 13  |-  ( (
# `  y )  e.  NN0  ->  ( # `  y
)  e.  ZZ )
16 nn0z 10897 . . . . . . . . . . . . 13  |-  ( m  e.  NN0  ->  m  e.  ZZ )
17 zsubcl 10915 . . . . . . . . . . . . 13  |-  ( ( ( # `  y
)  e.  ZZ  /\  m  e.  ZZ )  ->  ( ( # `  y
)  -  m )  e.  ZZ )
1815, 16, 17syl2anr 478 . . . . . . . . . . . 12  |-  ( ( m  e.  NN0  /\  ( # `  y )  e.  NN0 )  -> 
( ( # `  y
)  -  m )  e.  ZZ )
19183adant3 1016 . . . . . . . . . . 11  |-  ( ( m  e.  NN0  /\  ( # `  y )  e.  NN0  /\  m  <_  ( # `  y
) )  ->  (
( # `  y )  -  m )  e.  ZZ )
2014, 19sylbi 195 . . . . . . . . . 10  |-  ( m  e.  ( 0 ... ( # `  y
) )  ->  (
( # `  y )  -  m )  e.  ZZ )
2120adantl 466 . . . . . . . . 9  |-  ( ( y  e. Word  V  /\  m  e.  ( 0 ... ( # `  y
) ) )  -> 
( ( # `  y
)  -  m )  e.  ZZ )
2211, 13, 213jca 1176 . . . . . . . 8  |-  ( ( y  e. Word  V  /\  m  e.  ( 0 ... ( # `  y
) ) )  -> 
( y  e. Word  V  /\  m  e.  ZZ  /\  ( ( # `  y
)  -  m )  e.  ZZ ) )
2310, 22sylan 471 . . . . . . 7  |-  ( (
ph  /\  m  e.  ( 0 ... ( # `
 y ) ) )  ->  ( y  e. Word  V  /\  m  e.  ZZ  /\  ( (
# `  y )  -  m )  e.  ZZ ) )
24 2cshw 12756 . . . . . . 7  |-  ( ( y  e. Word  V  /\  m  e.  ZZ  /\  (
( # `  y )  -  m )  e.  ZZ )  ->  (
( y cyclShift  m ) cyclShift  ( ( # `  y
)  -  m ) )  =  ( y cyclShift  ( m  +  (
( # `  y )  -  m ) ) ) )
2523, 24syl 16 . . . . . 6  |-  ( (
ph  /\  m  e.  ( 0 ... ( # `
 y ) ) )  ->  ( (
y cyclShift  m ) cyclShift  ( ( # `
 y )  -  m ) )  =  ( y cyclShift  ( m  +  ( ( # `  y )  -  m
) ) ) )
26 nn0cn 10815 . . . . . . . . . . . 12  |-  ( m  e.  NN0  ->  m  e.  CC )
27 nn0cn 10815 . . . . . . . . . . . 12  |-  ( (
# `  y )  e.  NN0  ->  ( # `  y
)  e.  CC )
2826, 27anim12i 566 . . . . . . . . . . 11  |-  ( ( m  e.  NN0  /\  ( # `  y )  e.  NN0 )  -> 
( m  e.  CC  /\  ( # `  y
)  e.  CC ) )
29283adant3 1016 . . . . . . . . . 10  |-  ( ( m  e.  NN0  /\  ( # `  y )  e.  NN0  /\  m  <_  ( # `  y
) )  ->  (
m  e.  CC  /\  ( # `  y )  e.  CC ) )
3014, 29sylbi 195 . . . . . . . . 9  |-  ( m  e.  ( 0 ... ( # `  y
) )  ->  (
m  e.  CC  /\  ( # `  y )  e.  CC ) )
31 pncan3 9838 . . . . . . . . 9  |-  ( ( m  e.  CC  /\  ( # `  y )  e.  CC )  -> 
( m  +  ( ( # `  y
)  -  m ) )  =  ( # `  y ) )
3230, 31syl 16 . . . . . . . 8  |-  ( m  e.  ( 0 ... ( # `  y
) )  ->  (
m  +  ( (
# `  y )  -  m ) )  =  ( # `  y
) )
3332adantl 466 . . . . . . 7  |-  ( (
ph  /\  m  e.  ( 0 ... ( # `
 y ) ) )  ->  ( m  +  ( ( # `  y )  -  m
) )  =  (
# `  y )
)
3433oveq2d 6310 . . . . . 6  |-  ( (
ph  /\  m  e.  ( 0 ... ( # `
 y ) ) )  ->  ( y cyclShift  ( m  +  ( (
# `  y )  -  m ) ) )  =  ( y cyclShift  ( # `
 y ) ) )
35 cshwn 12743 . . . . . . . 8  |-  ( y  e. Word  V  ->  (
y cyclShift  ( # `  y
) )  =  y )
3610, 35syl 16 . . . . . . 7  |-  ( ph  ->  ( y cyclShift  ( # `  y
) )  =  y )
3736adantr 465 . . . . . 6  |-  ( (
ph  /\  m  e.  ( 0 ... ( # `
 y ) ) )  ->  ( y cyclShift  (
# `  y )
)  =  y )
3825, 34, 373eqtrrd 2513 . . . . 5  |-  ( (
ph  /\  m  e.  ( 0 ... ( # `
 y ) ) )  ->  y  =  ( ( y cyclShift  m
) cyclShift  ( ( # `  y
)  -  m ) ) )
3938adantrr 716 . . . 4  |-  ( (
ph  /\  ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) ) )  ->  y  =  ( ( y cyclShift  m ) cyclShift  ( ( # `  y
)  -  m ) ) )
40 oveq1 6301 . . . . . . 7  |-  ( x  =  ( y cyclShift  m
)  ->  ( x cyclShift  ( ( # `  y
)  -  m ) )  =  ( ( y cyclShift  m ) cyclShift  ( ( # `
 y )  -  m ) ) )
4140eqeq2d 2481 . . . . . 6  |-  ( x  =  ( y cyclShift  m
)  ->  ( y  =  ( x cyclShift  (
( # `  y )  -  m ) )  <-> 
y  =  ( ( y cyclShift  m ) cyclShift  ( ( # `
 y )  -  m ) ) ) )
4241adantl 466 . . . . 5  |-  ( ( m  e.  ( 0 ... ( # `  y
) )  /\  x  =  ( y cyclShift  m
) )  ->  (
y  =  ( x cyclShift  ( ( # `  y
)  -  m ) )  <->  y  =  ( ( y cyclShift  m ) cyclShift  ( ( # `  y
)  -  m ) ) ) )
4342adantl 466 . . . 4  |-  ( (
ph  /\  ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) ) )  ->  ( y  =  ( x cyclShift  ( ( # `
 y )  -  m ) )  <->  y  =  ( ( y cyclShift  m
) cyclShift  ( ( # `  y
)  -  m ) ) ) )
4439, 43mpbird 232 . . 3  |-  ( (
ph  /\  ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) ) )  ->  y  =  ( x cyclShift  ( ( # `  y
)  -  m ) ) )
45 oveq2 6302 . . . . 5  |-  ( n  =  ( ( # `  y )  -  m
)  ->  ( x cyclShift  n )  =  ( x cyclShift  ( ( # `  y
)  -  m ) ) )
4645eqeq2d 2481 . . . 4  |-  ( n  =  ( ( # `  y )  -  m
)  ->  ( y  =  ( x cyclShift  n
)  <->  y  =  ( x cyclShift  ( ( # `  y
)  -  m ) ) ) )
4746rspcev 3219 . . 3  |-  ( ( ( ( # `  y
)  -  m )  e.  ( 0 ... ( # `  x
) )  /\  y  =  ( x cyclShift  (
( # `  y )  -  m ) ) )  ->  E. n  e.  ( 0 ... ( # `
 x ) ) y  =  ( x cyclShift  n ) )
489, 44, 47syl2anc 661 . 2  |-  ( (
ph  /\  ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) ) )  ->  E. n  e.  ( 0 ... ( # `  x ) ) y  =  ( x cyclShift  n
) )
4948ex 434 1  |-  ( ph  ->  ( ( m  e.  ( 0 ... ( # `
 y ) )  /\  x  =  ( y cyclShift  m ) )  ->  E. n  e.  (
0 ... ( # `  x
) ) y  =  ( x cyclShift  n )
) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    /\ w3a 973    = wceq 1379    e. wcel 1767   E.wrex 2818   class class class wbr 4452   ` cfv 5593  (class class class)co 6294   CCcc 9500   0cc0 9502    + caddc 9505    <_ cle 9639    - cmin 9815   NN0cn0 10805   ZZcz 10874   ...cfz 11682   #chash 12383  Word cword 12510   cyclShift ccsh 12734
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 4563  ax-sep 4573  ax-nul 4581  ax-pow 4630  ax-pr 4691  ax-un 6586  ax-cnex 9558  ax-resscn 9559  ax-1cn 9560  ax-icn 9561  ax-addcl 9562  ax-addrcl 9563  ax-mulcl 9564  ax-mulrcl 9565  ax-mulcom 9566  ax-addass 9567  ax-mulass 9568  ax-distr 9569  ax-i2m1 9570  ax-1ne0 9571  ax-1rid 9572  ax-rnegex 9573  ax-rrecex 9574  ax-cnre 9575  ax-pre-lttri 9576  ax-pre-lttrn 9577  ax-pre-ltadd 9578  ax-pre-mulgt0 9579  ax-pre-sup 9580
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 2822  df-rex 2823  df-reu 2824  df-rmo 2825  df-rab 2826  df-v 3120  df-sbc 3337  df-csb 3441  df-dif 3484  df-un 3486  df-in 3488  df-ss 3495  df-pss 3497  df-nul 3791  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-uni 4251  df-int 4288  df-iun 4332  df-br 4453  df-opab 4511  df-mpt 4512  df-tr 4546  df-eprel 4796  df-id 4800  df-po 4805  df-so 4806  df-fr 4843  df-we 4845  df-ord 4886  df-on 4887  df-lim 4888  df-suc 4889  df-xp 5010  df-rel 5011  df-cnv 5012  df-co 5013  df-dm 5014  df-rn 5015  df-res 5016  df-ima 5017  df-iota 5556  df-fun 5595  df-fn 5596  df-f 5597  df-f1 5598  df-fo 5599  df-f1o 5600  df-fv 5601  df-riota 6255  df-ov 6297  df-oprab 6298  df-mpt2 6299  df-om 6695  df-1st 6794  df-2nd 6795  df-recs 7052  df-rdg 7086  df-1o 7140  df-oadd 7144  df-er 7321  df-en 7527  df-dom 7528  df-sdom 7529  df-fin 7530  df-sup 7911  df-card 8330  df-pnf 9640  df-mnf 9641  df-xr 9642  df-ltxr 9643  df-le 9644  df-sub 9817  df-neg 9818  df-div 10217  df-nn 10547  df-2 10604  df-n0 10806  df-z 10875  df-uz 11093  df-rp 11231  df-fz 11683  df-fzo 11803  df-fl 11907  df-mod 11975  df-hash 12384  df-word 12518  df-concat 12520  df-substr 12522  df-csh 12735
This theorem is referenced by:  erclwwlksym  24605  erclwwlknsym  24617
  Copyright terms: Public domain W3C validator