Metamath Proof Explorer


Theorem eulerpartlemgs2

Description: Lemma for eulerpart : The G function also preserves partition sums. (Contributed by Thierry Arnoux, 10-Sep-2017)

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
eulerpart.s S = f 0 R k f k k
Assertion eulerpartlemgs2 A T R S G A = S A

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 eulerpart.s S = f 0 R k f k k
12 cnvimass G A -1 dom G A
13 1 2 3 4 5 6 7 8 9 10 eulerpartgbij G : T R 1-1 onto 0 1 R
14 f1of G : T R 1-1 onto 0 1 R G : T R 0 1 R
15 13 14 ax-mp G : T R 0 1 R
16 15 ffvelrni A T R G A 0 1 R
17 elin G A 0 1 R G A 0 1 G A R
18 16 17 sylib A T R G A 0 1 G A R
19 18 simpld A T R G A 0 1
20 elmapi G A 0 1 G A : 0 1
21 fdm G A : 0 1 dom G A =
22 19 20 21 3syl A T R dom G A =
23 12 22 sseqtrid A T R G A -1
24 23 sselda A T R k G A -1 k
25 1 2 3 4 5 6 7 8 9 10 eulerpartlemgvv A T R k G A k = if t n bits A t 2 n t = k 1 0
26 25 oveq1d A T R k G A k k = if t n bits A t 2 n t = k 1 0 k
27 24 26 syldan A T R k G A -1 G A k k = if t n bits A t 2 n t = k 1 0 k
28 27 sumeq2dv A T R k G A -1 G A k k = k G A -1 if t n bits A t 2 n t = k 1 0 k
29 eqeq2 m = k 2 n t = m 2 n t = k
30 29 2rexbidv m = k t n bits A t 2 n t = m t n bits A t 2 n t = k
31 30 elrab k m | t n bits A t 2 n t = m k t n bits A t 2 n t = k
32 31 simprbi k m | t n bits A t 2 n t = m t n bits A t 2 n t = k
33 32 iftrued k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 = 1
34 33 oveq1d k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = 1 k
35 elrabi k m | t n bits A t 2 n t = m k
36 35 nncnd k m | t n bits A t 2 n t = m k
37 36 mulid2d k m | t n bits A t 2 n t = m 1 k = k
38 34 37 eqtrd k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = k
39 38 sumeq2i k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = k m | t n bits A t 2 n t = m k
40 id k = 2 2 nd w 1 st w k = 2 2 nd w 1 st w
41 1 2 3 4 5 6 7 8 9 10 eulerpartlemgf A T R G A -1 Fin
42 35 adantl A T R k m | t n bits A t 2 n t = m k
43 42 25 syldan A T R k m | t n bits A t 2 n t = m G A k = if t n bits A t 2 n t = k 1 0
44 32 adantl A T R k m | t n bits A t 2 n t = m t n bits A t 2 n t = k
45 44 iftrued A T R k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 = 1
46 43 45 eqtrd A T R k m | t n bits A t 2 n t = m G A k = 1
47 1nn 1
48 46 47 eqeltrdi A T R k m | t n bits A t 2 n t = m G A k
49 19 20 syl A T R G A : 0 1
50 ffn G A : 0 1 G A Fn
51 elpreima G A Fn k G A -1 k G A k
52 49 50 51 3syl A T R k G A -1 k G A k
53 52 adantr A T R k m | t n bits A t 2 n t = m k G A -1 k G A k
54 42 48 53 mpbir2and A T R k m | t n bits A t 2 n t = m k G A -1
55 54 ex A T R k m | t n bits A t 2 n t = m k G A -1
56 55 ssrdv A T R m | t n bits A t 2 n t = m G A -1
57 ssfi G A -1 Fin m | t n bits A t 2 n t = m G A -1 m | t n bits A t 2 n t = m Fin
58 41 56 57 syl2anc A T R m | t n bits A t 2 n t = m Fin
59 cnvexg A T R A -1 V
60 imaexg A -1 V A -1 V
61 inex1g A -1 V A -1 J V
62 59 60 61 3syl A T R A -1 J V
63 snex t V
64 fvex bits A t V
65 63 64 xpex t × bits A t V
66 65 rgenw t A -1 J t × bits A t V
67 iunexg A -1 J V t A -1 J t × bits A t V t A -1 J t × bits A t V
68 62 66 67 sylancl A T R t A -1 J t × bits A t V
69 eqid t A -1 J t × bits A t = t A -1 J t × bits A t
70 1 2 3 4 5 6 7 8 9 10 69 eulerpartlemgh A T R F t A -1 J t × bits A t : t A -1 J t × bits A t 1-1 onto m | t n bits A t 2 n t = m
71 f1oeng t A -1 J t × bits A t V F t A -1 J t × bits A t : t A -1 J t × bits A t 1-1 onto m | t n bits A t 2 n t = m t A -1 J t × bits A t m | t n bits A t 2 n t = m
72 68 70 71 syl2anc A T R t A -1 J t × bits A t m | t n bits A t 2 n t = m
73 enfii m | t n bits A t 2 n t = m Fin t A -1 J t × bits A t m | t n bits A t 2 n t = m t A -1 J t × bits A t Fin
74 58 72 73 syl2anc A T R t A -1 J t × bits A t Fin
75 fvres w t A -1 J t × bits A t F t A -1 J t × bits A t w = F w
76 75 adantl A T R w t A -1 J t × bits A t F t A -1 J t × bits A t w = F w
77 inss2 A -1 J J
78 simpr A T R t A -1 J t A -1 J
79 77 78 sselid A T R t A -1 J t J
80 79 snssd A T R t A -1 J t J
81 bitsss bits A t 0
82 xpss12 t J bits A t 0 t × bits A t J × 0
83 80 81 82 sylancl A T R t A -1 J t × bits A t J × 0
84 83 ralrimiva A T R t A -1 J t × bits A t J × 0
85 iunss t A -1 J t × bits A t J × 0 t A -1 J t × bits A t J × 0
86 84 85 sylibr A T R t A -1 J t × bits A t J × 0
87 86 sselda A T R w t A -1 J t × bits A t w J × 0
88 4 5 oddpwdcv w J × 0 F w = 2 2 nd w 1 st w
89 87 88 syl A T R w t A -1 J t × bits A t F w = 2 2 nd w 1 st w
90 76 89 eqtrd A T R w t A -1 J t × bits A t F t A -1 J t × bits A t w = 2 2 nd w 1 st w
91 42 nncnd A T R k m | t n bits A t 2 n t = m k
92 40 74 70 90 91 fsumf1o A T R k m | t n bits A t 2 n t = m k = w t A -1 J t × bits A t 2 2 nd w 1 st w
93 39 92 syl5eq A T R k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = w t A -1 J t × bits A t 2 2 nd w 1 st w
94 ax-1cn 1
95 0cn 0
96 94 95 ifcli if t n bits A t 2 n t = k 1 0
97 96 a1i A T R k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0
98 ssrab2 m | t n bits A t 2 n t = m
99 simpr A T R k m | t n bits A t 2 n t = m k m | t n bits A t 2 n t = m
100 98 99 sselid A T R k m | t n bits A t 2 n t = m k
101 100 nncnd A T R k m | t n bits A t 2 n t = m k
102 97 101 mulcld A T R k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k
103 simpr A T R k G A -1 m | t n bits A t 2 n t = m k G A -1 m | t n bits A t 2 n t = m
104 103 eldifbd A T R k G A -1 m | t n bits A t 2 n t = m ¬ k m | t n bits A t 2 n t = m
105 23 ssdifssd A T R G A -1 m | t n bits A t 2 n t = m
106 105 sselda A T R k G A -1 m | t n bits A t 2 n t = m k
107 31 notbii ¬ k m | t n bits A t 2 n t = m ¬ k t n bits A t 2 n t = k
108 imnan k ¬ t n bits A t 2 n t = k ¬ k t n bits A t 2 n t = k
109 107 108 sylbb2 ¬ k m | t n bits A t 2 n t = m k ¬ t n bits A t 2 n t = k
110 104 106 109 sylc A T R k G A -1 m | t n bits A t 2 n t = m ¬ t n bits A t 2 n t = k
111 110 iffalsed A T R k G A -1 m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 = 0
112 111 oveq1d A T R k G A -1 m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = 0 k
113 nnsscn
114 105 113 sstrdi A T R G A -1 m | t n bits A t 2 n t = m
115 114 sselda A T R k G A -1 m | t n bits A t 2 n t = m k
116 115 mul02d A T R k G A -1 m | t n bits A t 2 n t = m 0 k = 0
117 112 116 eqtrd A T R k G A -1 m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = 0
118 56 102 117 41 fsumss A T R k m | t n bits A t 2 n t = m if t n bits A t 2 n t = k 1 0 k = k G A -1 if t n bits A t 2 n t = k 1 0 k
119 93 118 eqtr3d A T R w t A -1 J t × bits A t 2 2 nd w 1 st w = k G A -1 if t n bits A t 2 n t = k 1 0 k
120 1 2 3 4 5 6 7 8 9 eulerpartlemt0 A T R A 0 A -1 Fin A -1 J
121 120 simp1bi A T R A 0
122 elmapi A 0 A : 0
123 121 122 syl A T R A : 0
124 123 adantr A T R t A -1 J A : 0
125 cnvimass A -1 dom A
126 125 123 fssdm A T R A -1
127 126 adantr A T R t A -1 J A -1
128 inss1 A -1 J A -1
129 128 78 sselid A T R t A -1 J t A -1
130 127 129 sseldd A T R t A -1 J t
131 124 130 ffvelrnd A T R t A -1 J A t 0
132 bitsfi A t 0 bits A t Fin
133 131 132 syl A T R t A -1 J bits A t Fin
134 130 nncnd A T R t A -1 J t
135 2cnd A T R t A -1 J n bits A t 2
136 simprr A T R t A -1 J n bits A t n bits A t
137 81 136 sselid A T R t A -1 J n bits A t n 0
138 135 137 expcld A T R t A -1 J n bits A t 2 n
139 138 anassrs A T R t A -1 J n bits A t 2 n
140 133 134 139 fsummulc1 A T R t A -1 J n bits A t 2 n t = n bits A t 2 n t
141 140 sumeq2dv A T R t A -1 J n bits A t 2 n t = t A -1 J n bits A t 2 n t
142 bitsinv1 A t 0 n bits A t 2 n = A t
143 142 oveq1d A t 0 n bits A t 2 n t = A t t
144 131 143 syl A T R t A -1 J n bits A t 2 n t = A t t
145 144 sumeq2dv A T R t A -1 J n bits A t 2 n t = t A -1 J A t t
146 vex t V
147 vex n V
148 146 147 op2ndd w = t n 2 nd w = n
149 148 oveq2d w = t n 2 2 nd w = 2 n
150 146 147 op1std w = t n 1 st w = t
151 149 150 oveq12d w = t n 2 2 nd w 1 st w = 2 n t
152 inss2 T R R
153 152 sseli A T R A R
154 cnveq f = A f -1 = A -1
155 154 imaeq1d f = A f -1 = A -1
156 155 eleq1d f = A f -1 Fin A -1 Fin
157 156 8 elab2g A T R A R A -1 Fin
158 153 157 mpbid A T R A -1 Fin
159 ssfi A -1 Fin A -1 J A -1 A -1 J Fin
160 158 128 159 sylancl A T R A -1 J Fin
161 134 adantrr A T R t A -1 J n bits A t t
162 138 161 mulcld A T R t A -1 J n bits A t 2 n t
163 151 160 133 162 fsum2d A T R t A -1 J n bits A t 2 n t = w t A -1 J t × bits A t 2 2 nd w 1 st w
164 141 145 163 3eqtr3d A T R t A -1 J A t t = w t A -1 J t × bits A t 2 2 nd w 1 st w
165 inss1 T R T
166 165 sseli A T R A T
167 155 sseq1d f = A f -1 J A -1 J
168 167 9 elrab2 A T A 0 A -1 J
169 168 simprbi A T A -1 J
170 166 169 syl A T R A -1 J
171 df-ss A -1 J A -1 J = A -1
172 170 171 sylib A T R A -1 J = A -1
173 172 sumeq1d A T R t A -1 J A t t = t A -1 A t t
174 164 173 eqtr3d A T R w t A -1 J t × bits A t 2 2 nd w 1 st w = t A -1 A t t
175 28 119 174 3eqtr2d A T R k G A -1 G A k k = t A -1 A t t
176 fveq2 k = t A k = A t
177 id k = t k = t
178 176 177 oveq12d k = t A k k = A t t
179 178 cbvsumv k A -1 A k k = t A -1 A t t
180 175 179 eqtr4di A T R k G A -1 G A k k = k A -1 A k k
181 0nn0 0 0
182 1nn0 1 0
183 prssi 0 0 1 0 0 1 0
184 181 182 183 mp2an 0 1 0
185 fss G A : 0 1 0 1 0 G A : 0
186 184 185 mpan2 G A : 0 1 G A : 0
187 nn0ex 0 V
188 nnex V
189 187 188 elmap G A 0 G A : 0
190 189 biimpri G A : 0 G A 0
191 20 186 190 3syl G A 0 1 G A 0
192 191 anim1i G A 0 1 G A R G A 0 G A R
193 elin G A 0 R G A 0 G A R
194 192 17 193 3imtr4i G A 0 1 R G A 0 R
195 8 11 eulerpartlemsv2 G A 0 R S G A = k G A -1 G A k k
196 16 194 195 3syl A T R S G A = k G A -1 G A k k
197 121 153 elind A T R A 0 R
198 8 11 eulerpartlemsv2 A 0 R S A = k A -1 A k k
199 197 198 syl A T R S A = k A -1 A k k
200 180 196 199 3eqtr4d A T R S G A = S A