Metamath Proof Explorer


Theorem swrdccat

Description: The subword of a concatenation of two words as concatenation of subwords of the two concatenated words. (Contributed by Alexander van der Vekens, 29-May-2018)

Ref Expression
Hypothesis swrdccatin2.l L=A
Assertion swrdccat AWordVBWordVM0NN0L+BA++BsubstrMN=AsubstrMifNLNL++Bsubstrif0MLML0NL

Proof

Step Hyp Ref Expression
1 swrdccatin2.l L=A
2 1 pfxccat3 AWordVBWordVM0NN0L+BA++BsubstrMN=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
3 2 imp AWordVBWordVM0NN0L+BA++BsubstrMN=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
4 lencl AWordVA0
5 4 adantr AWordVBWordVA0
6 1 eqcomi A=L
7 6 eleq1i A0L0
8 elfz2nn0 M0NM0N0MN
9 iftrue NLifNLNL=N
10 9 adantl AWordVBWordVM0N0L0NLifNLNL=N
11 10 opeq2d AWordVBWordVM0N0L0NLMifNLNL=MN
12 11 oveq2d AWordVBWordVM0N0L0NLAsubstrMifNLNL=AsubstrMN
13 iftrue 0MLif0MLML0=ML
14 13 opeq1d 0MLif0MLML0NL=MLNL
15 14 oveq2d 0MLBsubstrif0MLML0NL=BsubstrMLNL
16 15 adantr 0MLAWordVBWordVM0N0L0NLBsubstrif0MLML0NL=BsubstrMLNL
17 simpr AWordVBWordVBWordV
18 nn0z L0L
19 nn0z M0M
20 19 adantr M0N0M
21 zsubcl MLML
22 20 21 sylan M0N0LML
23 nn0z N0N
24 23 adantl M0N0N
25 zsubcl NLNL
26 24 25 sylan M0N0LNL
27 22 26 jca M0N0LMLNL
28 18 27 sylan2 M0N0L0MLNL
29 17 28 anim12i AWordVBWordVM0N0L0BWordVMLNL
30 3anass BWordVMLNLBWordVMLNL
31 29 30 sylibr AWordVBWordVM0N0L0BWordVMLNL
32 31 ad2antrl 0MLAWordVBWordVM0N0L0NLBWordVMLNL
33 nn0re M0M
34 nn0re N0N
35 33 34 anim12i M0N0MN
36 nn0re L0L
37 subge0 ML0MLLM
38 37 adantlr MNL0MLLM
39 simpr MNN
40 39 adantr MNLN
41 simpr MNLL
42 simpl MNM
43 42 adantr MNLM
44 letr NLMNLLMNM
45 40 41 43 44 syl3anc MNLNLLMNM
46 45 expcomd MNLLMNLNM
47 38 46 sylbid MNL0MLNLNM
48 47 com23 MNLNL0MLNM
49 35 36 48 syl2an M0N0L0NL0MLNM
50 49 adantl AWordVBWordVM0N0L0NL0MLNM
51 50 imp AWordVBWordVM0N0L0NL0MLNM
52 51 impcom 0MLAWordVBWordVM0N0L0NLNM
53 34 adantl M0N0N
54 53 adantr M0N0L0N
55 33 adantr M0N0M
56 55 adantr M0N0L0M
57 36 adantl M0N0L0L
58 54 56 57 3jca M0N0L0NML
59 58 adantl AWordVBWordVM0N0L0NML
60 59 ad2antrl 0MLAWordVBWordVM0N0L0NLNML
61 lesub1 NMLNMNLML
62 60 61 syl 0MLAWordVBWordVM0N0L0NLNMNLML
63 52 62 mpbid 0MLAWordVBWordVM0N0L0NLNLML
64 swrdlend BWordVMLNLNLMLBsubstrMLNL=
65 32 63 64 sylc 0MLAWordVBWordVM0N0L0NLBsubstrMLNL=
66 16 65 eqtrd 0MLAWordVBWordVM0N0L0NLBsubstrif0MLML0NL=
67 iffalse ¬0MLif0MLML0=0
68 67 opeq1d ¬0MLif0MLML0NL=0NL
69 68 oveq2d ¬0MLBsubstrif0MLML0NL=Bsubstr0NL
70 17 adantr AWordVBWordVM0N0L0BWordV
71 70 adantr AWordVBWordVM0N0L0NLBWordV
72 0zd AWordVBWordVM0N0L0NL0
73 24 18 25 syl2an M0N0L0NL
74 73 adantl AWordVBWordVM0N0L0NL
75 74 adantr AWordVBWordVM0N0L0NLNL
76 71 72 75 3jca AWordVBWordVM0N0L0NLBWordV0NL
77 53 36 anim12i M0N0L0NL
78 77 adantl AWordVBWordVM0N0L0NL
79 suble0 NLNL0NL
80 78 79 syl AWordVBWordVM0N0L0NL0NL
81 80 biimpar AWordVBWordVM0N0L0NLNL0
82 swrdlend BWordV0NLNL0Bsubstr0NL=
83 76 81 82 sylc AWordVBWordVM0N0L0NLBsubstr0NL=
84 69 83 sylan9eq ¬0MLAWordVBWordVM0N0L0NLBsubstrif0MLML0NL=
85 66 84 pm2.61ian AWordVBWordVM0N0L0NLBsubstrif0MLML0NL=
86 12 85 oveq12d AWordVBWordVM0N0L0NLAsubstrMifNLNL++Bsubstrif0MLML0NL=AsubstrMN++
87 swrdcl AWordVAsubstrMNWordV
88 ccatrid AsubstrMNWordVAsubstrMN++=AsubstrMN
89 87 88 syl AWordVAsubstrMN++=AsubstrMN
90 89 adantr AWordVBWordVAsubstrMN++=AsubstrMN
91 90 adantr AWordVBWordVM0N0L0AsubstrMN++=AsubstrMN
92 91 adantr AWordVBWordVM0N0L0NLAsubstrMN++=AsubstrMN
93 86 92 eqtrd AWordVBWordVM0N0L0NLAsubstrMifNLNL++Bsubstrif0MLML0NL=AsubstrMN
94 iffalse ¬NLifNLNL=L
95 94 3ad2ant2 AWordVBWordVM0N0L0¬NLLMifNLNL=L
96 95 opeq2d AWordVBWordVM0N0L0¬NLLMMifNLNL=ML
97 96 oveq2d AWordVBWordVM0N0L0¬NLLMAsubstrMifNLNL=AsubstrML
98 simpl AWordVBWordVAWordV
99 98 20 18 3anim123i AWordVBWordVM0N0L0AWordVML
100 99 3expb AWordVBWordVM0N0L0AWordVML
101 swrdlend AWordVMLLMAsubstrML=
102 100 101 syl AWordVBWordVM0N0L0LMAsubstrML=
103 102 imp AWordVBWordVM0N0L0LMAsubstrML=
104 103 3adant2 AWordVBWordVM0N0L0¬NLLMAsubstrML=
105 97 104 eqtrd AWordVBWordVM0N0L0¬NLLMAsubstrMifNLNL=
106 55 36 37 syl2an M0N0L00MLLM
107 106 biimprd M0N0L0LM0ML
108 107 adantl AWordVBWordVM0N0L0LM0ML
109 108 imp AWordVBWordVM0N0L0LM0ML
110 109 3adant2 AWordVBWordVM0N0L0¬NLLM0ML
111 110 14 syl AWordVBWordVM0N0L0¬NLLMif0MLML0NL=MLNL
112 111 oveq2d AWordVBWordVM0N0L0¬NLLMBsubstrif0MLML0NL=BsubstrMLNL
113 105 112 oveq12d AWordVBWordVM0N0L0¬NLLMAsubstrMifNLNL++Bsubstrif0MLML0NL=++BsubstrMLNL
114 swrdcl BWordVBsubstrMLNLWordV
115 114 adantl AWordVBWordVBsubstrMLNLWordV
116 ccatlid BsubstrMLNLWordV++BsubstrMLNL=BsubstrMLNL
117 115 116 syl AWordVBWordV++BsubstrMLNL=BsubstrMLNL
118 117 adantr AWordVBWordVM0N0L0++BsubstrMLNL=BsubstrMLNL
119 118 3ad2ant1 AWordVBWordVM0N0L0¬NLLM++BsubstrMLNL=BsubstrMLNL
120 113 119 eqtrd AWordVBWordVM0N0L0¬NLLMAsubstrMifNLNL++Bsubstrif0MLML0NL=BsubstrMLNL
121 94 3ad2ant2 AWordVBWordVM0N0L0¬NL¬LMifNLNL=L
122 121 opeq2d AWordVBWordVM0N0L0¬NL¬LMMifNLNL=ML
123 122 oveq2d AWordVBWordVM0N0L0¬NL¬LMAsubstrMifNLNL=AsubstrML
124 33 36 37 syl2an M0L00MLLM
125 124 adantlr M0N0L00MLLM
126 125 adantl AWordVBWordVM0N0L00MLLM
127 126 biimpd AWordVBWordVM0N0L00MLLM
128 127 con3dimp AWordVBWordVM0N0L0¬LM¬0ML
129 128 3adant2 AWordVBWordVM0N0L0¬NL¬LM¬0ML
130 129 67 syl AWordVBWordVM0N0L0¬NL¬LMif0MLML0=0
131 130 opeq1d AWordVBWordVM0N0L0¬NL¬LMif0MLML0NL=0NL
132 131 oveq2d AWordVBWordVM0N0L0¬NL¬LMBsubstrif0MLML0NL=Bsubstr0NL
133 70 3ad2ant1 AWordVBWordVM0N0L0¬NL¬LMBWordV
134 simplrr AWordVBWordVM0N0L0¬NLL0
135 simprlr AWordVBWordVM0N0L0N0
136 135 adantr AWordVBWordVM0N0L0¬NLN0
137 ltnle LNL<N¬NL
138 ltle LNL<NLN
139 137 138 sylbird LN¬NLLN
140 36 53 139 syl2anr M0N0L0¬NLLN
141 140 adantl AWordVBWordVM0N0L0¬NLLN
142 141 imp AWordVBWordVM0N0L0¬NLLN
143 nn0sub2 L0N0LNNL0
144 134 136 142 143 syl3anc AWordVBWordVM0N0L0¬NLNL0
145 144 3adant3 AWordVBWordVM0N0L0¬NL¬LMNL0
146 133 145 jca AWordVBWordVM0N0L0¬NL¬LMBWordVNL0
147 pfxval BWordVNL0BprefixNL=Bsubstr0NL
148 146 147 syl AWordVBWordVM0N0L0¬NL¬LMBprefixNL=Bsubstr0NL
149 132 148 eqtr4d AWordVBWordVM0N0L0¬NL¬LMBsubstrif0MLML0NL=BprefixNL
150 123 149 oveq12d AWordVBWordVM0N0L0¬NL¬LMAsubstrMifNLNL++Bsubstrif0MLML0NL=AsubstrML++BprefixNL
151 93 120 150 2if2 AWordVBWordVM0N0L0AsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
152 151 exp32 AWordVBWordVM0N0L0AsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
153 152 com12 M0N0AWordVBWordVL0AsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
154 153 3adant3 M0N0MNAWordVBWordVL0AsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
155 8 154 sylbi M0NAWordVBWordVL0AsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
156 155 adantr M0NN0L+BAWordVBWordVL0AsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
157 156 com13 L0AWordVBWordVM0NN0L+BAsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
158 7 157 sylbi A0AWordVBWordVM0NN0L+BAsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
159 5 158 mpcom AWordVBWordVM0NN0L+BAsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
160 159 imp AWordVBWordVM0NN0L+BAsubstrMifNLNL++Bsubstrif0MLML0NL=ifNLAsubstrMNifLMBsubstrMLNLAsubstrML++BprefixNL
161 3 160 eqtr4d AWordVBWordVM0NN0L+BA++BsubstrMN=AsubstrMifNLNL++Bsubstrif0MLML0NL
162 161 ex AWordVBWordVM0NN0L+BA++BsubstrMN=AsubstrMifNLNL++Bsubstrif0MLML0NL