# monoid -- make or retrieve a monoid

## Synopsis

• Usage:
monoid [a,b,c,...]
• Inputs:
• [a,b,c,...], an array of variables, as well as optional arguments. Alternatively, specifying a list {a,b,c,...} produces a monoid with a local ordering, by inserting the option Local => true
• Optional inputs:
• DegreeRank => an integer, default value null, the length of each multidegree
• Degrees => a list, default value null, a list of degrees or multidegrees of the variables. Each degree is an integers, and each multidegree is a list of integers. Degrees will be converted into multidegrees of length 1.
• Inverses => , default value false, whether negative exponents will be allowed, making the monoid into a group
• Global => , default value true, whether monoid rings based on this monoid are to be global rings. If set to true, and the option Inverses=>true is not specified, then an error is signalled if any of the variables are not greater than 1 in the monomial ordering, as required by the standard theory of Gröbner bases.
• Local => , default value false, whether this ring is to be a local ring; implies Global => false
• MonomialOrder => a list, default value {GRevLex, Position => Up}, an option for specifying the monomial ordering, see MonomialOrder
• MonomialSize => an integer, default value 32, the minimum number of bits to be used for storing each exponent in a monomial. The exponents are stored as signed binary numbers, so n bits allows an exponent as large as 2n-1-1. Useful values are 8, 16, and 32.
• SkewCommutative => ..., default value {}, specifies whether some of the variables skew-commute with each other. The value true indicates that all of the variables skew-commute. Otherwise, the value of the option should be a list of variables, variables names, or integers that will be interpreted as indices of the variables.
• Variables => ..., default value null, a list of variables names, or the number of variables to be made. This option is useful for those situations when one doesn't care about the names of the variables in a ring or monoid, or when one is creating a tensor product ring, symmetric algebra, or other ring, and one wants control over the names of the ring variables.
• VariableBaseName => , default value p, a symbol x to be used as the base for constructing a list of subscripted variable names of class IndexedVariable, of the form x_0, ..., x_(n-1).
• Weights => a list, default value {}, a list of integers, or a list of lists of integers, that specify weights for the variables. The orderings by these weight vectors is prepended to the list of orderings provided by the MonomialOrder option.
• WeylAlgebra => a list, default value {}, a list of options of the form x=>dx, which specifies that dx plays the role of the derivative with respect to x in the resulting Weyl algebra when this monoid is made into a polynomial ring.
• Heft => a list, default value null, a list of integers (called a heft vector): its dot product (presumably positive) with the degrees of the variables will be used as a computational aid in certain routines. If no value for this option is specified, one will be computed for you, and thus there is no need to provide one unless the time spent computing one is onerous; if no heft vector exists, certain computations will not be supported, and others may run more slowly.
• Join => , default value null, whether the degrees in a new monoid ring based on this monoid will be obtained by joining the degrees in the monoid with the degrees in the coefficient ring; default: true
• DegreeMap => , default value null, the degree map, to be used if Join => false is given: a (linear) function from the multidegrees of the (future) coefficient ring to the multidegrees of the monoid ring (polynomial ring) made from it with the monoid created here, to be used in determining homogeneity and in determining degrees in tensor products. The default is the identity.
• DegreeLift => , default value null, the degree lift function: a (partial) inverse of the degree map, giving an error when lifting is not possible. If the degree map is the identity, then by default the identity map will be provided.
• Constants (missing documentation) => ..., default value false,
• Outputs:
• a new monoid

## Description

The function monoid is called whenever a polynomial ring is created, see Ring Array, or when a local polynomial ring is made, see Ring List. Some of the options provided when making a monoid don't take effect until the monoid is made into a polynomial ring.

Let's make a free ordered commutative monoid on the variables a,b,c, with degrees 2, 3, and 4, respectively.
 i1 : M = monoid [a,b,c,Degrees=>{2,3,4}] o1 = M o1 : GeneralOrderedMonoid i2 : degrees M o2 = {{2}, {3}, {4}} o2 : List i3 : M_0 * M_1^6 6 o3 = a*b o3 : M
Use use to arrange for the variables to be assigned their values in the monoid.
 i4 : a o4 = a o4 : M i5 : use M o5 = M o5 : GeneralOrderedMonoid i6 : a * b^6 6 o6 = a*b o6 : M
The options used when the monoid was created can be recovered with options.
 i7 : options M o7 = OptionTable{Constants => false } DegreeLift => null DegreeMap => null DegreeRank => 1 Degrees => {{2}, {3}, {4}} Global => true Heft => {1} Inverses => false Join => null Local => false MonomialOrder => {MonomialSize => 32 } {GRevLex => {2, 3, 4}} {Position => Up } SkewCommutative => {} Variables => {a, b, c} WeylAlgebra => {} o7 : OptionTable
