Skip to content

Commit bb7a662

Browse files
Transversal improvements
1 parent 494d616 commit bb7a662

7 files changed

Lines changed: 198 additions & 10 deletions

File tree

lib/Classical/subgroups.gd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
IsHapCongruenceSubgroup:=NewFilter("IsHapCongruenceSubgroup");;
2+
DeclareGlobalFunction("HAP_GenericCongruenceSubgroup");
3+
DeclareOperation("HAPCongruenceSubgroupGamma0",[IsInt,IsInt]);
4+
DeclareOperation("HAPCongruenceSubgroupTree",[IsHapCongruenceSubgroup]);
5+
6+
InstallMethod( ViewObj,
7+
"for HapCongruenceSubgroup",
8+
[IsHapCongruenceSubgroup and IsGroup],
9+
10000000, #Ensures that this method is chosen
10+
function(G)
11+
Print(G!.name," of ",G!.fam);
12+
end);
13+
14+
InstallMethod( PrintObj,
15+
"for HapCongruenceSubgroup",
16+
[IsHapCongruenceSubgroup and IsGroup],
17+
100000000, #Ensures that this method is chosen
18+
function(G)
19+
Print(G!.name," of ",G!.fam);
20+
end);
21+

lib/Classical/subgroups.gi

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
###################################################################
2+
###################################################################
3+
InstallGlobalFunction(HAP_GenericCongruenceSubgroup,
4+
function(family,integer,ring,ideal)
5+
local R, n, one, mat, type, G, I, fam;
6+
7+
# This function returns a template for a congruence subgroup G in some
8+
# classical group such as GL(n,R), SL(n,R), Sp_n(R) over a ring of integers R.
9+
# The subgroup G is defined using some condition involving an ideal I<=R.
10+
# The input "family" is a string such as "SL", "GL", Sp". In this code we
11+
# denote any such family by "SL".
12+
#
13+
# Various components such as "membership, "tree", "cosetPos" will ineed to be
14+
# implemented using a specific secondary function that depends on the specific
15+
# family and ring.
16+
#
17+
# The *fast* method will use a formula to first implement "cosetPos" and then
18+
# compute the coset "tree", The *slow* method will use a general brute force
19+
# algorithm to first comput the "tree" and then implement "cosetPos".
20+
21+
R:=ring;
22+
n:=integer;
23+
if IsInt(ideal) then I:=IdealByGenerators(R,[ideal]);
24+
else
25+
I:=ideal;
26+
fi;
27+
if not IsBound(I) then return fail;
28+
fi;
29+
30+
one:=One(R);
31+
mat:=one*IdentityMat(n);
32+
fam:=Concatenation(family,"(",String(n),", ",Name(R)," )");
33+
34+
type := NewType( FamilyObj([ mat ]),
35+
IsGroup and
36+
IsAttributeStoringRep and
37+
IsFinitelyGeneratedGroup and
38+
IsMatrixGroup and
39+
IsHapCongruenceSubgroup);
40+
41+
G:=rec(
42+
ringOfIntegers:=R, #Matrices in the subgroup G lie in the ring R.
43+
level:=I, #This ideal I<=R is used to define G.
44+
fam:=fam, #The string "SL(n,R)".
45+
dimension:=n,
46+
membership:= fail, #true if a matrix g lies in G.
47+
membershipLight:=fail, #true if a matrix g in SL(n,R) lies in G.
48+
gens:=fail, #"Nice" generating set for SL(n,R).
49+
tree:= fail, #Coset tree of G with respect to gens.
50+
generators:= fail, #Generating set for G.
51+
index:=fail, #Index of G in SL(n,R).
52+
cosetRep:= fail, #CosetRep(g) represents g*G for g in SL(n,R).
53+
cosetPos:= fail, #cosetPos(g) is the position of the coset g*G.
54+
ugrp:= Group(mat), #The trivial (or vertex stabilizer) group.
55+
name:="Congruence subgroup");
56+
57+
ObjectifyWithAttributes( G, type,
58+
DimensionOfMatrixGroup, n
59+
);
60+
61+
return G;
62+
end);
63+
###################################################################
64+
###################################################################
65+
66+
###################################################################
67+
###################################################################
68+
InstallMethod( HAPCongruenceSubgroupGamma0,
69+
"for integer n and integer m",
70+
[IsInt, IsInt],
71+
function(n,m)
72+
local G,sl,membership,membershipLight,CosetRep, CosetPos;
73+
if not (n=2 and m>0) then TryNextMethod(); fi;
74+
75+
#The following implements G=Gamm0(m) < SL(2,Z)
76+
77+
sl:=SL(2,Integers);
78+
G:=HAP_GenericCongruenceSubgroup("SL",2,Integers,m);
79+
80+
###################################################
81+
membership:=function(g)
82+
if not g in sl then return false; fi;
83+
if not g[2][1] mod m = 0 then return false;
84+
else return true; fi;
85+
end;
86+
###################################################
87+
###################################################
88+
membershipLight:=function(g)
89+
if not g[2][1] mod m = 0 then return false;
90+
else return true; fi;
91+
end;
92+
###################################################
93+
94+
G!.membership:=membership;
95+
G!.membershipLight:=membershipLight;
96+
G!.level:=m;
97+
98+
G!.ugrp:=Group([[1,0],[0,1]]);
99+
G!.name:="CongruenceSubgroupGamma0";
100+
if m=1 then
101+
G!.index:=m;
102+
else
103+
G!.index:=m*Product(List(SSortedList(Factors(m)), p->1+1/p));
104+
fi;
105+
106+
if IsPrimeInt(m) then #NEEDS TO BE EXTENDED TO NONE PRIMES. THAT IS, NEED
107+
#TO IMPLEMENT THE PROJECTIVE LINE P^1(Z/mZ)
108+
###########################################
109+
CosetPos:=function(g)
110+
if g[1][1] mod m =0 then return m+1; fi;
111+
return 1 +((g[2][1]*g[1][1]^-1) mod m);
112+
end;
113+
###########################################
114+
115+
###########################################
116+
CosetRep:=function(g)
117+
if g[1][1] mod m=0 then return [[0,-1],[1,0]]; fi;
118+
return [[1,0],[(g[2][1]*g[1][1]^-1) mod m,1]];
119+
end;
120+
###########################################
121+
G!.cosetRep:=CosetRep;
122+
G!.cosetPos:=CosetPos;
123+
fi;
124+
125+
G:=ObjectifyWithAttributes(G, TypeObj(G),
126+
IsIntegerMatrixGroup, true,
127+
IsFinite, false);
128+
return G;
129+
130+
end);
131+
###################################################################
132+
###################################################################
133+
134+
###################################################################
135+
###################################################################
136+
#THERE SHOULD BE JUST ONE IMPLEMENTATION FOR ALL CASES.
137+
#NEED TO ADJUST THIS.
138+
InstallMethod(HAPCongruenceSubgroupTree,
139+
"Coset tree for congruence subgroup",
140+
[IsHapCongruenceSubgroup],
141+
function(G)
142+
if not (G!.dimension=2 and G!.ringOfIntegers=Integers) then TryNextMethod(); fi;
143+
HAP_SL2ZSubgroupTree_fast(G);
144+
end);
145+
###################################################################
146+
###################################################################
147+
148+
###################################################################
149+
###################################################################
150+
151+
InstallOtherMethod( RightTransversal,
152+
"Right transversal of congruence subgroup G in SL(2,Z)",
153+
[IsMatrixGroup, IsHapCongruenceSubgroup],
154+
100000,
155+
function(G,H)
156+
if not (H!.dimension=2 and Name(G)="SL(2,Integers)") then TryNextMethod(); fi;
157+
HAPCongruenceSubgroupTree(H);
158+
return HAP_TransversalCongruenceSubgroups(G,H);
159+
end);
160+
###################################################################
161+
###################################################################
162+
163+

