GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1[1X11 [33X[0;0YAffine semigroups[133X[101X234[1X11.1 [33X[0;0YDefining affine semigroups[133X[101X56[33X[0;0YAn affine semigroup [22XS[122X is a finitely generated cancellative monoid that is7reduced (no units other than 0) and is torsion-free ([22Xa s= b s[122X implies [22Xa=b[122X,8with [22Xa,b∈ N[122X and [22Xs∈ S[122X). Up to isomorphisms any affine semigroup can be viewed9as a finitely generated submonoid of [22XN^k[122X for some positive integer [22Xk[122X. Thus10affine semigroups are a natural generalization of numerical semigroups. The11most common way to give an affine semigroup is by any of its systems of12generators. As for numerical semigroups, any affine semigroup admits a13unique minimal system of generators. A system of generators can be14represented as a list of lists of nonnegative integers; all lists in the15list having the same length (a matrix actually). If [22XG[122X is a subgroup of [22XZ^k[122X,16then [22XS=G∩ N^k[122X is an affine semigroup (these semigroups are called full17affine semigroups). As [22XG[122X can be represented by its defining equations18(homogeneous and some of them possibly in congruences), we can represent [22XS[122X19by the defining equations of [22XG[122X; indeed [22XS[122X is just the set of nonnegative20solutions of this system of equations. We can represent the equations as a21list of lists of integers, all with the same length. Every list is a row of22the matrix of coefficients of the system of equations. For the equations in23congruences, if we arrange them so that they are the first ones in the list,24we provide the corresponding moduli in a list. So for instance, the25equations [22Xx+y≡ 0mod 2, x-2y=0[122X will be represented as [[1,1],[1,-2]] and the26moduli [2].[133X2728[33X[0;0YAs happens with numerical semigroups, there are different ways to specify an29affine semigroup [22XS[122X, namely, by means of a system of generators, a system of30homogeneous linear Diophantine equations or a system of homogeneous linear31Diophantine inequalities, just to mention some. In this section we describe32functions that may be used to specify, in one of these ways, an affine33semigroup in [5XGAP[105X.[133X3435[1X11.1-1 AffineSemigroupByGenerators[101X3637[29X[2XAffineSemigroupByGenerators[102X( [3XList[103X ) [32X function38[29X[2XAffineSemigroup[102X( [3XString[103X, [3XList[103X ) [32X function3940[33X[0;0Y[10XList[110X is a list of n-tuples of nonnegative integers, if the semigroup to be41created is n-dimensional. The n-tuples may be given as a list or by a42sequence of individual elements. The output is the affine semigroup spanned43by [10XList[110X.[133X4445[33X[0;0Y[10XString[110X does not need to be present. When it is present, it must be46[10X"generators"[110X and [10XList[110X must be a list, not a sequence of individual elements.[133X4748[4X[32X Example [32X[104X49[4X[25Xgap>[125X [27Xs1 := AffineSemigroupByGenerators([1,3],[7,2],[1,5]);[127X[104X50[4X[28X<Affine semigroup in 2 dimensional space, with 3 generators>[128X[104X51[4X[25Xgap>[125X [27Xs2 := AffineSemigroupByGenerators([[1,3],[7,2],[1,5]]);;[127X[104X52[4X[25Xgap>[125X [27Xs3 := AffineSemigroup("generators",[[1,3],[7,2],[1,5]]);;[127X[104X53[4X[25Xgap>[125X [27Xs4 := AffineSemigroup([1,3],[7,2],[1,5]);;[127X[104X54[4X[25Xgap>[125X [27Xs5 := AffineSemigroup([[1,3],[7,2],[1,5]]);;[127X[104X55[4X[25Xgap>[125X [27XLength(Set([s1,s2,s3,s4,s5]));[127X[104X56[4X[28X1[128X[104X57[4X[32X[104X5859[1X11.1-2 AffineSemigroupByEquations[101X6061[29X[2XAffineSemigroupByEquations[102X( [3XList[103X ) [32X function62[29X[2XAffineSemigroup[102X( [3XString[103X, [3XList[103X ) [32X function6364[33X[0;0Y[10XList[110X is a list with two components. The first represents a matrix with65integer coefficients, say [22XA=(a_ij)[122X, and so it is a list of lists of integers66all with the same length. The second component is a list of positive67integers, say [22Xd=(d_i)[122X, which may be empty. The list [22Xd[122X must be of length less68than or equal to the length of [22XA[122X (number of rows of [22XA[122X).[133X6970[33X[0;0YThe output is the full semigroup of nonnegative integer solutions to the71system of homogeneous equations[133X72[33X[0;0Y[22Xa_11x_1+⋯+a_1nx_n≡ 0mod d_1,[122X[133X73[33X[0;0Y[22X⋯[122X[133X74[33X[0;0Y[22Xa_k1x_1+⋯+a_knx_n≡ 0mod d_k,[122X[133X75[33X[0;0Y[22Xa_k+1 1x_1+⋯ +a_k+1 n=0,[122X[133X76[33X[0;0Y[22X⋯[122X[133X77[33X[0;0Y[22Xa_m1x_1+⋯+a_mnx_n=0.[122X[133X7879[33X[0;0YIf [22Xd[122X is empty, then there will be no equations in congruences.[133X8081[33X[0;0YAs pointed at the beginning of the section, the equations [22Xx+y≡ 0mod 2,82x-2y=0[122X will be represented as [22XA[122X equal to [[1,1],[1,-2]] and the moduli [22Xd[122X83equal to [2].[133X8485[33X[0;0YIn the second form, [10XString[110X must be [10X"equations"[110X.[133X8687[4X[32X Example [32X[104X88[4X[25Xgap>[125X [27Xs1 := AffineSemigroupByEquations([[[-2,1]],[3]]);[127X[104X89[4X[28X<Affine semigroup>[128X[104X90[4X[25Xgap>[125X [27Xs2 := AffineSemigroup("equations",[[[1,1]],[3]]);[127X[104X91[4X[28X<Affine semigroup>[128X[104X92[4X[25Xgap>[125X [27Xs1=s2;[127X[104X93[4X[28Xtrue[128X[104X94[4X[32X[104X9596[1X11.1-3 AffineSemigroupByInequalities[101X9798[29X[2XAffineSemigroupByInequalities[102X( [3XList[103X ) [32X function99[29X[2XAffineSemigroup[102X( [3XString[103X, [3XList[103X ) [32X function100101[33X[0;0Y[10XList[110X is a list of lists (a matrix) of integers that represents a set of102inequalities.[133X103104[33X[0;0YReturns the (normal) affine semigroup of nonegative integer solutions of the105system of inequalities [22XList× Xge 0[122X.[133X106107[33X[0;0YIn the second form, [10XString[110X must be [10X"inequalities"[110X.[133X108109[4X[32X Example [32X[104X110[4X[25Xgap>[125X [27Xa1:=AffineSemigroupByInequalities([[2,-1],[-1,3]]);[127X[104X111[4X[28X<Affine semigroup>[128X[104X112[4X[25Xgap>[125X [27Xa2:=AffineSemigroup("inequalities",[[2,-1],[-1,3]]);[127X[104X113[4X[28X<Affine semigroup>[128X[104X114[4X[25Xgap>[125X [27Xa1=a2;[127X[104X115[4X[28Xtrue[128X[104X116[4X[32X[104X117118[1X11.1-4 Generators[101X119120[29X[2XGenerators[102X( [3XS[103X ) [32X function121[29X[2XGeneratorsOfAffineSemigroup[102X( [3XS[103X ) [32X function122123[33X[0;0Y[3XS[103X is an affine semigroup, the output is a system of generators.[133X124125[4X[32X Example [32X[104X126[4X[25Xgap>[125X [27Xa:=AffineSemigroup([[1,0],[0,1],[1,1]]);[127X[104X127[4X[28X<Affine semigroup in 2 dimensional space, with 3 generators>[128X[104X128[4X[25Xgap>[125X [27XGenerators(a);[127X[104X129[4X[28X[ [ 0, 1 ], [ 1, 0 ], [ 1, 1 ] ][128X[104X130[4X[32X[104X131132[1X11.1-5 MinimalGenerators[101X133134[29X[2XMinimalGenerators[102X( [3XS[103X ) [32X function135[29X[2XMinimalGeneratingSystem[102X( [3XS[103X ) [32X function136137[33X[0;0Y[3XS[103X is an affine semigroup, the output is its system of minimal generators.[133X138139[4X[32X Example [32X[104X140[4X[25Xgap>[125X [27Xa:=AffineSemigroup([[1,0],[0,1],[1,1]]);[127X[104X141[4X[28X<Affine semigroup in 2 dimensional space, with 3 generators>[128X[104X142[4X[28X gap> MinimalGenerators(a);[128X[104X143[4X[28X [ [ 0, 1 ], [ 1, 0 ] ][128X[104X144[4X[28X [128X[104X145[4X[32X[104X146147[1X11.1-6 AsAffineSemigroup[101X148149[29X[2XAsAffineSemigroup[102X( [3XS[103X ) [32X function150151[33X[0;0Y[3XS[103X is a numerical semigroup, the output is [3XS[103X regarded as an affine semigroup.[133X152153[4X[32X Example [32X[104X154[4X[25Xgap>[125X [27Xs:=NumericalSemigroup(1310,1411,1546,1601);[127X[104X155[4X[28X<Numerical semigroup with 4 generators>[128X[104X156[4X[25Xgap>[125X [27XMinimalPresentationOfNumericalSemigroup(s);;time;[127X[104X157[4X[28X2960[128X[104X158[4X[25Xgap>[125X [27Xa:=AsAffineSemigroup(s);[127X[104X159[4X[28X<Affine semigroup in 1 dimensional space, with 4 generators>[128X[104X160[4X[25Xgap>[125X [27XGeneratorsOfAffineSemigroup(a);[127X[104X161[4X[28X[ [ 1310 ], [ 1411 ], [ 1546 ], [ 1601 ] ][128X[104X162[4X[25Xgap>[125X [27XMinimalPresentationOfAffineSemigroup(a);;time;[127X[104X163[4X[28X237972[128X[104X164[4X[32X[104X165166[33X[0;0YIf we use the package [10XSingularInterface[110X, the speed up is considerable.[133X167168[4X[32X Example [32X[104X169[4X[25Xgap>[125X [27XNumSgpsUseSingularInterface();[127X[104X170[4X[28X...[128X[104X171[4X[25Xgap>[125X [27XMinimalPresentationOfAffineSemigroup(a);;time;[127X[104X172[4X[28X32[128X[104X173[4X[32X[104X174175[1X11.1-7 IsAffineSemigroup[101X176177[29X[2XIsAffineSemigroup[102X( [3XAS[103X ) [32X attribute178[29X[2XIsAffineSemigroupByGenerators[102X( [3XAS[103X ) [32X attribute179[29X[2XIsAffineSemigroupByEquations[102X( [3XAS[103X ) [32X attribute180[29X[2XIsAffineSemigroupByInequalities[102X( [3XAS[103X ) [32X attribute181182[33X[0;0Y[3XAS[103X is an affine semigroup and these attributes are available (their names183should be self explanatory). They reflect what is currently known about the184semigroup.[133X185186[4X[32X Example [32X[104X187[4X[25Xgap>[125X [27Xa1:=AffineSemigroup([[3,0],[2,1],[1,2],[0,3]]);[127X[104X188[4X[28X<Affine semigroup in 2 dimensional space, with 4 generators>[128X[104X189[4X[25Xgap>[125X [27XIsAffineSemigroupByEquations(a1);[127X[104X190[4X[28Xfalse[128X[104X191[4X[25Xgap>[125X [27XIsAffineSemigroupByGenerators(a1);[127X[104X192[4X[28Xtrue[128X[104X193[4X[32X[104X194195[1X11.1-8 BelongsToAffineSemigroup[101X196197[29X[2XBelongsToAffineSemigroup[102X( [3Xv[103X, [3Xa[103X ) [32X function198[29X[2X\in[102X( [3Xv[103X, [3Xa[103X ) [32X operation199200[33X[0;0Y[3Xv[103X is a list of nonnegative integers and [3Xa[103X an affine semigroup. Returns true201if the vector is in the semigroup, and false otherwise.[133X202203[33X[0;0YIf the semigroup is full and its equations are known (either because the204semigroup was defined by equations, or because the user has called205[10XIsFullAffineSemgiroup(a)[110X and the output was true), then membership is206performed by evaluating [3Xv[103X in the equations. The same holds for normal207semigroups and its defining inequalities.[133X208209[33X[0;0Y[3X v in a[103X can be used for short.[133X210211[4X[32X Example [32X[104X212[4X[25Xgap>[125X [27Xa:=AffineSemigroup([[2,0],[0,2],[1,1]]);;[127X[104X213[4X[25Xgap>[125X [27XBelongsToAffineSemigroup([5,5],a);[127X[104X214[4X[28Xtrue[128X[104X215[4X[25Xgap>[125X [27XBelongsToAffineSemigroup([1,2],a);[127X[104X216[4X[28Xfalse[128X[104X217[4X[25Xgap>[125X [27X[5,5] in a;[127X[104X218[4X[28Xtrue[128X[104X219[4X[25Xgap>[125X [27X[1,2] in a;[127X[104X220[4X[28Xfalse[128X[104X221[4X[32X[104X222223[1X11.1-9 IsFull[101X224225[29X[2XIsFull[102X( [3XS[103X ) [32X property226[29X[2XIsFullAffineSemigroup[102X( [3XS[103X ) [32X property227228[33X[0;0Y[3Xs[103X is an affine semigroup.[133X229230[33X[0;0YReturns true if the semigroup is full, false otherwise. The semigroup is231full if whenever [22Xa,b∈ S[122X and [22Xb-a∈ N^k[122X, then [22Xa-b∈ S[122X, where [22Xk[122X is the dimension232of [22XS[122X.[133X233234[33X[0;0YIf the semigroup is full, then its equations are stored in the semigroup for235further use.[133X236237[4X[32X Example [32X[104X238[4X[25Xgap>[125X [27Xa:=AffineSemigroup("equations",[[[1,1,1],[0,0,2]],[2,2]]);;[127X[104X239[4X[25Xgap>[125X [27XIsFullAffineSemigroup(a);[127X[104X240[4X[28Xtrue[128X[104X241[4X[32X[104X242243[1X11.1-10 HilbertBasisOfSystemOfHomogeneousEquations[101X244245[29X[2XHilbertBasisOfSystemOfHomogeneousEquations[102X( [3Xls[103X, [3Xm[103X ) [32X operation246247[33X[0;0Y[3Xls[103X is a list of lists of integers and [3Xm[103X a list of integers. The elements of248[3Xls[103X represent the rows of a matrix [22XA[122X. The output is a minimal generating249system (Hilbert basis) of the set of nonnegative integer solutions of the250system [22XAx=0[122X where the [22Xk[122X first equations are in the congruences modulo [3Xm[i][103X,251with [22Xk[122X the length of [3Xm[103X.[133X252253[33X[0;0YIf the package [10XNormalizInterface[110X has not been loaded, then Contejean-Devie254algorithm is used [CD94] instead (if this is the case, congruences are255treated as in [RGS98]).[133X256257[4X[32X Example [32X[104X258[4X[25Xgap>[125X [27XHilbertBasisOfSystemOfHomogeneousEquations([[1,0,1],[0,1,-1]],[2]);[127X[104X259[4X[28X[ [ 0, 2, 2 ], [ 1, 1, 1 ], [ 2, 0, 0 ] ][128X[104X260[4X[32X[104X261262[33X[0;0YIf [22XC[122X is a pointed cone (a cone in [22XQ^k[122X not containing lines and [22X0∈ C[122X), then263[22XS=C∩ N^k[122X is an affine semigroup (known as normal affine semigroup). So264another way to give an affine semigroup is by a set of homogeneous265inequalities, and we can represent these inequalities by its coefficients.266If we put them in a matrix [22XS[122X can be defined as the set of nonnegative267integer solutions to [22XAx ge 0[122X.[133X268269[1X11.1-11 HilbertBasisOfSystemOfHomogeneousInequalities[101X270271[29X[2XHilbertBasisOfSystemOfHomogeneousInequalities[102X( [3Xls[103X ) [32X operation272273[33X[0;0Y[3Xls[103X is a list of lists of integers. The elements of [3Xls[103X represent the rows of274a matrix [22XA[122X. The output is a minimal generating system (Hilbert basis) of the275set of nonnegative integer solutions to [22XAxge 0[122X.[133X276277[33X[0;0YIf the package [10XNormalizInterface[110X has not been loaded, then Contejean-Devie278algorithm is used [CD94] instead (the use of slack variables is described in279[CAGGB02]).[133X280281[4X[32X Example [32X[104X282[4X[25Xgap>[125X [27XHilbertBasisOfSystemOfHomogeneousInequalities([[2,-3],[0,1]]);[127X[104X283[4X[28X[ [ 1, 0 ], [ 2, 1 ], [ 3, 2 ] ][128X[104X284[4X[32X[104X285286[1X11.1-12 EquationsOfGroupGeneratedBy[101X287288[29X[2XEquationsOfGroupGeneratedBy[102X( [3XM[103X ) [32X function289290[33X[0;0Y[3XM[103X is a matrix of integers. The output is a pair [22X[A,m][122X that represents the291set of defining equations of the group spanned by the rows of [3XM[103X: [22XAx=0∈292Z_n_1× ⋯ × Z_n_t× Z^k[122X, with [22Xm=[n_1,...,n_t][122X.[133X293294[4X[32X Example [32X[104X295[4X[25Xgap>[125X [27XEquationsOfGroupGeneratedBy([[1,2,0],[2,-2,2]]);[127X[104X296[4X[28X[ [ [ 0, 0, -1 ], [ -2, 1, 3 ] ], [ 2 ] ][128X[104X297[4X[32X[104X298299[1X11.1-13 BasisOfGroupGivenByEquations[101X300301[29X[2XBasisOfGroupGivenByEquations[102X( [3XA[103X, [3Xm[103X ) [32X function302303[33X[0;0Y[3XA[103X is a matrix of integers and [3Xm[103X is a list of positive integers. The output304is a basis for the group with defining equations [22XAx=0∈ Z_n_1× ⋯ × Z_n_t×305Z^k[122X, with [22Xm=[n_1,...,n_t][122X.[133X306307[4X[32X Example [32X[104X308[4X[25Xgap>[125X [27XBasisOfGroupGivenByEquations([[0,0,1],[2,-1,-3]],[2]);[127X[104X309[4X[28X[ [ -1, -2, 0 ], [ -2, 2, -2 ] ][128X[104X310[4X[32X[104X311312313[1X11.2 [33X[0;0YGluings of affine semigroups[133X[101X314315[33X[0;0YLet [22XS_1[122X and [22XS_2[122X be two affine semigroups with the same dimension generated316by [22XA_1[122X and [22XA_2[122X, respectively. We say that the affine semigroup [22XS[122X generated317by the union of [22XA_1[122X and [22XA_2[122X is a gluing of [22XS_1[122X and [22XS_2[122X if [22XG(S_1)∩ G(S_2)=d Z[122X318([22XG(⋅)[122X stands for group spanned by) for some [22Xd∈ S_1∩ S_2[122X.[133X319320[33X[0;0YThe algorithm used is explained in [RGS99a].[133X321322[1X11.2-1 GluingOfAffineSemigroups[101X323324[29X[2XGluingOfAffineSemigroups[102X( [3Xa1[103X, [3Xa2[103X ) [32X function325326[33X[0;0Y[3Xa1, a2[103X are affine semigroups. Determines if they can be glued, and if so,327returns the gluing. Otherwise it returns fail.[133X328329[4X[32X Example [32X[104X330[4X[25Xgap>[125X [27Xa1:=AffineSemigroup([[2,0],[0,2]]);[127X[104X331[4X[28X<Affine semigroup in 2 dimensional space, with 2 generators>[128X[104X332[4X[25Xgap>[125X [27Xa2:=AffineSemigroup([[1,1]]);[127X[104X333[4X[28X<Affine semigroup in 2 dimensional space, with 1 generators>[128X[104X334[4X[25Xgap>[125X [27XGluingOfAffineSemigroups(a1,a2);[127X[104X335[4X[28X<Affine semigroup in 2 dimensional space, with 3 generators>[128X[104X336[4X[25Xgap>[125X [27XGenerators(last);[127X[104X337[4X[28X[ [ 0, 2 ], [ 1, 1 ], [ 2, 0 ] ][128X[104X338[4X[32X[104X339340341[1X11.3 [33X[0;0YPresentations of affine semigroups[133X[101X342343[33X[0;0YA minimal presentation of an affine semigroup is defined analogously as for344numerical semigroups. The user might take into account that generators are345stored in a set, and thus might be arranged in a different way to the346initial input.[133X347348[1X11.3-1 GeneratorsOfKernelCongruence[101X349350[29X[2XGeneratorsOfKernelCongruence[102X( [3XM[103X ) [32X operation351352[33X[0;0Y[3XM[103X is matrix with nonnegative integer coefficients. The output is a system of353generators of the congruence [22X{(x,y)∣ xM=yM}[122X.[133X354355[33X[0;0YThe main difference with [10XMinimalPresentationOfAffineSemigroup[110X is that the356matrix [3XM[103X can have repeated columns and these are not treated as a set.[133X357358[1X11.3-2 CanonicalBasisOfKernelCongruence[101X359360[29X[2XCanonicalBasisOfKernelCongruence[102X( [3XM[103X, [3XOrd[103X ) [32X operation361362[33X[0;0Y[3XM[103X is matrix with nonnegative integer coefficients, [3XOrd[103X a term ordering. The363output is a canonical bases of the congruence [22X{(x,y)∣ xM=yM}[122X (see [RGS99b]).364This corresponds with the exponents of the Gröbner basis of the kernel ideal365of the morphism [22Xx_i↦ Y^m_i[122X, with [22Xm_i[122X the [22Xi[122Xth row of [22XM[122X.[133X366367[33X[0;0YAccepted term orderings are lexicographic ([10XMonomialLexOrdering()[110X), graded368lexicographic ([3XMonomialGrlexOrdering()[103X) and reversed graded lexicographic369([3XMonomialGrevlexOrdering()[103X).[133X370371[4X[32X Example [32X[104X372[4X[25Xgap>[125X [27XM:=[[3],[5],[7]];;[127X[104X373[4X[25Xgap>[125X [27XCanonicalBasisOfKernelCongruence(M,MonomialLexOrdering());[127X[104X374[4X[28X[ [ [ 0, 7, 0 ], [ 0, 0, 5 ] ], [ [ 1, 0, 1 ], [ 0, 2, 0 ] ],[128X[104X375[4X[28X [ [ 1, 5, 0 ], [ 0, 0, 4 ] ], [ [ 2, 3, 0 ], [ 0, 0, 3 ] ],[128X[104X376[4X[28X [ [ 3, 1, 0 ], [ 0, 0, 2 ] ], [ [ 4, 0, 0 ], [ 0, 1, 1 ] ] ][128X[104X377[4X[25Xgap>[125X [27XCanonicalBasisOfKernelCongruence(M,MonomialGrlexOrdering());[127X[104X378[4X[28X[ [ [ 0, 7, 0 ], [ 0, 0, 5 ] ], [ [ 1, 0, 1 ], [ 0, 2, 0 ] ],[128X[104X379[4X[28X [ [ 1, 5, 0 ], [ 0, 0, 4 ] ], [ [ 2, 3, 0 ], [ 0, 0, 3 ] ],[128X[104X380[4X[28X [ [ 3, 1, 0 ], [ 0, 0, 2 ] ], [ [ 4, 0, 0 ], [ 0, 1, 1 ] ] ][128X[104X381[4X[25Xgap>[125X [27XCanonicalBasisOfKernelCongruence(M,MonomialGrevlexOrdering());[127X[104X382[4X[28X[ [ [ 0, 2, 0 ], [ 1, 0, 1 ] ], [ [ 3, 1, 0 ], [ 0, 0, 2 ] ],[128X[104X383[4X[28X [ [ 4, 0, 0 ], [ 0, 1, 1 ] ] ][128X[104X384[4X[32X[104X385386[1X11.3-3 GraverBasis[101X387388[29X[2XGraverBasis[102X( [3XM[103X ) [32X operation389390[33X[0;0Y[3XM[103X is matrix with integer coefficients. The output is a Graver basis for [3XM[103X.[133X391392[4X[32X Example [32X[104X393[4X[25Xgap>[125X [27Xgr:=GraverBasis([[3,5,7]]);[127X[104X394[4X[28X[ [ -7, 0, 3 ], [ -5, 3, 0 ], [ -4, 1, 1 ], [ -3, -1, 2 ], [ -2, -3, 3 ],[128X[104X395[4X[28X [ -1, -5, 4 ], [ -1, 2, -1 ], [ 0, -7, 5 ], [ 0, 7, -5 ], [ 1, -2, 1 ],[128X[104X396[4X[28X [ 1, 5, -4 ], [ 2, 3, -3 ], [ 3, 1, -2 ], [ 4, -1, -1 ], [ 5, -3, 0 ],[128X[104X397[4X[28X [ 7, 0, -3 ] ][128X[104X398[4X[32X[104X399400[1X11.3-4 MinimalPresentationOfAffineSemigroup[101X401402[29X[2XMinimalPresentationOfAffineSemigroup[102X( [3Xa[103X ) [32X operation403[29X[2XMinimalPresentation[102X( [3Xa[103X ) [32X operation404405[33X[0;0Y[3Xa[103X is an affine semigroup. The output is a minimal presentation for [3Xa[103X.[133X406407[33X[0;0YThere are four methods implemented for this function, depending on the408packages loaded. All of them use elimination, and Herzog's correspondence,409computing the kernel of a ring homomorphism ([Her70]). The fastest procedure410is achieved when [10XSingularInterface[110X is loaded, followed by [10XSingular[110X. The411procedure that does not use external packages uses internal GAP Gröbner412basis computations and thus it is slower. Also in this case, from the413Gröbner basis, a minimal set of generating binomials must be refined, and414for this Rclasses are used (if [10XNormalizInterface[110X is loaded, then the415factorizations are faster). The [10X4ti2[110X implementation uses [10X4ti2[110X internal416Gröbner bases and factorizations are done via [10Xzsolve[110X.[133X417418[4X[32X Example [32X[104X419[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X420[4X[25Xgap>[125X [27XMinimalPresentationOfAffineSemigroup(a);[127X[104X421[4X[28X[ [ [ 1, 0, 1 ], [ 0, 2, 0 ] ] ][128X[104X422[4X[25Xgap>[125X [27XGeneratorsOfAffineSemigroup(a);[127X[104X423[4X[28X[ [ 0, 2 ], [ 1, 1 ], [ 2, 0 ] ][128X[104X424[4X[32X[104X425426[1X11.3-5 BettiElementsOfAffineSemigroup[101X427428[29X[2XBettiElementsOfAffineSemigroup[102X( [3Xa[103X ) [32X operation429[29X[2XBettiElements[102X( [3Xa[103X ) [32X operation430431[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the set of Betti elements of [3Xa[103X432(defined as for numerical semigroups).[133X433434[33X[0;0YThis function relies on the computation of a minimal presentation.[133X435436[4X[32X Example [32X[104X437[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X438[4X[25Xgap>[125X [27XBettiElementsOfAffineSemigroup(a);[127X[104X439[4X[28X[ [ 2, 2 ] ][128X[104X440[4X[32X[104X441442[1X11.3-6 ShadedSetOfElementInAffineSemigroup[101X443444[29X[2XShadedSetOfElementInAffineSemigroup[102X( [3Xv[103X, [3Xa[103X ) [32X function445446[33X[0;0Y[3Xa[103X is an affine semigroup and [3Xv[103X is an element in [3Xa[103X. This is a translation to447affine semigroups of [10XShadedSetOfElementInNumericalSemigroup[110X ([14X4.1-5[114X).[133X448449[1X11.3-7 IsGeneric[101X450451[29X[2XIsGeneric[102X( [3Xa[103X ) [32X property452[29X[2XIsGenericAffineSemigroup[102X( [3Xa[103X ) [32X property453454[33X[0;0Y[3Xa[103X is an affine semigroup.[133X455456[33X[0;0YThe same as [10XIsGenericNumericalSemigroup[110X ([14X4.2-2[114X) but for affine semigroups.[133X457458[1X11.3-8 IsUniquelyPresentedAffineSemigroup[101X459460[29X[2XIsUniquelyPresentedAffineSemigroup[102X( [3Xa[103X ) [32X property461462[33X[0;0Y[3Xa[103X is an affine semigroup.[133X463464[33X[0;0YThe same as [10XIsUniquelyPresentedNumericalSemigroup[110X ([14X4.2-1[114X) but for affine465semigroups.[133X466467[1X11.3-9 PrimitiveElementsOfAffineSemigroup[101X468469[29X[2XPrimitiveElementsOfAffineSemigroup[102X( [3Xa[103X ) [32X operation470471[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the set of primitive elements of [3Xa[103X472(defined as for numerical semigroups).[133X473474[33X[0;0YThis function has three implementations (methods), one using Graver basis475via the Lawrence lifting of [3Xa[103X and the other (much faster) using476[10XNormalizInterface[110X. Also a [10X4ti2[110X version using its Graver basis computation is477provided.[133X478479[4X[32X Example [32X[104X480[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X481[4X[25Xgap>[125X [27XPrimitiveElementsOfAffineSemigroup(a);[127X[104X482[4X[28X[ [ 0, 2 ], [ 1, 1 ], [ 2, 0 ], [ 2, 2 ] ][128X[104X483[4X[32X[104X484485486[1X11.4 [33X[0;0YFactorizations in affine semigroups[133X[101X487488[33X[0;0YThe invariants presented here are defined as for numerical semigroups.[133X489490[33X[0;0YAs with presentations, the user should take into account that generators are491stored in a set, and thus might be arranged in a different way to the492initial input.[133X493494[1X11.4-1 FactorizationsVectorWRTList[101X495496[29X[2XFactorizationsVectorWRTList[102X( [3Xv[103X, [3Xls[103X ) [32X operation497498[33X[0;0Y[3Xv[103X is a list of nonnegative integers and [3Xls[103X is a list of lists of nonnegative499integers. The output is set of factorizations of [3Xv[103X in terms of the elements500of [3Xls[103X.[133X501502[33X[0;0YIf no extra package is loaded, then factorizations are computed recursively;503and thus slowly. If [10XNormalizInterface[110X is loaded, then a system of equations504is solved with Normaliz, and the performance is much better. If505[10X4ti2Interface[110X is loaded instead, then factorizations are calculated using506[10Xzsolve[110X command of [10X4ti2[110X.[133X507508[4X[32X Example [32X[104X509[4X[25Xgap>[125X [27XFactorizationsVectorWRTList([5,5],[[2,0],[0,2],[1,1]]);[127X[104X510[4X[28X[ [ 2, 2, 1 ], [ 1, 1, 3 ], [ 0, 0, 5 ] ][128X[104X511[4X[32X[104X512513[1X11.4-2 ElasticityOfAffineSemigroup[101X514515[29X[2XElasticityOfAffineSemigroup[102X( [3Xa[103X ) [32X operation516517[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the elasticity of [3Xa[103X (defined as for518numerical semigroups).[133X519520[33X[0;0YThe procedure used is based on [Phi10], where it is shown that the521elasticity can be computed by using circuits. The set of circuits is522calculated using [ES96].[133X523524[4X[32X Example [32X[104X525[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X526[4X[25Xgap>[125X [27XElasticityOfAffineSemigroup(a);[127X[104X527[4X[28X1[128X[104X528[4X[32X[104X529530[1X11.4-3 DeltaSetOfAffineSemigroup[101X531532[29X[2XDeltaSetOfAffineSemigroup[102X( [3Xa[103X ) [32X function533534[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the Delta set of [3Xa[103X (defined as for535numerical semigroups). The the procedure used is explained in [GSOW17].[133X536537[4X[32X Example [32X[104X538[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X539[4X[25Xgap>[125X [27XDeltaSetOfAffineSemigroup(a);[127X[104X540[4X[28X[ ][128X[104X541[4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,13,15,47);;[127X[104X542[4X[25Xgap>[125X [27Xa:=AsAffineSemigroup(s);;[127X[104X543[4X[25Xgap>[125X [27XDeltaSetOfAffineSemigroup(a);[127X[104X544[4X[28X[ 1, 2, 3, 5 ][128X[104X545[4X[32X[104X546547[1X11.4-4 CatenaryDegreeOfAffineSemigroup[101X548549[29X[2XCatenaryDegreeOfAffineSemigroup[102X( [3Xa[103X ) [32X function550551[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the catenary degree of [3Xa[103X (defined as552for numerical semigroups).[133X553554[4X[32X Example [32X[104X555[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X556[4X[25Xgap>[125X [27XCatenaryDegreeOfAffineSemigroup(a);[127X[104X557[4X[28X2[128X[104X558[4X[32X[104X559560[1X11.4-5 EqualCatenaryDegreeOfAffineSemigroup[101X561562[29X[2XEqualCatenaryDegreeOfAffineSemigroup[102X( [3Xa[103X ) [32X function563564[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the equal catenary degree of [3Xa[103X565(defined as for numerical semigroups).[133X566567[33X[0;0YThis function relies on the results presented in [GSOSRN13].[133X568569[1X11.4-6 HomogeneousCatenaryDegreeOfAffineSemigroup[101X570571[29X[2XHomogeneousCatenaryDegreeOfAffineSemigroup[102X( [3Xa[103X ) [32X function572573[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the homogeneous catenary degree of [3Xa[103X574(defined as for numerical semigroups).[133X575576[33X[0;0YThis function is based on [GSOSRN13].[133X577578[1X11.4-7 MonotoneCatenaryDegreeOfAffineSemigroup[101X579580[29X[2XMonotoneCatenaryDegreeOfAffineSemigroup[102X( [3Xa[103X ) [32X function581582[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the monotone catenary degree of [3Xa[103X583(defined as for numerical semigroups), computed as explained in [Phi10].[133X584585[4X[32X Example [32X[104X586[4X[25Xgap>[125X [27Xa:=AffineSemigroup("inequalities",[[2,-1],[-1,3]]);[127X[104X587[4X[28X<Affine semigroup>[128X[104X588[4X[25Xgap>[125X [27XGeneratorsOfAffineSemigroup(a);[127X[104X589[4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 3, 1 ] ][128X[104X590[4X[25Xgap>[125X [27XCatenaryDegreeOfAffineSemigroup(a);[127X[104X591[4X[28X3[128X[104X592[4X[25Xgap>[125X [27XEqualCatenaryDegreeOfAffineSemigroup(a);[127X[104X593[4X[28X2[128X[104X594[4X[25Xgap>[125X [27XHomogeneousCatenaryDegreeOfAffineSemigroup(a);[127X[104X595[4X[28X3[128X[104X596[4X[25Xgap>[125X [27XMonotoneCatenaryDegreeOfAffineSemigroup(a);[127X[104X597[4X[28X3[128X[104X598[4X[32X[104X599600[1X11.4-8 TameDegreeOfAffineSemigroup[101X601602[29X[2XTameDegreeOfAffineSemigroup[102X( [3Xa[103X ) [32X operation603604[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the tame degree of [3Xa[103X (defined as for605numerical semigroups). If [3Xa[103X is given by equations (or its equations are606known), then the procedure explained in [GSOW17] is used.[133X607608[4X[32X Example [32X[104X609[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X610[4X[25Xgap>[125X [27XTameDegreeOfAffineSemigroup(a);[127X[104X611[4X[28X2[128X[104X612[4X[32X[104X613614[1X11.4-9 OmegaPrimalityOfElementInAffineSemigroup[101X615616[29X[2XOmegaPrimalityOfElementInAffineSemigroup[102X( [3Xv[103X, [3Xa[103X ) [32X operation617618[33X[0;0Y[3Xv[103X is a list of nonnegative integers and [3Xa[103X is an affine semigroup. The output619is the omega primality of [3Xa[103X (defined as for numerical semigroups). Returns 0620if the element is not in the semigroup.[133X621622[33X[0;0YThe implementation of this procedure is performed as explained in [BGSG11]623(also, if the semigroup has defining equations, then it takes advantage of624this fact as explained in this reference).[133X625626[4X[32X Example [32X[104X627[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X628[4X[25Xgap>[125X [27XOmegaPrimalityOfElementInAffineSemigroup([5,5],a);[127X[104X629[4X[28X6[128X[104X630[4X[32X[104X631632[1X11.4-10 OmegaPrimalityOfAffineSemigroup[101X633634[29X[2XOmegaPrimalityOfAffineSemigroup[102X( [3Xa[103X ) [32X function635636[33X[0;0Y[3Xa[103X is an affine semigroup. The output is the omega primality of [3Xa[103X (defined as637for numerical semigroups).[133X638639[4X[32X Example [32X[104X640[4X[25Xgap>[125X [27Xa:=AffineSemigroup([2,0],[0,2],[1,1]);;[127X[104X641[4X[25Xgap>[125X [27XOmegaPrimalityOfAffineSemigroup(a);[127X[104X642[4X[28X2[128X[104X643[4X[32X[104X644645646647