---
title: "Dimension of Ideals"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/LocalPolynomialRings/dimension.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/LocalPolynomialRings/dimension.md"
part: "Commutative Algebra"
chapter: "Local Polynomial Rings"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Commutative Algebra", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/index-commutative-algebra.md"}
  - {"title": "Local Polynomial Rings", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/LocalPolynomialRings/index-local-polynomial-rings.md"}
prev: {"title": "Changing Monomial Order", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/LocalPolynomialRings/change-order.md"}
next: {"title": "Bibliography", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/LocalPolynomialRings/bibliography.md"}
intrinsics:
  - {"name": "Dimension", "signature": "Dimension(I): RngMPolLoc -> RngIntElt, [ RngIntElt ]"}
---

<a id="dimension"></a>
<a id="gb-secdim"></a>
# Dimension of Ideals

Let $I$ be an ideal of the local polynomial ring $K[x_1, \ldots, x_n]_{\langle x_1, \ldots, x_n\rangle}$, where $K$ is a field. As for polynomial rings, the dimension of the ideal $I$ can be defined as the maximum of the cardinalities of all the independent sets modulo $I$ (see Section [Dimension of Ideals](https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/LocalPolynomialRings/dimension.md#gb-secdim) for details).

<a id="function-rngmpolloc-dimension"></a>
## `Dimension(I): RngMPolLoc -> RngIntElt, [ RngIntElt ]`

Given an ideal $I$ of a local polynomial ring $R$ defined over a field, return the dimension $d$ of $I$, together with a (sorted) sequence $U$ of integers of length $d$ such that the variables of $P$ corresponding to the integers of $U$ constitute a maximally independent set modulo $I$. If $I$ is the full local polynomial ring $R$, the dimension is defined to be $-1$, and the second return value is not set. The algorithm implemented is that given in [[BW93](https://docs.magma-maths.org/v2.30-1/references.md#cite-beckerweispfenning), p. 449].
