next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc > basic commutative algebra > M2SingularBook > Singular Book 2.1.10

Singular Book 2.1.10 -- Submodules of A^n

A common method of creating a submodule of A^n in Macaulay2 is to take the image of a matrix. This will be a submodule generated by the columns of the matrix.
i1 : A = QQ[x,y,z];
i2 : f = matrix{{x*y-1,y^4},{z^2+3,x^3},{x*y*z,z^2}}

o2 = | xy-1 y4 |
     | z2+3 x3 |
     | xyz  z2 |

             3       2
o2 : Matrix A  <--- A
i3 : M = image f

o3 = image | xy-1 y4 |
           | z2+3 x3 |
           | xyz  z2 |

                             3
o3 : A-module, submodule of A
i4 : numgens M

o4 = 2
i5 : ambient M

      3
o5 = A

o5 : A-module, free
A submodule can easily be moved to quotient rings.
i6 : Q = A/(x^2+y^2+z^2);
i7 : substitute(M,Q)

o7 = image | xy-1 y4       |
           | z2+3 -xy2-xz2 |
           | xyz  z2       |

                             3
o7 : Q-module, submodule of Q