Metamath Proof Explorer


Theorem splcl

Description: Closure of the substring replacement operator. (Contributed by Stefan O'Rear, 26-Aug-2015) (Proof shortened by AV, 15-Oct-2022)

Ref Expression
Assertion splcl S Word A R Word A S splice F T R Word A

Proof

Step Hyp Ref Expression
1 elex S Word A S V
2 otex F T R V
3 id s = S s = S
4 2fveq3 b = F T R 1 st 1 st b = 1 st 1 st F T R
5 3 4 oveqan12d s = S b = F T R s prefix 1 st 1 st b = S prefix 1 st 1 st F T R
6 simpr s = S b = F T R b = F T R
7 6 fveq2d s = S b = F T R 2 nd b = 2 nd F T R
8 5 7 oveq12d s = S b = F T R s prefix 1 st 1 st b ++ 2 nd b = S prefix 1 st 1 st F T R ++ 2 nd F T R
9 simpl s = S b = F T R s = S
10 6 fveq2d s = S b = F T R 1 st b = 1 st F T R
11 10 fveq2d s = S b = F T R 2 nd 1 st b = 2 nd 1 st F T R
12 9 fveq2d s = S b = F T R s = S
13 11 12 opeq12d s = S b = F T R 2 nd 1 st b s = 2 nd 1 st F T R S
14 9 13 oveq12d s = S b = F T R s substr 2 nd 1 st b s = S substr 2 nd 1 st F T R S
15 8 14 oveq12d s = S b = F T R s prefix 1 st 1 st b ++ 2 nd b ++ s substr 2 nd 1 st b s = S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S
16 df-splice splice = s V , b V s prefix 1 st 1 st b ++ 2 nd b ++ s substr 2 nd 1 st b s
17 ovex S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S V
18 15 16 17 ovmpoa S V F T R V S splice F T R = S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S
19 1 2 18 sylancl S Word A S splice F T R = S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S
20 19 adantr S Word A R Word A S splice F T R = S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S
21 pfxcl S Word A S prefix 1 st 1 st F T R Word A
22 21 adantr S Word A R Word A S prefix 1 st 1 st F T R Word A
23 ot3rdg R Word A 2 nd F T R = R
24 23 adantl S Word A R Word A 2 nd F T R = R
25 simpr S Word A R Word A R Word A
26 24 25 eqeltrd S Word A R Word A 2 nd F T R Word A
27 ccatcl S prefix 1 st 1 st F T R Word A 2 nd F T R Word A S prefix 1 st 1 st F T R ++ 2 nd F T R Word A
28 22 26 27 syl2anc S Word A R Word A S prefix 1 st 1 st F T R ++ 2 nd F T R Word A
29 swrdcl S Word A S substr 2 nd 1 st F T R S Word A
30 29 adantr S Word A R Word A S substr 2 nd 1 st F T R S Word A
31 ccatcl S prefix 1 st 1 st F T R ++ 2 nd F T R Word A S substr 2 nd 1 st F T R S Word A S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S Word A
32 28 30 31 syl2anc S Word A R Word A S prefix 1 st 1 st F T R ++ 2 nd F T R ++ S substr 2 nd 1 st F T R S Word A
33 20 32 eqeltrd S Word A R Word A S splice F T R Word A