# Singular Book 2.1.24 -- submodules, presentation of a module

 i1 : A = QQ[x,y,z] o1 = A o1 : PolynomialRing i2 : N = image matrix{{x*y,0},{0,x*z},{y*z,z^2}} o2 = image | xy 0 | | 0 xz | | yz z2 | 3 o2 : A-module, submodule of A
The submodule is generated by the two columns of this matrix.
 i3 : N + x*N o3 = image | xy 0 x2y 0 | | 0 xz 0 x2z | | yz z2 xyz xz2 | 3 o3 : A-module, submodule of A
It is easy to go between matrices and submodules. Use generators(Module) and image(Matrix)(gens and generators are synonyms). There is no automatic conversion between modules and matrices in Macaulay2.
 i4 : f = matrix{{x*y,x*z},{y*z,z^2}} o4 = | xy xz | | yz z2 | 2 2 o4 : Matrix A <--- A i5 : M = image f o5 = image | xy xz | | yz z2 | 2 o5 : A-module, submodule of A i6 : g = gens M o6 = | xy xz | | yz z2 | 2 2 o6 : Matrix A <--- A i7 : f == g o7 = true
In Macaulay2, matrices are not automatically either presentation matrices or generating matrices for a module. You use whichever you have in mind.
 i8 : N = cokernel f o8 = cokernel | xy xz | | yz z2 | 2 o8 : A-module, quotient of A i9 : presentation N o9 = | xy xz | | yz z2 | 2 2 o9 : Matrix A <--- A i10 : presentation M o10 = {2} | -z | {2} | y | 2 1 o10 : Matrix A <--- A
Notice that the presentation of N requires no computation, whereas the presentation of M requires a syzygy computation.

kernel(Matrix) gives a submodule, while syz(Matrix) returns the matrix.

 i11 : syz f o11 = {2} | -z | {2} | y | 2 1 o11 : Matrix A <--- A i12 : kernel f o12 = image {2} | -z | {2} | y | 2 o12 : A-module, submodule of A