The variables listed may be symbols or indexed variables. The values assigned to these variables are the corresponding monoid generators. The function baseName may be used to recover the original symbol or indexed variable.

The Heft option is used in particular by Ext(Module,Module).

 i8 : R = ZZ[x,y, Degrees => {-1,-2}, Heft => {-1}] o8 = R o8 : PolynomialRing i9 : degree \ gens R o9 = {{-1}, {-2}} o9 : List i10 : transpose vars R o10 = {1} | x | {2} | y | 2 1 o10 : Matrix R <--- R
In this example we make a Weyl algebra.
 i11 : R = ZZ/101[x,dx,y,dy,WeylAlgebra => {x=>dx, y=>dy}] o11 = R o11 : PolynomialRing, 2 differential variables i12 : dx*x o12 = x*dx + 1 o12 : R i13 : dx*x^10 10 9 o13 = x dx + 10x o13 : R i14 : dx*y^10 10 o14 = dx*y o14 : R
In this example we make a skew commutative ring.
 i15 : R = ZZ[x,y,z,SkewCommutative=>{x,y}] o15 = R o15 : PolynomialRing, 2 skew commutative variables i16 : x*y o16 = x*y o16 : R i17 : y*x o17 = -x*y o17 : R i18 : x*z-z*x o18 = 0 o18 : R
By default, (multi)degrees are concatenated when forming polynomial rings over polynomial rings, as can be seen by examining the corresponding flattened monoid, which displays information about all of the variables.
 i19 : QQ[x][y] o19 = QQ[x][y] o19 : PolynomialRing i20 : oo.FlatMonoid o20 = monoid[y, x, Degrees => {{1}, {0}}, Heft => {2:1}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 2] {0} {1} {GRevLex => {1} } {Position => Up } {GRevLex => {1} } o20 : GeneralOrderedMonoid i21 : QQ[x][y][z] o21 = QQ[x][y][z] o21 : PolynomialRing i22 : oo.FlatMonoid o22 = monoid[z, y, x, Degrees => {{1}, {0}, {0}}, Heft => {3:1}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 3] {0} {1} {0} {GRevLex => {1} } {0} {0} {1} {Position => Up } {2:(GRevLex => {1})} o22 : GeneralOrderedMonoid
That behavior can be overridden with the Join option.
 i23 : QQ[x][y,Join => false] o23 = QQ[x][y] o23 : PolynomialRing i24 : oo.FlatMonoid o24 = monoid[y, x, Degrees => {2:1}, Heft => {1}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 1] {GRevLex => {1} } {Position => Up } {GRevLex => {1} } o24 : GeneralOrderedMonoid
A degree map may be provided, and it will be used in computing tensor products.
 i25 : A = QQ[x]; i26 : B = A[y,Join => false,DegreeMap => x -> 7*x] o26 = B o26 : PolynomialRing i27 : B.FlatMonoid o27 = monoid[y, x, Degrees => {1, 7}, Heft => {1}, MonomialOrder => {MonomialSize => 32}, DegreeRank => 1] {GRevLex => {1} } {Position => Up } {GRevLex => {1} } o27 : GeneralOrderedMonoid i28 : degrees A^{-1,-2} o28 = {{1}, {2}} o28 : List i29 : degrees (B**A^{-1,-2}) o29 = {{7}, {14}} o29 : List
For certain applications, such as lifting matrices, a degree lift function can be provided.
 i30 : B = A[y,Join => false,DegreeMap => x -> 7*x, DegreeLift => x -> apply(x, d -> lift(d/7,ZZ))] o30 = B o30 : PolynomialRing i31 : matrix {{x_B}} o31 = | x | 1 1 o31 : Matrix B <--- B i32 : degrees oo o32 = {{{0}}, {{7}}} o32 : List i33 : lift(matrix {{x_B}},A) o33 = | x | 1 1 o33 : Matrix A <--- A i34 : degrees oo o34 = {{{0}}, {{1}}} o34 : List

## Synopsis

• Usage:
monoid R
• Inputs:
• Outputs:
• the monoid of monomials in the polynomial ring R

If R is a quotient ring of a polynomial ring S, then the monoid of S is returned.

 i35 : R = QQ[a..d, Weights=>{1,2,3,4}] o35 = R o35 : PolynomialRing i36 : monoid R o36 = monoid[a..d, Degrees => {4:1}, Heft => {1}, MonomialOrder => {Weights => {1..4} }, DegreeRank => 1] {MonomialSize => 32} {GRevLex => {4:1} } {Position => Up } o36 : GeneralOrderedMonoid

## Ways to use monoid :

• "monoid(Array)"
• "monoid(List)"
• "monoid(PolynomialRing)"
• "monoid(QuotientRing)"

## For the programmer

The object monoid is .