/* This file constructs a PC presentation for a generalised Nottingham group in Gap format. */ #include "global.h" #include /* Prototypes */ void GAPfprintvec(vector v, FILE *fp); void GAPfpowers(FILE *fp); void GAPfcommutators(FILE *fp); void GapPres(void); extern int prime, rank, total; void GAPfprintvec(vector v, FILE *fp) { int i, id = 1; for(i = 0; i < (total - rank - 1) * rank; i++) if (v[i]) { if (!id) fprintf(fp, "* "); fprintf(fp, "a%d^%d ", i + 1, v[i]); id = 0; } if (id) fprintf(fp, " a1^0 "); } void GAPfpowers(FILE *fp) { int i, j, k, t = 1; vector v; group_elt g, h; for(i = rank + 1; i < total; i++) for(j = 0; j < rank; j++) { initgroupelt(g); for(k = 0; k < rank; k++) g[k][rank - k] = 1; g[j][i] = 1; gpower(g, prime); groupinv(g,h); normalform(h, v); fprintf(fp, "a%d^%d * ",t++ , prime); GAPfprintvec(v, fp); fprintf(fp, ",\n"); } } void GAPfcommutators(FILE *fp) { vector vec; group_elt g, h, c; int i, j, u, v, k, t, s = 0; for(i = rank + 1; i < total; i++) for(j = 0; j < rank; j++) { initgroupelt(g); for(k = 0; k < rank; k++) g[k][rank - k] = 1; g[j][i] = 1; s++; t = 0; for(u = rank + 1; u < total; u++) for(v = 0; v < rank; v++) { t++; if (t>s) { initgroupelt(h); for(k = 0; k < rank; k++) h[k][rank - k] = 1; h[v][u] = 1; commutator(g, h, c); fprintf(fp, "Comm(a%d,a%d)*",t,s); normalform(c, vec); GAPfprintvec(vec, fp); if (t != rank * (total - rank - 1) || s != t-1) fprintf(fp,","); fprintf(fp,"\n"); } } } } void GapPres(void) { int complength, i; FILE *fp; set_file(&fp); complength = rank * (total - rank - 1); for(i = 0; i < complength; i++) { fprintf(fp, "a%d:=AbstractGenerator(\"a%d\");\n", i+1, i+1); } fprintf(fp, "generators:=["); for (i = 0; i < complength; i++) { fprintf(fp, "a%d", i+1); if (i < complength -1) fprintf(fp, ","); } fprintf(fp, "];"); fprintf(fp,"\n relators:=["); GAPfpowers(fp); GAPfcommutators(fp); fprintf(fp, "];\n"); fprintf(fp, "G := AgGroupFpGroup(rec(generators:=generators, relators:=relators));"); }