-- Variety of secant lines
-- for example wewnt to determine Sec_1(C) for C the rational normal curve of P^4
-- the coordinate ring of P^4
Target::=QQ[x[0..4]];
-- the ring where to perform elimination
Tot::=QQ[s[1..2],t[1..2],a,b,x[0..4]];
-- we make ready to work in the Tot ring
Use Tot;
-- we consider the curve parameterized by degree four monomial in s and t, i.e. the rational normal curve of P^4
-- we now pick two general points on the curve
P1:=[s[1]^4,s[1]^3t[1],s[1]^2t[1]^2,s[1]t[1]^3,t[1]^4];
P2:=[s[2]^4,s[2]^3t[2],s[2]^2t[2]^2,s[2]t[2]^3,t[2]^4];
-- we now pick a general point P on the line joining P1 and P2, i.e. P=aP1+bP2
P:=[aP1[I]+bP2[I] | I In 1..5];
-- we now consider the map into P^4 defined by the polynomials P[1],..,P[5] and we want to compute the ideal of the closure of its image
-- hence we define the ideal
I:=Ideal([x[I-1]-P[I] | I In 1..5]);
-- and we eliminate the parameters s[1..2],t[1..2],a,b
K:=Elim(s[1]..b,I);
-- comment the result: is what we expected? is it possible predict the degree?
-- Es 1b determine the ideal of the variety of secant lines of the rational normal curve of P^3 and explain the result
-- Es 2b determine the ideal of the variety of secant lines of a rational curve of degree 3 in P^4
-- Es 3b consider the rational normal curve of P^5 and determine its variety of secant planes