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

Theorem cshwshash 14438
Description: If a word has a length being a prime number, the size of the set of (different!) words resulting by cyclically shifting the original word equals the length of the original word or 1. (Contributed by AV, 19-May-2018.) (Revised by AV, 10-Nov-2018.)
Hypothesis
Ref Expression
cshwrepswhash1.m  |-  M  =  { w  e. Word  V  |  E. n  e.  ( 0..^ ( # `  W
) ) ( W cyclShift  n )  =  w }
Assertion
Ref Expression
cshwshash  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  (
( # `  M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) )
Distinct variable groups:    n, V, w    n, W, w
Allowed substitution hints:    M( w, n)

Proof of Theorem cshwshash
Dummy variable  i is distinct from all other variables.
StepHypRef Expression
1 repswsymballbi 12704 . . . . 5  |-  ( W  e. Word  V  ->  ( W  =  ( ( W `  0 ) repeatS  (
# `  W )
)  <->  A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
) ) )
21adantr 465 . . . 4  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( W  =  ( ( W `  0 ) repeatS  (
# `  W )
)  <->  A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
) ) )
3 prmnn 14070 . . . . . . . . 9  |-  ( (
# `  W )  e.  Prime  ->  ( # `  W
)  e.  NN )
43nnge1d 10569 . . . . . . . 8  |-  ( (
# `  W )  e.  Prime  ->  1  <_  (
# `  W )
)
5 wrdsymb1 12532 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  1  <_  ( # `  W
) )  ->  ( W `  0 )  e.  V )
64, 5sylan2 474 . . . . . . 7  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( W `  0 )  e.  V )
76adantr 465 . . . . . 6  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  W  =  (
( W `  0
) repeatS  ( # `  W
) ) )  -> 
( W `  0
)  e.  V )
83ad2antlr 726 . . . . . 6  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  W  =  (
( W `  0
) repeatS  ( # `  W
) ) )  -> 
( # `  W )  e.  NN )
9 simpr 461 . . . . . 6  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  W  =  (
( W `  0
) repeatS  ( # `  W
) ) )  ->  W  =  ( ( W `  0 ) repeatS  (
# `  W )
) )
10 cshwrepswhash1.m . . . . . . 7  |-  M  =  { w  e. Word  V  |  E. n  e.  ( 0..^ ( # `  W
) ) ( W cyclShift  n )  =  w }
1110cshwrepswhash1 14436 . . . . . 6  |-  ( ( ( W `  0
)  e.  V  /\  ( # `  W )  e.  NN  /\  W  =  ( ( W `
 0 ) repeatS  ( # `
 W ) ) )  ->  ( # `  M
)  =  1 )
127, 8, 9, 11syl3anc 1223 . . . . 5  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  W  =  (
( W `  0
) repeatS  ( # `  W
) ) )  -> 
( # `  M )  =  1 )
1312ex 434 . . . 4  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( W  =  ( ( W `  0 ) repeatS  (
# `  W )
)  ->  ( # `  M
)  =  1 ) )
142, 13sylbird 235 . . 3  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( A. i  e.  (
0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
)  ->  ( # `  M
)  =  1 ) )
15 olc 384 . . 3  |-  ( (
# `  M )  =  1  ->  (
( # `  M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) )
1614, 15syl6com 35 . 2  |-  ( A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
)  ->  ( ( W  e. Word  V  /\  ( # `
 W )  e. 
Prime )  ->  ( (
# `  M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) ) )
17 rexnal 2907 . . . 4  |-  ( E. i  e.  ( 0..^ ( # `  W
) )  -.  ( W `  i )  =  ( W ` 
0 )  <->  -.  A. i  e.  ( 0..^ ( # `  W ) ) ( W `  i )  =  ( W ` 
0 ) )
18 df-ne 2659 . . . . . 6  |-  ( ( W `  i )  =/=  ( W ` 
0 )  <->  -.  ( W `  i )  =  ( W ` 
0 ) )
1918bicomi 202 . . . . 5  |-  ( -.  ( W `  i
)  =  ( W `
 0 )  <->  ( W `  i )  =/=  ( W `  0 )
)
2019rexbii 2960 . . . 4  |-  ( E. i  e.  ( 0..^ ( # `  W
) )  -.  ( W `  i )  =  ( W ` 
0 )  <->  E. i  e.  ( 0..^ ( # `  W ) ) ( W `  i )  =/=  ( W ` 
0 ) )
2117, 20bitr3i 251 . . 3  |-  ( -. 
A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
)  <->  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )
2210cshwshashnsame 14437 . . . 4  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( E. i  e.  (
0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
)  ->  ( # `  M
)  =  ( # `  W ) ) )
23 orc 385 . . . 4  |-  ( (
# `  M )  =  ( # `  W
)  ->  ( ( # `
 M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) )
2422, 23syl6com 35 . . 3  |-  ( E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
)  ->  ( ( W  e. Word  V  /\  ( # `
 W )  e. 
Prime )  ->  ( (
# `  M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) ) )
2521, 24sylbi 195 . 2  |-  ( -. 
A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
)  ->  ( ( W  e. Word  V  /\  ( # `
 W )  e. 
Prime )  ->  ( (
# `  M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) ) )
2616, 25pm2.61i 164 1  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  (
( # `  M )  =  ( # `  W
)  \/  ( # `  M )  =  1 ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 184    \/ wo 368    /\ wa 369    = wceq 1374    e. wcel 1762    =/= wne 2657   A.wral 2809   E.wrex 2810   {crab 2813   class class class wbr 4442   ` cfv 5581  (class class class)co 6277   0cc0 9483   1c1 9484    <_ cle 9620   NNcn 10527  ..^cfzo 11783   #chash 12362  Word cword 12489   repeatS creps 12496   cyclShift ccsh 12711   Primecprime 14067
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1596  ax-4 1607  ax-5 1675  ax-6 1714  ax-7 1734  ax-8 1764  ax-9 1766  ax-10 1781  ax-11 1786  ax-12 1798  ax-13 1963  ax-ext 2440  ax-rep 4553  ax-sep 4563  ax-nul 4571  ax-pow 4620  ax-pr 4681  ax-un 6569  ax-inf2 8049  ax-cnex 9539  ax-resscn 9540  ax-1cn 9541  ax-icn 9542  ax-addcl 9543  ax-addrcl 9544  ax-mulcl 9545  ax-mulrcl 9546  ax-mulcom 9547  ax-addass 9548  ax-mulass 9549  ax-distr 9550  ax-i2m1 9551  ax-1ne0 9552  ax-1rid 9553  ax-rnegex 9554  ax-rrecex 9555  ax-cnre 9556  ax-pre-lttri 9557  ax-pre-lttrn 9558  ax-pre-ltadd 9559  ax-pre-mulgt0 9560  ax-pre-sup 9561
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 969  df-3an 970  df-tru 1377  df-fal 1380  df-ex 1592  df-nf 1595  df-sb 1707  df-eu 2274  df-mo 2275  df-clab 2448  df-cleq 2454  df-clel 2457  df-nfc 2612  df-ne 2659  df-nel 2660  df-ral 2814  df-rex 2815  df-reu 2816  df-rmo 2817  df-rab 2818  df-v 3110  df-sbc 3327  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3781  df-if 3935  df-pw 4007  df-sn 4023  df-pr 4025  df-tp 4027  df-op 4029  df-uni 4241  df-int 4278  df-iun 4322  df-disj 4413  df-br 4443  df-opab 4501  df-mpt 4502  df-tr 4536  df-eprel 4786  df-id 4790  df-po 4795  df-so 4796  df-fr 4833  df-se 4834  df-we 4835  df-ord 4876  df-on 4877  df-lim 4878  df-suc 4879  df-xp 5000  df-rel 5001  df-cnv 5002  df-co 5003  df-dm 5004  df-rn 5005  df-res 5006  df-ima 5007  df-iota 5544  df-fun 5583  df-fn 5584  df-f 5585  df-f1 5586  df-fo 5587  df-f1o 5588  df-fv 5589  df-isom 5590  df-riota 6238  df-ov 6280  df-oprab 6281  df-mpt2 6282  df-om 6674  df-1st 6776  df-2nd 6777  df-recs 7034  df-rdg 7068  df-1o 7122  df-2o 7123  df-oadd 7126  df-er 7303  df-map 7414  df-en 7509  df-dom 7510  df-sdom 7511  df-fin 7512  df-sup 7892  df-oi 7926  df-card 8311  df-cda 8539  df-pnf 9621  df-mnf 9622  df-xr 9623  df-ltxr 9624  df-le 9625  df-sub 9798  df-neg 9799  df-div 10198  df-nn 10528  df-2 10585  df-3 10586  df-n0 10787  df-z 10856  df-uz 11074  df-rp 11212  df-fz 11664  df-fzo 11784  df-fl 11888  df-mod 11955  df-seq 12066  df-exp 12125  df-hash 12363  df-word 12497  df-concat 12499  df-substr 12501  df-reps 12504  df-csh 12712  df-cj 12884  df-re 12885  df-im 12886  df-sqr 13020  df-abs 13021  df-clim 13262  df-sum 13460  df-dvds 13839  df-gcd 13995  df-prm 14068  df-phi 14146
This theorem is referenced by:  hashecclwwlkn1  24498
  Copyright terms: Public domain W3C validator