Metamath Proof Explorer


Theorem splfv2a

Description: Symbols within the replacement region of a splice, expressed using the coordinates of the replacement region. (Contributed by Stefan O'Rear, 23-Aug-2015) (Proof shortened by AV, 15-Oct-2022)

Ref Expression
Hypotheses spllen.s φ S Word A
spllen.f φ F 0 T
spllen.t φ T 0 S
spllen.r φ R Word A
splfv2a.x φ X 0 ..^ R
Assertion splfv2a φ S splice F T R F + X = R X

Proof

Step Hyp Ref Expression
1 spllen.s φ S Word A
2 spllen.f φ F 0 T
3 spllen.t φ T 0 S
4 spllen.r φ R Word A
5 splfv2a.x φ X 0 ..^ R
6 splval S Word A F 0 T T 0 S R Word A S splice F T R = S prefix F ++ R ++ S substr T S
7 1 2 3 4 6 syl13anc φ S splice F T R = S prefix F ++ R ++ S substr T S
8 elfznn0 F 0 T F 0
9 2 8 syl φ F 0
10 9 nn0cnd φ F
11 elfzonn0 X 0 ..^ R X 0
12 5 11 syl φ X 0
13 12 nn0cnd φ X
14 10 13 addcomd φ F + X = X + F
15 nn0uz 0 = 0
16 9 15 eleqtrdi φ F 0
17 elfzuz3 T 0 S S T
18 3 17 syl φ S T
19 elfzuz3 F 0 T T F
20 2 19 syl φ T F
21 uztrn S T T F S F
22 18 20 21 syl2anc φ S F
23 elfzuzb F 0 S F 0 S F
24 16 22 23 sylanbrc φ F 0 S
25 pfxlen S Word A F 0 S S prefix F = F
26 1 24 25 syl2anc φ S prefix F = F
27 26 oveq2d φ X + S prefix F = X + F
28 14 27 eqtr4d φ F + X = X + S prefix F
29 7 28 fveq12d φ S splice F T R F + X = S prefix F ++ R ++ S substr T S X + S prefix F
30 pfxcl S Word A S prefix F Word A
31 1 30 syl φ S prefix F Word A
32 ccatcl S prefix F Word A R Word A S prefix F ++ R Word A
33 31 4 32 syl2anc φ S prefix F ++ R Word A
34 swrdcl S Word A S substr T S Word A
35 1 34 syl φ S substr T S Word A
36 0nn0 0 0
37 nn0addcl 0 0 F 0 0 + F 0
38 36 9 37 sylancr φ 0 + F 0
39 fzoss1 0 + F 0 0 + F ..^ R + F 0 ..^ R + F
40 39 15 eleq2s 0 + F 0 0 + F ..^ R + F 0 ..^ R + F
41 38 40 syl φ 0 + F ..^ R + F 0 ..^ R + F
42 ccatlen S prefix F Word A R Word A S prefix F ++ R = S prefix F + R
43 31 4 42 syl2anc φ S prefix F ++ R = S prefix F + R
44 26 oveq1d φ S prefix F + R = F + R
45 lencl R Word A R 0
46 4 45 syl φ R 0
47 46 nn0cnd φ R
48 10 47 addcomd φ F + R = R + F
49 43 44 48 3eqtrd φ S prefix F ++ R = R + F
50 49 oveq2d φ 0 ..^ S prefix F ++ R = 0 ..^ R + F
51 41 50 sseqtrrd φ 0 + F ..^ R + F 0 ..^ S prefix F ++ R
52 9 nn0zd φ F
53 fzoaddel X 0 ..^ R F X + F 0 + F ..^ R + F
54 5 52 53 syl2anc φ X + F 0 + F ..^ R + F
55 51 54 sseldd φ X + F 0 ..^ S prefix F ++ R
56 27 55 eqeltrd φ X + S prefix F 0 ..^ S prefix F ++ R
57 ccatval1 S prefix F ++ R Word A S substr T S Word A X + S prefix F 0 ..^ S prefix F ++ R S prefix F ++ R ++ S substr T S X + S prefix F = S prefix F ++ R X + S prefix F
58 33 35 56 57 syl3anc φ S prefix F ++ R ++ S substr T S X + S prefix F = S prefix F ++ R X + S prefix F
59 ccatval3 S prefix F Word A R Word A X 0 ..^ R S prefix F ++ R X + S prefix F = R X
60 31 4 5 59 syl3anc φ S prefix F ++ R X + S prefix F = R X
61 29 58 60 3eqtrd φ S splice F T R F + X = R X