By the end of this presentation, you will know how to input a module into Macaulay2 and compute its free resolution. In order for this to be useful, you need to understand how mathematical objects in commutative algebra correspond to values on the computer.
The roadmap of how to get from 0 to free resolution is as follows.
ZZ
= $\mathbb{Z}$QQ
= $\mathbb{Q}$RR
= $\mathbb{R}$CC
= $\mathbb{C}$Note: many algorithms don't work with RR
or CC
because they are not exact
%%macaulay2 3 3/2 3.4 3.4+3*ii
%%macaulay2 R = ZZ/5 27_R
We will later learn how to construct quotient rings, so combined with the ability to construct free rings, this allows us to make any finitely presented ring over ZZ
or QQ
.
%%macaulay2 R = QQ[x,y]
This allows us to verify basic algebraic identities.
%%macaulay2 x^2 + 2*x*y + y^2 - (x+y)^2
Compute that $(x+y)^p = x^p + y^p$ in $(\mathbb{Z}/p\mathbb{Z})[x,y]$, for $p=101$
%%macaulay2 R = ZZ/101[x,y] (x+y)^101
Any old computer algebra system can manipulate formulas. What sets Macaulay2 apart is manipulating algebraic objects, like ideals and modules.
%%macaulay2 R = QQ[x,y] I = ideal(x^2,x*y)
This is the first Macaulay procedure we have seen. ideal
takes in several expressions, and returns the ideal generated by those expressions. We can then work with the returned ideal. For instance, we can compute its primary decomposition.
%%macaulay2 primaryDecomposition(I)
Or its radical
%%macaulay2 radical(I)
If we have two ideals, we can also do operations with them.
Other common operations are also functions in Macaulay, like saturation, or computation of associated primes (though you can get that from the primary decomposition of course).
Write down your favorite ideal and compute its radical.
%%macaulay2 I = ideal(x^3, y^2) radical(I)
You construct a quotient ring in exactly the way that you would expect.
%%macaulay2 R = QQ[x,y,z] I = ideal(x*y,x*z,y*z) A = R/I
%%macaulay2 (x_A + y_A) * y_A
This was so easy that we are going to skip to modules without a Do it Yourself section.
The theory of computer algebra is the theory of working with finite representations. Everything we work with is ultimately combinatorial in nature. This is why free modules and free rings are the bread and butter of Macaulay2.
Free modules are very easy to write down
%%macaulay2 M = A^2
Free modules have a preferred basis, which you can access easily, and writing down module elements is exactly as you would guess.
%%macaulay2 M_0 + 2*x*M_1
In order to do anything else with modules, we want to use matrices. This is because, as I said before, computer algebra is the study of finite representations. One way of finitely describing modules is by giving them as images, kernels, or cokernels of matrices, which are what it says on the tin: a rectangle of ring elements, in this case represented as a list of lists.
%%macaulay2 f = matrix({{x,y},{1,0}})
The important thing to get used to about Macaulay2 is that the domain of a function goes on the right, and the codomain goes on the left. The reason for this is that we put the argument to a function on the right hand side of the function, so intuitively the argument travels from right to left through the function. One imagines that the authors of Macaulay2 probably have strong opinions about why this is the correct way to write functions, that they would love to share with you if you went to their website.
%%macaulay2 f(y*M_0 + x*M_1)
Write down your favorite $3 \times 3$ permutation matrix and apply it to something.
%%macaulay2 f = matrix({{1, 0, 0},{0, 0, 1},{0,1,0}}) Q = ZZ^3 f(Q_0 + 2*Q_1 + Q_2)
Like I promised, we can compute the image, kernel, and cokernel of a matrix. At this point, you can probably guess how.
%%macaulay2 {image(f),kernel(f),cokernel(f)}
Let $k = \mathbb{Q}$, and let $A = \mathbb{Q}[x_1,x_2,x_3,x_4]$. Compute the free resolution for $k$ as an $A$-module.
First, write down $A$ in Macaulay
%%macaulay2 A=QQ[x1, x2, x3, x4]
To compute the free resolution of $k$ as a $A$-module, we must first display $k$ as a $A$-module. To this end, write down a map from $A^4$ to $A$ that has $k$ as its cokernel. Then assign k
to the cokernel of this map.
%%macaulay2 f = matrix({{x1, x2, x3, x4}}) k = cokernel(f)
Finally, apply the function resolution
to k
!
%%macaulay2 resolution(k)
If we want to learn more about the resolution than the degrees of the free modules, we have to learn how to work with a ChainComplex
object. However, that is beyond the scope of this presentation.
Thank you!