# Dimension of affine variety

Assume that I have $k$ polynomials $f_1(x_1,\ldots x_n),f_2(x_1,\ldots x_n),\ldots f_k(x_1,\ldots x_n)$ in $n>k$ variables. Is it possible to calculate, ,i.e., does there exist a fast algorithm, the dimension of the variety $Z(f_1,\ldots f_k)$?

Does there exist a good criterion to check if the dimension of $Z(f_1,\ldots f_k)$ is $n-k$ when all $f_i$ are quadratic polynomials?

-
A Google search for the terms "polynomials variety algorithm" points you to the book "Ideals, varieties, and algorithms" by Cox, Little, and O'Shea. You will find the answer to your question there (among many other places). –  Artie Prendergast-Smith Oct 27 '11 at 20:04

The codimension of $X=Z(f_1,\ldots,f_k)$ in $\mathbf{A}^n$ equals $k$, or equivalently, the dimension of $X$ is $n-k$, if $(f_1,\ldots,f_k)$ is a regular sequence.

Let me explain what a regular sequence is. Sorry if I'm writing things you already know.

Let $A$ be a noetherian ring. An element $x\in A$ is called regular if the multiplication by $x$ is injective. A sequence $(x_1,\ldots,x_n)$ of elements $x_1,\ldots,x_n\in A$ is said to be a regular sequence if $x_1$ is regular and the image of $x_i$ in $A/(x_1A+\ldots+ x_{i-1}A)$ is regular for all $i=2,\ldots,n$.

You can use Krull's principal ideal theorem to show that any ideal $I$ of $A$ which can be generated by a regular sequence $(x_1,\ldots,x_r)$ satisfies $\textrm{ht}( I) = r$.

So one way to find out if the dimension of $X$ is $n-k$ is to check the above condition.

If $k=1$ and $f_1\neq 0$ we're good.

Let's see how it goes for $k=2$. Let's suppose that $f_1\neq 0$ and that $f_2$ is not contained in the ideal $(f_1)$. Now, you have to check that the image of $f_2$ in $k[x_1,\ldots,x_n]/(f_1)$ is regular. So you compute the quotient and check if it's an integral domain. If it's an integral domain, we're good. If not, it might be a bit more difficult to check if $f_2$ is regular in $k[x_1,\ldots,x_n]/(f_1)$. I wouldn't know a fast way of checking if this element is a non-zero divisor at the moment.

This is not a complete answer but I hope it at least helped a bit.

-
Thanks for your answer. Although I if I have variety I still do not know how to calculate its dimention –  Klim Efremenko Oct 27 '11 at 20:29
Klim: did you see my comment? In brief, you do the following: i) run Macaulay 2; ii) define the ring R to be the polynomial ring in n variables, and the ideal I to be generated by the f_i; iii) type "dim Spec(R/I)". –  Artie Prendergast-Smith Oct 27 '11 at 21:45
@Artie: why don't you include this as an answer? –  Sándor Kovács Oct 27 '11 at 22:49
Sandor: because if googling the keywords gives the answer immediately, it probably shouldn't be an MO question... –  Artie Prendergast-Smith Oct 28 '11 at 0:13

You should calculate the Poincare series $P_X(t)$ of the coordinate ring $k[X].$ The the order of the pole $t=1$ is exactly the dimension of the affine variete $X.$ Some of computer algebra systems allows a Poincare series calculation for an input set of polynomials.

-