Metamath Proof Explorer


Theorem swrdco

Description: Mapping of words commutes with the substring operation. (Contributed by AV, 11-Nov-2018)

Ref Expression
Assertion swrdco W Word A M 0 N N 0 W F : A B F W substr M N = F W substr M N

Proof

Step Hyp Ref Expression
1 ffn F : A B F Fn A
2 1 3ad2ant3 W Word A M 0 N N 0 W F : A B F Fn A
3 swrdvalfn W Word A M 0 N N 0 W W substr M N Fn 0 ..^ N M
4 3 3expb W Word A M 0 N N 0 W W substr M N Fn 0 ..^ N M
5 4 3adant3 W Word A M 0 N N 0 W F : A B W substr M N Fn 0 ..^ N M
6 swrdrn W Word A M 0 N N 0 W ran W substr M N A
7 6 3expb W Word A M 0 N N 0 W ran W substr M N A
8 7 3adant3 W Word A M 0 N N 0 W F : A B ran W substr M N A
9 fnco F Fn A W substr M N Fn 0 ..^ N M ran W substr M N A F W substr M N Fn 0 ..^ N M
10 2 5 8 9 syl3anc W Word A M 0 N N 0 W F : A B F W substr M N Fn 0 ..^ N M
11 wrdco W Word A F : A B F W Word B
12 11 3adant2 W Word A M 0 N N 0 W F : A B F W Word B
13 simp2l W Word A M 0 N N 0 W F : A B M 0 N
14 lenco W Word A F : A B F W = W
15 14 eqcomd W Word A F : A B W = F W
16 15 oveq2d W Word A F : A B 0 W = 0 F W
17 16 eleq2d W Word A F : A B N 0 W N 0 F W
18 17 biimpd W Word A F : A B N 0 W N 0 F W
19 18 expcom F : A B W Word A N 0 W N 0 F W
20 19 com13 N 0 W W Word A F : A B N 0 F W
21 20 adantl M 0 N N 0 W W Word A F : A B N 0 F W
22 21 3imp21 W Word A M 0 N N 0 W F : A B N 0 F W
23 swrdvalfn F W Word B M 0 N N 0 F W F W substr M N Fn 0 ..^ N M
24 12 13 22 23 syl3anc W Word A M 0 N N 0 W F : A B F W substr M N Fn 0 ..^ N M
25 3anass W Word A M 0 N N 0 W W Word A M 0 N N 0 W
26 25 biimpri W Word A M 0 N N 0 W W Word A M 0 N N 0 W
27 26 3adant3 W Word A M 0 N N 0 W F : A B W Word A M 0 N N 0 W
28 swrdfv W Word A M 0 N N 0 W i 0 ..^ N M W substr M N i = W i + M
29 28 fveq2d W Word A M 0 N N 0 W i 0 ..^ N M F W substr M N i = F W i + M
30 27 29 sylan W Word A M 0 N N 0 W F : A B i 0 ..^ N M F W substr M N i = F W i + M
31 wrdfn W Word A W Fn 0 ..^ W
32 31 3ad2ant1 W Word A M 0 N N 0 W F : A B W Fn 0 ..^ W
33 elfzodifsumelfzo M 0 N N 0 W i 0 ..^ N M i + M 0 ..^ W
34 33 3ad2ant2 W Word A M 0 N N 0 W F : A B i 0 ..^ N M i + M 0 ..^ W
35 34 imp W Word A M 0 N N 0 W F : A B i 0 ..^ N M i + M 0 ..^ W
36 fvco2 W Fn 0 ..^ W i + M 0 ..^ W F W i + M = F W i + M
37 32 35 36 syl2an2r W Word A M 0 N N 0 W F : A B i 0 ..^ N M F W i + M = F W i + M
38 30 37 eqtr4d W Word A M 0 N N 0 W F : A B i 0 ..^ N M F W substr M N i = F W i + M
39 fvco2 W substr M N Fn 0 ..^ N M i 0 ..^ N M F W substr M N i = F W substr M N i
40 5 39 sylan W Word A M 0 N N 0 W F : A B i 0 ..^ N M F W substr M N i = F W substr M N i
41 14 ancoms F : A B W Word A F W = W
42 41 eqcomd F : A B W Word A W = F W
43 42 oveq2d F : A B W Word A 0 W = 0 F W
44 43 eleq2d F : A B W Word A N 0 W N 0 F W
45 44 biimpd F : A B W Word A N 0 W N 0 F W
46 45 ex F : A B W Word A N 0 W N 0 F W
47 46 com13 N 0 W W Word A F : A B N 0 F W
48 47 adantl M 0 N N 0 W W Word A F : A B N 0 F W
49 48 3imp21 W Word A M 0 N N 0 W F : A B N 0 F W
50 12 13 49 3jca W Word A M 0 N N 0 W F : A B F W Word B M 0 N N 0 F W
51 swrdfv F W Word B M 0 N N 0 F W i 0 ..^ N M F W substr M N i = F W i + M
52 50 51 sylan W Word A M 0 N N 0 W F : A B i 0 ..^ N M F W substr M N i = F W i + M
53 38 40 52 3eqtr4d W Word A M 0 N N 0 W F : A B i 0 ..^ N M F W substr M N i = F W substr M N i
54 10 24 53 eqfnfvd W Word A M 0 N N 0 W F : A B F W substr M N = F W substr M N