Commutative Algebra
In this page, we will see how to perform basic operations in commutative algebra in Macaulay 2.
Ideal Manipulations
To create an ideal
S = QQ[x, y, z]
I = ideal (y - x^3, z - x^5, y*x^2 - z)
You can also simply write ideal and give it a list of polynomials.
A nice way to display the list of generators of your ideal is to use the NetList command:
netList I_*
Note that I_* gives you a list of the generators of the ideal I.
To use an ideal in a different ring (for instance the same ring with a different monomial order), you can use the sub command:
J = sub(I, S)
The above command will create an ideal J in the ring S with the same generators as I, which was an ideal in the ring R.
If you want the ideal generated by the enries of a matrix M, you can simply use the following command:
J = ideal M
Groebner basis
GI = gb I
-- to see the generators of the Greobner basis
gens GI
To compute the normal form of a polynomial $f$ with respect to an ideal $I$ (that is, the remainder of $f$ when divided by the Groebner basis of $I$), simply do the following:
f % I
Testing membership in the ideal $I$ is then done by:
f % I == 0
Module Manipulations
Given a matrix M, we can compute the kernel of $M$ via computing its syzygy module:
K = syz M
Free Resolutions
Given an ideal $I \subset R$, we can compute a free resolution of $R/I$ using the res command:
C = res R^1/I
C.dd
Where C is the chain complex corresponding to the free resolution of $R/I$, and C.dd shows you the differentials in the complex.
You can also use the command res I to get a free resolution of $R/I$.
To get the $k^{th}$ differential in the complex, you can use C.dd_k, where k is a nonnegative integer.
To see the Betti numbers of the resolution, you can use the betti command:
betti C
Homological Algebra
You can compute Ext modules as follows:
E = prune Ext^k(R^1/I, R)
Where k is a nonnegative integer.