codim M -- calculate the codimension of the support of a module M.
codim I -- calculate the codimension of the quotient ring R/I.
If M is an R-module, then the number return by this routine is dim R - dim M. This does not agree with the usual definition of codimension unless Spec R is irreducible.
i1 : R = QQ[x,y]/(ideal(x,y) * ideal(x-1)) |
i2 : codim (R^1/(x,y)) |
Warning: over the integers, the computation effectively tensors first with the rational numbers, yielding the wrong answer in some cases.
Warning: we don't really compute the codimension when the ring has components of different dimension!
Class of returned value: ZZ -- the class of all integersWays to use codim :