Metamath Proof Explorer


Theorem lgseisenlem4

Description: Lemma for lgseisen . The function M is an injection (and hence a bijection by the pigeonhole principle). (Contributed by Mario Carneiro, 18-Jun-2015) (Proof shortened by AV, 15-Jun-2019)

Ref Expression
Hypotheses lgseisen.1 φ P 2
lgseisen.2 φ Q 2
lgseisen.3 φ P Q
lgseisen.4 R = Q 2 x mod P
lgseisen.5 M = x 1 P 1 2 1 R R mod P 2
lgseisen.6 S = Q 2 y mod P
lgseisen.7 Y = /P
lgseisen.8 G = mulGrp Y
lgseisen.9 L = ℤRHom Y
Assertion lgseisenlem4 φ Q P 1 2 mod P = 1 x = 1 P 1 2 Q P 2 x mod P

Proof

Step Hyp Ref Expression
1 lgseisen.1 φ P 2
2 lgseisen.2 φ Q 2
3 lgseisen.3 φ P Q
4 lgseisen.4 R = Q 2 x mod P
5 lgseisen.5 M = x 1 P 1 2 1 R R mod P 2
6 lgseisen.6 S = Q 2 y mod P
7 lgseisen.7 Y = /P
8 lgseisen.8 G = mulGrp Y
9 lgseisen.9 L = ℤRHom Y
10 zringbas = Base ring
11 zring0 0 = 0 ring
12 zringabl ring Abel
13 ablcmn ring Abel ring CMnd
14 12 13 mp1i φ ring CMnd
15 1 eldifad φ P
16 7 znfld P Y Field
17 15 16 syl φ Y Field
18 isfld Y Field Y DivRing Y CRing
19 18 simprbi Y Field Y CRing
20 17 19 syl φ Y CRing
21 8 crngmgp Y CRing G CMnd
22 20 21 syl φ G CMnd
23 cmnmnd G CMnd G Mnd
24 22 23 syl φ G Mnd
25 fzfid φ 1 P 1 2 Fin
26 crngring Y CRing Y Ring
27 20 26 syl φ Y Ring
28 9 zrhrhm Y Ring L ring RingHom Y
29 27 28 syl φ L ring RingHom Y
30 eqid Base Y = Base Y
31 10 30 rhmf L ring RingHom Y L : Base Y
32 29 31 syl φ L : Base Y
33 m1expcl k 1 k
34 33 adantl φ k 1 k
35 32 34 cofmpt φ L k 1 k = k L 1 k
36 zringmpg mulGrp fld 𝑠 = mulGrp ring
37 36 8 rhmmhm L ring RingHom Y L mulGrp fld 𝑠 MndHom G
38 29 37 syl φ L mulGrp fld 𝑠 MndHom G
39 neg1cn 1
40 neg1ne0 1 0
41 eqid mulGrp fld = mulGrp fld
42 eqid mulGrp fld 𝑠 0 = mulGrp fld 𝑠 0
43 41 42 expghm 1 1 0 k 1 k ring GrpHom mulGrp fld 𝑠 0
44 39 40 43 mp2an k 1 k ring GrpHom mulGrp fld 𝑠 0
45 ghmmhm k 1 k ring GrpHom mulGrp fld 𝑠 0 k 1 k ring MndHom mulGrp fld 𝑠 0
46 44 45 ax-mp k 1 k ring MndHom mulGrp fld 𝑠 0
47 cnring fld Ring
48 cnfldbas = Base fld
49 cnfld0 0 = 0 fld
50 cndrng fld DivRing
51 48 49 50 drngui 0 = Unit fld
52 51 41 unitsubm fld Ring 0 SubMnd mulGrp fld
53 47 52 ax-mp 0 SubMnd mulGrp fld
54 42 resmhm2 k 1 k ring MndHom mulGrp fld 𝑠 0 0 SubMnd mulGrp fld k 1 k ring MndHom mulGrp fld
55 46 53 54 mp2an k 1 k ring MndHom mulGrp fld
56 zsubrg SubRing fld
57 41 subrgsubm SubRing fld SubMnd mulGrp fld
58 56 57 ax-mp SubMnd mulGrp fld
59 34 fmpttd φ k 1 k :
60 59 frnd φ ran k 1 k
61 eqid mulGrp fld 𝑠 = mulGrp fld 𝑠
62 61 resmhm2b SubMnd mulGrp fld ran k 1 k k 1 k ring MndHom mulGrp fld k 1 k ring MndHom mulGrp fld 𝑠
63 58 60 62 sylancr φ k 1 k ring MndHom mulGrp fld k 1 k ring MndHom mulGrp fld 𝑠
64 55 63 mpbii φ k 1 k ring MndHom mulGrp fld 𝑠
65 mhmco L mulGrp fld 𝑠 MndHom G k 1 k ring MndHom mulGrp fld 𝑠 L k 1 k ring MndHom G
66 38 64 65 syl2anc φ L k 1 k ring MndHom G
67 35 66 eqeltrrd φ k L 1 k ring MndHom G
68 2 gausslemma2dlem0a φ Q
69 68 nnred φ Q
70 1 gausslemma2dlem0a φ P
71 69 70 nndivred φ Q P
72 71 adantr φ x 1 P 1 2 Q P
73 2nn 2
74 elfznn x 1 P 1 2 x
75 74 adantl φ x 1 P 1 2 x
76 nnmulcl 2 x 2 x
77 73 75 76 sylancr φ x 1 P 1 2 2 x
78 77 nnred φ x 1 P 1 2 2 x
79 72 78 remulcld φ x 1 P 1 2 Q P 2 x
80 79 flcld φ x 1 P 1 2 Q P 2 x
81 eqid x 1 P 1 2 Q P 2 x = x 1 P 1 2 Q P 2 x
82 fvexd φ x 1 P 1 2 Q P 2 x V
83 c0ex 0 V
84 83 a1i φ 0 V
85 81 25 82 84 fsuppmptdm φ finSupp 0 x 1 P 1 2 Q P 2 x
86 oveq2 k = Q P 2 x 1 k = 1 Q P 2 x
87 86 fveq2d k = Q P 2 x L 1 k = L 1 Q P 2 x
88 oveq2 k = ring x = 1 P 1 2 Q P 2 x 1 k = 1 ring x = 1 P 1 2 Q P 2 x
89 88 fveq2d k = ring x = 1 P 1 2 Q P 2 x L 1 k = L 1 ring x = 1 P 1 2 Q P 2 x
90 10 11 14 24 25 67 80 85 87 89 gsummhm2 φ G x = 1 P 1 2 L 1 Q P 2 x = L 1 ring x = 1 P 1 2 Q P 2 x
91 8 30 mgpbas Base Y = Base G
92 eqid Y = Y
93 8 92 mgpplusg Y = + G
94 32 adantr φ x 1 P 1 2 L : Base Y
95 m1expcl Q P 2 x 1 Q P 2 x
96 80 95 syl φ x 1 P 1 2 1 Q P 2 x
97 94 96 ffvelrnd φ x 1 P 1 2 L 1 Q P 2 x Base Y
98 neg1z 1
99 2 eldifad φ Q
100 99 adantr φ x 1 P 1 2 Q
101 prmz Q Q
102 100 101 syl φ x 1 P 1 2 Q
103 77 nnzd φ x 1 P 1 2 2 x
104 102 103 zmulcld φ x 1 P 1 2 Q 2 x
105 15 adantr φ x 1 P 1 2 P
106 prmnn P P
107 105 106 syl φ x 1 P 1 2 P
108 104 107 zmodcld φ x 1 P 1 2 Q 2 x mod P 0
109 4 108 eqeltrid φ x 1 P 1 2 R 0
110 zexpcl 1 R 0 1 R
111 98 109 110 sylancr φ x 1 P 1 2 1 R
112 111 102 zmulcld φ x 1 P 1 2 1 R Q
113 94 112 ffvelrnd φ x 1 P 1 2 L 1 R Q Base Y
114 eqid x 1 P 1 2 L 1 Q P 2 x = x 1 P 1 2 L 1 Q P 2 x
115 eqid x 1 P 1 2 L 1 R Q = x 1 P 1 2 L 1 R Q
116 91 93 22 25 97 113 114 115 gsummptfidmadd2 φ G x 1 P 1 2 L 1 Q P 2 x Y f x 1 P 1 2 L 1 R Q = G x = 1 P 1 2 L 1 Q P 2 x Y G x = 1 P 1 2 L 1 R Q
117 eqidd φ x 1 P 1 2 L 1 Q P 2 x = x 1 P 1 2 L 1 Q P 2 x
118 eqidd φ x 1 P 1 2 L 1 R Q = x 1 P 1 2 L 1 R Q
119 25 97 113 117 118 offval2 φ x 1 P 1 2 L 1 Q P 2 x Y f x 1 P 1 2 L 1 R Q = x 1 P 1 2 L 1 Q P 2 x Y L 1 R Q
120 29 adantr φ x 1 P 1 2 L ring RingHom Y
121 zringmulr × = ring
122 10 121 92 rhmmul L ring RingHom Y 1 Q P 2 x 1 R Q L 1 Q P 2 x 1 R Q = L 1 Q P 2 x Y L 1 R Q
123 120 96 112 122 syl3anc φ x 1 P 1 2 L 1 Q P 2 x 1 R Q = L 1 Q P 2 x Y L 1 R Q
124 104 zred φ x 1 P 1 2 Q 2 x
125 107 nnrpd φ x 1 P 1 2 P +
126 modval Q 2 x P + Q 2 x mod P = Q 2 x P Q 2 x P
127 124 125 126 syl2anc φ x 1 P 1 2 Q 2 x mod P = Q 2 x P Q 2 x P
128 4 127 syl5eq φ x 1 P 1 2 R = Q 2 x P Q 2 x P
129 102 zcnd φ x 1 P 1 2 Q
130 77 nncnd φ x 1 P 1 2 2 x
131 107 nncnd φ x 1 P 1 2 P
132 107 nnne0d φ x 1 P 1 2 P 0
133 129 130 131 132 div23d φ x 1 P 1 2 Q 2 x P = Q P 2 x
134 133 fveq2d φ x 1 P 1 2 Q 2 x P = Q P 2 x
135 134 oveq2d φ x 1 P 1 2 P Q 2 x P = P Q P 2 x
136 135 oveq2d φ x 1 P 1 2 Q 2 x P Q 2 x P = Q 2 x P Q P 2 x
137 128 136 eqtrd φ x 1 P 1 2 R = Q 2 x P Q P 2 x
138 137 oveq2d φ x 1 P 1 2 P Q P 2 x + R = P Q P 2 x + Q 2 x - P Q P 2 x
139 prmz P P
140 105 139 syl φ x 1 P 1 2 P
141 140 80 zmulcld φ x 1 P 1 2 P Q P 2 x
142 141 zcnd φ x 1 P 1 2 P Q P 2 x
143 104 zcnd φ x 1 P 1 2 Q 2 x
144 142 143 pncan3d φ x 1 P 1 2 P Q P 2 x + Q 2 x - P Q P 2 x = Q 2 x
145 2cnd φ x 1 P 1 2 2
146 75 nncnd φ x 1 P 1 2 x
147 129 145 146 mul12d φ x 1 P 1 2 Q 2 x = 2 Q x
148 138 144 147 3eqtrd φ x 1 P 1 2 P Q P 2 x + R = 2 Q x
149 148 oveq2d φ x 1 P 1 2 1 P Q P 2 x + R = 1 2 Q x
150 39 a1i φ x 1 P 1 2 1
151 40 a1i φ x 1 P 1 2 1 0
152 109 nn0zd φ x 1 P 1 2 R
153 expaddz 1 1 0 P Q P 2 x R 1 P Q P 2 x + R = 1 P Q P 2 x 1 R
154 150 151 141 152 153 syl22anc φ x 1 P 1 2 1 P Q P 2 x + R = 1 P Q P 2 x 1 R
155 expmulz 1 1 0 P Q P 2 x 1 P Q P 2 x = -1 P Q P 2 x
156 150 151 140 80 155 syl22anc φ x 1 P 1 2 1 P Q P 2 x = -1 P Q P 2 x
157 1cnd φ x 1 P 1 2 1
158 eldifsni P 2 P 2
159 1 158 syl φ P 2
160 159 necomd φ 2 P
161 160 neneqd φ ¬ 2 = P
162 161 adantr φ x 1 P 1 2 ¬ 2 = P
163 2z 2
164 uzid 2 2 2
165 163 164 ax-mp 2 2
166 dvdsprm 2 2 P 2 P 2 = P
167 165 105 166 sylancr φ x 1 P 1 2 2 P 2 = P
168 162 167 mtbird φ x 1 P 1 2 ¬ 2 P
169 oexpneg 1 P ¬ 2 P 1 P = 1 P
170 157 107 168 169 syl3anc φ x 1 P 1 2 1 P = 1 P
171 1exp P 1 P = 1
172 140 171 syl φ x 1 P 1 2 1 P = 1
173 172 negeqd φ x 1 P 1 2 1 P = 1
174 170 173 eqtrd φ x 1 P 1 2 1 P = 1
175 174 oveq1d φ x 1 P 1 2 -1 P Q P 2 x = 1 Q P 2 x
176 156 175 eqtrd φ x 1 P 1 2 1 P Q P 2 x = 1 Q P 2 x
177 176 oveq1d φ x 1 P 1 2 1 P Q P 2 x 1 R = 1 Q P 2 x 1 R
178 154 177 eqtrd φ x 1 P 1 2 1 P Q P 2 x + R = 1 Q P 2 x 1 R
179 nnmulcl Q x Q x
180 68 74 179 syl2an φ x 1 P 1 2 Q x
181 180 nnnn0d φ x 1 P 1 2 Q x 0
182 2nn0 2 0
183 182 a1i φ x 1 P 1 2 2 0
184 150 181 183 expmuld φ x 1 P 1 2 1 2 Q x = -1 2 Q x
185 neg1sqe1 1 2 = 1
186 185 oveq1i -1 2 Q x = 1 Q x
187 180 nnzd φ x 1 P 1 2 Q x
188 1exp Q x 1 Q x = 1
189 187 188 syl φ x 1 P 1 2 1 Q x = 1
190 186 189 syl5eq φ x 1 P 1 2 -1 2 Q x = 1
191 184 190 eqtrd φ x 1 P 1 2 1 2 Q x = 1
192 149 178 191 3eqtr3d φ x 1 P 1 2 1 Q P 2 x 1 R = 1
193 192 oveq1d φ x 1 P 1 2 1 Q P 2 x 1 R Q = 1 Q
194 96 zcnd φ x 1 P 1 2 1 Q P 2 x
195 111 zcnd φ x 1 P 1 2 1 R
196 194 195 129 mulassd φ x 1 P 1 2 1 Q P 2 x 1 R Q = 1 Q P 2 x 1 R Q
197 129 mulid2d φ x 1 P 1 2 1 Q = Q
198 193 196 197 3eqtr3d φ x 1 P 1 2 1 Q P 2 x 1 R Q = Q
199 198 fveq2d φ x 1 P 1 2 L 1 Q P 2 x 1 R Q = L Q
200 123 199 eqtr3d φ x 1 P 1 2 L 1 Q P 2 x Y L 1 R Q = L Q
201 200 mpteq2dva φ x 1 P 1 2 L 1 Q P 2 x Y L 1 R Q = x 1 P 1 2 L Q
202 119 201 eqtrd φ x 1 P 1 2 L 1 Q P 2 x Y f x 1 P 1 2 L 1 R Q = x 1 P 1 2 L Q
203 202 oveq2d φ G x 1 P 1 2 L 1 Q P 2 x Y f x 1 P 1 2 L 1 R Q = G x = 1 P 1 2 L Q
204 1 2 3 4 5 6 7 8 9 lgseisenlem3 φ G x = 1 P 1 2 L 1 R Q = 1 Y
205 204 oveq2d φ G x = 1 P 1 2 L 1 Q P 2 x Y G x = 1 P 1 2 L 1 R Q = G x = 1 P 1 2 L 1 Q P 2 x Y 1 Y
206 116 203 205 3eqtr3rd φ G x = 1 P 1 2 L 1 Q P 2 x Y 1 Y = G x = 1 P 1 2 L Q
207 eqid 0 G = 0 G
208 97 fmpttd φ x 1 P 1 2 L 1 Q P 2 x : 1 P 1 2 Base Y
209 fvexd φ x 1 P 1 2 L 1 Q P 2 x V
210 fvexd φ 0 G V
211 114 25 209 210 fsuppmptdm φ finSupp 0 G x 1 P 1 2 L 1 Q P 2 x
212 91 207 22 25 208 211 gsumcl φ G x = 1 P 1 2 L 1 Q P 2 x Base Y
213 eqid 1 Y = 1 Y
214 30 92 213 ringridm Y Ring G x = 1 P 1 2 L 1 Q P 2 x Base Y G x = 1 P 1 2 L 1 Q P 2 x Y 1 Y = G x = 1 P 1 2 L 1 Q P 2 x
215 27 212 214 syl2anc φ G x = 1 P 1 2 L 1 Q P 2 x Y 1 Y = G x = 1 P 1 2 L 1 Q P 2 x
216 99 101 syl φ Q
217 32 216 ffvelrnd φ L Q Base Y
218 eqid G = G
219 91 218 gsumconst G Mnd 1 P 1 2 Fin L Q Base Y G x = 1 P 1 2 L Q = 1 P 1 2 G L Q
220 24 25 217 219 syl3anc φ G x = 1 P 1 2 L Q = 1 P 1 2 G L Q
221 oddprm P 2 P 1 2
222 1 221 syl φ P 1 2
223 222 nnnn0d φ P 1 2 0
224 hashfz1 P 1 2 0 1 P 1 2 = P 1 2
225 223 224 syl φ 1 P 1 2 = P 1 2
226 225 oveq1d φ 1 P 1 2 G L Q = P 1 2 G L Q
227 36 10 mgpbas = Base mulGrp fld 𝑠
228 eqid mulGrp fld 𝑠 = mulGrp fld 𝑠
229 227 228 218 mhmmulg L mulGrp fld 𝑠 MndHom G P 1 2 0 Q L P 1 2 mulGrp fld 𝑠 Q = P 1 2 G L Q
230 38 223 216 229 syl3anc φ L P 1 2 mulGrp fld 𝑠 Q = P 1 2 G L Q
231 58 a1i φ SubMnd mulGrp fld
232 eqid mulGrp fld = mulGrp fld
233 232 61 228 submmulg SubMnd mulGrp fld P 1 2 0 Q P 1 2 mulGrp fld Q = P 1 2 mulGrp fld 𝑠 Q
234 231 223 216 233 syl3anc φ P 1 2 mulGrp fld Q = P 1 2 mulGrp fld 𝑠 Q
235 216 zcnd φ Q
236 cnfldexp Q P 1 2 0 P 1 2 mulGrp fld Q = Q P 1 2
237 235 223 236 syl2anc φ P 1 2 mulGrp fld Q = Q P 1 2
238 234 237 eqtr3d φ P 1 2 mulGrp fld 𝑠 Q = Q P 1 2
239 238 fveq2d φ L P 1 2 mulGrp fld 𝑠 Q = L Q P 1 2
240 230 239 eqtr3d φ P 1 2 G L Q = L Q P 1 2
241 220 226 240 3eqtrd φ G x = 1 P 1 2 L Q = L Q P 1 2
242 206 215 241 3eqtr3d φ G x = 1 P 1 2 L 1 Q P 2 x = L Q P 1 2
243 subrgsubg SubRing fld SubGrp fld
244 56 243 ax-mp SubGrp fld
245 subgsubm SubGrp fld SubMnd fld
246 244 245 mp1i φ SubMnd fld
247 80 fmpttd φ x 1 P 1 2 Q P 2 x : 1 P 1 2
248 df-zring ring = fld 𝑠
249 25 246 247 248 gsumsubm φ fld x = 1 P 1 2 Q P 2 x = ring x = 1 P 1 2 Q P 2 x
250 80 zcnd φ x 1 P 1 2 Q P 2 x
251 25 250 gsumfsum φ fld x = 1 P 1 2 Q P 2 x = x = 1 P 1 2 Q P 2 x
252 249 251 eqtr3d φ ring x = 1 P 1 2 Q P 2 x = x = 1 P 1 2 Q P 2 x
253 252 oveq2d φ 1 ring x = 1 P 1 2 Q P 2 x = 1 x = 1 P 1 2 Q P 2 x
254 253 fveq2d φ L 1 ring x = 1 P 1 2 Q P 2 x = L 1 x = 1 P 1 2 Q P 2 x
255 90 242 254 3eqtr3d φ L Q P 1 2 = L 1 x = 1 P 1 2 Q P 2 x
256 70 nnnn0d φ P 0
257 zexpcl Q P 1 2 0 Q P 1 2
258 216 223 257 syl2anc φ Q P 1 2
259 25 80 fsumzcl φ x = 1 P 1 2 Q P 2 x
260 m1expcl x = 1 P 1 2 Q P 2 x 1 x = 1 P 1 2 Q P 2 x
261 259 260 syl φ 1 x = 1 P 1 2 Q P 2 x
262 7 9 zndvds P 0 Q P 1 2 1 x = 1 P 1 2 Q P 2 x L Q P 1 2 = L 1 x = 1 P 1 2 Q P 2 x P Q P 1 2 1 x = 1 P 1 2 Q P 2 x
263 256 258 261 262 syl3anc φ L Q P 1 2 = L 1 x = 1 P 1 2 Q P 2 x P Q P 1 2 1 x = 1 P 1 2 Q P 2 x
264 255 263 mpbid φ P Q P 1 2 1 x = 1 P 1 2 Q P 2 x
265 moddvds P Q P 1 2 1 x = 1 P 1 2 Q P 2 x Q P 1 2 mod P = 1 x = 1 P 1 2 Q P 2 x mod P P Q P 1 2 1 x = 1 P 1 2 Q P 2 x
266 70 258 261 265 syl3anc φ Q P 1 2 mod P = 1 x = 1 P 1 2 Q P 2 x mod P P Q P 1 2 1 x = 1 P 1 2 Q P 2 x
267 264 266 mpbird φ Q P 1 2 mod P = 1 x = 1 P 1 2 Q P 2 x mod P