# monoid -- make or retrieve a 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

Call use to assign the variables their values in the monoid.

 i4 : monoid[x,y,z] o4 = monoid[x..z, Degrees => {3:1}, Heft => {1}] o4 : GeneralOrderedMonoid i5 : x o5 = x o5 : Symbol i6 : use ooo o6 = monoid[x..z, Degrees => {3:1}, Heft => {1}] o6 : GeneralOrderedMonoid i7 : x * y^6 6 o7 = x*y o7 : monoid[x..z, Degrees => {3:1}, Heft => {1}]

The options used when the monoid was created can be recovered with options.

 i8 : options M o8 = OptionTable{Constants => false } 1 DegreeGroup => ZZ 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 => {} o8 : OptionTable i9 : describe M o9 = monoid[a..c, Degrees => {2..4}, Heft => {1}, MonomialOrder => {MonomialSize => 32}] {GRevLex => {2..4} } {Position => Up } i10 : toExternalString M o10 = monoid[a..c, Degrees => {2..4}, Heft => {1}, MonomialOrder => VerticalList{MonomialSize => 32, GRevLex => {2..4}, Position => Up}]

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 monoid(...,Heft=>...) option is used, for instance, by Ext(Module,Module).

 i11 : R = ZZ[x,y, Degrees => {-1,-2}, Heft => {-1}] o11 = R o11 : PolynomialRing i12 : degree \ gens R o12 = {{-1}, {-2}} o12 : List i13 : transpose vars R o13 = {1} | x | {2} | y | 2 1 o13 : Matrix R <--- 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.

 i14 : QQ[x][y] o14 = QQ[x][y] o14 : PolynomialRing i15 : oo.FlatMonoid o15 = monoid[y, x, Degrees => {{1}, {0}}, Heft => {2:1}, MonomialOrder => {MonomialSize => 32}] {0} {1} {GRevLex => {1} } {Position => Up } {GRevLex => {1} } o15 : GeneralOrderedMonoid i16 : QQ[x][y][z] o16 = QQ[x][y][z] o16 : PolynomialRing i17 : oo.FlatMonoid o17 = monoid[z, y, x, Degrees => {{1}, {0}, {0}}, Heft => {3:1}, MonomialOrder => {MonomialSize => 32}] {0} {1} {0} {GRevLex => {1} } {0} {0} {1} {Position => Up } {2:(GRevLex => {1})} o17 : GeneralOrderedMonoid

That behavior can be overridden with the monoid(...,Join=>...) option.

 i18 : QQ[x][y, Join => false] o18 = QQ[x][y] o18 : PolynomialRing i19 : oo.FlatMonoid o19 = monoid[y, x, Degrees => {2:1}, Heft => {1}, Join => false, MonomialOrder => {MonomialSize => 32}] {GRevLex => {1} } {Position => Up } {GRevLex => {1} } o19 : GeneralOrderedMonoid

## Ways to use monoid :

• "monoid(Array)"
• "monoid(List)"
• monoid(Ring) -- make or retrieve a monoid

## For the programmer

The object monoid is .