-
Notifications
You must be signed in to change notification settings - Fork 2
/
Conj.mag
404 lines (357 loc) · 13.6 KB
/
Conj.mag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
import "Utils.mag": not_implemented, sort_by, all_binnings;
IS_TRANSITIVE := IsTransitive;
declare type PGGConj: PGGGrpPerm;
declare attributes PGGConj: pol, base_field, parent_subgroup, parent_quotient, galgrp_is_known, galgrp_is_transitive, galgrp_overgroup;
declare type PGGConj_Symmetric: PGGConj, PGGGrpPerm_Symmetric;
declare attributes PGGConj_Symmetric: top_field;
declare type PGGConj_Factors: PGGConj, PGGGrpPerm_DirProd;
declare attributes PGGConj_Factors: pol_factors;
declare type PGGConj_Tower: PGGConj, PGGGrpPerm_WrProd;
declare attributes PGGConj_Tower: top_field;
declare type PGGConj_Unramified: PGGConj, PGGGrpPerm_Cyclic;
declare attributes PGGConj_Unramified: top_field;
declare type PGGConj_TotRam: PGGConj, PGGGrpPerm_RawSubgroup;
declare attributes PGGConj_TotRam: top_field;
declare type PGGConj_ElemAbel: PGGConj, PGGGrpPerm_ElemAbel;
declare attributes PGGConj_ElemAbel: top_field;
declare type PGGConj_Raw: PGGConj, PGGGrpPerm_Raw;
declare attributes PGGConj_Raw: top_field;
intrinsic PGGConj_Symmetric_Make(f :: PGGPol : GaloisGroupAlg:=false, TopField:=false, IsTransitive:=false, KnownGroup:=false) -> PGGConj_Symmetric
{Makes a conjugacy.}
c := New(PGGConj_Symmetric);
Init(~c, Degree(f));
c`pol := f;
c`base_field := BaseRing(f);
if TopField cmpne false then
c`top_field := TopField;
end if;
if KnownGroup cmpne false then
assert KnownGroup subset Group(c);
c`galgrp_is_known := [* true, KnownGroup *];
elif Degree(c) eq 1 then
c`galgrp_is_known := [* true, Group(c) *];
elif GaloisGroupAlg cmpne false then
PGG_GlobalTimer_Push("galois group");
c`galgrp_is_known := [* true, GaloisGroup(GaloisGroupAlg, f) *];
PGG_GlobalTimer_Pop();
else
c`galgrp_is_known := [* false *];
end if;
c`galgrp_is_transitive := IsTransitive or assigned c`top_field or Degree(c) eq 1;
return c;
end intrinsic;
intrinsic PGGConj_Unramified_Make(f :: PGGPol : TopField:=false) -> PGGConj_Unramified
{"}
require TopField cmpne false: "f must be known to be irreducible";
c := New(PGGConj_Unramified);
Init(~c, Degree(f));
c`pol := f;
c`base_field := BaseRing(f);
c`top_field := TopField;
assert Degree(c`top_field, c`base_field) eq Degree(f);
assert RamificationDegree(c`top_field, c`base_field) eq 1;
c`galgrp_is_known := [* true, Group(c) *];
c`galgrp_is_transitive := true;
return c;
end intrinsic;
intrinsic PGGConj_TotRam_Make(f :: PGGPol : TopField:=false) -> PGGConj_TotRam
{"}
require TopField cmpne false: "f must be known to be irreducible";
L := TopField;
K := BaseRing(f);
d := Degree(f);
p := Prime(K);
assert Degree(L, K) eq d;
assert InertiaDegree(L, K) eq 1;
assert not IsDivisibleBy(d, p);
q := p^AbsoluteInertiaDegree(K);
d0 := Order(q @@ m) where _,m:=MultiplicativeGroup(Integers(d));
Sd := PGGGrpPerm_Symmetric_Make(d);
c := New(PGGConj_TotRam);
Init(~c, Sd, sub<Group(Sd) | [[(((k-1)*(q^j)+i) mod d) + 1 : k in [1..d]] : j in [0..d0-1], i in [0..d-1]]>);
assert #Group(c) eq d*d0;
c`pol := d;
c`base_field := K;
c`top_field := L;
c`galgrp_is_known := [* true, Group(c) *];
c`galgrp_is_transitive := true;
return c;
end intrinsic;
intrinsic PGGConj_ElemAbel_Make(f :: PGGPol : TopField:=false) -> PGGConj_ElemAbel
{"}
require TopField cmpne false: "TopField must be known";
c := New(PGGConj_ElemAbel);
Init(~c, Degree(f));
c`pol := f;
c`base_field := BaseRing(f);
c`galgrp_is_known := [* true, Group(c) *];
c`galgrp_is_transitive := c`dim le 1;
c`top_field := TopField;
return c;
end intrinsic;
intrinsic PGGConj_Raw_Make(f :: PGGPol, G :: GrpPerm : TopField:=false, IsTransitive:=false, KnownGroup:=false) -> PGGConj_Raw
{"}
c := New(PGGConj_Raw);
Init(~c, G);
c`pol := f;
c`base_field := BaseRing(f);
if TopField cmpne false then
c`top_field := TopField;
IsTransitive or:= true;
end if;
if KnownGroup cmpne false then
assert KnownGroup subset Group(c);
c`galgrp_is_known := [* true, KnownGroup *];
IsTransitive or:= IS_TRANSITIVE(KnownGroup);
else
c`galgrp_is_known := [* false *];
IsTransitive or:= Degree(G) le 1;
end if;
c`galgrp_is_transitive := IsTransitive;
return c;
end intrinsic;
intrinsic PGGConj_Factors_Make(f :: PGGPol, facs :: Tup) -> PGGConj
{"}
require forall{c : c in facs | ISA(Type(c), PGGConj)}: "facs must be a tuple of PGGConj";
c := New(PGGConj_Factors);
c`factors := facs;
c`base_field := BaseRing(f);
offset := 0;
for i in [1..#c`factors] do
cc := c`factors[i];
d := Degree(cc);
cc`parent_subgroup := Group(c);
cc`parent_quotient := OrbitAction(Group(c), [offset+1..offset+d]);
offset +:= d;
end for;
assert Degree(c) eq offset;
return c;
end intrinsic;
intrinsic PGGConj_Tower_Make(f :: PGGPol, tower :: Tup) -> PGGConj
{"}
require forall{c : c in tower | ISA(Type(c), PGGConj)}: "tower must be a tuple of PGGConj";
c := New(PGGConj_Tower);
c`pol := f;
c`factors := tower;
c`base_field := BaseRing(f);
degree := 1;
for i in [#c`factors..1 by -1] do
cc := c`factors[i];
d := Degree(cc);
cc`parent_subgroup := Stabilizer(Group(c), {1..degree*d});
oact := OrbitAction(cc`parent_subgroup, [1..degree*d]);
bact := BlocksAction(Codomain(oact), [{(i-1)*degree+j : j in [1..degree]} : i in [1..d]]);
cc`parent_quotient := oact * bact;
degree *:= d;
end for;
assert Degree(c) eq degree;
return c;
end intrinsic;
// intrinsic EasyResolvents(conj :: PGGConj_Symmetric) -> []
// {Some trivial resolvents based on the initial presentation of the problem.}
// return [<conj`pol, Stabilizer(conj`group, 1)>];
// end intrinsic;
// intrinsic EasyResolvents(conj :: PGGConj_Factors) -> []
// {Some trivial resolvents based on the initial presentation of the problem.}
// // TODO: resolvents corresponding to each factor, and the whole polynomial?
// not_implemented("easy resolvents: factors");
// end intrinsic;
// intrinsic EasyResolvents(conj :: PGGConj_Tower) -> []
// {Some trivial resolvents based on the initial presentation of the problem.}
// // TODO: more resolvents corresponding to pieces of the tower?
// return [<conj`pol, Stabilizer(conj`group, 1)>];
// end intrinsic;
// intrinsic Print(conj :: PGGConj)
// {"}
// _Print(conj);
// ok, G := IsKnown(conj);
// if ok then
// if G eq Group(conj) then
// printf " exactly";
// else
// printf " actually %o", GroupName(G);
// end if;
// else
// if IsTransitive(conj) then
// printf " transitive";
// end if;
// if Overgroup(conj) ne Group(conj) then
// printf " subgroup of %o", GroupName(Overgroup(conj));
// end if;
// end if;
// end intrinsic;
// intrinsic _Print(conj :: PGGConj_Symmetric)
// {"}
// printf "Symmetric(%o)", Degree(conj);
// end intrinsic;
// intrinsic _Print(conj :: PGGConj_Factors)
// {"}
// printf "Factors(%o)", Join([Sprintf("%o", c) : c in conj`factors], ", ");
// end intrinsic;
// intrinsic _Print(conj :: PGGConj_Tower)
// {"}
// printf "Tower(%o)", Join([Sprintf("%o", c) : c in conj`tower], ", ");
// end intrinsic;
intrinsic GalGrpOvergroup(conj :: PGGConj) -> GrpPerm
{An overgroup of the Galois group.}
if not assigned conj`galgrp_overgroup then
ok, G := GalGrpIsKnown(conj);
if not ok then
G := _GalGrpOvergroup(conj);
end if;
assert G subset Group(conj);
conj`galgrp_overgroup := G;
end if;
return conj`galgrp_overgroup;
end intrinsic;
intrinsic _GalGrpOvergroup(conj :: PGGConj_Symmetric) -> GrpPerm
{"}
return Group(conj);
end intrinsic;
intrinsic _GalGrpOvergroup(conj :: PGGConj_Factors) -> GrpPerm
{"}
return DirectProduct([GalGrpOvergroup(c) : c in conj`factors]);
end intrinsic;
intrinsic _GalGrpOvergroup(conj :: PGGConj_Tower) -> GrpPerm
{"}
return WreathProduct(Reverse([GalGrpOvergroup(c) : c in conj`factors]));
end intrinsic;
intrinsic GalGrpIsTransitive(conj :: PGGConj) -> BoolElt
{True if the Galois group is known to be transitive on this part of the group.}
if not assigned conj`galgrp_is_transitive then
conj`galgrp_is_transitive := _GalGrpIsTransitive(conj);
end if;
return conj`galgrp_is_transitive;
end intrinsic;
intrinsic _GalGrpIsTransitive(conj :: PGGConj_Factors) -> BoolElt
{"}
return #conj`factors le 1 and forall{c : c in conj`factors | GalGrpIsTransitive(conj`factors[1])};
end intrinsic;
intrinsic _GalGrpIsTransitive(conj :: PGGConj_Tower) -> BoolElt
{"}
assert forall{c : c in conj`factors | GalGrpIsTransitive(c)};
return true;
end intrinsic;
intrinsic GalGrpIsConsistent(conj :: PGGConj, G :: GrpPerm) -> BoolElt
{True if G could be the Galois group.}
ok, G2 := GalGrpIsKnown(conj);
if ok then
return IsConjugate(Group(conj), G, G2);
else
return _GalGrpIsConsistent(conj, G);
end if;
end intrinsic;
intrinsic _GalGrpIsConsistent(conj :: PGGConj_Symmetric, G :: GrpPerm) -> BoolElt
{"}
return (not GalGrpIsTransitive(conj)) or IsTransitive(G);
end intrinsic;
intrinsic _GalGrpIsConsistent(conj :: PGGConj_Factors, G :: GrpPerm) -> BoolElt
{"}
return forall{c : c in conj`factors | GalGrpIsConsistent(c, c`parent_quotient(G meet c`parent_subgroup))};
end intrinsic;
intrinsic _GalGrpIsConsistent(conj :: PGGConj_Tower, G :: GrpPerm) -> BoolElt
{"}
return forall{c : c in conj`factors | GalGrpIsConsistent(c, c`parent_quotient(G meet c`parent_subgroup))};
end intrinsic;
// intrinsic GalGrpIsConsistentToSymmetricConjugacy(conj :: PGGConj, G :: GrpPerm) -> BoolElt
// {True if G is consistent with being a Galois group of conj, where G is only specified up to conjugacy in a symmetric group.}
// not_implemented("GalGrpIsConsistentToSymmetricConjugacy:", Type(conj));
// end intrinsic;
// intrinsic GalGrpIsConsistentToSymmetricConjugacy(conj :: PGGConj_Factors, G :: GrpPerm) -> BoolElt
// {"}
// os := sort_by(Orbits(G), func<o | -#o>);
// oszs := [#o : o in os];
// facszs := [Degree(fac) : fac in conj`factors];
// istrans := [GalGrpIsTransitive(fac) : fac in conj`factors];
// binss := all_binnings([1 : o in os], [1 : fac in conj`factors] : is_semivalid:=func<i,b | (istrans[i] select #b le 1 else true) and (&+[oszs[j] : j in b] le facszs[i])>);
// return exists{bins : bins in binss | forall{i : i in [1..#conj`factors] | GalGrpIsConsistentToSymmetricConjugacy(conj`factors[i], G0) where G0:=OrbitImage(G, &join[os[j] : j in bin, bin in bins[i]])}};
// end intrinsic;
// intrinsic GalGrpIsConsistentToSymmetricConjugacy(conj :: PGGConj_Tower, G :: GrpPerm) -> BoolElt
// {"}
// // TODO: check it has a
// return GalGrpIsTransitive(conj) select IsTransitive(G) else true;
// end intrinsic;
// intrinsic GalGrpIsConsistentToSymmetricConjugacy(conj :: PGGConj_Symmetric, G :: GrpPerm) -> BoolElt
// {"}
// return GalGrpIsTransitive(conj) select IsTransitive(G) else true;
// end intrinsic;
intrinsic GalGrpIsConsistentWithSubgroup(conj :: PGGConj, G :: GrpPerm) -> BoolElt
{True if the Galois group could be a subgroup of G.}
ok, G2 := GalGrpIsKnown(conj);
if ok then
return IsConjugateSubgroup(Group(conj), G, G2);
else
return _GalGrpIsConsistentWithSubgroup(conj, G);
end if;
end intrinsic;
intrinsic _GalGrpIsConsistentWithSubgroup(conj :: PGGConj, G :: GrpPerm) -> BoolElt
{True if the Galois group could be a subgroup of G.}
not_implemented("GalGrpIsConsistentWithSubgroup: ", Type(conj));
end intrinsic;
intrinsic _GalGrpIsConsistentWithSubgroup(conj :: PGGConj_Symmetric, G :: GrpPerm) -> BoolElt
{"}
return (not GalGrpIsTransitive(conj)) or IsTransitive(G);
end intrinsic;
intrinsic _GalGrpIsConsistentWithSubgroup(conj :: PGGConj_Factors, G :: GrpPerm) -> BoolElt
{"}
return forall{c : c in conj`factors | GalGrpIsConsistentWithSubgroup(c, c`parent_quotient(G meet c`parent_subgroup))};
end intrinsic;
intrinsic _GalGrpIsConsistentWithSubgroup(conj :: PGGConj_Tower, G :: GrpPerm) -> BoolElt
{"}
return forall{c : c in conj`factors | GalGrpIsConsistentWithSubgroup(c, c`parent_quotient(G meet c`parent_subgroup))};
end intrinsic;
intrinsic GalGrpIsKnown(conj :: PGGConj) -> BoolElt, GrpPerm
{True if the Galois group is known exactly, and the group.}
if not assigned conj`galgrp_is_known then
ok, G := _GalGrpIsKnown(conj);
if ok then
assert G subset Group(conj);
conj`galgrp_is_known := [* true, G *];
else
conj`galgrp_is_known := [* false *];
end if;
end if;
if conj`galgrp_is_known[1] then
return true, conj`galgrp_is_known[2];
else
return false, _;
end if;
end intrinsic;
intrinsic _GalGrpIsKnown(conj :: PGGConj_Factors) -> BoolElt, GrpPerm
{"}
if #[c : c in conj`factors | Degree(c) gt 1] le 1 then
Gs := [];
for c in conj`factors do
ok, G := GalGrpIsKnown(c);
if ok then
Append(~Gs, G);
else
return false, _;
end if;
end for;
return true, DirectProduct(Gs);
else
return false, _;
end if;
end intrinsic;
intrinsic _GalGrpIsKnown(conj :: PGGConj_Tower) -> BoolElt, GrpPerm
{"}
if #<c : c in conj`factors | Degree(c) gt 1> le 1 then
Gs := [];
for c in conj`factors do
ok, G := GalGrpIsKnown(c);
if ok then
Append(~Gs, G);
else
return false, _;
end if;
end for;
if #Gs eq 0 then
return true, SymmetricGroup(1);
else
return true, WreathProduct(Reverse(Gs));
end if;
else
return false, _;
end if;
end intrinsic;