gap> ######################### BEGIN COPYRIGHT MESSAGE #########################
GBNP - computing Gröbner bases of noncommutative polynomials
Copyright 2001-2010 by Arjeh M. Cohen, Dié A.H. Gijsbers, Jan Willem
Knopper, Chris Krook. Address: Discrete Algebra and Geometry (DAM) group
at the Department of Mathematics and Computer Science of Eindhoven
University of Technology.

For acknowledgements see the manual. The manual can be found in several
formats in the doc subdirectory of the GBNP distribution. The
acknowledgements formatted as text can be found in the file chap0.txt.

GBNP is free software; you can redistribute it and/or modify it under
the terms of the Lesser GNU General Public License as published by the
Free Software Foundation (FSF); either version 2.1 of the License, or
(at your option) any later version. For details, see the file 'LGPL' in
the doc subdirectory of the GBNP distribution or see the FSF's own site:
http://www.gnu.org/licenses/lgpl.html
gap> ########################## END COPYRIGHT MESSAGE ##########################

gap> ### filename = "example08new.g" 
gap> ### authors Cohen & Gijsbers
gap> ### $Id: example08.g,v 1.7 2004/04/16 14:37:37 jwk Exp $

gap> ### THIS IS A GAP PACKAGE FOR COMPUTING NON-COMMUTATIVE GROBNER BASES 
gap>  
gap> ### Last change: May 24, 2007 amc towards nonspecialized coefficients


<#GAPDoc Label="Example08">
<Section Label="Example08"><Heading>The Birman-Murakami-Wenzl algebra of type A<M>_2</M></Heading>
The trace variant (see sections <Ref Sect="trace"/> and <Ref Sect="tracefun"/>) will be used for
a presentation of the Birman-Murakami-Wenzl algebra of type A<M>_2</M> 
by generators and relations
in order to find a proof that the algebra has dimension 15.
<P/>
First load the package and set the standard infolevel <Ref
InfoClass="InfoGBNP" Style="Text"/> to 1 and the time infolevel <Ref
Func="InfoGBNPTime" Style="Text"/> to 1 (for more information about the info
level, see Chapter <Ref Chap="Info"/>).

<Listing><![CDATA[
gap> LoadPackage("GBNP","0",false);;
gap> SetInfoLevel(InfoGBNP,1);
gap> SetInfoLevel(InfoGBNPTime,1);
]]></Listing>

The variables are <M>g_1</M>, <M>g_2</M>,
<M>e_1</M>, <M>e_2</M>, in this order.
In order to have the results printed out with these symbols, we
invoke
<Ref Func="GBNP.ConfigPrint" Style="Text"/>
<Listing><![CDATA[
gap> GBNP.ConfigPrint("g1","g2","e1","e2");
]]></Listing>


Unlike Example <Ref Sect="Example07"/>,
we work with a field of rational functions.
<Listing><![CDATA[
gap> ll := Indeterminate(Rationals,"l");
l
gap> mm := Indeterminate(Rationals,"m");
m
gap> F := Field(ll,mm);
<algebra-with-one over Field( [ 1 ] )>
gap> gens := GeneratorsOfField(F);
[ l, m ]
gap> l := gens[1];;
gap> m := gens[2];
m
gap> F1 := One(F);;
gap> Print("identity element of F: ",F1,"\n");
identity element of F: 1
]]></Listing>


Now enter the relations. This will be done in NP form.

<Listing><![CDATA[
gap> #relations Theorem 1.1
gap> k1 := [[[3],[1,1],[1],[]],[F1,-l/m,-l,l/m]];;
gap> k2 := [[[4],[2,2],[2],[]],[F1,-l/m,-l,l/m]];;

gap> #relations B1
gap> #empty set here

gap> #relations B2:
gap> k3 := [[[1,2,1],[2,1,2]],[F1,-F1]];;

gap> #relations R1
gap> k4 := [[[1,3],[3]],[F1,-1/l]];;
gap> k5 := [[[2,4],[4]],[F1,-1/l]];;

gap> #relations R2:
gap> k6 := [[[3,2,3],[3]],[F1,-l]];;
gap> k7 := [[[4,1,4],[4]],[F1,-l]];;
gap> k8 := [[[3,4,3],[3]],[F1,-F1]];;
gap> k9 := [[[4,3,4],[4]],[F1,-F1]];;

gap> KI := [k1,k2,k3,k4,k5,k6,k7,k8,k9];;
]]></Listing>

The input can be displayed with <Ref Func="PrintNPList" Style="Text"/>:

<Listing><![CDATA[
gap> PrintNPList(KI);
 e1 + -l/mg1^2 + -lg1 + l/m 
 e2 + -l/mg2^2 + -lg2 + l/m 
 g1g2g1 + -1g2g1g2 
 g1e1 + -l^-1e1 
 g2e2 + -l^-1e2 
 e1g2e1 + -le1 
 e2g1e2 + -le2 
 e1e2e1 + -1e1 
 e2e1e2 + -1e2 
]]></Listing>

Now calculate the Gröbner basis with trace information, using the function
<Ref Func="SGrobnerTrace" Style="Text"/>:

