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

Theorem cshwsidrepsw 14789
Description: If cyclically shifting a word of length being a prime number by a number of positions which is not divisible by the prime number results in the word itself, the word is a "repeated symbol word". (Contributed by AV, 18-May-2018.) (Revised by AV, 10-Nov-2018.)
Assertion
Ref Expression
cshwsidrepsw  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  (
( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W )  ->  W  =  ( ( W ` 
0 ) repeatS  ( # `  W
) ) ) )

Proof of Theorem cshwsidrepsw
Dummy variables  i 
j  k are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 simpr 461 . . . . . . . . 9  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  ( # `
 W )  e. 
Prime )
21adantr 465 . . . . . . . 8  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  ( # `
 W )  e. 
Prime )
3 simp1 999 . . . . . . . . 9  |-  ( ( L  e.  ZZ  /\  ( L  mod  ( # `  W ) )  =/=  0  /\  ( W cyclShift  L )  =  W )  ->  L  e.  ZZ )
43adantl 466 . . . . . . . 8  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  L  e.  ZZ )
5 simpr2 1006 . . . . . . . 8  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  ( L  mod  ( # `  W
) )  =/=  0
)
62, 4, 53jca 1179 . . . . . . 7  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  (
( # `  W )  e.  Prime  /\  L  e.  ZZ  /\  ( L  mod  ( # `  W
) )  =/=  0
) )
76adantr 465 . . . . . 6  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  ( ( # `  W )  e.  Prime  /\  L  e.  ZZ  /\  ( L  mod  ( # `  W ) )  =/=  0 ) )
8 simpr 461 . . . . . 6  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  i  e.  ( 0..^ ( # `  W
) ) )
9 modprmn0modprm0 14543 . . . . . 6  |-  ( ( ( # `  W
)  e.  Prime  /\  L  e.  ZZ  /\  ( L  mod  ( # `  W
) )  =/=  0
)  ->  ( i  e.  ( 0..^ ( # `  W ) )  ->  E. j  e.  (
0..^ ( # `  W
) ) ( ( i  +  ( j  x.  L ) )  mod  ( # `  W
) )  =  0 ) )
107, 8, 9sylc 61 . . . . 5  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  E. j  e.  ( 0..^ ( # `  W
) ) ( ( i  +  ( j  x.  L ) )  mod  ( # `  W
) )  =  0 )
11 elfzonn0 11901 . . . . . . . . . 10  |-  ( j  e.  ( 0..^ (
# `  W )
)  ->  j  e.  NN0 )
1211ad2antrr 726 . . . . . . . . 9  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  j  e.  NN0 )
13 simpl 457 . . . . . . . . . . . . 13  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  W  e. Word  V )
1413, 3anim12i 566 . . . . . . . . . . . 12  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  ( W  e. Word  V  /\  L  e.  ZZ ) )
1514adantr 465 . . . . . . . . . . 11  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  ( W  e. Word  V  /\  L  e.  ZZ ) )
1615adantl 466 . . . . . . . . . 10  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  ( W  e. Word  V  /\  L  e.  ZZ ) )
17 simpr3 1007 . . . . . . . . . . . 12  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  ( W cyclShift  L )  =  W )
1817anim1i 568 . . . . . . . . . . 11  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  ( ( W cyclShift  L )  =  W  /\  i  e.  ( 0..^ ( # `  W
) ) ) )
1918adantl 466 . . . . . . . . . 10  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  ( ( W cyclShift  L )  =  W  /\  i  e.  ( 0..^ ( # `  W
) ) ) )
20 cshweqrep 12847 . . . . . . . . . 10  |-  ( ( W  e. Word  V  /\  L  e.  ZZ )  ->  ( ( ( W cyclShift  L )  =  W  /\  i  e.  ( 0..^ ( # `  W
) ) )  ->  A. k  e.  NN0  ( W `  i )  =  ( W `  ( ( i  +  ( k  x.  L
) )  mod  ( # `
 W ) ) ) ) )
