Metamath Proof Explorer


Theorem swrdrevpfx

Description: A subword expressed in terms of reverses and prefixes. (Contributed by BTernaryTau, 3-Dec-2023)

Ref Expression
Assertion swrdrevpfx W Word V F 0 L L 0 W W substr F L = reverse reverse W prefix L prefix L F

Proof

Step Hyp Ref Expression
1 fznn0sub2 F 0 L L F 0 L
2 pfxcl W Word V W prefix L Word V
3 revcl W prefix L Word V reverse W prefix L Word V
4 2 3 syl W Word V reverse W prefix L Word V
5 4 3ad2ant1 W Word V L 0 W L F 0 L reverse W prefix L Word V
6 simp3 W Word V L 0 W L F 0 L L F 0 L
7 revlen W prefix L Word V reverse W prefix L = W prefix L
8 2 7 syl W Word V reverse W prefix L = W prefix L
9 8 adantr W Word V L 0 W reverse W prefix L = W prefix L
10 pfxlen W Word V L 0 W W prefix L = L
11 9 10 eqtrd W Word V L 0 W reverse W prefix L = L
12 11 3adant3 W Word V L 0 W L F 0 L reverse W prefix L = L
13 12 oveq2d W Word V L 0 W L F 0 L 0 reverse W prefix L = 0 L
14 6 13 eleqtrrd W Word V L 0 W L F 0 L L F 0 reverse W prefix L
15 5 14 jca W Word V L 0 W L F 0 L reverse W prefix L Word V L F 0 reverse W prefix L
16 1 15 syl3an3 W Word V L 0 W F 0 L reverse W prefix L Word V L F 0 reverse W prefix L
17 16 3com23 W Word V F 0 L L 0 W reverse W prefix L Word V L F 0 reverse W prefix L
18 revpfxsfxrev reverse W prefix L Word V L F 0 reverse W prefix L reverse reverse W prefix L prefix L F = reverse reverse W prefix L substr reverse W prefix L L F reverse W prefix L
19 17 18 syl W Word V F 0 L L 0 W reverse reverse W prefix L prefix L F = reverse reverse W prefix L substr reverse W prefix L L F reverse W prefix L
20 revrev W prefix L Word V reverse reverse W prefix L = W prefix L
21 2 20 syl W Word V reverse reverse W prefix L = W prefix L
22 21 oveq1d W Word V reverse reverse W prefix L substr reverse W prefix L L F reverse W prefix L = W prefix L substr reverse W prefix L L F reverse W prefix L
23 22 3ad2ant1 W Word V F 0 L L 0 W reverse reverse W prefix L substr reverse W prefix L L F reverse W prefix L = W prefix L substr reverse W prefix L L F reverse W prefix L
24 11 oveq1d W Word V L 0 W reverse W prefix L L F = L L F
25 24 3adant2 W Word V F 0 L L 0 W reverse W prefix L L F = L L F
26 elfzel2 F 0 L L
27 26 zcnd F 0 L L
28 elfzelz F 0 L F
29 28 zcnd F 0 L F
30 27 29 nncand F 0 L L L F = F
31 30 3ad2ant2 W Word V F 0 L L 0 W L L F = F
32 25 31 eqtrd W Word V F 0 L L 0 W reverse W prefix L L F = F
33 11 3adant2 W Word V F 0 L L 0 W reverse W prefix L = L
34 32 33 opeq12d W Word V F 0 L L 0 W reverse W prefix L L F reverse W prefix L = F L
35 34 oveq2d W Word V F 0 L L 0 W W prefix L substr reverse W prefix L L F reverse W prefix L = W prefix L substr F L
36 19 23 35 3eqtrd W Word V F 0 L L 0 W reverse reverse W prefix L prefix L F = W prefix L substr F L
37 elfzuz3 F 0 L L F
38 eluzfz2 L F L F L
39 37 38 syl F 0 L L F L
40 39 ancli F 0 L F 0 L L F L
41 40 3ad2ant2 W Word V F 0 L L 0 W F 0 L L F L
42 swrdpfx W Word V L 0 W F 0 L L F L W prefix L substr F L = W substr F L
43 41 42 syl5 W Word V L 0 W W Word V F 0 L L 0 W W prefix L substr F L = W substr F L
44 43 3adant2 W Word V F 0 L L 0 W W Word V F 0 L L 0 W W prefix L substr F L = W substr F L
45 44 pm2.43i W Word V F 0 L L 0 W W prefix L substr F L = W substr F L
46 36 45 eqtr2d W Word V F 0 L L 0 W W substr F L = reverse reverse W prefix L prefix L F