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

Theorem cshwsidrepsw 15522
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 ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) → ((𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊) → 𝑊 = ((𝑊‘0) repeatS (#‘𝑊))))

Proof of Theorem cshwsidrepsw
Dummy variables 𝑖 𝑗 𝑘 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 simpr 475 . . . . . . . . 9 ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) → (#‘𝑊) ∈ ℙ)
21adantr 479 . . . . . . . 8 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → (#‘𝑊) ∈ ℙ)
3 simp1 1053 . . . . . . . . 9 ((𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊) → 𝐿 ∈ ℤ)
43adantl 480 . . . . . . . 8 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → 𝐿 ∈ ℤ)
5 simpr2 1060 . . . . . . . 8 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → (𝐿 mod (#‘𝑊)) ≠ 0)
62, 4, 53jca 1234 . . . . . . 7 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → ((#‘𝑊) ∈ ℙ ∧ 𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0))
76adantr 479 . . . . . 6 ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → ((#‘𝑊) ∈ ℙ ∧ 𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0))
8 simpr 475 . . . . . 6 ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → 𝑖 ∈ (0..^(#‘𝑊)))
9 modprmn0modprm0 15234 . . . . . 6 (((#‘𝑊) ∈ ℙ ∧ 𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0) → (𝑖 ∈ (0..^(#‘𝑊)) → ∃𝑗 ∈ (0..^(#‘𝑊))((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0))
107, 8, 9sylc 62 . . . . 5 ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → ∃𝑗 ∈ (0..^(#‘𝑊))((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0)
11 elfzonn0 12248 . . . . . . . . . 10 (𝑗 ∈ (0..^(#‘𝑊)) → 𝑗 ∈ ℕ0)
1211ad2antrr 757 . . . . . . . . 9 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → 𝑗 ∈ ℕ0)
13 simpl 471 . . . . . . . . . . . . 13 ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) → 𝑊 ∈ Word 𝑉)
1413, 3anim12i 587 . . . . . . . . . . . 12 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → (𝑊 ∈ Word 𝑉𝐿 ∈ ℤ))
1514adantr 479 . . . . . . . . . . 11 ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → (𝑊 ∈ Word 𝑉𝐿 ∈ ℤ))
1615adantl 480 . . . . . . . . . 10 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → (𝑊 ∈ Word 𝑉𝐿 ∈ ℤ))
17 simpr3 1061 . . . . . . . . . . . 12 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → (𝑊 cyclShift 𝐿) = 𝑊)
1817anim1i 589 . . . . . . . . . . 11 ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → ((𝑊 cyclShift 𝐿) = 𝑊𝑖 ∈ (0..^(#‘𝑊))))
1918adantl 480 . . . . . . . . . 10 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → ((𝑊 cyclShift 𝐿) = 𝑊𝑖 ∈ (0..^(#‘𝑊))))
20 cshweqrep 13277 . . . . . . . . . 10 ((𝑊 ∈ Word 𝑉𝐿 ∈ ℤ) → (((𝑊 cyclShift 𝐿) = 𝑊𝑖 ∈ (0..^(#‘𝑊))) → ∀𝑘 ∈ ℕ0 (𝑊𝑖) = (𝑊‘((𝑖 + (𝑘 · 𝐿)) mod (#‘𝑊)))))
2116, 19, 20sylc 62 . . . . . . . . 9 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → ∀𝑘 ∈ ℕ0 (𝑊𝑖) = (𝑊‘((𝑖 + (𝑘 · 𝐿)) mod (#‘𝑊))))
22 oveq1 6433 . . . . . . . . . . . . . 14 (𝑘 = 𝑗 → (𝑘 · 𝐿) = (𝑗 · 𝐿))
2322oveq2d 6442 . . . . . . . . . . . . 13 (𝑘 = 𝑗 → (𝑖 + (𝑘 · 𝐿)) = (𝑖 + (𝑗 · 𝐿)))
2423oveq1d 6441 . . . . . . . . . . . 12 (𝑘 = 𝑗 → ((𝑖 + (𝑘 · 𝐿)) mod (#‘𝑊)) = ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)))
2524fveq2d 5991 . . . . . . . . . . 11 (𝑘 = 𝑗 → (𝑊‘((𝑖 + (𝑘 · 𝐿)) mod (#‘𝑊))) = (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊))))
2625eqeq2d 2524 . . . . . . . . . 10 (𝑘 = 𝑗 → ((𝑊𝑖) = (𝑊‘((𝑖 + (𝑘 · 𝐿)) mod (#‘𝑊))) ↔ (𝑊𝑖) = (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)))))
2726rspcva 3184 . . . . . . . . 9 ((𝑗 ∈ ℕ0 ∧ ∀𝑘 ∈ ℕ0 (𝑊𝑖) = (𝑊‘((𝑖 + (𝑘 · 𝐿)) mod (#‘𝑊)))) → (𝑊𝑖) = (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊))))
2812, 21, 27syl2anc 690 . . . . . . . 8 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → (𝑊𝑖) = (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊))))
29 fveq2 5987 . . . . . . . . . 10 (((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0 → (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊))) = (𝑊‘0))
3029adantl 480 . . . . . . . . 9 ((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) → (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊))) = (𝑊‘0))
3130adantr 479 . . . . . . . 8 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → (𝑊‘((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊))) = (𝑊‘0))
3228, 31eqtrd 2548 . . . . . . 7 (((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) ∧ (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊)))) → (𝑊𝑖) = (𝑊‘0))
3332ex 448 . . . . . 6 ((𝑗 ∈ (0..^(#‘𝑊)) ∧ ((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0) → ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → (𝑊𝑖) = (𝑊‘0)))
3433rexlimiva 2914 . . . . 5 (∃𝑗 ∈ (0..^(#‘𝑊))((𝑖 + (𝑗 · 𝐿)) mod (#‘𝑊)) = 0 → ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → (𝑊𝑖) = (𝑊‘0)))
3510, 34mpcom 37 . . . 4 ((((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) ∧ 𝑖 ∈ (0..^(#‘𝑊))) → (𝑊𝑖) = (𝑊‘0))
3635ralrimiva 2853 . . 3 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
37 repswsymballbi 13237 . . . 4 (𝑊 ∈ Word 𝑉 → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
3837ad2antrr 757 . . 3 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
3936, 38mpbird 245 . 2 (((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) ∧ (𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊)) → 𝑊 = ((𝑊‘0) repeatS (#‘𝑊)))
4039ex 448 1 ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) ∈ ℙ) → ((𝐿 ∈ ℤ ∧ (𝐿 mod (#‘𝑊)) ≠ 0 ∧ (𝑊 cyclShift 𝐿) = 𝑊) → 𝑊 = ((𝑊‘0) repeatS (#‘𝑊))))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 194  wa 382  w3a 1030   = wceq 1474  wcel 1938  wne 2684  wral 2800  wrex 2801  cfv 5689  (class class class)co 6426  0cc0 9691   + caddc 9694   · cmul 9696  0cn0 11047  cz 11118  ..^cfzo 12202   mod cmo 12398  #chash 12847  Word cword 13005   repeatS creps 13012   cyclShift ccsh 13244  cprime 15099
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1700  ax-4 1713  ax-5 1793  ax-6 1838  ax-7 1885  ax-8 1940  ax-9 1947  ax-10 1966  ax-11 1971  ax-12 1983  ax-13 2137  ax-ext 2494  ax-rep 4597  ax-sep 4607  ax-nul 4616  ax-pow 4668  ax-pr 4732  ax-un 6723  ax-cnex 9747  ax-resscn 9748  ax-1cn 9749  ax-icn 9750  ax-addcl 9751  ax-addrcl 9752  ax-mulcl 9753  ax-mulrcl 9754  ax-mulcom 9755  ax-addass 9756  ax-mulass 9757  ax-distr 9758  ax-i2m1 9759  ax-1ne0 9760  ax-1rid 9761  ax-rnegex 9762  ax-rrecex 9763  ax-cnre 9764  ax-pre-lttri 9765  ax-pre-lttrn 9766  ax-pre-ltadd 9767  ax-pre-mulgt0 9768  ax-pre-sup 9769
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1699  df-sb 1831  df-eu 2366  df-mo 2367  df-clab 2501  df-cleq 2507  df-clel 2510  df-nfc 2644  df-ne 2686  df-nel 2687  df-ral 2805  df-rex 2806  df-reu 2807  df-rmo 2808  df-rab 2809  df-v 3079  df-sbc 3307  df-csb 3404  df-dif 3447  df-un 3449  df-in 3451  df-ss 3458  df-pss 3460  df-nul 3778  df-if 3940  df-pw 4013  df-sn 4029  df-pr 4031  df-tp 4033  df-op 4035  df-uni 4271  df-int 4309  df-iun 4355  df-br 4482  df-opab 4542  df-mpt 4543  df-tr 4579  df-eprel 4843  df-id 4847  df-po 4853  df-so 4854  df-fr 4891  df-we 4893  df-xp 4938  df-rel 4939  df-cnv 4940  df-co 4941  df-dm 4942  df-rn 4943  df-res 4944  df-ima 4945  df-pred 5487  df-ord 5533  df-on 5534  df-lim 5535  df-suc 5536  df-iota 5653  df-fun 5691  df-fn 5692  df-f 5693  df-f1 5694  df-fo 5695  df-f1o 5696  df-fv 5697  df-riota 6388  df-ov 6429  df-oprab 6430  df-mpt2 6431  df-om 6834  df-1st 6934  df-2nd 6935  df-wrecs 7169  df-recs 7231  df-rdg 7269  df-1o 7323  df-2o 7324  df-oadd 7327  df-er 7505  df-map 7622  df-en 7718  df-dom 7719  df-sdom 7720  df-fin 7721  df-sup 8107  df-inf 8108  df-card 8524  df-cda 8749  df-pnf 9831  df-mnf 9832  df-xr 9833  df-ltxr 9834  df-le 9835  df-sub 10019  df-neg 10020  df-div 10434  df-nn 10776  df-2 10834  df-3 10835  df-n0 11048  df-z 11119  df-uz 11428  df-rp 11575  df-fz 12066  df-fzo 12203  df-fl 12323  df-mod 12399  df-seq 12532  df-exp 12591  df-hash 12848  df-word 13013  df-concat 13015  df-substr 13017  df-reps 13020  df-csh 13245  df-cj 13546  df-re 13547  df-im 13548  df-sqrt 13682  df-abs 13683  df-dvds 14691  df-gcd 14928  df-prm 15100  df-phi 15187
This theorem is referenced by:  cshwsidrepswmod0  15523
  Copyright terms: Public domain W3C validator