# primaryDecomposition(Module) -- irredundant primary decomposition of a module

## Synopsis

• Function: primaryDecomposition
• Usage:
primaryDecomposition M
• Inputs:
• M, , in a (quotient of a) polynomial ring R
• Optional inputs:
• MinimalGenerators => , default value true, if false, the components will not be minimalized
• Strategy => ..., default value null,
• Outputs:
• a list, containing a minimal list of primary submodules of M whose intersection is 0

## Description

This routine returns a minimal primary decomposition for the zero submodule of M, i.e. a minimal list of submodules Q_i of M such that the intersection of all the Q_i is 0 and Ass(M/Q_i) = {p_i} for some associated prime p_i of M.

Here minimality means that the associated primes of the submodules are pairwise distinct, and that the decomposition is irredundant, i.e. no submodule contains the intersection of the others. The i-th element of this output is primary to the i-th element of associatedPrimes M. The algorithm used is inspired by the Eisenbud-Huneke-Vasconcelos algorithm, modified to work for modules.

 i1 : R = QQ[x_0..x_3] o1 = R o1 : PolynomialRing i2 : (I1,I2,I3) = ({1,2,3},{2,3},{4,5}) / monomialCurveIdeal_R 2 2 3 2 5 o2 = (ideal (x - x x , x x - x x , x - x x ), ideal(x - x x ), ideal(x - 2 1 3 1 2 0 3 1 0 2 1 0 2 1 ------------------------------------------------------------------------ 4 x x )) 0 2 o2 : Sequence i3 : M = comodule I1 ++ comodule I2 ++ comodule I3 o3 = cokernel | x_2^2-x_1x_3 x_1x_2-x_0x_3 x_1^2-x_0x_2 0 0 | | 0 0 0 x_1^3-x_0x_2^2 0 | | 0 0 0 0 x_1^5-x_0x_2^4 | 3 o3 : R-module, quotient of R i4 : associatedPrimes M 3 2 5 4 2 2 o4 = {ideal(x - x x ), ideal(x - x x ), ideal (x - x x , x x - x x , x - 1 0 2 1 0 2 2 1 3 1 2 0 3 1 ------------------------------------------------------------------------ x x )} 0 2 o4 : List i5 : C = primaryDecomposition M; i6 : netList C +------------------------------------------------------------------------------------------------+ o6 = |subquotient (| 1 0 |, | x_2^2-x_1x_3 x_1x_2-x_0x_3 x_1^2-x_0x_2 0 0 |)| | | 0 0 | | 0 0 0 x_1^3-x_0x_2^2 0 | | | | 0 1 | | 0 0 0 0 x_1^5-x_0x_2^4 | | +------------------------------------------------------------------------------------------------+ |subquotient (| 1 0 |, | x_2^2-x_1x_3 x_1x_2-x_0x_3 x_1^2-x_0x_2 0 0 |)| | | 0 1 | | 0 0 0 x_1^3-x_0x_2^2 0 | | | | 0 0 | | 0 0 0 0 x_1^5-x_0x_2^4 | | +------------------------------------------------------------------------------------------------+ |subquotient (| 0 0 |, | x_2^2-x_1x_3 x_1x_2-x_0x_3 x_1^2-x_0x_2 0 0 |)| | | 1 0 | | 0 0 0 x_1^3-x_0x_2^2 0 | | | | 0 1 | | 0 0 0 0 x_1^5-x_0x_2^4 | | +------------------------------------------------------------------------------------------------+ i7 : intersect C == 0 and all(C, isPrimary_M) o7 = true i8 : C / degree o8 = {5, 3, 8} o8 : List

Recall that in Macaulay2, a module is commonly represented as a subquotient, which is an ordered pair consisting of generators and relations represented as column matrices. As submodules of M, each module in the output list has the same relations as M, and has generators which are R-linear combinations of generators of M, where R = ring M.

To obtain a primary decomposition of a submodule N, run this function on the quotient M/N. Note that the / command does not check whether N is actually a submodule of M, and a non-sensible result may be returned if this is not the case.

