Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » Type » Ring » EngineRing » QuotientRing » codim(QuotientRing)
next | previous | forward | backward | up | index | toc

# codim(QuotientRing) -- compute the codimension

- Function: codim
- Usage:
    `codim R`
- Inputs:
  - R, a quotient ring
- Optional inputs:
  - Generic => ..., default value false,
- Outputs:
  - an integer, the codimension of R

## Description

Computes the codimension of the presentation ideal of R over its ambient polynomial ring.

    i1 : R = QQ[x,y]/(ideal(x,y) * ideal(x-1))

    o1 = R

    o1 : QuotientRing

    i2 : codim R

    o2 = 1

However, the following may not be the expected result.

    i3 : R = QQ[x,y]/(ideal(x,y) * ideal(x-1))

    o3 = R

    o3 : QuotientRing

    i4 : codim R

    o4 = 1

    i5 : codim (R/x)

    o5 = 2

## See also

- dim(QuotientRing) -- compute the Krull dimension

## Ways to use this method:

- `codim(PolynomialRing)`
- codim(QuotientRing) -- compute the codimension

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/codim-doc.m2:48:0.