ideals

The ideal generated by a list of ring elements can be constructed with the function ideal.

i1 : R = ZZ/101[a..d];
i2 : I = ideal (a^2*b-c^2, a*b^2-d^3, c^5-d)

             2     2     2    3   5
o2 = ideal (a b - c , a*b  - d , c  - d)

o2 : Ideal of R

If you have a matrix, then ideal will produce the ideal generated by the entries of the matrix.

i3 : f = matrix {{a^2,b^2},{c^2,d^2}}

o3 = {0} | a2 b2 |
     {0} | c2 d2 |

             2       2
o3 : Matrix R  <--- R
i4 : J = ideal f

             2   2   2   2
o4 = ideal (a , c , b , d )

o4 : Ideal of R

An interesting class of ideals can be obtained as the defining ideals in projective space of monomial curves. The twisted cubic is the closure of the set of points (1,t^1,t^2,t^3) in projective space. We use a list of the exponents and monomialCurve to get the ideal.

i5 : monomialCurve(R,{1,2,3})

                        2         2
o5 = ideal (b*c - a*d, c  - b*d, b  - a*c)

o5 : Ideal of R

The command substitute can be used to transfer an ideal to another ring. You may want to do this because another ring has a monomial ordering more suitable for the computations you are about to do, or it may have additional variables in it, one of which you wish to use for homogenization. Here is an example of the latter. We make another ring with a new variable t in it, transfer the ideal, and then homogenize the ideal.

i6 : S = ZZ/101[a..d,t];
i7 : substitute(I,S)

             2     2     2    3   5
o7 = ideal (a b - c , a*b  - d , c  - d)

o7 : Ideal of S
i8 : homogenize(oo,t)

             2     2      2    3   5      4
o8 = ideal (a b - c t, a*b  - d , c  - d*t )

o8 : Ideal of S

In this case, the substitution was done according to the names of the variables in the two rings. There are more explicit ways to specify the substitution to be performed. Here is one where we list the new values for all the variables.

i9 : T = ZZ/101[x,y,z,t];
i10 : substitute(I,{a=>x^10,b=>y^10,c=>z^10,d=>t^10})

              20 10    20   10 20    30   50    10
o10 = ideal (x  y   - z  , x  y   - t  , z   - t  )

o10 : Ideal of T

Now notice that the variable a appears to be an element of S. The creation of the ring S supplanted the earlier value.

i11 : a

o11 = a

o11 : S

We restore the variables of R to visibility.

i12 : use R

o12 = R

o12 : PolynomialRing

To recover the generators of an ideal as a matrix, use generators.

i13 : generators J

o13 = {0} | a2 c2 b2 d2 |

              1       4
o13 : Matrix R  <--- R

Use the operator % to reduce a ring element with respect to a Groebner basis of the ideal.

i14 : (1+a+a^3+a^4) % J

o14 = a + 1

o14 : R

Membership in the ideal may be tested by comparing the answer to 0 with ==.

i15 : (1+a+a^3+a^4) % J == 0

o15 = false
i16 : a^4 % J == 0

o16 = true

The usual algebraic operations on ideals are available.

i17 : I+J

              2     2     2    3   5       2   2   2   2
o17 = ideal (a b - c , a*b  - d , c  - d, a , c , b , d )

o17 : Ideal of R
i18 : intersect(I,J)

                  2    3     2     2   5     2   7    2    2 5    2    2 5    2
o18 = ideal (- a*b  + d , - a b + c , c d - d , c  - c d, b c  - b d, a c  - a d)

o18 : Ideal of R
i19 : I*J

              4     2 2   2   2    4   2 3    2 2   2   2    2 2   3 2    2 3     2 2    2 3     4    2 3     2 2    5   2 5    2    7    2    2 5    2    5 2    3
o19 = ideal (a b - a c , a b*c  - c , a b  - b c , a b*d  - c d , a b  - a d , a*b c  - c d , a*b  - b d , a*b d  - d , a c  - a d, c  - c d, b c  - b d, c d  - d )

o19 : Ideal of R
i20 : J:I

                 2   2   2
o20 = ideal (d, c , b , a )

o20 : Ideal of R
i21 : radical J

o21 = ideal (d, c, b, a)

o21 : Ideal of R

We may ask whether one ideal is contained in another.

i22 : isSubset(I,J)

o22 = false
i23 : isSubset(I,I+J)

o23 = true
i24 : isSubset(I+J,J)

o24 = false

Once you have an ideal, then you may construct the quotient ring or the quotient module (there is a difference). Here is the quotient ring.

i25 : R/I

                    R
o25 = -----------------------------
        2     2     2    3   5
      (a b - c , a*b  - d , c  - d)

o25 : QuotientRing

Here is the quotient module.

i26 : M = R^1/I

o26 = cokernel {0} | a2b-c2 ab2-d3 c5-d |

                               1
o26 : R - module, quotient of R

And if you want the module underlying I itself, you can get it with module.

i27 : module I

o27 = image {0} | a2b-c2 ab2-d3 c5-d |

                                1
o27 : R - module, submodule of R

In general, when an ideal is used as an argument to a function which usually would be given a module, we try to make an informed choice about whether the user intends the ideal to be used as a module directly, or whether the quotient module is more suitable. In homological functions such as Ext and Tor the underlying module is used. Here are some examples where the quotient module is used.

A free resolution of R^1/I can be obtained with resolution.

i28 : resolution I

       1      3      3      1
o28 = R  <-- R  <-- R  <-- R
                           
      0      1      2      3

o28 : ChainComplex

The Krull dimension or codimension of the support of the quotient module can be obtained.

i29 : dim I

o29 = 1
i30 : dim J

o30 = 0
i31 : codim I

o31 = 3

(Beware that for a homogeneous ideal the dimension of its projective variety is one less than the number provided by dim.)

If the dimension of the quotient module as a vector space is needed, use basis to get a matrix whose columns form a basis, and compute the dimension from it.

i32 : basis (R^1/J)

o32 = {0} | 1 a ab abc abcd abd ac acd ad b bc bcd bd c cd d |

o32 : Matrix
i33 : rank source oo

o33 = 16

(Here oo refers to the result on the previous line.

Other useful functions for dealing with ideals include annihilator, decompose, fittingIdeal, module, quotient, radical, removeLowestDimension, and top.


topindexpreviousupnext