# dim(Ideal) -- compute the Krull dimension

## Synopsis

• Function: dim
• Usage:
dim I
• Inputs:
• Outputs:

## Description

Computes the Krull dimension of the base ring of I mod I.

The ideal of 3x3 commuting matrices:

 i1 : R = ZZ/101[x_(0,0)..x_(2,2),y_(0,0)..y_(2,2)] o1 = R o1 : PolynomialRing i2 : M = genericMatrix(R,x_(0,0),3,3) o2 = | x_(0,0) x_(1,0) x_(2,0) | | x_(0,1) x_(1,1) x_(2,1) | | x_(0,2) x_(1,2) x_(2,2) | 3 3 o2 : Matrix R <--- R i3 : N = genericMatrix(R,y_(0,0),3,3) o3 = | y_(0,0) y_(1,0) y_(2,0) | | y_(0,1) y_(1,1) y_(2,1) | | y_(0,2) y_(1,2) y_(2,2) | 3 3 o3 : Matrix R <--- R i4 : I = ideal flatten(M*N-N*M); o4 : Ideal of R i5 : dim I o5 = 12
The dimension of a Stanley-Reisner monomial ideal associated to a simplicial complex.

A hollow tetrahedron:

 i6 : needsPackage "SimplicialComplexes" o6 = SimplicialComplexes o6 : Package i7 : R = QQ[a..d] o7 = R o7 : PolynomialRing i8 : D = simplicialComplex {a*b*c,a*b*d,a*c*d,b*c*d} o8 = simplicialComplex | bcd acd abd abc | o8 : SimplicialComplex i9 : I = monomialIdeal D o9 = monomialIdeal(a*b*c*d) o9 : MonomialIdeal of R i10 : facets D o10 = {b*c*d, a*c*d, a*b*d, a*b*c} o10 : List i11 : dim D o11 = 2 i12 : dim I o12 = 3
Note that the dimension of the zero ideal is -1.