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

Theorem splcl 13296
Description: Closure of the substring replacement operator. (Contributed by Stefan O'Rear, 26-Aug-2015.)
Assertion
Ref Expression
splcl ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) ∈ Word 𝐴)

Proof of Theorem splcl
Dummy variables 𝑠 𝑏 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 elex 3180 . . . 4 (𝑆 ∈ Word 𝐴𝑆 ∈ V)
2 otex 4850 . . . 4 𝐹, 𝑇, 𝑅⟩ ∈ V
3 id 22 . . . . . . . 8 (𝑠 = 𝑆𝑠 = 𝑆)
4 fveq2 6084 . . . . . . . . . 10 (𝑏 = ⟨𝐹, 𝑇, 𝑅⟩ → (1st𝑏) = (1st ‘⟨𝐹, 𝑇, 𝑅⟩))
54fveq2d 6088 . . . . . . . . 9 (𝑏 = ⟨𝐹, 𝑇, 𝑅⟩ → (1st ‘(1st𝑏)) = (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)))
65opeq2d 4337 . . . . . . . 8 (𝑏 = ⟨𝐹, 𝑇, 𝑅⟩ → ⟨0, (1st ‘(1st𝑏))⟩ = ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩)
73, 6oveqan12d 6542 . . . . . . 7 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (𝑠 substr ⟨0, (1st ‘(1st𝑏))⟩) = (𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩))
8 simpr 475 . . . . . . . 8 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → 𝑏 = ⟨𝐹, 𝑇, 𝑅⟩)
98fveq2d 6088 . . . . . . 7 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (2nd𝑏) = (2nd ‘⟨𝐹, 𝑇, 𝑅⟩))
107, 9oveq12d 6541 . . . . . 6 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → ((𝑠 substr ⟨0, (1st ‘(1st𝑏))⟩) ++ (2nd𝑏)) = ((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)))
11 simpl 471 . . . . . . 7 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → 𝑠 = 𝑆)
128fveq2d 6088 . . . . . . . . 9 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (1st𝑏) = (1st ‘⟨𝐹, 𝑇, 𝑅⟩))
1312fveq2d 6088 . . . . . . . 8 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (2nd ‘(1st𝑏)) = (2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)))
1411fveq2d 6088 . . . . . . . 8 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (#‘𝑠) = (#‘𝑆))
1513, 14opeq12d 4338 . . . . . . 7 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → ⟨(2nd ‘(1st𝑏)), (#‘𝑠)⟩ = ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)
1611, 15oveq12d 6541 . . . . . 6 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (𝑠 substr ⟨(2nd ‘(1st𝑏)), (#‘𝑠)⟩) = (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩))
1710, 16oveq12d 6541 . . . . 5 ((𝑠 = 𝑆𝑏 = ⟨𝐹, 𝑇, 𝑅⟩) → (((𝑠 substr ⟨0, (1st ‘(1st𝑏))⟩) ++ (2nd𝑏)) ++ (𝑠 substr ⟨(2nd ‘(1st𝑏)), (#‘𝑠)⟩)) = (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)))
18 df-splice 13101 . . . . 5 splice = (𝑠 ∈ V, 𝑏 ∈ V ↦ (((𝑠 substr ⟨0, (1st ‘(1st𝑏))⟩) ++ (2nd𝑏)) ++ (𝑠 substr ⟨(2nd ‘(1st𝑏)), (#‘𝑠)⟩)))
19 ovex 6551 . . . . 5 (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)) ∈ V
2017, 18, 19ovmpt2a 6663 . . . 4 ((𝑆 ∈ V ∧ ⟨𝐹, 𝑇, 𝑅⟩ ∈ V) → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)))
211, 2, 20sylancl 692 . . 3 (𝑆 ∈ Word 𝐴 → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)))
2221adantr 479 . 2 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) = (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)))
23 swrdcl 13213 . . . . 5 (𝑆 ∈ Word 𝐴 → (𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ∈ Word 𝐴)
2423adantr 479 . . . 4 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ∈ Word 𝐴)
25 ot3rdg 7048 . . . . . 6 (𝑅 ∈ Word 𝐴 → (2nd ‘⟨𝐹, 𝑇, 𝑅⟩) = 𝑅)
2625adantl 480 . . . . 5 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (2nd ‘⟨𝐹, 𝑇, 𝑅⟩) = 𝑅)
27 simpr 475 . . . . 5 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → 𝑅 ∈ Word 𝐴)
2826, 27eqeltrd 2683 . . . 4 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (2nd ‘⟨𝐹, 𝑇, 𝑅⟩) ∈ Word 𝐴)
29 ccatcl 13154 . . . 4 (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ∈ Word 𝐴 ∧ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩) ∈ Word 𝐴) → ((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ∈ Word 𝐴)
3024, 28, 29syl2anc 690 . . 3 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → ((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ∈ Word 𝐴)
31 swrdcl 13213 . . . 4 (𝑆 ∈ Word 𝐴 → (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩) ∈ Word 𝐴)
3231adantr 479 . . 3 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩) ∈ Word 𝐴)
33 ccatcl 13154 . . 3 ((((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ∈ Word 𝐴 ∧ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩) ∈ Word 𝐴) → (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)) ∈ Word 𝐴)
3430, 32, 33syl2anc 690 . 2 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (((𝑆 substr ⟨0, (1st ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩))⟩) ++ (2nd ‘⟨𝐹, 𝑇, 𝑅⟩)) ++ (𝑆 substr ⟨(2nd ‘(1st ‘⟨𝐹, 𝑇, 𝑅⟩)), (#‘𝑆)⟩)) ∈ Word 𝐴)
3522, 34eqeltrd 2683 1 ((𝑆 ∈ Word 𝐴𝑅 ∈ Word 𝐴) → (𝑆 splice ⟨𝐹, 𝑇, 𝑅⟩) ∈ Word 𝐴)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1474  wcel 1975  Vcvv 3168  cop 4126  cotp 4128  cfv 5786  (class class class)co 6523  1st c1st 7030  2nd c2nd 7031  0cc0 9788  #chash 12930  Word cword 13088   ++ cconcat 13090   substr csubstr 13092   splice csplice 13093
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1711  ax-4 1726  ax-5 1825  ax-6 1873  ax-7 1920  ax-8 1977  ax-9 1984  ax-10 2004  ax-11 2019  ax-12 2031  ax-13 2228  ax-ext 2585  ax-rep 4689  ax-sep 4699  ax-nul 4708  ax-pow 4760  ax-pr 4824  ax-un 6820  ax-cnex 9844  ax-resscn 9845  ax-1cn 9846  ax-icn 9847  ax-addcl 9848  ax-addrcl 9849  ax-mulcl 9850  ax-mulrcl 9851  ax-mulcom 9852  ax-addass 9853  ax-mulass 9854  ax-distr 9855  ax-i2m1 9856  ax-1ne0 9857  ax-1rid 9858  ax-rnegex 9859  ax-rrecex 9860  ax-cnre 9861  ax-pre-lttri 9862  ax-pre-lttrn 9863  ax-pre-ltadd 9864  ax-pre-mulgt0 9865
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 1866  df-eu 2457  df-mo 2458  df-clab 2592  df-cleq 2598  df-clel 2601  df-nfc 2735  df-ne 2777  df-nel 2778  df-ral 2896  df-rex 2897  df-reu 2898  df-rab 2900  df-v 3170  df-sbc 3398  df-csb 3495  df-dif 3538  df-un 3540  df-in 3542  df-ss 3549  df-pss 3551  df-nul 3870  df-if 4032  df-pw 4105  df-sn 4121  df-pr 4123  df-tp 4125  df-op 4127  df-ot 4129  df-uni 4363  df-int 4401  df-iun 4447  df-br 4574  df-opab 4634  df-mpt 4635  df-tr 4671  df-eprel 4935  df-id 4939  df-po 4945  df-so 4946  df-fr 4983  df-we 4985  df-xp 5030  df-rel 5031  df-cnv 5032  df-co 5033  df-dm 5034  df-rn 5035  df-res 5036  df-ima 5037  df-pred 5579  df-ord 5625  df-on 5626  df-lim 5627  df-suc 5628  df-iota 5750  df-fun 5788  df-fn 5789  df-f 5790  df-f1 5791  df-fo 5792  df-f1o 5793  df-fv 5794  df-riota 6485  df-ov 6526  df-oprab 6527  df-mpt2 6528  df-om 6931  df-1st 7032  df-2nd 7033  df-wrecs 7267  df-recs 7328  df-rdg 7366  df-1o 7420  df-oadd 7424  df-er 7602  df-en 7815  df-dom 7816  df-sdom 7817  df-fin 7818  df-card 8621  df-pnf 9928  df-mnf 9929  df-xr 9930  df-ltxr 9931  df-le 9932  df-sub 10115  df-neg 10116  df-nn 10864  df-n0 11136  df-z 11207  df-uz 11516  df-fz 12149  df-fzo 12286  df-hash 12931  df-word 13096  df-concat 13098  df-substr 13100  df-splice 13101
This theorem is referenced by:  psgnunilem2  17680  efglem  17894  efgtf  17900  frgpuplem  17950
  Copyright terms: Public domain W3C validator