  
  [1X2 [33X[0;0YAuxiliary Functions[133X[101X
  
  [33X[0;0YThis  chapter  contains the description of some functions that do not fit in
  any other chapter.[133X
  
  
  [1X2.1 [33X[0;0YRoot Systems[133X[101X
  
  [1X2.1-1 ExtendedCartanMatrix[101X
  
  [33X[1;0Y[29X[2XExtendedCartanMatrix[102X( [3XR[103X ) [32X operation[133X
  
  [33X[0;0YHere [3XR[103X is a root system. This function returns the extended Cartan matrix of
  [3XR[103X. That is the Cartan matrix correponding to the lowest root (coming first),
  and the simple roots of [3XR[103X.[133X
  
  [33X[0;0YThe  output is a record with components [3XECM[103X (the extended Cartan matrix) and
  [3Xlabels[103X (the labels of the corresponding Dynkin diagram; they are the integer
  coefficients  of  a  linear  dependency  of  the  roots corresponding to the
  nodes).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("F",4);;[127X[104X
    [4X[25Xgap>[125X [27XExtendedCartanMatrix(R);[127X[104X
    [4X[28Xrec( ECM := [ [ 2, -1, 0, 0, 0 ], [ -1, 2, -1, 0, 0 ], [ 0, -1, 2, -2, 0 ], [128X[104X
    [4X[28X      [ 0, 0, -1, 2, -1 ], [ 0, 0, 0, -1, 2 ] ], labels := [ 1, 2, 3, 4, 2 ] )[128X[104X
  [4X[32X[104X
  
  [1X2.1-2 CartanType[101X
  
  [33X[1;0Y[29X[2XCartanType[102X( [3XC[103X ) [32X operation[133X
  
  [33X[0;0YHere [3XC[103X is a Cartan matrix (i.e., an integer matrix with 2-s on the diagonal,
  non-positive entries otherwise, and there exists a diagonal integer matrix [3XD[103X
  such that [3XCD[103X is a positive definite symmetric matrix). This function returns
  a  record  with  two  components:  [3Xtypes[103X, a list containing the types of the
  simple  components  of  the  corresponding  root  system, and [3Xenumeration[103X, a
  standard enumeration of the vertices of the Dynkin diagram of [3XC[103X. So this can
  be used to construct isomorphisms of root systems.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XC:= [[2,0,-3,0],[0,2,0,-1],[-1,0,2,0],[0,-1,0,2]];[127X[104X
    [4X[28X[ [ 2, 0, -3, 0 ], [ 0, 2, 0, -1 ], [ -1, 0, 2, 0 ], [ 0, -1, 0, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XCartanType(C);[127X[104X
    [4X[28Xrec( enumeration := [ [ 3, 1 ], [ 2, 4 ] ], [128X[104X
    [4X[28X  types := [ [ "G", 2 ], [ "A", 2 ] ] )[128X[104X
  [4X[32X[104X
  
  
  [1X2.2 [33X[0;0YWeyl groups[133X[101X
  
  [1X2.2-1 WeylTransversal[101X
  
  [33X[1;0Y[29X[2XWeylTransversal[102X( [3XR[103X, [3Xinds[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XWeylTransversal[102X( [3XR[103X, [3Xroots[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XR[103X  is a root system, and [3Xinds[103X a list of indices of [13Xpositive[113X roots of [3XR[103X
  that  form  a  set of simple roots of a root subsystem of [3XR[103X (the system does
  not  check  this).  Here  an index of a positive root is its position in the
  list [3XPositiveRootsNF( R )[103X.[133X
  
  [33X[0;0YThis function returns a list of shortest representatives of the right cosets
  of  the  corresponding Weyl subgroup of the Weyl group of [3XR[103X. The elements of
  the Weyl group are given as reduced expressions.[133X
  
  [33X[0;0YIn  the  second  form [3Xrts[103X is a list of roots of [3XR[103X, that form a set of simple
  roots  of  a  root subsystem of [3XR[103X (again, this is not checked). In this form
  the  roots  so  not  have  to  be positive. They have to be represented with
  respect   to  the  basis  of  simple  roots,  i.e.,  they  are  elements  of
  [3XPositiveRootsNF(R)[103X or of [3XNegativeRootsNF(R)[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("A",3);;[127X[104X
    [4X[25Xgap>[125X [27XWeylTransversal( R, [2,6] );[127X[104X
    [4X[28X[ [  ], [ 1 ], [ 3 ], [ 1, 2 ], [ 1, 3 ], [ 3, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("E",8);;[127X[104X
    [4X[25Xgap>[125X [27Xp:= PositiveRootsNF(R);;[127X[104X
    [4X[25Xgap>[125X [27Xa:= WeylTransversal( R, [p[1],p[3],p[4],p[5],p[6],p[7],p[8],-p[120]] );;[127X[104X
    [4X[25Xgap>[125X [27XLength(a);[127X[104X
    [4X[28X1920[128X[104X
  [4X[32X[104X
  
  [1X2.2-2 SizeOfWeylGroup[101X
  
  [33X[1;0Y[29X[2XSizeOfWeylGroup[102X( [3XR[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSizeOfWeylGroup[102X( [3Xtype[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XSizeOfWeylGroup[102X( [3XX[103X, [3Xn[103X ) [32X operation[133X
  
  [33X[0;0YIn  the  first from [3XR[103X is a root system. In the second form [3Xtype[103X is a list of
  lists    describing    the   type   of   a   root   system.   For   example:
  [3X[["A",3],["B",5],["G",2]][103X.  In the third form [3XX[103X is a letter (i.e., a string)
  and  [3Xn[103X  a positive integer, so that [3X Xn[103X is the type of a root system. In all
  cases the number of elements of the Weyl group is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem( SimpleLieAlgebra("E",6,Rationals) );;[127X[104X
    [4X[25Xgap>[125X [27XSizeOfWeylGroup(R);                [127X[104X
    [4X[28X51840[128X[104X
    [4X[25Xgap>[125X [27XSizeOfWeylGroup( [["E",6]] );[127X[104X
    [4X[28X51840[128X[104X
    [4X[25Xgap>[125X [27XSizeOfWeylGroup( "E", 6 );   [127X[104X
    [4X[28X51840[128X[104X
  [4X[32X[104X
  
  [1X2.2-3 WeylGroupAsPermGroup[101X
  
  [33X[1;0Y[29X[2XWeylGroupAsPermGroup[102X( [3XR[103X ) [32X operation[133X
  
  [33X[0;0YHere [3XR[103X is a root system. This function returns a permutation group whose set
  of elements is in bijection with the set of elements of the Weyl group of [3XR[103X.
  More precisely, this bijection works as follows.[133X
  
  [33X[0;0YLet  [22Xn[122X  be  the number of positive roots of [3XR[103X. We list the positive roots in
  the  order  in  which  they apppear in [3XPositiveRootsNF( R )[103X. To this list we
  append  the negative roots, listed in the same order. Thus the list of roots
  is  [22X{α_1,...,α_2n}[122X,  where  [22Xα_i+n  = -α_i[122X for [22X1≤ i≤ n[122X. Then a reflection [22Xs_α[122X
  corresponding  to  the root [22Xα[122X corresponds to the permutation [22Xπ_α[122X, where [22Xs_α(
  α_i  )  =  α_i^π_α}[122X. Note, however, that [22Xs_α[122X acts from the [13Xleft[113X, whereas [22Xπ_α[122X
  acts from the [13Xright[113X. Let [22XW[122X denote the Weyl group of [3XR[103X and let [22XG[122X be the group
  generated  by the permutations [22Xπ_α[122X for [22Xα[122X in the fixed set of simple roots of
  [3XR[103X.  Then mapping [22Xs_α[122X to [22Xπ_α[122X extends to an [13Xanti-isomorphism[113X [22XW-> G[122X. The reason
  for  doing  it  like  this is that in the vast majority of literature on Lie
  theory  the Weyl group acts from the left, but in [5XGAP[105X permutation groups act
  from the right. When applying the group that is output by this function this
  difference  has to be kept in mind. For example, the orbit of a root [22Xβ[122X under
  [22XW[122X equals the set of images of [22Xβ[122X under the representatives of the left cosets
  of  the stabilizer of [22Xβ[122X. But when we use the group [22XG[122X we have to consider the
  right cosets for this.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("E",6);[127X[104X
    [4X[28X<root system of type E6>[128X[104X
    [4X[25Xgap>[125X [27XG:= WeylGroupAsPermGroup( R );[127X[104X
    [4X[28X<permutation group with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(G);[127X[104X
    [4X[28X51840[128X[104X
  [4X[32X[104X
  
  [1X2.2-4 ApplyWeylPermToWeight[101X
  
  [33X[1;0Y[29X[2XApplyWeylPermToWeight[102X( [3XR[103X, [3Xp[103X, [3Xw[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XR[103X  is  a  root  system,  [3Xp[103X  is  an  element  of  the group returned by
  [2XWeylGroupAsPermGroup[102X ([14X2.2-3[114X) with input [3XR[103X. Here [3Xw[103X is a weight, that the list
  of  coefficients  of  a  weight  when  written  as  a  linear combination of
  fundamental  weights.  This  function  returns the result of acting with the
  element of the Weyl group corresponding to [3Xp[103X on [3Xw[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("D",4);;[127X[104X
    [4X[25Xgap>[125X [27XG:= WeylGroupAsPermGroup(R);[127X[104X
    [4X[28X<permutation group with 4 generators>[128X[104X
    [4X[25Xgap>[125X [27Xwt:= ApplyWeylPermToWeight( R, Random(G), [1,1,1,1] );;[127X[104X
    [4X[25Xgap>[125X [27XConjugateDominantWeight( WeylGroup(R), wt );[127X[104X
    [4X[28X[ 1, 1, 1, 1 ] [128X[104X
  [4X[32X[104X
  
  [1X2.2-5 WeylWordAsPerm[101X
  
  [33X[1;0Y[29X[2XWeylWordAsPerm[102X( [3XR[103X, [3Xu[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XR[103X  is  a root system, and [3Xu[103X is an element of the Weyl group given as a
  (not  necessarily  reduced)  word,  that is, [3Xu[103X is given by a list of indices
  between  1  and  the  rank  of  [3XR[103X.  This  function  returns  the permutation
  corresponding  to  [3Xu[103X,  that  is,  the  image of [3Xu[103X under the anti-iromorphism
  discussed in [2XWeylGroupAsPermGroup[102X ([14X2.2-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("D",4);;[127X[104X
    [4X[25Xgap>[125X [27XWeylWordAsPerm( R, [1,2,1,3,4,2,3,4,1] );[127X[104X
    [4X[28X(1,23,12,17)(2,10,14,22)(3,19,16,6)(4,18,15,7)(5,13,11,24)(8,21)(9,20)[128X[104X
  [4X[32X[104X
  
  [1X2.2-6 PermAsWeylWord[101X
  
  [33X[1;0Y[29X[2XPermAsWeylWord[102X( [3XR[103X, [3Xp[103X ) [32X operation[133X
  
  [33X[0;0YThis  is  the  inverse  operation  to  the  one  discussed in [2XWeylWordAsPerm[102X
  ([14X2.2-5[114X).  That is, the element of the Weyl group (this time given as reduced
  expression) corresponding to the permutation [3Xp[103X is returned.[133X
  
  [33X[0;0YIn the next example we compute generators of the stabilizer of a subset of a
  root system. The generators are given as reduced words.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XR:= RootSystem("D",4);;[127X[104X
    [4X[25Xgap>[125X [27Xrts:= [1,3,4,12,13,15,16,24];;[127X[104X
    [4X[25Xgap>[125X [27XG:= WeylGroupAsPermGroup(R);;[127X[104X
    [4X[25Xgap>[125X [27XS:= Stabilizer( G, rts, OnSets );[127X[104X
    [4X[28X<permutation group of size 64 with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XSize(S);[127X[104X
    [4X[28X64[128X[104X
    [4X[25Xgap>[125X [27XList( GeneratorsOfGroup(S), g -> PermAsWeylWord( R, g ) );[127X[104X
    [4X[28X[ [ 3 ], [ 3, 4 ], [ 2, 1, 3, 2, 4, 2, 1, 3, 2, 4 ], [ 2, 1, 3, 2 ], [128X[104X
    [4X[28X  [ 2, 1, 4, 2 ], [ 1, 3 ] ][128X[104X
  [4X[32X[104X
  
  
  [1X2.3 [33X[0;0YLie Algebras and Their Modules[133X[101X
  
  [1X2.3-1 IsomorphismOfSemisimpleLieAlgebras[101X
  
  [33X[1;0Y[29X[2XIsomorphismOfSemisimpleLieAlgebras[102X( [3XL1[103X, [3XL2[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XL1[103X  and  [3XL2[103X  are  two  semisimple  Lie  algebras  that are known to be
  isomorphic  (i.e.,  they  have  the  same  type).  This  function returns an
  isomorphism.[133X
  
  [1X2.3-2 AdmissibleLattice[101X
  
  [33X[1;0Y[29X[2XAdmissibleLattice[102X( [3XV[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XV[103X  is  a  [13Xsimple[113X  module  over a semisimple Lie algebra. This function
  returns  a basis of [3XV[103X that spans an admissible lattice in [3XV[103X. This means that
  for  a  root  vector  [22Xx[122X  of  the  acting Lie algebra the matrix [22Xexp( mx )[122X is
  integral,  where  [22Xmx[122X  denotes  the  matrix  of  [22Xx[122X relative to the admissible
  lattice.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XL:= SimpleLieAlgebra("G",2,Rationals);;[127X[104X
    [4X[25Xgap>[125X [27XV:= HighestWeightModule( L, [2,0] );[127X[104X
    [4X[28X<27-dimensional left-module over <Lie algebra of dimension 14 over Rationals>>[128X[104X
    [4X[25Xgap>[125X [27XB:=AdmissibleLattice(V);;[127X[104X
    [4X[25Xgap>[125X [27Xx:= L.1;[127X[104X
    [4X[28Xv.1[128X[104X
    [4X[25Xgap>[125X [27Xmx:= MatrixOfAction( B, x );;[127X[104X
    [4X[25Xgap>[125X [27XIsZero(mx^4); IsZero(mx^5);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xexp:=Sum( List( [0..4], i -> mx^i/Factorial(i) ) );;[127X[104X
    [4X[25Xgap>[125X [27XForAll( Flat(exp), IsInt );[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X2.3-3 DirectSumDecomposition[101X
  
  [33X[1;0Y[29X[2XDirectSumDecomposition[102X( [3XV[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XV[103X  is a module over a semisimple Lie algebra; this function computes a
  list of sub-modules such that [3XV[103X is their direct sum.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XL:= SimpleLieAlgebra("G",2,Rationals);;[127X[104X
    [4X[25Xgap>[125X [27XV:= HighestWeightModule( L, [1,0] );;[127X[104X
    [4X[25Xgap>[125X [27XW:= TensorProductOfAlgebraModules( V, V );[127X[104X
    [4X[28X<49-dimensional left-module over <Lie algebra of dimension 14 over Rationals>>[128X[104X
    [4X[25Xgap>[125X [27XDirectSumDecomposition( W );[127X[104X
    [4X[28X[ <left-module over <Lie algebra of dimension 14 over Rationals>>, [128X[104X
    [4X[28X  <left-module over <Lie algebra of dimension 14 over Rationals>>, [128X[104X
    [4X[28X  <left-module over <Lie algebra of dimension 14 over Rationals>>, [128X[104X
    [4X[28X  <left-module over <Lie algebra of dimension 14 over Rationals>> ][128X[104X
    [4X[25Xgap>[125X [27XList( last, Dimension );[127X[104X
    [4X[28X[ 27, 7, 14, 1 ][128X[104X
  [4X[32X[104X
  
  [1X2.3-4 CharacteristicsOfStrata[101X
  
  [33X[1;0Y[29X[2XCharacteristicsOfStrata[102X( [3XL[103X, [3Xhw[103X ) [32X operation[133X
  
  [33X[0;0YHere  [3XL[103X  is  a  semisimple  Lie  algebra  over  a field of characteristic 0.
  Secondly,  [3Xhw[103X  is  a  dominant weight, represented as a list of non-negative
  integers  (where  the  ordering  of  the fundamantal weights is given by the
  Cartan  matrix  of  the  root  system  of  [3XL[103X).  Let  [22XG[122X denote the semisimple
  algebraic group acting on the irreducible representation with highest weight
  [3Xhw[103X. Hesselink ([Hes79]) defined a stratification of the nullcone relative to
  the   action   of   [22XG[122X.  Popov  and  Vinberg  ([VP89])  have  described  this
  stratification  in  terms of characteristics, which are elements of a Cartan
  subalgebra  of  [3XL[103X.  To each characteristic there corresponds a stratum. This
  function  is  an  implementation of an algorithm due to Popov ([Pop03]), for
  computing the characteristics of the strata. It returns a list of two lists.
  The  first  list  contains the characteristics. The second list contains the
  dimensions of the corresponding strata. If the highest weight [3Xhw[103X defines the
  adjoint  representation,  then the characteristics of the strata are exactly
  the  characteristics of the nilpotent orbits in [3XL[103X. This means the following:
  let  [22Xh[122X  be  a  characteristic,  then there are [22Xe,f[122X in [3XL[103X such that the triple
  [22Xh,e,f[122X  satisfies the commutation relations of [22Xmathfraksl_2[122X, and the elements
  [22Xe[122X thus obtained are the representatives of the nilpotent [22XG[122X-orbits in [3XL[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XL:= SimpleLieAlgebra("G",2,Rationals);;[127X[104X
    [4X[25Xgap>[125X [27XL:= SimpleLieAlgebra("G",2,Rationals);;[127X[104X
    [4X[25Xgap>[125X [27XCharacteristicsOfStrata( L, [0,1] );[127X[104X
    [4X[28X[ [ v.13+(2)*v.14, (2)*v.13+(3)*v.14, (2)*v.13+(4)*v.14, (6)*v.13+(10)*v.14 ],[128X[104X
    [4X[28X  [ 6, 8, 10, 12 ] ][128X[104X
  [4X[32X[104X
  