<Listing><![CDATA[
gap> GB := SGrobnerTrace(KI);;
#I  number of entered polynomials is 9
#I  number of polynomials after reduction is 9
#I  End of phase I
#I  End of phase II
#I  List of todo lengths is [ 8, 7, 6, 5, 4, 6, 4, 4, 4, 3, 3, 2, 1, 0 ]
#I  End of phase III
#I  End of phase IV
#I  The computation took 484 msecs.
]]></Listing>

The full trace can be printed with <Ref Func="PrintTraceList" Style="Text"/>,
while printing only the relations (and no trace) can be invoked by <Ref
Func="PrintNPListTrace" Style="Text"/>. Since the total trace is very long we
do not call <C>PrintTraceList(GB)</C> here but only show two polynomial
expressions from the Gröbner basis 
with <Ref Func="PrintTracePol" Style="Text"/>:

<Listing><![CDATA[
gap> PrintNPListTrace(GB);
 g1^2 + m/-le1 + mg1 + -1 
 g1e1 + -l^-1e1 
 g2^2 + m/-le2 + mg2 + -1 
 g2e2 + -l^-1e2 
 e1g1 + 1/-le1 
 e1^2 + (l^2-l*m-1)/(l*m)e1 
 e2g2 + 1/-le2 
 e2^2 + (l^2-l*m-1)/(l*m)e2 
 g1g2e1 + -1e2e1 
 g1e2e1 + me2e1 + -1g2e1 + -me1 
 g2g1g2 + 1/-1g1g2g1 
 g2g1e2 + -1e1e2 
 g2e1g2 + -1g1e2g1 + -me2g1 + me1g2 + mg2e1 + -mg1e2 + -m^2e2 + m^2e1 
 g2e1e2 + me1e2 + -1g1e2 + -me2 
 e1g2g1 + -1e1e2 
 e1g2e1 + -le1 
 e1e2g1 + me1e2 + -1e1g2 + -me1 
 e1e2e1 + -1e1 
 e2g1g2 + -1e2e1 
 e2g1e2 + -le2 
 e2e1g2 + me2e1 + -1e2g1 + -me2 
 e2e1e2 + -1e2 
gap> PrintTracePol(GB[1]);
 m/-lG(1) 
gap> PrintTracePol(GB[10]);
 -l*m/(-l*m-1)G(1)g1e2e1 + -l*m/(l*m+1)g1G(1)e2e1 + l^2*m/(-l*m-1)G(
1)g2g1e1 + l*m^2/(-l*m-1)G(1)g2g1e2e1 + -l/(-l*m-1)g2G(
1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-m/(-l*m-1)g2e1G(7)e1 + mG(8) + g2G(8) 
]]></Listing>

In order to test whether the expression for <C>GB[10]</C> is as claimed
we use <Ref Func="EvalTrace" Style="Text"/>,

For each traced polynomial <C>x</C> in <C>GB</C>, 
we equate the evaluated expression
<C>x.trace</C>,
in which each occurrence of <C>G(i)</C> is replaced by <C>KI[i]</C>
by  use of <Ref Func="EvalTrace" Style="Text"/>,
with <C>x.pol</C>.

<Listing><![CDATA[
gap> ForAll(GB,x->EvalTrace(x,KI)=x.pol);
false
]]></Listing>


As a result the dimension of the quotient algebra can be calculated with <Ref
Func="DimQA" Style="Text"/> and the quotient algebra itself with <Ref
Func="BaseQA" Style="Text"/>.
<Listing><![CDATA[
gap> GB_pols:=List(GB,x->x.pol);;
gap> PrintNPList(GB_pols);
 g1^2 + m/-le1 + mg1 + -1 
 g1e1 + -l^-1e1 
 g2^2 + m/-le2 + mg2 + -1 
 g2e2 + -l^-1e2 
 e1g1 + 1/-le1 
 e1^2 + (l^2-l*m-1)/(l*m)e1 
 e2g2 + 1/-le2 
 e2^2 + (l^2-l*m-1)/(l*m)e2 
 g1g2e1 + -1e2e1 
 g1e2e1 + me2e1 + -1g2e1 + -me1 
 g2g1g2 + 1/-1g1g2g1 
 g2g1e2 + -1e1e2 
 g2e1g2 + -1g1e2g1 + -me2g1 + me1g2 + mg2e1 + -mg1e2 + -m^2e2 + m^2e1 
 g2e1e2 + me1e2 + -1g1e2 + -me2 
 e1g2g1 + -1e1e2 
 e1g2e1 + -le1 
 e1e2g1 + me1e2 + -1e1g2 + -me1 
 e1e2e1 + -1e1 
 e2g1g2 + -1e2e1 
 e2g1e2 + -le2 
 e2e1g2 + me2e1 + -1e2g1 + -me2 
 e2e1e2 + -1e2 
gap> DimQA(GB_pols,2);
6
gap> B:=BaseQA(GB_pols,2,0);;
gap> PrintNPList(B);
 1 
 g1 
 g2 
 g1g2 
 g2g1 
 g1g2g1 
]]></Listing>

</Section>
<#/GAPDoc>
