Metamath Proof Explorer


Theorem pfxmpt

Description: Value of the prefix extractor as a mapping. (Contributed by AV, 2-May-2020)

Ref Expression
Assertion pfxmpt S Word A L 0 S S prefix L = x 0 ..^ L S x

Proof

Step Hyp Ref Expression
1 elfznn0 L 0 S L 0
2 pfxval S Word A L 0 S prefix L = S substr 0 L
3 1 2 sylan2 S Word A L 0 S S prefix L = S substr 0 L
4 simpl S Word A L 0 S S Word A
5 1 adantl S Word A L 0 S L 0
6 0elfz L 0 0 0 L
7 5 6 syl S Word A L 0 S 0 0 L
8 simpr S Word A L 0 S L 0 S
9 swrdval2 S Word A 0 0 L L 0 S S substr 0 L = x 0 ..^ L 0 S x + 0
10 4 7 8 9 syl3anc S Word A L 0 S S substr 0 L = x 0 ..^ L 0 S x + 0
11 nn0cn L 0 L
12 11 subid1d L 0 L 0 = L
13 1 12 syl L 0 S L 0 = L
14 13 oveq2d L 0 S 0 ..^ L 0 = 0 ..^ L
15 14 adantl S Word A L 0 S 0 ..^ L 0 = 0 ..^ L
16 elfzonn0 x 0 ..^ L 0 x 0
17 nn0cn x 0 x
18 17 addid1d x 0 x + 0 = x
19 16 18 syl x 0 ..^ L 0 x + 0 = x
20 19 fveq2d x 0 ..^ L 0 S x + 0 = S x
21 20 adantl S Word A L 0 S x 0 ..^ L 0 S x + 0 = S x
22 15 21 mpteq12dva S Word A L 0 S x 0 ..^ L 0 S x + 0 = x 0 ..^ L S x
23 3 10 22 3eqtrd S Word A L 0 S S prefix L = x 0 ..^ L S x