File: resAspherical.gi

package info (click to toggle)
gap-hap 1.66%2Bds-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 55,348 kB
  • sloc: xml: 15,368; sh: 216; javascript: 155; makefile: 126; ansic: 57; perl: 36
file content (147 lines) | stat: -rw-r--r-- 3,584 bytes parent folder | download | duplicates (2)
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
#(C) Graham Ellis, 2..5-2006

#####################################################################
#####################################################################
InstallGlobalFunction(ResolutionAsphericalPresentation,
function(arg)
local
	F,rels,N,Dimension,
	Boundary, PseudoBoundary,
	Homotopy, HomotopyRecord,
	G,
	EltsG,
	gensF, gensG,
	FhomG,
	toggle,
	i,R,B,w,ww,x;

if Length(arg)=3 then
F:=arg[1]; rels:=arg[2]; N:=arg[3]; 
         if Length(rels)>0 then G:=F/rels;
         else G:=F; fi;
fi;
if Length(arg)=2 then
G:=arg[1]; 
F:=FreeGroupOfFpGroup(G);
rels:=RelatorsOfFpGroup(G); N:=arg[2];
fi;

toggle:=false;
gensF:=GeneratorsOfGroup(F);
#if Length(rels)>0 then G:=F/rels;
#else G:=F; fi;
gensG:=GeneratorsOfGroup(G);
FhomG:=GroupHomomorphismByImagesNC(F,G,gensF,gensG);
EltsG:=[Identity(G)];

if IsFreeGroup(G) and Length(gensG)=1 then toggle:=true;
x:=HAPconstant; ##CHANGE x IF THIS CAUSES PROBLEMS!
for i in [1..x]  do
Append(EltsG,[F.1^i,F.1^-i]);
od;
fi;

#####################################################################
Dimension:=function(n);

if n=0 then return 1; fi;
if n=1 then return Length(gensF); fi;
if n=2 then return Length(rels); fi;
if n<0 or n>2 then return 0; fi;

end;
#####################################################################

PseudoBoundary:=[[],[]];

for i in [1..Dimension(1)] do
Append(PseudoBoundary[1], [   [ [-1,1], [1,i+1] ]   ]); 
Append(EltsG,[gensG[i]]);
od;

for i in [1..Dimension(2)] do
R:=LetterRepAssocWord(rels[i]);
B:=[];
w:=Identity(F);

for x in R do
Append(EltsG,[Image(FhomG,w)]);
#Append(B,[[x,Length(EltsG)]]);
w:=w*gensF[AbsoluteValue(x)]^SignInt(x);
if SignInt(x)=1 then
Append(B,[[x,Length(EltsG)]]);
else
Append(B,[[x,Length(EltsG)+1]]);
fi;

od;
Append(EltsG,[Image(FhomG,w)]);

Append(PseudoBoundary[2],[B]);


od;

#####################################################################
Boundary:=function(n,i);
if n<1 or n>2 then return [ ]; fi;

if i>0 then 
return PseudoBoundary[n][i];
else return NegateWord(PseudoBoundary[n][-i]);
fi;
end;
#####################################################################

if not toggle then Homotopy:=fail;
else

#####################################################################
HomotopyRecord:=function(i,x)
local g,k,j,hty;
if i>0 then return []; fi;
g:=EltsG[x[2]];
if g=Identity(F) then return []; fi;
for k in [-100..100] do			#THIS SLOPPINESS MIGHT CAUSE PROBLEMS
if F.1^k=g then j:=k; break; fi;
od;

if j>0 then k:=Position(EltsG,F.1^(j-1)); 
hty:=Concatenation(ShallowCopy(HomotopyRecord(i,[x[1],k])),
				[[1,k]]); 

else k:=Position(EltsG,F.1^(j+1)); 
hty:=Concatenation(ShallowCopy(HomotopyRecord(i,[x[1],k])),
                                [[-1,x[2]]]); 
fi;  #Need to think more about this!


return hty;
end;
#####################################################################

#####################################################################
Homotopy:=function(i,x);
if SignInt(x[1])=1 then return HomotopyRecord(i,x);
else
return NegateWord(HomotopyRecord(i,x));
fi;
end;
#####################################################################
fi;

return Objectify(HapResolution,
	    rec(
            dimension:=Dimension,
            boundary:=Boundary,
            homotopy:=Homotopy,
            elts:=EltsG,
            group:=G,
            properties:=
            [["length",N],
	     ["characteristic",0],
	     ["type","resolution"],
	     ["reduced",true]]  ));
end);
#####################################################################
#####################################################################