Metamath Proof Explorer


Theorem pfxccatin12lem2

Description: Lemma 2 for pfxccatin12 . (Contributed by AV, 30-Mar-2018) (Revised by AV, 9-May-2020)

Ref Expression
Hypothesis swrdccatin2.l L = A
Assertion pfxccatin12lem2 A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A ++ B substr M N K = B prefix N L K A substr M L

Proof

Step Hyp Ref Expression
1 swrdccatin2.l L = A
2 1 pfxccatin12lem2c A Word V B Word V M 0 L N L L + B A ++ B Word V M 0 N N 0 A ++ B
3 simprl A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K 0 ..^ N M
4 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
5 2 3 4 syl2an2r A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A ++ B substr M N K = A ++ B K + M
6 elfzoelz K 0 ..^ N M K
7 elfz2nn0 M 0 L M 0 L 0 M L
8 nn0cn M 0 M
9 nn0cn L 0 L
10 8 9 anim12i M 0 L 0 M L
11 zcn K K
12 subcl L M L M
13 12 ancoms M L L M
14 13 anim1ci M L K K L M
15 subcl K L M K L M
16 14 15 syl M L K K L M
17 16 addid1d M L K K - L M + 0 = K L M
18 simpr M L K K
19 simplr M L K L
20 simpll M L K M
21 18 19 20 subsub3d M L K K L M = K + M - L
22 17 21 eqtr2d M L K K + M - L = K - L M + 0
23 10 11 22 syl2an M 0 L 0 K K + M - L = K - L M + 0
24 oveq2 A = L K + M - A = K + M - L
25 24 eqcoms L = A K + M - A = K + M - L
26 25 eqeq1d L = A K + M - A = K - L M + 0 K + M - L = K - L M + 0
27 23 26 syl5ibr L = A M 0 L 0 K K + M - A = K - L M + 0
28 1 27 ax-mp M 0 L 0 K K + M - A = K - L M + 0
29 28 ex M 0 L 0 K K + M - A = K - L M + 0
30 29 3adant3 M 0 L 0 M L K K + M - A = K - L M + 0
31 7 30 sylbi M 0 L K K + M - A = K - L M + 0
32 31 ad2antrl A Word V B Word V M 0 L N L L + B K K + M - A = K - L M + 0
33 6 32 syl5com K 0 ..^ N M A Word V B Word V M 0 L N L L + B K + M - A = K - L M + 0
34 33 adantr K 0 ..^ N M ¬ K 0 ..^ L M A Word V B Word V M 0 L N L L + B K + M - A = K - L M + 0
35 34 impcom A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K + M - A = K - L M + 0
36 35 fveq2d A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M B K + M - A = B K - L M + 0
37 simpll A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A Word V B Word V
38 pfxccatin12lem2a M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K + M L ..^ L + B
39 38 adantl A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K + M L ..^ L + B
40 39 imp A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K + M L ..^ L + B
41 id A = L A = L
42 oveq1 A = L A + B = L + B
43 41 42 oveq12d A = L A ..^ A + B = L ..^ L + B
44 43 eleq2d A = L K + M A ..^ A + B K + M L ..^ L + B
45 44 eqcoms L = A K + M A ..^ A + B K + M L ..^ L + B
46 1 45 ax-mp K + M A ..^ A + B K + M L ..^ L + B
47 40 46 sylibr A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K + M A ..^ A + B
48 df-3an A Word V B Word V K + M A ..^ A + B A Word V B Word V K + M A ..^ A + B
49 37 47 48 sylanbrc A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A Word V B Word V K + M A ..^ A + B
50 ccatval2 A Word V B Word V K + M A ..^ A + B A ++ B K + M = B K + M - A
51 49 50 syl A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A ++ B K + M = B K + M - A
52 simplr A Word V B Word V M 0 L N L L + B B Word V
53 52 adantr A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M B Word V
54 lencl B Word V B 0
55 elfzel2 M 0 L L
56 zsubcl N L N L
57 56 ancoms L N N L
58 57 adantr L N L N N L
59 zre N N
60 zre L L
61 subge0 N L 0 N L L N
62 59 60 61 syl2anr L N 0 N L L N
63 62 biimprd L N L N 0 N L
64 63 imp L N L N 0 N L
65 elnn0z N L 0 N L 0 N L
66 58 64 65 sylanbrc L N L N N L 0
67 66 expcom L N L N N L 0
68 67 adantr L N N L + B L N N L 0
69 68 expcomd L N N L + B N L N L 0
70 69 com12 N L N N L + B L N L 0
71 70 3ad2ant3 L L + B N L N N L + B L N L 0
72 71 imp L L + B N L N N L + B L N L 0
73 72 com12 L L L + B N L N N L + B N L 0
74 73 adantr L B 0 L L + B N L N N L + B N L 0
75 74 imp L B 0 L L + B N L N N L + B N L 0
76 simplr L B 0 L L + B N L N N L + B B 0
77 59 3ad2ant3 L L + B N N
78 77 adantl L B 0 L L + B N N
79 60 adantr L B 0 L
80 79 adantr L B 0 L L + B N L
81 nn0re B 0 B
82 81 adantl L B 0 B
83 82 adantr L B 0 L L + B N B
84 lesubadd2 N L B N L B N L + B
85 84 biimprd N L B N L + B N L B
86 78 80 83 85 syl3anc L B 0 L L + B N N L + B N L B
87 86 ex L B 0 L L + B N N L + B N L B
88 87 com13 N L + B L L + B N L B 0 N L B
89 88 adantl L N N L + B L L + B N L B 0 N L B
90 89 impcom L L + B N L N N L + B L B 0 N L B
91 90 impcom L B 0 L L + B N L N N L + B N L B
92 75 76 91 3jca L B 0 L L + B N L N N L + B N L 0 B 0 N L B
93 92 ex L B 0 L L + B N L N N L + B N L 0 B 0 N L B
94 elfz2 N L L + B L L + B N L N N L + B
95 elfz2nn0 N L 0 B N L 0 B 0 N L B
96 93 94 95 3imtr4g L B 0 N L L + B N L 0 B
97 96 ex L B 0 N L L + B N L 0 B
98 97 com23 L N L L + B B 0 N L 0 B
99 55 98 syl M 0 L N L L + B B 0 N L 0 B
100 99 imp M 0 L N L L + B B 0 N L 0 B
101 54 100 syl5com B Word V M 0 L N L L + B N L 0 B
102 101 adantl A Word V B Word V M 0 L N L L + B N L 0 B
103 102 imp A Word V B Word V M 0 L N L L + B N L 0 B
104 103 adantr A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M N L 0 B
105 pfxccatin12lem1 M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K L M 0 ..^ N L
106 105 adantl A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K L M 0 ..^ N L
107 106 imp A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K L M 0 ..^ N L
108 pfxfv B Word V N L 0 B K L M 0 ..^ N L B prefix N L K L M = B K L M
109 53 104 107 108 syl3anc A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M B prefix N L K L M = B K L M
110 6 zcnd K 0 ..^ N M K
111 110 ad2antrl A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K
112 55 zcnd M 0 L L
113 112 ad2antrl A Word V B Word V M 0 L N L L + B L
114 113 adantr A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M L
115 elfzelz M 0 L M
116 115 zcnd M 0 L M
117 116 ad2antrl A Word V B Word V M 0 L N L L + B M
118 117 adantr A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M M
119 114 118 subcld A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M L M
120 111 119 subcld A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K L M
121 120 addid1d A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K - L M + 0 = K L M
122 121 eqcomd A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K L M = K - L M + 0
123 122 fveq2d A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M B K L M = B K - L M + 0
124 109 123 eqtrd A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M B prefix N L K L M = B K - L M + 0
125 36 51 124 3eqtr4d A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A ++ B K + M = B prefix N L K L M
126 simpll A Word V B Word V M 0 L N L L + B A Word V
127 simprl A Word V B Word V M 0 L N L L + B M 0 L
128 lencl A Word V A 0
129 elnn0uz A 0 A 0
130 eluzfz2 A 0 A 0 A
131 129 130 sylbi A 0 A 0 A
132 1 131 eqeltrid A 0 L 0 A
133 128 132 syl A Word V L 0 A
134 133 adantr A Word V B Word V L 0 A
135 134 adantr A Word V B Word V M 0 L N L L + B L 0 A
136 126 127 135 3jca A Word V B Word V M 0 L N L L + B A Word V M 0 L L 0 A
137 136 adantr A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A Word V M 0 L L 0 A
138 swrdlen A Word V M 0 L L 0 A A substr M L = L M
139 137 138 syl A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A substr M L = L M
140 139 eqcomd A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M L M = A substr M L
141 140 oveq2d A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M K L M = K A substr M L
142 141 fveq2d A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M B prefix N L K L M = B prefix N L K A substr M L
143 5 125 142 3eqtrd A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A ++ B substr M N K = B prefix N L K A substr M L
144 143 ex A Word V B Word V M 0 L N L L + B K 0 ..^ N M ¬ K 0 ..^ L M A ++ B substr M N K = B prefix N L K A substr M L