Metamath Proof Explorer


Theorem eulerpartlemn

Description: Lemma for eulerpart . (Contributed by Thierry Arnoux, 30-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
eulerpart.s S = f 0 R k f k k
Assertion eulerpartlemn G O : O 1-1 onto D

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 simpl o = q k o = q
13 12 fveq1d o = q k o k = q k
14 13 oveq1d o = q k o k k = q k k
15 14 sumeq2dv o = q k o k k = k q k k
16 15 eqeq1d o = q k o k k = N k q k k = N
17 16 cbvrabv o T R | k o k k = N = q T R | k q k k = N
18 17 a1i o = q o T R | k o k k = N = q T R | k q k k = N
19 18 reseq2d o = q G o T R | k o k k = N = G q T R | k q k k = N
20 eqidd o = q d 0 1 R | k d k k = N = d 0 1 R | k d k k = N
21 19 18 20 f1oeq123d o = q G o T R | k o k k = N : o T R | k o k k = N 1-1 onto d 0 1 R | k d k k = N G q T R | k q k k = N : q T R | k q k k = N 1-1 onto d 0 1 R | k d k k = N
22 21 imbi2d o = q G o T R | k o k k = N : o T R | k o k k = N 1-1 onto d 0 1 R | k d k k = N G q T R | k q k k = N : q T R | k q k k = N 1-1 onto d 0 1 R | k d k k = N
23 1 2 3 4 5 6 7 8 9 10 eulerpartgbij G : T R 1-1 onto 0 1 R
24 23 a1i G : T R 1-1 onto 0 1 R
25 fveq2 q = o G q = G o
26 reseq1 q = o q J = o J
27 26 coeq2d q = o bits q J = bits o J
28 27 fveq2d q = o M bits q J = M bits o J
29 28 imaeq2d q = o F M bits q J = F M bits o J
30 29 fveq2d q = o 𝟙 F M bits q J = 𝟙 F M bits o J
31 25 30 eqeq12d q = o G q = 𝟙 F M bits q J G o = 𝟙 F M bits o J
32 1 2 3 4 5 6 7 8 9 10 eulerpartlemgv q T R G q = 𝟙 F M bits q J
33 31 32 vtoclga o T R G o = 𝟙 F M bits o J
34 33 3ad2ant2 o T R d = 𝟙 F M bits o J G o = 𝟙 F M bits o J
35 simp3 o T R d = 𝟙 F M bits o J d = 𝟙 F M bits o J
36 34 35 eqtr4d o T R d = 𝟙 F M bits o J G o = d
37 36 fveq1d o T R d = 𝟙 F M bits o J G o k = d k
38 37 oveq1d o T R d = 𝟙 F M bits o J G o k k = d k k
39 38 sumeq2sdv o T R d = 𝟙 F M bits o J k G o k k = k d k k
40 25 fveq2d q = o S G q = S G o
41 fveq2 q = o S q = S o
42 40 41 eqeq12d q = o S G q = S q S G o = S o
43 1 2 3 4 5 6 7 8 9 10 11 eulerpartlemgs2 q T R S G q = S q
44 42 43 vtoclga o T R S G o = S o
45 nn0ex 0 V
46 0nn0 0 0
47 1nn0 1 0
48 prssi 0 0 1 0 0 1 0
49 46 47 48 mp2an 0 1 0
50 mapss 0 V 0 1 0 0 1 0
51 45 49 50 mp2an 0 1 0
52 ssrin 0 1 0 0 1 R 0 R
53 51 52 ax-mp 0 1 R 0 R
54 f1of G : T R 1-1 onto 0 1 R G : T R 0 1 R
55 23 54 ax-mp G : T R 0 1 R
56 55 ffvelrni o T R G o 0 1 R
57 53 56 sselid o T R G o 0 R
58 8 11 eulerpartlemsv1 G o 0 R S G o = k G o k k
59 57 58 syl o T R S G o = k G o k k
60 1 2 3 4 5 6 7 8 9 eulerpartlemt0 o T R o 0 o -1 Fin o -1 J
61 60 simp1bi o T R o 0
62 inss2 T R R
63 62 sseli o T R o R
64 61 63 elind o T R o 0 R
65 8 11 eulerpartlemsv1 o 0 R S o = k o k k
66 64 65 syl o T R S o = k o k k
67 44 59 66 3eqtr3d o T R k G o k k = k o k k
68 67 3ad2ant2 o T R d = 𝟙 F M bits o J k G o k k = k o k k
69 39 68 eqtr3d o T R d = 𝟙 F M bits o J k d k k = k o k k
70 69 eqeq1d o T R d = 𝟙 F M bits o J k d k k = N k o k k = N
71 10 24 70 f1oresrab G o T R | k o k k = N : o T R | k o k k = N 1-1 onto d 0 1 R | k d k k = N
72 22 71 chvarvv G q T R | k q k k = N : q T R | k q k k = N 1-1 onto d 0 1 R | k d k k = N
73 cnveq g = q g -1 = q -1
74 73 imaeq1d g = q g -1 = q -1
75 74 raleqdv g = q n g -1 ¬ 2 n n q -1 ¬ 2 n
76 75 cbvrabv g P | n g -1 ¬ 2 n = q P | n q -1 ¬ 2 n
77 nfrab1 _ q q P | n q -1 ¬ 2 n
78 nfrab1 _ q q T R | k q k k = N
79 df-3an q : 0 q -1 Fin k q k k = N q : 0 q -1 Fin k q k k = N
80 79 anbi1i q : 0 q -1 Fin k q k k = N n q -1 ¬ 2 n q : 0 q -1 Fin k q k k = N n q -1 ¬ 2 n
81 1 eulerpartleme q P q : 0 q -1 Fin k q k k = N
82 81 anbi1i q P n q -1 ¬ 2 n q : 0 q -1 Fin k q k k = N n q -1 ¬ 2 n
83 an32 q : 0 q -1 Fin n q -1 ¬ 2 n k q k k = N q : 0 q -1 Fin k q k k = N n q -1 ¬ 2 n
84 80 82 83 3bitr4i q P n q -1 ¬ 2 n q : 0 q -1 Fin n q -1 ¬ 2 n k q k k = N
85 1 2 3 4 5 6 7 8 9 eulerpartlemt0 q T R q 0 q -1 Fin q -1 J
86 nnex V
87 45 86 elmap q 0 q : 0
88 87 3anbi1i q 0 q -1 Fin q -1 J q : 0 q -1 Fin q -1 J
89 85 88 bitri q T R q : 0 q -1 Fin q -1 J
90 df-3an q : 0 q -1 Fin q -1 J q : 0 q -1 Fin q -1 J
91 dfss3 q -1 J n q -1 n J
92 breq2 z = n 2 z 2 n
93 92 notbid z = n ¬ 2 z ¬ 2 n
94 93 4 elrab2 n J n ¬ 2 n
95 94 ralbii n q -1 n J n q -1 n ¬ 2 n
96 r19.26 n q -1 n ¬ 2 n n q -1 n n q -1 ¬ 2 n
97 91 95 96 3bitri q -1 J n q -1 n n q -1 ¬ 2 n
98 cnvimass q -1 dom q
99 fdm q : 0 dom q =
100 98 99 sseqtrid q : 0 q -1
101 dfss3 q -1 n q -1 n
102 100 101 sylib q : 0 n q -1 n
103 102 biantrurd q : 0 n q -1 ¬ 2 n n q -1 n n q -1 ¬ 2 n
104 97 103 bitr4id q : 0 q -1 J n q -1 ¬ 2 n
105 104 adantr q : 0 q -1 Fin q -1 J n q -1 ¬ 2 n
106 105 pm5.32i q : 0 q -1 Fin q -1 J q : 0 q -1 Fin n q -1 ¬ 2 n
107 89 90 106 3bitri q T R q : 0 q -1 Fin n q -1 ¬ 2 n
108 107 anbi1i q T R k q k k = N q : 0 q -1 Fin n q -1 ¬ 2 n k q k k = N
109 84 108 bitr4i q P n q -1 ¬ 2 n q T R k q k k = N
110 rabid q q P | n q -1 ¬ 2 n q P n q -1 ¬ 2 n
111 rabid q q T R | k q k k = N q T R k q k k = N
112 109 110 111 3bitr4i q q P | n q -1 ¬ 2 n q q T R | k q k k = N
113 77 78 112 eqri q P | n q -1 ¬ 2 n = q T R | k q k k = N
114 2 76 113 3eqtri O = q T R | k q k k = N
115 114 reseq2i G O = G q T R | k q k k = N
116 115 a1i G O = G q T R | k q k k = N
117 114 a1i O = q T R | k q k k = N
118 nfcv _ d D
119 nfrab1 _ d d 0 1 R | k d k k = N
120 fnima d Fn d = ran d
121 120 sseq1d d Fn d 0 1 ran d 0 1
122 121 anbi2d d Fn ran d 0 d 0 1 ran d 0 ran d 0 1
123 sstr ran d 0 1 0 1 0 ran d 0
124 49 123 mpan2 ran d 0 1 ran d 0
125 124 pm4.71ri ran d 0 1 ran d 0 ran d 0 1
126 122 125 bitr4di d Fn ran d 0 d 0 1 ran d 0 1
127 126 pm5.32i d Fn ran d 0 d 0 1 d Fn ran d 0 1
128 anass d Fn ran d 0 d 0 1 d Fn ran d 0 d 0 1
129 df-f d : 0 1 d Fn ran d 0 1
130 127 128 129 3bitr4ri d : 0 1 d Fn ran d 0 d 0 1
131 prex 0 1 V
132 131 86 elmap d 0 1 d : 0 1
133 df-f d : 0 d Fn ran d 0
134 133 anbi1i d : 0 d 0 1 d Fn ran d 0 d 0 1
135 130 132 134 3bitr4i d 0 1 d : 0 d 0 1
136 vex d V
137 cnveq f = d f -1 = d -1
138 137 imaeq1d f = d f -1 = d -1
139 138 eleq1d f = d f -1 Fin d -1 Fin
140 136 139 8 elab2 d R d -1 Fin
141 135 140 anbi12i d 0 1 d R d : 0 d 0 1 d -1 Fin
142 elin d 0 1 R d 0 1 d R
143 an32 d : 0 d -1 Fin d 0 1 d : 0 d 0 1 d -1 Fin
144 141 142 143 3bitr4i d 0 1 R d : 0 d -1 Fin d 0 1
145 144 anbi1i d 0 1 R k d k k = N d : 0 d -1 Fin d 0 1 k d k k = N
146 1 eulerpartleme d P d : 0 d -1 Fin k d k k = N
147 146 anbi1i d P d 0 1 d : 0 d -1 Fin k d k k = N d 0 1
148 df-3an d : 0 d -1 Fin k d k k = N d : 0 d -1 Fin k d k k = N
149 148 anbi1i d : 0 d -1 Fin k d k k = N d 0 1 d : 0 d -1 Fin k d k k = N d 0 1
150 an32 d : 0 d -1 Fin k d k k = N d 0 1 d : 0 d -1 Fin d 0 1 k d k k = N
151 147 149 150 3bitri d P d 0 1 d : 0 d -1 Fin d 0 1 k d k k = N
152 145 151 bitr4i d 0 1 R k d k k = N d P d 0 1
153 rabid d d 0 1 R | k d k k = N d 0 1 R k d k k = N
154 1 2 3 eulerpartlemd d D d P d 0 1
155 152 153 154 3bitr4ri d D d d 0 1 R | k d k k = N
156 118 119 155 eqri D = d 0 1 R | k d k k = N
157 156 a1i D = d 0 1 R | k d k k = N
158 116 117 157 f1oeq123d G O : O 1-1 onto D G q T R | k q k k = N : q T R | k q k k = N 1-1 onto d 0 1 R | k d k k = N
159 72 158 mpbird G O : O 1-1 onto D
160 159 mptru G O : O 1-1 onto D