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

Theorem pfxlswccat 14627
Description: Reconstruct a nonempty word from its prefix and last symbol. (Contributed by Alexander van der Vekens, 5-Aug-2018.) (Revised by AV, 9-May-2020.)
Assertion
Ref Expression
pfxlswccat ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → ((𝑊 prefix ((♯‘𝑊) − 1)) ++ ⟨“(lastS‘𝑊)”⟩) = 𝑊)

Proof of Theorem pfxlswccat
StepHypRef Expression
1 swrdlsw 14582 . . . 4 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → (𝑊 substr ⟨((♯‘𝑊) − 1), (♯‘𝑊)⟩) = ⟨“(lastS‘𝑊)”⟩)
21eqcomd 2739 . . 3 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → ⟨“(lastS‘𝑊)”⟩ = (𝑊 substr ⟨((♯‘𝑊) − 1), (♯‘𝑊)⟩))
32oveq2d 7371 . 2 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → ((𝑊 prefix ((♯‘𝑊) − 1)) ++ ⟨“(lastS‘𝑊)”⟩) = ((𝑊 prefix ((♯‘𝑊) − 1)) ++ (𝑊 substr ⟨((♯‘𝑊) − 1), (♯‘𝑊)⟩)))
4 wrdfin 14446 . . . . 5 (𝑊 ∈ Word 𝑉𝑊 ∈ Fin)
5 1elfz0hash 14304 . . . . 5 ((𝑊 ∈ Fin ∧ 𝑊 ≠ ∅) → 1 ∈ (0...(♯‘𝑊)))
64, 5sylan 580 . . . 4 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → 1 ∈ (0...(♯‘𝑊)))
7 fznn0sub2 13542 . . . 4 (1 ∈ (0...(♯‘𝑊)) → ((♯‘𝑊) − 1) ∈ (0...(♯‘𝑊)))
86, 7syl 17 . . 3 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → ((♯‘𝑊) − 1) ∈ (0...(♯‘𝑊)))
9 pfxcctswrd 14624 . . 3 ((𝑊 ∈ Word 𝑉 ∧ ((♯‘𝑊) − 1) ∈ (0...(♯‘𝑊))) → ((𝑊 prefix ((♯‘𝑊) − 1)) ++ (𝑊 substr ⟨((♯‘𝑊) − 1), (♯‘𝑊)⟩)) = 𝑊)
108, 9syldan 591 . 2 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → ((𝑊 prefix ((♯‘𝑊) − 1)) ++ (𝑊 substr ⟨((♯‘𝑊) − 1), (♯‘𝑊)⟩)) = 𝑊)
113, 10eqtrd 2768 1 ((𝑊 ∈ Word 𝑉𝑊 ≠ ∅) → ((𝑊 prefix ((♯‘𝑊) − 1)) ++ ⟨“(lastS‘𝑊)”⟩) = 𝑊)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 395   = wceq 1541  wcel 2113  wne 2929  c0 4282  cop 4583  cfv 6489  (class class class)co 7355  Fincfn 8879  0cc0 11017  1c1 11018  cmin 11355  ...cfz 13414  chash 14244  Word cword 14427  lastSclsw 14476   ++ cconcat 14484  ⟨“cs1 14510   substr csubstr 14555   prefix cpfx 14585
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1796  ax-4 1810  ax-5 1911  ax-6 1968  ax-7 2009  ax-8 2115  ax-9 2123  ax-10 2146  ax-11 2162  ax-12 2182  ax-ext 2705  ax-rep 5221  ax-sep 5238  ax-nul 5248  ax-pow 5307  ax-pr 5374  ax-un 7677  ax-cnex 11073  ax-resscn 11074  ax-1cn 11075  ax-icn 11076  ax-addcl 11077  ax-addrcl 11078  ax-mulcl 11079  ax-mulrcl 11080  ax-mulcom 11081  ax-addass 11082  ax-mulass 11083  ax-distr 11084  ax-i2m1 11085  ax-1ne0 11086  ax-1rid 11087  ax-rnegex 11088  ax-rrecex 11089  ax-cnre 11090  ax-pre-lttri 11091  ax-pre-lttrn 11092  ax-pre-ltadd 11093  ax-pre-mulgt0 11094
This theorem depends on definitions:  df-bi 207  df-an 396  df-or 848  df-3or 1087  df-3an 1088  df-tru 1544  df-fal 1554  df-ex 1781  df-nf 1785  df-sb 2068  df-mo 2537  df-eu 2566  df-clab 2712  df-cleq 2725  df-clel 2808  df-nfc 2882  df-ne 2930  df-nel 3034  df-ral 3049  df-rex 3058  df-reu 3348  df-rab 3397  df-v 3439  df-sbc 3738  df-csb 3847  df-dif 3901  df-un 3903  df-in 3905  df-ss 3915  df-pss 3918  df-nul 4283  df-if 4477  df-pw 4553  df-sn 4578  df-pr 4580  df-op 4584  df-uni 4861  df-int 4900  df-iun 4945  df-br 5096  df-opab 5158  df-mpt 5177  df-tr 5203  df-id 5516  df-eprel 5521  df-po 5529  df-so 5530  df-fr 5574  df-we 5576  df-xp 5627  df-rel 5628  df-cnv 5629  df-co 5630  df-dm 5631  df-rn 5632  df-res 5633  df-ima 5634  df-pred 6256  df-ord 6317  df-on 6318  df-lim 6319  df-suc 6320  df-iota 6445  df-fun 6491  df-fn 6492  df-f 6493  df-f1 6494  df-fo 6495  df-f1o 6496  df-fv 6497  df-riota 7312  df-ov 7358  df-oprab 7359  df-mpo 7360  df-om 7806  df-1st 7930  df-2nd 7931  df-frecs 8220  df-wrecs 8251  df-recs 8300  df-rdg 8338  df-1o 8394  df-er 8631  df-en 8880  df-dom 8881  df-sdom 8882  df-fin 8883  df-card 9843  df-pnf 11159  df-mnf 11160  df-xr 11161  df-ltxr 11162  df-le 11163  df-sub 11357  df-neg 11358  df-nn 12137  df-n0 12393  df-xnn0 12466  df-z 12480  df-uz 12743  df-fz 13415  df-fzo 13562  df-hash 14245  df-word 14428  df-lsw 14477  df-concat 14485  df-s1 14511  df-substr 14556  df-pfx 14586
This theorem is referenced by:  ccats1pfxeq  14628  wrdind  14636  wrd2ind  14637  psgnunilem5  19414  wwlksnextwrd  29896  pfxlsw2ccat  32960  wrdpmtrlast  33103  iwrdsplit  34472  signsvtn0  34655  signstfveq0  34662
  Copyright terms: Public domain W3C validator