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

Theorem cshw1 13367
Description: If cyclically shifting a word by 1 position results in the word itself, the word is build of identical symbols. Remark: also "valid" for an empty word! (Contributed by AV, 13-May-2018.) (Revised by AV, 7-Jun-2018.) (Proof shortened by AV, 1-Nov-2018.)
Assertion
Ref Expression
cshw1 ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
Distinct variable groups:   𝑖,𝑉   𝑖,𝑊

Proof of Theorem cshw1
StepHypRef Expression
1 ral0 4027 . . . 4 𝑖 ∈ ∅ (𝑊𝑖) = (𝑊‘0)
2 oveq2 6534 . . . . . 6 ((#‘𝑊) = 0 → (0..^(#‘𝑊)) = (0..^0))
3 fzo0 12318 . . . . . 6 (0..^0) = ∅
42, 3syl6eq 2659 . . . . 5 ((#‘𝑊) = 0 → (0..^(#‘𝑊)) = ∅)
54raleqdv 3120 . . . 4 ((#‘𝑊) = 0 → (∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0) ↔ ∀𝑖 ∈ ∅ (𝑊𝑖) = (𝑊‘0)))
61, 5mpbiri 246 . . 3 ((#‘𝑊) = 0 → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
76a1d 25 . 2 ((#‘𝑊) = 0 → ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
8 simprl 789 . . . . . . . 8 (((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → 𝑊 ∈ Word 𝑉)
9 lencl 13127 . . . . . . . . . . 11 (𝑊 ∈ Word 𝑉 → (#‘𝑊) ∈ ℕ0)
10 1nn0 11157 . . . . . . . . . . . . . 14 1 ∈ ℕ0
1110a1i 11 . . . . . . . . . . . . 13 (((#‘𝑊) ∈ ℕ0 ∧ (¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1)) → 1 ∈ ℕ0)
12 df-ne 2781 . . . . . . . . . . . . . . . 16 ((#‘𝑊) ≠ 0 ↔ ¬ (#‘𝑊) = 0)
13 elnnne0 11155 . . . . . . . . . . . . . . . . 17 ((#‘𝑊) ∈ ℕ ↔ ((#‘𝑊) ∈ ℕ0 ∧ (#‘𝑊) ≠ 0))
1413simplbi2com 654 . . . . . . . . . . . . . . . 16 ((#‘𝑊) ≠ 0 → ((#‘𝑊) ∈ ℕ0 → (#‘𝑊) ∈ ℕ))
1512, 14sylbir 223 . . . . . . . . . . . . . . 15 (¬ (#‘𝑊) = 0 → ((#‘𝑊) ∈ ℕ0 → (#‘𝑊) ∈ ℕ))
1615adantr 479 . . . . . . . . . . . . . 14 ((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) → ((#‘𝑊) ∈ ℕ0 → (#‘𝑊) ∈ ℕ))
1716impcom 444 . . . . . . . . . . . . 13 (((#‘𝑊) ∈ ℕ0 ∧ (¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1)) → (#‘𝑊) ∈ ℕ)
18 df-ne 2781 . . . . . . . . . . . . . . . 16 ((#‘𝑊) ≠ 1 ↔ ¬ (#‘𝑊) = 1)
1918biimpri 216 . . . . . . . . . . . . . . 15 (¬ (#‘𝑊) = 1 → (#‘𝑊) ≠ 1)
2019ad2antll 760 . . . . . . . . . . . . . 14 (((#‘𝑊) ∈ ℕ0 ∧ (¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1)) → (#‘𝑊) ≠ 1)
21 nngt1ne1 10896 . . . . . . . . . . . . . . 15 ((#‘𝑊) ∈ ℕ → (1 < (#‘𝑊) ↔ (#‘𝑊) ≠ 1))
2217, 21syl 17 . . . . . . . . . . . . . 14 (((#‘𝑊) ∈ ℕ0 ∧ (¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1)) → (1 < (#‘𝑊) ↔ (#‘𝑊) ≠ 1))
2320, 22mpbird 245 . . . . . . . . . . . . 13 (((#‘𝑊) ∈ ℕ0 ∧ (¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1)) → 1 < (#‘𝑊))
24 elfzo0 12333 . . . . . . . . . . . . 13 (1 ∈ (0..^(#‘𝑊)) ↔ (1 ∈ ℕ0 ∧ (#‘𝑊) ∈ ℕ ∧ 1 < (#‘𝑊)))
2511, 17, 23, 24syl3anbrc 1238 . . . . . . . . . . . 12 (((#‘𝑊) ∈ ℕ0 ∧ (¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1)) → 1 ∈ (0..^(#‘𝑊)))
2625ex 448 . . . . . . . . . . 11 ((#‘𝑊) ∈ ℕ0 → ((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) → 1 ∈ (0..^(#‘𝑊))))
279, 26syl 17 . . . . . . . . . 10 (𝑊 ∈ Word 𝑉 → ((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) → 1 ∈ (0..^(#‘𝑊))))
2827adantr 479 . . . . . . . . 9 ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → ((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) → 1 ∈ (0..^(#‘𝑊))))
2928impcom 444 . . . . . . . 8 (((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → 1 ∈ (0..^(#‘𝑊)))
30 simprr 791 . . . . . . . 8 (((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → (𝑊 cyclShift 1) = 𝑊)
31 lbfzo0 12332 . . . . . . . . . . . . . . . . 17 (0 ∈ (0..^(#‘𝑊)) ↔ (#‘𝑊) ∈ ℕ)
3231biimpri 216 . . . . . . . . . . . . . . . 16 ((#‘𝑊) ∈ ℕ → 0 ∈ (0..^(#‘𝑊)))
3313, 32sylbir 223 . . . . . . . . . . . . . . 15 (((#‘𝑊) ∈ ℕ0 ∧ (#‘𝑊) ≠ 0) → 0 ∈ (0..^(#‘𝑊)))
3433ex 448 . . . . . . . . . . . . . 14 ((#‘𝑊) ∈ ℕ0 → ((#‘𝑊) ≠ 0 → 0 ∈ (0..^(#‘𝑊))))
3512, 34syl5bir 231 . . . . . . . . . . . . 13 ((#‘𝑊) ∈ ℕ0 → (¬ (#‘𝑊) = 0 → 0 ∈ (0..^(#‘𝑊))))
369, 35syl 17 . . . . . . . . . . . 12 (𝑊 ∈ Word 𝑉 → (¬ (#‘𝑊) = 0 → 0 ∈ (0..^(#‘𝑊))))
3736adantr 479 . . . . . . . . . . 11 ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → (¬ (#‘𝑊) = 0 → 0 ∈ (0..^(#‘𝑊))))
3837com12 32 . . . . . . . . . 10 (¬ (#‘𝑊) = 0 → ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → 0 ∈ (0..^(#‘𝑊))))
3938adantr 479 . . . . . . . . 9 ((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) → ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → 0 ∈ (0..^(#‘𝑊))))
4039imp 443 . . . . . . . 8 (((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → 0 ∈ (0..^(#‘𝑊)))
41 elfzoelz 12296 . . . . . . . . . 10 (1 ∈ (0..^(#‘𝑊)) → 1 ∈ ℤ)
42 cshweqrep 13366 . . . . . . . . . 10 ((𝑊 ∈ Word 𝑉 ∧ 1 ∈ ℤ) → (((𝑊 cyclShift 1) = 𝑊 ∧ 0 ∈ (0..^(#‘𝑊))) → ∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊)))))
4341, 42sylan2 489 . . . . . . . . 9 ((𝑊 ∈ Word 𝑉 ∧ 1 ∈ (0..^(#‘𝑊))) → (((𝑊 cyclShift 1) = 𝑊 ∧ 0 ∈ (0..^(#‘𝑊))) → ∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊)))))
4443imp 443 . . . . . . . 8 (((𝑊 ∈ Word 𝑉 ∧ 1 ∈ (0..^(#‘𝑊))) ∧ ((𝑊 cyclShift 1) = 𝑊 ∧ 0 ∈ (0..^(#‘𝑊)))) → ∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))))
458, 29, 30, 40, 44syl22anc 1318 . . . . . . 7 (((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → ∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))))
46 0nn0 11156 . . . . . . . . 9 0 ∈ ℕ0
47 fzossnn0 12325 . . . . . . . . 9 (0 ∈ ℕ0 → (0..^(#‘𝑊)) ⊆ ℕ0)
48 ssralv 3628 . . . . . . . . 9 ((0..^(#‘𝑊)) ⊆ ℕ0 → (∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊)))))
4946, 47, 48mp2b 10 . . . . . . . 8 (∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))))
50 eqcom 2616 . . . . . . . . . 10 ((𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) ↔ (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) = (𝑊‘0))
51 elfzoelz 12296 . . . . . . . . . . . . . . . 16 (𝑖 ∈ (0..^(#‘𝑊)) → 𝑖 ∈ ℤ)
52 zre 11216 . . . . . . . . . . . . . . . . . . 19 (𝑖 ∈ ℤ → 𝑖 ∈ ℝ)
53 ax-1rid 9862 . . . . . . . . . . . . . . . . . . 19 (𝑖 ∈ ℝ → (𝑖 · 1) = 𝑖)
5452, 53syl 17 . . . . . . . . . . . . . . . . . 18 (𝑖 ∈ ℤ → (𝑖 · 1) = 𝑖)
5554oveq2d 6542 . . . . . . . . . . . . . . . . 17 (𝑖 ∈ ℤ → (0 + (𝑖 · 1)) = (0 + 𝑖))
56 zcn 11217 . . . . . . . . . . . . . . . . . 18 (𝑖 ∈ ℤ → 𝑖 ∈ ℂ)
5756addid2d 10088 . . . . . . . . . . . . . . . . 17 (𝑖 ∈ ℤ → (0 + 𝑖) = 𝑖)
5855, 57eqtrd 2643 . . . . . . . . . . . . . . . 16 (𝑖 ∈ ℤ → (0 + (𝑖 · 1)) = 𝑖)
5951, 58syl 17 . . . . . . . . . . . . . . 15 (𝑖 ∈ (0..^(#‘𝑊)) → (0 + (𝑖 · 1)) = 𝑖)
6059oveq1d 6541 . . . . . . . . . . . . . 14 (𝑖 ∈ (0..^(#‘𝑊)) → ((0 + (𝑖 · 1)) mod (#‘𝑊)) = (𝑖 mod (#‘𝑊)))
61 zmodidfzoimp 12519 . . . . . . . . . . . . . 14 (𝑖 ∈ (0..^(#‘𝑊)) → (𝑖 mod (#‘𝑊)) = 𝑖)
6260, 61eqtrd 2643 . . . . . . . . . . . . 13 (𝑖 ∈ (0..^(#‘𝑊)) → ((0 + (𝑖 · 1)) mod (#‘𝑊)) = 𝑖)
6362fveq2d 6091 . . . . . . . . . . . 12 (𝑖 ∈ (0..^(#‘𝑊)) → (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) = (𝑊𝑖))
6463eqeq1d 2611 . . . . . . . . . . 11 (𝑖 ∈ (0..^(#‘𝑊)) → ((𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) = (𝑊‘0) ↔ (𝑊𝑖) = (𝑊‘0)))
6564biimpd 217 . . . . . . . . . 10 (𝑖 ∈ (0..^(#‘𝑊)) → ((𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) = (𝑊‘0) → (𝑊𝑖) = (𝑊‘0)))
6650, 65syl5bi 230 . . . . . . . . 9 (𝑖 ∈ (0..^(#‘𝑊)) → ((𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) → (𝑊𝑖) = (𝑊‘0)))
6766ralimia 2933 . . . . . . . 8 (∀𝑖 ∈ (0..^(#‘𝑊))(𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
6849, 67syl 17 . . . . . . 7 (∀𝑖 ∈ ℕ0 (𝑊‘0) = (𝑊‘((0 + (𝑖 · 1)) mod (#‘𝑊))) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
6945, 68syl 17 . . . . . 6 (((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
7069ex 448 . . . . 5 ((¬ (#‘𝑊) = 0 ∧ ¬ (#‘𝑊) = 1) → ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
7170impancom 454 . . . 4 ((¬ (#‘𝑊) = 0 ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → (¬ (#‘𝑊) = 1 → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
72 eqid 2609 . . . . . 6 (𝑊‘0) = (𝑊‘0)
73 c0ex 9890 . . . . . . 7 0 ∈ V
74 fveq2 6087 . . . . . . . 8 (𝑖 = 0 → (𝑊𝑖) = (𝑊‘0))
7574eqeq1d 2611 . . . . . . 7 (𝑖 = 0 → ((𝑊𝑖) = (𝑊‘0) ↔ (𝑊‘0) = (𝑊‘0)))
7673, 75ralsn 4168 . . . . . 6 (∀𝑖 ∈ {0} (𝑊𝑖) = (𝑊‘0) ↔ (𝑊‘0) = (𝑊‘0))
7772, 76mpbir 219 . . . . 5 𝑖 ∈ {0} (𝑊𝑖) = (𝑊‘0)
78 oveq2 6534 . . . . . . 7 ((#‘𝑊) = 1 → (0..^(#‘𝑊)) = (0..^1))
79 fzo01 12374 . . . . . . 7 (0..^1) = {0}
8078, 79syl6eq 2659 . . . . . 6 ((#‘𝑊) = 1 → (0..^(#‘𝑊)) = {0})
8180raleqdv 3120 . . . . 5 ((#‘𝑊) = 1 → (∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0) ↔ ∀𝑖 ∈ {0} (𝑊𝑖) = (𝑊‘0)))
8277, 81mpbiri 246 . . . 4 ((#‘𝑊) = 1 → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
8371, 82pm2.61d2 170 . . 3 ((¬ (#‘𝑊) = 0 ∧ (𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊)) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
8483ex 448 . 2 (¬ (#‘𝑊) = 0 → ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
857, 84pm2.61i 174 1 ((𝑊 ∈ Word 𝑉 ∧ (𝑊 cyclShift 1) = 𝑊) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 194  wa 382   = wceq 1474  wcel 1976  wne 2779  wral 2895  wss 3539  c0 3873  {csn 4124   class class class wbr 4577  cfv 5789  (class class class)co 6526  cr 9791  0cc0 9792  1c1 9793   + caddc 9795   · cmul 9797   < clt 9930  cn 10869  0cn0 11141  cz 11212  ..^cfzo 12291   mod cmo 12487  #chash 12936  Word cword 13094   cyclShift ccsh 13333
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1712  ax-4 1727  ax-5 1826  ax-6 1874  ax-7 1921  ax-8 1978  ax-9 1985  ax-10 2005  ax-11 2020  ax-12 2033  ax-13 2233  ax-ext 2589  ax-rep 4693  ax-sep 4703  ax-nul 4711  ax-pow 4763  ax-pr 4827  ax-un 6824  ax-cnex 9848  ax-resscn 9849  ax-1cn 9850  ax-icn 9851  ax-addcl 9852  ax-addrcl 9853  ax-mulcl 9854  ax-mulrcl 9855  ax-mulcom 9856  ax-addass 9857  ax-mulass 9858  ax-distr 9859  ax-i2m1 9860  ax-1ne0 9861  ax-1rid 9862  ax-rnegex 9863  ax-rrecex 9864  ax-cnre 9865  ax-pre-lttri 9866  ax-pre-lttrn 9867  ax-pre-ltadd 9868  ax-pre-mulgt0 9869  ax-pre-sup 9870
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 1700  df-sb 1867  df-eu 2461  df-mo 2462  df-clab 2596  df-cleq 2602  df-clel 2605  df-nfc 2739  df-ne 2781  df-nel 2782  df-ral 2900  df-rex 2901  df-reu 2902  df-rmo 2903  df-rab 2904  df-v 3174  df-sbc 3402  df-csb 3499  df-dif 3542  df-un 3544  df-in 3546  df-ss 3553  df-pss 3555  df-nul 3874  df-if 4036  df-pw 4109  df-sn 4125  df-pr 4127  df-tp 4129  df-op 4131  df-uni 4367  df-int 4405  df-iun 4451  df-br 4578  df-opab 4638  df-mpt 4639  df-tr 4675  df-eprel 4938  df-id 4942  df-po 4948  df-so 4949  df-fr 4986  df-we 4988  df-xp 5033  df-rel 5034  df-cnv 5035  df-co 5036  df-dm 5037  df-rn 5038  df-res 5039  df-ima 5040  df-pred 5582  df-ord 5628  df-on 5629  df-lim 5630  df-suc 5631  df-iota 5753  df-fun 5791  df-fn 5792  df-f 5793  df-f1 5794  df-fo 5795  df-f1o 5796  df-fv 5797  df-riota 6488  df-ov 6529  df-oprab 6530  df-mpt2 6531  df-om 6935  df-1st 7036  df-2nd 7037  df-wrecs 7271  df-recs 7332  df-rdg 7370  df-1o 7424  df-oadd 7428  df-er 7606  df-en 7819  df-dom 7820  df-sdom 7821  df-fin 7822  df-sup 8208  df-inf 8209  df-card 8625  df-pnf 9932  df-mnf 9933  df-xr 9934  df-ltxr 9935  df-le 9936  df-sub 10119  df-neg 10120  df-div 10536  df-nn 10870  df-2 10928  df-n0 11142  df-z 11213  df-uz 11522  df-rp 11667  df-fz 12155  df-fzo 12292  df-fl 12412  df-mod 12488  df-hash 12937  df-word 13102  df-concat 13104  df-substr 13106  df-csh 13334
This theorem is referenced by:  cshw1repsw  13368
  Copyright terms: Public domain W3C validator