2116, 19, 20sylc 61 . . . . . . . . 9  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  A. k  e.  NN0  ( W `  i )  =  ( W `  ( ( i  +  ( k  x.  L ) )  mod  ( # `  W
) ) ) )
22 oveq1 6287 . . . . . . . . . . . . . 14  |-  ( k  =  j  ->  (
k  x.  L )  =  ( j  x.  L ) )
2322oveq2d 6296 . . . . . . . . . . . . 13  |-  ( k  =  j  ->  (
i  +  ( k  x.  L ) )  =  ( i  +  ( j  x.  L
) ) )
2423oveq1d 6295 . . . . . . . . . . . 12  |-  ( k  =  j  ->  (
( i  +  ( k  x.  L ) )  mod  ( # `  W ) )  =  ( ( i  +  ( j  x.  L
) )  mod  ( # `
 W ) ) )
2524fveq2d 5855 . . . . . . . . . . 11  |-  ( k  =  j  ->  ( W `  ( (
i  +  ( k  x.  L ) )  mod  ( # `  W
) ) )  =  ( W `  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) ) ) )
2625eqeq2d 2418 . . . . . . . . . 10  |-  ( k  =  j  ->  (
( W `  i
)  =  ( W `
 ( ( i  +  ( k  x.  L ) )  mod  ( # `  W
) ) )  <->  ( W `  i )  =  ( W `  ( ( i  +  ( j  x.  L ) )  mod  ( # `  W
) ) ) ) )
2726rspcva 3160 . . . . . . . . 9  |-  ( ( j  e.  NN0  /\  A. k  e.  NN0  ( W `  i )  =  ( W `  ( ( i  +  ( k  x.  L
) )  mod  ( # `
 W ) ) ) )  ->  ( W `  i )  =  ( W `  ( ( i  +  ( j  x.  L
) )  mod  ( # `
 W ) ) ) )
