Metamath Proof Explorer


Theorem repswswrd

Description: A subword of a "repeated symbol word" is again a "repeated symbol word". The assumption N <_ L is required, because otherwise ( L < N ) : ( ( S repeatS L ) substr <. M , N >. ) = (/) , but for M < N ( S repeatS ( N - M ) ) ) =/= (/) ! The proof is relatively long because the border cases ( M = N , -. ( M ..^ N ) C_ ( 0 ..^ L ) must have been considered. (Contributed by AV, 6-Nov-2018)

Ref Expression
Assertion repswswrd S V L 0 M 0 N 0 N L S repeatS L substr M N = S repeatS N M

Proof

Step Hyp Ref Expression
1 repsw S V L 0 S repeatS L Word V
2 nn0z M 0 M
3 nn0z N 0 N
4 2 3 anim12i M 0 N 0 M N
5 1 4 anim12i S V L 0 M 0 N 0 S repeatS L Word V M N
6 3anass S repeatS L Word V M N S repeatS L Word V M N
7 5 6 sylibr S V L 0 M 0 N 0 S repeatS L Word V M N
8 7 3adant3 S V L 0 M 0 N 0 N L S repeatS L Word V M N
9 swrdval S repeatS L Word V M N S repeatS L substr M N = if M ..^ N dom S repeatS L x 0 ..^ N M S repeatS L x + M
10 8 9 syl S V L 0 M 0 N 0 N L S repeatS L substr M N = if M ..^ N dom S repeatS L x 0 ..^ N M S repeatS L x + M
11 repsf S V L 0 S repeatS L : 0 ..^ L V
12 11 3ad2ant1 S V L 0 M 0 N 0 N L S repeatS L : 0 ..^ L V
13 12 fdmd S V L 0 M 0 N 0 N L dom S repeatS L = 0 ..^ L
14 13 sseq2d S V L 0 M 0 N 0 N L M ..^ N dom S repeatS L M ..^ N 0 ..^ L
15 14 ifbid S V L 0 M 0 N 0 N L if M ..^ N dom S repeatS L x 0 ..^ N M S repeatS L x + M = if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M
16 fzon M N N M M ..^ N =
17 4 16 syl M 0 N 0 N M M ..^ N =
18 17 adantl S V L 0 M 0 N 0 N M M ..^ N =
19 18 biimpac N M S V L 0 M 0 N 0 M ..^ N =
20 0ss 0 ..^ L
21 19 20 eqsstrdi N M S V L 0 M 0 N 0 M ..^ N 0 ..^ L
22 iftrue M ..^ N 0 ..^ L if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = x 0 ..^ N M S repeatS L x + M
23 21 22 syl N M S V L 0 M 0 N 0 if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = x 0 ..^ N M S repeatS L x + M
24 nn0re M 0 M
25 nn0re N 0 N
26 24 25 anim12ci M 0 N 0 N M
27 26 adantl S V L 0 M 0 N 0 N M
28 suble0 N M N M 0 N M
29 27 28 syl S V L 0 M 0 N 0 N M 0 N M
30 29 biimparc N M S V L 0 M 0 N 0 N M 0
31 0z 0
32 zsubcl N M N M
33 3 2 32 syl2anr M 0 N 0 N M
34 33 adantl S V L 0 M 0 N 0 N M
35 34 adantl N M S V L 0 M 0 N 0 N M
36 fzon 0 N M N M 0 0 ..^ N M =
37 31 35 36 sylancr N M S V L 0 M 0 N 0 N M 0 0 ..^ N M =
38 30 37 mpbid N M S V L 0 M 0 N 0 0 ..^ N M =
39 38 mpteq1d N M S V L 0 M 0 N 0 x 0 ..^ N M S repeatS L x + M = x S repeatS L x + M
40 mpt0 x S repeatS L x + M =
41 oveq2 M = N N M = N N
42 41 oveq2d M = N S repeatS N M = S repeatS N N
43 nn0cn N 0 N
44 43 adantl M 0 N 0 N
45 44 subidd M 0 N 0 N N = 0
46 45 adantl S V L 0 M 0 N 0 N N = 0
47 46 oveq2d S V L 0 M 0 N 0 S repeatS N N = S repeatS 0
48 repsw0 S V S repeatS 0 =
49 48 ad2antrr S V L 0 M 0 N 0 S repeatS 0 =
50 47 49 eqtrd S V L 0 M 0 N 0 S repeatS N N =
51 42 50 sylan9eqr S V L 0 M 0 N 0 M = N S repeatS N M =
52 51 ex S V L 0 M 0 N 0 M = N S repeatS N M =
53 52 adantl N M S V L 0 M 0 N 0 M = N S repeatS N M =
54 53 com12 M = N N M S V L 0 M 0 N 0 S repeatS N M =
55 elnn0z N M 0 N M 0 N M
56 subge0 N M 0 N M M N
57 25 24 56 syl2anr M 0 N 0 0 N M M N
58 24 25 anim12i M 0 N 0 M N
59 letri3 M N M = N M N N M
60 58 59 syl M 0 N 0 M = N M N N M
61 60 biimprd M 0 N 0 M N N M M = N
62 61 expd M 0 N 0 M N N M M = N
63 57 62 sylbid M 0 N 0 0 N M N M M = N
64 63 com23 M 0 N 0 N M 0 N M M = N
65 64 adantl S V L 0 M 0 N 0 N M 0 N M M = N
66 65 impcom N M S V L 0 M 0 N 0 0 N M M = N
67 66 com12 0 N M N M S V L 0 M 0 N 0 M = N
68 55 67 simplbiim N M 0 N M S V L 0 M 0 N 0 M = N
69 68 com12 N M S V L 0 M 0 N 0 N M 0 M = N
70 69 con3d N M S V L 0 M 0 N 0 ¬ M = N ¬ N M 0
71 70 impcom ¬ M = N N M S V L 0 M 0 N 0 ¬ N M 0
72 df-nel N M 0 ¬ N M 0
73 71 72 sylibr ¬ M = N N M S V L 0 M 0 N 0 N M 0
74 repsundef N M 0 S repeatS N M =
75 73 74 syl ¬ M = N N M S V L 0 M 0 N 0 S repeatS N M =
76 75 ex ¬ M = N N M S V L 0 M 0 N 0 S repeatS N M =
77 54 76 pm2.61i N M S V L 0 M 0 N 0 S repeatS N M =
78 40 77 eqtr4id N M S V L 0 M 0 N 0 x S repeatS L x + M = S repeatS N M
79 23 39 78 3eqtrd N M S V L 0 M 0 N 0 if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
80 79 expcom S V L 0 M 0 N 0 N M if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
81 80 3adant3 S V L 0 M 0 N 0 N L N M if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
82 ltnle M N M < N ¬ N M
83 58 82 syl M 0 N 0 M < N ¬ N M
84 83 bicomd M 0 N 0 ¬ N M M < N
85 84 3ad2ant2 S V L 0 M 0 N 0 N L ¬ N M M < N
86 22 adantr M ..^ N 0 ..^ L S V L 0 M 0 N 0 N L M < N if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = x 0 ..^ N M S repeatS L x + M
87 4 3ad2ant2 S V L 0 M 0 N 0 N L M N
88 87 adantr S V L 0 M 0 N 0 N L M < N M N
89 0zd S V 0
90 nn0z L 0 L
91 89 90 anim12i S V L 0 0 L
92 91 3ad2ant1 S V L 0 M 0 N 0 N L 0 L
93 92 adantr S V L 0 M 0 N 0 N L M < N 0 L
94 simpr S V L 0 M 0 N 0 N L M < N M < N
95 ssfzo12bi M N 0 L M < N M ..^ N 0 ..^ L 0 M N L
96 88 93 94 95 syl3anc S V L 0 M 0 N 0 N L M < N M ..^ N 0 ..^ L 0 M N L
97 simpl1l S V L 0 M 0 N 0 N L M < N S V
98 97 ad2antrr S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M S V
99 simpl1r S V L 0 M 0 N 0 N L M < N L 0
100 99 ad2antrr S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M L 0
101 nn0addcl x 0 M 0 x + M 0
102 101 expcom M 0 x 0 x + M 0
103 102 adantr M 0 N 0 x 0 x + M 0
104 103 3ad2ant2 S V L 0 M 0 N 0 N L x 0 x + M 0
105 104 ad2antrr S V L 0 M 0 N 0 N L M < N 0 M N L x 0 x + M 0
106 elfzonn0 x 0 ..^ N M x 0
107 105 106 impel S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M x + M 0
108 90 adantl S V L 0 L
109 108 3ad2ant1 S V L 0 M 0 N 0 N L L
110 109 adantr S V L 0 M 0 N 0 N L M < N L
111 nn0re L 0 L
112 111 adantl S V L 0 L
113 112 58 anim12ci S V L 0 M 0 N 0 M N L
114 df-3an M N L M N L
115 113 114 sylibr S V L 0 M 0 N 0 M N L
116 ltletr M N L M < N N L M < L
117 115 116 syl S V L 0 M 0 N 0 M < N N L M < L
118 elnn0z M 0 M 0 M
119 0red M S V L 0 0
120 zre M M
121 120 adantr M S V L 0 M
122 112 adantl M S V L 0 L
123 lelttr 0 M L 0 M M < L 0 < L
124 119 121 122 123 syl3anc M S V L 0 0 M M < L 0 < L
125 124 expd M S V L 0 0 M M < L 0 < L
126 125 impancom M 0 M S V L 0 M < L 0 < L
127 118 126 sylbi M 0 S V L 0 M < L 0 < L
128 127 adantr M 0 N 0 S V L 0 M < L 0 < L
129 128 impcom S V L 0 M 0 N 0 M < L 0 < L
130 117 129 syld S V L 0 M 0 N 0 M < N N L 0 < L
131 130 expcomd S V L 0 M 0 N 0 N L M < N 0 < L
132 131 3impia S V L 0 M 0 N 0 N L M < N 0 < L
133 132 imp S V L 0 M 0 N 0 N L M < N 0 < L
134 elnnz L L 0 < L
135 110 133 134 sylanbrc S V L 0 M 0 N 0 N L M < N L
136 135 ad2antrr S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M L
137 elfzo0 x 0 ..^ N M x 0 N M x < N M
138 nn0readdcl x 0 M 0 x + M
139 138 expcom M 0 x 0 x + M
140 139 ad2antrl L 0 M 0 N 0 x 0 x + M
141 140 impcom x 0 L 0 M 0 N 0 x + M
142 25 adantl M 0 N 0 N
143 142 adantl L 0 M 0 N 0 N
144 143 adantl x 0 L 0 M 0 N 0 N
145 111 ad2antrl x 0 L 0 M 0 N 0 L
146 141 144 145 3jca x 0 L 0 M 0 N 0 x + M N L
147 146 ex x 0 L 0 M 0 N 0 x + M N L
148 147 adantr x 0 x < N M L 0 M 0 N 0 x + M N L
149 148 impcom L 0 M 0 N 0 x 0 x < N M x + M N L
150 149 adantr L 0 M 0 N 0 x 0 x < N M N L x + M N L
151 nn0re x 0 x
152 151 adantr x 0 L 0 M 0 N 0 x
153 24 ad2antrl L 0 M 0 N 0 M
154 153 adantl x 0 L 0 M 0 N 0 M
155 152 154 144 ltaddsubd x 0 L 0 M 0 N 0 x + M < N x < N M
156 idd x 0 L 0 M 0 N 0 N L x + M < N x + M < N
157 156 ex x 0 L 0 M 0 N 0 N L x + M < N x + M < N
158 157 com23 x 0 L 0 M 0 N 0 x + M < N N L x + M < N
159 155 158 sylbird x 0 L 0 M 0 N 0 x < N M N L x + M < N
160 159 impancom x 0 x < N M L 0 M 0 N 0 N L x + M < N
161 160 impcom L 0 M 0 N 0 x 0 x < N M N L x + M < N
162 161 impac L 0 M 0 N 0 x 0 x < N M N L x + M < N N L
163 ltletr x + M N L x + M < N N L x + M < L
164 150 162 163 sylc L 0 M 0 N 0 x 0 x < N M N L x + M < L
165 164 exp31 L 0 M 0 N 0 x 0 x < N M N L x + M < L
166 165 com23 L 0 M 0 N 0 N L x 0 x < N M x + M < L
167 166 ex L 0 M 0 N 0 N L x 0 x < N M x + M < L
168 167 adantl S V L 0 M 0 N 0 N L x 0 x < N M x + M < L
169 168 3imp S V L 0 M 0 N 0 N L x 0 x < N M x + M < L
170 169 ad2antrr S V L 0 M 0 N 0 N L M < N 0 M N L x 0 x < N M x + M < L
171 170 com12 x 0 x < N M S V L 0 M 0 N 0 N L M < N 0 M N L x + M < L
172 171 3adant2 x 0 N M x < N M S V L 0 M 0 N 0 N L M < N 0 M N L x + M < L
173 137 172 sylbi x 0 ..^ N M S V L 0 M 0 N 0 N L M < N 0 M N L x + M < L
174 173 impcom S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M x + M < L
175 elfzo0 x + M 0 ..^ L x + M 0 L x + M < L
176 107 136 174 175 syl3anbrc S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M x + M 0 ..^ L
177 repswsymb S V L 0 x + M 0 ..^ L S repeatS L x + M = S
178 98 100 176 177 syl3anc S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M S repeatS L x + M = S
179 178 mpteq2dva S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M S repeatS L x + M = x 0 ..^ N M S
180 33 3ad2ant2 S V L 0 M 0 N 0 N L N M
181 180 adantr S V L 0 M 0 N 0 N L M < N N M
182 58 3ad2ant2 S V L 0 M 0 N 0 N L M N
183 ltle M N M < N M N
184 182 183 syl S V L 0 M 0 N 0 N L M < N M N
185 26 3ad2ant2 S V L 0 M 0 N 0 N L N M
186 185 56 syl S V L 0 M 0 N 0 N L 0 N M M N
187 184 186 sylibrd S V L 0 M 0 N 0 N L M < N 0 N M
188 187 imp S V L 0 M 0 N 0 N L M < N 0 N M
189 181 188 55 sylanbrc S V L 0 M 0 N 0 N L M < N N M 0
190 97 189 jca S V L 0 M 0 N 0 N L M < N S V N M 0
191 190 adantr S V L 0 M 0 N 0 N L M < N 0 M N L S V N M 0
192 reps S V N M 0 S repeatS N M = x 0 ..^ N M S
193 192 eqcomd S V N M 0 x 0 ..^ N M S = S repeatS N M
194 191 193 syl S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M S = S repeatS N M
195 179 194 eqtrd S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M S repeatS L x + M = S repeatS N M
196 195 ex S V L 0 M 0 N 0 N L M < N 0 M N L x 0 ..^ N M S repeatS L x + M = S repeatS N M
197 96 196 sylbid S V L 0 M 0 N 0 N L M < N M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
198 197 impcom M ..^ N 0 ..^ L S V L 0 M 0 N 0 N L M < N x 0 ..^ N M S repeatS L x + M = S repeatS N M
199 86 198 eqtrd M ..^ N 0 ..^ L S V L 0 M 0 N 0 N L M < N if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
200 iffalse ¬ M ..^ N 0 ..^ L if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M =
201 200 adantr ¬ M ..^ N 0 ..^ L S V L 0 M 0 N 0 N L M < N if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M =
202 96 notbid S V L 0 M 0 N 0 N L M < N ¬ M ..^ N 0 ..^ L ¬ 0 M N L
203 ianor ¬ 0 M N L ¬ 0 M ¬ N L
204 nn0ge0 M 0 0 M
205 pm2.24 0 M ¬ 0 M S repeatS N M =
206 204 205 syl M 0 ¬ 0 M S repeatS N M =
207 206 adantr M 0 N 0 ¬ 0 M S repeatS N M =
208 207 3ad2ant2 S V L 0 M 0 N 0 N L ¬ 0 M S repeatS N M =
209 208 adantr S V L 0 M 0 N 0 N L M < N ¬ 0 M S repeatS N M =
210 209 com12 ¬ 0 M S V L 0 M 0 N 0 N L M < N S repeatS N M =
211 pm2.24 N L ¬ N L S repeatS N M =
212 211 3ad2ant3 S V L 0 M 0 N 0 N L ¬ N L S repeatS N M =
213 212 adantr S V L 0 M 0 N 0 N L M < N ¬ N L S repeatS N M =
214 213 com12 ¬ N L S V L 0 M 0 N 0 N L M < N S repeatS N M =
215 210 214 jaoi ¬ 0 M ¬ N L S V L 0 M 0 N 0 N L M < N S repeatS N M =
216 203 215 sylbi ¬ 0 M N L S V L 0 M 0 N 0 N L M < N S repeatS N M =
217 216 com12 S V L 0 M 0 N 0 N L M < N ¬ 0 M N L S repeatS N M =
218 202 217 sylbid S V L 0 M 0 N 0 N L M < N ¬ M ..^ N 0 ..^ L S repeatS N M =
219 218 impcom ¬ M ..^ N 0 ..^ L S V L 0 M 0 N 0 N L M < N S repeatS N M =
220 201 219 eqtr4d ¬ M ..^ N 0 ..^ L S V L 0 M 0 N 0 N L M < N if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
221 199 220 pm2.61ian S V L 0 M 0 N 0 N L M < N if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
222 221 ex S V L 0 M 0 N 0 N L M < N if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
223 85 222 sylbid S V L 0 M 0 N 0 N L ¬ N M if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
224 81 223 pm2.61d S V L 0 M 0 N 0 N L if M ..^ N 0 ..^ L x 0 ..^ N M S repeatS L x + M = S repeatS N M
225 10 15 224 3eqtrd S V L 0 M 0 N 0 N L S repeatS L substr M N = S repeatS N M