lib/Congruence/cong.gi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ leaves:=NewDictionary(S,true,SL(2,Integers));
3838
nodes:=[one];
3939
AddDictionary(leaves,one,1);
4040

41-
InH:=H!.membership;
41+
InH:=H!.membershipLight;
4242

4343
###########################################
4444
InLowDegreeNodesModH:=function(g)

lib/Congruence/sl2conjugates.gi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ G:=rec(
1717
conjugator:=fail,
1818
conjugatorInverse:=fail,
1919
membership:= fail,
20+
membershipLight:=fail,
2021
generators:= fail,
2122
cosetRep:= fail,
2223
cosetPos:= fail,
@@ -83,6 +84,7 @@ end;
8384
###################################################
8485

8586
G!.membership:=membership;
87+
G!.membershipLight:=membership;
8688
G!.sl2Zsubgroup:=H;
8789
G!.conjugator:=g;
8890
G!.conjugatorInverse:=gg;
@@ -111,6 +113,7 @@ end;
111113
###################################################
112114

113115
G!.membership:=membership;
116+
G!.membershipLight:=membership;
114117
G!.sl2Zsubgroup:=H;
115118
G!.conjugator:=g;
116119
G!.conjugatorInverse:=gg;
@@ -142,6 +145,7 @@ end;
142145

143146
HH:=Intersection(H,H^g);
144147
G!.membership:=membership;
148+
G!.membershipLight:=membership;
145149
#G!.sl2Zsubgroup:=HH;
146150

147151
SetGeneratorsOfMagmaWithInverses(G,GeneratorsOfGroup(HH));

lib/Congruence/sl2subgroups.gi

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ end;
268268
triple2word:=function(x)
269269
local u,uu,g,q,c;
270270
for u in Ugrp do
271-
#Print(vertex2word(G!.cosetPos(x[3])) = x[3], " ");
272271
c:=x[4]^-1*u*vertex2word(G!.cosetPos(x[4]));
273-
if c in G then return c; fi;
274-
od;
272+
#if c in G then return c; fi;
273+
if G!.membership(c) then return c; fi;
274+
od;
275275
return fail; #This should never happen
276276
end;
277277
#####################################################
@@ -407,7 +407,7 @@ end);
407407
###################################################################
408408
InstallGlobalFunction(HAP_CongruenceSubgroupGamma0,
409409
function(n)
410-
local G,sl,S,T,membership,membershipLight,CosetRep, CosetPos,g,x,y,a;
410+
local G,sl,membership,membershipLight,CosetRep, CosetPos,g,x,y,a;
411411

412412
if IsRing(n) then
413413
return HAP_CongruenceSubgroupGamma0Ideal(n);
@@ -434,18 +434,15 @@ G!.membership:=membership;
434434
G!.membershipLight:=membershipLight;
435435
G!.level:=n;
436436

437-
S:=[[0,-1],[1,0]];;
438-
T:=[[1,1],[0,1]];
439-
440-
G!.ugrp:=Group((S*T)^0);
437+
G!.ugrp:=Group([[1,0],[0,1]]);
441438
G!.name:="CongruenceSubgroupGamma0";
442439
if n=1 then
443440
G!.index:=1;
444441
else
445442
G!.index:=n*Product(List(SSortedList(Factors(n)), p->1+1/p));
446443
fi;
447444

448-
if IsPrimeInt(n) then #I need to extend this to no primes
445+
if IsPrimeInt(n) then #I need to extend this to none primes
449446
###########################################
450447
CosetPos:=function(g)
451448
if g[1][1] mod n =0 then return n+1; fi;

lib/hap.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ReadPackage("HAP","lib/RahmSanchez/DavisComplex.gd");
1616
ReadPackage("HAP","lib/GOuterGroups/functorialGouter.gd");
1717
ReadPackage("HAP","lib/Congruence/quadraticIntegers.gd");
1818
ReadPackage("HAP","lib/Congruence/residues.gd");
19+
ReadPackage("HAP","lib/Classical/subgroups.gd");
1920

2021

2122

read.g

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ ReadPackageHap( "lib/Congruence/resAbelianBianchiSubgroup.gi");
234234
ReadPackageHap( "lib/Congruence/qnf_nc.gi");
235235
ReadPackageHap( "lib/Congruence/notused.gi");
236236

237+
##################### CLASSICAL #####################################
238+
ReadPackageHap( "lib/Classical/subgroups.gi");
237239

238240

239241

0 commit comments

Comments
 (0)