-- Veronese varieties
-- how can we check whether a given polynomial is a power of a linear form?
-- for example consider cubic forms in three variables
Use Linear::=Q[a,b,c];
F:=(a+b+2c)^3;
G:=F+a^3;
-- cubics in three variables are parameterized by points in P^9 hence we define
Powers::=Q[x[0..9]];
-- we consider the Veronese variety obtained by the map P^2-->P^9 sending a linear form into its cube L |--> L^3
-- and we want to determine its equations, hence we need the ring Tot to perform elimination
Use Tot::=QQ[a,b,c,x[0..9]];
-- we need all degree 3 monomial
Use Linear;
Monomials:=Gens(Ideal(a,b,c)^3);
Use Tot;
Monomials:=BringIn(Monomials);
I:=Ideal([x[J-1]-Monomials[J] | J In 1..10]);
K:=Elim(a..c,I);
Use Powers;
-- the ideal of the Veronese is
IV:=Ideal(BringIn(Gens(K)));
-- to which point of P^9 corresponds the form F?
Use Linear;
Monomials:=BringIn(Monomials);
-- the form (a+b+c)^3 corresponds to the point [1:1:1:1:1:1:1:1:1:1] in P^9
-- the coordinate of F as a point of P^9 are
PF:=[CoeffOfTerm(Monomials[I],F)/CoeffOfTerm(Monomials[I],(a+b+c)^3) | I In 1..10];
-- the coordinate of G as a point of P^9 are
PG:=[CoeffOfTerm(Monomials[I],G)/CoeffOfTerm(Monomials[I],(a+b+c)^3) | I In 1..10];
-- to verify whether F is a cube it is enough to evaluate each generator of IV in the point PF
Use Powers;
Foreach T In Gens(IV) Do
Eval(T,PF);
Endforeach;
Foreach T In Gens(IV) Do
Eval(T,PG);
Endforeach;
-- Ex 1a for forms of degree 2 there is an easy way to determine the number of squares needed to present them as a sum of squares of linear forms(no elimination needed). Analyse (using CoCoA) the cases of two and three variables to find out a general method.
-- Ex 2a how can we check whether a given cube is a sum of two cubes? what about three or four cubes? is it possible to do this using equations?
-- Ex 3a consider binary forms, i.e. homogeneous elements in k[s,t]. How many squares do we need to write the *generic* degree 2 binary form? What about *any* degree two binary form? (To answer just use one conic curve in the plane)