Metamath Proof Explorer


Theorem swrdpfx

Description: A subword of a prefix is a subword. (Contributed by Alexander van der Vekens, 6-Apr-2018) (Revised by AV, 8-May-2020)

Ref Expression
Assertion swrdpfx W Word V N 0 W K 0 N L K N W prefix N substr K L = W substr K L

Proof

Step Hyp Ref Expression
1 elfznn0 N 0 W N 0
2 1 anim2i W Word V N 0 W W Word V N 0
3 2 adantr W Word V N 0 W K 0 N L K N W Word V N 0
4 pfxval W Word V N 0 W prefix N = W substr 0 N
5 3 4 syl W Word V N 0 W K 0 N L K N W prefix N = W substr 0 N
6 5 oveq1d W Word V N 0 W K 0 N L K N W prefix N substr K L = W substr 0 N substr K L
7 simpl W Word V N 0 W W Word V
8 simpr W Word V N 0 W N 0 W
9 0elfz N 0 0 0 N
10 1 9 syl N 0 W 0 0 N
11 10 adantl W Word V N 0 W 0 0 N
12 7 8 11 3jca W Word V N 0 W W Word V N 0 W 0 0 N
13 12 adantr W Word V N 0 W K 0 N L K N W Word V N 0 W 0 0 N
14 elfzelz N 0 W N
15 zcn N N
16 15 subid1d N N 0 = N
17 16 eqcomd N N = N 0
18 14 17 syl N 0 W N = N 0
19 18 adantl W Word V N 0 W N = N 0
20 19 oveq2d W Word V N 0 W 0 N = 0 N 0
21 20 eleq2d W Word V N 0 W K 0 N K 0 N 0
22 19 oveq2d W Word V N 0 W K N = K N 0
23 22 eleq2d W Word V N 0 W L K N L K N 0
24 21 23 anbi12d W Word V N 0 W K 0 N L K N K 0 N 0 L K N 0
25 24 biimpa W Word V N 0 W K 0 N L K N K 0 N 0 L K N 0
26 swrdswrd W Word V N 0 W 0 0 N K 0 N 0 L K N 0 W substr 0 N substr K L = W substr 0 + K 0 + L
27 13 25 26 sylc W Word V N 0 W K 0 N L K N W substr 0 N substr K L = W substr 0 + K 0 + L
28 elfzelz K 0 N K
29 28 zcnd K 0 N K
30 29 adantr K 0 N L K N K
31 30 adantl W Word V N 0 W K 0 N L K N K
32 31 addid2d W Word V N 0 W K 0 N L K N 0 + K = K
33 elfzelz L K N L
34 33 zcnd L K N L
35 34 adantl K 0 N L K N L
36 35 adantl W Word V N 0 W K 0 N L K N L
37 36 addid2d W Word V N 0 W K 0 N L K N 0 + L = L
38 32 37 opeq12d W Word V N 0 W K 0 N L K N 0 + K 0 + L = K L
39 38 oveq2d W Word V N 0 W K 0 N L K N W substr 0 + K 0 + L = W substr K L
40 6 27 39 3eqtrd W Word V N 0 W K 0 N L K N W prefix N substr K L = W substr K L
41 40 ex W Word V N 0 W K 0 N L K N W prefix N substr K L = W substr K L