2812, 21, 27syl2anc 661 . . . . . . . 8  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  ( W `  i )  =  ( W `  ( ( i  +  ( j  x.  L ) )  mod  ( # `  W
) ) ) )
29 fveq2 5851 . . . . . . . . . 10  |-  ( ( ( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0  ->  ( W `  ( ( i  +  ( j  x.  L
) )  mod  ( # `
 W ) ) )  =  ( W `
 0 ) )
3029adantl 466 . . . . . . . . 9  |-  ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  ->  ( W `  ( (
i  +  ( j  x.  L ) )  mod  ( # `  W
) ) )  =  ( W `  0
) )
3130adantr 465 . . . . . . . 8  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  ( W `  ( ( i  +  ( j  x.  L
) )  mod  ( # `
 W ) ) )  =  ( W `
 0 ) )
3228, 31eqtrd 2445 . . . . . . 7  |-  ( ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  /\  (
( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) ) )  ->  ( W `  i )  =  ( W `  0 ) )
3332ex 434 . . . . . 6  |-  ( ( j  e.  ( 0..^ ( # `  W
) )  /\  (
( i  +  ( j  x.  L ) )  mod  ( # `  W ) )  =  0 )  ->  (
( ( ( W  e. Word  V  /\  ( # `
 W )  e. 
Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `  W
) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W
) ) )  -> 
( W `  i
)  =  ( W `
 0 ) ) )
3433rexlimiva 2894 . . . . 5  |-  ( E. j  e.  ( 0..^ ( # `  W
) ) ( ( i  +  ( j  x.  L ) )  mod  ( # `  W
) )  =  0  ->  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  ( W `  i )  =  ( W `  0 ) ) )
3510, 34mpcom 36 . . . 4  |-  ( ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  /\  i  e.  ( 0..^ ( # `  W ) ) )  ->  ( W `  i )  =  ( W `  0 ) )
3635ralrimiva 2820 . . 3  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  A. i  e.  ( 0..^ ( # `  W ) ) ( W `  i )  =  ( W ` 
0 ) )
37 repswsymballbi 12810 . . . 4  |-  ( W  e. Word  V  ->  ( W  =  ( ( W `  0 ) repeatS  (
# `  W )
)  <->  A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
) ) )
3837ad2antrr 726 . . 3  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  ( W  =  ( ( W `  0 ) repeatS  (
# `  W )
)  <->  A. i  e.  ( 0..^ ( # `  W
) ) ( W `
 i )  =  ( W `  0
) ) )
3936, 38mpbird 234 . 2  |-  ( ( ( W  e. Word  V  /\  ( # `  W
)  e.  Prime )  /\  ( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W ) )  ->  W  =  ( ( W `
 0 ) repeatS  ( # `
 W ) ) )
4039ex 434 1  |-  ( ( W  e. Word  V  /\  ( # `  W )  e.  Prime )  ->  (
( L  e.  ZZ  /\  ( L  mod  ( # `
 W ) )  =/=  0  /\  ( W cyclShift  L )  =  W )  ->  W  =  ( ( W ` 
0 ) repeatS  ( # `  W
) ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 186    /\ wa 369    /\ w3a 976    = wceq 1407    e. wcel 1844    =/= wne 2600   A.wral 2756   E.wrex 2757   ` cfv 5571  (class class class)co 6280   0cc0 9524    + caddc 9527    x. cmul 9529   NN0cn0 10838   ZZcz 10907  ..^cfzo 11856    mod cmo 12036   #chash 12454  Word cword 12585   repeatS creps 12592   cyclShift ccsh 12817   Primecprime 14428
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1641  ax-4 1654  ax-5 1727  ax-6 1773  ax-7 1816  ax-8 1846  ax-9 1848  ax-10 1863  ax-11 1868  ax-12 1880  ax-13 2028  ax-ext 2382  ax-rep 4509  ax-sep 4519  ax-nul 4527  ax-pow 4574  ax-pr 4632  ax-un 6576  ax-cnex 9580  ax-resscn 9581  ax-1cn 9582  ax-icn 9583  ax-addcl 9584  ax-addrcl 9585  ax-mulcl 9586  ax-mulrcl 9587  ax-mulcom 9588  ax-addass 9589  ax-mulass 9590  ax-distr 9591  ax-i2m1 9592  ax-1ne0 9593  ax-1rid 9594  ax-rnegex 9595  ax-rrecex 9596  ax-cnre 9597  ax-pre-lttri 9598  ax-pre-lttrn 9599  ax-pre-ltadd 9600  ax-pre-mulgt0 9601  ax-pre-sup 9602
This theorem depends on definitions:  df-bi 187  df-or 370  df-an 371  df-3or 977  df-3an 978  df-tru 1410  df-ex 1636  df-nf 1640  df-sb 1766  df-eu 2244  df-mo 2245  df-clab 2390  df-cleq 2396  df-clel 2399  df-nfc 2554  df-ne 2602  df-nel 2603  df-ral 2761  df-rex 2762  df-reu 2763  df-rmo 2764  df-rab 2765  df-v 3063  df-sbc 3280  df-csb 3376  df-dif 3419  df-un 3421  df-in 3423  df-ss 3430  df-pss 3432  df-nul 3741  df-if 3888  df-pw 3959  df-sn 3975  df-pr 3977  df-tp 3979  df-op 3981  df-uni 4194  df-int 4230  df-iun 4275  df-br 4398  df-opab 4456  df-mpt 4457  df-tr 4492  df-eprel 4736  df-id 4740  df-po 4746  df-so 4747  df-fr 4784  df-we 4786  df-xp 4831  df-rel 4832  df-cnv 4833  df-co 4834  df-dm 4835  df-rn 4836  df-res 4837  df-ima 4838  df-pred 5369  df-ord 5415  df-on 5416  df-lim 5417  df-suc 5418  df-iota 5535  df-fun 5573  df-fn 5574  df-f 5575  df-f1 5576  df-fo 5577  df-f1o 5578  df-fv 5579  df-riota 6242  df-ov 6283  df-oprab 6284  df-mpt2 6285  df-om 6686  df-1st 6786  df-2nd 6787  df-wrecs 7015  df-recs 7077  df-rdg 7115  df-1o 7169  df-2o 7170  df-oadd 7173  df-er 7350  df-map 7461  df-en 7557  df-dom 7558  df-sdom 7559  df-fin 7560  df-sup 7937  df-card 8354  df-cda 8582  df-pnf 9662  df-mnf 9663  df-xr 9664  df-ltxr 9665  df-le 9666  df-sub 9845  df-neg 9846  df-div 10250  df-nn 10579  df-2 10637  df-3 10638  df-n0 10839  df-z 10908  df-uz 11130  df-rp 11268  df-fz 11729  df-fzo 11857  df-fl 11968  df-mod 12037  df-seq 12154  df-exp 12213  df-hash 12455  df-word 12593  df-concat 12595  df-substr 12597  df-reps 12600  df-csh 12818  df-cj 13083  df-re 13084  df-im 13085  df-sqrt 13219  df-abs 13220  df-dvds 14198  df-gcd 14356  df-prm 14429  df-phi 14507
This theorem is referenced by:  cshwsidrepswmod0  14790
  Copyright terms: Public domain W3C validator