This is MonomialAlgebras.info, produced by Macaulay2, version 1.24.11

MonomialAlgebras -- Decompose a monomial algebra as a module over a subalgebra.
*******************************************************************************

Description
===========

Overview:

Consider a monoid B in \mathbb{N}^m and a submonoid A \subseteq B (both
finitely generated) such that K[B] is a finitely generated K[A]-module (with
the module structure given by inclusion, and K being a field).

Note that this is equivalent to the condition that the corresponding cones C(A)
and C(B) spanned by the monoids are equal. From this it follows that G(B)/G(A)
is finite, where G(A) and G(B) are the groups generated by the monoids.

This package provides functions to decompose the corresponding monomial algebra
K[B] as a direct sum of monomial ideals in K[A]. In

Le Tuan Hoa, Juergen Stueckrad: Castelnuovo-Mumford regularity of simplicial
toric rings, Journal of Algebra, Volume 259, Issue 1, 1 January 2003, pages
127-146,

it is shown that this decomposition exists in the case that B is homogeneous
and simplicial and A is generated by minimal generators of B on the extremal
rays of C(B). In particular then K[A] is a Noether normalization of K[B].

For the existence of the decomposition in the general (non-simplicial) case,
and for algorithms computing the decomposition and the regularity see:

J. Boehm, D. Eisenbud, M. Nitsche: Decomposition of semigroup algebras, Exper.
Math. 21(4) (2012) 385-394, http://arxiv.org/abs/1110.3653.

Using the decomposition algorithm, the package also provides fast functions to
test ring-theoretic properties of monomial algebras. For details on the
corresponding algorithms see:

J. Boehm, D. Eisenbud, M. Nitsche: Decomposition of Monomial Algebras:
Applications and Algorithms, 2012, http://arxiv.org/abs/1206.1735.

Key user functions:

Decomposition:

decomposeMonomialAlgebra, -- Decomposition of
one monomial algebra over a subalgebra.

See decomposeHomogeneousMA, -- Decomposition of one
homogeneous monomial algebra over a subalgebra.

Ring-theoretic properties:

isCohenMacaulayMA, -- Test whether a simplicial
monomial algebra is Cohen-Macaulay.

See isGorensteinMA, -- Test whether a simplicial monomial
algebra is Gorenstein.

See isBuchsbaumMA, -- Test whether a simplicial monomial
algebra is Buchsbaum.

See isNormalMA, -- Test whether a simplicial monomial algebra is
normal.

See isSeminormalMA, -- Test whether a simplicial monomial
algebra is seminormal.

See isSimplicialMA, -- Test whether a monomial algebra is
simplicial.

Regularity:

regularityMA, -- Compute the regularity via the
decomposition.

See degreeMA, -- Compute the degree via the decomposition.

See codimMA, -- Compute the codimension of a monomial algebra.

Options:

Computation of the binomial ideal associated to B via the function
binomialIdeal, can be done via two different methods:

The standard method uses the Macaulay2 function kernel (Macaulay2Doc),
and requires no configuration.

Alternatively, the external program 4ti2, http://www.4ti2.de/ can be called,
which is delivered with the Macaulay2 distribution. For large examples this is
typically much faster. To use this option load the MonomialAlgebras package
with the following configuration option:

loadPackage (Macaulay2Doc),("MonomialAlgebras",Configuration
=>\{"Use4ti2"=>true\})

Note that you can change the standard option by editing the file
init-MonomialAlgebras.m2 in the .Macaulay directory in your home directory.

In order to use 4ti2, on some systems you may have to configure the Macaulay2
package FourTiTwo first.

Setup:

Install this Package (Macaulay2Doc), by doing

See installPackage (Macaulay2Doc),("MonomialAlgebras")

Tests:

The following files contain the tuples (regularity, degree, codim) for every
semigroup B in \mathbb{N}^d with fixed d and fixed coordinate sum a. Using this
data we have verified the Eisenbud-Goto conjecture in these cases.

d = 3:

a = 3:    proveEG_33 (see
https://agag-jboehm.math.rptu.de/~boehm/Macaulay2/MonomialAlgebras/proveEG_33.
m2 )

a = 4:    proveEG_43 (see
https://agag-jboehm.math.rptu.de/~boehm/Macaulay2/MonomialAlgebras/proveEG_43.
m2 )

a = 5:    proveEG_53 (see
https://agag-jboehm.math.rptu.de/~boehm/Macaulay2/MonomialAlgebras/proveEG_53.
zip )

d = 4:

a = 2:    proveEG_24 (see
https://agag-jboehm.math.rptu.de/~boehm/Macaulay2/MonomialAlgebras/proveEG_24.
m2 )

a = 3:    proveEG_34 (see
https://agag-jboehm.math.rptu.de/~boehm/Macaulay2/MonomialAlgebras/proveEG_34.
zip )

d = 5:

a = 2:    proveEG_25 (see
https://agag-jboehm.math.rptu.de/~boehm/Macaulay2/MonomialAlgebras/proveEG_25.
zip )

Diagrams:

We illustrate the tests with Diagrams, showing projections of
the set of all possible (regularity, degree, codim).

