  
  [1X5 Module Polynomials[0X
  
  In this chapter we consider finitely generated modules over the monoid rings
  considered   previously.  We  call  an  element  of  this  module  a  [13Xmodule
  polynomial[0m,  and  we  describe functions to construct module polynomials and
  the standard algebraic operations for such polynomials.
  
  A  module  polynomial [10Xmodpoly[0m is recorded as a list of pairs, [10X[ gen, monpoly
  ][0m,  where [10Xgen[0m is a module generator (basis element), and [10Xmonpoly[0m is a monoid
  polynomial.  The  module  polynomial  is printed as the formal sum of monoid
  polynomial multiples of the generators. Note that the monoid polynomials are
  the  coefficients  of  the module polynomials and appear to the right of the
  generator, as we choose to work with right modules.
  
  The  examples  we  are aiming for are the identities among the relators of a
  finitely presented group (see section [12X5.4[0m).
  
  
  [1X5.1 Construction of module polynomials[0X
  
  [1X5.1-1 ModulePoly[0m
  
  [2X> ModulePoly( [0X[3Xgens, monpolys[0X[2X ) ____________________________________[0Xoperation
  [2X> ModulePoly( [0X[3Xargs[0X[2X ) ______________________________________________[0Xoperation
  [2X> ZeroModulePoly( [0X[3XFgens, Fmon[0X[2X ) ___________________________________[0Xoperation
  
  The  function  [10XModulePoly[0m  returns  a  module  polynomial.  The terms of the
  polynomial  maybe input as a list of generators followed by a list of monoid
  polynomials or as one list of [10X[generator, monoid polynomial][0m pairs.
  
  Assuming  that  [10XFgens[0m is the free group on the module generators and [10XFmon[0m is
  the free group on the monoid generators, the function [10XZeroModulePoly[0m returns
  the  zero  module  polynomial,  which has no terms, and is an element of the
  module.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> frq8 := FreeRelatorGroup( q8 );; [0X
    [4Xgap> genfrq8 := GeneratorsOfGroup( frq8 ); [0X
    [4X[ q8_R1, q8_R2, q8_R3, q8_R4 ][0X
    [4Xgap> Display( rmp1 ); [0X
    [4X - 7*q8_M4 + 5*q8_M1 + 9*<identity ...>[0X
    [4Xgap> mp2 := MonoidPolyFromCoeffsWords( [4,-5], [ M[4], M[1] ] );;[0X
    [4Xgap> Display( mp2 ); [0X
    [4X4*q8_M4 - 5*q8_M1[0X
    [4Xgap> s1 := ModulePoly( [ genfrq8[4], genfrq8[1] ], [ rmp1, mp2 ] );[0X
    [4Xq8_R1*(4*q8_M4 - 5*q8_M1) + q8_R4*( - 7*q8_M4 + 5*q8_M1 + 9*<identity ...>)[0X
    [4Xgap> s2 := ModulePoly( [ genfrq8[3], genfrq8[2], genfrq8[1] ], [0X
    [4Xgap>    [ -1*rmp1, 3*mp2, (rmp1+mp2) ] );[0X
    [4Xq8_R1*( - 3*q8_M4 + 9*<identity ...>) + q8_R2*(12*q8_M4 - 15*q8_M1) + q8_R3*([0X
    [4X7*q8_M4 - 5*q8_M1 - 9*<identity ...>)[0X
    [4Xgap> zeromp := ZeroModulePoly( frq8, freeq8 );[0X
    [4Xzero modpoly[0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X5.2 Components of a module polynomial[0X
  
  [1X5.2-1 Terms[0m
  
  [2X> Terms( [0X[3Xmodpoly[0X[2X ) ________________________________________________[0Xattribute
  [2X> LeadTerm( [0X[3Xmodpoly[0X[2X ) _____________________________________________[0Xattribute
  [2X> LeadMonoidPoly( [0X[3Xmodpoly[0X[2X ) _______________________________________[0Xattribute
  [2X> One( [0X[3Xmodpoly[0X[2X ) __________________________________________________[0Xattribute
  [2X> Length( [0X[3Xmodpoly[0X[2X ) _______________________________________________[0Xattribute
  
  The  first  function  counts  the number of module generators which occur in
  [10Xmodpoly[0m  (a generator occurs in a polynomial if it has nonzero coefficient).
  The function [10XOne[0m returns the identity in the free group on the generators.
  
  The  function  [10XTerms[0m  returns  the terms of a module polynomial as a list of
  pairs. In [10XLeadTerm[0m, the generators are ordered, and the term of [10Xmodpoly[0m with
  the  highest  value  generator is defined to be the leading term. The monoid
  polynomial  (coefficient)  part  of  the  leading  term  is  returned by the
  function [10XLeadMonoidPoly[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> [ Length(s1), Length(s2) ];[0X
    [4X[ 2, 3 ][0X
    [4Xgap> One( s1 );[0X
    [4X<identity ...> [0X
    [4Xgap> Terms( s1 );[0X
    [4X[ [ q8_R1, <monpoly> ], [ q8_R4, <monpoly> ] ][0X
    [4Xgap> Display( LeadTerm( s1 ) );[0X
    [4X[ q8_R4,[0X
    [4X   - 7*q8_M4 + 5*q8_M1 + 9*<identity ...>[0X
    [4X  ][0X
    [4Xgap> Display( LeadTerm( s2 ) );[0X
    [4X[ q8_R3,[0X
    [4X  7*q8_M4 - 5*q8_M1 - 9*<identity ...>[0X
    [4X  ][0X
    [4Xgap> Display( LeadMonoidPoly( s1 ) );[0X
    [4X - 7*q8_M4 + 5*q8_M1 + 9*<identity ...>[0X
    [4Xgap> Display( LeadMonoidPoly( s2 ) );[0X
    [4X7*q8_M4 - 5*q8_M1 - 9*<identity ...>[0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X5.3 Module Polynomial Operations[0X
  
  [1X5.3-1 AddTermModulePoly[0m
  
  [2X> AddTermModulePoly( [0X[3Xmodpoly, gen, monpoly[0X[2X ) ______________________[0Xoperation
  
  The  function  [10XAddTermModulePoly[0m  adds  a  term  [10X[gen,  monpoly][0m to a module
  polynomial [10Xmodpoly[0m.
  
  Tests for equality and arithmetic operations are performed in the usual way.
  Module  polynomials may be added or subtracted. A module polynomial can also
  be  multiplied  on the right by a word or by a scalar. The effect of this is
  to  multiply the monoid polynomial parts of each term by the word or scalar.
  This is made clearer in the example.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> mp0 := MonoidPolyFromCoeffsWords( [6], [ M[2] ] );;[0X
    [4Xgap> Display(mp0);[0X
    [4X6*q8_M2[0X
    [4Xgap> s0 := AddTermModulePoly( s1, genfrq8[3], mp0 ); [0X
    [4Xq8_R1*(4*q8_M4 - 5*q8_M1) + q8_R3*(6*q8_M2) + q8_R4*( - 7*q8_M4 + 5*q8_M1 +[0X
    [4X9*<identity ...>)[0X
    [4Xgap> Display( s1 + s2 );[0X
    [4Xq8_R1*( q8_M4 - 5*q8_M1 + 9*<identity ...>) + q8_R2*(12*q8_M4 -[0X
    [4X15*q8_M1) + q8_R3*(7*q8_M4 - 5*q8_M1 - 9*<identity ...>) + q8_R4*( -[0X
    [4X7*q8_M4 + 5*q8_M1 + 9*<identity ...>)[0X
    [4Xgap> Display( s1 - s0 );[0X
    [4Xq8_R3*( - 6*q8_M2)[0X
    [4Xgap> Display( s1 * 1/2 );[0X
    [4Xq8_R1*(2*q8_M4 - 5/2*q8_M1) + q8_R4*( - 7/2*q8_M4 + 5/2*q8_M1 + 9/[0X
    [4X2*<identity ...>)[0X
    [4Xgap> Display( s1 * M[1] );[0X
    [4Xq8_R1*(4*q8_M4*q8_M1 - 5*q8_M1^2) + q8_R4*( - 7*q8_M4*q8_M1 + 5*q8_M1^2 +[0X
    [4X9*q8_M1)[0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1X5.4 Identities among relators[0X
  
  [1X5.4-1 IdentityYSequences[0m
  
  [2X> IdentityYSequences( [0X[3Xgrp[0X[2X ) _______________________________________[0Xattribute
  [2X> IdentityModulePolynomials( [0X[3Xgrp[0X[2X ) ________________________________[0Xoperation
  [2X> IdentitiesAmongRelators( [0X[3Xgrp[0X[2X ) __________________________________[0Xattribute
  
  The  identities  among  the  relators  for  a  finitely  presented group are
  constructed as logged module polynomials. The procedure, described in [HW03]
  and  based  on work in [BS99], is to construct a full set of Y-sequences for
  the   group;  convert  these  into  module  polynomials  (eliminating  empty
  sequences);  and  then  apply  simplification  rules  (including the primary
  identity property) to eliminate obvious duplicates and conjugates.
  
  It  is [13Xnot[0m guaranteed that a minimal set of identities is obtained. For [10Xq8[0m a
  set  of  seven  identities  is obtained, whereas a minimal set contains only
  six. See Example 5.1 of [HW03] for further details.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> yseqs := IdentityYSequences( q8 );;[0X
    [4Xgap> Length( yseqs );[0X
    [4X32[0X
    [4Xgap> polys := IdentityModulePolys( q8 );;[0X
    [4Xgap> Length( polys );[0X
    [4X22[0X
    [4Xgap> idsq8 := IdentitiesAmongRelators( q8 );;[0X
    [4Xgap> Length( idsq8 );[0X
    [4X2[0X
    [4Xgap> Length( idsq8[1] );[0X
    [4X7[0X
    [4Xgap> Display( idsq8[1] );[0X
    [4X[ ( q8_Y3*( q8_M1*q8_M4), q8_R1*( q8_M1 - <identity ...>) ),[0X
    [4X  ( q8_Y10*( -q8_M1*q8_M4), q8_R2*( q8_M2 - <identity ...>) ),[0X
    [4X  ( q8_Y17*( <identity ...>), q8_R1*( -q8_M3 - q8_M2) + q8_R3*( q8_M1^[0X
    [4X2 + q8_M3 + q8_M1 + <identity ...>) ),[0X
    [4X  ( q8_Y31*( q8_M1*q8_M4), q8_R3*( q8_M3 - q8_M2) + q8_R4*( q8_M1 - <identity \[0X
    [4X...>) ),[0X
    [4X  ( q8_Y32*( -q8_M1*q8_M4), q8_R2*( -q8_M1^[0X
    [4X2) + q8_R3*( -q8_M3 - <identity ...>) + q8_R4*( q8_M2 + <identity ...>) ),[0X
    [4X  ( q8_Y12*( q8_M1*q8_M4), q8_R1*( -q8_M2) + q8_R3*( q8_M1*q8_M2 + q8_M4) + q8\[0X
    [4X_R4*( q8_M2 - <identity ...>) ),[0X
    [4X  ( q8_Y16*( -<identity ...>), q8_R1*( -<identity ...>) + q8_R2*( -q8_M1) + q8\[0X
    [4X_R4*( q8_M3 + q8_M1) )[0X
    [4X  ][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  [1X5.4-2 RootIdentities[0m
  
  [2X> RootIdentities( [0X[3Xgrp[0X[2X ) ___________________________________________[0Xattribute
  
  The  [13Xroot  identities[0m  are identities of the form r^wr^-1 where r = w^n is a
  relator and n>1.
  
  For  [10Xq8[0m only two of the four relators are proper powers, q=a^4 and r=b^4, so
  the root identities are q^aq^-1 and r^br^-1.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X[0X
    [4Xgap> RootIdentities( q8 );[0X
    [4X[ ( q8_Y3*( q8_M1*q8_M4), q8_R1*( q8_M1 - <identity ...>) ),[0X
    [4X  ( q8_Y10*( -q8_M1*q8_M4), q8_R2*( q8_M2 - <identity ...>) ) ][0X
    [4Xgap> RootIdentities(s3);[0X
    [4X[ ( s3_Y4*( s3_M2*s3_M1), s3_R1*( s3_M1 - <identity ...>) ),[0X
    [4X  ( s3_Y8*( s3_M2*s3_M1), s3_R2*( s3_M2 - <identity ...>) ),[0X
    [4X  ( s3_Y7*( s3_M2*s3_M1), s3_R3*( s3_M2 - s3_M1) ) ][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
