source: git/Singular/LIB/fpalgebras.lib @ c47d823

fieker-DuValspielwiese
Last change on this file since c47d823 was c47d823, checked in by Hans Schoenemann <hannes@…>, 5 years ago
doc: format
  • Property mode set to 100644
File size: 46.0 KB
Line 
1////////////////////////////////////////////////////////////////
2version="version fpalgebras.lib 4.1.1.4 Oct_2018 "; // $Id$
3category="Noncommutative";
4info="
5LIBRARY: fpalgebras.lib    Definitions of some finitely presented algebras and groups (Letterplace)
6AUTHORS: Karim Abou Zeid,       karim.abou.zeid at rwth-aachen.de@*
7         Viktor Levandovskyy,   viktor.levandovskyy at math.rwth-aachen.de@*
8         Grischa Studzinski,    grischa.studzinski at rwth-aachen.de
9
10Support: Project II.6 in the transregional collaborative research centre
11SFB-TRR 195 'Symbolic Tools in Mathematics and their Application' of the German DFG
12
13OVERVIEW:
14Generation of various algebras, including group algebras of finitely presented groups in the Letterplace ring.
15FPA stands for finitely presented algebra.
16
17KEYWORDS: free associative algebra; finitely presented algebra; finitely presented group; Serre relations
18
19PROCEDURES:
20operatorAlgebra(string a, int d); description of some common algebras of operators
21serreRelations(A,z); compute the homogeneous part of Serre's relations associated to a generalized Cartan matrix A
22fullSerreRelations(A,N,C,P,d); compute the ideal of all Serre's relations associated to a generalized Cartan matrix A
23ademRelations(i,j);    compute the ideal of Adem relations for i<2j in char 0
24baumslagSolitar(int n, int m, int d, list #);
25baumslagGroup(int m, int n, int d);
26crystallographicGroupP1(int d);
27crystallographicGroupPM(int d);
28crystallographicGroupPG(int d);
29crystallographicGroupP2MM(int d);
30crystallographicGroupP2(int d);
31crystallographicGroupP2GG(int d);
32crystallographicGroupCM(int d);
33crystallographicGroupC2MM(int d);
34crystallographicGroupP4(int d);
35crystallographicGroupP4MM(int d);
36crystallographicGroupP4GM(int d);
37crystallographicGroupP3(int d);
38crystallographicGroupP31M(int d);
39crystallographicGroupP3M1(int d);
40crystallographicGroupP6(int d);
41crystallographicGroupP6MM(int d);
42dyckGroup1(int n, int d, intvec P);
43dyckGroup2(int n, int d, intvec P);
44dyckGroup3(int n, int d, intvec P);
45fibonacciGroup(int m, int d);
46tetrahedronGroup(int g, int d);
47triangularGroup(int g, int d);
48
49SEE ALSO: freegb_lib, fpadim_lib, fpaprops_lib, LETTERPLACE
50";
51
52LIB "freegb.lib";
53LIB "general.lib";
54////////////////////////////////////////////////////////////////////
55
56/* very fast and cheap test of consistency and functionality
57  DO NOT make it static !
58  after adding the new proc, add it here */
59proc tstfpalgebras()
60{
61  example operatorAlgebra;
62  example serreRelations;
63  example fullSerreRelations;
64  example ademRelations;
65  example baumslagSolitar;
66  example baumslagGroup;
67  example dyckGroup1;
68  example dyckGroup2;
69  example dyckGroup3;
70  example fibonacciGroup;
71  example tetrahedronGroup;
72  example triangularGroup;
73};
74
75// Serre and Adem
76proc serreRelations(intmat A, int zu)
77"USAGE:  serreRelations(A,z); A an intmat, z an int
78RETURN:  ideal
79ASSUME: basering has a letterplace ring structure and
80@*          A is a generalized Cartan matrix with integer entries
81PURPOSE: compute the ideal of Serre's relations associated to A
82EXAMPLE: example serreRelations; shows examples
83"
84{
85  // zu = 1 -> with commutators [f_i,f_j]; zu == 0 without them
86  // suppose that A is cartan matrix
87  // then Serre's relations are
88  // (ad f_j)^{1-A_{ij}} ( f_i)
89  int ppl = printlevel-voice+2;
90  int n = ncols(A); // hence n variables
91  int i,j,k,el;
92  poly p,q;
93  ideal I;
94  for (i=1; i<=n; i++)
95  {
96    for (j=1; j<=n; j++)
97    {
98      el = 1 - A[i,j];
99      //     printf("i:%s, j: %s, l: %s",i,j,l);
100      dbprint(ppl,"i, j, l: ",i,j,el);
101      //      if ((i!=j) && (l >0))
102      //      if ( (i!=j) &&  ( ((zu ==0) &&  (l >=2)) || ((zu ==1) &&  (l >=1)) ) )
103      if ((i!=j) && (el >0))
104      {
105        q = lieBracket(var(j),var(i));
106        dbprint(ppl,"first bracket: ",q);
107        //        if (l >=2)
108        //        {
109          for (k=1; k<=el-1; k++)
110          {
111            q = lieBracket(var(j),q);
112            dbprint(ppl,"further bracket:",q);
113          }
114          //        }
115      }
116      if (q!=0) { I = I,q; q=0;}
117    }
118  }
119  I = simplify(I,2);
120  return(I);
121}
122example
123{
124  "EXAMPLE:"; echo = 2;
125  intmat A[3][3] =
126    2, -1, 0,
127    -1, 2, -3,
128    0, -1, 2; // G^1_2 Cartan matrix
129  ring r = 0,(f1,f2,f3),dp;
130  int uptodeg = 5;
131  def R = makeLetterplaceRing(uptodeg);
132  setring R;
133  ideal I = serreRelations(A,1); I = simplify(I,1+2+8);
134  I;
135}
136
137/* setup for older example:
138  intmat A[2][2] = 2, -1, -1, 2; // sl_3 == A_2
139  ring r = 0,(f1,f2),dp;
140  int uptodeg = 5; int lV = 2;
141*/
142
143proc fullSerreRelations(intmat A, ideal rNegative, ideal rCartan, ideal rPositive, int uptodeg)
144"USAGE:  fullSerreRelations(A,N,C,P,d); A an intmat, N,C,P ideals, d an int
145RETURN:  ring (and ideal)
146PURPOSE: compute the inhomogeneous Serre's relations associated to A in given
147@*       variable names
148ASSUME: three ideals in the input are of the same sizes and contain merely
149@* variables which are interpreted as follows: N resp. P stand for negative
150@* resp. positive roots, C stand for Cartan elements. d is the degree bound for
151@* letterplace ring, which will be returned.
152@* The matrix A is a generalized Cartan matrix with integer entries
153@* The result is the ideal called 'fsRel' in the returned ring.
154EXAMPLE: example fullSerreRelations; shows examples
155"
156{
157  /* SerreRels on rNeg and rPos plus Cartans etc. */
158  int ppl = printlevel -voice+2;
159  /* ideals must be written in variables: assume each term is of degree 1 */
160  int i,j,k;
161  int N = nvars(basering);
162  def save = basering;
163  int comFlag = 0;
164  /* assume:  (size(rNegative) == size(rPositive)) */
165  /* assume:  (size(rNegative) == size(rCartan)) i.e. nonsimple Cartans */
166  if ( (size(rNegative) != size(rPositive)) || (size(rNegative) != size(rCartan)) )
167  {
168    ERROR("All input ideals must be of the same size");
169  }
170
171//   if (size(rNegative) != size(rPositive))
172//   {
173//     ERROR("The 1st and the 3rd input ideals must be of the same size");
174//   }
175
176  /* assume:  2*size(rNegative) + size(rCartan) >= nvars(basering) */
177  i = 2*size(rNegative) + size(rCartan);
178  if (i>N)
179  {
180    string s1="The total number of elements in input ideals";
181    string s2="must not exceed the dimension of the ground ring";
182    ERROR(s1+s2);
183  }
184  if (i < N)
185  {
186    comFlag = N-i; // so many elements will commute
187    "Warning: some elements will be treated as mutually commuting";
188  }
189  /* extract varnames from input ideals */
190  intvec iNeg = varIdeal2intvec(rNegative);
191  intvec iCartan = varIdeal2intvec(rCartan);
192  intvec iPos = varIdeal2intvec(rPositive);
193  /* for each vector in rNeg and rPositive, go into the corr. ring and create SerreRels */
194  /* rNegative: */
195  list L = ringlist(save);
196  def LPsave = makeLetterplaceRing(uptodeg); setring save;
197  list LNEG = L; list tmp;
198  /* L[1] field as is; L[2] vars: a subset; L[3] ordering: dp, L[4] as is */
199  for (i=1; i<=size(iNeg); i++)
200  {
201    tmp[i] = string(var(iNeg[i]));
202  }
203  LNEG[2] = tmp; LNEG[3] = list(list("dp",intvec(1:size(iNeg))), list("C",0));
204  def RNEG = ring(LNEG); setring RNEG;
205  def RRNEG = makeLetterplaceRing(uptodeg);
206  setring RRNEG;
207  ideal I = serreRelations(A,1); I = simplify(I,1+2+8);
208  setring LPsave;
209  ideal srNeg = imap(RRNEG,I);
210  dbprint(ppl,"0-1 ideal of negative relations is ready");
211  dbprint(ppl-1,srNeg);
212  setring save; kill L,tmp,RRNEG,RNEG, LNEG;
213  /* rPositive: */
214  list L = ringlist(save);
215  list LPOS = L; list tmp;
216  /* L[1] field as is; L[2] vars: a subset; L[3] ordering: dp, L[4] as is */
217  for (i=1; i<=size(iPos); i++)
218  {
219    tmp[i] = string(var(iPos[i]));
220  }
221  LPOS[2] = tmp; LPOS[3] = list(list("dp",intvec(1:size(iPos))), list("C",0));
222  def RPOS = ring(LPOS); setring RPOS;
223  def RRPOS = makeLetterplaceRing(uptodeg);
224  setring RRPOS;
225  ideal I = serreRelations(A,1); I = simplify(I,1+2+8);
226  setring LPsave;
227  ideal srPos = imap(RRPOS,I);
228  dbprint(ppl,"0-2 ideal of positive relations is ready");
229  dbprint(ppl-1,srPos);
230  setring save; kill L,tmp,RRPOS,RPOS, LPOS;
231  string sMap = "ideal Mmap =";
232  for (i=1; i<=nvars(save); i++)
233  {
234    sMap = sMap + string(var(i))+",";
235  }
236  sMap[size(sMap)] = ";";
237  /* cartans: h_j h_i = h_i h_j */
238  setring LPsave;
239  ideal ComCartan;
240  for (i=1; i<size(iCartan); i++)
241  {
242    for (j=i+1; j<=size(iCartan); j++)
243    {
244      ComCartan =  ComCartan + lieBracket(var(iCartan[j]),var(iCartan[i]));
245    }
246  }
247  ComCartan = simplify(ComCartan,1+2+8);
248  execute(sMap); // defines an ideal Mmap
249  map F = save, Mmap;
250  dbprint(ppl,"1. commuting Cartans: ");
251  dbprint(ppl-1,ComCartan);
252  /* [e_i, f_j] =0 if i<>j */
253  ideal ComPosNeg; // assume: #Neg=#Pos
254  for (i=1; i<size(iPos); i++)
255  {
256    for (j=1; j<=size(iPos); j++)
257    {
258      if (j !=i)
259      {
260        ComPosNeg =  ComPosNeg + lieBracket(var(iPos[i]),var(iNeg[j]));
261        ComPosNeg =  ComPosNeg + lieBracket(var(iPos[j]),var(iNeg[i]));
262      }
263    }
264  }
265  ComPosNeg = simplify(ComPosNeg,1+2+8);
266  dbprint(ppl,"2. commuting Positive and Negative:");
267  dbprint(ppl-1,ComPosNeg);
268  /* [e_i, f_i] = h_i */
269  poly tempo;
270  for (i=1; i<=size(iCartan); i++)
271  {
272    tempo = lieBracket(var(iPos[i]),var(iNeg[i])) - var(iCartan[i]);
273    ComPosNeg =  ComPosNeg + tempo;
274  }
275  //  ComPosNeg = simplify(ComPosNeg,1+2+8);
276  dbprint(ppl,"3. added sl2 triples [e_i,f_i]=h_i");
277  dbprint(ppl-1,ComPosNeg);
278
279  /* [h_i, e_j] = A_ij e_j */
280  /* [h_i, f_j] = -A_ij f_j */
281  ideal ActCartan; // assume: #Neg=#Pos
282  for (i=1; i<=size(iCartan); i++)
283  {
284    for (j=1; j<=size(iCartan); j++)
285    {
286      tempo = lieBracket(var(iCartan[i]),var(iPos[j])) - A[i,j]*var(iPos[j]);
287      ActCartan = ActCartan + tempo;
288      tempo = lieBracket(var(iCartan[i]),var(iNeg[j])) + A[i,j]*var(iNeg[j]);
289      ActCartan = ActCartan + tempo;
290    }
291  }
292  ActCartan = simplify(ActCartan,1+2+8);
293  dbprint(ppl,"4. actions of Cartan:");
294  dbprint(ppl-1, ActCartan);
295
296  /* final part: prepare the output */
297  setring LPsave;
298  ideal fsRel = srNeg, srPos, ComPosNeg, ComCartan, ActCartan;
299  export fsRel;
300  setring save;
301  return(LPsave);
302}
303example
304{
305  "EXAMPLE:"; echo = 2;
306  intmat A[2][2] =
307    2, -1,
308    -1, 2; // A_2 = sl_3 Cartan matrix
309  ring r = 0,(f1,f2,h1,h2,e1,e2),dp;
310  ideal negroots = f1,f2; ideal cartans = h1,h2; ideal posroots = e1,e2;
311  int uptodeg = 5;
312  def RS = fullSerreRelations(A,negroots,cartans,posroots,uptodeg);
313  setring RS; fsRel;
314}
315
316/* intmat A[2][2] =
317    2, -1,
318    -3, 2; // G_2 Cartan matrix
319*/
320
321
322static proc varIdeal2intvec(ideal I)
323{
324  // used in SerreRelations
325  /* assume1:  input ideal is a list of variables of the ground ring */
326  int i,j; intvec V;
327  for (i=1; i<= size(I); i++)
328  {
329    j = univariate(I[i]);
330    if (j<=0)
331    {
332      ERROR("input ideal must contain only variables");
333    }
334    V[i] = j;
335  }
336  dbprint(printlevel-voice+2,V);
337  /* now we make a smaller list of non-repeating entries */
338  ideal iW = simplify(ideal(V),2+4); // no zeros, no repetitions
339  if (size(iW) < size(V))
340  {
341    /* extract intvec from iW */
342    intvec inW;
343    for(j=1; j<=size(iW); j++)
344    {
345      inW[j] = int(leadcoef(iW[j]));
346    }
347    return(inW);
348  }
349  return(V);
350}
351example
352{
353  "EXAMPLE:"; echo = 2;
354  ring r = 0,(x,y,z),dp;
355  ideal I = x,z;
356  varIdeal2intvec(I);
357  varIdeal2intvec(ideal(x2,y^3,x+1));
358  varIdeal2intvec(ideal(x*y,y,x+1));
359}
360
361proc ademRelations(int i, int j)
362"USAGE:  ademRelations(i,j); i,j int
363RETURN:  ring (and exports ideal)
364PURPOSE: compute the ideal of Adem relations for i<2j in characteristic 0
365@*  the ideal is exported under the name AdemRel in the output ring
366EXAMPLE: example ademRelations; shows examples
367"
368{
369  // produces Adem relations for i<2j in char 0
370  // assume: 0<i<2j
371  // requires presence of vars up to i+j
372  if ( (i<0) || (i >= 2*j) )
373  {
374    ERROR("arguments out of range"); return(0);
375  }
376  ring @r = 0,(s(i+j..0)),lp;
377  poly p,q;
378  number n;
379  int ii = i div 2; int k;
380  // k=0 => s(0)=1
381  n = binomial(j-1,i);
382  q = n*s(i+j)*s(0);
383  //  printf("k=0, term=%s",q);
384  p = p + q;
385  for (k=1; k<= ii; k++)
386  {
387    n = binomial(j-k-1,i-2*k);
388    q = n*s(i+j-k)*s(k);;
389    //    printf("k=%s, term=%s",k,q);
390    p = p + q;
391  }
392  poly AdemRel = p;
393  export AdemRel;
394  return(@r);
395}
396example
397{
398  "EXAMPLE:"; echo = 2;
399  def A = ademRelations(2,5);
400  setring A;
401  AdemRel;
402}
403
404/*
4051,1: 0
4061,2: s(3)*s(0) == s(3) -> def for s(3):=s(1)s(2)
4072,1: adm
4082,2: s(3)*s(1) == s(1)s(2)s(1)
4091,3: 0 ( since 2*s(4)*s(0) = 0 mod 2)
4103,1: adm
4112,3: s(5)*s(0)+s(4)*s(1) == s(5)+s(4)*s(1)
4123,2: 0
4133,3: s(5)*s(1)
4141,4: 3*s(5)*s(0) == s(5)  -> def for s(5):=s(1)*s(4)
4154,1: adm
4162,4: 3*s(6)*s(0)+s(5)*s(1) == s(6) + s(5)*s(1) == s(6) + s(1)*s(4)*s(1)
4174,2: adm
4184,3: s(5)*s(2)
4193,4: s(7)*s(0)+2*s(6)*s(1) == s(7) -> def for s(7):=s(3)*s(4)
4204,4: s(7)*s(1)+s(6)*s(2)
421*/
422
423/* s1,s2:
424s1*s1 =0, s2*s2 = s1*s2*s1
425try char 0:
426s1,s2:
427s1*s1 =0, s2*s2 = s1*s2*s1, s(1)*s(3)== s(1)*s(1)*s(3) == 0 = 2*s(4) ->def for s(4)
428hence 2==0! only in char 2
429Adem rels modulo 2 are interesting
430 */
431
432////////////////////////////////////////////////////////////////////
433// Operator Algebras ///////////////////////////////////////////////
434////////////////////////////////////////////////////////////////////
435
436proc operatorAlgebra(string a, int d)
437"USAGE: operatorAlgebra(a,d); a a string, d an integer
438RETURN: ring
439NOTE: - the ring contains the ideal I, which contains the required relations
440      - a gives the name of the algebra
441      - d gives the degreebound for the Letterplace ring
442
443      a must be one of the following:
444        integrodiff3
445        toeplitz
446        weyl1
447        usl2
448        usl2h
449        shift1inverse
450        exterior2
451        quadrowmm
452        shift1
453        weyl1inverse
454
455      This is a collection of common algebras.
456"
457{
458  if (d < 2) {
459    ERROR("Degbound d is too small. Must be at least 2.");
460  }
461  int baseringdef;
462  if (defined(basering)) // if a basering is defined, it should be saved for later use
463  {
464    def save = basering;
465    baseringdef = 1;
466  }
467
468  if (a == "integrodiff3") {
469    ring r = 0,(D,II,x),dp;
470    def R = makeLetterplaceRing(d);
471    setring(R);
472    ideal I = D*x-x*D-1,
473          II*x-x*II+II*II,
474          D*II-1;
475  }
476  if (a == "toeplitz") {
477    ring r = 0,(y,x),dp;
478    def R = makeLetterplaceRing(d);
479    setring(R);
480    ideal I = y*x-1;
481  }
482  if (a == "weyl1") {
483    ring r = 0,(D,x),dp;
484    def R = makeLetterplaceRing(d);
485    setring(R);
486    ideal I = D*x-x*D-1;
487  }
488  if (a == "usl2") {
489    ring r = 0,(h,f,e),dp;
490    def R = makeLetterplaceRing(d);
491    setring(R);
492    ideal I = f*e-e*f+h,
493          h*e-e*h-2*e,
494          h*f-f*h+2*f;
495  }
496  if (a == "usl2h") {
497    ring r = 0,(H,h,f,e),dp;
498    def R = makeLetterplaceRing(d);
499    setring(R);
500    ideal I = f*e-e*f+h*H,
501          h*e-e*h-2*e*H,
502          h*f-f*h+2*f*H,
503          f*H-H*f,
504          e*H-H*e,
505          h*H-H*h;
506  }
507  if (a == "shift1inverse") {
508    ring r = 0,(D,x,t),dp;
509    def R = makeLetterplaceRing(d);
510    setring(R);
511    ideal I = D*x-x*D-D,
512          t*x-1,
513          x*t-1;
514  }
515  if (a == "exterior2") {
516    ring r = 0,(y,x),dp;
517    def R = makeLetterplaceRing(d);
518    setring(R);
519    ideal I = y*x+x*y,
520          x*x,
521          y*y;
522  }
523  if (a == "quadrowmm") {
524    ring r = 0,(y,x),dp;
525    def R = makeLetterplaceRing(d);
526    setring(R);
527    ideal I = y*x-x*y,
528          x*x,
529          y*y;
530  }
531  if (a == "shift1") {
532    ring r = 0,(s,x),dp;
533    def R = makeLetterplaceRing(d);
534    setring(R);
535    ideal I = s*x-x*s-s;
536  }
537  if (a == "weyl1inverse") {
538    ring r = 0,(D,x,t),dp;
539    def R = makeLetterplaceRing(d);
540    setring(R);
541    ideal I = D*x-x*D-1,
542          t*x-1,
543          x*t-1;
544  }
545
546  if (!defined(I)) {
547    ERROR("Illegal argument for algebra");
548  }
549
550  export(I);
551  if (baseringdef == 1) {setring save;}
552  return(R);
553}
554example
555{
556  "EXAMPLE:"; echo = 2;
557  def R = operatorAlgebra("integrodiff3",5); setring R;
558  I; //relations of the algebra
559}
560
561////////////////////////////////////////////////////////////////////
562// Baumslag ////////////////////////////////////////////////////////
563// from Grischa Studzinski /////////////////////////////////////////
564////////////////////////////////////////////////////////////////////
565
566proc baumslagSolitar(int n, int m, int d, list #)
567"USAGE: baumslagSolitar(m,n,d[,IsGroup]); n an integer, m an integer, d an integer, IsGroup an optional integer
568RETURN: ring
569NOTE: - the ring contains the ideal I, which contains the required relations
570      - in the group case: A = a^(-1), B = b^(-1)
571      - negative input is only allowed in the group case!
572      - d gives a degreebound and must be >m,n
573      - varying n and m produces a family of examples
574"
575{
576  int isGroup = 0;
577  if (size(#) > 0) {isGroup = #[1];}
578
579  if (isGroup != 0)
580  {
581   int baseringdef;
582   if (defined(basering)) // if a basering is defined, it should be saved for later use
583   {
584    def save = basering;
585    baseringdef = 1;
586   }
587   if (m < 0 || n < 0) {ERROR("Exponent can't be negativ in monoid rings!");}
588   if (d < 1 || d < m || d < n) {ERROR("Degree bound must be positiv and greater then m,n!");}
589   int i;
590   ring mr = 0,(a,b),Dp;
591   def Mr = makeLetterplaceRing(d);
592   setring Mr;
593   poly p,q;
594   if (n==0) {p = b;}
595   else
596   {
597    p = a*b;
598    for (i = 1; i < n; i++) {p = a*p;}
599   }
600   if (m==0) {q = b;}
601   else
602   {
603    q = b*a;
604    for (i = 1; i < m; i++) {q = q*a;}
605   }
606   ideal I = p - q;
607   export(I);
608   if (baseringdef == 1) {setring save;}
609   return(Mr);
610  }
611  else
612  {
613   int baseringdef;
614   if (defined(basering)) // if a basering is defined, it should be saved for later use
615   {
616    def save = basering;
617    baseringdef = 1;
618   }
619   int i;
620   if (d < 1 || d < absValue(m) || d < absValue(n)) {ERROR("Degree bound must be positiv and greater then |m|,|n|!");}
621   ring gr = 0,(a,b,A,B),Dp;
622   def Gr = makeLetterplaceRing(d);
623   setring Gr;
624   poly p,q;
625   if (n==0) {p = b;}
626   else
627   {if (n > 0)
628    {
629     p = a*b;
630     for (i = 1; i < n; i++) {p = a*p;}
631    }
632    else
633    {
634     p = A*b;
635     for (i = 1; i < -n; i++) {p = A*p;}
636    }
637   }
638   if (m==0) {q = b;}
639   else
640   {if (m > 0)
641    {
642     q = b*a;
643     for (i = 1; i < m; i++) {q = q*a;}
644    }
645    else
646    {
647     q = A*b;
648     for (i = 1; i < -m; i++) {q = q*A;}
649    }
650   }
651   ideal I = p - q, a*A - 1, b*B - 1, a*A - A*a, b*B - B*b;
652   export(I);
653   if (baseringdef == 1) {setring save;}
654   return(Gr);
655  }
656}
657example
658{
659  "EXAMPLE:"; echo = 2;
660  def R = baumslagSolitar(2,3,4); setring R;
661  I;
662}
663
664proc baumslagGroup(int m, int n, int d)
665"USAGE: baumslagGroup(m,n,d); m an integer, n an integer, d an integer
666RETURN: ring
667NOTE: - the ring contains the ideal I, which contains the required relations
668      - Baumslag group with the following presentation
669        < a, b | a^m = b^n = 1 >
670      -d gives the degreebound for the Letterplace ring
671      - varying n and m produces a family of examples
672"
673{
674 if (m < 0 || n < 0 ) {ERROR("m,n must be non-negativ integers!");}
675 if (d < 1 || d < m || d < n) {ERROR("degreebound must be positiv and larger than n and m!");}
676 int i;
677 ring r = 0,(a,b),dp;
678 def R = makeLetterplaceRing(d);
679 setring R;
680 poly p,q;
681 p = 1; q = 1;
682 for (i = 1; i <= m; i++){p = p*a;}
683 for (i = 1; i <= n; i++){q = q*b;}
684 ideal I = p-1,q-1;
685 export(I);
686 return(R);
687}
688example
689{
690  "EXAMPLE:"; echo = 2;
691  def R = baumslagGroup(2,3,4); setring R;
692  I;
693}
694
695////////////////////////////////////////////////////////////////////
696// Crystallographic Groups //////////////////////////////////////////
697// from Grischa Studzinski /////////////////////////////////////////
698////////////////////////////////////////////////////////////////////
699
700proc crystallographicGroupP1(int d)
701"USAGE: crystallographicGroupP1(d); d an integer
702RETURN: ring
703NOTE: - the ring contains the ideal I, which contains the required relations
704      - p1 group with the following presentation
705        < x, y | [x, y] = 1 >
706      -d gives the degreebound for the Letterplace ring
707"
708{
709 if (d < 2){ERROR("Degreebound is to small for choosen example!");}
710
711 int baseringdef;
712 if (defined(basering)) // if a basering is defined, it should be saved for later use
713 {
714  def save = basering;
715  baseringdef = 1;
716 }
717 ring r = 2,(x,y,X,Y),dp;
718 def R = makeLetterplaceRing(d);
719 setring R;
720 ideal I = x*y-y*x-1, X*x-1, x*X-1, y*Y-1, Y*y-1;
721 I = simplify(I,2);
722 export(I);
723 if (baseringdef == 1) {setring save;}
724 return(R);
725}
726example
727{
728  "EXAMPLE:"; echo = 2;
729  def R = crystallographicGroupP1(5); setring R;
730  I;
731}
732
733// old? there is already another crystallographicGroupP2 proc
734/* proc crystallographicGroupP2(int d) */
735/* " */
736/* p2 group with the following presentation */
737/* < x, y, r | [x, y] = r^2 = 1, r^(-1)*x*r = x^(-1), r^(-1)*y*r = y^(-1) > */
738/* Note: r = r^(-1) */
739/* " */
740/* { */
741/*  if (d < 3){ERROR("Degreebound is to small for choosen example!");} */
742
743/*  int baseringdef; */
744/*  if (defined(basering)) // if a basering is defined, it should be saved for later use */
745/*  { */
746/*   def save = basering; */
747/*   baseringdef = 1; */
748/*  } */
749/*  ring r = 2,(x,y,r,X,Y),dp; */
750/*  def R = makeLetterplaceRing(d); */
751/*  setring R; */
752/*  ideal I = x*y-y*x-1, x*y-y*x-r*r, r*r-1, r*x*r-X, r*y*r-Y,x*X-1, */
753/* X*x-1, Y*y-1,  y*Y-1; */
754/*  I = simplify(I,2); */
755/*  export(I); */
756/*  if (baseringdef == 1) {setring save;} */
757/*  return(R); */
758/* } */
759
760proc crystallographicGroupPM(int d)
761"USAGE: crystallographicGroupPM(d); d an integer
762RETURN: ring
763NOTE: - the ring contains the ideal I, which contains the required relations
764      - pm group with the following presentation
765        < x, y, m | [x, y] = m^2 = 1, m^(-1)*x*m = x, m^(-1)*y*m = y^(-1) >
766      - d gives the degreebound for the Letterplace ring
767"
768{
769 if (d < 3){ERROR("Degreebound is to small for choosen example!");}
770
771 int baseringdef;
772 if (defined(basering)) // if a basering is defined, it should be saved for later use
773 {
774  def save = basering;
775  baseringdef = 1;
776 }
777 ring r = 2,(x,y,m,X,Y),dp;
778 def R = makeLetterplaceRing(d);
779 setring R;
780 ideal I = x*y-y*x-1, x*y-y*x-m*m, m*m-1, m*x*m-x, m*y*m-Y,x*X-1,
781X*x-1, Y*y-1,  y*Y-1;
782 I = simplify(I,2);
783 export(I);
784 if (baseringdef == 1) {setring save;}
785 return(R);
786}
787example
788{
789  "EXAMPLE:"; echo = 2;
790  def R = crystallographicGroupPM(5); setring R;
791  I;
792}
793
794proc crystallographicGroupPG(int d)
795"USAGE: crystallographicGroupPG(d); d an integer
796RETURN: ring
797NOTE: - the ring contains the ideal I, which contains the required relations
798      - pg group with the following presentation
799        < x, y, t | [x, y] = 1, t^2 = x, t^(-1)*y*t = y^(-1) >
800      - d gives the degreebound for the Letterplace ring
801"
802{
803 if (d < 3){ERROR("Degreebound is to small for choosen example!");}
804
805 int baseringdef;
806 if (defined(basering)) // if a basering is defined, it should be saved for later use
807 {
808  def save = basering;
809  baseringdef = 1;
810 }
811 ring r = 2,(x,y,t,X,Y,T),dp;
812 def R = makeLetterplaceRing(d);
813 setring R;
814 ideal I = x*y-y*x-1, t*t - x, T*y*t-Y, X*x-1, x*X-1,
815Y*y-1,  y*Y-1, t*T-1, T*t-1;
816 I = simplify(I,2);
817 export(I);
818 if (baseringdef == 1) {setring save;}
819 return(R);
820}
821example
822{
823  "EXAMPLE:"; echo = 2;
824  def R = crystallographicGroupPG(5); setring R;
825  I;
826}
827
828
829proc crystallographicGroupP2MM(int d)
830"USAGE: crystallographicGroupP2MM(d); d an integer
831RETURN: ring
832NOTE: - the ring contains the ideal I, which contains the required relations
833      - p2mm group with the following presentation
834        < x, y, p, q | [x, y] = [p, q] = p^2 = q^2 = 1, p^(-1)*x*p = x, q^(-1)*x*q = x^(-1), p^(-1)*y*p = y^(-1), q^(-1)*y*q = y >
835      - d gives the degreebound for the Letterplace ring
836"
837{
838 if (d < 3){ERROR("Degreebound is to small for choosen example!");}
839
840 int baseringdef;
841 if (defined(basering)) // if a basering is defined, it should be saved for later use
842 {
843  def save = basering;
844  baseringdef = 1;
845 }
846 ring r = 2,(x,y,p,q,X,Y),dp;
847 def R = makeLetterplaceRing(d);
848 setring R;
849 ideal I = x*y-y*x-1, p*q-q*p-1, p*p - 1, q*q - 1, p*y*p-Y, p*x*p-x,
850 q*y*q-y, q*x*q-X, X*x-1, x*X-1,  Y*y-1,  y*Y-1,  x*y-y*x- p*p,
851 x*y-y*x- q*q, p*p-q*q;
852 I = simplify(I,2);
853 export(I);
854 if (baseringdef == 1) {setring save;}
855 return(R);
856}
857example
858{
859  "EXAMPLE:"; echo = 2;
860  def R = crystallographicGroupP2MM(5); setring R;
861  I;
862}
863
864proc crystallographicGroupP2(int d)
865"USAGE: crystallographicGroupP2(d); d an integer
866RETURN: ring
867NOTE: - the ring contains the ideal I, which contains the required relations
868      - p2 group with the following presentation
869        < x, y, m, t | [x, y] = t^2 = 1, m^2 = y, t^(-1)*x*t = x, m^(-1)*x*m = x^(-1), t^(-1)*y*t = y^(-1), t^(-1)*m*t = m^(-1) >
870      - d gives the degreebound for the Letterplace ring
871"
872{
873 if (d < 3){ERROR("Degreebound is to small for choosen example!");}
874
875 int baseringdef;
876 if (defined(basering)) // if a basering is defined, it should be saved for later use
877 {
878  def save = basering;
879  baseringdef = 1;
880 }
881 ring r = 2,(x,y,m,t,X,Y,M),dp;
882 def R = makeLetterplaceRing(d);
883 setring R;
884 ideal I = x*y-y*x-1, x*y-y*x-t*t, m*m-y, t*t - 1, t*x*t-x,
885M*x*m-X, t*y*t-Y, t*m*t-M, X*x-1, x*X-1,  Y*y-1,  y*Y-1,
886m*M-1, M*m-1;
887 I = simplify(I,2);
888 export(I);
889 if (baseringdef == 1) {setring save;}
890 return(R);
891}
892example
893{
894  "EXAMPLE:"; echo = 2;
895  def R = crystallographicGroupP2(5); setring R;
896  I;
897}
898
899proc crystallographicGroupP2GG(int d)
900"USAGE: crystallographicGroupP2GG(d); d an integer
901RETURN: ring
902NOTE: - the ring contains the ideal I, which contains the required relations
903      - p2gg group with the following presentation
904        < x, y, u, v | [x, y] = (u*v)^2 = 1, u^2 = x, v^2 = y, v^(-1)*x*v = x^(-1), u^(-1)*y*u = y^(-1) >
905      - d gives the degreebound for the Letterplace ring
906"
907{
908 if (d < 4){ERROR("Degreebound is to small for choosen example!");}
909
910 int baseringdef;
911 if (defined(basering)) // if a basering is defined, it should be saved for later use
912 {
913  def save = basering;
914  baseringdef = 1;
915 }
916 ring r = 2,(x,y,u,v,X,Y,U,V),dp;
917 def R = makeLetterplaceRing(d);
918 setring R;
919 ideal I = x*y-y*x-1, x*y-y*x-u*v*u*v, u*v*u*v-1, u*u-x, v*v - y,
920V*x*v-X, U*y*u-Y,
921X*x-1, x*X-1,  Y*y-1,  y*Y-1, u*U-1, U*u-1, v*V-1, V*v-1;
922 I = simplify(I,2);
923 export(I);
924 if (baseringdef == 1) {setring save;}
925 return(R);
926}
927example
928{
929  "EXAMPLE:"; echo = 2;
930  def R = crystallographicGroupP2GG(5); setring R;
931  I;
932}
933
934proc crystallographicGroupCM(int d)
935"USAGE: crystallographicGroupCM(d); d an integer
936RETURN: ring
937NOTE: - the ring contains the ideal I, which contains the required relations
938      - cm group with the following presentation
939        < x, y, t | [x, y] = t^2 = 1, t^(-1)*x*t = x*y, t^(-1)*y*t = y^(-1) >
940      - d gives the degreebound for the Letterplace ring
941"
942{
943 if (d < 3){ERROR("Degreebound is to small for choosen example!");}
944
945 int baseringdef;
946 if (defined(basering)) // if a basering is defined, it should be saved for later use
947 {
948  def save = basering;
949  baseringdef = 1;
950 }
951 ring r = 2,(x,y,t,X,Y),dp;
952 def R = makeLetterplaceRing(d);
953 setring R;
954 ideal I = x*y-y*x-1, x*y-y*x-t*t, t*t-1,
955t*x*t-x*y, t*y*t-Y,
956X*x-1, x*X-1,  Y*y-1,  y*Y-1;
957 I = simplify(I,2);
958 export(I);
959 if (baseringdef == 1) {setring save;}
960 return(R);
961}
962example
963{
964  "EXAMPLE:"; echo = 2;
965  def R = crystallographicGroupCM(5); setring R;
966  I;
967}
968
969proc crystallographicGroupC2MM(int d)
970"USAGE: crystallographicGroupC2MM(d); d an integer
971RETURN: ring
972NOTE: - the ring contains the ideal I, which contains the required relations
973      - c2mm group with the following presentation
974        < x, y, m, r | [x, y] = m^2 = r^2 = 1, m^(-1)*y*m = y^(-1), m^(-1)*x*m = x*y, r^(-1)*y*r = y^(-1), r^(-1)*x*r = x^(-1), m^(-1)*r*m = r^(-1) >
975      - d gives the degreebound for the Letterplace ring
976"
977{
978 if (d < 3){ERROR("Degreebound is to small for choosen example!");}
979
980 int baseringdef;
981 if (defined(basering)) // if a basering is defined, it should be saved for later use
982 {
983  def save = basering;
984  baseringdef = 1;
985 }
986 ring rr = 2,(x,y,m,r,X,Y),dp;
987 def R = makeLetterplaceRing(d);
988 setring R;
989 ideal I = x*y-y*x-1, x*y-y*x-m*m, x*y-y*x-r*r, m*m-1,  r*r-1,
990 m*m-r*r, m*y*m-Y, m*x*m-x*y, r*y*r-Y, r*x*r-X, m*r*m-r,
991X*x-1, x*X-1,  Y*y-1,  y*Y-1;
992 I = simplify(I,2);
993 export(I);
994 if (baseringdef == 1) {setring save;}
995 return(R);
996}
997example
998{
999  "EXAMPLE:"; echo = 2;
1000  def R = crystallographicGroupC2MM(5); setring R;
1001  I;
1002}
1003
1004proc crystallographicGroupP4(int d)
1005"USAGE: crystallographicGroupP4(d); d an integer
1006RETURN: ring
1007NOTE: - the ring contains the ideal I, which contains the required relations
1008      - p4 group with the following presentation
1009        < x, y, r | [x, y] = r^4 = 1, r^(-1)*x*r = x^(-1), r^(-1)*x*r = y >
1010      - d gives the degreebound for the Letterplace ring
1011"
1012{
1013 if (d < 5){ERROR("Degreebound is to small for choosen example!");}
1014
1015 int baseringdef;
1016 if (defined(basering)) // if a basering is defined, it should be saved for later use
1017 {
1018  def save = basering;
1019  baseringdef = 1;
1020 }
1021 ring rr = 2,(x,y,r,X,Y),dp;
1022 def R = makeLetterplaceRing(d);
1023 setring R;
1024 ideal I = x*y-y*x-1, x*y-y*x-r*r*r*r, r*r*r*r-1,
1025 r*r*r*x*r-X, r*r*r*x*r-y,
1026X*x-1, x*X-1,  Y*y-1,  y*Y-1;
1027 I = simplify(I,2);
1028 export(I);
1029 if (baseringdef == 1) {setring save;}
1030 return(R);
1031}
1032example
1033{
1034  "EXAMPLE:"; echo = 2;
1035  def R = crystallographicGroupP4(5); setring R;
1036  I;
1037}
1038
1039proc crystallographicGroupP4MM(int d)
1040"USAGE: crystallographicGroupP4MM(d); d an integer
1041RETURN: ring
1042NOTE: - the ring contains the ideal I, which contains the required relations
1043      - p4mm group with the following presentation
1044        < x, y, r, m | [x, y] = r^4 = m^2 = 1, r^(-1)*y*r = x^(-1), r^(-1)*x*r = y, m^(-1)*x*m = y, m^(-1)*r*m = r^(-1) >
1045      - d gives the degreebound for the Letterplace ring
1046"
1047{
1048 if (d < 5){ERROR("Degreebound is to small for choosen example!");}
1049
1050 int baseringdef;
1051 if (defined(basering)) // if a basering is defined, it should be saved for later use
1052 {
1053  def save = basering;
1054  baseringdef = 1;
1055 }
1056 ring rr = 2,(x,y,r,m,X,Y),dp;
1057 def R = makeLetterplaceRing(d);
1058 setring R;
1059 ideal I = x*y-y*x-1, x*y-y*x-r*r*r*r,  r*r*r*r-1,
1060 r*r*r*x*r-X, r*r*r*x*r-y,
1061X*x-1, x*X-1,  Y*y-1,  y*Y-1;
1062 I = simplify(I,2);
1063 export(I);
1064 if (baseringdef == 1) {setring save;}
1065 return(R);
1066}
1067example
1068{
1069  "EXAMPLE:"; echo = 2;
1070  def R = crystallographicGroupP4MM(5); setring R;
1071  I;
1072}
1073
1074proc crystallographicGroupP4GM(int d)
1075"USAGE: crystallographicGroupP4GM(d); d an integer
1076RETURN: ring
1077NOTE: - the ring contains the ideal I, which contains the required relations
1078      - p4gm group with the following presentation
1079        < x, y, r, t | [x, y] = r^4 = t^2 = 1, r^(-1)*y*r = x^(-1), r^(-1)*x*r = y, t^(-1)*x*t = y, t^(-1)*r*t = x^(-1)*r^(-1)>
1080      - d gives the degreebound for the Letterplace ring
1081"
1082{
1083 if (d < 5){ERROR("Degreebound is to small for choosen example!");}
1084
1085 int baseringdef;
1086 if (defined(basering)) // if a basering is defined, it should be saved for later use
1087 {
1088  def save = basering;
1089  baseringdef = 1;
1090 }
1091 ring rr = 2,(x,y,r,t,X,Y),dp;
1092 def R = makeLetterplaceRing(d);
1093 setring R;
1094 ideal I = x*y-y*x-1, x*y-y*x-r*r*r*r,  r*r*r*r-1, x*y-y*x-t*t,
1095 t*t-1,  r*r*r*r-t*t,  r*r*r*y*r-X, r*r*r*x*r-y,
1096 t*r*t-X*r*r*r, X*x-1, x*X-1,  Y*y-1,  y*Y-1;
1097 I = simplify(I,2);
1098 export(I);
1099 if (baseringdef == 1) {setring save;}
1100 return(R);
1101}
1102example
1103{
1104  "EXAMPLE:"; echo = 2;
1105  def R = crystallographicGroupP4GM(5); setring R;
1106  I;
1107}
1108
1109proc crystallographicGroupP3(int d)
1110"USAGE: crystallographicGroupP3(d); d an integer
1111RETURN: ring
1112NOTE: - the ring contains the ideal I, which contains the required relations
1113      - p3 group with the following presentation
1114        < x, y, r | [x, y] = r^3 = 1, r^(-1)*x*r = x^(-1)*y, r^(-1)*y*r = x^(-1)>
1115      - d gives the degreebound for the Letterplace ring
1116"
1117{
1118 if (d < 4){ERROR("Degreebound is to small for choosen example!");}
1119
1120 int baseringdef;
1121 if (defined(basering)) // if a basering is defined, it should be saved for later use
1122 {
1123  def save = basering;
1124  baseringdef = 1;
1125 }
1126 ring rr = 2,(x,y,r,X,Y),dp;
1127 def R = makeLetterplaceRing(d);
1128 setring R;
1129 ideal I = x*y-y*x-1, x*y-y*x-r*r*r,  r*r*r-1,
1130  r*r*x*r-X*y,  r*r*y*r-X, X*x-1, x*X-1,  Y*y-1,  y*Y-1;
1131 I = simplify(I,2);
1132 export(I);
1133 if (baseringdef == 1) {setring save;}
1134 return(R);
1135}
1136example
1137{
1138  "EXAMPLE:"; echo = 2;
1139  def R = crystallographicGroupP3(5); setring R;
1140  I;
1141}
1142
1143proc crystallographicGroupP31M(int d)
1144"USAGE: crystallographicGroupP31M(d); d an integer
1145RETURN: ring
1146NOTE: - the ring contains the ideal I, which contains the required relations
1147      - p31m group with the following presentation
1148        < x, y, r, t | [x, y] = r^2 = t^2 = (t*r)^3 = 1, r^(-1)*x*r = x, t^(-1)*y*t = y, t^(-1)*x*t = x^(-1)*y, r^(-1)*y*r = x*y^(-1) >
1149      - d gives the degreebound for the Letterplace ring
1150"
1151{
1152 if (d < 6){ERROR("Degreebound is to small for choosen example!");}
1153
1154 int baseringdef;
1155 if (defined(basering)) // if a basering is defined, it should be saved for later use
1156 {
1157  def save = basering;
1158  baseringdef = 1;
1159 }
1160 ring rr = 2,(x,y,r,t,X,Y),dp;
1161 def R = makeLetterplaceRing(d);
1162 setring R;
1163 ideal I = x*y-y*x-1, x*y-y*x-r*r, x*y-y*x-t*t, r*r-1, t*t-1,
1164 t*r*t*r*t*r-1, r*r-t*t,  x*y-y*x-t*r*t*r*t*r,
1165 t*r*t*r*t*r-r*r, t*r*t*r*t*r-t*t,
1166 r*x*r-x,  t*y*t-y, t*x*t-X*y, r*y*r-x*Y,
1167 X*x-1, x*X-1, Y*y-1,  y*Y-1;
1168 I = simplify(I,2);
1169 export(I);
1170 if (baseringdef == 1) {setring save;}
1171 return(R);
1172}
1173example
1174{
1175  "EXAMPLE:"; echo = 2;
1176  def R = crystallographicGroupP31M(6); setring R;
1177  I;
1178}
1179
1180proc crystallographicGroupP3M1(int d)
1181"USAGE: crystallographicGroupP3M1(d); d an integer
1182RETURN: ring
1183NOTE: - the ring contains the ideal I, which contains the required relations
1184      - p3m1 group with the following presentation
1185        < x, y, r, m | [x, y] = r^3 = m^2 = 1, m^(-1)*r*m = r^2, r^(-1)*x*r = x^(-1)*y, r^(-1)*y*r = x^(-1), m^(-1)*x*m = x^(-1), m^(-1)*y*m = x^(-1)*y >
1186      - d gives the degreebound for the Letterplace ring
1187"
1188{
1189 if (d < 4){ERROR("Degreebound is to small for choosen example!");}
1190
1191 int baseringdef;
1192 if (defined(basering)) // if a basering is defined, it should be saved for later use
1193 {
1194  def save = basering;
1195  baseringdef = 1;
1196 }
1197 ring rr = 2,(x,y,r,m,X,Y),dp;
1198 def R = makeLetterplaceRing(d);
1199 setring R;
1200 ideal I = x*y-y*x-1, x*y-y*x-r*r*r, x*y-y*x-m*m, r*r*r-1, m*m-1,
1201 r*r*r-m*m,  m*r*m-r*r, r*r*x*r-X*y, r*r*y*r-X,m*x*m-X,
1202 m*y*m-X*y, X*x-1, x*X-1, Y*y-1,  y*Y-1;
1203 I = simplify(I,2);
1204 export(I);
1205 if (baseringdef == 1) {setring save;}
1206 return(R);
1207}
1208example
1209{
1210  "EXAMPLE:"; echo = 2;
1211  def R = crystallographicGroupP3M1(5); setring R;
1212  I;
1213}
1214
1215proc crystallographicGroupP6(int d)
1216"USAGE: crystallographicGroupP6(d); d an integer
1217RETURN: ring
1218NOTE: - the ring contains the ideal I, which contains the required relations
1219      - p6 group with the following presentation
1220        < x, y, r | [x, y] = r^6 = 1, r^(-1)*x*r = y, r^(-1)*y*r = x^(-1)*y>
1221      - d gives the degreebound for the Letterplace ring
1222"
1223{
1224 if (d < 7){ERROR("Degreebound is to small for choosen example!");}
1225
1226 int baseringdef;
1227 if (defined(basering)) // if a basering is defined, it should be saved for later use
1228 {
1229  def save = basering;
1230  baseringdef = 1;
1231 }
1232 ring rr = 2,(x,y,r,X,Y),dp;
1233 def R = makeLetterplaceRing(d);
1234 setring R;
1235 ideal I = x*y-y*x-1, x*y-y*x-r*r*r*r*r*r, r*r*r*r*r*r-1,
1236 r*r*r*r*r*x*r-y, r*r*r*r*r*y*r-X*y,
1237 X*x-1, x*X-1, Y*y-1,  y*Y-1;
1238 I = simplify(I,2);
1239 export(I);
1240 if (baseringdef == 1) {setring save;}
1241 return(R);
1242}
1243example
1244{
1245  "EXAMPLE:"; echo = 2;
1246  def R = crystallographicGroupP6(7); setring R;
1247  I;
1248}
1249
1250proc crystallographicGroupP6MM(int d)
1251"USAGE: crystallographicGroupP6MM(d); d an integer
1252RETURN: ring
1253NOTE: - the ring contains the ideal I, which contains the required relations
1254      - p6mm group with the following presentation
1255        < x, y, r, m | [x, y] = r^6 = m^2 = 1, r^(-1)*y*r = x^(-1)*y, r^(-1)*x*r = y, m^(-1)*x*m = x^(-1), m^(-1)*y*m = x^(-1)*y, m^(-1)*r*m = r^(-1)*y>
1256      - d gives the degreebound for the Letterplace ring
1257"
1258{
1259 if (d < 7){ERROR("Degreebound is to small for choosen example!");}
1260
1261 int baseringdef;
1262 if (defined(basering)) // if a basering is defined, it should be saved for later use
1263 {
1264  def save = basering;
1265  baseringdef = 1;
1266 }
1267 ring rr = 2,(x,y,r,m,X,Y),dp;
1268 def R = makeLetterplaceRing(d);
1269 setring R;
1270 ideal I = x*y-y*x-1, x*y-y*x-r*r*r*r*r*r, r*r*r*r*r*r-1,
1271 x*y-y*x-m*m, r*r*r*r*r*r-m*m, m*m-1, m*x*m-X,  m*y*m-X*y,
1272 r*r*r*r*r*x*r-y, r*r*r*r*r*y*r-X*y, m*r*m- r*r*r*r*r*y,
1273 X*x-1, x*X-1, Y*y-1,  y*Y-1;
1274 I = simplify(I,2);
1275 export(I);
1276 if (baseringdef == 1) {setring save;}
1277 return(R);
1278}
1279example
1280{
1281  "EXAMPLE:"; echo = 2;
1282  def R = crystallographicGroupP6MM(7); setring R;
1283  I;
1284}
1285
1286////////////////////////////////////////////////////////////////////
1287// Dyck Group //////////////////////////////////////////////////////
1288// from Grischa Studzinski /////////////////////////////////////////
1289////////////////////////////////////////////////////////////////////
1290
1291proc dyckGroup1(int n, int d, intvec P)
1292"USAGE: dyckGroup1(n,d,P); n an integer, d an integer, P an intvec
1293RETURN: ring
1294NOTE: - the ring contains the ideal I, which contains the required relations
1295      - The Dyck group with the following presentation
1296        < x_1, x_2, ... , x_n | (x_1)^p1 = (x_2)^p2 = ... = (x_n)^pn = x_1 * x_2 * ... * x_n = 1 >
1297      - negative exponents are allowed
1298      - representation in the form x_i^p_i - x_(i+1)^p_(i+1)
1299      - d gives the degreebound for the Letterplace ring
1300      - varying n and P produces a family of examples
1301"
1302{
1303 int baseringdef,i,j;
1304 if (n < 1) {ERROR("There must be at least one variable!");}
1305 if (d < n) {ERROR("Degreebound is to small!");}
1306 for (i = 1; i <= size(P); i++) {if (d < absValue(P[i])){ERROR("Degreebound is to small!");}}
1307
1308 if (defined(basering)) // if a basering is defined, it should be saved for later use
1309 {
1310  def save = basering;
1311  baseringdef = 1;
1312 }
1313 ring r = 2,(x(1..n),Y(1..n)),dp;
1314 def R = makeLetterplaceRing(d);
1315 setring R;
1316 ideal I; poly p,q;
1317 p = 1; q = 1;
1318 for (i = 1; i<= n; i++) {p = p*var(i);}
1319 I = p-1;
1320 for (i = n; i > 0; i--)
1321 {
1322  if (P[i] >= 0) {for (j = 1; j <= P[i]; j++){q = q*var(i);}}
1323  else {for (j = 1; j <= -P[i]; j++){q = q*var(i+n);}}
1324  I = p - q,I;
1325  p = q; q = 1;
1326 }
1327
1328 I = simplify(I,2);
1329 export(I);
1330 if (baseringdef == 1) {setring save;}
1331 return(R);
1332}
1333example
1334{
1335  "EXAMPLE:"; echo = 2;
1336  intvec P = 1,2,3;
1337  def R = dyckGroup1(3,5,P); setring R;
1338  I;
1339}
1340
1341
1342proc dyckGroup2(int n, int d, intvec P)
1343"USAGE: dyckGroup2(n,d,P); n an integer, d an integer, P an intvec
1344RETURN: ring
1345NOTE: - the ring contains the ideal I, which contains the required relations
1346      - The Dyck group with the following presentation
1347        < x_1, x_2, ... , x_n | (x_1)^p1 = (x_2)^p2 = ... = (x_n)^pn = x_1 * x_2 * ... * x_n = 1 >
1348      - negative exponents are allowed
1349      - representation in the form x_i^p_i - 1
1350      - d gives the degreebound for the Letterplace ring
1351      - varying n and P produces a family of examples
1352"
1353{
1354 int baseringdef,i,j;
1355 if (n < 1) {ERROR("There must be at least one variable!");}
1356 if (d < n) {ERROR("Degreebound is to small!");}
1357 for (i = 1; i <= size(P); i++) {if (d < absValue(P[i])){ERROR("Degreebound is to small!");}}
1358
1359 if (defined(basering)) // if a basering is defined, it should be saved for later use
1360 {
1361  def save = basering;
1362  baseringdef = 1;
1363 }
1364 ring r = 2,(x(1..n),Y(1..n)),dp;
1365 def R = makeLetterplaceRing(d);
1366 setring R;
1367 ideal I; poly p;
1368 p = 1;
1369 for (i = 1; i<= n; i++) {p = p*var(i);}
1370 I = p-1;
1371 for (i = n; i > 0; i--)
1372 {
1373  p = 1;
1374  if (P[i] >= 0) {for (j = 1; j <= P[i]; j++){p = p*var(i);}}
1375  else {for (j = 1; j <= -P[i]; j++){p = p*var(i+n);}}
1376  I = p - 1,I;
1377 }
1378
1379 I = simplify(I,2);
1380 export(I);
1381 if (baseringdef == 1) {setring save;}
1382 return(R);
1383}
1384example
1385{
1386  "EXAMPLE:"; echo = 2;
1387  intvec P = 1,2,3;
1388  def R = dyckGroup2(3,5,P); setring R;
1389  I;
1390}
1391
1392
1393
1394proc dyckGroup3(int n, int d, intvec P)
1395"USAGE: dyckGroup2(n,d,P); n an integer, d an integer, P an intvec
1396RETURN: ring
1397NOTE: - the ring contains the ideal I, which contains the required relations
1398      - The Dyck group with the following presentation
1399        < x_1, x_2, ... , x_n | (x_1)^p1 = (x_2)^p2 = ... = (x_n)^pn = x_1 * x_2 * ... * x_n = 1 >
1400      - only positive exponents are allowed
1401      - no inverse generators needed
1402      - d gives the degreebound for the Letterplace ring
1403      - varying n and P produces a family of examples
1404"
1405{
1406 int baseringdef,i,j;
1407 if (n < 1) {ERROR("There must be at least one variable!");}
1408 if (d < n) {ERROR("Degreebound is to small!");}
1409 for (i = 1; i <= size(P); i++) {if (P[i] < 0){ERROR("Exponents must be positive!");}}
1410 for (i = 1; i <= size(P); i++) {if (d < P[i]){ERROR("Degreebound is to small!");}}
1411
1412
1413 if (defined(basering)) // if a basering is defined, it should be saved for later use
1414 {
1415  def save = basering;
1416  baseringdef = 1;
1417 }
1418 ring r = 2,x(1..n),dp;
1419 def R = makeLetterplaceRing(d);
1420 setring R;
1421 ideal I; poly p;
1422 p = 1;
1423 for (i = 1; i<= n; i++) {p = p*var(i);}
1424 I = p-1;
1425 for (i = n; i > 0; i--)
1426 {
1427  p = 1;
1428  for (j = 1; j <= P[i]; j++){p = p*var(i);}
1429  I = p - 1,I;
1430 }
1431
1432 I = simplify(I,2);
1433 export(I);
1434 if (baseringdef == 1) {setring save;}
1435 return(R);
1436}
1437example
1438{
1439  "EXAMPLE:"; echo = 2;
1440  intvec P = 1,2,3;
1441  def R = dyckGroup3(3,5,P); setring R;
1442  I;
1443}
1444
1445////////////////////////////////////////////////////////////////////
1446// Fibonacci Group /////////////////////////////////////////////////
1447// from Grischa Studzinski /////////////////////////////////////////
1448////////////////////////////////////////////////////////////////////
1449
1450proc fibonacciGroup(int m, int d)
1451"USAGE: fibonacciGroup(m,d); m an integer, d an integer
1452RETURN: ring
1453NOTE: - the ring contains the ideal I, which contains the required relations
1454      - The Fibonacci group F(2, m) with the following presentation
1455        < x_1, x_2, ... , x_m | x_i * x_(i + 1) = x_(i + 2) >
1456      - d gives the degreebound for the Letterplace ring
1457      - varying m produces a family of examples
1458"
1459{
1460// TODO: basefield Q oder F2?
1461// TODO: inverse Elemente!
1462 if (m < 3) {ERROR("At least three generators are required!");}
1463 if (d < 2) {ERROR("Degree bound must be at least 2!");}
1464 int baseringdef,i;
1465 if (defined(basering)) // if a basering is defined, it should be saved for later use
1466 {
1467  def save = basering;
1468  baseringdef = 1;
1469 }
1470 ring r = 2,(x(1..m),Y(1..m)),dp;
1471 def R = makeLetterplaceRing(d);
1472 setring R;
1473 ideal I; poly p;
1474 for (i = 1; i < m-1; i++)
1475 {
1476  p = var(i)*var(i+1)-var(i+2);
1477  I = I,p;
1478 }
1479 for (i = 1; i <= m; i++)
1480 {
1481  p = var(i)*var(i+m)-1;
1482  I = I,p;
1483  p = var(i+m)*var(i)-1;
1484  I = I,p;
1485 }
1486 I = simplify(I,2);
1487 export(I);
1488 if (baseringdef == 1) {setring save;}
1489 return(R);
1490}
1491example
1492{
1493  "EXAMPLE:"; echo = 2;
1494  def R = fibonacciGroup(3,5); setring R;
1495  I;
1496}
1497
1498
1499////////////////////////////////////////////////////////////////////
1500// Tetrahedron Groups ///////////////////////////////////////////////
1501// from Grischa Studzinski /////////////////////////////////////////
1502////////////////////////////////////////////////////////////////////
1503
1504proc tetrahedronGroup(int g, int d)
1505"USAGE: tetrahedronGroup(g,d); g an integer, d an integer
1506RETURN: ring
1507NOTE: - the ring contains the ideal I, which contains the required relations
1508      - g gives the number of the example (1 - 5)
1509      - d gives the degreebound for the Letterplace ring
1510      - varying g produces a family of examples
1511
1512The examples are found in ``Classification of the finite generalized tetrahedron groups''
1513by Gerhard Rosenberger and Martin Scheer.
1514The 5 examples originate from Proposition 1.9 and describe
1515finite generalized tetrahedron group in the Tsaranov-case, which are
1516not equivalent to a presentation for an ordinary tetrahedron group.
1517"
1518{
1519 if (g < 1 || g > 5) {ERROR("There are only 5 examples!");}
1520 if ((g == 1 && d < 6)||(g == 2 && d < 6)||(g == 3 && d < 5)||(g == 4 && d < 4)||(g == 5 && d < 5))
1521 {ERROR("Degreebound is to small for choosen example!");}
1522
1523 int baseringdef,i,j;
1524 if (defined(basering)) // if a basering is defined, it should be saved for later use
1525 {
1526  def save = basering;
1527  baseringdef = 1;
1528 }
1529 ring r = 2,(x,y,z),dp;
1530 def R = makeLetterplaceRing(d);
1531 setring R;
1532 ideal I;
1533 if (g == 1)
1534 {I = x*x*x*x*x-1, y*y-1, z*z*z-1, x*y*x*y*x*y-1, x*x*z*x*x*z-1,
1535      y*z*y*z-1;
1536 }
1537 if (g == 2)
1538 {I = x*x*x-1, y*y*y-1, z*z*z*z*z-1,x*y*x*y-1,x*z*x*z-1,
1539      y*z*z*y*z*z-1;
1540 }
1541 if (g == 3)
1542 {I =  x*x*x-1, y*y*y-1, z*z*z-1, x*y*x*y-1, x*z*x*z-1, y*z*y*z-1;
1543 }
1544 if (g == 4)
1545 {I =  x*x*x-1, y*y*y-1, z*z*z*z-1,x*y*x*y-1, x*z*x*z-1, y*z*y*z-1;
1546 }
1547 if (g ==5)
1548 {I =  x*x*x-1, y*y*y-1, z*z*z*z*z-1,x*y*x*y-1, x*z*x*z-1, y*z*y*z-1;
1549 }
1550
1551 I = simplify(I,2);
1552 export(I);
1553 if (baseringdef == 1) {setring save;}
1554 return(R);
1555}
1556example
1557{
1558  "EXAMPLE:"; echo = 2;
1559  def R = tetrahedronGroup(3,5); setring R;
1560  I;
1561}
1562
1563
1564////////////////////////////////////////////////////////////////////
1565// Triangular Groups ///////////////////////////////////////////////
1566// from Grischa Studzinski /////////////////////////////////////////
1567////////////////////////////////////////////////////////////////////
1568
1569proc triangularGroup(int g, int d)
1570"USAGE: triangularGroup(g,d); g an integer, d an integer
1571RETURN: ring
1572NOTE: - the ring contains the ideal I, which contains the required relations
1573      - g gives the number of the example (1 - 14)
1574      - d gives the degreebound for the Letterplace ring
1575      - varying g produces a family of examples
1576
1577The examples are found in
1578Classification of the finite generalized tetrahedron groups
1579by Gerhard Rosenberger and Martin Scheer.
1580The 14 examples are denoted in theorem 2.12
1581"
1582{
1583 if (g < 1 || g > 14) {ERROR("There are only 14 examples!");}
1584 if ((g == 1 && d < 20)||(g == 2 && d < 21)||(g == 3 && d < 10)||(g == 4 && d < 12)||(g == 5 && d < 10)||(g == 6 && d < 18)||(g == 7 && d < 20)||(g == 8 && d < 16)||(g == 9 && d < 10)||(g == 10 && d < 14)||(g == 11 && d < 16)||(g == 12 && d < 24)||(g == 13 && d < 28)||(g == 14 && d < 37))
1585 {ERROR("Degreebound is to small for choosen example!");}
1586
1587 int baseringdef;
1588 if (defined(basering)) // if a basering is defined, it should be saved for later use
1589 {
1590  def save = basering;
1591  baseringdef = 1;
1592 }
1593 ring r = 2,(a,b),dp;
1594 def R = makeLetterplaceRing(d);
1595 setring R;
1596 ideal I;
1597
1598 if (g == 1)
1599 {I = a*a-1, b*b*b-1,
1600  a*b*a*b*a*b*b*a*b*b*a*b*a*b*a*b*b*a*b*b-1;
1601 }
1602 if (g == 2)
1603 {I = a*a-1, b*b*b-1,
1604  a*b*a*b*a*b*b*a*b*a*b*a*b*b*a*b*a*b*a*b*b-1;
1605 }
1606 if (g == 3)
1607 {I = a*a*a-1, b*b*b-1,
1608  a*b*a*b*b*a*b*a*b*b-1;
1609 }
1610 if (g == 4)
1611 {I = a*a*a-1, b*b*b-1,
1612  a*b*a*a*b*b*a*b*a*a*b*b-1;
1613 }
1614 if (g == 5)
1615 {I = a*a-1, b*b*b*b*b-1,
1616   a*b*a*b*b*a*b*a*b*b-1;
1617 }
1618 if (g == 6)
1619 {I = a*a-1, b*b*b*b*b-1,
1620   a*b*a*b*a*b*b*b*b*a*b*a*b*a*b*b*b*b-1;
1621 }
1622 if (g == 7)
1623 {I = a*a-1, b*b*b*b*b-1,
1624   a*b*a*b*b*a*b*b*b*b*a*b*a*b*b*a*b*b*b*b-1;
1625 }
1626 if (g == 8)
1627 {I = a*a-1, b*b*b*b-1,
1628   a*b*a*b*a*b*b*b*a*b*a*b*a*b*b*b-1;
1629 }
1630 if (g == 9)
1631 {I = a*a-1, b*b*b-1,
1632   a*b*a*b*b*a*b*a*b*b-1;
1633 }
1634 if (g == 10)
1635 {I = a*a-1, b*b*b-1,
1636  a*b*a*b*a*b*b*a*b*a*b*a*b*b-1;
1637 }
1638 if (g == 11)
1639 {I = a*a-1, b*b*b-1,
1640  a*b*a*b*a*b*a*b*b*a*b*a*b*a*b*b-1;
1641 }
1642 if (g == 12)
1643 {I = a*a-1, b*b*b-1,
1644  a*b*a*b*a*b*b*a*b*a*b*b*a*b*a*b*a*b*b*a*b*a*b*b-1;
1645 }
1646 if (g == 13)
1647 {I = a*a-1, b*b*b-1,
1648a*b*a*b*a*b*a*b*a*b*b*a*b*b*a*b*a*b*a*b*a*b*a*b*b*a*b*b-1;
1649 }
1650 if (g == 14)
1651 {I = a*a-1, b*b*b-1,
1652a*b*a*b*a*b*a*b*b*a*b*b*a*b*a*b*b*a*b*b*a*b*a*b*a*b*a*b*b*a*b*a*b*b*a*b*b-1;
1653 }
1654
1655 I = simplify(I,2);
1656 export(I);
1657 if (baseringdef == 1) {setring save;}
1658 return(R);
1659}
1660example
1661{
1662  "EXAMPLE:"; echo = 2;
1663  def R = triangularGroup(3,10); setring R;
1664  I;
1665}
1666
Note: See TracBrowser for help on using the repository browser.