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

Theorem cshwshash 14466
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 12731 . . . . 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 14097 . . . . . . . . 9  |-  ( (
# `  W )  e.  Prime  ->  ( # `  W
)  e.  NN )
43nnge1d 10584 . . . . . . . 8  |-  ( (
# `  W )  e.  Prime  ->  1  <_  (
# `  W )
)
5 wrdsymb1 12557 . . . . . . . 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 14464 . . . . . 6  |-  ( ( ( W `  0
)  e.  V  /\  ( # `  W )  e.  NN  /\  W  =  ( ( W `
 0 ) repeatS  ( # `
 W ) ) )  ->  ( # `  M
)  =  1 )
127, 8, 9, 11syl3anc 1229 . . . . 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 2891 . . . 4  |-  ( E. i  e.  ( 0..^ ( # `  W
) )  -.  ( W `  i )  =  ( W ` 
0 )  <->  -.  A. i  e.  ( 0..^ ( # `  W ) ) ( W `  i )  =  ( W ` 
0 ) )
18 df-ne 2640 . . . . . 6  |-  ( ( W `  i )  =/=  ( W ` 
0 )  <->  -.  ( W `  i )  =  ( W ` 
0 ) )
1918bicomi 202 . . . . 5  |-  ( -.  ( W `  i
)  =  ( W `
 0 )  <->  ( W `  i )  =/=  ( W `  0 )
)
2019rexbii 2945 . . . 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 14465 . . . 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 1383    e. wcel 1804    =/= wne 2638   A.wral 2793   E.wrex 2794   {crab 2797   class class class wbr 4437   ` cfv 5578  (class class class)co 6281   0cc0 9495   1c1 9496    <_ cle 9632   NNcn 10542  ..^cfzo 11803   #chash 12384  Word cword 12513   repeatS creps 12520   cyclShift ccsh 12738   Primecprime 14094
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1605  ax-4 1618  ax-5 1691  ax-6 1734  ax-7 1776  ax-8 1806  ax-9 1808  ax-10 1823  ax-11 1828  ax-12 1840  ax-13 1985  ax-ext 2421  ax-rep 4548  ax-sep 4558  ax-nul 4566  ax-pow 4615  ax-pr 4676  ax-un 6577  ax-inf2 8061  ax-cnex 9551  ax-resscn 9552  ax-1cn 9553  ax-icn 9554  ax-addcl 9555  ax-addrcl 9556  ax-mulcl 9557  ax-mulrcl 9558  ax-mulcom 9559  ax-addass 9560  ax-mulass 9561  ax-distr 9562  ax-i2m1 9563  ax-1ne0 9564  ax-1rid 9565  ax-rnegex 9566  ax-rrecex 9567  ax-cnre 9568  ax-pre-lttri 9569  ax-pre-lttrn 9570  ax-pre-ltadd 9571  ax-pre-mulgt0 9572  ax-pre-sup 9573
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 975  df-3an 976  df-tru 1386  df-fal 1389  df-ex 1600  df-nf 1604  df-sb 1727  df-eu 2272  df-mo 2273  df-clab 2429  df-cleq 2435  df-clel 2438  df-nfc 2593  df-ne 2640  df-nel 2641  df-ral 2798  df-rex 2799  df-reu 2800  df-rmo 2801  df-rab 2802  df-v 3097  df-sbc 3314  df-csb 3421  df-dif 3464  df-un 3466  df-in 3468  df-ss 3475  df-pss 3477  df-nul 3771  df-if 3927  df-pw 3999  df-sn 4015  df-pr 4017  df-tp 4019  df-op 4021  df-uni 4235  df-int 4272  df-iun 4317  df-disj 4408  df-br 4438  df-opab 4496  df-mpt 4497  df-tr 4531  df-eprel 4781  df-id 4785  df-po 4790  df-so 4791  df-fr 4828  df-se 4829  df-we 4830  df-ord 4871  df-on 4872  df-lim 4873  df-suc 4874  df-xp 4995  df-rel 4996  df-cnv 4997  df-co 4998  df-dm 4999  df-rn 5000  df-res 5001  df-ima 5002  df-iota 5541  df-fun 5580  df-fn 5581  df-f 5582  df-f1 5583  df-fo 5584  df-f1o 5585  df-fv 5586  df-isom 5587  df-riota 6242  df-ov 6284  df-oprab 6285  df-mpt2 6286  df-om 6686  df-1st 6785  df-2nd 6786  df-recs 7044  df-rdg 7078  df-1o 7132  df-2o 7133  df-oadd 7136  df-er 7313  df-map 7424  df-en 7519  df-dom 7520  df-sdom 7521  df-fin 7522  df-sup 7903  df-oi 7938  df-card 8323  df-cda 8551  df-pnf 9633  df-mnf 9634  df-xr 9635  df-ltxr 9636  df-le 9637  df-sub 9812  df-neg 9813  df-div 10213  df-nn 10543  df-2 10600  df-3 10601  df-n0 10802  df-z 10871  df-uz 11091  df-rp 11230  df-fz 11682  df-fzo 11804  df-fl 11908  df-mod 11976  df-seq 12087  df-exp 12146  df-hash 12385  df-word 12521  df-concat 12523  df-substr 12525  df-reps 12528  df-csh 12739  df-cj 12911  df-re 12912  df-im 12913  df-sqrt 13047  df-abs 13048  df-clim 13290  df-sum 13488  df-dvds 13864  df-gcd 14022  df-prm 14095  df-phi 14173
This theorem is referenced by:  hashecclwwlkn1  24706
  Copyright terms: Public domain W3C validator