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

Theorem cshwshashnsame 14600
Description: If a word (not consisting of identical symbols) 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. (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
cshwshashnsame  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( E. i  e.  (
0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
)  ->  ( # `  M
)  =  ( # `  W ) ) )
Distinct variable groups:    n, V, w    n, W, w, i   
i, V
Allowed substitution hints:    M( w, i, n)

Proof of Theorem cshwshashnsame
StepHypRef Expression
1 cshwrepswhash1.m . . . . . 6  |-  M  =  { w  e. Word  V  |  E. n  e.  ( 0..^ ( # `  W
) ) ( W cyclShift  n )  =  w }
21cshwsiun 14596 . . . . 5  |-  ( W  e. Word  V  ->  M  =  U_ n  e.  ( 0..^ ( # `  W
) ) { ( W cyclShift  n ) } )
32ad2antrr 725 . . . 4  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  M  =  U_ n  e.  ( 0..^ ( # `  W
) ) { ( W cyclShift  n ) } )
43fveq2d 5876 . . 3  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  ( # `
 M )  =  ( # `  U_ n  e.  ( 0..^ ( # `  W ) ) { ( W cyclShift  n ) } ) )
5 fzofi 12087 . . . . 5  |-  ( 0..^ ( # `  W
) )  e.  Fin
65a1i 11 . . . 4  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  (
0..^ ( # `  W
) )  e.  Fin )
7 snfi 7615 . . . . 5  |-  { ( W cyclShift  n ) }  e.  Fin
87a1i 11 . . . 4  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  /\  n  e.  ( 0..^ ( # `  W ) ) )  ->  { ( W cyclShift  n ) }  e.  Fin )
9 id 22 . . . . 5  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( W  e. Word  V  /\  ( # `
 W )  e. 
Prime ) )
109cshwsdisj 14595 . . . 4  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  -> Disj  n  e.  ( 0..^ ( # `  W ) ) { ( W cyclShift  n ) } )
116, 8, 10hashiun 13648 . . 3  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  ( # `
 U_ n  e.  ( 0..^ ( # `  W
) ) { ( W cyclShift  n ) } )  =  sum_ n  e.  ( 0..^ ( # `  W
) ) ( # `  { ( W cyclShift  n ) } ) )
12 ovex 6324 . . . . . 6  |-  ( W cyclShift  n )  e.  _V
13 hashsng 12441 . . . . . 6  |-  ( ( W cyclShift  n )  e.  _V  ->  ( # `  {
( W cyclShift  n ) } )  =  1 )
1412, 13mp1i 12 . . . . 5  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  ( # `
 { ( W cyclShift  n ) } )  =  1 )
1514sumeq2sdv 13538 . . . 4  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  sum_ n  e.  ( 0..^ ( # `  W ) ) (
# `  { ( W cyclShift  n ) } )  =  sum_ n  e.  ( 0..^ ( # `  W
) ) 1 )
16 1cnd 9629 . . . . . . 7  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  1  e.  CC )
17 fsumconst 13617 . . . . . . 7  |-  ( ( ( 0..^ ( # `  W ) )  e. 
Fin  /\  1  e.  CC )  ->  sum_ n  e.  ( 0..^ ( # `  W ) ) 1  =  ( ( # `  ( 0..^ ( # `  W ) ) )  x.  1 ) )
185, 16, 17sylancr 663 . . . . . 6  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  sum_ n  e.  ( 0..^ ( # `  W ) ) 1  =  ( ( # `  ( 0..^ ( # `  W ) ) )  x.  1 ) )
19 lencl 12569 . . . . . . . . 9  |-  ( W  e. Word  V  ->  ( # `
 W )  e. 
NN0 )
2019adantr 465 . . . . . . . 8  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( # `
 W )  e. 
NN0 )
21 hashfzo0 12492 . . . . . . . 8  |-  ( (
# `  W )  e.  NN0  ->  ( # `  (
0..^ ( # `  W
) ) )  =  ( # `  W
) )
2220, 21syl 16 . . . . . . 7  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( # `
 ( 0..^ (
# `  W )
) )  =  (
# `  W )
)
2322oveq1d 6311 . . . . . 6  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  (
( # `  ( 0..^ ( # `  W
) ) )  x.  1 )  =  ( ( # `  W
)  x.  1 ) )
24 prmnn 14232 . . . . . . . . 9  |-  ( (
# `  W )  e.  Prime  ->  ( # `  W
)  e.  NN )
2524nnred 10571 . . . . . . . 8  |-  ( (
# `  W )  e.  Prime  ->  ( # `  W
)  e.  RR )
2625adantl 466 . . . . . . 7  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( # `
 W )  e.  RR )
27 ax-1rid 9579 . . . . . . 7  |-  ( (
# `  W )  e.  RR  ->  ( ( # `
 W )  x.  1 )  =  (
# `  W )
)
2826, 27syl 16 . . . . . 6  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  (
( # `  W )  x.  1 )  =  ( # `  W
) )
2918, 23, 283eqtrd 2502 . . . . 5  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  sum_ n  e.  ( 0..^ ( # `  W ) ) 1  =  ( # `  W
) )
3029adantr 465 . . . 4  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  sum_ n  e.  ( 0..^ ( # `  W ) ) 1  =  ( # `  W
) )
3115, 30eqtrd 2498 . . 3  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  sum_ n  e.  ( 0..^ ( # `  W ) ) (
# `  { ( W cyclShift  n ) } )  =  ( # `  W
) )
324, 11, 313eqtrd 2502 . 2  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  E. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
) )  ->  ( # `
 M )  =  ( # `  W
) )
3332ex 434 1  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( E. i  e.  (
0..^ ( # `  W
) ) ( W `
 i )  =/=  ( W `  0
)  ->  ( # `  M
)  =  ( # `  W ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1395    e. wcel 1819    =/= wne 2652   E.wrex 2808   {crab 2811   _Vcvv 3109   {csn 4032   U_ciun 4332   ` cfv 5594  (class class class)co 6296   Fincfn 7535   CCcc 9507   RRcr 9508   0cc0 9509   1c1 9510    x. cmul 9514   NN0cn0 10816  ..^cfzo 11821   #chash 12408  Word cword 12538   cyclShift ccsh 12771   sum_csu 13520   Primecprime 14229
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1619  ax-4 1632  ax-5 1705  ax-6 1748  ax-7 1791  ax-8 1821  ax-9 1823  ax-10 1838  ax-11 1843  ax-12 1855  ax-13 2000  ax-ext 2435  ax-rep 4568  ax-sep 4578  ax-nul 4586  ax-pow 4634  ax-pr 4695  ax-un 6591  ax-inf2 8075  ax-cnex 9565  ax-resscn 9566  ax-1cn 9567  ax-icn 9568  ax-addcl 9569  ax-addrcl 9570  ax-mulcl 9571  ax-mulrcl 9572  ax-mulcom 9573  ax-addass 9574  ax-mulass 9575  ax-distr 9576  ax-i2m1 9577  ax-1ne0 9578  ax-1rid 9579  ax-rnegex 9580  ax-rrecex 9581  ax-cnre 9582  ax-pre-lttri 9583  ax-pre-lttrn 9584  ax-pre-ltadd 9585  ax-pre-mulgt0 9586  ax-pre-sup 9587
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-tru 1398  df-fal 1401  df-ex 1614  df-nf 1618  df-sb 1741  df-eu 2287  df-mo 2288  df-clab 2443  df-cleq 2449  df-clel 2452  df-nfc 2607  df-ne 2654  df-nel 2655  df-ral 2812  df-rex 2813  df-reu 2814  df-rmo 2815  df-rab 2816  df-v 3111  df-sbc 3328  df-csb 3431  df-dif 3474  df-un 3476  df-in 3478  df-ss 3485  df-pss 3487  df-nul 3794  df-if 3945  df-pw 4017  df-sn 4033  df-pr 4035  df-tp 4037  df-op 4039  df-uni 4252  df-int 4289  df-iun 4334  df-disj 4428  df-br 4457  df-opab 4516  df-mpt 4517  df-tr 4551  df-eprel 4800  df-id 4804  df-po 4809  df-so 4810  df-fr 4847  df-se 4848  df-we 4849  df-ord 4890  df-on 4891  df-lim 4892  df-suc 4893  df-xp 5014  df-rel 5015  df-cnv 5016  df-co 5017  df-dm 5018  df-rn 5019  df-res 5020  df-ima 5021  df-iota 5557  df-fun 5596  df-fn 5597  df-f 5598  df-f1 5599  df-fo 5600  df-f1o 5601  df-fv 5602  df-isom 5603  df-riota 6258  df-ov 6299  df-oprab 6300  df-mpt2 6301  df-om 6700  df-1st 6799  df-2nd 6800  df-recs 7060  df-rdg 7094  df-1o 7148  df-2o 7149  df-oadd 7152  df-er 7329  df-map 7440  df-en 7536  df-dom 7537  df-sdom 7538  df-fin 7539  df-sup 7919  df-oi 7953  df-card 8337  df-cda 8565  df-pnf 9647  df-mnf 9648  df-xr 9649  df-ltxr 9650  df-le 9651  df-sub 9826  df-neg 9827  df-div 10228  df-nn 10557  df-2 10615  df-3 10616  df-n0 10817  df-z 10886  df-uz 11107  df-rp 11246  df-fz 11698  df-fzo 11822  df-fl 11932  df-mod 12000  df-seq 12111  df-exp 12170  df-hash 12409  df-word 12546  df-concat 12548  df-substr 12550  df-reps 12553  df-csh 12772  df-cj 12944  df-re 12945  df-im 12946  df-sqrt 13080  df-abs 13081  df-clim 13323  df-sum 13521  df-dvds 13999  df-gcd 14157  df-prm 14230  df-phi 14308
This theorem is referenced by:  cshwshash  14601  usghashecclwwlk  24962
  Copyright terms: Public domain W3C validator