This function generalizes primary decomposition of ideals (more precisely, cyclic modules), as can be seen by calling primaryDecomposition comodule I for an ideal I. For convenience, one can also call primaryDecomposition R for a ring R (which is most useful when R is a QuotientRing). When computing primary decompositions of ideals with this function, remember to add back the original ideal to obtain the desired primary ideals, as in the following example.

 i9 : I = intersect((ideal(x_0..x_3))^5, (ideal(x_0..x_2))^4, (ideal(x_0..x_1))^3) 3 2 2 3 4 3 2 2 3 o9 = ideal (x x x , x x x x , x x x x , x x x , x x , x x x , x x x , x x x , 1 2 3 0 1 2 3 0 1 2 3 0 2 3 1 3 0 1 3 0 1 3 0 1 3 ------------------------------------------------------------------------ 4 3 2 2 2 2 2 3 2 4 3 2 2 3 4 x x , x x , x x x , x x x , x x , x x , x x x , x x x , x x x , x x , 0 3 1 2 0 1 2 0 1 2 0 2 1 2 0 1 2 0 1 2 0 1 2 0 2 ------------------------------------------------------------------------ 5 4 2 3 3 2 4 5 x , x x , x x , x x , x x , x ) 1 0 1 0 1 0 1 0 1 0 o9 : Ideal of R i10 : S = R/I o10 = S o10 : QuotientRing i11 : associatedPrimes S o11 = {ideal (x , x ), ideal (x , x , x ), ideal (x , x , x , x )} 1 0 2 1 0 3 2 1 0 o11 : List i12 : comps = primaryDecomposition S o12 = {subquotient (| x_1^3 x_0x_1^2 x_0^2x_1 x_0^3 |, | x_1^3x_2x_3 ----------------------------------------------------------------------- x_0x_1^2x_2x_3 x_0^2x_1x_2x_3 x_0^3x_2x_3 x_1^4x_3 x_0x_1^3x_3 ----------------------------------------------------------------------- x_0^2x_1^2x_3 x_0^3x_1x_3 x_0^4x_3 x_1^3x_2^2 x_0x_1^2x_2^2 ----------------------------------------------------------------------- x_0^2x_1x_2^2 x_0^3x_2^2 x_1^4x_2 x_0x_1^3x_2 x_0^2x_1^2x_2 x_0^3x_1x_2 ----------------------------------------------------------------------- x_0^4x_2 x_1^5 x_0x_1^4 x_0^2x_1^3 x_0^3x_1^2 x_0^4x_1 x_0^5 |), ----------------------------------------------------------------------- subquotient (| x_1^3x_2 x_0x_1^2x_2 x_0^2x_1x_2 x_0^3x_2 x_1^4 x_0x_1^3 ----------------------------------------------------------------------- x_0^2x_1^2 x_0^3x_1 x_0^4 x_2^5 |, | x_1^3x_2x_3 x_0x_1^2x_2x_3 ----------------------------------------------------------------------- x_0^2x_1x_2x_3 x_0^3x_2x_3 x_1^4x_3 x_0x_1^3x_3 x_0^2x_1^2x_3 ----------------------------------------------------------------------- x_0^3x_1x_3 x_0^4x_3 x_1^3x_2^2 x_0x_1^2x_2^2 x_0^2x_1x_2^2 x_0^3x_2^2 ----------------------------------------------------------------------- x_1^4x_2 x_0x_1^3x_2 x_0^2x_1^2x_2 x_0^3x_1x_2 x_0^4x_2 x_1^5 x_0x_1^4 ----------------------------------------------------------------------- x_0^2x_1^3 x_0^3x_1^2 x_0^4x_1 x_0^5 |), subquotient (| x_3^5 x_2^5 |, ----------------------------------------------------------------------- | x_1^3x_2x_3 x_0x_1^2x_2x_3 x_0^2x_1x_2x_3 x_0^3x_2x_3 x_1^4x_3 ----------------------------------------------------------------------- x_0x_1^3x_3 x_0^2x_1^2x_3 x_0^3x_1x_3 x_0^4x_3 x_1^3x_2^2 x_0x_1^2x_2^2 ----------------------------------------------------------------------- x_0^2x_1x_2^2 x_0^3x_2^2 x_1^4x_2 x_0x_1^3x_2 x_0^2x_1^2x_2 x_0^3x_1x_2 ----------------------------------------------------------------------- x_0^4x_2 x_1^5 x_0x_1^4 x_0^2x_1^3 x_0^3x_1^2 x_0^4x_1 x_0^5 |)} o12 : List i13 : apply(comps, Q -> ideal mingens(I + ideal gens Q)) 3 2 2 3 3 2 2 3 4 o13 = {ideal (x , x x , x x , x ), ideal (x x , x x x , x x x , x x , x , 1 0 1 0 1 0 1 2 0 1 2 0 1 2 0 2 1 ----------------------------------------------------------------------- 3 2 2 3 4 5 5 3 2 2 x x , x x , x x , x , x ), ideal (x , x x x , x x x x , x x x x , 0 1 0 1 0 1 0 2 3 1 2 3 0 1 2 3 0 1 2 3 ----------------------------------------------------------------------- 3 4 3 2 2 3 4 5 3 2 2 2 2 2 x x x , x x , x x x , x x x , x x x , x x , x , x x , x x x , x x x , 0 2 3 1 3 0 1 3 0 1 3 0 1 3 0 3 2 1 2 0 1 2 0 1 2 ----------------------------------------------------------------------- 3 2 4 3 2 2 3 4 5 4 2 3 3 2 4 x x , x x , x x x , x x x , x x x , x x , x , x x , x x , x x , x x , 0 2 1 2 0 1 2 0 1 2 0 1 2 0 2 1 0 1 0 1 0 1 0 1 ----------------------------------------------------------------------- 5 x )} 0 o13 : List i14 : I == intersect oo o14 = true

The results of the computation are stored inside M.cache, as a MutableHashTable whose keys are associated primes and values are the corresponding primary components. The list of all associated prime ideals is also cached, and can be obtained with associatedPrimes M. The computation may be interrupted at any point, and can be resumed later without recomputing already known primary components. To display detailed information throughout the computation, set the global variable debugLevel to a value greater than 0, e.g. debugLevel=1 (or debugLevel=2 for even more detail).

This function has one optional input Strategy, which accepts 3 possible values that determine the algorithm for finding embedded components.

• Res

This strategy is closest to the original Eisenbud-Huneke-Vasconcelos method.

• Hom
• Sat

While the default (and typically fastest) strategy is Sat, it is recommended to try different Strategy values if the computation of a particular embedded component is taking too long. One can start the computation with one strategy, and interrupt and resume with a different strategy (even multiple times) if desired.

## Caveat

Note that although isolated components (i.e. those corresponding to minimal primes) are unique, embedded components are never unique, and thus specifying generators of an embedded component requires non-canonical choices. For speed purposes, this algorithm searches for embedded components obtained by adding a bracket power of the embedded prime, with exponent determined by the degrees of generators of the embedded prime and ann M. In particular, the generators of an embedded component may not be of minimal possible degree.