Metamath Proof Explorer


Theorem swrdccatin2

Description: The subword of a concatenation of two words within the second of the concatenated words. (Contributed by Alexander van der Vekens, 28-Mar-2018) (Revised by Alexander van der Vekens, 27-May-2018)

Ref Expression
Hypothesis swrdccatin2.l L = A
Assertion swrdccatin2 A Word V B Word V M L N N L L + B A ++ B substr M N = B substr M L N L

Proof

Step Hyp Ref Expression
1 swrdccatin2.l L = A
2 oveq1 L = A L N = A N
3 2 eleq2d L = A M L N M A N
4 id L = A L = A
5 oveq1 L = A L + B = A + B
6 4 5 oveq12d L = A L L + B = A A + B
7 6 eleq2d L = A N L L + B N A A + B
8 3 7 anbi12d L = A M L N N L L + B M A N N A A + B
9 1 8 ax-mp M L N N L L + B M A N N A A + B
10 lencl A Word V A 0
11 elnn0uz A 0 A 0
12 fzss1 A 0 A N 0 N
13 11 12 sylbi A 0 A N 0 N
14 13 sseld A 0 M A N M 0 N
15 fzss1 A 0 A A + B 0 A + B
16 11 15 sylbi A 0 A A + B 0 A + B
17 16 sseld A 0 N A A + B N 0 A + B
18 14 17 anim12d A 0 M A N N A A + B M 0 N N 0 A + B
19 10 18 syl A Word V M A N N A A + B M 0 N N 0 A + B
20 19 adantr A Word V B Word V M A N N A A + B M 0 N N 0 A + B
21 9 20 syl5bi A Word V B Word V M L N N L L + B M 0 N N 0 A + B
22 21 imp A Word V B Word V M L N N L L + B M 0 N N 0 A + B
23 swrdccatfn A Word V B Word V M 0 N N 0 A + B A ++ B substr M N Fn 0 ..^ N M
24 22 23 syldan A Word V B Word V M L N N L L + B A ++ B substr M N Fn 0 ..^ N M
25 fzmmmeqm M L N N - L - M L = N M
26 25 oveq2d M L N 0 ..^ N - L - M L = 0 ..^ N M
27 26 fneq2d M L N A ++ B substr M N Fn 0 ..^ N - L - M L A ++ B substr M N Fn 0 ..^ N M
28 27 ad2antrl A Word V B Word V M L N N L L + B A ++ B substr M N Fn 0 ..^ N - L - M L A ++ B substr M N Fn 0 ..^ N M
29 24 28 mpbird A Word V B Word V M L N N L L + B A ++ B substr M N Fn 0 ..^ N - L - M L
30 simplr A Word V B Word V M L N N L L + B B Word V
31 elfzmlbm M L N M L 0 N L
32 31 ad2antrl A Word V B Word V M L N N L L + B M L 0 N L
33 lencl B Word V B 0
34 33 nn0zd B Word V B
35 34 adantl A Word V B Word V B
36 elfzmlbp B N L L + B N L 0 B
37 35 36 sylan A Word V B Word V N L L + B N L 0 B
38 37 adantrl A Word V B Word V M L N N L L + B N L 0 B
39 swrdvalfn B Word V M L 0 N L N L 0 B B substr M L N L Fn 0 ..^ N - L - M L
40 30 32 38 39 syl3anc A Word V B Word V M L N N L L + B B substr M L N L Fn 0 ..^ N - L - M L
41 simpll A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L A Word V B Word V
42 elfzelz M L N M
43 zaddcl k M k + M
44 43 expcom M k k + M
45 42 44 syl M L N k k + M
46 45 ad2antrl A Word V B Word V M L N N L L + B k k + M
47 elfzoelz k 0 ..^ N - L - M L k
48 46 47 impel A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L k + M
49 df-3an A Word V B Word V k + M A Word V B Word V k + M
50 41 48 49 sylanbrc A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L A Word V B Word V k + M
51 ccatsymb A Word V B Word V k + M A ++ B k + M = if k + M < A A k + M B k + M - A
52 50 51 syl A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L A ++ B k + M = if k + M < A A k + M B k + M - A
53 elfz2 M L N L N M L M M N
54 zre L L
55 zre M M
56 54 55 anim12i L M L M
57 elnn0z k 0 k 0 k
58 zre k k
59 0re 0
60 59 jctl L 0 L
61 60 ad2antrl k L M 0 L
62 id k M k M
63 62 adantrl k L M k M
64 le2add 0 L k M 0 k L M 0 + L k + M
65 61 63 64 syl2anc k L M 0 k L M 0 + L k + M
66 recn L L
67 66 addid2d L 0 + L = L
68 67 ad2antrl k L M 0 + L = L
69 68 breq1d k L M 0 + L k + M L k + M
70 65 69 sylibd k L M 0 k L M L k + M
71 simprl k L M L
72 readdcl k M k + M
73 72 adantrl k L M k + M
74 71 73 lenltd k L M L k + M ¬ k + M < L
75 70 74 sylibd k L M 0 k L M ¬ k + M < L
76 75 expd k L M 0 k L M ¬ k + M < L
77 76 com12 0 k k L M L M ¬ k + M < L
78 77 expd 0 k k L M L M ¬ k + M < L
79 58 78 mpan9 k 0 k L M L M ¬ k + M < L
80 57 79 sylbi k 0 L M L M ¬ k + M < L
81 56 80 mpan9 L M k 0 L M ¬ k + M < L
82 1 breq2i k + M < L k + M < A
83 82 notbii ¬ k + M < L ¬ k + M < A
84 81 83 syl6ib L M k 0 L M ¬ k + M < A
85 84 ex L M k 0 L M ¬ k + M < A
86 85 com23 L M L M k 0 ¬ k + M < A
87 86 3adant2 L N M L M k 0 ¬ k + M < A
88 87 imp L N M L M k 0 ¬ k + M < A
89 88 adantrr L N M L M M N k 0 ¬ k + M < A
90 53 89 sylbi M L N k 0 ¬ k + M < A
91 90 ad2antrl A Word V B Word V M L N N L L + B k 0 ¬ k + M < A
92 elfzonn0 k 0 ..^ N - L - M L k 0
93 91 92 impel A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L ¬ k + M < A
94 93 iffalsed A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L if k + M < A A k + M B k + M - A = B k + M - A
95 zcn k k
96 95 adantl L M k k
97 zcn M M
98 97 ad2antlr L M k M
99 zcn L L
100 99 ad2antrr L M k L
101 96 98 100 addsubassd L M k k + M - L = k + M - L
102 oveq2 L = A k + M - L = k + M - A
103 102 eqeq1d L = A k + M - L = k + M - L k + M - A = k + M - L
104 101 103 syl5ib L = A L M k k + M - A = k + M - L
105 1 104 ax-mp L M k k + M - A = k + M - L
106 105 ex L M k k + M - A = k + M - L
107 106 3adant2 L N M k k + M - A = k + M - L
108 107 adantr L N M L M M N k k + M - A = k + M - L
109 53 108 sylbi M L N k k + M - A = k + M - L
110 109 ad2antrl A Word V B Word V M L N N L L + B k k + M - A = k + M - L
111 110 47 impel A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L k + M - A = k + M - L
112 111 fveq2d A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L B k + M - A = B k + M - L
113 52 94 112 3eqtrd A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L A ++ B k + M = B k + M - L
114 ccatcl A Word V B Word V A ++ B Word V
115 114 adantr A Word V B Word V M L N N L L + B A ++ B Word V
116 11 biimpi A 0 A 0
117 1 116 eqeltrid A 0 L 0
118 fzss1 L 0 L N 0 N
119 10 117 118 3syl A Word V L N 0 N
120 119 sselda A Word V M L N M 0 N
121 120 ad2ant2r A Word V B Word V M L N N L L + B M 0 N
122 1 7 ax-mp N L L + B N A A + B
123 10 116 15 3syl A Word V A A + B 0 A + B
124 123 adantr A Word V B Word V A A + B 0 A + B
125 124 sseld A Word V B Word V N A A + B N 0 A + B
126 125 impcom N A A + B A Word V B Word V N 0 A + B
127 ccatlen A Word V B Word V A ++ B = A + B
128 127 oveq2d A Word V B Word V 0 A ++ B = 0 A + B
129 128 eleq2d A Word V B Word V N 0 A ++ B N 0 A + B
130 129 adantl N A A + B A Word V B Word V N 0 A ++ B N 0 A + B
131 126 130 mpbird N A A + B A Word V B Word V N 0 A ++ B
132 131 ex N A A + B A Word V B Word V N 0 A ++ B
133 122 132 sylbi N L L + B A Word V B Word V N 0 A ++ B
134 133 impcom A Word V B Word V N L L + B N 0 A ++ B
135 134 adantrl A Word V B Word V M L N N L L + B N 0 A ++ B
136 115 121 135 3jca A Word V B Word V M L N N L L + B A ++ B Word V M 0 N N 0 A ++ B
137 26 eleq2d M L N k 0 ..^ N - L - M L k 0 ..^ N M
138 137 ad2antrl A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L k 0 ..^ N M
139 138 biimpa A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L k 0 ..^ N M
140 swrdfv A ++ B Word V M 0 N N 0 A ++ B k 0 ..^ N M A ++ B substr M N k = A ++ B k + M
141 136 139 140 syl2an2r A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L A ++ B substr M N k = A ++ B k + M
142 34 36 sylan B Word V N L L + B N L 0 B
143 142 ad2ant2l A Word V B Word V M L N N L L + B N L 0 B
144 30 32 143 3jca A Word V B Word V M L N N L L + B B Word V M L 0 N L N L 0 B
145 swrdfv B Word V M L 0 N L N L 0 B k 0 ..^ N - L - M L B substr M L N L k = B k + M - L
146 144 145 sylan A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L B substr M L N L k = B k + M - L
147 113 141 146 3eqtr4d A Word V B Word V M L N N L L + B k 0 ..^ N - L - M L A ++ B substr M N k = B substr M L N L k
148 29 40 147 eqfnfvd A Word V B Word V M L N N L L + B A ++ B substr M N = B substr M L N L
149 148 ex A Word V B Word V M L N N L L + B A ++ B substr M N = B substr M L N L