Metamath Proof Explorer


Theorem eulerpartlemgvv

Description: Lemma for eulerpart : value of the function G evaluated. (Contributed by Thierry Arnoux, 10-Aug-2018)

Ref Expression
Hypotheses eulerpart.p P = f 0 | f -1 Fin k f k k = N
eulerpart.o O = g P | n g -1 ¬ 2 n
eulerpart.d D = g P | n g n 1
eulerpart.j J = z | ¬ 2 z
eulerpart.f F = x J , y 0 2 y x
eulerpart.h H = r 𝒫 0 Fin J | r supp Fin
eulerpart.m M = r H x y | x J y r x
eulerpart.r R = f | f -1 Fin
eulerpart.t T = f 0 | f -1 J
eulerpart.g G = o T R 𝟙 F M bits o J
Assertion eulerpartlemgvv A T R B G A B = if t n bits A t 2 n t = B 1 0

Proof

Step Hyp Ref Expression
1 eulerpart.p P = f 0 | f -1 Fin k f k k = N
2 eulerpart.o O = g P | n g -1 ¬ 2 n
3 eulerpart.d D = g P | n g n 1
4 eulerpart.j J = z | ¬ 2 z
5 eulerpart.f F = x J , y 0 2 y x
6 eulerpart.h H = r 𝒫 0 Fin J | r supp Fin
7 eulerpart.m M = r H x y | x J y r x
8 eulerpart.r R = f | f -1 Fin
9 eulerpart.t T = f 0 | f -1 J
10 eulerpart.g G = o T R 𝟙 F M bits o J
11 1 2 3 4 5 6 7 8 9 10 eulerpartlemgv A T R G A = 𝟙 F M bits A J
12 11 fveq1d A T R G A B = 𝟙 F M bits A J B
13 12 adantr A T R B G A B = 𝟙 F M bits A J B
14 nnex V
15 imassrn F M bits A J ran F
16 4 5 oddpwdc F : J × 0 1-1 onto
17 f1of F : J × 0 1-1 onto F : J × 0
18 frn F : J × 0 ran F
19 16 17 18 mp2b ran F
20 15 19 sstri F M bits A J
21 simpr A T R B B
22 indfval V F M bits A J B 𝟙 F M bits A J B = if B F M bits A J 1 0
23 14 20 21 22 mp3an12i A T R B 𝟙 F M bits A J B = if B F M bits A J 1 0
24 ffn F : J × 0 F Fn J × 0
25 16 17 24 mp2b F Fn J × 0
26 1 2 3 4 5 6 7 8 9 10 eulerpartlemmf A T R bits A J H
27 1 2 3 4 5 6 7 eulerpartlem1 M : H 1-1 onto 𝒫 J × 0 Fin
28 f1of M : H 1-1 onto 𝒫 J × 0 Fin M : H 𝒫 J × 0 Fin
29 27 28 ax-mp M : H 𝒫 J × 0 Fin
30 29 ffvelrni bits A J H M bits A J 𝒫 J × 0 Fin
31 26 30 syl A T R M bits A J 𝒫 J × 0 Fin
32 31 elin1d A T R M bits A J 𝒫 J × 0
33 32 adantr A T R B M bits A J 𝒫 J × 0
34 33 elpwid A T R B M bits A J J × 0
35 fvelimab F Fn J × 0 M bits A J J × 0 B F M bits A J w M bits A J F w = B
36 25 34 35 sylancr A T R B B F M bits A J w M bits A J F w = B
37 4 ssrab3 J
38 fveq1 r = bits A J r x = bits A J x
39 38 eleq2d r = bits A J y r x y bits A J x
40 39 anbi2d r = bits A J x J y r x x J y bits A J x
41 40 opabbidv r = bits A J x y | x J y r x = x y | x J y bits A J x
42 14 37 ssexi J V
43 abid2 y | y bits A J x = bits A J x
44 43 fvexi y | y bits A J x V
45 44 a1i x J y | y bits A J x V
46 42 45 opabex3 x y | x J y bits A J x V
47 46 a1i A T R x y | x J y bits A J x V
48 7 41 26 47 fvmptd3 A T R M bits A J = x y | x J y bits A J x
49 simpl x = t y = n x = t
50 49 eleq1d x = t y = n x J t J
51 simpr x = t y = n y = n
52 49 fveq2d x = t y = n bits A J x = bits A J t
53 51 52 eleq12d x = t y = n y bits A J x n bits A J t
54 50 53 anbi12d x = t y = n x J y bits A J x t J n bits A J t
55 54 cbvopabv x y | x J y bits A J x = t n | t J n bits A J t
56 48 55 eqtrdi A T R M bits A J = t n | t J n bits A J t
57 56 eleq2d A T R w M bits A J w t n | t J n bits A J t
58 1 2 3 4 5 6 7 8 9 eulerpartlemt0 A T R A 0 A -1 Fin A -1 J
59 58 simp1bi A T R A 0
60 nn0ex 0 V
61 60 14 elmap A 0 A : 0
62 59 61 sylib A T R A : 0
63 ffun A : 0 Fun A
64 funres Fun A Fun A J
65 62 63 64 3syl A T R Fun A J
66 fssres A : 0 J A J : J 0
67 62 37 66 sylancl A T R A J : J 0
68 fdm A J : J 0 dom A J = J
69 68 eleq2d A J : J 0 t dom A J t J
70 67 69 syl A T R t dom A J t J
71 70 biimpar A T R t J t dom A J
72 fvco Fun A J t dom A J bits A J t = bits A J t
73 65 71 72 syl2an2r A T R t J bits A J t = bits A J t
74 fvres t J A J t = A t
75 74 fveq2d t J bits A J t = bits A t
76 75 adantl A T R t J bits A J t = bits A t
77 73 76 eqtrd A T R t J bits A J t = bits A t
78 77 eleq2d A T R t J n bits A J t n bits A t
79 78 pm5.32da A T R t J n bits A J t t J n bits A t
80 79 opabbidv A T R t n | t J n bits A J t = t n | t J n bits A t
81 80 eleq2d A T R w t n | t J n bits A J t w t n | t J n bits A t
82 elopab w t n | t J n bits A t t n w = t n t J n bits A t
83 81 82 bitrdi A T R w t n | t J n bits A J t t n w = t n t J n bits A t
84 ancom w = t n t J n bits A t t J n bits A t w = t n
85 anass t J n bits A t w = t n t J n bits A t w = t n
86 84 85 bitri w = t n t J n bits A t t J n bits A t w = t n
87 86 2exbii t n w = t n t J n bits A t t n t J n bits A t w = t n
88 df-rex n bits A t w = t n n n bits A t w = t n
89 88 anbi2i t J n bits A t w = t n t J n n bits A t w = t n
90 89 exbii t t J n bits A t w = t n t t J n n bits A t w = t n
91 df-rex t J n bits A t w = t n t t J n bits A t w = t n
92 exdistr t n t J n bits A t w = t n t t J n n bits A t w = t n
93 90 91 92 3bitr4i t J n bits A t w = t n t n t J n bits A t w = t n
94 87 93 bitr4i t n w = t n t J n bits A t t J n bits A t w = t n
95 83 94 bitrdi A T R w t n | t J n bits A J t t J n bits A t w = t n
96 57 95 bitrd A T R w M bits A J t J n bits A t w = t n
97 96 biimpa A T R w M bits A J t J n bits A t w = t n
98 97 adantlr A T R B w M bits A J t J n bits A t w = t n
99 fveq2 w = t n F w = F t n
100 99 adantl A T R B w M bits A J t J n bits A t w = t n F w = F t n
101 bitsss bits A t 0
102 101 sseli n bits A t n 0
103 102 anim2i t J n bits A t t J n 0
104 103 ad2antlr A T R B w M bits A J t J n bits A t w = t n t J n 0
105 opelxp t n J × 0 t J n 0
106 4 5 oddpwdcv t n J × 0 F t n = 2 2 nd t n 1 st t n
107 vex t V
108 vex n V
109 107 108 op2nd 2 nd t n = n
110 109 oveq2i 2 2 nd t n = 2 n
111 107 108 op1st 1 st t n = t
112 110 111 oveq12i 2 2 nd t n 1 st t n = 2 n t
113 106 112 eqtrdi t n J × 0 F t n = 2 n t
114 105 113 sylbir t J n 0 F t n = 2 n t
115 104 114 syl A T R B w M bits A J t J n bits A t w = t n F t n = 2 n t
116 100 115 eqtr2d A T R B w M bits A J t J n bits A t w = t n 2 n t = F w
117 116 ex A T R B w M bits A J t J n bits A t w = t n 2 n t = F w
118 117 reximdvva A T R B w M bits A J t J n bits A t w = t n t J n bits A t 2 n t = F w
119 98 118 mpd A T R B w M bits A J t J n bits A t 2 n t = F w
120 ssrexv J t J n bits A t 2 n t = F w t n bits A t 2 n t = F w
121 37 119 120 mpsyl A T R B w M bits A J t n bits A t 2 n t = F w
122 121 adantr A T R B w M bits A J F w = B t n bits A t 2 n t = F w
123 eqeq2 F w = B 2 n t = F w 2 n t = B
124 123 rexbidv F w = B n bits A t 2 n t = F w n bits A t 2 n t = B
125 124 adantl A T R B w M bits A J F w = B n bits A t 2 n t = F w n bits A t 2 n t = B
126 125 rexbidv A T R B w M bits A J F w = B t n bits A t 2 n t = F w t n bits A t 2 n t = B
127 122 126 mpbid A T R B w M bits A J F w = B t n bits A t 2 n t = B
128 127 r19.29an A T R B w M bits A J F w = B t n bits A t 2 n t = B
129 simp-5l A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B A T R
130 simpllr A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B x J
131 simplr A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B y bits A x
132 68 eleq2d A J : J 0 x dom A J x J
133 67 132 syl A T R x dom A J x J
134 133 biimpar A T R x J x dom A J
135 fvco Fun A J x dom A J bits A J x = bits A J x
136 65 134 135 syl2an2r A T R x J bits A J x = bits A J x
137 fvres x J A J x = A x
138 137 fveq2d x J bits A J x = bits A x
139 138 adantl A T R x J bits A J x = bits A x
140 136 139 eqtrd A T R x J bits A J x = bits A x
141 129 130 140 syl2anc A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B bits A J x = bits A x
142 131 141 eleqtrrd A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B y bits A J x
143 48 eleq2d A T R x y M bits A J x y x y | x J y bits A J x
144 opabidw x y x y | x J y bits A J x x J y bits A J x
145 143 144 bitrdi A T R x y M bits A J x J y bits A J x
146 145 biimpar A T R x J y bits A J x x y M bits A J
147 129 130 142 146 syl12anc A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B x y M bits A J
148 simpr A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B 2 y x = B
149 34 ad4antr A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B M bits A J J × 0
150 149 147 sseldd A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B x y J × 0
151 opeq1 t = x t y = x y
152 151 eleq1d t = x t y J × 0 x y J × 0
153 151 fveq2d t = x F t y = F x y
154 oveq2 t = x 2 y t = 2 y x
155 153 154 eqeq12d t = x F t y = 2 y t F x y = 2 y x
156 152 155 imbi12d t = x t y J × 0 F t y = 2 y t x y J × 0 F x y = 2 y x
157 opeq2 n = y t n = t y
158 157 eleq1d n = y t n J × 0 t y J × 0
159 157 fveq2d n = y F t n = F t y
160 oveq2 n = y 2 n = 2 y
161 160 oveq1d n = y 2 n t = 2 y t
162 159 161 eqeq12d n = y F t n = 2 n t F t y = 2 y t
163 158 162 imbi12d n = y t n J × 0 F t n = 2 n t t y J × 0 F t y = 2 y t
164 163 113 chvarvv t y J × 0 F t y = 2 y t
165 156 164 chvarvv x y J × 0 F x y = 2 y x
166 eqeq2 2 y x = B F x y = 2 y x F x y = B
167 166 biimpa 2 y x = B F x y = 2 y x F x y = B
168 165 167 sylan2 2 y x = B x y J × 0 F x y = B
169 148 150 168 syl2anc A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B F x y = B
170 fveqeq2 w = x y F w = B F x y = B
171 170 rspcev x y M bits A J F x y = B w M bits A J F w = B
172 147 169 171 syl2anc A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B w M bits A J F w = B
173 oveq2 t = x 2 n t = 2 n x
174 173 eqeq1d t = x 2 n t = B 2 n x = B
175 160 oveq1d n = y 2 n x = 2 y x
176 175 eqeq1d n = y 2 n x = B 2 y x = B
177 174 176 sylan9bb t = x n = y 2 n t = B 2 y x = B
178 simpl t = x n = y t = x
179 178 fveq2d t = x n = y A t = A x
180 179 fveq2d t = x n = y bits A t = bits A x
181 177 180 cbvrexdva2 t = x n bits A t 2 n t = B y bits A x 2 y x = B
182 181 cbvrexvw t n bits A t 2 n t = B x y bits A x 2 y x = B
183 nfv y A T R
184 nfv y x
185 nfre1 y y bits A x 2 y x = B
186 184 185 nfan y x y bits A x 2 y x = B
187 183 186 nfan y A T R x y bits A x 2 y x = B
188 simplr A T R x y bits A x x
189 62 ffvelrnda A T R x A x 0
190 189 adantr A T R x y bits A x A x 0
191 elnn0 A x 0 A x A x = 0
192 190 191 sylib A T R x y bits A x A x A x = 0
193 n0i y bits A x ¬ bits A x =
194 193 adantl A T R x y bits A x ¬ bits A x =
195 fveq2 A x = 0 bits A x = bits 0
196 0bits bits 0 =
197 195 196 eqtrdi A x = 0 bits A x =
198 194 197 nsyl A T R x y bits A x ¬ A x = 0
199 192 198 olcnd A T R x y bits A x A x
200 58 simp3bi A T R A -1 J
201 200 sselda A T R n A -1 n J
202 breq2 z = n 2 z 2 n
203 202 notbid z = n ¬ 2 z ¬ 2 n
204 203 4 elrab2 n J n ¬ 2 n
205 204 simprbi n J ¬ 2 n
206 201 205 syl A T R n A -1 ¬ 2 n
207 206 ralrimiva A T R n A -1 ¬ 2 n
208 ffn A : 0 A Fn
209 elpreima A Fn n A -1 n A n
210 62 208 209 3syl A T R n A -1 n A n
211 210 imbi1d A T R n A -1 ¬ 2 n n A n ¬ 2 n
212 impexp n A n ¬ 2 n n A n ¬ 2 n
213 211 212 bitrdi A T R n A -1 ¬ 2 n n A n ¬ 2 n
214 213 ralbidv2 A T R n A -1 ¬ 2 n n A n ¬ 2 n
215 207 214 mpbid A T R n A n ¬ 2 n
216 fveq2 x = n A x = A n
217 216 eleq1d x = n A x A n
218 breq2 x = n 2 x 2 n
219 218 notbid x = n ¬ 2 x ¬ 2 n
220 217 219 imbi12d x = n A x ¬ 2 x A n ¬ 2 n
221 220 cbvralvw x A x ¬ 2 x n A n ¬ 2 n
222 215 221 sylibr A T R x A x ¬ 2 x
223 222 r19.21bi A T R x A x ¬ 2 x
224 223 imp A T R x A x ¬ 2 x
225 199 224 syldan A T R x y bits A x ¬ 2 x
226 breq2 z = x 2 z 2 x
227 226 notbid z = x ¬ 2 z ¬ 2 x
228 227 4 elrab2 x J x ¬ 2 x
229 188 225 228 sylanbrc A T R x y bits A x x J
230 229 adantlrr A T R x y bits A x 2 y x = B y bits A x x J
231 230 adantr A T R x y bits A x 2 y x = B y bits A x 2 y x = B x J
232 simprr A T R x y bits A x 2 y x = B y bits A x 2 y x = B
233 187 231 232 r19.29af A T R x y bits A x 2 y x = B x J
234 233 232 jca A T R x y bits A x 2 y x = B x J y bits A x 2 y x = B
235 234 ex A T R x y bits A x 2 y x = B x J y bits A x 2 y x = B
236 235 reximdv2 A T R x y bits A x 2 y x = B x J y bits A x 2 y x = B
237 236 imp A T R x y bits A x 2 y x = B x J y bits A x 2 y x = B
238 237 adantlr A T R B x y bits A x 2 y x = B x J y bits A x 2 y x = B
239 182 238 sylan2b A T R B t n bits A t 2 n t = B x J y bits A x 2 y x = B
240 172 239 r19.29vva A T R B t n bits A t 2 n t = B w M bits A J F w = B
241 128 240 impbida A T R B w M bits A J F w = B t n bits A t 2 n t = B
242 36 241 bitrd A T R B B F M bits A J t n bits A t 2 n t = B
243 242 ifbid A T R B if B F M bits A J 1 0 = if t n bits A t 2 n t = B 1 0
244 13 23 243 3eqtrd A T R B G A B = if t n bits A t 2 n t = B 1 0