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

Theorem repswsymballbi 13327
Description: A word is a "repeated symbol word" iff each of its symbols equals the first symbol of the word. (Contributed by AV, 10-Nov-2018.)
Assertion
Ref Expression
repswsymballbi (𝑊 ∈ Word 𝑉 → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
Distinct variable group:   𝑖,𝑊
Allowed substitution hint:   𝑉(𝑖)

Proof of Theorem repswsymballbi
StepHypRef Expression
1 fveq2 6088 . . . . 5 (𝑊 = ∅ → (#‘𝑊) = (#‘∅))
2 hash0 12974 . . . . 5 (#‘∅) = 0
31, 2syl6eq 2659 . . . 4 (𝑊 = ∅ → (#‘𝑊) = 0)
4 fvex 6098 . . . . . . . 8 (𝑊‘0) ∈ V
5 repsw0 13324 . . . . . . . 8 ((𝑊‘0) ∈ V → ((𝑊‘0) repeatS 0) = ∅)
64, 5ax-mp 5 . . . . . . 7 ((𝑊‘0) repeatS 0) = ∅
76eqcomi 2618 . . . . . 6 ∅ = ((𝑊‘0) repeatS 0)
8 simpr 475 . . . . . 6 (((#‘𝑊) = 0 ∧ 𝑊 = ∅) → 𝑊 = ∅)
9 oveq2 6535 . . . . . . 7 ((#‘𝑊) = 0 → ((𝑊‘0) repeatS (#‘𝑊)) = ((𝑊‘0) repeatS 0))
109adantr 479 . . . . . 6 (((#‘𝑊) = 0 ∧ 𝑊 = ∅) → ((𝑊‘0) repeatS (#‘𝑊)) = ((𝑊‘0) repeatS 0))
117, 8, 103eqtr4a 2669 . . . . 5 (((#‘𝑊) = 0 ∧ 𝑊 = ∅) → 𝑊 = ((𝑊‘0) repeatS (#‘𝑊)))
12 ral0 4027 . . . . . . 7 𝑖 ∈ ∅ (𝑊𝑖) = (𝑊‘0)
13 oveq2 6535 . . . . . . . . 9 ((#‘𝑊) = 0 → (0..^(#‘𝑊)) = (0..^0))
14 fzo0 12319 . . . . . . . . 9 (0..^0) = ∅
1513, 14syl6eq 2659 . . . . . . . 8 ((#‘𝑊) = 0 → (0..^(#‘𝑊)) = ∅)
1615raleqdv 3120 . . . . . . 7 ((#‘𝑊) = 0 → (∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0) ↔ ∀𝑖 ∈ ∅ (𝑊𝑖) = (𝑊‘0)))
1712, 16mpbiri 246 . . . . . 6 ((#‘𝑊) = 0 → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
1817adantr 479 . . . . 5 (((#‘𝑊) = 0 ∧ 𝑊 = ∅) → ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))
1911, 182thd 253 . . . 4 (((#‘𝑊) = 0 ∧ 𝑊 = ∅) → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
203, 19mpancom 699 . . 3 (𝑊 = ∅ → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
2120a1d 25 . 2 (𝑊 = ∅ → (𝑊 ∈ Word 𝑉 → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))))
22 df-3an 1032 . . . . 5 ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)) ↔ ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊)) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
2322a1i 11 . . . 4 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)) ↔ ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊)) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))))
24 fstwrdne 13148 . . . . . 6 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → (𝑊‘0) ∈ 𝑉)
2524ancoms 467 . . . . 5 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (𝑊‘0) ∈ 𝑉)
26 lencl 13128 . . . . . 6 (𝑊 ∈ Word 𝑉 → (#‘𝑊) ∈ ℕ0)
2726adantl 480 . . . . 5 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (#‘𝑊) ∈ ℕ0)
28 repsdf2 13325 . . . . 5 (((𝑊‘0) ∈ 𝑉 ∧ (#‘𝑊) ∈ ℕ0) → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ (𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))))
2925, 27, 28syl2anc 690 . . . 4 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ (𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))))
30 simpr 475 . . . . . 6 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → 𝑊 ∈ Word 𝑉)
31 eqidd 2610 . . . . . 6 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (#‘𝑊) = (#‘𝑊))
3230, 31jca 552 . . . . 5 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊)))
3332biantrurd 527 . . . 4 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0) ↔ ((𝑊 ∈ Word 𝑉 ∧ (#‘𝑊) = (#‘𝑊)) ∧ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))))
3423, 29, 333bitr4d 298 . . 3 ((𝑊 ≠ ∅ ∧ 𝑊 ∈ Word 𝑉) → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
3534ex 448 . 2 (𝑊 ≠ ∅ → (𝑊 ∈ Word 𝑉 → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0))))
3621, 35pm2.61ine 2864 1 (𝑊 ∈ Word 𝑉 → (𝑊 = ((𝑊‘0) repeatS (#‘𝑊)) ↔ ∀𝑖 ∈ (0..^(#‘𝑊))(𝑊𝑖) = (𝑊‘0)))
Colors of variables: wff setvar class
Syntax hints:  wi 4  wb 194  wa 382  w3a 1030   = wceq 1474  wcel 1976  wne 2779  wral 2895  Vcvv 3172  c0 3873  cfv 5790  (class class class)co 6527  0cc0 9793  0cn0 11142  ..^cfzo 12292  #chash 12937  Word cword 13095   repeatS creps 13102
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 4712  ax-pow 4764  ax-pr 4828  ax-un 6825  ax-cnex 9849  ax-resscn 9850  ax-1cn 9851  ax-icn 9852  ax-addcl 9853  ax-addrcl 9854  ax-mulcl 9855  ax-mulrcl 9856  ax-mulcom 9857  ax-addass 9858  ax-mulass 9859  ax-distr 9860  ax-i2m1 9861  ax-1ne0 9862  ax-1rid 9863  ax-rnegex 9864  ax-rrecex 9865  ax-cnre 9866  ax-pre-lttri 9867  ax-pre-lttrn 9868  ax-pre-ltadd 9869  ax-pre-mulgt0 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-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 4939  df-id 4943  df-po 4949  df-so 4950  df-fr 4987  df-we 4989  df-xp 5034  df-rel 5035  df-cnv 5036  df-co 5037  df-dm 5038  df-rn 5039  df-res 5040  df-ima 5041  df-pred 5583  df-ord 5629  df-on 5630  df-lim 5631  df-suc 5632  df-iota 5754  df-fun 5792  df-fn 5793  df-f 5794  df-f1 5795  df-fo 5796  df-f1o 5797  df-fv 5798  df-riota 6489  df-ov 6530  df-oprab 6531  df-mpt2 6532  df-om 6936  df-1st 7037  df-2nd 7038  df-wrecs 7272  df-recs 7333  df-rdg 7371  df-1o 7425  df-oadd 7429  df-er 7607  df-en 7820  df-dom 7821  df-sdom 7822  df-fin 7823  df-card 8626  df-pnf 9933  df-mnf 9934  df-xr 9935  df-ltxr 9936  df-le 9937  df-sub 10120  df-neg 10121  df-nn 10871  df-n0 11143  df-z 11214  df-uz 11523  df-fz 12156  df-fzo 12293  df-hash 12938  df-word 13103  df-reps 13110
This theorem is referenced by:  cshw1repsw  13369  cshwsidrepsw  15587  cshwshashlem1  15589  cshwshash  15598
  Copyright terms: Public domain W3C validator