There are several methods to eliminate variables in Macaulay2.
i1 : A = QQ[t,x,y,z];
|
i2 : I = ideal"t2+x2+y2+z2,t2+2x2-xy-z2,t+y3-z3";
o2 : Ideal of A
|
i3 : eliminate(I,t)
2 2 2 6 3 3 6 2 2
o3 = ideal (x - x*y - y - 2z , y - 2y z + z + x*y + 2y + 3z )
o3 : Ideal of A
|
Alternatively, one may do it by hand: the elements of the Groebner basis under an elimination order not involving
t generate the elimination ideal.
i4 : A1 = QQ[t,x,y,z,MonomialOrder=>{1,3}];
|
i5 : I = substitute(I,A1);
o5 : Ideal of A1
|
i6 : transpose gens gb I
o6 = {-2} | x2-xy-y2-2z2 |
{-6} | y6-2y3z3+z6+xy+2y2+3z2 |
{-3} | t+y3-z3 |
3 1
o6 : Matrix A1 <-- A1
|
Here is another elimination ideal. Weights not given are assumed to be zero.
i7 : A2 = QQ[t,x,y,z,MonomialOrder=>Weights=>{1}];
|
i8 : I = substitute(I,A2);
o8 : Ideal of A2
|
i9 : transpose gens gb I
o9 = {-2} | x2-xy-y2-2z2 |
{-6} | y6-2y3z3+z6+xy+2y2+3z2 |
{-3} | t+y3-z3 |
3 1
o9 : Matrix A2 <-- A2
|
The same order as the previous one:
i10 : A3 = QQ[t,x,y,z,MonomialOrder=>Eliminate 1];
|
i11 : I = substitute(I,A3);
o11 : Ideal of A3
|
i12 : transpose gens gb I
o12 = {-2} | x2-xy-y2-2z2 |
{-6} | y6-2y3z3+z6+xy+2y2+3z2 |
{-3} | t+y3-z3 |
3 1
o12 : Matrix A3 <-- A3
|