Metamath Proof Explorer


Theorem swrdswrd

Description: A subword of a subword is a subword. (Contributed by Alexander van der Vekens, 4-Apr-2018)

Ref Expression
Assertion swrdswrd W Word V N 0 W M 0 N K 0 N M L K N M W substr M N substr K L = W substr M + K M + L

Proof

Step Hyp Ref Expression
1 swrdcl W Word V W substr M N Word V
2 1 3ad2ant1 W Word V N 0 W M 0 N W substr M N Word V
3 2 adantr W Word V N 0 W M 0 N K 0 N M L K N M W substr M N Word V
4 elfz0ubfz0 K 0 N M L K N M K 0 L
5 4 adantl W Word V N 0 W M 0 N K 0 N M L K N M K 0 L
6 elfzuz K 0 N M K 0
7 6 adantl W Word V N 0 W M 0 N K 0 N M K 0
8 fzss1 K 0 K N M 0 N M
9 7 8 syl W Word V N 0 W M 0 N K 0 N M K N M 0 N M
10 9 sseld W Word V N 0 W M 0 N K 0 N M L K N M L 0 N M
11 10 impr W Word V N 0 W M 0 N K 0 N M L K N M L 0 N M
12 3ancomb W Word V N 0 W M 0 N W Word V M 0 N N 0 W
13 12 biimpi W Word V N 0 W M 0 N W Word V M 0 N N 0 W
14 13 adantr W Word V N 0 W M 0 N K 0 N M L K N M W Word V M 0 N N 0 W
15 swrdlen W Word V M 0 N N 0 W W substr M N = N M
16 14 15 syl W Word V N 0 W M 0 N K 0 N M L K N M W substr M N = N M
17 16 oveq2d W Word V N 0 W M 0 N K 0 N M L K N M 0 W substr M N = 0 N M
18 11 17 eleqtrrd W Word V N 0 W M 0 N K 0 N M L K N M L 0 W substr M N
19 swrdval2 W substr M N Word V K 0 L L 0 W substr M N W substr M N substr K L = x 0 ..^ L K W substr M N x + K
20 3 5 18 19 syl3anc W Word V N 0 W M 0 N K 0 N M L K N M W substr M N substr K L = x 0 ..^ L K W substr M N x + K
21 fvex W substr M N x + K V
22 eqid x 0 ..^ L K W substr M N x + K = x 0 ..^ L K W substr M N x + K
23 21 22 fnmpti x 0 ..^ L K W substr M N x + K Fn 0 ..^ L K
24 23 a1i W Word V N 0 W M 0 N K 0 N M L K N M x 0 ..^ L K W substr M N x + K Fn 0 ..^ L K
25 swrdswrdlem W Word V N 0 W M 0 N K 0 N M L K N M W Word V M + K 0 M + L M + L 0 W
26 swrdvalfn W Word V M + K 0 M + L M + L 0 W W substr M + K M + L Fn 0 ..^ M + L - M + K
27 25 26 syl W Word V N 0 W M 0 N K 0 N M L K N M W substr M + K M + L Fn 0 ..^ M + L - M + K
28 elfzelz M 0 N M
29 elfzelz L K N M L
30 elfzelz K 0 N M K
31 zcn M M
32 31 adantr M L K M
33 zcn L L
34 33 ad2antrl M L K L
35 zcn K K
36 35 ad2antll M L K K
37 pnpcan M L K M + L - M + K = L K
38 37 eqcomd M L K L K = M + L - M + K
39 32 34 36 38 syl3anc M L K L K = M + L - M + K
40 39 expcom L K M L K = M + L - M + K
41 29 30 40 syl2anr K 0 N M L K N M M L K = M + L - M + K
42 28 41 syl5com M 0 N K 0 N M L K N M L K = M + L - M + K
43 42 3ad2ant3 W Word V N 0 W M 0 N K 0 N M L K N M L K = M + L - M + K
44 43 imp W Word V N 0 W M 0 N K 0 N M L K N M L K = M + L - M + K
45 44 oveq2d W Word V N 0 W M 0 N K 0 N M L K N M 0 ..^ L K = 0 ..^ M + L - M + K
46 45 fneq2d W Word V N 0 W M 0 N K 0 N M L K N M W substr M + K M + L Fn 0 ..^ L K W substr M + K M + L Fn 0 ..^ M + L - M + K
47 27 46 mpbird W Word V N 0 W M 0 N K 0 N M L K N M W substr M + K M + L Fn 0 ..^ L K
48 simpr W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K y 0 ..^ L K
49 fvex W y + K + M V
50 oveq1 x = y x + K = y + K
51 50 fvoveq1d x = y W x + K + M = W y + K + M
52 eqid x 0 ..^ L K W x + K + M = x 0 ..^ L K W x + K + M
53 51 52 fvmptg y 0 ..^ L K W y + K + M V x 0 ..^ L K W x + K + M y = W y + K + M
54 48 49 53 sylancl W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W x + K + M y = W y + K + M
55 zcn y y
56 55 31 35 3anim123i y M K y M K
57 56 3expa y M K y M K
58 add32r y M K y + M + K = y + K + M
59 58 eqcomd y M K y + K + M = y + M + K
60 57 59 syl y M K y + K + M = y + M + K
61 60 exp31 y M K y + K + M = y + M + K
62 61 com13 K M y y + K + M = y + M + K
63 30 62 syl K 0 N M M y y + K + M = y + M + K
64 63 adantr K 0 N M L K N M M y y + K + M = y + M + K
65 28 64 syl5com M 0 N K 0 N M L K N M y y + K + M = y + M + K
66 65 3ad2ant3 W Word V N 0 W M 0 N K 0 N M L K N M y y + K + M = y + M + K
67 66 imp W Word V N 0 W M 0 N K 0 N M L K N M y y + K + M = y + M + K
68 elfzoelz y 0 ..^ L K y
69 67 68 impel W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K y + K + M = y + M + K
70 69 fveq2d W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K W y + K + M = W y + M + K
71 54 70 eqtrd W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W x + K + M y = W y + M + K
72 13 ad3antrrr W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W Word V M 0 N N 0 W
73 elfz2nn0 K 0 N M K 0 N M 0 K N M
74 elfz2 L K N M K N M L K L L N M
75 elfzo0 x 0 ..^ L K x 0 L K x < L K
76 nn0re x 0 x
77 76 ad2antrl K 0 x 0 L x
78 nn0re K 0 K
79 78 adantr K 0 x 0 L K
80 zre L L
81 80 ad2antll K 0 x 0 L L
82 ltaddsub x K L x + K < L x < L K
83 82 bicomd x K L x < L K x + K < L
84 77 79 81 83 syl3anc K 0 x 0 L x < L K x + K < L
85 nn0addcl x 0 K 0 x + K 0
86 85 ex x 0 K 0 x + K 0
87 86 adantr x 0 L K 0 x + K 0
88 87 impcom K 0 x 0 L x + K 0
89 88 ad3antrrr K 0 x 0 L x + K < L N M 0 L N M x + K 0
90 elnn0z x + K 0 x + K 0 x + K
91 0red x + K L 0
92 zre x + K x + K
93 92 adantr x + K L x + K
94 80 adantl x + K L L
95 lelttr 0 x + K L 0 x + K x + K < L 0 < L
96 91 93 94 95 syl3anc x + K L 0 x + K x + K < L 0 < L
97 0red L N M 0 0
98 80 adantr L N M 0 L
99 nn0re N M 0 N M
100 99 adantl L N M 0 N M
101 ltletr 0 L N M 0 < L L N M 0 < N M
102 97 98 100 101 syl3anc L N M 0 0 < L L N M 0 < N M
103 elnnnn0b N M N M 0 0 < N M
104 103 simplbi2 N M 0 0 < N M N M
105 104 adantl L N M 0 0 < N M N M
106 102 105 syld L N M 0 0 < L L N M N M
107 106 exp4b L N M 0 0 < L L N M N M
108 107 com23 L 0 < L N M 0 L N M N M
109 108 adantl x + K L 0 < L N M 0 L N M N M
110 96 109 syld x + K L 0 x + K x + K < L N M 0 L N M N M
111 110 expd x + K L 0 x + K x + K < L N M 0 L N M N M
112 111 a1d x + K L x 0 K 0 0 x + K x + K < L N M 0 L N M N M
113 112 ex x + K L x 0 K 0 0 x + K x + K < L N M 0 L N M N M
114 113 com24 x + K 0 x + K x 0 K 0 L x + K < L N M 0 L N M N M
115 114 imp x + K 0 x + K x 0 K 0 L x + K < L N M 0 L N M N M
116 90 115 sylbi x + K 0 x 0 K 0 L x + K < L N M 0 L N M N M
117 85 116 mpcom x 0 K 0 L x + K < L N M 0 L N M N M
118 117 impancom x 0 L K 0 x + K < L N M 0 L N M N M
119 118 impcom K 0 x 0 L x + K < L N M 0 L N M N M
120 119 imp41 K 0 x 0 L x + K < L N M 0 L N M N M
121 nn0readdcl x 0 K 0 x + K
122 121 ex x 0 K 0 x + K
123 122 adantr x 0 L K 0 x + K
124 123 impcom K 0 x 0 L x + K
125 ltletr x + K L N M x + K < L L N M x + K < N M
126 124 81 99 125 syl2an3an K 0 x 0 L N M 0 x + K < L L N M x + K < N M
127 126 exp4b K 0 x 0 L N M 0 x + K < L L N M x + K < N M
128 127 com23 K 0 x 0 L x + K < L N M 0 L N M x + K < N M
129 128 imp41 K 0 x 0 L x + K < L N M 0 L N M x + K < N M
130 elfzo0 x + K 0 ..^ N M x + K 0 N M x + K < N M
131 89 120 129 130 syl3anbrc K 0 x 0 L x + K < L N M 0 L N M x + K 0 ..^ N M
132 131 exp41 K 0 x 0 L x + K < L N M 0 L N M x + K 0 ..^ N M
133 84 132 sylbid K 0 x 0 L x < L K N M 0 L N M x + K 0 ..^ N M
134 133 ex K 0 x 0 L x < L K N M 0 L N M x + K 0 ..^ N M
135 134 com24 K 0 N M 0 x < L K x 0 L L N M x + K 0 ..^ N M
136 135 imp K 0 N M 0 x < L K x 0 L L N M x + K 0 ..^ N M
137 136 com13 x 0 L x < L K K 0 N M 0 L N M x + K 0 ..^ N M
138 137 impancom x 0 x < L K L K 0 N M 0 L N M x + K 0 ..^ N M
139 138 3adant2 x 0 L K x < L K L K 0 N M 0 L N M x + K 0 ..^ N M
140 75 139 sylbi x 0 ..^ L K L K 0 N M 0 L N M x + K 0 ..^ N M
141 140 com14 L N M L K 0 N M 0 x 0 ..^ L K x + K 0 ..^ N M
142 141 adantl K L L N M L K 0 N M 0 x 0 ..^ L K x + K 0 ..^ N M
143 142 com12 L K L L N M K 0 N M 0 x 0 ..^ L K x + K 0 ..^ N M
144 143 3ad2ant3 K N M L K L L N M K 0 N M 0 x 0 ..^ L K x + K 0 ..^ N M
145 144 imp K N M L K L L N M K 0 N M 0 x 0 ..^ L K x + K 0 ..^ N M
146 74 145 sylbi L K N M K 0 N M 0 x 0 ..^ L K x + K 0 ..^ N M
147 146 com12 K 0 N M 0 L K N M x 0 ..^ L K x + K 0 ..^ N M
148 147 3adant3 K 0 N M 0 K N M L K N M x 0 ..^ L K x + K 0 ..^ N M
149 73 148 sylbi K 0 N M L K N M x 0 ..^ L K x + K 0 ..^ N M
150 149 imp K 0 N M L K N M x 0 ..^ L K x + K 0 ..^ N M
151 150 adantl W Word V N 0 W M 0 N K 0 N M L K N M x 0 ..^ L K x + K 0 ..^ N M
152 151 adantr W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K x + K 0 ..^ N M
153 152 imp W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K x + K 0 ..^ N M
154 swrdfv W Word V M 0 N N 0 W x + K 0 ..^ N M W substr M N x + K = W x + K + M
155 72 153 154 syl2anc W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W substr M N x + K = W x + K + M
156 155 mpteq2dva W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W substr M N x + K = x 0 ..^ L K W x + K + M
157 156 fveq1d W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W substr M N x + K y = x 0 ..^ L K W x + K + M y
158 25 adantr W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K W Word V M + K 0 M + L M + L 0 W
159 31 33 35 3anim123i M L K M L K
160 159 3expa M L K M L K
161 160 38 syl M L K L K = M + L - M + K
162 161 exp31 M L K L K = M + L - M + K
163 162 com3l L K M L K = M + L - M + K
164 29 163 syl L K N M K M L K = M + L - M + K
165 30 164 mpan9 K 0 N M L K N M M L K = M + L - M + K
166 28 165 syl5com M 0 N K 0 N M L K N M L K = M + L - M + K
167 166 3ad2ant3 W Word V N 0 W M 0 N K 0 N M L K N M L K = M + L - M + K
168 167 imp W Word V N 0 W M 0 N K 0 N M L K N M L K = M + L - M + K
169 168 oveq2d W Word V N 0 W M 0 N K 0 N M L K N M 0 ..^ L K = 0 ..^ M + L - M + K
170 169 eleq2d W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K y 0 ..^ M + L - M + K
171 170 biimpa W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K y 0 ..^ M + L - M + K
172 swrdfv W Word V M + K 0 M + L M + L 0 W y 0 ..^ M + L - M + K W substr M + K M + L y = W y + M + K
173 158 171 172 syl2anc W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K W substr M + K M + L y = W y + M + K
174 71 157 173 3eqtr4d W Word V N 0 W M 0 N K 0 N M L K N M y 0 ..^ L K x 0 ..^ L K W substr M N x + K y = W substr M + K M + L y
175 24 47 174 eqfnfvd W Word V N 0 W M 0 N K 0 N M L K N M x 0 ..^ L K W substr M N x + K = W substr M + K M + L
176 20 175 eqtrd W Word V N 0 W M 0 N K 0 N M L K N M W substr M N substr K L = W substr M + K M + L
177 176 ex W Word V N 0 W M 0 N K 0 N M L K N M W substr M N substr K L = W substr M + K M + L