Macaulay2 » Documentation
Packages » Macaulay2Doc » A first course in commutative algebra » M2SingularBook » Singular Book 1.8.1
next | previous | forward | backward | up | index | toc

# Singular Book 1.8.1 -- ideal membership

    i1 : A = QQ[x,y];

    i2 : I = ideal(x^10+x^9*y^2, y^8-x^2*y^7);

    o2 : Ideal of A

    i3 : f = x^2*y^7+y^14;

    i4 : f % I

              12    8
    o4 = - x*y   + y

    o4 : A

So this f is not in the ideal I.

    i5 : f = x*y^13+y^12;

    i6 : f % I

    o6 = 0

    o6 : A

This f is in the ideal I.

Check inclusion and equality of ideals.

    i7 : K = ideal(f,x^2*y^7+y^14);

    o7 : Ideal of A

    i8 : (gens K) % I

    o8 = | 0 -xy12+y8 |

                 1      2
    o8 : Matrix A  <-- A

In Macaulay2, inclusion of ideals can be tested using isSubset(Ideal,Ideal) and equality can be checked using Ideal == Ideal. In both cases the necessary Gröbner bases are computed, if they have not already been computed.

    i9 : isSubset(K,I)

    o9 = false

    i10 : K == I

    o10 = false

    i11 : K = ideal(f,y^14+x*y^12);

    o11 : Ideal of A

    i12 : (gens K) % I

    o12 = 0

                  1      2
    o12 : Matrix A  <-- A

    i13 : isSubset(K,I)

    o13 = true

    i14 : K == I

    o14 = false

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/M2-Singular-Book.m2:513:0.