--Segre varieties
--we want to compute the ideal of the Segre variety P^1xP^1xP^1 which is naturally embedded in P^7
Target::=Q[x[0..7]];
--a point of P^1xP^1xP^1 is described has [r1,r2]x[s1,s2]x[t1,t2] and it is mapped in P^7
--using the monomial si * tj, i<>j
Use Tot::=Q[r[1..2],s[1..2],t[1..2],x[0..7]];
--we need the forms embedding the Segre variety
F:=[];
For L:=1 To 2 Do
For I:=1 To 2 Do
For J:=1 To 2 Do
Append(F,r[L]*s[I]*t[J]);
EndFor;
EndFor;
Endfor;
--the ideal for elimination
I:=Ideal([x[J-1]-F[J] | J In 1..8]);
K:=Elim(r[1]..t[2],I);
Use Target;
IS:=Ideal(BringIn(Gens(K)));
Hilbert(Target/IS);
--Ex 1c compute the ideal of the Segre variety P^1xP^1 embedded in P^3
--Ex 2c compute the ideal of the variety of secant lines of P^1xP^1xP^1
--Ex 3c consider in P^4 two lines and determinane the ideal of their join (use prametrization for the lines, take a general point on each of the line, joinr the points, eliminate)
--Ex 4c given a line and a conic in P^4 use Terracini's lemma to compute the dimension of their join. Determine the ideal of the join using elimination. Is there any connection with the Segre variety P^xP^1xP^1?