///////////////////////////////////////////////////////////////////////////// version="$Id$"; category="Tropical Geometry"; info=" LIBRARY: realizationMatroids.lib Deciding Relative Realizability for Tropical Fan Curves in 2-Dimensional Matroidal Fans AUTHORS: Anna Lena Winstel, winstel@mathematik.uni-kl.de OVERVIEW: In tropical geometry, one question to ask is the following: given a one-dimensional balanced polyhedral fan C which is set theoretically contained in the tropicalization trop(Y) of an algebraic variety Y in K^n, where K is any algebraically closed field, does there exist a curve X in Y such that trop(X) = C? This equality of C and trop(X) denotes an equality of both, the fans trop(X) and C and their multiplicities on the maximal cones. The relative realization space of C with respect to Y is the space of all algebraic curves in Y which tropicalize to C. This library provides procedures deciding relative realizability for tropical fan curves, i.e. one-dimensional balanced polyhedral fans, contained in two-dimensional matroidal fans trop(Y) where Y is a projective plane in K^n. Here K is any algebraically closed field. NOTATION: If Y is a projective plane in (n-1)-dimensional projective space, we consider trop(Y) in R^n/<1>. Moreover, for the relative realization space of C with respect to Y we only consider algebraic curves of degree deg(C) in Y which tropicalize to C. PROCEDURES: realizationDim(I,C); For a given tropical fan curve C in trop(Y), where Y = V(I) is a projective plane, this routine returns the dimension of the relative realization space of C with respect to Y, that is the space of all algebraic curves of degree deg(C) in Y which tropicalize to C. If the realization space is empty, the output is set to -1. This routine may be used for fields of any characteristic. irrRealizationDim(I,C); This routine returns the dimension of the irreducible relative realization space of the tropical fan curve C with respect to Y = V(I), that is the space of all irreducible algebraic curves of degree deg(C) in Y which tropicalize to C. If the irreducible relative realization space is empty, the output is set to -1. This routine may be used for fields of any characteristic. realizationDimPoly(I,C); If C is a tropical fan curve contained in the tropicalization trop(Y) of the projective plane Y = V(I) such that the relative realization space M of C is non-empty, this routine returns the tuple (dim(M),f) where f is an example of a homogeneous polynomial of degree deg(C) cutting out a curve X in Y which tropicalizes to C. If M is empty, the output is set to -1. This routine only considers polynomials with integer coefficients, hence it should only be used when working over fields of characteristic zero. "; LIB "control.lib"; LIB "qhmoduli.lib"; static proc gcdvector(intvec v) { int i; int ggt = 0; for(i=1;i<=size(v);i++) { ggt = gcd(ggt,v[i]); if( ggt == 1 ) { return(ggt); } } return(ggt); } static proc balanced(list lInput) { list ba; int i; int j; if(size(lInput)>0) { for(i=1;i<=size(lInput[1]);i++) { ba[i] = 0; for(j=1;j<=size(lInput);j++) { ba[i] = ba[i] + lInput[j][i]; } } int boolean = 1; for(i=2;i<=size(ba);i++) { if(ba[i] != ba[1]) { boolean = 0; } } if(boolean == 1) { return(ba[1]); } else { return(0); } } else { return(0); } } static proc genPoly(int d, int i, int j, int k) { int ii; int ij; int ik = 1; poly f = 0; for(ii=0;ii<=d;ii++) { for(ij=0;ij<=d-ii;ij++) { f = f + a(ik)*x(i)^(d-ii-ij)*x(j)^ij*x(k)^ii; ik = ik + 1; } } return(f); } static proc prodvar(int n) { int i; poly f = 1; for(i=1;i<=n;i++) { f = f * x(i); } return(f); } static proc lessThan(int i, int j, intvec v, intvec w) { return (v[i]*w[j] can be written as [w] = m*[v] where [v] is the primitive generator of K and m is the multiplicity of K. This routine may be used for fields of any characteristic. RETURNS: the dimension of the relative realization space of the tropical curve C with respect to Y, and -1 if the relative realization space is empty. EXAMPLE: example realizationDim; shows an example" { int ret = realizationDimIdeal(iInput,lInput)[1]; if(ret[1] == -2) { printf("WARNING: no computation possible"); return(-2); } else { return(ret); } } example { "EXAMPLE:"; echo=2; ring r = 0,(x(1..4)),dp; ideal I = x(1)+x(2)+x(3)+x(4); list C = list(intvec(3,2,0,0),intvec(0,1,0,2),intvec(0,0,3,1)); // C represents the tropical fan curve which consists of the cones // cone([(3,2,0,0)]), cone([(0,1,0,2)]), cone([(0,0,3,1)]) // (with multiplicity 1 each) realizationDim(I,C); ring s = 2,(x(1..4)),dp; ideal J = x(1)+x(2)+x(3)+x(4); realizationDim(J,C); } proc irrRealizationDim(ideal iInput, list lInput) "USAGE: irrRealizationDim(I,C); where I is a homogeneous linear ideal defining the projective plane Y = V(I) and C is a list of intvectors such that each intvector represents a one-dimensional cone in the tropical fan curve whose irreducible relative realizability should be checked. This representation is done in the following way: a one-dimensional cone K is represented by a vector w whose equivalence class [w] in R^n/<1> can be written as [w] = m*[v] where [v] is the primitive generator of K and m is the multiplicity of K. This routine may be used for fields of any characteristic. RETURNS: the dimension of the irreducible relative realization space of C with respect to Y, and -1 if the irreducible realization space is empty. EXAMPLE: example irrRealizationDim; shows an example" { int i; int i_dim = realizationDim(iInput,lInput); if(i_dim > -1) { //check if also realizable by an irreducible curve list lweight; int i_rdim = -1; //substitute the vectors by a primitve one and store the multiplicities for(i=1;i<=size(lInput);i++) { lweight[i] = gcdvector(lInput[i]); lInput[i] = lInput[i] div lweight[i]; } //find all decompositions into two tropical curves intvec tm; for(i=1;i<=size(lInput);i++) { tm[i] = 0; } int na; list C1; list C2; int dimC1; int dimC2; while(na==0) { na = 1; for(i=1;i<=size(lInput);i++) { if(tm[i] < lweight[i]) { tm[i] = tm[i]+1; na = 0; i = size(lInput); } else { tm[i] = 0; } } if(na == 0) { C1 = list(); C2 = list(); for(i=1;i<=size(lInput);i++) { if(tm[i] > 0) { C1 = C1 + list(tm[i]*lInput[i]); if(tm[i] < lweight[i]) { C2 = C2 + list((lweight[i]-tm[i])*lInput[i]); } } else { C2 = C2 + list(lweight[i]*lInput[i]); } } if((balanced(C2) != 0) and (balanced(C2) <= balanced(C1))) { dimC1 = realizationDim(iInput,C1); dimC2 = realizationDim(iInput,C2); if((dimC1 >= 0) and (dimC2 >= 0)) { i_rdim = Max(intvec(i_rdim,dimC1 + dimC2)); } } } } if(i_rdim < i_dim) { return(i_dim); } else { return(-1); } } else { return(-1); } } example { "EXAMPLE:"; echo=2; ring r = 0,(x(1..4)),dp; ideal I = x(1)+x(2)+x(3)+x(4); list C = list(intvec(2,2,0,0),intvec(0,0,2,2)); // C represents the tropical fan curve which consists of the cones // cone([(1,1,0,0)]) and cone([(1,1,0,0)]), both with multiplicity 2 realizationDim(I,C); irrRealizationDim(I,C); ring s = 3,(x(1..4)),dp; ideal J = x(1)+x(2)+x(3)+x(4); realizationDim(J,C); irrRealizationDim(J,C); } proc realizationDimPoly(ideal iInput, list lInput) "USAGE: realizationDimPoly(I,C); where I is a homogeneous linear ideal defining the projective plane Y = V(I) and C is a list of intvectors such that each intvector represents a one-dimensional cone in the tropical fan curve whose relative realizability should be checked. This representation is done in the following way: the one-dimensional cone K is represented by a vector w whose equivalence class [w] in R^n/<1> can be written as [w] = m*[v] where [v] is the primitive generator of K and m is the multiplicity of K. This routine can only be used when working over fields of characteristic zero. RETURNS: If the relative realization space of the tropical fan curve C is non-empty, this routine returns the tuple (r,f), where r is the dimension of the relative realization space and f is an example of a homogeneous polynomial of degree deg(C) cutting out a curve X in Y which tropicalizes to C. In case the relative realization space is empty, the output is set to -1. EXAMPLE: example realizationDimPoly; shows an example" { def save = basering; int d = balanced(lInput); int n = size(lInput[1]); int N = (d+2)*(d+1) div 2; int i; ring r = 0,(x(1..n),a(1..N)),dp; list ret = realizationDimIdeal(fetch(save,iInput),lInput); int realdim = ret[1]; if(realdim != -1) { ideal E = ret[2]; list NE = ret[3]; E = std(E); //find variables which are free to choose intvec v; for(i=1;i<=size(E);i++) { v = v + leadexp(E[i]); } int j; int k; int boolean; ideal E1; list NE1; poly f; poly g; //initialize the list of the free variables list lValues; if(size(v) > 1) { for(j=1;j<=N;j++) { if(v[j+n] == 0) { lValues = lValues + list(list(a(j),0)); } } } else { for(j=1;j<=N;j++) { lValues = lValues + list(list(a(j),0)); } } //try to find an easy solution boolean = 1; for(j=1;j<=size(lValues);j++) { if(boolean == 1) { lValues[j][2] = 0; } else { lValues[j][2] = lValues[j][2] + 1; } boolean = 1; E1 = E; for(i=1;i<=size(E1);i++) { for(k=1;k<=j;k++) { E1[i] = subst(E1[i],lValues[k][1],lValues[k][2]); } } NE1 = NE; for(i=1;i<=size(NE);i++) { for(k=1;k<=j;k++) { NE1[i] = subst(NE1[i],lValues[k][1],lValues[k][2]); } } E1 = std(E1); for(i=1;i<=size(NE1);i++) { if(reduce(NE1[i],E1) == 0) { boolean = 0; } } if(boolean == 0) { j = j-1; } } //compute the values of the dependent variables for(j=1;j<=size(E);j++) { f = E[j]; for(k=1;k<=size(lValues);k++) { f = subst(f,lValues[k][1],lValues[k][2]); } if(leadcoef(f) != 1) { for(k=1;k<=size(lValues);k++) { lValues[k][2] = lValues[k][2] * leadcoef(f); } } f = subst(f,leadmonom(f),0); lValues = lValues + list(list(leadmonom(E[j]),-f)); } g = genPoly(d,ret[4][1],ret[4][2],ret[4][3]); for(j=1;j<=N;j++) { g = subst(g,lValues[j][1],lValues[j][2]); } setring save; return(realdim,fetch(r,g)); } else { return(-1); } } example { "EXAMPLE:"; echo=2; ring r = 0,(x(1..4)),dp; ideal I = x(1)+x(2)+x(3)+x(4); list C = list(intvec(2,2,0,0),intvec(0,0,2,2)); // C represents the tropical fan curve which consists of the cones // cone([(1,1,0,0)]) and cone([(1,1,0,0)]), both with multiplicity 2 realizationDimPoly(I,C); C = list(intvec(0,0,0,4),intvec(0,1,3,0),intvec(1,0,1,0),intvec(0,2,0,0),intvec(3,1,0,0)); // C represents the tropical fan curve which consists of the cones // cone([(0,0,0,1)]) with multiplicity 4, // cone([(0,1,3,0)]), cone([(1,0,1,0)]) both with multiplicity 1, // cone([(0,1,0,0)]) with multiplicity 2, and // cone([(3,1,0,0)]) with multiplicity 1 realizationDimPoly(I,C); }