restart
R=QQ[x,y]
I=ideal(x*y-1)
eliminate(x,I)
--so the closure of the projection is all of k^1
--We can also use elimination to find algebraic relations
--Consider the power sums:
restart
R=QQ[p_1..p_4,x..z]
--let the p_i's denote the ith power sum x^i+y^i+z^i
--the first 4 power sums are
I=ideal for i from 1 to 4 list (p_i-(x^i+y^i+z^i))
-- projecting onto (p_1,...,p_4) will tell us how the different power sums
-- are related
eliminate({x,y,z},I)
--or
eliminate(toList(x..z),I)
--this can be done with a lex GB
--(or actually some other monomial orders, called elimination orders, as well)
restart
S=QQ[x..z,p_1..p_4,MonomialOrder=>Lex]
-- we want Lex with p_1Lex]
-- in general we would just take all the polynomials in G which are only in QQ[p_1..p_4]
-- in this case there is only one.
restart
R=QQ[x..z,p_1..p_4,MonomialOrder=>{Eliminate (3)}];
I=ideal for i from 1 to 4 list (p_i-(x^i+y^i+z^i))
ideal selectInSubring(1, groebnerBasis(I))
--Now consider an explicit power sum
restart
S=QQ[x..z,MonomialOrder=>Lex]
I=ideal for i from 1 to 3 list (i-(x^i+y^i+z^i))
degree I
G=ideal groebnerBasis I
needsPackage "NumericalAlgebraicGeometry"
zcoords= for sol in solveSystem {sub(G_0,CC[z])} list first coordinates sol
S2=CC[y,z]
gyz=sub(G_1,S2)
polysy=sub(gyz,{z=>zcoords_0})
ypoints=solveSystem({sub(polysy,CC[y])})
ycoords=for p in ypoints list first coordinates p
sub(gyz,{S2_1=>zcoords_0,S2_0=>ycoords_0})
sub(gyz,{S2_1=>zcoords_0,S2_0=>ycoords_1})
--this gives us two of the six solutions, doing the same for the other 2 roots of G_0
--gives the remaining 4
solveSystem flatten entries gens I
--the elimination theorem tells us that
-- the first polnomial is a GB for I \cap QQ[z]
-- the first two for I \cap QQ[y,z]
--this means that the roots of first equation
--are all roots that project to the the z coordinate from
-- C^3... so we can solve by back subsitution to obtain all
--solutons to the system
--In this case we know we go the correct number of solutions by listing projections
--since we found 6 distinct solutions and
degree I
radical(I)==I
dim I