Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/hap/lib/Manifolds/   (GAP Algebra Version 4.15.1©)  Datei vom 19.6.2025 mit Größe 19 kB image not shown  

Quelle  manifolds.gi   Sprache: unbekannt

 
Spracherkennung für: .gi vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

#####################################################
#####################################################
InstallGlobalFunction(HAP_WedgeSumOfSimplicialComplexes,
function(K,L)
local W;

W:=MaximalSimplicesOfSimplicialComplex(K);
Append(W,  (K!.nrSimplices(0)-1)+MaximalSimplicesOfSimplicialComplex(L));

return MaximalSimplicesToSimplicialComplex(W);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallMethod(WedgeSum,
"wedge of simplicial complexes",
[IsHapSimplicialComplex,IsHapSimplicialComplex],
function(K,L)
return HAP_WedgeSumOfSimplicialComplexes(K,L);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(WedgeSum,
"wedge of simplicial complexes",
[IsHapSimplicialComplex,IsHapSimplicialComplex,IsHapSimplicialComplex],
function(K,L,M)
return HAP_WedgeSumOfSimplicialComplexes(HAP_WedgeSumOfSimplicialComplexes(K,L),M);
end);
#####################################################
#####################################################


#####################################################
#####################################################
InstallOtherMethod(WedgeSum,
"wedge of regulat CW complexes",
[IsHapRegularCWComplex,IsHapRegularCWComplex],
function(K,L)
return RegularCWComplex_WedgeSum(K,L,1,1);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(WedgeSum,
"wedge of regulat CW complexes",
[IsHapRegularCWComplex,IsHapRegularCWComplex,IsHapRegularCWComplex],
function(K,L,M)
return RegularCWComplex_WedgeSum(RegularCWComplex_WedgeSum(K,L,1,1),M,1,1);
end);
#####################################################
#####################################################



#####################################################
#####################################################
InstallOtherMethod(ClosedSurface,
"simplicial surface or genus +/- g (where - means nonorientable)",
[IsInt],
function(n)
local M, i;
if n=0 then return Sphere(n); fi;

if n>0 then M:=HAP_SimplicialTorus();;
for i in [2..n] do
M:=ConnectedSum(M,HAP_SimplicialTorus());
od;
return M;
fi;

M:=HAP_SimplicialProjectivePlane();;
for i in [2..-n] do
M:=ConnectedSum(M,HAP_SimplicialProjectivePlane());
od;
return M;

end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(ClosedSurface,
"simplicial surface or genus +/- g (where - means nonorientable)",
[IsInt,IsString],
function(n,str)
local Y;
if str="CW" then
Y:=ClosedSurface(n);
Y:=RegularCWComplex(Y);;
Y:=BarycentricallySimplifiedComplex(Y);
return Y;
fi;
if str="Simplicial" then
Y:=ClosedSurface(n);
return Y;
fi;
Print("The second argument should be \"CW\" or \"Simplicial\".\n");
return fail;
end);
#####################################################
#####################################################


#####################################################
#####################################################
InstallGlobalFunction(HAP_SimplicialTorus, 
function()
local S;

#S:=[ [1,2,4], [2,4,6], [2,3,6], [3,6,7], [1,3,7], [1,4,7],
#     [4,5,6], [5,6,8], [6,7,8], [7,8,9], [4,7,9], [4,5,9],
#     [1,5,8], [1,2,8], [2,8,9], [2,3,9], [3,5,9], [1,3,5]];; 
S:=[[1,2,6],[2,6,7],[2,3,7],[1,3,7],[4,6,7],[4,5,7],[1,5,7],
    [1,5,6],[1,2,4],[2,4,5],[2,3,5],[3,5,6],[3,4,6],[1,3,4]];;
return MaximalSimplicesToSimplicialComplex(S);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallGlobalFunction(HAP_SimplicialProjectivePlane,
function()
local S;

S:= [[1,5,8],[1,2,8],[2,7,8],[2,3,7],[3,4,7],
     [4,5,8],[4,8,9],[7,8,9],[6,7,9],[4,6,7],[4,5,6],
     [3,4,9],[2,3,9],[2,6,9],[1,2,6],[1,5,6]];;
return MaximalSimplicesToSimplicialComplex(S);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallGlobalFunction(SimplicialK3Surface,
function()
local S;

S:=[[210131516], [35101315], [257810], [19111314], [1281012], [135611], [156912], [145614], [14101314], [19101415], [247812], [3461012], [16789], [345715], [17121516], [4571316], [58111215], [2471214], [1451416], [2561011], [1681214], [5891416], [510111213], [248912], [79121516], [126915], [15141516], [23459], [68101115], [1581012], [137910], [678913], [1291115], [28111416], [2451316], [1481315], [4781011], [248910], [234913], [28101213], [1241115], [2391115], [28111516], [345911], [610131516], [810111516], [67111315], [1571516], [457915], [346716], [23111416], [3491113], [1251415], [2391314], [17121316], [1251316], [237812], [29111214], [19111516], [247810], [1491314], [1231216], [811121415], [1261316], [14101213], [3681016], [2781416], [168912], [69101416], [58111216], [59101415], [39121516], [46101115], [2491016], [5891315], [236915], [611121416], [23101315], [3591116], [3481113], [345713], [5781014], [412131415], [67101416], [510111314], [3471316], [6891213], [1341014], [2461112], [1791014], [4681314], [49101116], [3781016], [5791516], [1791114], [68101516], [4691416], [5891014], [78101416], [267911], [79101315], [3671012], [2461011], [458911], [123816], [138912], [126814], [3561315], [1561214], [2571415], [15101112], [3781011], [1261415], [126816], [79101215], [346814], [37131416], [257814], [6791014], [2371214], [410121314], [2561113], [456716], [13121316], [14111516], [134610], [110111213], [39111516], [35101415], [5891013], [125715], [24111214], [311131416], [125713], [478915], [1561011], [67101315], [3471415], [34101214], [126713], [234513], [58121315], [4691314], [245612], [29101316], [811121416], [17121315], [812131415], [2891213], [46101215], [28111415], [2691112], [89101116], [2361315], [23121516], [135912], [256912], [5681115], [26131516], [23111516], [356815], [245912], [210121314], [68121314], [123812], [147811], [5671216], [3571314], [345811], [67111215], [346712], [124711], [39101215], [410121516], [3571415], [39111314], [59141516], [456712], [1361011], [1391015], [478912], [59101315], [1381316], [29121314], [67101215], [2681415], [356811], [3471214], [13101415], [711121316], [311121316], [345815], [711131416], [2471415], [12101216], [1681316], [1781315], [69111214], [3681415], [24111415], [3791012], [1361415], [245610], [1491416], [13789], [5791216], [1371011], [7891315], [147815], [14101216], [17101114], [12679], [13111213], [1571316], [57101114], [210121516], [3671016], [125810], [410111516], [58101213], [3681011], [457912], [67111216], [2891013], [89101416], [346816], [110111314], [125814], [2451016], [127911], [13569], [57111314], [35101314], [2391114], [411121415], [2371416], [3481316], [6791114], [56111315], [4561416], [3481415], [458915], [1481113], [56121416], [23101214], [1251016], [2571011], [2671113], [1451016], [2681516], [23101215], [711121315], [1381113], [4891011], [19141516], [136915], [69121314], [23101314], [2571113], [235613], [4681316], [6791013], [58121416], [4691316], [5891116], [23569], [1351112], [378912], [46111215], [3591216], [511121315], [134614], [35111216], [1581214], [48131415], [137811], [69101316], [2491316], [167813], [14121315], [2471011], [1491113], [67111416], [1491116], [14121516], [124715], [237816], [145610]];;
return MaximalSimplicesToSimplicialComplex(S);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(Sphere,
"n-sphere as a simplicial complex",
[IsInt],
function(n)
local boundaries, k;

return MaximalSimplicesToSimplicialComplex( Combinations([1..n+2],n+1) );
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(ComplexProjectiveSpace,
"Complex projective plane as simplicial complex",
[IsInt],
function(n)
local B;

if n>2 or n<1 then 
Print("This is currently implemented only for n=12\n");
return fail;
fi;

if n=1 then return Sphere(2); fi;

B:=
[ [ 12456 ], [ 12459 ], [ 12568 ], 
  [ 12647 ], [ 23458 ], [ 23564 ], 
  [ 23567 ], [ 23649 ], [ 31457 ],
  [ 31569 ], [ 31645 ], [ 31648 ], 
  [ 45783 ], [ 45789 ], [ 45892 ], 
  [ 45971 ], [ 56782 ], [ 56891 ],
  [ 56897 ], [ 56973 ], [ 64781 ], 
  [ 64893 ], [ 64972 ], [ 64978 ], 
  [ 78123 ], [ 78126 ], [ 78235 ],
  [ 78314 ], [ 89125 ], [ 89231 ], 
  [ 89234 ], [ 89316 ], [ 97124 ], 
  [ 97236 ], [ 97312 ], [ 97315 ] ];;

return MaximalSimplicesToSimplicialComplex(B);
end);
#####################################################
#####################################################

#####################################################
#####################################################
## Inputs simplicial complexes K, L representing 
## n-manifolds and integer e=+ or e=-1. It returns the 
## connected sum K#L or K#-L depending on e. 
## The implementation assumes K!.vertices=[1..m] and
## L!.vertices=[1..n]
##
SimplicialComplexConnectedSum:=function(arg)
local K, L, e, V, W, maxK, maxL,newmaxL, x,y,w,N,reindex, pos,a, b;

K:=arg[1];
L:=arg[2];

if not Dimension(K)=Dimension(L) then
Print("The simplicial manifolds must have the same dimension.\n");
return fail;
fi;

e:=-arg[3]; 
maxK:=1*K!.simplicesLst[Dimension(K)+1];
maxL:=1*L!.simplicesLst[Dimension(L)+1];

if (not Size(MaximalSimplicesToSimplicialComplex(maxK)) = Size(K))
or (not Size(MaximalSimplicesToSimplicialComplex(maxL)) = Size(L))
then
Print("The simplicial complexes are not pure.\n");
return fail;
fi;

V:=maxK[1];
W:=maxL[1];
maxK:=maxK{[2..Length(maxK)]};
maxK:=Concatenation(maxK,Combinations(V,Length(V)-1));
maxL:=maxL{[2..Length(maxL)]};
maxL:=Concatenation(maxL,Combinations(W,Length(W)-1));
N:=K!.nrSimplices(0)+1;
reindex:=[];
for w in L!.vertices do 
pos:=Position(W,w);
if not pos=fail then reindex[w]:=V[pos];
else reindex[w]:=N; N:=N+1; fi;
od;

if e<0 then
W:=Flat(W);
a:=reindex[W[1]];
b:=reindex[W[2]];
reindex[W[1]]:=b;
reindex[W[2]]:=a;
fi;

newmaxL:=[];
for x in maxL do
Add(newmaxL, List(x,i->reindex[i]) );
od;

return MaximalSimplicesToSimplicialComplex( Concatenation(maxK,newmaxL) );;
end;
#####################################################
#####################################################

#####################################################
#####################################################
InstallMethod(ConnectedSum,
"Connected sum of simplicial manifolds",
[IsHapSimplicialComplex,IsHapSimplicialComplex,IsInt],
function(K,L,e);
return SimplicialComplexConnectedSum(K,L,e);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(ConnectedSum,
"Connected sum of simplicial manifolds",
[IsHapSimplicialComplex,IsHapSimplicialComplex],
function(K,L);
return SimplicialComplexConnectedSum(K,L,1);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(ConnectedSum,
"Connected sum of regular CW-manifolds  [temporary method -- needs replacing]",
[IsHapRegularCWComplex,IsHapRegularCWComplex,IsInt],
function(KK,LL,e)
local K, L;
K:=BarycentricSubdivision(KK);
L:=BarycentricSubdivision(LL);
return SimplifiedComplex(RegularCWComplex(ConnectedSum(K,L,e)));
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(ConnectedSum,
"Connected sum of regular CW-manifolds  [temporary method -- needs replacing]",
[IsHapRegularCWComplex,IsHapRegularCWComplex],
function(KK,LL)
local K, L;
K:=BarycentricSubdivision(KK);
L:=BarycentricSubdivision(LL);
return SimplifiedComplex(RegularCWComplex(ConnectedSum(K,L)));
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(Cohomology,
"Integral cohomology of a simplicial complex",
[IsHapSimplicialComplex,IsInt],
function(K,n);
return Cohomology(RegularCWComplex(K),n);
end);
#####################################################
#####################################################

#####################################################
#####################################################
IntersectionForm:=function(arg)
local Y, H, gens, A, i, j, cup, c, x, y, n,B;

Y:=arg[1];
#if IsHapSimplicialComplex(YY) then
#Y:=RegularCWComplex(YY); 
#else
#Y:=YY;
#fi;

if not ( IsEvenInt(Dimension(Y)) and  Homology(Y,Dimension(Y))=[0]   )
then Print("The argument must have even dimension and top homology equal to Z.\n"); return fail; fi;

n:=Dimension(Y)/2;

H:=Cohomology(Y,n);
gens:=Filtered([1..Length(H)],i->H[i]=0);
A:=NullMat(Length(gens),Length(gens));

cup:=CupProduct(Y);
if Length(arg)=1 then
B:=IdentityMat(Length(H));
B:=B{gens};
else B:=arg[2];
fi;

for i in [1..Length(B)] do
for j in [i..Length(B)] do
c:=cup(n,n,B[i],B[j]);
A[i][j]:=c[1];
A[j][i]:=(-1)^n*c[1];
od;
od;
return A;
end;
#####################################################
#####################################################

#####################################################
#####################################################
InstallGlobalFunction(CohomologyRingOfSimplicialComplex,
function(K,prime)
local R, dims, Y, C, D, n, k, i, j, ii, jj, dim, SCT, Degree, 
      cup, V, pair2int, int2pair, cnt, x, y, c, s, dims1;

Y:=RegularCWComplex(K);
C:=ChainComplex(Y);
D:=HomToIntegersModP(C,prime);
dims:=List([0..Dimension(K)], i->Cohomology(D,i));
dim:=Sum(dims);
cnt:=0;
dims1:=[];
dims1[1]:=0;
for k in [1..Length(dims)] do
cnt:=cnt+dims[k];
dims1[k+1]:=cnt;
od;
cup:=CupProduct(K,prime);

###############################
cnt:=0;
pair2int:=[];
int2pair:=[];
for n in [1..Length(dims)] do
pair2int[n]:=[];
for k in [1..dims[n]] do
cnt:=cnt+1;
pair2int[n][k]:=cnt;
int2pair[cnt]:=[n,k];
od;
od;
###############################

SCT:=EmptySCTable(dim,Zero(GF(prime)));
cnt:=0;

for i in [1..dim] do
for j in [i..dim] do
ii:=int2pair[i];
jj:=int2pair[j];
x:=[1..dims[ii[1]]]*0; x[ii[2]]:=1;
y:=[1..dims[jj[1]]]*0; y[jj[2]]:=1;
if ii[1]-1+jj[1]-1<=Length(dims)-1 then
c:=cup(ii[1]-1,jj[1]-1, x, y);
s:=dims1[ii[1]-1+jj[1]];
V:=[];
for k in [1..Length(c)] do
if not c[k]=0 then
Add(V, c[k]);
Add(V, s+k);
fi;
od;
SetEntrySCTable(SCT,i,j,V);
fi;
od;
od;

for i in [1..dim] do
for j in [1..i-1] do
ii:=int2pair[i];
jj:=int2pair[j];
x:=[];
x[1]:=List(SCT[j][i][1],a->1*a);
x[2]:=List(SCT[j][i][2],a->1*a);
if IsOddInt((ii[1]-1)*(jj[1]-1)) then
x[2]:=-1*x[2];
fi;
SCT[i][j]:=x;
od;od;

R:=AlgebraByStructureConstants(GF(prime),SCT);
R!.chainComplex:=C;

#####################################################################
Degree:=function(x)
local i, w, bas;
# returns the highest degree of a non-zero coefficient of x

if IsZero(x) then return 0; fi;
i:=Position(GeneratorsOfAlgebra(R),x);

if i=1 then return 0; fi;

if not i=fail then return int2pair[i][1]-1; fi;

bas:=Basis(R);
w:=Coefficients(bas,x);
w:=Filtered([2..Length(bas)],i->not IsZero(w[i]));
w:=List(w,i->int2pair[i][1]-1);
return Maximum(w);
end;
#####################################################################

R!.degree:=Degree;
R!.int2pair:=int2pair;
R!.pair2int:=pair2int;
#R!.bockstein:=HAP_bockstein(R); 
return R;
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(CohomologyRing,
"cohomology of a simplicial complex over a field of p elements",
[IsHapSimplicialComplex,IsInt],
function(K,prime);
return CohomologyRingOfSimplicialComplex(K,prime);
end);
#####################################################
#####################################################

#####################################################
#####################################################
InstallOtherMethod(CohomologyRing,
"cohomology of a regular CW-complex complex over a field of p elements",
[IsHapRegularCWComplex,IsInt],
function(W,prime)
local K;
#K:=BarycentricSubdivision(W);     #WE SHOULD USE THE DIAGONAL FOR W HERE!!!
                                  #THIS IS A TEMPORARY METHOD
return CohomologyRingOfSimplicialComplex(W,prime);
end);
#####################################################
#####################################################


[zur Elbe Produktseite wechseln0.86QuellennavigatorsAnalyse erneut starten2026-06-18]