Metamath Proof Explorer


Theorem cycpmco2lem5

Description: Lemma for cycpmco2 . (Contributed by Thierry Arnoux, 4-Jan-2024)

Ref Expression
Hypotheses cycpmco2.c M = toCyc D
cycpmco2.s S = SymGrp D
cycpmco2.d φ D V
cycpmco2.w φ W dom M
cycpmco2.i φ I D ran W
cycpmco2.j φ J ran W
cycpmco2.e E = W -1 J + 1
cycpmco2.1 U = W splice E E ⟨“ I ”⟩
cycpmco2lem.1 φ K ran W
cycpmco2lem5.1 φ U -1 K = U 1
Assertion cycpmco2lem5 φ M U K = M W K

Proof

Step Hyp Ref Expression
1 cycpmco2.c M = toCyc D
2 cycpmco2.s S = SymGrp D
3 cycpmco2.d φ D V
4 cycpmco2.w φ W dom M
5 cycpmco2.i φ I D ran W
6 cycpmco2.j φ J ran W
7 cycpmco2.e E = W -1 J + 1
8 cycpmco2.1 U = W splice E E ⟨“ I ”⟩
9 cycpmco2lem.1 φ K ran W
10 cycpmco2lem5.1 φ U -1 K = U 1
11 9 adantr φ W = E K ran W
12 ovexd φ W -1 J + 1 V
13 7 12 eqeltrid φ E V
14 5 eldifad φ I D
15 14 s1cld φ ⟨“ I ”⟩ Word D
16 splval W dom M E V E V ⟨“ I ”⟩ Word D W splice E E ⟨“ I ”⟩ = W prefix E ++ ⟨“ I ”⟩ ++ W substr E W
17 4 13 13 15 16 syl13anc φ W splice E E ⟨“ I ”⟩ = W prefix E ++ ⟨“ I ”⟩ ++ W substr E W
18 8 17 eqtrid φ U = W prefix E ++ ⟨“ I ”⟩ ++ W substr E W
19 18 fveq2d φ U = W prefix E ++ ⟨“ I ”⟩ ++ W substr E W
20 ssrab2 w Word D | w : dom w 1-1 D Word D
21 eqid Base S = Base S
22 1 2 21 tocycf D V M : w Word D | w : dom w 1-1 D Base S
23 3 22 syl φ M : w Word D | w : dom w 1-1 D Base S
24 23 fdmd φ dom M = w Word D | w : dom w 1-1 D
25 4 24 eleqtrd φ W w Word D | w : dom w 1-1 D
26 20 25 sselid φ W Word D
27 pfxcl W Word D W prefix E Word D
28 26 27 syl φ W prefix E Word D
29 ccatcl W prefix E Word D ⟨“ I ”⟩ Word D W prefix E ++ ⟨“ I ”⟩ Word D
30 28 15 29 syl2anc φ W prefix E ++ ⟨“ I ”⟩ Word D
31 swrdcl W Word D W substr E W Word D
32 26 31 syl φ W substr E W Word D
33 ccatlen W prefix E ++ ⟨“ I ”⟩ Word D W substr E W Word D W prefix E ++ ⟨“ I ”⟩ ++ W substr E W = W prefix E ++ ⟨“ I ”⟩ + W substr E W
34 30 32 33 syl2anc φ W prefix E ++ ⟨“ I ”⟩ ++ W substr E W = W prefix E ++ ⟨“ I ”⟩ + W substr E W
35 ccatws1len W prefix E Word D W prefix E ++ ⟨“ I ”⟩ = W prefix E + 1
36 28 35 syl φ W prefix E ++ ⟨“ I ”⟩ = W prefix E + 1
37 id w = W w = W
38 dmeq w = W dom w = dom W
39 eqidd w = W D = D
40 37 38 39 f1eq123d w = W w : dom w 1-1 D W : dom W 1-1 D
41 40 elrab W w Word D | w : dom w 1-1 D W Word D W : dom W 1-1 D
42 25 41 sylib φ W Word D W : dom W 1-1 D
43 42 simprd φ W : dom W 1-1 D
44 f1cnv W : dom W 1-1 D W -1 : ran W 1-1 onto dom W
45 43 44 syl φ W -1 : ran W 1-1 onto dom W
46 f1of W -1 : ran W 1-1 onto dom W W -1 : ran W dom W
47 45 46 syl φ W -1 : ran W dom W
48 47 6 ffvelrnd φ W -1 J dom W
49 wrddm W Word D dom W = 0 ..^ W
50 26 49 syl φ dom W = 0 ..^ W
51 48 50 eleqtrd φ W -1 J 0 ..^ W
52 fzofzp1 W -1 J 0 ..^ W W -1 J + 1 0 W
53 51 52 syl φ W -1 J + 1 0 W
54 7 53 eqeltrid φ E 0 W
55 pfxlen W Word D E 0 W W prefix E = E
56 26 54 55 syl2anc φ W prefix E = E
57 56 oveq1d φ W prefix E + 1 = E + 1
58 36 57 eqtrd φ W prefix E ++ ⟨“ I ”⟩ = E + 1
59 lencl W Word D W 0
60 26 59 syl φ W 0
61 nn0fz0 W 0 W 0 W
62 60 61 sylib φ W 0 W
63 swrdlen W Word D E 0 W W 0 W W substr E W = W E
64 26 54 62 63 syl3anc φ W substr E W = W E
65 58 64 oveq12d φ W prefix E ++ ⟨“ I ”⟩ + W substr E W = E + 1 + W E
66 19 34 65 3eqtrd φ U = E + 1 + W E
67 fz0ssnn0 0 W 0
68 67 54 sselid φ E 0
69 68 nn0zd φ E
70 69 peano2zd φ E + 1
71 70 zcnd φ E + 1
72 60 nn0cnd φ W
73 68 nn0cnd φ E
74 71 72 73 addsubassd φ E + 1 + W - E = E + 1 + W E
75 1cnd φ 1
76 73 75 72 addassd φ E + 1 + W = E + 1 + W
77 76 oveq1d φ E + 1 + W - E = E + 1 + W - E
78 66 74 77 3eqtr2d φ U = E + 1 + W - E
79 75 72 addcld φ 1 + W
80 73 79 pncan2d φ E + 1 + W - E = 1 + W
81 75 72 addcomd φ 1 + W = W + 1
82 78 80 81 3eqtrd φ U = W + 1
83 oveq1 W = E W + 1 = E + 1
84 82 83 sylan9eq φ W = E U = E + 1
85 84 oveq1d φ W = E U 1 = E + 1 - 1
86 73 75 pncand φ E + 1 - 1 = E
87 86 adantr φ W = E E + 1 - 1 = E
88 85 87 eqtrd φ W = E U 1 = E
89 88 fveq2d φ W = E U U 1 = U E
90 10 fveq2d φ U U -1 K = U U 1
91 1 2 3 4 5 6 7 8 cycpmco2f1 φ U : dom U 1-1 D
92 f1f1orn U : dom U 1-1 D U : dom U 1-1 onto ran U
93 91 92 syl φ U : dom U 1-1 onto ran U
94 ssun1 ran W ran W I
95 1 2 3 4 5 6 7 8 cycpmco2rn φ ran U = ran W I
96 94 95 sseqtrrid φ ran W ran U
97 96 sselda φ K ran W K ran U
98 f1ocnvfv2 U : dom U 1-1 onto ran U K ran U U U -1 K = K
99 93 97 98 syl2an2r φ K ran W U U -1 K = K
100 9 99 mpdan φ U U -1 K = K
101 90 100 eqtr3d φ U U 1 = K
102 101 adantr φ W = E U U 1 = K
103 1 2 3 4 5 6 7 8 cycpmco2lem2 φ U E = I
104 103 adantr φ W = E U E = I
105 89 102 104 3eqtr3d φ W = E K = I
106 5 eldifbd φ ¬ I ran W
107 106 adantr φ W = E ¬ I ran W
108 105 107 eqneltrd φ W = E ¬ K ran W
109 11 108 pm2.21dd φ W = E M U U U 1 = M W U U 1
110 splcl W Word D ⟨“ I ”⟩ Word D W splice E E ⟨“ I ”⟩ Word D
111 26 15 110 syl2anc φ W splice E E ⟨“ I ”⟩ Word D
112 8 111 eqeltrid φ U Word D
113 nn0p1gt0 W 0 0 < W + 1
114 60 113 syl φ 0 < W + 1
115 114 82 breqtrrd φ 0 < U
116 eqidd φ U 1 = U 1
117 1 3 112 91 115 116 cycpmfv2 φ M U U U 1 = U 0
118 117 adantr φ W E M U U U 1 = U 0
119 f1f W : dom W 1-1 D W : dom W D
120 43 119 syl φ W : dom W D
121 120 frnd φ ran W D
122 3 121 ssexd φ ran W V
123 6 ne0d φ ran W
124 hashgt0 ran W V ran W 0 < ran W
125 122 123 124 syl2anc φ 0 < ran W
126 4 dmexd φ dom W V
127 hashf1rn dom W V W : dom W 1-1 D W = ran W
128 126 43 127 syl2anc φ W = ran W
129 125 128 breqtrrd φ 0 < W
130 eqidd φ W 1 = W 1
131 1 3 26 43 129 130 cycpmfv2 φ M W W W 1 = W 0
132 131 adantr φ W E M W W W 1 = W 0
133 8 a1i φ W E U = W splice E E ⟨“ I ”⟩
134 1 2 3 4 5 6 7 8 cycpmco2lem3 φ U 1 = W
135 73 75 addcomd φ E + 1 = 1 + E
136 135 oveq2d φ W - 1 - E + E + 1 = W - 1 - E + 1 + E
137 72 75 subcld φ W 1
138 137 73 75 nppcan3d φ W - 1 - E + 1 + E = W - 1 + 1
139 72 75 npcand φ W - 1 + 1 = W
140 136 138 139 3eqtrd φ W - 1 - E + E + 1 = W
141 134 140 eqtr4d φ U 1 = W - 1 - E + E + 1
142 141 adantr φ W E U 1 = W - 1 - E + E + 1
143 133 142 fveq12d φ W E U U 1 = W splice E E ⟨“ I ”⟩ W - 1 - E + E + 1
144 26 adantr φ W E W Word D
145 nn0fz0 E 0 E 0 E
146 68 145 sylib φ E 0 E
147 146 adantr φ W E E 0 E
148 54 adantr φ W E E 0 W
149 15 adantr φ W E ⟨“ I ”⟩ Word D
150 72 adantr φ W E W
151 1cnd φ W E 1
152 73 adantr φ W E E
153 150 151 152 sub32d φ W E W - 1 - E = W - E - 1
154 fznn0sub E 0 W W E 0
155 54 154 syl φ W E 0
156 155 adantr φ W E W E 0
157 simpr φ W E W E
158 150 152 156 157 subne0nn φ W E W E
159 fzo0end W E W - E - 1 0 ..^ W E
160 158 159 syl φ W E W - E - 1 0 ..^ W E
161 153 160 eqeltrd φ W E W - 1 - E 0 ..^ W E
162 s1len ⟨“ I ”⟩ = 1
163 162 eqcomi 1 = ⟨“ I ”⟩
164 163 oveq2i E + 1 = E + ⟨“ I ”⟩
165 164 a1i φ W E E + 1 = E + ⟨“ I ”⟩
166 144 147 148 149 161 165 splfv3 φ W E W splice E E ⟨“ I ”⟩ W - 1 - E + E + 1 = W W 1 - E + E
167 137 73 npcand φ W 1 - E + E = W 1
168 167 fveq2d φ W W 1 - E + E = W W 1
169 168 adantr φ W E W W 1 - E + E = W W 1
170 143 166 169 3eqtrd φ W E U U 1 = W W 1
171 170 fveq2d φ W E M W U U 1 = M W W W 1
172 18 fveq1d φ U 0 = W prefix E ++ ⟨“ I ”⟩ ++ W substr E W 0
173 nn0p1nn E 0 E + 1
174 68 173 syl φ E + 1
175 lbfzo0 0 0 ..^ E + 1 E + 1
176 174 175 sylibr φ 0 0 ..^ E + 1
177 58 oveq2d φ 0 ..^ W prefix E ++ ⟨“ I ”⟩ = 0 ..^ E + 1
178 176 177 eleqtrrd φ 0 0 ..^ W prefix E ++ ⟨“ I ”⟩
179 ccatval1 W prefix E ++ ⟨“ I ”⟩ Word D W substr E W Word D 0 0 ..^ W prefix E ++ ⟨“ I ”⟩ W prefix E ++ ⟨“ I ”⟩ ++ W substr E W 0 = W prefix E ++ ⟨“ I ”⟩ 0
180 30 32 178 179 syl3anc φ W prefix E ++ ⟨“ I ”⟩ ++ W substr E W 0 = W prefix E ++ ⟨“ I ”⟩ 0
181 elfzonn0 W -1 J 0 ..^ W W -1 J 0
182 51 181 syl φ W -1 J 0
183 nn0p1nn W -1 J 0 W -1 J + 1
184 182 183 syl φ W -1 J + 1
185 7 184 eqeltrid φ E
186 lbfzo0 0 0 ..^ E E
187 185 186 sylibr φ 0 0 ..^ E
188 56 oveq2d φ 0 ..^ W prefix E = 0 ..^ E
189 187 188 eleqtrrd φ 0 0 ..^ W prefix E
190 ccatval1 W prefix E Word D ⟨“ I ”⟩ Word D 0 0 ..^ W prefix E W prefix E ++ ⟨“ I ”⟩ 0 = W prefix E 0
191 28 15 189 190 syl3anc φ W prefix E ++ ⟨“ I ”⟩ 0 = W prefix E 0
192 nn0p1gt0 W -1 J 0 0 < W -1 J + 1
193 182 192 syl φ 0 < W -1 J + 1
194 193 7 breqtrrdi φ 0 < E
195 194 gt0ne0d φ E 0
196 fzne1 E 0 W E 0 E 0 + 1 W
197 54 195 196 syl2anc φ E 0 + 1 W
198 0p1e1 0 + 1 = 1
199 198 oveq1i 0 + 1 W = 1 W
200 197 199 eleqtrdi φ E 1 W
201 pfxfv0 W Word D E 1 W W prefix E 0 = W 0
202 26 200 201 syl2anc φ W prefix E 0 = W 0
203 180 191 202 3eqtrd φ W prefix E ++ ⟨“ I ”⟩ ++ W substr E W 0 = W 0
204 172 203 eqtrd φ U 0 = W 0
205 204 adantr φ W E U 0 = W 0
206 132 171 205 3eqtr4rd φ W E U 0 = M W U U 1
207 118 206 eqtrd φ W E M U U U 1 = M W U U 1
208 109 207 pm2.61dane φ M U U U 1 = M W U U 1
209 101 fveq2d φ M U U U 1 = M U K
210 101 fveq2d φ M W U U 1 = M W K
211 208 209 210 3eqtr3d φ M U K = M W K