Metamath Proof Explorer


Theorem swrdval

Description: Value of a subword. (Contributed by Stefan O'Rear, 15-Aug-2015)

Ref Expression
Assertion swrdval S V F L S substr F L = if F ..^ L dom S x 0 ..^ L F S x + F

Proof

Step Hyp Ref Expression
1 df-substr substr = s V , b × if 1 st b ..^ 2 nd b dom s x 0 ..^ 2 nd b 1 st b s x + 1 st b
2 1 a1i S V F L substr = s V , b × if 1 st b ..^ 2 nd b dom s x 0 ..^ 2 nd b 1 st b s x + 1 st b
3 simprl S V F L s = S b = F L s = S
4 fveq2 b = F L 1 st b = 1 st F L
5 4 adantl s = S b = F L 1 st b = 1 st F L
6 op1stg F L 1 st F L = F
7 6 3adant1 S V F L 1 st F L = F
8 5 7 sylan9eqr S V F L s = S b = F L 1 st b = F
9 fveq2 b = F L 2 nd b = 2 nd F L
10 9 adantl s = S b = F L 2 nd b = 2 nd F L
11 op2ndg F L 2 nd F L = L
12 11 3adant1 S V F L 2 nd F L = L
13 10 12 sylan9eqr S V F L s = S b = F L 2 nd b = L
14 simp2 s = S 1 st b = F 2 nd b = L 1 st b = F
15 simp3 s = S 1 st b = F 2 nd b = L 2 nd b = L
16 14 15 oveq12d s = S 1 st b = F 2 nd b = L 1 st b ..^ 2 nd b = F ..^ L
17 simp1 s = S 1 st b = F 2 nd b = L s = S
18 17 dmeqd s = S 1 st b = F 2 nd b = L dom s = dom S
19 16 18 sseq12d s = S 1 st b = F 2 nd b = L 1 st b ..^ 2 nd b dom s F ..^ L dom S
20 15 14 oveq12d s = S 1 st b = F 2 nd b = L 2 nd b 1 st b = L F
21 20 oveq2d s = S 1 st b = F 2 nd b = L 0 ..^ 2 nd b 1 st b = 0 ..^ L F
22 14 oveq2d s = S 1 st b = F 2 nd b = L x + 1 st b = x + F
23 17 22 fveq12d s = S 1 st b = F 2 nd b = L s x + 1 st b = S x + F
24 21 23 mpteq12dv s = S 1 st b = F 2 nd b = L x 0 ..^ 2 nd b 1 st b s x + 1 st b = x 0 ..^ L F S x + F
25 19 24 ifbieq1d s = S 1 st b = F 2 nd b = L if 1 st b ..^ 2 nd b dom s x 0 ..^ 2 nd b 1 st b s x + 1 st b = if F ..^ L dom S x 0 ..^ L F S x + F
26 3 8 13 25 syl3anc S V F L s = S b = F L if 1 st b ..^ 2 nd b dom s x 0 ..^ 2 nd b 1 st b s x + 1 st b = if F ..^ L dom S x 0 ..^ L F S x + F
27 elex S V S V
28 27 3ad2ant1 S V F L S V
29 opelxpi F L F L ×
30 29 3adant1 S V F L F L ×
31 ovex 0 ..^ L F V
32 31 mptex x 0 ..^ L F S x + F V
33 0ex V
34 32 33 ifex if F ..^ L dom S x 0 ..^ L F S x + F V
35 34 a1i S V F L if F ..^ L dom S x 0 ..^ L F S x + F V
36 2 26 28 30 35 ovmpod S V F L S substr F L = if F ..^ L dom S x 0 ..^ L F S x + F