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 = "example15.g" 
gap> ### author Krook
gap>  
gap> ### THIS IS A GAP PACKAGE GBNP
gap> ### FOR COMPUTING WITH NON-COMMUTATIVE POLYNOMIALS
gap> ### ADD-ON: STUDY GROWTH OF FACTOR ALGEBRA

gap> ### $Id: example15.g,v 1.5 2004/04/16 14:37:38 jwk Exp $

<#GAPDoc Label="Example15">
<Section Label="Example15"><Heading>A quotient algebra with exponential growth</Heading>
This example demonstrates an instance in which the quotient 
algebra is infinite dimensional and has exponential 
growth. We start out with <C>KI</C><M>:=[y^4-y^2,x^2y-xy]</M> and obtain a
Gröbner basis with leading terms <M>[xxy,yyy]</M>. The quotient algebra will
thus have exponential growth since the 
cycles <M>(xyyx)^n</M> and <M>(xy)^m</M>
intersect in the common subwords <M>xy</M> (and in <M>yx</M>). This is 
explained in <Cite Key="Krook2003"/>. The function <Ref
Func="DetermineGrowthQA" Style="Text"/> is used for the computation.
<P/>
First load the package and set the standard infolevel <Ref
InfoClass="InfoGBNP" Style="Text"/> to 2 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,2);
gap> SetInfoLevel(InfoGBNPTime,1);
]]></Listing>

Let the variables be printed as <M>x</M> and <M>y</M> instead of <M>a</M> and <M>b</M> by means of
<Ref Func="GBNP.ConfigPrint" Style="Text"/>
<Listing><![CDATA[
gap> GBNP.ConfigPrint("x","y");
]]></Listing>


Then input the relations in NP format (see Section <Ref Sect="NP"/>). They
will be assigned to <C>KI</C>.

<Listing><![CDATA[
gap> k1 := [[[2,2,2,2],[2,2]],[1,-1]];;
gap> k2 := [[[1,1,2],[1,2]],[1,-1]];;
gap> KI := [k1,k2];;
gap> PrintNPList(KI);
 y^4 - y^2 
 x^2y - xy 
]]></Listing>

We calculate the Gröbner basis with the function <Ref Func="SGrobner"
Style="Text"/> and print it with <Ref Func="PrintNPList" Style="Text"/>.

<Listing><![CDATA[
gap> GB := SGrobner(KI);;
#I  number of entered polynomials is 2
#I  number of polynomials after reduction is 2
#I  End of phase I
#I  End of phase II
#I  List of todo lengths is [ 0 ]
#I  End of phase III
#I  G: Cleaning finished, 0 polynomials reduced
#I  End of phase IV
#I  The computation took 0 msecs.
gap> PrintNPList(GB);
 x^2y - xy 
 y^4 - y^2 
]]></Listing>

Next we check the dimensionality of the quotient algebra 
with the function <Ref
Func="FinCheckQA" Style="Text"/> or the function <Ref Func="DetermineGrowthQA"
Style="Text"/>. These functions expect as first argument a list <A>F</A>
of leading terms of a Gröbner basis, 
which can be calculated with the function <Ref
Func="LMonsNP" Style="Text"/> and as second argument the number of symbols
(here equal to 2). The function <Ref Func="DetermineGrowthQA" Style="Text"/>
will not only report whether a Gröbner basis is finite, but will also provide
information about its growth.

<Listing><![CDATA[
gap> L:=LMonsNP(GB);
[ [ 1, 1, 2 ], [ 2, 2, 2, 2 ] ]
gap> fd:=FinCheckQA(L,2);
false
gap> fd:=DetermineGrowthQA(L,2,false);
"exponential growth"
]]></Listing>

Although the quotient algebra is infinite dimensional,
multiplication of two elements can be carried out by
<Ref Func="MulQA" Style="Text"/>.
We print three positive powers of <M>x+y</M>.

<Listing><![CDATA[
gap> w := [[[1],[2]],[1,1]];;
gap> hlp := [[[]],[1]];;
gap> for i in [3..5] do 
>   hlp := MulQA(hlp, w, GB);
>   Print("\n (x+y)^",i," = \n"); 
>   PrintNP(hlp);
> od;

 (x+y)^3 = 
 y + x 

 (x+y)^4 = 
 y^2 + yx + xy + x^2 

 (x+y)^5 = 
 y^3 + y^2x + yxy + yx^2 + xy^2 + xyx + x^3 + xy 
]]></Listing>


</Section>
<#/GAPDoc>
