# How to find the generic initial ideal?

Here is an example from Ezra Miller's book: Combinatorial Commutative Algebra,p26-27

Let $f,g\in k[x_1,x_2,x_3,x_4]$ be a generic forms of degree $d$ and $e$, the generic initial ideal of $I=\langle f,g\rangle$ for both the lexicographic order and the inverse lexicographic order.
When $(d,e)=(2,2)$,the ideals $J=\operatorname{gin}_{\operatorname{lex}}(I)$ are $(x_2^4,x_1x_3^2,x_1x_2,x_1^2)$, the ideal $J=\operatorname{gin}_{\operatorname{revlex}}(I)$ are $(x_2^3,x_1x_2,x_1^2)$.

How to find it?

• By the way, it might be worth mentioning that this book is by Ezra Miller and Bernd Sturmfels. – Sam Hopkins Jan 13 '15 at 7:40

You should apply a generic linear coordinate transform to the ideal and then compute the initial ideal. The matrices for which the result is the generic initial ideal is a (Zariski) open subset (Lemma 2.6, in the book). In particular the complement is of lower dimension.
Leaving distribution issues aside, if you 'pick a random coordinate transform', then you'll always find the generic initial ideal. In practice you'll find it with high probability. There is also an implementation in Macaulay2

Edit: Here is one way to computer-prove the statements from the book. To do this I make a ring in which the coefficients of $f,g$ are extra variables. There are 10 degree 2 monomials in four variables, therefore we need a ring with 10+10+4 variables. Here is the Macaulay2 code:

S = QQ[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10, x1,x2,x3,x4]
ba = {x1^2, x1*x2, x1*x3, x1*x4, x2^2, x2*x3, x2*x4, x3^2, x3*x4, x4^2}
a={a1,a2,a3,a4,a5,a6,a7,a8,a9,a10}  -- coefficients of f
b={b1,b2,b3,b4,b5,b6,b7,b8,b9,b10}  -- coefficients of g
f = sum (for i to 9 list a#i*ba#i)
g = sum (for i to 9 list b#i*ba#i)
I = ideal (f,g)
monomialIdeal I  -- returns the initial ideal


Running it computes the revlex initial ideal because revlex is the default order. The output is $(a_1 x_1^2,b_1 x_1^2,a_2 b_1x_1 x_2,a_5 b_1 x_1 x_2^2,a_1 a_5 b_2 x_1 x_2^2,a_5^2 b_1^2 x_2^3)$ and thus making the $a_i$ and $b_i$ invertible we find the claimed result. For lex you have to change the variable and monomial order on $S$. One has to be a bit careful with the ordering of the variables, because M2 does not know that the $a_i$ and $b_i$ are invertible. Putting the $x_1$ last does the right thing for revlex(this needs a quick check). The Macaulay2 package that I linked is for a concrete ideal (not the generic complete intersection) like in the example.

• I am just a beginner,does any example to show it? – Strongart Apr 15 '12 at 10:48
• Maybe my question is not very exact,MY interesting is not at the computer algebra,I just want to know the method to find or prove the generic initial ideal.If my example is something complicated to work by hand,you can change other easy case.Miller's book use the comprehensive Grobner basis,does it important? – Strongart Apr 19 '12 at 11:47
• As I said, to find/prove the generic intitial ideal you have to do a generic coordinate transform and compute the initial ideal. Whether this can be carried out depends on the ideal that you are giving. If you want it for just one ideal, then you can choose a random coordinate transform and with probability one you are fine. If you want a class of examples, like "generated by two forms of degree $d,e$ then you need to do it in general. Note that the code that I gave is that 'more general'. It proves the statement in the book, it is not computing an example. – Thomas Kahle Apr 27 '12 at 12:01

The general problem of computing invariants of the lexicographic generic initial ideal of an ideal is discussed in the last chapter of Mark Green Barcelona's notes

There are papers devoted in particular to the study of gin-lex of ideals defining curves (not only complete intersections) see for example math/0402418 and arXiv:1108.0045.