Authors
=======

  * David Eisenbud (see http://www.msri.org/~de/ ) <de@msri.org>
  * Janko Boehm (see http://www.mathematik.uni-kl.de/~boehm/ )
    <boehm@mathematik.uni-kl.de>
  * Max Nitsche (see  ) <nitsche@mis.mpg.de>

Certification a gold star
=========================

Version 2.3 of this package was accepted for publication in volume 5 (see
https://msp.org/jsag/2013/5-1/ ) of The Journal of Software for Algebra and
Geometry (see https://msp.org/jsag/ ) on 2013-04-07, in the article
Decomposition of Monomial Algebras: Applications and Algorithms (see
https://msp.org/jsag/2013/5-1/p02.xhtml ) (DOI: 10.2140/jsag.2013.5.8 (see
https://doi.org/10.2140/jsag.2013.5.8 )). That version can be obtained from the
journal (see https://msp.org/jsag/2013/5-1/jsag-v5-n1-x02-code.zip ) or from
the Macaulay2 source code repository (see
https://github.com/Macaulay2/M2/blob/68f41d641fadb0a1054023432eb60177f1d7cbd9/
M2/Macaulay2/packages/MonomialAlgebras.m2 ).

Version
=======

This documentation describes version 2.3 of MonomialAlgebras.

Source code
===========

The source code from which this documentation is derived is in the file
MonomialAlgebras.m2 (see common/share/Macaulay2/MonomialAlgebras.m2 ). The
auxiliary files accompanying it are in the directory MonomialAlgebras/ (see
common/share/Macaulay2/MonomialAlgebras/ ).

Exports
=======

  * Types
      * MonomialAlgebra -- The class of all
        monomialAlgebras.
  * Functions and commands
      * adjoinPurePowers -- adjoin semigroup elements
        corresponding to pure powers of variables
      * affineAlgebra -- Define a monomial algebra
      * binomialIdeal -- Compute the ideal of a monomial
        algebra
      * codimMA -- Codimension of a monomial algebra.
      * decomposeHomogeneousMA -- Decomposition
        of one monomial algebra over a subalgebra
      * decomposeMonomialAlgebra, --
        Decomposition of one monomial algebra over a subalgebra
      * degreeMA -- Degree of a monomial algebra.
      * findGeneratorsOfSubalgebra -- Find
        submonoid corresponding to the convex hull.
      * findMonomialSubalgebra -- Find monomial
        subalgebra corresponding to the convex hull.
      * homogenizeSemigroup -- Homogenize
        generators of a semigroup.
      * isBuchsbaumMA -- Test whether a simplicial
        monomial algebra is Buchsbaum.
      * isCohenMacaulayMA -- Test whether a
        simplicial monomial algebra is Cohen-Macaulay.
      * isGorensteinMA -- Test whether a simplicial
        monomial algebra is Gorenstein.
      * isNormalMA -- Test whether a simplicial monomial
        algebra is normal.
      * isSeminormalMA -- Test whether a simplicial
        monomial algebra is seminormal.
      * isSimplicialMA -- Test whether a monomial
        algebra is simplicial.
      * monomialAlgebra -- Create a monomial algebra
      * randomMonomialAlgebra -- Generate random
        monomial algebra.
      * randomSemigroup -- Generate random semigroups.
      * regularityMA -- Compute regularity from
        decomposition
  * Methods
      * "adjoinPurePowers(List)" -- see adjoinPurePowers,
        -- adjoin semigroup elements corresponding to pure
        powers of variables
      * "affineAlgebra(List)" -- see affineAlgebra, --
        Define a monomial algebra
      * "affineAlgebra(MonomialAlgebra)" -- see affineAlgebra,
        -- Define a monomial algebra
      * "affineAlgebra(PolynomialRing)" -- see affineAlgebra,
        -- Define a monomial algebra
      * "binomialIdeal(List)" -- see binomialIdeal, --
        Compute the ideal of a monomial algebra
      * "binomialIdeal(MonomialAlgebra)" -- see binomialIdeal,
        -- Compute the ideal of a monomial algebra
      * "binomialIdeal(PolynomialRing)" -- see binomialIdeal,
        -- Compute the ideal of a monomial algebra
      * "codimMA(List)" -- see codimMA, -- Codimension of a
        monomial algebra.
      * "codimMA(MonomialAlgebra)" -- see codimMA, --
        Codimension of a monomial algebra.
      * "codimMA(PolynomialRing)" -- see codimMA, -- Codimension
        of a monomial algebra.
      * "decomposeHomogeneousMA(List)" -- see decomposeHomogeneousMA,
        -- Decomposition of one monomial algebra over a
        subalgebra
      * "decomposeHomogeneousMA(MonomialAlgebra)" -- see
        decomposeHomogeneousMA, -- Decomposition of one
        monomial algebra over a subalgebra
      * "decomposeHomogeneousMA(PolynomialRing)" -- see
        decomposeHomogeneousMA, -- Decomposition of one
        monomial algebra over a subalgebra
      * "decomposeHomogeneousMA(RingMap)" -- see decomposeHomogeneousMA,
        -- Decomposition of one monomial algebra over a
        subalgebra
      * "decomposeMonomialAlgebra(List)" -- see decomposeMonomialAlgebra,
        -- Decomposition of one monomial algebra over
        a subalgebra
      * "decomposeMonomialAlgebra(List,List)" -- see
        decomposeMonomialAlgebra, -- Decomposition of
        one monomial algebra over a subalgebra
      * "decomposeMonomialAlgebra(MonomialAlgebra)" -- see
        decomposeMonomialAlgebra, -- Decomposition of
        one monomial algebra over a subalgebra
      * "decomposeMonomialAlgebra(PolynomialRing)" -- see
        decomposeMonomialAlgebra, -- Decomposition of
        one monomial algebra over a subalgebra
      * "decomposeMonomialAlgebra(RingMap)" -- see
        decomposeMonomialAlgebra, -- Decomposition of
        one monomial algebra over a subalgebra
      * "degreeMA(List)" -- see degreeMA, -- Degree of a
        monomial algebra.
      * "degreeMA(MonomialAlgebra)" -- see degreeMA, -- Degree
        of a monomial algebra.
      * "degreeMA(PolynomialRing)" -- see degreeMA, -- Degree
        of a monomial algebra.
      * degrees(MonomialAlgebra), --
        Generators of the degree monoid
      * "findGeneratorsOfSubalgebra(List)" -- see
        findGeneratorsOfSubalgebra, -- Find
        submonoid corresponding to the convex hull.
      * "findMonomialSubalgebra(MonomialAlgebra)" -- see
        findMonomialSubalgebra, -- Find monomial
        subalgebra corresponding to the convex hull.
      * "findMonomialSubalgebra(PolynomialRing)" -- see
        findMonomialSubalgebra, -- Find monomial
        subalgebra corresponding to the convex hull.
      * "homogenizeSemigroup(List)" -- see homogenizeSemigroup,
        -- Homogenize generators of a semigroup.
      * "isBuchsbaumMA(List)" -- see isBuchsbaumMA, --
        Test whether a simplicial monomial algebra is Buchsbaum.
      * "isBuchsbaumMA(MonomialAlgebra)" -- see isBuchsbaumMA,
        -- Test whether a simplicial monomial algebra is
        Buchsbaum.
      * "isBuchsbaumMA(PolynomialRing)" -- see isBuchsbaumMA,
        -- Test whether a simplicial monomial algebra is
        Buchsbaum.
      * "isCohenMacaulayMA(List)" -- see isCohenMacaulayMA,
        -- Test whether a simplicial monomial algebra is
        Cohen-Macaulay.
      * "isCohenMacaulayMA(MonomialAlgebra)" -- see isCohenMacaulayMA,
        -- Test whether a simplicial monomial algebra is
        Cohen-Macaulay.
      * "isCohenMacaulayMA(PolynomialRing)" -- see isCohenMacaulayMA,
        -- Test whether a simplicial monomial algebra is
        Cohen-Macaulay.
      * "isGorensteinMA(List)" -- see isGorensteinMA, --
        Test whether a simplicial monomial algebra is Gorenstein.
      * "isGorensteinMA(MonomialAlgebra)" -- see isGorensteinMA,
        -- Test whether a simplicial monomial algebra is
        Gorenstein.
      * "isGorensteinMA(PolynomialRing)" -- see isGorensteinMA,
        -- Test whether a simplicial monomial algebra is
        Gorenstein.
      * "isNormalMA(List)" -- see isNormalMA, -- Test whether
        a simplicial monomial algebra is normal.
      * "isNormalMA(MonomialAlgebra)" -- see isNormalMA, --
        Test whether a simplicial monomial algebra is normal.
      * "isNormalMA(PolynomialRing)" -- see isNormalMA, --
        Test whether a simplicial monomial algebra is normal.
      * "isSeminormalMA(List)" -- see isSeminormalMA, --
        Test whether a simplicial monomial algebra is seminormal.
      * "isSeminormalMA(MonomialAlgebra)" -- see isSeminormalMA,
        -- Test whether a simplicial monomial algebra is
        seminormal.
      * "isSeminormalMA(PolynomialRing)" -- see isSeminormalMA,
        -- Test whether a simplicial monomial algebra is
        seminormal.
      * "isSimplicialMA(List)" -- see isSimplicialMA, --
        Test whether a monomial algebra is simplicial.
      * "isSimplicialMA(MonomialAlgebra)" -- see isSimplicialMA,
        -- Test whether a monomial algebra is simplicial.
      * "isSimplicialMA(PolynomialRing)" -- see isSimplicialMA,
        -- Test whether a monomial algebra is simplicial.
      * "monomialAlgebra(List)" -- see monomialAlgebra,
        -- Create a monomial algebra
      * "monomialAlgebra(PolynomialRing)" -- see monomialAlgebra,
        -- Create a monomial algebra
      * net(MonomialAlgebra) -- Pretty print
        for monomial algebras
      * "randomMonomialAlgebra(ZZ,ZZ,ZZ)" -- see randomMonomialAlgebra,
        -- Generate random monomial algebra.
      * "randomSemigroup(ZZ,ZZ,ZZ)" -- see randomSemigroup,
        -- Generate random semigroups.
      * "regularityMA(List)" -- see regularityMA, --
        Compute regularity from decomposition
      * "regularityMA(MonomialAlgebra)" -- see regularityMA,
        -- Compute regularity from decomposition
      * "regularityMA(PolynomialRing)" -- see regularityMA,
        -- Compute regularity from decomposition
      * ring(MonomialAlgebra) -- Multigraded
        polynomial ring associated to a monomial algebra
  * Symbols
      * CoefficientField -- Option to set the
        coefficient field.
      * Decomposition -- Optional argument of
        regularityMA to specify the decomposition.
      * Num -- Option of randomSemigroup and randomMonomialAlgebra
        to return a list of several semigroups.
      * ReturnMingens -- Option to return the minimal
        generating set B_A of K[B] as K[A]-module.
      * SetSeed -- Option to set the random seed for
        randomSemigroup and randomMonomialAlgebra.
      * Simplicial -- Option of randomSemigroup and
        randomMonomialAlgebra to return a simplicial semigroup.

For the programmer
==================

The object MonomialAlgebras, is a package (Macaulay2Doc).

adjoinPurePowers -- adjoin semigroup elements corresponding to pure powers of variables
***************************************************************************************

Synopsis
========

  * Usage:
        adjoinPurePowers A
  * Inputs:
      * A, a list (Macaulay2Doc), of lists of ZZ, containing
        generators of A, all of the same degree d.
  * Outputs:
      * a list (Macaulay2Doc), of lists of ZZ. Same as A, but with
        elements of the form (d,0...), (0,d,0...)... prepended.

Description
===========

Used to simplify the input of complicated homogeneous monoids.

+-------------------------------------+
|i1 : A = {{1,4}, {2,3}}              |
|                                     |
|o1 = {{1, 4}, {2, 3}}                |
|                                     |
|o1 : List                            |
+-------------------------------------+
|i2 : adjoinPurePowers A              |
|                                     |
|o2 = {{5, 0}, {0, 5}, {1, 4}, {2, 3}}|
|                                     |
|o2 : List                            |
+-------------------------------------+

Ways to use adjoinPurePowers:
=============================

  * "adjoinPurePowers(List)"

For the programmer
==================

The object adjoinPurePowers, is a method function (Macaulay2Doc).

affineAlgebra -- Define a monomial algebra
******************************************

Synopsis
========

  * Usage:
        affineAlgebra P
        affineAlgebra B
  * Inputs:
      * P, a polynomial ring (Macaulay2Doc), multigraded,
        with B = See degrees (Macaulay2Doc), R and K = See
        coefficientRing (Macaulay2Doc), R, or
      * B, a list (Macaulay2Doc), In the case B is specified, K is
        set via the Option (Macaulay2Doc), CoefficientField.
  * Optional inputs (Macaulay2Doc),:
      * CoefficientField, => ..., default value ZZ/101,
        Option to set the coefficient field.
  * Outputs:
      * a ring (Macaulay2Doc),

Description
===========

Returns the monomial algebra K[B]=P/see binomialIdeal,(P)
associated to the degree monoid of the polynomial ring P.

+------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                    |
|                                                                  |
|o1 = kk                                                           |
|                                                                  |
|o1 : QuotientRing                                                 |
+------------------------------------------------------------------+
|i2 : B = {{1,2},{3,0},{0,4},{0,5}}                                |
|                                                                  |
|o2 = {{1, 2}, {3, 0}, {0, 4}, {0, 5}}                             |
|                                                                  |
|o2 : List                                                         |
+------------------------------------------------------------------+
|i3 : S = kk[x_0..x_3, Degrees=> B]                                |
|                                                                  |
|o3 = S                                                            |
|                                                                  |
|o3 : PolynomialRing                                               |
+------------------------------------------------------------------+
|i4 : affineAlgebra S                                              |
|                                                                  |
|                            S                                     |
|o4 = ----------------------------------------------               |
|       3        2   6    2 3     4    3 2   5    4                |
|     (x x  - x x , x  - x x , x x  - x x , x  - x )               |
|       0 2    1 3   0    1 2   1 2    0 3   2    3                |
|                                                                  |
|o4 : QuotientRing                                                 |
+------------------------------------------------------------------+
|i5 : affineAlgebra B                                              |
|                                                                  |
|                       kk[x ..x ]                                 |
|                           0   3                                  |
|o5 = ----------------------------------------------               |
|       3        2   6    2 3     4    3 2   5    4                |
|     (x x  - x x , x  - x x , x x  - x x , x  - x )               |
|       0 2    1 3   0    1 2   1 2    0 3   2    3                |
|                                                                  |
|o5 : QuotientRing                                                 |
+------------------------------------------------------------------+
|i6 : M = monomialAlgebra B                                        |
|                                                                  |
|o6 = kk[x ..x ]                                                   |
|         0   3                                                    |
|                                                                  |
|o6 : MonomialAlgebra generated by {{1, 2}, {3, 0}, {0, 4}, {0, 5}}|
+------------------------------------------------------------------+
|i7 : affineAlgebra M                                              |
|                                                                  |
|                       kk[x ..x ]                                 |
|                           0   3                                  |
|o7 = ----------------------------------------------               |
|       3        2   6    2 3     4    3 2   5    4                |
|     (x x  - x x , x  - x x , x x  - x x , x  - x )               |
|       0 2    1 3   0    1 2   1 2    0 3   2    3                |
|                                                                  |
|o7 : QuotientRing                                                 |
+------------------------------------------------------------------+

Ways to use affineAlgebra:
==========================

  * "affineAlgebra(List)"
  * "affineAlgebra(MonomialAlgebra)"
  * "affineAlgebra(PolynomialRing)"

For the programmer
==================

The object affineAlgebra, is a method function with options (Macaulay2Doc).

binomialIdeal -- Compute the ideal of a monomial algebra
********************************************************

Synopsis
========

  * Usage:
        binomialIdeal P
        binomialIdeal B
        binomialIdeal M
  * Inputs:
      * P, a polynomial ring (Macaulay2Doc), multigraded,
        with B = See degrees (Macaulay2Doc), R and K = See
        coefficientRing (Macaulay2Doc), R, or
      * B, a list (Macaulay2Doc), In the case B is specified, K is
        set via the Option (Macaulay2Doc), CoefficientField.
      * M, a MonomialAlgebra,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientField, => ..., default value ZZ/101,
        Option to set the coefficient field.
  * Outputs:
      * an ideal (Macaulay2Doc),

Description
===========

Returns the toric ideal associated to the degree monoid B of the polynomial
ring P as an ideal of P.

+------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                    |
|                                                                  |
|o1 = kk                                                           |
|                                                                  |
|o1 : QuotientRing                                                 |
+------------------------------------------------------------------+
|i2 : B = {{1,2},{3,0},{0,4},{0,5}}                                |
|                                                                  |
|o2 = {{1, 2}, {3, 0}, {0, 4}, {0, 5}}                             |
|                                                                  |
|o2 : List                                                         |
+------------------------------------------------------------------+
|i3 : S = kk[x_0..x_3, Degrees=> B]                                |
|                                                                  |
|o3 = S                                                            |
|                                                                  |
|o3 : PolynomialRing                                               |
+------------------------------------------------------------------+
|i4 : binomialIdeal S                                              |
|                                                                  |
|             3        2   6    2 3     4    3 2   5    4          |
|o4 = ideal (x x  - x x , x  - x x , x x  - x x , x  - x )         |
|             0 2    1 3   0    1 2   1 2    0 3   2    3          |
|                                                                  |
|o4 : Ideal of S                                                   |
+------------------------------------------------------------------+
|i5 : C = {{1,2},{0,5}}                                            |
|                                                                  |
|o5 = {{1, 2}, {0, 5}}                                             |
|                                                                  |
|o5 : List                                                         |
+------------------------------------------------------------------+
|i6 : P = kk[y_0,y_1, Degrees=> C]                                 |
|                                                                  |
|o6 = P                                                            |
|                                                                  |
|o6 : PolynomialRing                                               |
+------------------------------------------------------------------+
|i7 : binomialIdeal P                                              |
|                                                                  |
|o7 = ideal ()                                                     |
|                                                                  |
|o7 : Ideal of P                                                   |
+------------------------------------------------------------------+
|i8 : M = monomialAlgebra B                                        |
|                                                                  |
|o8 = kk[x ..x ]                                                   |
|         0   3                                                    |
|                                                                  |
|o8 : MonomialAlgebra generated by {{1, 2}, {3, 0}, {0, 4}, {0, 5}}|
+------------------------------------------------------------------+
|i9 : binomialIdeal M                                              |
|                                                                  |
|             3        2   6    2 3     4    3 2   5    4          |
|o9 = ideal (x x  - x x , x  - x x , x x  - x x , x  - x )         |
|             0 2    1 3   0    1 2   1 2    0 3   2    3          |
|                                                                  |
|o9 : Ideal of kk[x ..x ]                                          |
|                  0   3                                           |
+------------------------------------------------------------------+

Ways to use binomialIdeal:
==========================

  * "binomialIdeal(List)"
  * "binomialIdeal(MonomialAlgebra)"
  * "binomialIdeal(PolynomialRing)"

For the programmer
==================

The object binomialIdeal, is a method function with options (Macaulay2Doc).

codimMA -- Codimension of a monomial algebra.
*********************************************

Synopsis
========

  * Usage:
        codimMA R
        codimMA B
        codimMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * an integer (Macaulay2Doc),

Description
===========

Compute the codimension of the homogeneous monomial algebra K[B].

As the result is independent of K it is possible to specify just B.

+-----------------------------------------------------------------------------+
|i1 : B={{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,|
|                                                                             |
|o1 = {{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,  |
|     ------------------------------------------------------------------------|
|     3, 1}}                                                                  |
|                                                                             |
|o1 : List                                                                    |
|-----------------------------------------------------------------------------|
|3, 1}}                                                                       |
+-----------------------------------------------------------------------------+
|i2 : codimMA B                                                               |
|                                                                             |
|o2 = 4                                                                       |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i3 : B={{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,|
|                                                                             |
|o3 = {{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,  |
|     ------------------------------------------------------------------------|
|     3, 1}}                                                                  |
|                                                                             |
|o3 : List                                                                    |
|-----------------------------------------------------------------------------|
|3, 1}}                                                                       |
+-----------------------------------------------------------------------------+
|i4 : M=monomialAlgebra B                                                     |
|                                                                             |
|      ZZ                                                                     |
|o4 = ---[x ..x ]                                                             |
|     101  0   6                                                              |
|                                                                             |
|o4 : MonomialAlgebra generated by {{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0,   |
|-----------------------------------------------------------------------------|
|3}, {1, 4, 0}, {2, 3, 0}, {1, 3, 1}}                                         |
+-----------------------------------------------------------------------------+
|i5 : codimMA M                                                               |
|                                                                             |
|o5 = 4                                                                       |
+-----------------------------------------------------------------------------+

Ways to use codimMA:
====================

  * "codimMA(List)"
  * "codimMA(MonomialAlgebra)"
  * "codimMA(PolynomialRing)"

For the programmer
==================

The object codimMA, is a method function (Macaulay2Doc).

CoefficientField -- Option to set the coefficient field.
********************************************************

Description
===========

This option can be used to set the coefficient field of the polynomial rings
created by decomposeMonomialAlgebra,
decomposeHomogeneousMA,  monomialAlgebra.

The standard option is ZZ (Macaulay2Doc),/101.

Functions with optional argument named CoefficientField:
========================================================

  * "affineAlgebra(...,CoefficientField=>...)"
  * "binomialIdeal(...,CoefficientField=>...)"
  * "decomposeHomogeneousMA(...,CoefficientField=>...)"
  * "decomposeMonomialAlgebra(...,CoefficientField=>...)"
  * "monomialAlgebra(...,CoefficientField=>...)"
  * "regularityMA(...,CoefficientField=>...)"

For the programmer
==================

The object CoefficientField, is a symbol (Macaulay2Doc).

decomposeHomogeneousMA -- Decomposition of one monomial algebra over a subalgebra
*********************************************************************************

Synopsis
========

  * Usage:
        decomposeHomogeneousMA f
        decomposeHomogeneousMA R
        decomposeHomogeneousMA B
        decomposeHomogeneousMA M
  * Inputs:
      * f, a ring map (Macaulay2Doc), between multigraded
        polynomial rings such that the degree monoids are homogeneous and the
        degrees are minimal generating sets of the degree monoids, or
      * R, a polynomial ring (Macaulay2Doc), multigraded,
        with homogeneous degree monoid, such that B = See degrees (Macaulay2Doc),
        R are minimal generators of the degree monoid,
        and set K = See coefficientRing (Macaulay2Doc), R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d. In the case B is specified, K is set via the
        Option (Macaulay2Doc), CoefficientField.
        If a list of positive integers is given, the
        function uses adjoinPurePowers, and
        homogenizeSemigroup, to convert it into a list of
        elements of \mathbb{N}^2.
      * M, a MonomialAlgebra,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientField, => ..., default value ZZ/101,
        Option to set the coefficient field.
      * ReturnMingens, => ..., default value false, Option
        to return the minimal generating set B_A of K[B] as K[A]-module.
      * Verbose,
        => ..., default value 0, Option to print intermediate results.
  * Outputs:
      * a hash table (Macaulay2Doc), with the following data:
        Let B be the degree monoid of the target (Macaulay2Doc),
        of f and analogously A for the source (Macaulay2Doc). The
        keys (Macaulay2Doc), are representatives of congruence
        classes in G(B) / G(A). The value associated to a key k is a tuple
        whose first component is a monomial ideal of K[A] isomorphic to the
        K[A]-submodule of K[B] consisting of elements in the class k, and whose
        second component is an element of ZZ (Macaulay2Doc), that is
        the twist between the ideal and the submodule of K[B] with respect to
        the standard grading (which gives the minimal generators degree 1).

Description
===========

Let K[B] be the monomial algebra of the degree monoid of the target (Macaulay2Doc),
of f and let analogously K[A] for source (Macaulay2Doc),
of f. Assume that K[B] is finite as a K[A]-module.

The monomial algebra K[B] is decomposed as a direct sum of monomial ideals in
K[A] with twists in ZZ.

If B or R with degrees B is specified then A is computed via
findGeneratorsOfSubalgebra.

Note that the shift chosen by the function depends on the monomial ordering of
K[A] (in the non-simplicial case).

+--------------------------------------------+
|i1 : B = {{4,0},{3,1},{1,3},{0,4}}          |
|                                            |
|o1 = {{4, 0}, {3, 1}, {1, 3}, {0, 4}}       |
|                                            |
|o1 : List                                   |
+--------------------------------------------+
|i2 : S = ZZ/101[x_0..x_(#B-1), Degrees=>B]; |
+--------------------------------------------+
|i3 : decomposeHomogeneousMA S               |
|                                            |
|o3 = HashTable{| -1 | => {ideal 1, 1}      }|
|               | 1  |                       |
|               0 => {ideal 1, 0}            |
|               | 1  | => {ideal 1, 1}       |
|               | -1 |                       |
|               | 2 | => {ideal (x , x ), 1} |
|               | 2 |             0   3      |
|                                            |
|o3 : HashTable                              |
+--------------------------------------------+
|i4 : decomposeHomogeneousMA B               |
|                                            |
|o4 = HashTable{| -1 | => {ideal 1, 1}      }|
|               | 1  |                       |
|               0 => {ideal 1, 0}            |
|               | 1  | => {ideal 1, 1}       |
|               | -1 |                       |
|               | 2 | => {ideal (x , x ), 1} |
|               | 2 |             0   3      |
|                                            |
|o4 : HashTable                              |
+--------------------------------------------+

+-----------------------------------------------------------------------------+
|i5 : decomposeHomogeneousMA {{2,0,1},{0,2,1},{1,1,1},{2,2,1},{2,1,1},{1,4,1}}|
|                                                                             |
|                                 2                                           |
|o5 = HashTable{0 => {ideal (x , x x ), -1}    }                              |
|                             3   0 5                                         |
|                                       2                                     |
|               | 0 | => {ideal (x x , x ), -1}                               |
|               | 1 |             0 5   3                                     |
|               | 0 |                                                         |
|                                                                             |
|o5 : HashTable                                                               |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i6 : M = monomialAlgebra {{2,0,1},{0,2,1},{1,1,1},{2,2,1},{2,1,1},{1,4,1}}   |
|                                                                             |
|      ZZ                                                                     |
|o6 = ---[x ..x ]                                                             |
|     101  0   5                                                              |
|                                                                             |
|o6 : MonomialAlgebra generated by {{2, 0, 1}, {0, 2, 1}, {1, 1, 1}, {2, 2,   |
|-----------------------------------------------------------------------------|
|1}, {2, 1, 1}, {1, 4, 1}}                                                    |
+-----------------------------------------------------------------------------+
|i7 : decomposeHomogeneousMA M                                                |
|                                                                             |
|                                 2                                           |
|o7 = HashTable{0 => {ideal (x , x x ), -1}    }                              |
|                             3   0 5                                         |
|                                       2                                     |
|               | 0 | => {ideal (x x , x ), -1}                               |
|               | 1 |             0 5   3                                     |
|               | 0 |                                                         |
|                                                                             |
|o7 : HashTable                                                               |
+-----------------------------------------------------------------------------+

Ways to use decomposeHomogeneousMA:
===================================

  * "decomposeHomogeneousMA(List)"
  * "decomposeHomogeneousMA(MonomialAlgebra)"
  * "decomposeHomogeneousMA(PolynomialRing)"
  * "decomposeHomogeneousMA(RingMap)"

For the programmer
==================

The object decomposeHomogeneousMA, is a
method function with options (Macaulay2Doc).

decomposeHomogeneousMA(...,Verbose=>...) -- Option to print intermediate results.
*********************************************************************************

Description
===========

Option to print intermediate results. The standard value is 0 (= do not print).

Further information
===================

  * Default value: 0
  * Function: decomposeHomogeneousMA, --
    Decomposition of one monomial algebra over a subalgebra
  * Option key: Verbose (Macaulay2Doc), -- request verbose
    feedback

Functions with optional argument named Verbose:
===============================================

  * "check(...,Verbose=>...)" -- see check (Macaulay2Doc), --
    perform tests of a package
  * "checkDegrees(...,Verbose=>...)" -- see checkDegrees (Isomorphism),
    -- compares the degrees of generators of two
    modules
  * "copyDirectory(...,Verbose=>...)" -- see
    copyDirectory(String,String) (Macaulay2Doc),
  * "copyFile(...,Verbose=>...)" -- see copyFile(String,String) (Macaulay2Doc),
  * decomposeHomogeneousMA(...,Verbose=>...)
    -- Option to
    print intermediate results.
  * decomposeMonomialAlgebra(...,Verbose=>...)
    -- Option to
    print intermediate results.
  * degreeMA(...,Verbose=>...)
    -- Option to print
    intermediate results.
  * "findProgram(...,Verbose=>...)" -- see findProgram (Macaulay2Doc),
    -- load external program
  * "installPackage(...,Verbose=>...)" -- see installPackage (Macaulay2Doc),
    -- load and install a package and its
    documentation
  * "isIsomorphic(...,Verbose=>...)" -- see isIsomorphic (Isomorphism),
    -- Probabilistic test for isomorphism of modules
  * "moveFile(...,Verbose=>...)" -- see moveFile(String,String) (Macaulay2Doc),
  * "runProgram(...,Verbose=>...)" -- see runProgram (Macaulay2Doc),
    -- run an external program
  * "symlinkDirectory(...,Verbose=>...)" -- see
    symlinkDirectory(String,String) (Macaulay2Doc),
    -- make symbolic links
    for all files in a directory tree

decomposeMonomialAlgebra -- Decomposition of one monomial algebra over a subalgebra
***********************************************************************************

Synopsis
========

  * Usage:
        decomposeMonomialAlgebra f
        decomposeMonomialAlgebra R
        decomposeMonomialAlgebra B
        decomposeMonomialAlgebra(B,A)
        decomposeMonomialAlgebra M
  * Inputs:
      * f, a ring map (Macaulay2Doc), between multigraded
        polynomial rings, or
      * R, a polynomial ring (Macaulay2Doc), multigraded,
        with B = See degrees (Macaulay2Doc), R and K = See
        coefficientRing (Macaulay2Doc), R, or
      * B, a list (Macaulay2Doc), In the case B is specified, K is
        set via the Option (Macaulay2Doc), CoefficientField.
        If a list of positive integers is given, the
        function uses adjoinPurePowers, and
        homogenizeSemigroup, to convert it into a list of
        elements of \mathbb{N}^2.
      * A, a list (Macaulay2Doc), of elements of B, such that K[B]
        is finite as a K[A]-module. If A is specified, the function chooses the
        canonical map f from the A-graded to the B-graded polynomial ring.
      * M, a MonomialAlgebra,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientField, => ..., default value ZZ/101,
        Option to set the coefficient field.
      * ReturnMingens, => ..., default value false, Option
        to return the minimal generating set B_A of K[B] as K[A]-module.
      * Verbose,
        => ..., default value 0, Option to print intermediate results.
  * Outputs:
      * a hash table (Macaulay2Doc), with the following data:
        Let B be the degree monoid of the target (Macaulay2Doc),
        of f and analogously A for the source (Macaulay2Doc). The
        keys (Macaulay2Doc), are representatives of congruence
        classes in G(B) / G(A). The value associated to a key k is a tuple
        whose first component is an ideal of K[A] isomorphic to the
        K[A]-submodule of K[B] consisting of elements in the class k, and whose
        second component is an element of G(B) that is the translation vector
        between the weights of the generators of the ideal and those of the
        submodule of K[B].

Description
===========

Let K[B] be the monomial algebra of the degree monoid of the target (Macaulay2Doc),
of f and analogously K[A] for source (Macaulay2Doc),
of f. Assume that K[B] is finite as a K[A]-module.

The monomial algebra K[B] is decomposed as a direct sum of monomial ideals in
K[A] with twists in G(B).

If R with degrees B is specified then A is computed via
findGeneratorsOfSubalgebra.

Note that the shift chosen by the function depends on the monomial ordering of
K[A] (in the non-simplicial case).

+-----------------------------------------------------------------------------+
|i1 : B = {{4,2},{10,6},{3,7},{3,6}}                                          |
|                                                                             |
|o1 = {{4, 2}, {10, 6}, {3, 7}, {3, 6}}                                       |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : A = {{4,2},{10,6},{3,7}}                                                |
|                                                                             |
|o2 = {{4, 2}, {10, 6}, {3, 7}}                                               |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : S = ZZ/101[x_0..x_(#B-1), Degrees=>B];                                  |
+-----------------------------------------------------------------------------+
|i4 : P = ZZ/101[x_0..x_(#A-1), Degrees=>A];                                  |
+-----------------------------------------------------------------------------+
|i5 : f = map(S,P)                                                            |
|                                                                             |
|o5 = map (S, P, {x , x , x })                                                |
|                  0   1   2                                                  |
|                                                                             |
|o5 : RingMap S <-- P                                                         |
+-----------------------------------------------------------------------------+
|i6 : decomposeMonomialAlgebra f                                              |
|                                                                             |
|                             210   189 9   194 7 2   199 5 4   204 3 6   209 |
|o6 = HashTable{0 => {ideal (x   , x   x , x   x x , x   x x , x   x x , x   x|
|                             0     0   1   0   1 2   0   1 2   0   1 2   0   |
|                                 210   189 9   194 7 2   199 5 4   204 3 6   |
|               | 1 | => {ideal (x   , x   x , x   x x , x   x x , x   x x , x|
|               | 0 |             0     0   1   0   1 2   0   1 2   0   1 2   |
|                                                                             |
|o6 : HashTable                                                               |
|-----------------------------------------------------------------------------|
|  8   188 10 8   193 8 10   198 6 12   203 4 14   208 2 16                   |
| x , x   x  x , x   x x  , x   x x  , x   x x  , x   x x  ), | -840 |}    }  |
|1 2   0   1  2   0   1 2    0   1 2    0   1 2    0   1 2    | -420 |        |
|209   8   188 10 8   193 8 10   198 6 12   203 4 14   208 2 16               |
|   x x , x   x  x , x   x x  , x   x x  , x   x x  , x   x x  ), | -837 |}   |
|0   1 2   0   1  2   0   1 2    0   1 2    0   1 2    0   1 2    | -414 |    |
+-----------------------------------------------------------------------------+

Decomposition over a polynomial ring

+-----------------------------------------------------------+
|i7 : B = {{4,2},{3,7},{10,6},{3,6}}                        |
|                                                           |
|o7 = {{4, 2}, {3, 7}, {10, 6}, {3, 6}}                     |
|                                                           |
|o7 : List                                                  |
+-----------------------------------------------------------+
|i8 : A = {{4,2},{3,7}}                                     |
|                                                           |
|o8 = {{4, 2}, {3, 7}}                                      |
|                                                           |
|o8 : List                                                  |
+-----------------------------------------------------------+
|i9 : S = ZZ/101[x_0..x_(#B-1), Degrees=>B];                |
+-----------------------------------------------------------+
|i10 : P = ZZ/101[x_0..x_(#A-1), Degrees=>A];               |
+-----------------------------------------------------------+
|i11 : f = map(S,P)                                         |
|                                                           |
|o11 = map (S, P, {x , x })                                 |
|                   0   1                                   |
|                                                           |
|o11 : RingMap S <-- P                                      |
+-----------------------------------------------------------+
|i12 : decomposeMonomialAlgebra f                           |
|                                                           |
|                                   16   2                  |
|o12 = HashTable{| -1 | => {ideal (x  , x ), | 9  |}       }|
|                | 0  |             0    1   | 16 |         |
|                                       8                   |
|                | -2 | => {ideal (x , x ), | 6 |}          |
|                | 0  |             0   1   | 4 |           |
|                                   17     2   10           |
|                | -3 | => {ideal (x  , x x , x  ), | 15 |} |
|                | 0  |             0    0 1   1    | 20 |  |
|                                   2     8   16            |
|                | -4 | => {ideal (x , x x , x  ), | 12 |}  |
|                | 0  |             0   0 1   1    | 8  |   |
|                | -5 | => {ideal 1, | 9  |}                |
|                | 0  |              | 18 |                 |
|                                   6   6                   |
|                | -6 | => {ideal (x , x ), | 6 |}          |
|                | 0  |             0   1   | 6 |           |
|                                       8                   |
|                | -7 | => {ideal (x , x ), | 15 |}         |
|                | 0  |             0   1   | 22 |          |
|                                   7     6   14            |
|                | -8 | => {ideal (x , x x , x  ), | 12 |}  |
|                | 0  |             0   0 1   1    | 10 |   |
|                | -9 | => {ideal 1, | 3 |}                 |
|                | 0  |              | 6 |                  |
|                                    11   4                 |
|                | -10 | => {ideal (x  , x ), | 6 |}        |
|                | 0   |             0    1   | 8 |         |
|                0 => {ideal 1, 0}                          |
|                                  12     4   12            |
|                | 1 | => {ideal (x  , x x , x  ), | 15 |}  |
|                | 0 |             0    0 1   1    | 18 |   |
|                                      8                    |
|                | 2 | => {ideal (x , x ), | 12 |}          |
|                | 0 |             0   1   | 16 |           |
|                                  11   4                   |
|                | 3 | => {ideal (x  , x ), | 9  |}         |
|                | 0 |             0    1   | 14 |          |
|                | 4 | => {ideal 1, | 6  |}                 |
|                | 0 |              | 12 |                  |
|                                  7     6   14             |
|                | 5 | => {ideal (x , x x , x  ), | 15 |}   |
|                | 0 |             0   0 1   1    | 16 |    |
|                                  17     2   10            |
|                | 6 | => {ideal (x  , x x , x  ), | 12 |}  |
|                | 0 |             0    0 1   1    | 14 |   |
|                                  6   6                    |
|                | 7 | => {ideal (x , x ), | 9  |}          |
|                | 0 |             0   1   | 12 |           |
|                                  16   2                   |
|                | 8 | => {ideal (x  , x ), | 6  |}         |
|                | 0 |             0    1   | 10 |          |
|                                  2     8   16             |
|                | 9 | => {ideal (x , x x , x  ), | 15 |}   |
|                | 0 |             0   0 1   1    | 14 |    |
|                                   12     4   12           |
|                | 10 | => {ideal (x  , x x , x  ), | 12 |} |
|                | 0  |             0    0 1   1    | 12 |  |
|                                       8                   |
|                | 11 | => {ideal (x , x ), | 9  |}         |
|                | 0  |             0   1   | 10 |          |
|                                                           |
|o12 : HashTable                                            |
+-----------------------------------------------------------+

Specifying R:

+-----------------------------------------------------------+
|i13 : B = {{4,2},{10,6},{3,7},{3,6}}                       |
|                                                           |
|o13 = {{4, 2}, {10, 6}, {3, 7}, {3, 6}}                    |
|                                                           |
|o13 : List                                                 |
+-----------------------------------------------------------+
|i14 : S = ZZ/101[x_0..x_(#B-1), Degrees=>B];               |
+-----------------------------------------------------------+
|i15 : decomposeMonomialAlgebra S                           |
|                                                           |
|                                   16   2                  |
|o15 = HashTable{| -1 | => {ideal (x  , x ), | 9  |}       }|
|                | 0  |             0    2   | 16 |         |
|                                       8                   |
|                | -2 | => {ideal (x , x ), | 6 |}          |
|                | 0  |             0   2   | 4 |           |
|                                   17     2   10           |
|                | -3 | => {ideal (x  , x x , x  ), | 15 |} |
|                | 0  |             0    0 2   2    | 20 |  |
|                                   2     8   16            |
|                | -4 | => {ideal (x , x x , x  ), | 12 |}  |
|                | 0  |             0   0 2   2    | 8  |   |
|                | -5 | => {ideal 1, | 9  |}                |
|                | 0  |              | 18 |                 |
|                                   6   6                   |
|                | -6 | => {ideal (x , x ), | 6 |}          |
|                | 0  |             0   2   | 6 |           |
|                                       8                   |
|                | -7 | => {ideal (x , x ), | 15 |}         |
|                | 0  |             0   2   | 22 |          |
|                                   7     6   14            |
|                | -8 | => {ideal (x , x x , x  ), | 12 |}  |
|                | 0  |             0   0 2   2    | 10 |   |
|                | -9 | => {ideal 1, | 3 |}                 |
|                | 0  |              | 6 |                  |
|                                    11   4                 |
|                | -10 | => {ideal (x  , x ), | 6 |}        |
|                | 0   |             0    2   | 8 |         |
|                0 => {ideal 1, 0}                          |
|                                  12     4   12            |
|                | 1 | => {ideal (x  , x x , x  ), | 15 |}  |
|                | 0 |             0    0 2   2    | 18 |   |
|                                      8                    |
|                | 2 | => {ideal (x , x ), | 12 |}          |
|                | 0 |             0   2   | 16 |           |
|                                  11   4                   |
|                | 3 | => {ideal (x  , x ), | 9  |}         |
|                | 0 |             0    2   | 14 |          |
|                | 4 | => {ideal 1, | 6  |}                 |
|                | 0 |              | 12 |                  |
|                                  7     6   14             |
|                | 5 | => {ideal (x , x x , x  ), | 15 |}   |
|                | 0 |             0   0 2   2    | 16 |    |
|                                  17     2   10            |
|                | 6 | => {ideal (x  , x x , x  ), | 12 |}  |
|                | 0 |             0    0 2   2    | 14 |   |
|                                  6   6                    |
|                | 7 | => {ideal (x , x ), | 9  |}          |
|                | 0 |             0   2   | 12 |           |
|                                  16   2                   |
|                | 8 | => {ideal (x  , x ), | 6  |}         |
|                | 0 |             0    2   | 10 |          |
|                                  2     8   16             |
|                | 9 | => {ideal (x , x x , x  ), | 15 |}   |
|                | 0 |             0   0 2   2    | 14 |    |
|                                   12     4   12           |
|                | 10 | => {ideal (x  , x x , x  ), | 12 |} |
|                | 0  |             0    0 2   2    | 12 |  |
|                                       8                   |
|                | 11 | => {ideal (x , x ), | 9  |}         |
|                | 0  |             0   2   | 10 |          |
|                                                           |
|o15 : HashTable                                            |
+-----------------------------------------------------------+

Specifying a monomial algebra:

+--------------------------------------------------------------------+
|i16 : M = monomialAlgebra {{4,2},{10,6},{3,7},{3,6}}                |
|                                                                    |
|       ZZ                                                           |
|o16 = ---[x ..x ]                                                   |
|      101  0   3                                                    |
|                                                                    |
|o16 : MonomialAlgebra generated by {{4, 2}, {10, 6}, {3, 7}, {3, 6}}|
+--------------------------------------------------------------------+
|i17 : decomposeMonomialAlgebra M                                    |
|                                                                    |
|                                   16   2                           |
|o17 = HashTable{| -1 | => {ideal (x  , x ), | 9  |}       }         |
|                | 0  |             0    2   | 16 |                  |
|                                       8                            |
|                | -2 | => {ideal (x , x ), | 6 |}                   |
|                | 0  |             0   2   | 4 |                    |
|                                   17     2   10                    |
|                | -3 | => {ideal (x  , x x , x  ), | 15 |}          |
|                | 0  |             0    0 2   2    | 20 |           |
|                                   2     8   16                     |
|                | -4 | => {ideal (x , x x , x  ), | 12 |}           |
|                | 0  |             0   0 2   2    | 8  |            |
|                | -5 | => {ideal 1, | 9  |}                         |
|                | 0  |              | 18 |                          |
|                                   6   6                            |
|                | -6 | => {ideal (x , x ), | 6 |}                   |
|                | 0  |             0   2   | 6 |                    |
|                                       8                            |
|                | -7 | => {ideal (x , x ), | 15 |}                  |
|                | 0  |             0   2   | 22 |                   |
|                                   7     6   14                     |
|                | -8 | => {ideal (x , x x , x  ), | 12 |}           |
|                | 0  |             0   0 2   2    | 10 |            |
|                | -9 | => {ideal 1, | 3 |}                          |
|                | 0  |              | 6 |                           |
|                                    11   4                          |
|                | -10 | => {ideal (x  , x ), | 6 |}                 |
|                | 0   |             0    2   | 8 |                  |
|                0 => {ideal 1, 0}                                   |
|                                  12     4   12                     |
|                | 1 | => {ideal (x  , x x , x  ), | 15 |}           |
|                | 0 |             0    0 2   2    | 18 |            |
|                                      8                             |
|                | 2 | => {ideal (x , x ), | 12 |}                   |
|                | 0 |             0   2   | 16 |                    |
|                                  11   4                            |
|                | 3 | => {ideal (x  , x ), | 9  |}                  |
|                | 0 |             0    2   | 14 |                   |
|                | 4 | => {ideal 1, | 6  |}                          |
|                | 0 |              | 12 |                           |
|                                  7     6   14                      |
|                | 5 | => {ideal (x , x x , x  ), | 15 |}            |
|                | 0 |             0   0 2   2    | 16 |             |
|                                  17     2   10                     |
|                | 6 | => {ideal (x  , x x , x  ), | 12 |}           |
|                | 0 |             0    0 2   2    | 14 |            |
|                                  6   6                             |
|                | 7 | => {ideal (x , x ), | 9  |}                   |
|                | 0 |             0   2   | 12 |                    |
|                                  16   2                            |
|                | 8 | => {ideal (x  , x ), | 6  |}                  |
|                | 0 |             0    2   | 10 |                   |
|                                  2     8   16                      |
|                | 9 | => {ideal (x , x x , x  ), | 15 |}            |
|                | 0 |             0   0 2   2    | 14 |             |
|                                   12     4   12                    |
|                | 10 | => {ideal (x  , x x , x  ), | 12 |}          |
|                | 0  |             0    0 2   2    | 12 |           |
|                                       8                            |
|                | 11 | => {ideal (x , x ), | 9  |}                  |
|                | 0  |             0   2   | 10 |                   |
|                                                                    |
|o17 : HashTable                                                     |
+--------------------------------------------------------------------+

Specifying a monomial curve by a list of positive integers:

+--------------------------------------------------------+
|i18 : decomposeMonomialAlgebra {1,4,8,9,11}             |
|                                                        |
|o18 = HashTable{| -1 | => {ideal 1, | 10 |}            }|
|                | 1  |              | 12 |              |
|                | -2 | => {ideal 1, | 9 |}              |
|                | 2  |              | 2 |               |
|                | -3 | => {ideal 1, | 8 |}              |
|                | 3  |              | 3 |               |
|                                   3                    |
|                | -4 | => {ideal (x , x ), | 7 |}       |
|                | 4  |             1   0   | 4 |        |
|                                   2                    |
|                | -5 | => {ideal (x , x ), | 6 |}       |
|                | 5  |             1   0   | 5 |        |
|                0 => {ideal 1, 0}                       |
|                | 1  | => {ideal 1, | 1  |}             |
|                | -1 |              | 10 |              |
|                | 2  | => {ideal (x , x ), | 2 |}       |
|                | -2 |             1   0   | 9 |        |
|                                   2         2          |
|                | 3  | => {ideal (x , x x , x ), | 3 |} |
|                | -3 |             1   0 1   0   | 8 |  |
|                | 4  | => {ideal 1, | 4 |}              |
|                | -4 |              | 7 |               |
|                | 5  | => {ideal (x , x ), | 5 |}       |
|                | -5 |             1   0   | 6 |        |
|                                                        |
|o18 : HashTable                                         |
+--------------------------------------------------------+

Some simpler examples:

+------------------------------------------------------------------------+
|i19 : B = adjoinPurePowers homogenizeSemigroup {{1,2},{3,0},{0,4},{0,5}}|
|                                                                        |
|o19 = {{5, 0, 0}, {0, 5, 0}, {0, 0, 5}, {1, 2, 2}, {3, 0, 2}, {0, 4, 1}}|
|                                                                        |
|o19 : List                                                              |
+------------------------------------------------------------------------+
|i20 : A = adjoinPurePowers homogenizeSemigroup {{0,5}}                  |
|                                                                        |
|o20 = {{5, 0, 0}, {0, 5, 0}, {0, 0, 5}}                                 |
|                                                                        |
|o20 : List                                                              |
+------------------------------------------------------------------------+
|i21 : S = ZZ/101[x_0..x_(#B-1), Degrees=>B];                            |
+------------------------------------------------------------------------+
|i22 : P = ZZ/101[x_0..x_(#A-1), Degrees=>A];                            |
+------------------------------------------------------------------------+
|i23 : f = map(S,P)                                                      |
|                                                                        |
|o23 = map (S, P, {x , x , x })                                          |
|                   0   1   2                                            |
|                                                                        |
|o23 : RingMap S <-- P                                                   |
+------------------------------------------------------------------------+
|i24 : decomposeMonomialAlgebra f                                        |
|                                                                        |
|                                   2                                    |
|o24 = HashTable{| -1 | => {ideal (x , x ), | 4 |}      }                |
|                | -1 |             1   0   | 4 |                        |
|                | 2  |                     | 7 |                        |
|                | -1 | => {ideal 1, | 4 |}                              |
|                | -2 |              | 8 |                               |
|                | -2 |              | 8 |                               |
|                                   2                                    |
|                | -1 | => {ideal (x , x ), | 4 |}                       |
|                | 0  |             1   0   | 0 |                        |
|                | 1  |                     | 6 |                        |
|                | -1 | => {ideal 1, | 4 |}                              |
|                | 1  |              | 6 |                               |
|                | 0  |              | 5 |                               |
|                | -1 | => {ideal 1, | 4 |}                              |
|                | 2  |              | 2 |                               |
|                | -1 |              | 4 |                               |
|                | -2 | => {ideal 1, | 3 |}                              |
|                | -1 |              | 4 |                               |
|                | -2 |              | 3 |                               |
|                | -2 | => {ideal 1, | 3 |}                              |
|                | -2 |              | 8 |                               |
|                | -1 |              | 4 |                               |
|                | -2 | => {ideal 1, | 3 |}                              |
|                | 0  |              | 0 |                               |
|                | 2  |              | 2 |                               |
|                | -2 | => {ideal 1, | 3 |}                              |
|                | 1  |              | 6 |                               |
|                | 1  |              | 6 |                               |
|                                   2     2                              |
|                | -2 | => {ideal (x x , x ), | 3 |}                     |
|                | 2  |             0 2   1   | 2 |                      |
|                | 0  |                       | 5 |                      |
|                | 0  | => {ideal 1, | 0 |}                              |
|                | -1 |              | 4 |                               |
|                | 1  |              | 1 |                               |
|                | 0  | => {ideal 1, | 0 |}                              |
|                | -2 |              | 8 |                               |
|                | 2  |              | 2 |                               |
|                0 => {ideal 1, 0}                                       |
|                                   2     2                              |
|                | 0  | => {ideal (x x , x ), | 0 |}                     |
|                | 1  |             0 2   1   | 6 |                      |
|                | -1 |                       | 4 |                      |
|                                   2     2                              |
|                | 0  | => {ideal (x x , x ), | 0 |}                     |
|                | 2  |             0 2   1   | 2 |                      |
|                | -2 |                       | 3 |                      |
|                                   2                                    |
|                | 1  | => {ideal (x , x ), | 1 |}                       |
|                | -1 |             1   0   | 4 |                        |
|                | 0  |                     | 5 |                        |
|                                   2                                    |
|                | 1  | => {ideal (x , x ), | 1 |}                       |
|                | -2 |             1   0   | 8 |                        |
|                | 1  |                     | 6 |                        |
|                                   2                                    |
|                | 1  | => {ideal (x , x ), | 1 |}                       |
|                | 0  |             1   0   | 0 |                        |
|                | -1 |                     | 4 |                        |
|                | 1  | => {ideal 1, | 1 |}                              |
|                | 1  |              | 6 |                               |
|                | -2 |              | 3 |                               |
|                | 1 | => {ideal 1, | 1 |}                               |
|                | 2 |              | 2 |                                |
|                | 2 |              | 2 |                                |
|                | 2  | => {ideal 1, | 2 |}                              |
|                | -1 |              | 4 |                               |
|                | -1 |              | 4 |                               |
|                | 2  | => {ideal 1, | 2 |}                              |
|                | -2 |              | 8 |                               |
|                | 0  |              | 5 |                               |
|                                   4     2   2                          |
|                | 2  | => {ideal (x , x x , x ), | 2 |}                 |
|                | 0  |             1   0 1   0   | 0 |                  |
|                | -2 |                           | 8 |                  |
|                                  2                                     |
|                | 2 | => {ideal (x , x ), | 2 |}                        |
|                | 1 |             1   0   | 6 |                         |
|                | 2 |                     | 7 |                         |
|                                  2                                     |
|                | 2 | => {ideal (x , x ), | 2 |}                        |
|                | 2 |             1   0   | 2 |                         |
|                | 1 |                     | 6 |                         |
|                                                                        |
|o24 : HashTable                                                         |
+------------------------------------------------------------------------+

Consider the family of smooth monomial curves in $\mathbb{P}^3$, the one of
degree $d$ having parametrization $$ (s,t) \rightarrow (s^d, s^{d-1}t, st^{d-1}
t^d) \in \mathbb{P}^3. $$

+-----------------------------------------------------------------------------+
|i25 : kk=ZZ/101;                                                             |
+-----------------------------------------------------------------------------+
|i26 : L= for d from 4 to 10 list (f=                                         |
|-----------------------------------------------------------------------------|
|map(kk[x_0..x_3,Degrees=>{{d,0},{d-1,1},{1,d-1},{0,d}}],                     |
|-----------------------------------------------------------------------------|
|kk[x_0,x_3,Degrees=>{{d,0},{0,d}}]));                                        |
+-----------------------------------------------------------------------------+
|i27 : print\decomposeMonomialAlgebra\L                                       |
|HashTable{| -1 | => {ideal 1, | 3 |}      }                                  |
|          | 1  |              | 1 |                                          |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 3 |                                          |
|          | 2 | => {ideal (x , x ), | 2 |}                                   |
|          | 2 |             0   3   | 2 |                                    |
|HashTable{| -1 | => {ideal 1, | 4 |}       }                                 |
|          | 1  |              | 1 |                                          |
|                                 2                                           |
|          | -2 | => {ideal (x , x ), | 3 |}                                  |
|          | 2  |             0   3   | 2 |                                   |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 4 |                                          |
|                             2                                               |
|          | 2  | => {ideal (x , x ), | 2 |}                                  |
|          | -2 |             0   3   | 3 |                                   |
|HashTable{| -1 | => {ideal 1, | 5 |}       }                                 |
|          | 1  |              | 1 |                                          |
|                                 3                                           |
|          | -2 | => {ideal (x , x ), | 4 |}                                  |
|          | 2  |             0   3   | 2 |                                   |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 5 |                                          |
|                             3                                               |
|          | 2  | => {ideal (x , x ), | 2 |}                                  |
|          | -2 |             0   3   | 4 |                                   |
|                            2   2                                            |
|          | 3 | => {ideal (x , x ), | 3 |}                                   |
|          | 3 |             0   3   | 3 |                                    |
|HashTable{| -1 | => {ideal 1, | 6 |}       }                                 |
|          | 1  |              | 1 |                                          |
|                                 4                                           |
|          | -2 | => {ideal (x , x ), | 5 |}                                  |
|          | 2  |             0   3   | 2 |                                   |
|                             2   3                                           |
|          | -3 | => {ideal (x , x ), | 4 |}                                  |
|          | 3  |             0   3   | 3 |                                   |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 6 |                                          |
|                             4                                               |
|          | 2  | => {ideal (x , x ), | 2 |}                                  |
|          | -2 |             0   3   | 5 |                                   |
|                             3   2                                           |
|          | 3  | => {ideal (x , x ), | 3 |}                                  |
|          | -3 |             0   3   | 4 |                                   |
|HashTable{| -1 | => {ideal 1, | 7 |}       }                                 |
|          | 1  |              | 1 |                                          |
|                                 5                                           |
|          | -2 | => {ideal (x , x ), | 6 |}                                  |
|          | 2  |             0   3   | 2 |                                   |
|                             2   4                                           |
|          | -3 | => {ideal (x , x ), | 5 |}                                  |
|          | 3  |             0   3   | 3 |                                   |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 7 |                                          |
|                             5                                               |
|          | 2  | => {ideal (x , x ), | 2 |}                                  |
|          | -2 |             0   3   | 6 |                                   |
|                             4   2                                           |
|          | 3  | => {ideal (x , x ), | 3 |}                                  |
|          | -3 |             0   3   | 5 |                                   |
|                            3   3                                            |
|          | 4 | => {ideal (x , x ), | 4 |}                                   |
|          | 4 |             0   3   | 4 |                                    |
|HashTable{| -1 | => {ideal 1, | 8 |}       }                                 |
|          | 1  |              | 1 |                                          |
|                                 6                                           |
|          | -2 | => {ideal (x , x ), | 7 |}                                  |
|          | 2  |             0   3   | 2 |                                   |
|                             2   5                                           |
|          | -3 | => {ideal (x , x ), | 6 |}                                  |
|          | 3  |             0   3   | 3 |                                   |
|                             3   4                                           |
|          | -4 | => {ideal (x , x ), | 5 |}                                  |
|          | 4  |             0   3   | 4 |                                   |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 8 |                                          |
|                             6                                               |
|          | 2  | => {ideal (x , x ), | 2 |}                                  |
|          | -2 |             0   3   | 7 |                                   |
|                             5   2                                           |
|          | 3  | => {ideal (x , x ), | 3 |}                                  |
|          | -3 |             0   3   | 6 |                                   |
|                             4   3                                           |
|          | 4  | => {ideal (x , x ), | 4 |}                                  |
|          | -4 |             0   3   | 5 |                                   |
|HashTable{| -1 | => {ideal 1, | 9 |}       }                                 |
|          | 1  |              | 1 |                                          |
|                                 7                                           |
|          | -2 | => {ideal (x , x ), | 8 |}                                  |
|          | 2  |             0   3   | 2 |                                   |
|                             2   6                                           |
|          | -3 | => {ideal (x , x ), | 7 |}                                  |
|          | 3  |             0   3   | 3 |                                   |
|                             3   5                                           |
|          | -4 | => {ideal (x , x ), | 6 |}                                  |
|          | 4  |             0   3   | 4 |                                   |
|          0 => {ideal 1, 0}                                                  |
|          | 1  | => {ideal 1, | 1 |}                                         |
|          | -1 |              | 9 |                                          |
|                             7                                               |
|          | 2  | => {ideal (x , x ), | 2 |}                                  |
|          | -2 |             0   3   | 8 |                                   |
|                             6   2                                           |
|          | 3  | => {ideal (x , x ), | 3 |}                                  |
|          | -3 |             0   3   | 7 |                                   |
|                             5   3                                           |
|          | 4  | => {ideal (x , x ), | 4 |}                                  |
|          | -4 |             0   3   | 6 |                                   |
|                            4   4                                            |
|          | 5 | => {ideal (x , x ), | 5 |}                                   |
|          | 5 |             0   3   | 5 |                                    |
|                                                                             |
|o27 = {, , , , , , }                                                         |
|                                                                             |
|o27 : List                                                                   |
+-----------------------------------------------------------------------------+

See also decomposeHomogeneousMA,:

+-----------------------------------------------------------------------------+
|i28 : decomposeHomogeneousMA {{2,0,1},{0,2,1},{1,1,1},{2,2,1},{2,1,1},{1,4,1 |
|                                                                             |
|                                  2                                          |
|o28 = HashTable{0 => {ideal (x , x x ), -1}    }                             |
|                              3   0 5                                        |
|                                        2                                    |
|                | 0 | => {ideal (x x , x ), -1}                              |
|                | 1 |             0 5   3                                    |
|                | 0 |                                                        |
|                                                                             |
|o28 : HashTable                                                              |
|-----------------------------------------------------------------------------|
|}}                                                                           |
+-----------------------------------------------------------------------------+

Ways to use decomposeMonomialAlgebra:
=====================================

  * "decomposeMonomialAlgebra(List)"
  * "decomposeMonomialAlgebra(List,List)"
  * "decomposeMonomialAlgebra(MonomialAlgebra)"
  * "decomposeMonomialAlgebra(PolynomialRing)"
  * "decomposeMonomialAlgebra(RingMap)"

For the programmer
==================

The object decomposeMonomialAlgebra, is a
method function with options (Macaulay2Doc).

decomposeMonomialAlgebra(...,Verbose=>...) -- Option to print intermediate results.
***********************************************************************************

Description
===========

Option to print intermediate results. The standard value is 0 (= do not print).

Further information
===================

  * Default value: 0
  * Function: decomposeMonomialAlgebra, --
    Decomposition of one monomial algebra over a subalgebra
  * Option key: Verbose (Macaulay2Doc), -- request verbose
    feedback

Functions with optional argument named Verbose:
===============================================

  * "check(...,Verbose=>...)" -- see check (Macaulay2Doc), --
    perform tests of a package
  * "checkDegrees(...,Verbose=>...)" -- see checkDegrees (Isomorphism),
    -- compares the degrees of generators of two
    modules
  * "copyDirectory(...,Verbose=>...)" -- see
    copyDirectory(String,String) (Macaulay2Doc),
  * "copyFile(...,Verbose=>...)" -- see copyFile(String,String) (Macaulay2Doc),
  * decomposeHomogeneousMA(...,Verbose=>...)
    -- Option to
    print intermediate results.
  * decomposeMonomialAlgebra(...,Verbose=>...)
    -- Option to
    print intermediate results.
  * degreeMA(...,Verbose=>...)
    -- Option to print
    intermediate results.
  * "findProgram(...,Verbose=>...)" -- see findProgram (Macaulay2Doc),
    -- load external program
  * "installPackage(...,Verbose=>...)" -- see installPackage (Macaulay2Doc),
    -- load and install a package and its
    documentation
  * "isIsomorphic(...,Verbose=>...)" -- see isIsomorphic (Isomorphism),
    -- Probabilistic test for isomorphism of modules
  * "moveFile(...,Verbose=>...)" -- see moveFile(String,String) (Macaulay2Doc),
  * "runProgram(...,Verbose=>...)" -- see runProgram (Macaulay2Doc),
    -- run an external program
  * "symlinkDirectory(...,Verbose=>...)" -- see
    symlinkDirectory(String,String) (Macaulay2Doc),
    -- make symbolic links
    for all files in a directory tree

Decomposition -- Optional argument of regularityMA to specify the decomposition.
********************************************************************************

Description
===========

Using this argument the decomposition computed by
decomposeMonomialAlgebra, can be specified if known a
priori.

Functions with optional argument named Decomposition:
=====================================================

  * "regularityMA(...,Decomposition=>...)"

For the programmer
==================

The object Decomposition, is a symbol (Macaulay2Doc).

degreeMA -- Degree of a monomial algebra.
*****************************************

Synopsis
========

  * Usage:
        degreeMA R
        degreeMA B
        degreeMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * B, a MonomialAlgebra,
  * Optional inputs (Macaulay2Doc),:
      * Verbose, => ...,
        default value 0, Option to print intermediate results.
  * Outputs:
      * an integer (Macaulay2Doc),

Description
===========

Compute the degree of the homogeneous monomial algebra K[B].

As the result is independent of K it is possible to specify just B.

+-----------------------------------------------------------------------------+
|i1 : B={{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,|
|                                                                             |
|o1 = {{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,  |
|     ------------------------------------------------------------------------|
|     3, 1}}                                                                  |
|                                                                             |
|o1 : List                                                                    |
|-----------------------------------------------------------------------------|
|3, 1}}                                                                       |
+-----------------------------------------------------------------------------+
|i2 : R=QQ[x_1..x_(#B),Degrees=>B]                                            |
|                                                                             |
|o2 = R                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : degreeMA R                                                              |
|                                                                             |
|o3 = 6                                                                       |
+-----------------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i4 : B={{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,|
|                                                                             |
|o4 = {{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0, 3}, {1, 4, 0}, {2, 3, 0}, {1,  |
|     ------------------------------------------------------------------------|
|     3, 1}}                                                                  |
|                                                                             |
|o4 : List                                                                    |
|-----------------------------------------------------------------------------|
|3, 1}}                                                                       |
+-----------------------------------------------------------------------------+
|i5 : M=monomialAlgebra B                                                     |
|                                                                             |
|      ZZ                                                                     |
|o5 = ---[x ..x ]                                                             |
|     101  0   6                                                              |
|                                                                             |
|o5 : MonomialAlgebra generated by {{2, 2, 1}, {1, 1, 3}, {1, 2, 2}, {2, 0,   |
|-----------------------------------------------------------------------------|
|3}, {1, 4, 0}, {2, 3, 0}, {1, 3, 1}}                                         |
+-----------------------------------------------------------------------------+
|i6 : degreeMA M                                                              |
|                                                                             |
|o6 = 6                                                                       |
+-----------------------------------------------------------------------------+

Ways to use degreeMA:
=====================

  * "degreeMA(List)"
  * "degreeMA(MonomialAlgebra)"
  * "degreeMA(PolynomialRing)"

For the programmer
==================

The object degreeMA, is a method function with options (Macaulay2Doc).

degreeMA(...,Verbose=>...) -- Option to print intermediate results.
*******************************************************************

Description
===========

Option to print intermediate results. The standard value is 0 (= do not print).

Further information
===================

  * Default value: 0
  * Function: degreeMA, -- Degree of a monomial algebra.
  * Option key: Verbose (Macaulay2Doc), -- request verbose
    feedback

Functions with optional argument named Verbose:
===============================================

  * "check(...,Verbose=>...)" -- see check (Macaulay2Doc), --
    perform tests of a package
  * "checkDegrees(...,Verbose=>...)" -- see checkDegrees (Isomorphism),
    -- compares the degrees of generators of two
    modules
  * "copyDirectory(...,Verbose=>...)" -- see
    copyDirectory(String,String) (Macaulay2Doc),
  * "copyFile(...,Verbose=>...)" -- see copyFile(String,String) (Macaulay2Doc),
  * decomposeHomogeneousMA(...,Verbose=>...)
    -- Option to
    print intermediate results.
  * decomposeMonomialAlgebra(...,Verbose=>...)
    -- Option to
    print intermediate results.
  * degreeMA(...,Verbose=>...)
    -- Option to print
    intermediate results.
  * "findProgram(...,Verbose=>...)" -- see findProgram (Macaulay2Doc),
    -- load external program
  * "installPackage(...,Verbose=>...)" -- see installPackage (Macaulay2Doc),
    -- load and install a package and its
    documentation
  * "isIsomorphic(...,Verbose=>...)" -- see isIsomorphic (Isomorphism),
    -- Probabilistic test for isomorphism of modules
  * "moveFile(...,Verbose=>...)" -- see moveFile(String,String) (Macaulay2Doc),
  * "runProgram(...,Verbose=>...)" -- see runProgram (Macaulay2Doc),
    -- run an external program
  * "symlinkDirectory(...,Verbose=>...)" -- see
    symlinkDirectory(String,String) (Macaulay2Doc),
    -- make symbolic links
    for all files in a directory tree

degrees(MonomialAlgebra) -- Generators of the degree monoid
***********************************************************

Synopsis
========

  * Function: degrees (Macaulay2Doc),
  * Usage:
        degrees M
  * Inputs:
      * M, a MonomialAlgebra,
  * Outputs:
      * a list (Macaulay2Doc),

Description
===========

Returns the generators of the degree monoid of M.

+-----------------------------------------------------------------------------+
|i1 : M = monomialAlgebra {1,4,8,9,11}                                        |
|                                                                             |
|      ZZ                                                                     |
|o1 = ---[x ..x ]                                                             |
|     101  0   5                                                              |
|                                                                             |
|o1 : MonomialAlgebra generated by {{11, 0}, {0, 11}, {1, 10}, {4, 7}, {8, 3},|
|-----------------------------------------------------------------------------|
|{9, 2}}                                                                      |
+-----------------------------------------------------------------------------+
|i2 : degrees M                                                               |
|                                                                             |
|o2 = {{11, 0}, {0, 11}, {1, 10}, {4, 7}, {8, 3}, {9, 2}}                     |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * degrees(MonomialAlgebra) -- Generators
    of the degree monoid

Diagrams -- Diagrams illustrating the tests
*******************************************

For fixed a and d the following diagrams show all possible

regularity +  codim against degree

degree - regularity against codim

degree - codim against regularity

codim against regularity for semigroups with regularity - degree + codim = 0

regularity on top of codim against degree.

The line corresponds to the Eisenbud-Goto bound.

d = 3:

a = 3:

a = 4:

a = 5:

d = 4:

a = 2:

a = 3:

d = 5:

a = 2:

findGeneratorsOfSubalgebra -- Find submonoid corresponding to the convex hull.
******************************************************************************

Synopsis
========

  * Usage:
        findGeneratorsOfSubalgebra B
  * Inputs:
      * B, a list (Macaulay2Doc), with generators of an affine
        semigroup in \mathbb{N}^d.
  * Outputs:
      * a list (Macaulay2Doc), of elements of B.

Description
===========

Denote by C(B) the cone in \mathbb{R}^d spanned by B. This function computes on
each ray of C(B) one element of B which has minimal coordinate sum, and returns
a list of those elements.

+-------------------------------------------+
|i1 : a=3                                   |
|                                           |
|o1 = 3                                     |
+-------------------------------------------+
|i2 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}|
|                                           |
|o2 = {{3, 0}, {0, 3}, {1, 2}, {2, 1}}      |
|                                           |
|o2 : List                                  |
+-------------------------------------------+
|i3 : findGeneratorsOfSubalgebra B          |
|                                           |
|o3 = {{{3, 0}, 0}, {{0, 3}, 1}}            |
|                                           |
|o3 : List                                  |
+-------------------------------------------+

+---------------------------------------------+
|i4 : a=4                                     |
|                                             |
|o4 = 4                                       |
+---------------------------------------------+
|i5 : B={{a, 0}, {2, a-2}, {1, a-1}, {a-1, 1}}|
|                                             |
|o5 = {{4, 0}, {2, 2}, {1, 3}, {3, 1}}        |
|                                             |
|o5 : List                                    |
+---------------------------------------------+
|i6 : findGeneratorsOfSubalgebra B            |
|                                             |
|o6 = {{{4, 0}, 0}, {{1, 3}, 2}}              |
|                                             |
|o6 : List                                    |
+---------------------------------------------+

+---------------------------------------+
|i7 : B={{3, 0}, {2, 0}, {1, 1}, {0, 2}}|
|                                       |
|o7 = {{3, 0}, {2, 0}, {1, 1}, {0, 2}}  |
|                                       |
|o7 : List                              |
+---------------------------------------+
|i8 : findGeneratorsOfSubalgebra B      |
|                                       |
|o8 = {{{2, 0}, 1}, {{0, 2}, 3}}        |
|                                       |
|o8 : List                              |
+---------------------------------------+

Ways to use findGeneratorsOfSubalgebra:
=======================================

  * "findGeneratorsOfSubalgebra(List)"

For the programmer
==================

The object findGeneratorsOfSubalgebra, is a
method function (Macaulay2Doc).

findMonomialSubalgebra -- Find monomial subalgebra corresponding to the convex hull.
************************************************************************************

Synopsis
========

  * Usage:
        findMonomialSubalgebra M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * M, a MonomialAlgebra,
  * Outputs:
      * a polynomial ring (Macaulay2Doc),
      * a MonomialAlgebra,

Description
===========

Denote by C(B) the cone in \mathbb{R}^d spanned by B. This function computes on
each ray of C(B) one element of B which has minimal coordinate sum, and returns
the multigraded polynomial ring with the corresponding variables.

If a monomial algebra is specified the function returns a monomial algebra.

+-------------------------------------------+
|i1 : a=3                                   |
|                                           |
|o1 = 3                                     |
+-------------------------------------------+
|i2 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}|
|                                           |
|o2 = {{3, 0}, {0, 3}, {1, 2}, {2, 1}}      |
|                                           |
|o2 : List                                  |
+-------------------------------------------+
|i3 : R=QQ[x_0..x_3, Degrees=> B]           |
|                                           |
|o3 = R                                     |
|                                           |
|o3 : PolynomialRing                        |
+-------------------------------------------+
|i4 : findMonomialSubalgebra R              |
|                                           |
|o4 = QQ[x ..x ]                            |
|         0   1                             |
|                                           |
|o4 : PolynomialRing                        |
+-------------------------------------------+

+------------------------------------------------------------------+
|i5 : a=3                                                          |
|                                                                  |
|o5 = 3                                                            |
+------------------------------------------------------------------+
|i6 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}                       |
|                                                                  |
|o6 = {{3, 0}, {0, 3}, {1, 2}, {2, 1}}                             |
|                                                                  |
|o6 : List                                                         |
+------------------------------------------------------------------+
|i7 : M=monomialAlgebra B                                          |
|                                                                  |
|      ZZ                                                          |
|o7 = ---[x ..x ]                                                  |
|     101  0   3                                                   |
|                                                                  |
|o7 : MonomialAlgebra generated by {{3, 0}, {0, 3}, {1, 2}, {2, 1}}|
+------------------------------------------------------------------+
|i8 : findMonomialSubalgebra M                                     |
|                                                                  |
|      ZZ                                                          |
|o8 = ---[x ..x ]                                                  |
|     101  0   1                                                   |
|                                                                  |
|o8 : MonomialAlgebra generated by {{3, 0}, {0, 3}}                |
+------------------------------------------------------------------+

Ways to use findMonomialSubalgebra:
===================================

  * "findMonomialSubalgebra(MonomialAlgebra)"
  * "findMonomialSubalgebra(PolynomialRing)"

For the programmer
==================

The object findMonomialSubalgebra, is a
method function (Macaulay2Doc).

homogenizeSemigroup -- Homogenize generators of a semigroup.
************************************************************

Synopsis
========

  * Usage:
        homogenizeSemigroup(A)
  * Inputs:
      * A, a list (Macaulay2Doc), of lists of integers
  * Outputs:
      * a list (Macaulay2Doc),

Description
===========

Homogenize the generators of a semigroup adding an additional coordinate.

+-------------------------------------------------+
|i1 : A = {{1,2},{3,0},{0,4},{0,5}}               |
|                                                 |
|o1 = {{1, 2}, {3, 0}, {0, 4}, {0, 5}}            |
|                                                 |
|o1 : List                                        |
+-------------------------------------------------+
|i2 : homogenizeSemigroup A                       |
|                                                 |
|o2 = {{1, 2, 2}, {3, 0, 2}, {0, 4, 1}, {0, 5, 0}}|
|                                                 |
|o2 : List                                        |
+-------------------------------------------------+

Ways to use homogenizeSemigroup:
================================

  * "homogenizeSemigroup(List)"

For the programmer
==================

The object homogenizeSemigroup, is a method function (Macaulay2Doc).

isBuchsbaumMA -- Test whether a simplicial monomial algebra is Buchsbaum.
*************************************************************************

Synopsis
========

  * Usage:
        isBuchsbaumMA R
        isBuchsbaumMA B
        isBuchsbaumMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test whether the simplicial monomial algebra K[B] is Buchsbaum.

Note that this condition does not depend on K.

For the definition of Buchsbaum see:

J. Stueckrad, W. Vogel: Castelnuovo Bounds for Certain Subvarieties in
\mathbb{P}^n, Math. Ann. 276 (1987), 341-352.

+------------------------------------------------------+
|i1 : R=QQ[x_0..x_3,Degrees=>{{6,0},{0,6},{4,2},{1,5}}]|
|                                                      |
|o1 = R                                                |
|                                                      |
|o1 : PolynomialRing                                   |
+------------------------------------------------------+
|i2 : isBuchsbaumMA R                                  |
|                                                      |
|o2 = false                                            |
+------------------------------------------------------+
|i3 : decomposeMonomialAlgebra R                       |
|                                                      |
|o3 = HashTable{| -1 | => {ideal 1, | 5 |}       }     |
|               | 1  |              | 7 |              |
|               | -2 | => {ideal 1, | 4 |}             |
|               | 2  |              | 2 |              |
|               0 => {ideal 1, 0}                      |
|               | 1  | => {ideal 1, | 1 |}             |
|               | -1 |              | 5 |              |
|               | 2  | => {ideal (x , x ), | 2 |}      |
|               | -2 |             0   1   | 4 |       |
|               | 3 | => {ideal (x , x ), | 3 |}       |
|               | 3 |             0   1   | 9 |        |
|                                                      |
|o3 : HashTable                                        |
+------------------------------------------------------+

+------------------------------------------------------+
|i4 : R=QQ[x_0..x_3,Degrees=>{{4,0},{0,4},{3,1},{1,3}}]|
|                                                      |
|o4 = R                                                |
|                                                      |
|o4 : PolynomialRing                                   |
+------------------------------------------------------+
|i5 : isBuchsbaumMA R                                  |
|                                                      |
|o5 = true                                             |
+------------------------------------------------------+
|i6 : decomposeMonomialAlgebra R                       |
|                                                      |
|o6 = HashTable{| -1 | => {ideal 1, | 3 |}      }      |
|               | 1  |              | 1 |              |
|               0 => {ideal 1, 0}                      |
|               | 1  | => {ideal 1, | 1 |}             |
|               | -1 |              | 3 |              |
|               | 2 | => {ideal (x , x ), | 2 |}       |
|               | 2 |             0   1   | 2 |        |
|                                                      |
|o6 : HashTable                                        |
+------------------------------------------------------+

+------------------------------------------------------+
|i7 : R=QQ[x_0..x_3,Degrees=>{{5,0},{0,5},{4,1},{1,4}}]|
|                                                      |
|o7 = R                                                |
|                                                      |
|o7 : PolynomialRing                                   |
+------------------------------------------------------+
|i8 : isBuchsbaumMA R                                  |
|                                                      |
|o8 = false                                            |
+------------------------------------------------------+
|i9 : decomposeMonomialAlgebra R                       |
|                                                      |
|o9 = HashTable{| -1 | => {ideal 1, | 4 |}       }     |
|               | 1  |              | 1 |              |
|                                      2               |
|               | -2 | => {ideal (x , x ), | 3 |}      |
|               | 2  |             0   1   | 2 |       |
|               0 => {ideal 1, 0}                      |
|               | 1  | => {ideal 1, | 1 |}             |
|               | -1 |              | 4 |              |
|                                  2                   |
|               | 2  | => {ideal (x , x ), | 2 |}      |
|               | -2 |             0   1   | 3 |       |
|                                                      |
|o9 : HashTable                                        |
+------------------------------------------------------+

+-------------------------------------------------------------------+
|i10 : R=QQ[x_0..x_3,Degrees=>{{5,0},{0,5},{4,1},{1,4}}]            |
|                                                                   |
|o10 = R                                                            |
|                                                                   |
|o10 : PolynomialRing                                               |
+-------------------------------------------------------------------+
|i11 : M=monomialAlgebra R                                          |
|                                                                   |
|o11 = R                                                            |
|                                                                   |
|o11 : MonomialAlgebra generated by {{5, 0}, {0, 5}, {4, 1}, {1, 4}}|
+-------------------------------------------------------------------+
|i12 : isBuchsbaumMA M                                              |
|                                                                   |
|o12 = false                                                        |
+-------------------------------------------------------------------+

Ways to use isBuchsbaumMA:
==========================

  * "isBuchsbaumMA(List)"
  * "isBuchsbaumMA(MonomialAlgebra)"
  * "isBuchsbaumMA(PolynomialRing)"

For the programmer
==================

The object isBuchsbaumMA, is a method function (Macaulay2Doc).

isCohenMacaulayMA -- Test whether a simplicial monomial algebra is Cohen-Macaulay.
**********************************************************************************

Synopsis
========

  * Usage:
        isCohenMacaulayMA R
        isCohenMacaulayMA B
        isCohenMacaulayMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test whether the simplicial monomial algebra K[B] is Cohen-Macaulay.

Note that this condition does not depend on K.

+-------------------------------------------+
|i1 : a=3                                   |
|                                           |
|o1 = 3                                     |
+-------------------------------------------+
|i2 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}|
|                                           |
|o2 = {{3, 0}, {0, 3}, {1, 2}, {2, 1}}      |
|                                           |
|o2 : List                                  |
+-------------------------------------------+
|i3 : R=QQ[x_0..x_3,Degrees=>B]             |
|                                           |
|o3 = R                                     |
|                                           |
|o3 : PolynomialRing                        |
+-------------------------------------------+
|i4 : isCohenMacaulayMA R                   |
|                                           |
|o4 = true                                  |
+-------------------------------------------+
|i5 : decomposeMonomialAlgebra R            |
|                                           |
|o5 = HashTable{| -1 | => {ideal 1, | 2 |}} |
|               | 1  |              | 1 |   |
|               0 => {ideal 1, 0}           |
|               | 1  | => {ideal 1, | 1 |}  |
|               | -1 |              | 2 |   |
|                                           |
|o5 : HashTable                             |
+-------------------------------------------+

+-------------------------------------------------+
|i6 : a=4                                         |
|                                                 |
|o6 = 4                                           |
+-------------------------------------------------+
|i7 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}      |
|                                                 |
|o7 = {{4, 0}, {0, 4}, {1, 3}, {3, 1}}            |
|                                                 |
|o7 : List                                        |
+-------------------------------------------------+
|i8 : R=QQ[x_0..x_3,Degrees=>B]                   |
|                                                 |
|o8 = R                                           |
|                                                 |
|o8 : PolynomialRing                              |
+-------------------------------------------------+
|i9 : isCohenMacaulayMA R                         |
|                                                 |
|o9 = false                                       |
+-------------------------------------------------+
|i10 : decomposeMonomialAlgebra R                 |
|                                                 |
|o10 = HashTable{| -1 | => {ideal 1, | 3 |}      }|
|                | 1  |              | 1 |        |
|                0 => {ideal 1, 0}                |
|                | 1  | => {ideal 1, | 1 |}       |
|                | -1 |              | 3 |        |
|                | 2 | => {ideal (x , x ), | 2 |} |
|                | 2 |             1   0   | 2 |  |
|                                                 |
|o10 : HashTable                                  |
+-------------------------------------------------+

+-------------------------------------------------------------------+
|i11 : a=4                                                          |
|                                                                   |
|o11 = 4                                                            |
+-------------------------------------------------------------------+
|i12 : M=monomialAlgebra {{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}       |
|                                                                   |
|       ZZ                                                          |
|o12 = ---[x ..x ]                                                  |
|      101  0   3                                                   |
|                                                                   |
|o12 : MonomialAlgebra generated by {{4, 0}, {0, 4}, {1, 3}, {3, 1}}|
+-------------------------------------------------------------------+
|i13 : isCohenMacaulayMA M                                          |
|                                                                   |
|o13 = false                                                        |
+-------------------------------------------------------------------+

Ways to use isCohenMacaulayMA:
==============================

  * "isCohenMacaulayMA(List)"
  * "isCohenMacaulayMA(MonomialAlgebra)"
  * "isCohenMacaulayMA(PolynomialRing)"

For the programmer
==================

The object isCohenMacaulayMA, is a method function (Macaulay2Doc).

isGorensteinMA -- Test whether a simplicial monomial algebra is Gorenstein.
***************************************************************************

Synopsis
========

  * Usage:
        isGorensteinMA R
        isGorensteinMA B
        isGorensteinMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test whether the simplicial monomial algebra K[B] is Gorenstein.

Note that this condition does not depend on K.

+-----------------------------------------------------+
|i1 : R=QQ[x_0..x_2,Degrees=>{{2, 0}, {0, 2}, {1, 1}}]|
|                                                     |
|o1 = R                                               |
|                                                     |
|o1 : PolynomialRing                                  |
+-----------------------------------------------------+
|i2 : isGorensteinMA R                                |
|                                                     |
|o2 = true                                            |
+-----------------------------------------------------+

Not Gorenstein:

+---------------------------------------+
|i3 : B={{3, 0}, {0, 3}, {1, 2}, {2, 1}}|
|                                       |
|o3 = {{3, 0}, {0, 3}, {1, 2}, {2, 1}}  |
|                                       |
|o3 : List                              |
+---------------------------------------+
|i4 : R=QQ[x_0..x_3,Degrees=>B]         |
|                                       |
|o4 = R                                 |
|                                       |
|o4 : PolynomialRing                    |
+---------------------------------------+
|i5 : isGorensteinMA R                  |
|                                       |
|o5 = false                             |
+---------------------------------------+

Not even Cohen-Macaulay:

+---------------------------------------+
|i6 : B={{4, 0}, {0, 4}, {1, 3}, {3, 1}}|
|                                       |
|o6 = {{4, 0}, {0, 4}, {1, 3}, {3, 1}}  |
|                                       |
|o6 : List                              |
+---------------------------------------+
|i7 : R=QQ[x_0..x_3,Degrees=>B]         |
|                                       |
|o7 = R                                 |
|                                       |
|o7 : PolynomialRing                    |
+---------------------------------------+
|i8 : isGorensteinMA R                  |
|                                       |
|o8 = false                             |
+---------------------------------------+
|i9 : isCohenMacaulayMA R               |
|                                       |
|o9 = false                             |
+---------------------------------------+

Gorenstein:

+-----------------------------------------------------------------------+
|i10 : R=QQ[x_0..x_4,Degrees=>{{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}]|
|                                                                       |
|o10 = R                                                                |
|                                                                       |
|o10 : PolynomialRing                                                   |
+-----------------------------------------------------------------------+
|i11 : isGorensteinMA R                                                 |
|                                                                       |
|o11 = true                                                             |
+-----------------------------------------------------------------------+
|i12 : decomposeMonomialAlgebra R                                       |
|                                                                       |
|o12 = HashTable{0 => {ideal 1, 0}        }                             |
|                | 0 | => {ideal 1, | 1 |}                              |
|                | 0 |              | 0 |                               |
|                | 1 |              | 1 |                               |
|                | 0 | => {ideal 1, | 1 |}                              |
|                | 1 |              | 1 |                               |
|                | 0 |              | 2 |                               |
|                | 0 | => {ideal 1, | 0 |}                              |
|                | 1 |              | 1 |                               |
|                | 1 |              | 1 |                               |
|                                                                       |
|o12 : HashTable                                                        |
+-----------------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i13 : R=QQ[x_0..x_4,Degrees=>{{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}]      |
|                                                                             |
|o13 = R                                                                      |
|                                                                             |
|o13 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i14 : M=monomialAlgebra R                                                    |
|                                                                             |
|o14 = R                                                                      |
|                                                                             |
|o14 : MonomialAlgebra generated by {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0,  |
|-----------------------------------------------------------------------------|
|1}, {0, 1, 1}}                                                               |
+-----------------------------------------------------------------------------+
|i15 : isGorensteinMA M                                                       |
|                                                                             |
|o15 = true                                                                   |
+-----------------------------------------------------------------------------+

Ways to use isGorensteinMA:
===========================

  * "isGorensteinMA(List)"
  * "isGorensteinMA(MonomialAlgebra)"
  * "isGorensteinMA(PolynomialRing)"

For the programmer
==================

The object isGorensteinMA, is a method function (Macaulay2Doc).

isNormalMA -- Test whether a simplicial monomial algebra is normal.
*******************************************************************

Synopsis
========

  * Usage:
        isNormalMA R
        isNormalMA B
        isNormalMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test whether the simplicial monomial algebra K[B] is normal.

Note that this condition does not depend on K.

+------------------------------------------------------------+
|i1 : B={{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}            |
|                                                            |
|o1 = {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0, 1}, {0, 1, 1}}|
|                                                            |
|o1 : List                                                   |
+------------------------------------------------------------+
|i2 : R=QQ[x_0..x_4,Degrees=>B]                              |
|                                                            |
|o2 = R                                                      |
|                                                            |
|o2 : PolynomialRing                                         |
+------------------------------------------------------------+
|i3 : isNormalMA R                                           |
|                                                            |
|o3 = false                                                  |
+------------------------------------------------------------+
|i4 : isSeminormalMA R                                       |
|                                                            |
|o4 = true                                                   |
+------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i5 : B={{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}                             |
|                                                                             |
|o5 = {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0, 1}, {0, 1, 1}}                 |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : M=monomialAlgebra B                                                     |
|                                                                             |
|      ZZ                                                                     |
|o6 = ---[x ..x ]                                                             |
|     101  0   4                                                              |
|                                                                             |
|o6 : MonomialAlgebra generated by {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0,   |
|-----------------------------------------------------------------------------|
|1}, {0, 1, 1}}                                                               |
+-----------------------------------------------------------------------------+
|i7 : isNormalMA M                                                            |
|                                                                             |
|o7 = false                                                                   |
+-----------------------------------------------------------------------------+
|i8 : isSeminormalMA M                                                        |
|                                                                             |
|o8 = true                                                                    |
+-----------------------------------------------------------------------------+

Ways to use isNormalMA:
=======================

  * "isNormalMA(List)"
  * "isNormalMA(MonomialAlgebra)"
  * "isNormalMA(PolynomialRing)"

For the programmer
==================

The object isNormalMA, is a method function (Macaulay2Doc).

isSeminormalMA -- Test whether a simplicial monomial algebra is seminormal.
***************************************************************************

Synopsis
========

  * Usage:
        isSeminormalMA R
        isSeminormalMA B
        isSeminormalMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test whether the simplicial monomial algebra K[B] is seminormal.

Note that this condition does not depend on K.

For the definition of seminormal see:

Richard G. Swan: On Seminormality, J. Algebra 67, no. 1 (1980), 210-229.

+------------------------------------------------------------+
|i1 : B={{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}            |
|                                                            |
|o1 = {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0, 1}, {0, 1, 1}}|
|                                                            |
|o1 : List                                                   |
+------------------------------------------------------------+
|i2 : R=QQ[x_0..x_4,Degrees=>B]                              |
|                                                            |
|o2 = R                                                      |
|                                                            |
|o2 : PolynomialRing                                         |
+------------------------------------------------------------+
|i3 : isSeminormalMA R                                       |
|                                                            |
|o3 = true                                                   |
+------------------------------------------------------------+
|i4 : isNormalMA R                                           |
|                                                            |
|o4 = false                                                  |
+------------------------------------------------------------+

+-----------------------------------------------------------------------------+
|i5 : B={{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}                             |
|                                                                             |
|o5 = {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0, 1}, {0, 1, 1}}                 |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : M=monomialAlgebra B                                                     |
|                                                                             |
|      ZZ                                                                     |
|o6 = ---[x ..x ]                                                             |
|     101  0   4                                                              |
|                                                                             |
|o6 : MonomialAlgebra generated by {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0,   |
|-----------------------------------------------------------------------------|
|1}, {0, 1, 1}}                                                               |
+-----------------------------------------------------------------------------+
|i7 : isSeminormalMA M                                                        |
|                                                                             |
|o7 = true                                                                    |
+-----------------------------------------------------------------------------+
|i8 : isNormalMA M                                                            |
|                                                                             |
|o8 = false                                                                   |
+-----------------------------------------------------------------------------+

Ways to use isSeminormalMA:
===========================

  * "isSeminormalMA(List)"
  * "isSeminormalMA(MonomialAlgebra)"
  * "isSeminormalMA(PolynomialRing)"

For the programmer
==================

The object isSeminormalMA, is a method function (Macaulay2Doc).

isSimplicialMA -- Test whether a monomial algebra is simplicial.
****************************************************************

Synopsis
========

  * Usage:
        isSimplicialMA R
        isSimplicialMA B
        isSimplicialMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d.
      * M, a MonomialAlgebra,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Test whether the monomial algebra K[B] is simplicial, that is, the cone C(B) is
spanned by linearly independent vectors.

Note that this condition does not depend on K.

+------------------------------------------------------------+
|i1 : B={{1,0,0},{0,2,0},{0,0,2},{1,0,1},{0,1,1}}            |
|                                                            |
|o1 = {{1, 0, 0}, {0, 2, 0}, {0, 0, 2}, {1, 0, 1}, {0, 1, 1}}|
|                                                            |
|o1 : List                                                   |
+------------------------------------------------------------+
|i2 : R=QQ[x_0..x_4,Degrees=>B]                              |
|                                                            |
|o2 = R                                                      |
|                                                            |
|o2 : PolynomialRing                                         |
+------------------------------------------------------------+
|i3 : isSimplicialMA R                                       |
|                                                            |
|o3 = true                                                   |
+------------------------------------------------------------+
|i4 : isSimplicialMA B                                       |
|                                                            |
|o4 = true                                                   |
+------------------------------------------------------------+

+-------------------------------------------------+
|i5 : B={{1,0,1},{0,1,1},{1,1,1},{0,0,1}}         |
|                                                 |
|o5 = {{1, 0, 1}, {0, 1, 1}, {1, 1, 1}, {0, 0, 1}}|
|                                                 |
|o5 : List                                        |
+-------------------------------------------------+
|i6 : R=QQ[x_0..x_3,Degrees=>B]                   |
|                                                 |
|o6 = R                                           |
|                                                 |
|o6 : PolynomialRing                              |
+-------------------------------------------------+
|i7 : isSimplicialMA R                            |
|                                                 |
|o7 = false                                       |
+-------------------------------------------------+
|i8 : isSimplicialMA B                            |
|                                                 |
|o8 = false                                       |
+-------------------------------------------------+

+-----------------------------------------------------------------------------+
|i9 : B={{1,0,1},{0,1,1},{1,1,1},{0,0,1}}                                     |
|                                                                             |
|o9 = {{1, 0, 1}, {0, 1, 1}, {1, 1, 1}, {0, 0, 1}}                            |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : M=monomialAlgebra B                                                    |
|                                                                             |
|       ZZ                                                                    |
|o10 = ---[x ..x ]                                                            |
|      101  0   3                                                             |
|                                                                             |
|o10 : MonomialAlgebra generated by {{1, 0, 1}, {0, 1, 1}, {1, 1, 1}, {0, 0,  |
|-----------------------------------------------------------------------------|
|1}}                                                                          |
+-----------------------------------------------------------------------------+
|i11 : isSimplicialMA M                                                       |
|                                                                             |
|o11 = false                                                                  |
+-----------------------------------------------------------------------------+

Ways to use isSimplicialMA:
===========================

  * "isSimplicialMA(List)"
  * "isSimplicialMA(MonomialAlgebra)"
  * "isSimplicialMA(PolynomialRing)"

For the programmer
==================

The object isSimplicialMA, is a method function (Macaulay2Doc).

MonomialAlgebra -- The class of all monomialAlgebras.
*****************************************************

Description
===========

The class of monomial algebras K[B] where B is a subsemigroup of \mathbb{N}^r.

You can create a monomial algebra via the function monomialAlgebra,
by either specifying

- the semigroup B as a list of generators. The field K is selected via the
option CoefficientField.

- a list of positive integers which is converted by adjoinPurePowers,
and homogenizeSemigroup, into a
list B of elements of \mathbb{N}^2. The field K is selected via the option
CoefficientField.

- a multigraded polynomial ring K[X] with Degrees (Macaulay2Doc),
R = B.

This data can be extracted as follows:

ring(MonomialAlgebra), returns the associated
multigraded polynomial ring.

See degrees(MonomialAlgebra), returns B.

Key functions:

Decomposition:

decomposeMonomialAlgebra, -- Decomposition of a
monomial algebra over the subalgebra corresponding to the convex hull of the
degree monoid.

See decomposeHomogeneousMA, -- Decomposition of a
homogeneous monomial algebra over the subalgebra corresponding to the convex
hull of the degree monoid.

Ring-theoretic properties:

isCohenMacaulayMA, -- Test whether a simplicial
monomial algebra is Cohen-Macaulay.

See isGorensteinMA, -- Test whether a simplicial monomial
algebra is Gorenstein.

See isBuchsbaumMA, -- Test whether a simplicial monomial
algebra is Buchsbaum.

See isNormalMA, -- Test whether a simplicial monomial algebra is
normal.

See isSeminormalMA, -- Test whether a simplicial monomial
algebra is seminormal.

See isSimplicialMA, -- Test whether a monomial algebra is
simplicial.

Regularity:

regularityMA, -- Compute the regularity via the
decomposition.

See degreeMA, -- Compute the degree via the decomposition.

See codimMA, -- Compute the codimension of a monomial algebra.

Methods that use a MonomialAlgebra:
===================================

  * "affineAlgebra(MonomialAlgebra)" -- see affineAlgebra,
    -- Define a monomial algebra
  * "binomialIdeal(MonomialAlgebra)" -- see binomialIdeal,
    -- Compute the ideal of a monomial algebra
  * "codimMA(MonomialAlgebra)" -- see codimMA, -- Codimension of
    a monomial algebra.
  * "decomposeHomogeneousMA(MonomialAlgebra)" -- see
    decomposeHomogeneousMA, -- Decomposition of one
    monomial algebra over a subalgebra
  * "decomposeMonomialAlgebra(MonomialAlgebra)" -- see
    decomposeMonomialAlgebra, -- Decomposition of one
    monomial algebra over a subalgebra
  * "degreeMA(MonomialAlgebra)" -- see degreeMA, -- Degree of a
    monomial algebra.
  * degrees(MonomialAlgebra) -- Generators
    of the degree monoid
  * "findMonomialSubalgebra(MonomialAlgebra)" -- see
    findMonomialSubalgebra, -- Find monomial subalgebra
    corresponding to the convex hull.
  * "isBuchsbaumMA(MonomialAlgebra)" -- see isBuchsbaumMA,
    -- Test whether a simplicial monomial algebra is Buchsbaum.
  * "isCohenMacaulayMA(MonomialAlgebra)" -- see isCohenMacaulayMA,
    -- Test whether a simplicial monomial algebra is
    Cohen-Macaulay.
  * "isGorensteinMA(MonomialAlgebra)" -- see isGorensteinMA,
    -- Test whether a simplicial monomial algebra is
    Gorenstein.
  * "isNormalMA(MonomialAlgebra)" -- see isNormalMA, -- Test
    whether a simplicial monomial algebra is normal.
  * "isSeminormalMA(MonomialAlgebra)" -- see isSeminormalMA,
    -- Test whether a simplicial monomial algebra is
    seminormal.
  * "isSimplicialMA(MonomialAlgebra)" -- see isSimplicialMA,
    -- Test whether a monomial algebra is simplicial.
  * net(MonomialAlgebra) -- Pretty print for
    monomial algebras
  * "regularityMA(MonomialAlgebra)" -- see regularityMA, --
    Compute regularity from decomposition
  * ring(MonomialAlgebra) -- Multigraded
    polynomial ring associated to a monomial algebra

For the programmer
==================

The object MonomialAlgebra, is a type (Macaulay2Doc),
with ancestor classes MutableHashTable (Macaulay2Doc),
< HashTable (Macaulay2Doc) <
Thing (Macaulay2Doc).

monomialAlgebra -- Create a monomial algebra
********************************************

Synopsis
========

  * Usage:
        monomialAlgebra R
        monomialAlgebra B
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), multigraded,
        with B = See degrees (Macaulay2Doc), R and K = See
        coefficientRing (Macaulay2Doc), R, or
      * B, a list (Macaulay2Doc), In the case B is specified, K is
        set via the Option (Macaulay2Doc), CoefficientField.
        If a list of positive integers is given, the
        function uses adjoinPurePowers, and
        homogenizeSemigroup, to convert it into a list of
        elements of \mathbb{N}^2.
  * Optional inputs (Macaulay2Doc),:
      * CoefficientField, => ..., default value ZZ/101,
        Option to set the coefficient field.
  * Outputs:
      * a MonomialAlgebra,

Description
===========

Create a monomial algebra K[B] by either specifying

- the semigroup B as a list of generators. The field K is selected via the
option CoefficientField.

- a list of positive integers which is converted by adjoinPurePowers,
and homogenizeSemigroup, into a
list B of elements of \mathbb{N}^2. The field K is selected via the option
CoefficientField.

- a multigraded polynomial ring R with Degrees (Macaulay2Doc), R
= B.

Specifying B:

+------------------------------------------------------------------+
|i1 : B = {{1,2},{3,0},{0,4},{0,5}}                                |
|                                                                  |
|o1 = {{1, 2}, {3, 0}, {0, 4}, {0, 5}}                             |
|                                                                  |
|o1 : List                                                         |
+------------------------------------------------------------------+
|i2 : monomialAlgebra B                                            |
|                                                                  |
|      ZZ                                                          |
|o2 = ---[x ..x ]                                                  |
|     101  0   3                                                   |
|                                                                  |
|o2 : MonomialAlgebra generated by {{1, 2}, {3, 0}, {0, 4}, {0, 5}}|
+------------------------------------------------------------------+
|i3 : monomialAlgebra(B, CoefficientField=>QQ)                     |
|                                                                  |
|o3 = QQ[x ..x ]                                                   |
|         0   3                                                    |
|                                                                  |
|o3 : MonomialAlgebra generated by {{1, 2}, {3, 0}, {0, 4}, {0, 5}}|
+------------------------------------------------------------------+

Specifying R:

+------------------------------------------------------------------+
|i4 : kk=ZZ/101                                                    |
|                                                                  |
|o4 = kk                                                           |
|                                                                  |
|o4 : QuotientRing                                                 |
+------------------------------------------------------------------+
|i5 : B = {{1,2},{3,0},{0,4},{0,5}}                                |
|                                                                  |
|o5 = {{1, 2}, {3, 0}, {0, 4}, {0, 5}}                             |
|                                                                  |
|o5 : List                                                         |
+------------------------------------------------------------------+
|i6 : monomialAlgebra(kk[x_0..x_3, Degrees=> B])                   |
|                                                                  |
|o6 = kk[x ..x ]                                                   |
|         0   3                                                    |
|                                                                  |
|o6 : MonomialAlgebra generated by {{1, 2}, {3, 0}, {0, 4}, {0, 5}}|
+------------------------------------------------------------------+

Specifying a list of integers to define a monomial curve:

+-----------------------------------------------------------------------------+
|i7 : M = monomialAlgebra {1,4,8,9,11}                                        |
|                                                                             |
|o7 = kk[x ..x ]                                                              |
|         0   5                                                               |
|                                                                             |
|o7 : MonomialAlgebra generated by {{11, 0}, {0, 11}, {1, 10}, {4, 7}, {8, 3},|
|-----------------------------------------------------------------------------|
|{9, 2}}                                                                      |
+-----------------------------------------------------------------------------+

Ways to use monomialAlgebra:
============================

  * "monomialAlgebra(List)"
  * "monomialAlgebra(PolynomialRing)"

For the programmer
==================

The object monomialAlgebra, is a method function with options (Macaulay2Doc).

net(MonomialAlgebra) -- Pretty print for monomial algebras
**********************************************************

Synopsis
========

  * Function: net (Macaulay2Doc),
  * Usage:
        net M
  * Inputs:
      * M, a MonomialAlgebra,
  * Outputs:
      * a net (Macaulay2Doc),

Description
===========

Pretty print for monomial algebras. Prints the associated polynomial ring of M.

+-----------------------------------------------------------------------------+
|i1 : M = monomialAlgebra {1,4,8,9,11}                                        |
|                                                                             |
|      ZZ                                                                     |
|o1 = ---[x ..x ]                                                             |
|     101  0   5                                                              |
|                                                                             |
|o1 : MonomialAlgebra generated by {{11, 0}, {0, 11}, {1, 10}, {4, 7}, {8, 3},|
|-----------------------------------------------------------------------------|
|{9, 2}}                                                                      |
+-----------------------------------------------------------------------------+
|i2 : net M                                                                   |
|                                                                             |
|      ZZ                                                                     |
|o2 = ---[x ..x ]                                                             |
|     101  0   5                                                              |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * net(MonomialAlgebra) -- Pretty print for
    monomial algebras

Num -- Option of randomSemigroup and randomMonomialAlgebra to return a list of several semigroups.
**************************************************************************************************

Description
===========

Option of randomSemigroup, and
randomMonomialAlgebra, to return a list of several
semigroups.

The default value is 1.

Functions with optional argument named Num:
===========================================

  * "randomMonomialAlgebra(...,Num=>...)"
  * "randomSemigroup(...,Num=>...)"

For the programmer
==================

The object Num, is a symbol (Macaulay2Doc).

randomMonomialAlgebra -- Generate random monomial algebra.
**********************************************************

Synopsis
========

  * Usage:
        randomMonomialAlgebra(a,d,c)
  * Inputs:
      * a, an integer (Macaulay2Doc), positive
      * d, an integer (Macaulay2Doc), positive
      * c, an integer (Macaulay2Doc), positive
  * Optional inputs (Macaulay2Doc),:
      * Num, => ..., default value 1, Option of randomSemigroup and
        randomMonomialAlgebra to return a list of several semigroups.
      * SetSeed, => ..., default value false, Option to set the
        random seed for randomSemigroup and randomMonomialAlgebra.
      * Simplicial, => ..., default value false, Option of
        randomSemigroup and randomMonomialAlgebra to return a simplicial
        semigroup.
  * Outputs:
      * a MonomialAlgebra, or a list of those if the
        option Num, is bigger or equal to 2.

Description
===========

Generate a random monomial algebra such that the semigroup generated by the
degrees is in \mathbb{N}^d of full dimension with coordinate sum a and
codimension c.

Note that the random number generator can be controlled by the command
setRandomSeed (Macaulay2Doc). Alternatively you can also use the
option SetSeed.

The option Num, can be used to return a list of semigroups.

The option Simplicial, can be used to return a simplicial
semigroup such that the standard vectors a*e_i are among the Hilbert basis.

+-----------------------------------------------------------------------------+
|i1 : randomMonomialAlgebra(5,3,7)                                            |
|                                                                             |
|      ZZ                                                                     |
|o1 = ---[x ..x ]                                                             |
|     101  0   9                                                              |
|                                                                             |
|o1 : MonomialAlgebra generated by {{1, 3, 1}, {0, 1, 4}, {2, 1, 2}, {0, 4,   |
|-----------------------------------------------------------------------------|
|1}, {2, 2, 1}, {3, 2, 0}, {3, 1, 1}, {5, 0, 0}, {2, 3, 0}, {0, 3, 2}}        |
+-----------------------------------------------------------------------------+
|i2 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i3 : randomMonomialAlgebra(5,3,7)                                            |
|                                                                             |
|      ZZ                                                                     |
|o3 = ---[x ..x ]                                                             |
|     101  0   9                                                              |
|                                                                             |
|o3 : MonomialAlgebra generated by {{5, 0, 0}, {1, 3, 1}, {1, 4, 0}, {0, 2,   |
|-----------------------------------------------------------------------------|
|3}, {3, 0, 2}, {0, 1, 4}, {0, 5, 0}, {4, 1, 0}, {2, 0, 3}, {4, 0, 1}}        |
+-----------------------------------------------------------------------------+
|i4 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i5 : randomMonomialAlgebra(5,3,7)                                            |
|                                                                             |
|      ZZ                                                                     |
|o5 = ---[x ..x ]                                                             |
|     101  0   9                                                              |
|                                                                             |
|o5 : MonomialAlgebra generated by {{5, 0, 0}, {1, 3, 1}, {1, 4, 0}, {0, 2,   |
|-----------------------------------------------------------------------------|
|3}, {3, 0, 2}, {0, 1, 4}, {0, 5, 0}, {4, 1, 0}, {2, 0, 3}, {4, 0, 1}}        |
+-----------------------------------------------------------------------------+
|i6 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i7 : randomMonomialAlgebra(5,3,7,Num=>2)                                     |
|                                                                             |
|       ZZ           ZZ                                                       |
|o7 = {---[x ..x ], ---[x ..x ]}                                              |
|      101  0   9   101  0   9                                                |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i9 : randomMonomialAlgebra(5,3,7,Simplicial=>true)                           |
|                                                                             |
|      ZZ                                                                     |
|o9 = ---[x ..x ]                                                             |
|     101  0   9                                                              |
|                                                                             |
|o9 : MonomialAlgebra generated by {{5, 0, 0}, {0, 5, 0}, {0, 0, 5}, {0, 1,   |
|-----------------------------------------------------------------------------|
|4}, {4, 0, 1}, {1, 1, 3}, {1, 3, 1}, {2, 3, 0}, {2, 0, 3}, {1, 4, 0}}        |
+-----------------------------------------------------------------------------+

Ways to use randomMonomialAlgebra:
==================================

  * "randomMonomialAlgebra(ZZ,ZZ,ZZ)"

For the programmer
==================

The object randomMonomialAlgebra, is a
method function with options (Macaulay2Doc).

randomSemigroup -- Generate random semigroups.
**********************************************

Synopsis
========

  * Usage:
        randomSemigroup(a,d,c)
  * Inputs:
      * a, an integer (Macaulay2Doc), positive
      * d, an integer (Macaulay2Doc), positive
      * c, an integer (Macaulay2Doc), positive
  * Optional inputs (Macaulay2Doc),:
      * Num, => ..., default value 1, Option of randomSemigroup and
        randomMonomialAlgebra to return a list of several semigroups.
      * SetSeed, => ..., default value false, Option to set the
        random seed for randomSemigroup and randomMonomialAlgebra.
      * Simplicial, => ..., default value false, Option of
        randomSemigroup and randomMonomialAlgebra to return a simplicial
        semigroup.
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

Generate a random generating set of a semigroups B in \mathbb{N}^d of full
dimension with coordinate sum a and codimension c.

Note that the random number generator can be controlled by the command
setRandomSeed (Macaulay2Doc). Alternatively you can also use the
option SetSeed.

The option Num, can be used to return a list of semigroups.

The option Simplicial, can be used to return a simplicial
semigroup such that the standard vectors a*e_i are among the Hilbert basis.

+-----------------------------------------------------------------------------+
|i1 : randomSemigroup(5,3,7)                                                  |
|                                                                             |
|o1 = {{1, 3, 1}, {0, 1, 4}, {2, 1, 2}, {0, 4, 1}, {2, 2, 1}, {3, 2, 0}, {3,  |
|     ------------------------------------------------------------------------|
|     1, 1}, {5, 0, 0}, {2, 3, 0}, {0, 3, 2}}                                 |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i3 : randomSemigroup(5,3,7)                                                  |
|                                                                             |
|o3 = {{5, 0, 0}, {1, 3, 1}, {1, 4, 0}, {0, 2, 3}, {3, 0, 2}, {0, 1, 4}, {0,  |
|     ------------------------------------------------------------------------|
|     5, 0}, {4, 1, 0}, {2, 0, 3}, {4, 0, 1}}                                 |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i5 : randomSemigroup(5,3,7)                                                  |
|                                                                             |
|o5 = {{5, 0, 0}, {1, 3, 1}, {1, 4, 0}, {0, 2, 3}, {3, 0, 2}, {0, 1, 4}, {0,  |
|     ------------------------------------------------------------------------|
|     5, 0}, {4, 1, 0}, {2, 0, 3}, {4, 0, 1}}                                 |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i7 : randomSemigroup(5,3,7,Num=>2)                                           |
|                                                                             |
|o7 = {{{5, 0, 0}, {1, 3, 1}, {1, 4, 0}, {0, 2, 3}, {3, 0, 2}, {0, 1, 4}, {0, |
|     ------------------------------------------------------------------------|
|     5, 0}, {4, 1, 0}, {2, 0, 3}, {4, 0, 1}}, {{1, 3, 1}, {1, 4, 0}, {2, 3,  |
|     ------------------------------------------------------------------------|
|     0}, {0, 5, 0}, {1, 2, 2}, {3, 1, 1}, {0, 0, 5}, {1, 1, 3}, {4, 0, 1},   |
|     ------------------------------------------------------------------------|
|     {0, 2, 3}}}                                                             |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : setRandomSeed()                                                         |
+-----------------------------------------------------------------------------+
|i9 : randomSemigroup(5,3,7,Simplicial=>true)                                 |
|                                                                             |
|o9 = {{5, 0, 0}, {0, 5, 0}, {0, 0, 5}, {0, 1, 4}, {4, 0, 1}, {1, 1, 3}, {1,  |
|     ------------------------------------------------------------------------|
|     3, 1}, {2, 3, 0}, {2, 0, 3}, {1, 4, 0}}                                 |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use randomSemigroup:
============================

  * "randomSemigroup(ZZ,ZZ,ZZ)"

For the programmer
==================

The object randomSemigroup, is a method function with options (Macaulay2Doc).

regularityMA -- Compute regularity from decomposition
*****************************************************

Synopsis
========

  * Usage:
        regularityMA R
        regularityMA B
        regularityMA M
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), with B =
        See degrees (Macaulay2Doc), R and K = See coefficientRing (Macaulay2Doc),
        R, or
      * B, a list (Macaulay2Doc), with the generators of an affine
        semigroup in \mathbb{N}^d. In the case B is specified, K is set via the
        Option (Macaulay2Doc), CoefficientField.
        If a list of positive integers is given, the
        function uses adjoinPurePowers, and
        homogenizeSemigroup, to convert it into a list of
        elements of \mathbb{N}^2.
      * M, a MonomialAlgebra,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientField, => ..., default value ZZ/101,
        Option to set the coefficient field.
      * Decomposition, => ..., default value new HashTable
        from {}, Optional argument of regularityMA to specify the
        decomposition.
  * Outputs:
      * an integer (Macaulay2Doc), list of the regularity and list of
        the summands achieving the maximum

Description
===========

Compute the regularity of K[B] from the decomposition of the homogeneous
monomial algebra K[B].

We assume that B=<b_{1},...,b_{r}> is homogeneous and minimally generated by
b_{1},...,b_{r}, that is, there is a group homomorphism \phi : G(B) \to
\mathbb{Z} such that \phi(b_{i}) = 1 for all i.

In the case of a monomial curve an ad hoc formula for the regularity of the
components is used (if R or B is given).

Specifying R:

+------------------------------------------------------------+
|i1 : a=5                                                    |
|                                                            |
|o1 = 5                                                      |
+------------------------------------------------------------+
|i2 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}                 |
|                                                            |
|o2 = {{5, 0}, {0, 5}, {1, 4}, {4, 1}}                       |
|                                                            |
|o2 : List                                                   |
+------------------------------------------------------------+
|i3 : R=QQ[x_0..x_3,Degrees=>B]                              |
|                                                            |
|o3 = R                                                      |
|                                                            |
|o3 : PolynomialRing                                         |
+------------------------------------------------------------+
|i4 : regularityMA R                                         |
|                                                            |
|                   2                            2           |
|o4 = {3, {{ideal (x , x ), | 3 |}, {ideal (x , x ), | 2 |}}}|
|                   1   0   | 2 |            1   0   | 3 |   |
|                                                            |
|o4 : List                                                   |
+------------------------------------------------------------+

Specifying a monomial algebra:

+------------------------------------------------------------------+
|i5 : a=5                                                          |
|                                                                  |
|o5 = 5                                                            |
+------------------------------------------------------------------+
|i6 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}                       |
|                                                                  |
|o6 = {{5, 0}, {0, 5}, {1, 4}, {4, 1}}                             |
|                                                                  |
|o6 : List                                                         |
+------------------------------------------------------------------+
|i7 : M=monomialAlgebra B                                          |
|                                                                  |
|      ZZ                                                          |
|o7 = ---[x ..x ]                                                  |
|     101  0   3                                                   |
|                                                                  |
|o7 : MonomialAlgebra generated by {{5, 0}, {0, 5}, {1, 4}, {4, 1}}|
+------------------------------------------------------------------+
|i8 : regularityMA M                                               |
|                                                                  |
|                   2                            2                 |
|o8 = {3, {{ideal (x , x ), | 3 |}, {ideal (x , x ), | 2 |}}}      |
|                   1   0   | 2 |            1   0   | 3 |         |
|                                                                  |
|o8 : List                                                         |
+------------------------------------------------------------------+

Specifying the decomposition dc:

+-------------------------------------------------------------+
|i9 : a=5                                                     |
|                                                             |
|o9 = 5                                                       |
+-------------------------------------------------------------+
|i10 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}                 |
|                                                             |
|o10 = {{5, 0}, {0, 5}, {1, 4}, {4, 1}}                       |
|                                                             |
|o10 : List                                                   |
+-------------------------------------------------------------+
|i11 : R=QQ[x_0..x_3,Degrees=>B]                              |
|                                                             |
|o11 = R                                                      |
|                                                             |
|o11 : PolynomialRing                                         |
+-------------------------------------------------------------+
|i12 : dc=decomposeMonomialAlgebra R                          |
|                                                             |
|o12 = HashTable{| -1 | => {ideal 1, | 4 |}       }           |
|                | 1  |              | 1 |                    |
|                                   2                         |
|                | -2 | => {ideal (x , x ), | 3 |}            |
|                | 2  |             1   0   | 2 |             |
|                0 => {ideal 1, 0}                            |
|                | 1  | => {ideal 1, | 1 |}                   |
|                | -1 |              | 4 |                    |
|                                       2                     |
|                | 2  | => {ideal (x , x ), | 2 |}            |
|                | -2 |             1   0   | 3 |             |
|                                                             |
|o12 : HashTable                                              |
+-------------------------------------------------------------+
|i13 : regularityMA(B,Decomposition=>dc)                      |
|                                                             |
|                    2                            2           |
|o13 = {3, {{ideal (x , x ), | 3 |}, {ideal (x , x ), | 2 |}}}|
|                    1   0   | 2 |            1   0   | 3 |   |
|                                                             |
|o13 : List                                                   |
+-------------------------------------------------------------+

Specifying B:

+-------------------------------------------------------------+
|i14 : a=5                                                    |
|                                                             |
|o14 = 5                                                      |
+-------------------------------------------------------------+
|i15 : B={{a, 0}, {0, a}, {1, a-1}, {a-1, 1}}                 |
|                                                             |
|o15 = {{5, 0}, {0, 5}, {1, 4}, {4, 1}}                       |
|                                                             |
|o15 : List                                                   |
+-------------------------------------------------------------+
|i16 : regularityMA B                                         |
|                                                             |
|                    2                            2           |
|o16 = {3, {{ideal (x , x ), | 3 |}, {ideal (x , x ), | 2 |}}}|
|                    1   0   | 2 |            1   0   | 3 |   |
|                                                             |
|o16 : List                                                   |
+-------------------------------------------------------------+

Compare to

+----------------------------------------------------------------------------+
|i17 : I=ker map(QQ[s,t],QQ[x_0..x_3],matrix {{s^a,t^a,s*t^(a-1),s^(a-1)*t}})|
|                                                                            |
|                           4    3       3    2 2   2 2      3   3      4    |
|o17 = ideal (x x  - x x , x  - x x , x x  - x x , x x  - x x , x x  - x )   |
|              0 1    2 3   2    1 3   0 2    1 3   0 2    1 3   0 2    3    |
|                                                                            |
|o17 : Ideal of QQ[x ..x ]                                                   |
|                   0   3                                                    |
+----------------------------------------------------------------------------+
|i18 : -1+regularity I                                                       |
|                                                                            |
|o18 = 3                                                                     |
+----------------------------------------------------------------------------+

Ways to use regularityMA:
=========================

  * "regularityMA(List)"
  * "regularityMA(MonomialAlgebra)"
  * "regularityMA(PolynomialRing)"

For the programmer
==================

The object regularityMA, is a method function with options (Macaulay2Doc).

ReturnMingens -- Option to return the minimal generating set B_A of K[B] as K[A]-module.
****************************************************************************************

Description
===========

Option to return the minimal generating set B_A of K[B] as K[A]-module. Used by
isSeminormalMA, and isNormalMA.

Functions with optional argument named ReturnMingens:
=====================================================

  * "decomposeHomogeneousMA(...,ReturnMingens=>...)"
  * "decomposeMonomialAlgebra(...,ReturnMingens=>...)"

For the programmer
==================

The object ReturnMingens, is a symbol (Macaulay2Doc).

ring(MonomialAlgebra) -- Multigraded polynomial ring associated to a monomial algebra
*************************************************************************************

Synopsis
========

  * Function: ring (Macaulay2Doc),
  * Usage:
        ring M
  * Inputs:
      * M, a MonomialAlgebra,
  * Outputs:
      * a ring (Macaulay2Doc),

Description
===========

Returns the multigraded polynomial ring associated to M.

+-----------------------------------------------------------------------------+
|i1 : M = monomialAlgebra {1,4,8,9,11}                                        |
|                                                                             |
|      ZZ                                                                     |
|o1 = ---[x ..x ]                                                             |
|     101  0   5                                                              |
|                                                                             |
|o1 : MonomialAlgebra generated by {{11, 0}, {0, 11}, {1, 10}, {4, 7}, {8, 3},|
|-----------------------------------------------------------------------------|
|{9, 2}}                                                                      |
+-----------------------------------------------------------------------------+
|i2 : ring M                                                                  |
|                                                                             |
|      ZZ                                                                     |
|o2 = ---[x ..x ]                                                             |
|     101  0   5                                                              |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : degrees ring M                                                          |
|                                                                             |
|o3 = {{11, 0}, {0, 11}, {1, 10}, {4, 7}, {8, 3}, {9, 2}}                     |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * ring(MonomialAlgebra) -- Multigraded
    polynomial ring associated to a monomial algebra

SetSeed -- Option to set the random seed for randomSemigroup and randomMonomialAlgebra.
***************************************************************************************

Description
===========

Option to set the random seed for randomSemigroup, and
randomMonomialAlgebra.

For the standard option false Macaulay2 automatically produces a random seed
from various system parameters.

If the option is true, then the command setRandomSeed (Macaulay2Doc),
() is applied upon initialization of the function
to use always the standard Macaulay2 random seed.

If the option is set to an integer r then setRandomSeed (Macaulay2Doc),
(r) is applied.

Functions with optional argument named SetSeed:
===============================================

  * "randomMonomialAlgebra(...,SetSeed=>...)"
  * "randomSemigroup(...,SetSeed=>...)"

For the programmer
==================

The object SetSeed, is a symbol (Macaulay2Doc).

Simplicial -- Option of randomSemigroup and randomMonomialAlgebra to return a simplicial semigroup.
***************************************************************************************************

Description
===========

Option of randomSemigroup, and
randomMonomialAlgebra, to return a set of generators of
a simplicial semigroup (with coordinate sum a) such that the standard vectors
a*e_i are among the Hilbert basis.

The default value is false.

Functions with optional argument named Simplicial:
==================================================

  * "randomMonomialAlgebra(...,Simplicial=>...)"
  * "randomSemigroup(...,Simplicial=>...)"

For the programmer
==================

The object Simplicial, is a symbol (Macaulay2Doc).