-
Notifications
You must be signed in to change notification settings - Fork 1
/
subgrpcon.gi
377 lines (279 loc) · 11.5 KB
/
subgrpcon.gi
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
#######################################################################
## Local function to calculate the normalizer of U in G ##
#######################################################################
NormalizerNilGroupSeries := function(G, U, efa)
local genU, #Generators of U
N, #Normalizer of U in G
H, #Intersection of the previous step
Hi, #Intersection on each step
i, #Bucle variable
h, #Generator of U/V
nat; #Natural homomorphism N->N/V
genU := Reversed( Igs(U) );
N := G;
H := Subgroup(U, [ genU[1] ]);
Info( InfoConjugacySubgroups, 1, StringFormatted("The algorithm has to process {} layers.", Length(genU)-1 ) );
for i in [2..Length(genU)] do
Hi := Subgroup(U, genU{[1..i]});
h := Pcp(Hi, H)[1];
nat := NaturalHomomorphismByNormalSubgroup(N, H);
N := PreImage( nat, CentralizerNilGroup( Image(nat), nat(h) ) );
H := Hi;
Info( InfoConjugacySubgroups, 1, StringFormatted("Layer {} done.", i) );
od;
return N;
end;
#######################################################################
## Global function to calculate the normalizer of U in G ##
#######################################################################
InstallGlobalFunction( "NormalizerNilGroup", function(G,U)
if not IsSubgroup(G,U) then
Error( "U has to be a subgroup of G.");
fi;
return NormalizerNilGroupSeries(G, U, EfaSeries(G));
end );
#######################################################################
## Local function to calculate the preimage of an element ##
#######################################################################
PreImageByQuotient := function(G, hom, elm )
local pcp,
gens,
matrix,
exp,
solv;
pcp := Pcp( Image(hom) );
gens := Cgs(G);
matrix := List( gens, x-> ExponentsByPcp( pcp, hom(x) ) );
exp := ExponentsByPcp( pcp, elm );
solv := PcpSolutionIntMat( matrix, exp );
return MappedVector( solv, gens );
end;
#######################################################################
## Local function to calculate is two subgroups of G are conjugated ##
#######################################################################
IsConjugateSubgroupsNilGroup := function(G, U, V)
local x, #Conjugating element of U and V
Ui, #Conjuate of U in each step
H, #Intersection of previous step of U
K, #Intersection of previous step of V
N, #Normalizer of W
i, #Bucle variable
Hi, #Intersection in each step of U
Ki, #Intersection in each step of V
h, #Generator of U/W
k, #Generator of V/W
nat, #Natural homomorphism N->N/W
conj, #Conjugating of h and k
xi, #Conjugating element in each step
genU, #Generators of U
genV; #Generators of V
#Catch trivial case
genU := Reversed( Cgs(U) );
genV := Reversed( Cgs(V) );
if Length(genU) <> Length(genV) then
return false;
fi;
#Start the algorithm
x := One(G);
Ui := U;
H := Subgroup(U, [ ]);
K := Subgroup(V, [ ]);
N := G;
if H <> K then
return false;
fi;
Info( InfoConjugacySubgroups, 1, StringFormatted("The algorithm has to process {} layers.", Length(genU) ) );
for i in [1..Length( genU )] do
#Take the intersection
Hi := Subgroup(Ui, genU{[1..i]});
Ki := Subgroup(V, genV{[1..i]});
#Get the generators of U/W and V/W
h := Pcp(Hi, H)[1];
k := Pcp(Ki, K)[1];
#Define the homomorphism N-> N/W
nat := NaturalHomomorphismByNormalSubgroupNC(N, H );
conj:= IsConjugateNilGroup( Image(nat), nat(h), nat(k) );
if IsBool(conj) then
return false;
else
#They are conjugated, update values
xi := PreImageByQuotient( N, nat, conj );
x := x * xi;
H := Hi^ xi;
Ui := Ui^ xi;
genU:= Reversed( Cgs(Ui) );
K := Ki;
#Update the normalizer
N := PreImage( nat, CentralizerNilGroup( Image(nat), nat(k) ) );
fi;
Info( InfoConjugacySubgroups, 1, StringFormatted("Layer {} done.", i) );
od;
return x;
end;
#######################################################################
## Global function to calculate is two subgroups of G are conjugated ##
#######################################################################
InstallGlobalFunction( "IsConjugateSubgroups", function(G, U, V)
if not (IsSubgroup(G,U) and IsSubgroup(G,V) ) then
Error( "U and V have to be subgroups of G.");
fi;
if U = V then
return One(G);
else
return IsConjugateSubgroupsNilGroup(G, U, V);
fi;
end );
#######################################################################
## Local function to calculate the reduced canonical form ##
#######################################################################
ReducedCanonical := function(G, U, elms)
local nat, #Natural homomrphism from G to G/U
kan, #Canonical conjugate of the image of g by nat
k, #Reduced preimage of the canonical conjugate
v, #Conjugating element
N, #Normalizer
i; #Bucle variable
nat := NaturalHomomorphismByNormalSubgroup(G, U );
kan := CanonicalConjugateElements( Image(nat), List( elms, nat ) );
k := [];
v := [];
for i in [1..Length(elms)] do
k[i]:= PreImagesRepresentative(nat, kan.kano[i]);
v[i]:= PreImagesRepresentative(nat, kan.conj[i]);
k[i]:= ReducePcpElement(k[i] , Cgs(U));
od;
N := PreImage( nat, kan.cent[1] );
return rec( kano := k, conj := v, N := N );
end;
#######################################################################
## Local function to check if two elements are conjugate in the ##
## quotient ##
#######################################################################
IsCanonicalConjugateQuotient := function(G, U, elms)
local nat, #Natural homomrphism from G to G/U
kan, #Canonical conjugate of the image of g by nat
k, #Reduced preimage of the canonical conjugate
v, #Conjugating element
N, #Normalizer
i; #Bucle variable
nat := NaturalHomomorphismByNormalSubgroup(G, U );
kan := IsCanonicalConjugateElements( Image(nat), List( elms, nat ));
if IsBool(kan) then
return false;
else;
v := [];
for i in [1..Length(elms)] do
v[i] := PreImagesRepresentative(nat, kan.conj[i]);
od;
k := PreImagesRepresentative(nat, kan.kano);
k := ReducePcpElement(k , Cgs(U));
N := PreImage( nat, kan.cent );
return rec( kan := k, v := v, N := N );
fi;
end;
#######################################################################
## Local function to calculate the canonical conjugate subgroup of ##
## a subgroup in G ##
#######################################################################
CanonicalConjugateSubgroupNilGroup := function(G, U)
local gU, #Generators of U
N, #Normalizer of K
x, #Conjugating element
gK, #Generators of K
Ui, #Subgroup Ui in the current step
K, #Canonical subgroup
i, #Bucle variable
u, #Generator on each step
kan; #Canonical conjugates of h
gU := Reversed( Cgs(U) );
N := G;
x := One(G);
Ui := Subgroup( U, [ ]);
gK := [];
Info( InfoConjugacySubgroups, 1, StringFormatted("The algorithm has to process {} layers.", Length(gU) ) );
for i in [1..Length(gU)] do
u := NormedPcpElement( gU[i]^x );
kan := ReducedCanonical(N, Ui, [u]);
x := x*kan.conj[1];
Ui := Subgroup(U, gU{[1..i]} );
SetCgs(Ui, gU{[1..i]} );
Ui := Ui^x;
N := kan.N;
Add( gK, kan.kano[1] );
Info( InfoConjugacySubgroups, 1, StringFormatted("Layer {} done.", i) );
od;
K := Subgroup( G, gK );
return rec( kano := K, conj := x, norm := N);
end;
#######################################################################
## Global function to calculate the canonical conjugate subgroup of ##
## a subgroup in G ##
#######################################################################
InstallGlobalFunction( "CanonicalConjugateSubgroup", function(G, U)
if not IsSubgroup(G,U) then
Error( "U has to be subgroups of G.");
fi;
return CanonicalConjugateSubgroupNilGroup(G, U);
end );
######################################################################
## Local function to calculate solve the conjugacy problem in G ##
## using canonical conjugate elements ##
######################################################################
IsCanonicalConjugateSubgroupNilGroup := function(G, U, V)
local gU, #Generators of U
gV, #Generators of V
N, #Normalizer of K
x, #Conjugating element of U
y, #Conjugating element of V
gK, #Generators of K
Ui, #Subgroup Ui in the current step
K, #Canonical subgroup
i, #Bucle variable
u, #Generator on each step of U
v, #Generator on each step of V
kU; #Canonical conjugates of
gU := Reversed( Cgs(U) );
gV := Reversed( Cgs(V) );
N := G;
x := One(G);
y := One(G);
Ui := Subgroup( U, [ ]);
gK := [];
if Length(gU) <> Length(gV) then
return false;
fi;
Info( InfoConjugacySubgroups, 1, StringFormatted("The algorithm has to process {} layers.", Length(gU)-1 ) );
for i in [1..Length(gU)] do
u := NormedPcpElement( gU[i]^x );
v := NormedPcpElement( gV[i]^y );
kU := IsCanonicalConjugateQuotient(N, Ui, [u,v]);
if IsBool(kU) then
return false;
else
x := x*kU.v[1];
Ui := Subgroup(U, gU{[1..i]} );
SetCgs(Ui, gU{[1..i]});
Ui := Ui^x;
y := y*kU.v[2];
N := kU.N;
Add( gK, kU.kan );
fi;
Info( InfoConjugacySubgroups, 1, StringFormatted("Layer {} done.", i) );
od;
K := Subgroup( G, gK );
return rec( kano := K, conj := [x,y], norm := N);
end;
######################################################################
## Global function to calculate solve the conjugacy problem in G ##
## using canonical conjugate elements ##
######################################################################
InstallGlobalFunction( "IsCanonicalConjugateSubgroups", function(G, U, V)
if not (IsSubgroup(G,U) and IsSubgroup(G,V) ) then
Error( "U and V have to be subgroups of G.");
fi;
if U = V then
return One(G);
else
return IsCanonicalConjugateSubgroupNilGroup(G, U, V);
fi;
end );