Changeset 7d56875 in git

Ignore:
Timestamp:
Oct 9, 2008, 11:31:58 AM (15 years ago)
Branches:
Children:
7f1f2a45aaa4363f5fb9be8996b78121813f7ef5
Parents:
fba86f89b3458187b40c5f0d5f6408412d98d295
Message:
*hannes: typos reported by gorzelc

git-svn-id: file:///usr/local/Singular/svn/trunk@11114 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
12 edited

Unmodified
Removed
• Singular/LIB/atkins.lib

 rfba86f8 /////////////////////////////////////////////////////////////////////////////// version="$Id: atkins.lib,v 1.4 2007-07-20 11:26:46 Singular Exp$"; version="$Id: atkins.lib,v 1.5 2008-10-09 09:31:57 Singular Exp$"; category="Teaching"; info=" K is input for the procedure "HilbertClassPolynomial", B describes the number of recursions being calculated - The basis of the the algorithm is the following theorem: - The basis of the algorithm is the following theorem: Let N be an integer coprime to 6 and different from 1 and E be an ellipic curve modulo N. Assume that we know an integer m and a
• Singular/LIB/crypto.lib

 rfba86f8 //GP, last modified 28.6.06 /////////////////////////////////////////////////////////////////////////////// version="$Id: crypto.lib,v 1.5 2008-08-07 16:00:50 Singular Exp$"; version="$Id: crypto.lib,v 1.6 2008-10-09 09:31:57 Singular Exp$"; category="Teaching"; info=" m,q integers ASSUME: gcd(N,6)=1 NOTE:   The basis of the the algorithm is the following theorem: NOTE:   The basis of the algorithm is the following theorem: Given C, an elliptic curve over Z/N, P a point of C(Z/N), m an integer, q a prime with the following properties:
• Singular/LIB/dmodapp.lib

 rfba86f8 ////////////////////////////////////////////////////////////////////////////// version="$Id: dmodapp.lib,v 1.9 2008-10-06 17:04:26 Singular Exp$"; version="$Id: dmodapp.lib,v 1.10 2008-10-09 09:31:57 Singular Exp$"; category="Noncommutative"; info=" @*       graded ring while the Groebner basis is a subset of D. @*       If s<>0, @code{std} is used for Groebner basis computations, otherwise, @*       and by default, @code{slimgb} is used. @*       and by default, @code{slimgb} is used. @*       If t<>0, a matrix ordering is used for Groebner basis computations, @*       otherwise, and by default, a block ordering is used. NOTE:    Activate the output ring with the @code{setring} command. @*       Varnames of the basering should not include t and Dt. @*       In the ouput ring, inF is is the initial Malgrange ideal. @*       In the ouput ring, inF is the initial Malgrange ideal. @*       If s<>0, @code{std} is used for Groebner basis computations, otherwise, @*        and by default, @code{slimgb} is used. @*        and by default, @code{slimgb} is used. @*       If t<>0, a matrix ordering is used for Groebner basis computations, @*       otherwise, and by default, a block ordering is used. EXAMPLE: example initialmalgrange; shows examples " { { int ppl = printlevel - voice +2; def save = basering; { reversevars = int(#[3]); } } if (size(#)>3) { { u0 = #[4]; } } } } } } if (calledfrom == "initialideal") { ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),dp(noofvars-1),lp(1)); ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),dp(noofvars-1),lp(1)); } else // bfctonestep { ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),a(uv),dp(noofvars-1),lp(1)); ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),a(uv),dp(noofvars-1),lp(1)); } } if (calledfrom == "initialideal") { ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),M(@Ord)); ring Dh = 0,(x(1..n),D(1..n),h),(a(@a),M(@Ord)); } else // bfctonestep { ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),M(@Ord)); ring Dh = 0,(t,s,x(n..1),Dt,D(n..1),h),(a(@a),a(@a2),M(@Ord)); } } for (i=1; i<=n; i++) { @relD[i,n+i] = h^2; @relD[i,n+i] = h^2; } } for (i=1; i<=n; i++) { @relD[i+2,n+3+i] = h^2; @relD[i+2,n+3+i] = h^2; } } I = I,t*Dt-s; } } } dbprint(ppl, "starting Groebner basis computation with engine:", whichengine); I = engine(I, whichengine); if (varnames[i] == "t") { ERROR("Variable names should not include t"); ERROR("Variable names should not include t"); } } for (i=1; i<=n; i++) { newvarnames[i+1] = varnames[i]; newvarnames[i+n+2] = "D"+varnames[i]; newvarnames[i+1] = varnames[i]; newvarnames[i+n+2] = "D"+varnames[i]; } rl[2] = newvarnames; } } J[j] = g; J[j] = g; } if (typeof(#[1])=="poly") list LL = ringlist(save); list L; int i; int i; for(i=1;i<=4;i++) { matrix @D = ncr[2]; def @U = ring(L); // 2. create the commutative ring // 2. create the commutative ring setring save; list CL; // TODO static proc charInfo(ideal I) "USAGE:  charInfo(I);  I an ideal "USAGE:  charInfo(I);  I an ideal RETURN:  ring STATUS: experimental, todo proc isFsat(ideal I, poly F) "USAGE:  isFsat(I, F);  I an ideal, F a poly RETURN: int RETURN: int PURPOSE: check whether the ideal I is F-saturated NOTE:    1 is returned if I is F-saturated, otherwise 0 is returned def R = Weyl();    setring R; poly F = x2-y3; ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; DLoc(I, x2-y3); LD0; LD0; BS; } ideal bbs; int srat=0; int HasRatRoots = 0; int sP; for (i=1; i<= size(bs); i++) for (i=1; i<= size(bs); i++) { if (deg(bs[i]) == 1) // no roots! dbprint(ppl,"// -2-4- no integer root, setting s0 = -1"); sP = -1; sP = -1; //      HasRatRoots = 0; // older stuff, here we do substitution HasRatRoots = 1; kill @R3; setring @R4; ideal bs = imap(@R2,bs); // only rationals are the entries ideal bs = imap(@R2,bs); // only rationals are the entries list BS; BS[1] = bs; BS[2] = m; export BS; ideal LD0 = K4; export LD0; return(@R4); return(@R4); } else { { /* SHOULD NEVER GET THERE */ /* no rational/integer roots */ export BS; return(@R2); } } } example; def R = Weyl();    setring R; poly F = x2-y3; ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; def W = SDLoc(I,F);  setring W; // creates ideal LD def U = DLoc0(LD, x2-y3);  setring U; LD0; LD0; BS; } def R = Weyl();   setring R; poly F = x2-y3; ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; ideal I = (y^3 - x^2)*Dx - 2*x, (y^3 - x^2)*Dy + 3*y^2; // I = Dx*F, Dy*F; def W = SDLoc(I,F); setring W; setring U; LD0; BS; BS; // the same with DLoc: setring R;
• Singular/LIB/gmssing.lib

 rfba86f8 /////////////////////////////////////////////////////////////////////////////// version="$Id: gmssing.lib,v 1.11 2007-01-23 15:03:30 Singular Exp$"; version="$Id: gmssing.lib,v 1.12 2008-10-09 09:31:57 Singular Exp$"; category="Singularities"; AUTHOR:   Mathias Schulze, email: mschulze@mathematik.uni-kl.de OVERVIEW: A library to compute invariants related to the the Gauss-Manin system OVERVIEW: A library to compute invariants related to the Gauss-Manin system of an isolated hypersurface singularity
• Singular/LIB/homolog.lib

 rfba86f8 /////////////////////////////////////////////////////////////////////////////// version="$Id: homolog.lib,v 1.26 2008-09-09 09:54:30 Singular Exp$"; version="$Id: homolog.lib,v 1.27 2008-10-09 09:31:57 Singular Exp$"; category="Commutative Algebra"; info=" dbprint(p-1,"// kbase of Ext^2(M,M)", "//  - the columns present the kbase elements in Hom(F(2),F(0))", "//  - F(*) is a a free resolution of M ",kb2); "//  - F(*) is a free resolution of M ",kb2); //-------  compute: cup-products of base-elements ----------------------------- for (i=1;i<=e1;i=i+1)
• Singular/LIB/phindex.lib

 rfba86f8 ////////////////////////////////////////////////////////////////////////////// version="$Id: phindex.lib,v 1.2 2008-08-18 10:42:27 Singular Exp$"; version="$Id: phindex.lib,v 1.3 2008-10-09 09:31:57 Singular Exp$"; category=" "; info=" static proc SigntL(poly M)  //static procedure to compute the signature of any quadratic form. "USAGE:    SigntL(M); M is a quadratic form. RETURN:   The signature of of M of type int. RETURN:   The signature of M of type int. ASSUME:   M is a quadratic form (ply type). "
• Singular/LIB/primdec.lib

 rfba86f8 /////////////////////////////////////////////////////////////////////////////// version="$Id: primdec.lib,v 1.139 2008-03-19 17:44:38 Singular Exp$"; version="$Id: primdec.lib,v 1.140 2008-10-09 09:31:57 Singular Exp$"; category="Commutative Algebra"; info=" // // Computes the radical of I using KL algorithm. // The only difference with the the previous implementation of KL algorithm is // The only difference with the previous implementation of KL algorithm is // that now it uses block dp instead of lp ordering for the reduction to the // zerodimensional case. //                 0 -> Otherwise // ideal ser       Only for radicalKL. (Same as in radicalKL) // list #          Only for radicalKL (If #[1] = 1, // list #          Only for radicalKL (If #[1] = 1, //                    only equiradical is required. //                    It is used to set the value of done.)
• Singular/LIB/redcgs.lib

 rfba86f8 ////////////////////////////////////////////////////////////////////////////// version="$Id: redcgs.lib,v 1.2 2008-08-18 10:42:50 Singular Exp$"; version="$Id: redcgs.lib,v 1.3 2008-10-09 09:31:58 Singular Exp$"; category="General purpose"; info=" PURPOSE:  Comprehensive Groebner Systems. Canonical Forms. The library contains Monte's algorithms to compute disjoint, reduced Comprehensive Groebner Systems (CGS). A CGS is a set of pairs of (segment,basis). The segments S_i are subsets of the parameter space, and the bases B_i are sets of polynomials specializing to Groebner Comprehensive Groebner Systems (CGS). A CGS is a set of pairs of (segment,basis). The segments S_i are subsets of the parameter space, and the bases B_i are sets of polynomials specializing to Groebner bases of the specialized ideal for every point in S_i. The purpose of the routines in this library is to obtain CGS with better properties, namely disjoint segments forming a partition of the parameter space and reduced bases. Reduced bases are sets of polynomials that specialize to the reduced Groebner basis of the specialized ideal preserving the leading power products (lpp). the parameter space and reduced bases. Reduced bases are sets of polynomials that specialize to the reduced Groebner basis of the specialized ideal preserving the leading power products (lpp). The lpp characterize the type of solution in each segment. A further objective is to summarize as much as possible the segments with the same lpp into a single segment, and if possible to obtain a final result that is canonical, i.e. independent of the algorithm and only attached to the given ideal. There are three fundamental routines in the library: mrcgs, rcgs and crcgs. mrcgs (Minimal Reduced CGS) is an algorithm that packs so much as it is able to do (using algorithms adhoc) the segments with the same lpp, obtaining the minimal number of segments. The hypothesis is that the result is also canonical, but for the moment there is no proof of the uniqueness of this minimal packing. Moreover, the segments that are obtained are not locally closed, i.e. there are not There are three fundamental routines in the library: mrcgs, rcgs and crcgs. mrcgs (Minimal Reduced CGS) is an algorithm that packs so much as it is able to do (using algorithms adhoc) the segments with the same lpp, obtaining the minimal number of segments. The hypothesis is that the result is also canonical, but for the moment there is no proof of the uniqueness of this minimal packing. Moreover, the segments that are obtained are not locally closed, i.e. there are not difference of two varieties. On the other side, Michael Wibmer has proved that for homogeneous ideals, all the segments with reduced bases having the same lpp admit a unique basis specializing well. For this purpose it is necessary to extend the description of the elements of the bases to functions, forming sheaves of polynomials instead of simple polynomials, so that the polynomials in a sheaf either preserve the lpp of the corresponding polynomial of of polynomials instead of simple polynomials, so that the polynomials in a sheaf either preserve the lpp of the corresponding polynomial of the specialized Groebner basis (and then it specializes well) or it specializes to 0. Moreover, in a sheaf, for every point in the segments are locally closed, that is can be described as the difference of two varieties. Using Wibmer's Theorem we proved that an affine ideal can be homogenized, than discussed by mrcgs and finally de-homogenized. The bases so obtained can be reduced and specialize well in the segment. If the theoretic objective is reached, and all the segments of the homogenized ideal objective is reached, and all the segments of the homogenized ideal have been packed, locally closed segments will be obtained. If we only homogenize the given basis of the ideal, then we cannot ensure the canonicity of the partition obtained, because there are many different is usually faster than mrcgs and crcgs. But the given partition is not always canonical. Finally it is possible to homogenize the whole affine ideal, and then the packing algorithm will provide canonical segments by dehomogenizing. This corresponds to crcgs routine. It provides the best description of the segments and bases. In contrast crcgs algorithm is usually much more time consuming and it will not always finish in a reasonable time. Moreover it will contain more segments than mrcgs and possibly also more of the segments and bases. In contrast crcgs algorithm is usually much more time consuming and it will not always finish in a reasonable time. Moreover it will contain more segments than mrcgs and possibly also more than rcgs. But the actual algorithms in the library to pack segments have some lacks. They are not theoretically always able to pack the segments that we know that can be packed. Nevertheless, thanks to Wibmer's Theorem, the algorithms rcgs and crcgs are able to detect if the objective has not been reached, and if so, to give a Warning. The warning does not invalidate the output, but it only recognizes that the theoretical objective is not completely reached by the actual campcting methods and that some segments algorithms rcgs and crcgs are able to detect if the objective has not been reached, and if so, to give a Warning. The warning does not invalidate the output, but it only recognizes that the theoretical objective is not completely reached by the actual campcting methods and that some segments that can be packed have not been packed with a single basis. The routine buildtree is the first algorithm used in all the previous methods providing a first disjoint CGS, and can be used if none of the three fundamental algorithms of the library finishes in a reasonable time. There are also routines to visualize better the output of the previous There are also routines to visualize better the output of the previous algorithms: finalcases can be applied to the list provided by buildtree to obtain the CGS. The list provided by buildtree contains the whole discussion, and finalcases extracts the CGS. The output of buildtree can also be transformed into a file using buildtreetoMaple routine that can be read in Maple. Using Monte's dpgb The output of buildtree can also be transformed into a file using buildtreetoMaple routine that can be read in Maple. Using Monte's dpgb library in Maple the output can be plotted (with the routine tplot). To plot the output of mrcgs, rcgs or crcgs in Maple, the library also prime ideals in a canonical form that is described in the papers. Nevertheless this canonical form is somewhat uncomfortable to be interpreted. When the segments are all locally closed (and this is interpreted. When the segments are all locally closed (and this is always the case for rcgs and crcgs) the routine cantodiffcgs transforms the output into a simpler form having only one list element for each segment and providing the two varieties whose difference represent the segment also in a canonical form. AUTHORS:  Antonio Montes , Hans Schoenemann. OVERVIEW: see \"Minimal Reduced Comprehensive Groebner Systems\" AUTHORS:  Antonio Montes , Hans Schoenemann. OVERVIEW: see \"Minimal Reduced Comprehensive Groebner Systems\" by Antonio Montes. (http://www-ma2.upc.edu/~montes/). setglobalrings();    It is called by the fundamental routines of the library: (buildtree, mrcgs, rcgs, crcgs). After calling it, the rings @R, @P and @RP are defined After calling it, the rings @R, @P and @RP are defined globally. memberpos(f,J);      Returns the list of two integers: the value 0 or 1 depending on if f belongs to J or not, and the position in J (0 if it memberpos(f,J);      Returns the list of two integers: the value 0 or 1 depending on if f belongs to J or not, and the position in J (0 if it does not belong). subset(F,G);         If all elements of F belong to the ideal G it returns 1, and 0 otherwise. pdivi(f,F);          Pseudodivision of a poly f by an ideal F in @R. Returns a and 0 otherwise. pdivi(f,F);          Pseudodivision of a poly f by an ideal F in @R. Returns a list (r,q,m) such that m*f=r+sum(q.G). facvar(ideal J)      Returns all the free-square factors of the elements facvar(ideal J)      Returns all the free-square factors of the elements of ideal J (non repeated). Integer factors are ignored, even 0 is ignored. It can be called from ideal @R, but the given ideal J must only contain poynomials in the parameters. redspec(N,W);        Given null and non-null conditions depending only on the redspec(N,W);        Given null and non-null conditions depending only on the parameters it returns a red-specification. pnormalform(f,N,W);  Reduces the poly f wrt to the null condition ideal N and the pnormalform(f,N,W);  Reduces the poly f wrt to the null condition ideal N and the non-null condition ideal W (both depending on the parameters). buildtree(F);        Returns a list T describing a first reduced CGS of the ideal buildtree(F);        Returns a list T describing a first reduced CGS of the ideal F in K[a][x]. buildtreetoMaple(T); Writes into a file the output of buildtree in Maple readable buildtreetoMaple(T); Writes into a file the output of buildtree in Maple readable form. finalcases(T);       From the output of buildtree it provides the list of its terminal vertices. That list represents the dichotomic, of its terminal vertices. That list represents the dichotomic, reduced CGS obtained by buildtree. mrcgs(F);            Returns a list T describing the Minimal Reduced CGS of the mrcgs(F);            Returns a list T describing the Minimal Reduced CGS of the ideal F of K[a][x] rcgs(F);             Returns a list T describing the Reduced CGS of the ideal F of K[a][x] obtained by direct homogenizing and de-homogenizing rcgs(F);             Returns a list T describing the Reduced CGS of the ideal F of K[a][x] obtained by direct homogenizing and de-homogenizing the basis of the given ideal. crcgs(F);            Returns a list T describing the Canonical Reduced CGS of the ideal F of K[a][x] obtained by homogenizing and de-homogenizing crcgs(F);            Returns a list T describing the Canonical Reduced CGS of the ideal F of K[a][x] obtained by homogenizing and de-homogenizing the initial ideal. cantreetoMaple)(M);  Writes into a file the output of mrcgs, rcgs or crcgs in Maple cantreetoMaple)(M);  Writes into a file the output of mrcgs, rcgs or crcgs in Maple readable form. cantodiffcgs(list L);From the output of rcgs or crcgs (or even of mrcgs when it is possible) it returns a simpler list where the segments are given as difference of varieties. SEE ALSO: compregb_lib are given as difference of varieties. SEE ALSO: compregb_lib "; // ************ Begin of the redCGS library ********************* // Library redCGS // (Reduced Comprehesive Groebner Systems): // Library redCGS // (Reduced Comprehesive Groebner Systems): // Initial data: 21-1-2008 // Release 1: // Final data: 3_7-2008 // All given and determined polynomials and ideals are in the // All given and determined polynomials and ideals are in the // basering K[a][x]; // After calling setglobalrings(); the rings // After calling setglobalrings(); the rings //        @R   (K[a][x]), //        @P   (K[a]), //        @P   (K[a]), //        @RP   (K[x,a]) are globally defined //        They are used internally and can also be called by the user; //        setglobalrings() is called by buildtree, so it is not required to //        setglobalrings() is called by buildtree, so it is not required to //        call setglobalrings before using //        the fundamental routines of the library. "USAGE:   setglobalrings(); No arguments RETURN:   After its call the rings @R=K[a][x], @P=K[a], @RP=K[x,a] are RETURN:   After its call the rings @R=K[a][x], @P=K[a], @RP=K[x,a] are defined as global variables. NOTE:     It is called by the fundamental routines of the library. the fundamental routines have been called and some other routines of the library are used. The basering R, must be of the form K[a][x], a=parameters, The basering R, must be of the form K[a][x], a=parameters, x=variables, and should be defined previously. KEYWORDS: ring, rings { def @R=basering;  // must be of the form K[a][x], a=parameters, x=variables def Rx=ringlist(@R); def @P=ring(Rx[1]); def Rx=ringlist(@R); def @P=ring(Rx[1]); list Lx; Lx[1]=0; Lx[2]=Rx[2]+Rx[1][2]; Lx[3]=Rx[1][3]; Lx[4]=Rx[1][4]; Lx[4]=Rx[1][4]; //def @K=ring(Lx); //exportto(Top,@K);  //global ring K[x,a] with the order of x extended to x,a Rx[1]=0; def D=ring(Rx); def @RP=D+@P; exportto(Top,@R);      // global ring K[a][x] Rx[1]=0; def D=ring(Rx); def @RP=D+@P; exportto(Top,@R);      // global ring K[a][x] exportto(Top,@P);      // global ring K[a] exportto(Top,@RP);     // global ring K[x,a] with product order //   ideal J (J can be also poly), but the output is an ideal; // output: //   ideal Jc (the new form of ideal J without denominators and //   ideal Jc (the new form of ideal J without denominators and //       normalized to content 1) proc cld(ideal J) example { "EXAMPLE:"; echo = 2; list J=list(7,3,2); list J=list(7,3,2); list K=list(1,2,3,5,7,8); subset(J,K); poly f: the polynomial to be divided ideal F: the divisor ideal RETURN:   A list (poly r, ideal q, poly m). r is the remainder of the pseudodivision, q is the ideal of quotients, and m is the factor by which f is to be multiplied. NOTE:     Pseudodivision of a poly f by an ideal F in @R. Returns a RETURN:   A list (poly r, ideal q, poly m). r is the remainder of the pseudodivision, q is the ideal of quotients, and m is the factor by which f is to be multiplied. NOTE:     Pseudodivision of a poly f by an ideal F in @R. Returns a list (r,q,m) such that m*f=r+sum(q.G). KEYWORDS: division, reduce }; // facvar: Returns all the free-square factors of the elements // facvar: Returns all the free-square factors of the elements //         of ideal J (non repeated). Integer factors are ignored, //         even 0 is ignored. It can be called from ideal @R, but //         Operates in the ring @P, but can be called from ring @R. // input:   ideal J // output:  ideal Jc: Returns all the free-square factors of the elements // output:  ideal Jc: Returns all the free-square factors of the elements //         of ideal J (non repeated). Integer factors are ignored, //         even 0 is ignored. It can be called from ideal @R, but "USAGE:   facvar(J); J: an ideal in the parameters RETURN:   all the free-square factors of the elements RETURN:   all the free-square factors of the elements of ideal J (non repeated). Integer factors are ignored, even 0 is ignored. It can be called from ideal @R, but the given ideal J must only contain poynomials in the parameters. parameters. NOTE:     Operates in the ring @P, and the ideal J must contain only polynomials in the parameters, but can be called from ring @R. polynomials in the parameters, but can be called from ring @R. KEYWORDS: factor EXAMPLE:  facvar; shows an example" proc pnormalform(poly f, ideal N, ideal W) "USAGE:   pnormalform(f,N,W); f: the polynomial to be reduced modulo N,W (in parameters and f: the polynomial to be reduced modulo N,W (in parameters and variables) N: the null conditions ideal W: the non-null conditions (set of irreducible polynomials, ideal) W: the non-null conditions (set of irreducible polynomials, ideal) RETURN:   a reduced polynomial g of f, whose coefficients are reduced modulo N and having no factor in W. NOTE:     Should be called from ring @R. Ideals N and W must be polynomials in the parameters forming a red-specification (see definition)         the papers). NOTE:     Should be called from ring @R. Ideals N and W must be polynomials in the parameters forming a red-specification (see definition)         the papers). KEYWORDS: division, pdivi, reduce EXAMPLE:  pnormalform; shows an example" W: set of non-null polynomials (ideal) RETURN:   a list (N1,W1,L1) containing a red-specification of the segment (N,W). N1 is the radical reduced ideal characterizing the segment. V(N1) is the Zarisky closure of the segment (N,W). N1 is the radical reduced ideal characterizing the segment. V(N1) is the Zarisky closure of the segment (N,W). The segment S=V(N1) \ V(h), where h=prod(w in W1) N1 is uniquely determined and no prime component of N1 contains none of the polynomials in W1. The polynomials in W1 are prime and reduced wrt N1, and are considered non-null on the segment. L1 contains the list of prime components of N1. NOTE:     can be called from ring @R but it works in ring @P. L1 contains the list of prime components of N1. NOTE:     can be called from ring @R but it works in ring @P. KEYWORDS: specification EXAMPLE:  redspec; shows an example" "USAGE:   buildtree(F); F: ideal in K[a][x] (parameters and variables) to be discussed RETURN:   Returns a list T describing a dichotomic discussion tree, whose RETURN:   Returns a list T describing a dichotomic discussion tree, whose content is the first discussion of the ideal F of K[a][x]. The first element of the list is the root, and contains no optional conditions are given. [7] the set of lpp of ideal F [8] condition that was taken to reach the vertex [8] condition that was taken to reach the vertex (poly 1, for the root). The remaning elements of the list represent vertices of the tree: to reach the vertex [7] the set of lpp of the specialized ideal at this stage [8] condition that was taken to reach the vertex from the [8] condition that was taken to reach the vertex from the father's vertex (that was taken non-null if the last integer in the label is 1, and null if it is 0) specialized ideal on each point of the segment and preserve the lpp. So they form a disjoint reduced CGS. NOTE:     The basering R, must be of the form K[a][x], a=parameters, NOTE:     The basering R, must be of the form K[a][x], a=parameters, x=variables, and should be defined previously. The ideal must be defined on R. The file written by buildtreetoMaple when readed in a Maple worksheet can be plotted using the dbgb routine tplot; KEYWORDS: CGS, disjoint, reduced, comprehensive Groebner system EXAMPLE:  buildtree; shows an example" // detect weather W1 intersect W2 is non-empty for (i=1;i<=size(W1);i++) { { if (memberpos(W1[i],W2)[1]) { { W12[size(W12)+1]=W1[i]; } else { if (nonnull(W1[i],N2,W2)) if (nonnull(W1[i],N2,W2)) { W12[size(W12)+1]=W1[i]; G=G+(cA1*ww1*c1[alpha]-(matrix(N10)*T*qT)[1,1])*Tm[alpha]; } //T_ "genimage has found a more generic basis (method 2)"; //T_ "genimage has found a more generic basis (method 2)"; //T_ "f1:"; f1; "N1:"; N1; "W1:"; W1; //T_ "f2:"; f2; "N2:"; N2; "W2:"; W2; GG=ideal(G); } else{GG=ideal(0);} else{GG=ideal(0);} return(GG); }; //          that is non-null in the second segment. // input: // poly f:    a polynomials of the reduced basis in the segment (N,W) // poly f:    a polynomials of the reduced basis in the segment (N,W) // ideal N:   the null-conditions ideal in the segment // ideal W12: the set of non-null polynomials common to the segment and // ideal W12: the set of non-null polynomials common to the segment and //            a second segment proc extendpoly(poly f, ideal N, ideal W12) //T_ "A sheaf has been found (method 1)"; return(ideal(g1,g2)); } } return(ideal(genimage(g1,N1,W1,g2,N2,W2))); } [3]: the reduced basis of the segment. [4], [5], [6]: the red-spec of the null and non-null conditions of the segment. of the segment. [4] is the null-conditions radical ideal N, [5] is the non-null polynomials set (ideal) W, [7]: is the set of lpp [8]: poly 1 (irrelevant) is the condition to branch (but no more branch is necessary in the discussion, so 1 is the result. more branch is necessary in the discussion, so 1 is the result. NOTE:     It can be called having as argument the list output by buildtree KEYWORDS: buildtree, buildtreetoMaple, CGS //            reduced basis. The elements of L are of the form //            list (lpp,B,list(list(N,W,L),..list(N,W,L)) ) proc selectcases(list bT) proc selectcases(list bT) { list T=groupsegments(finalcases(bT)); } // given the the label labfu of the vertex fu it returns the last // given the label labfu of the vertex fu it returns the last // int of the label of the last existing children. // if no child exists, then it ouputs 0. } // given the the vertex u it provides the next brother of u. // given the vertex u it provides the next brother of u. // if it does not exist, then it ouputs v=list(list(intvec(0)),0) proc nextbrother(intvec labu) The description given here is identical for rcgs and crcgs. The elements of the list T computed by mrcgs are lists representing a rooted tree. a rooted tree. Each element has as the two first entries with the following content: [1]: The label (intvec) representing the position in the rooted [1]: The label (intvec) representing the position in the rooted tree:  0 for the root (and this is a special element) i for the root of the segment i i for the root of the segment i (i,...) for the children of the segment i [2]: the number of children (int) of the vertex. 3) the rest of vertices labelled with more indices. Description of the root. Vertex type 1) There is a special vertex (the first one) whose content is There is a special vertex (the first one) whose content is the following: [3] lpp of the given ideal with an odd number of integers in the label are to be considered as substraction. As an example consider the following vertices: v1=((i),2,lpp,B), v2=((i,1),2,P_{(i,1)}), v1=((i),2,lpp,B), v2=((i,1),2,P_{(i,1)}), v3=((i,1,1),2,P_{(i,1,1)}, v4=((i,1,1,1),1,P_{(i,1,1,1)}, v4=((i,1,1,1),1,P_{(i,1,1,1)}, v5=((i,1,1,1,1),0,P_{(i,1,1,1,1)}, v6=((i,1,1,2),1,P_{(i,1,1,2)}, v6=((i,1,1,2),1,P_{(i,1,1,2)}, v7=((i,1,1,2,1),0,P_{(i,1,1,2,1)}, v8=((i,1,2),0,P_{(i,1,2)}, (V(i,1)\(((V(i,1,1) \ ((V(i,1,1,1) \ V(i,1,1,1,1)) u (V(i,1,1,2) \ V(i,1,1,2,1))))) u V(i,1,2)) u (V(i,2) \ V(i,2,1)) and can also be represented by and can also be represented by (V(i,1) \ (V(i,1,1) u V(i,1,2))) u (V(i,1,1,1) \ V(i,1,1,1)) u (V(i,1,1,2) \ V(i,1,1,2,1)) u (V(i,1,1,2) \ V(i,1,1,2,1)) u (V(i,2) \ V(i,2,1)) where V(i,j,..) = V(P_{(i,j,..)} where V(i,j,..) = V(P_{(i,j,..)} NOTE:     There are three fundamental routines in the library: mrcgs, rcgs and crcgs. mrcgs (Minimal Reduced CGS) is an algorithm that packs so much as it is able to do (using algorithms adhoc) the segments with the same lpp, obtaining the minimal number of segments. The hypothesis is that this is also canonical, but for the moment there is no proof of the uniqueness is able to do (using algorithms adhoc) the segments with the same lpp, obtaining the minimal number of segments. The hypothesis is that this is also canonical, but for the moment there is no proof of the uniqueness of that minimal packing. Moreover, the segments that are obtained are not locally closed, i.e. there are not always the difference of two varieties, { if (size(@L[i][1])>1) { { @L[i][3]=delidfromid(N,@L[i][3]); } { if ((size(@L[i][1])>1) and (size(@L[i][1]) mod 2==1) and (equalideals(@L[i][3],ideal(0)))) { { lab=@L[i][1]; labfu=delintvec(lab,size(lab)); The description given here is analogous as for mrcgs and crcgs. The elements of the list T computed by rcgs are lists representing a rooted tree. a rooted tree. Each element has as the two first entries with the following content: [1]: The label (intvec) representing the position in the rooted [1]: The label (intvec) representing the position in the rooted tree:  0 for the root (and this is a special element) i for the root of the segment i i for the root of the segment i (i,...) for the children of the segment i [2]: the number of children (int) of the vertex. 3) the rest of vertices labelled with more indices. Description of the root. Vertex type 1) There is a special vertex (the first one) whose content is There is a special vertex (the first one) whose content is the following: [3] lpp of the given ideal with an odd number of integers in the label are to be considered as substraction. As an example consider the following vertices: v1=((i),2,lpp,B), v2=((i,1),2,P_{(i,1)}), v1=((i),2,lpp,B), v2=((i,1),2,P_{(i,1)}), v3=((i,1,1),0,P_{(i,1,1)}, v4=((i,1,2),0,P_{(i,1,1)}), v5=((i,2),2,P_{(i,2)}, v5=((i,2),2,P_{(i,2)}, v6=((i,2,1),0,P_{(i,2,1)}, v7=((i,2,2),0,P_{(i,2,2)} They represent the segment: (V(i,1)\(V(i,1,1) u V(i,1,2))) u (V(i,1)\(V(i,1,1) u V(i,1,2))) u (V(i,2)\(V(i,2,1) u V(i,2,2))) where V(i,j,..) = V(P_{(i,j,..)} where V(i,j,..) = V(P_{(i,j,..)} NOTE:     There are three fundamental routines in the library: mrcgs, rcgs and crcgs. rcgs (Reduced CGS) is an algorithm that first homogenizes the basis of the given ideal then applies mrcgs and finally de-homogenizes basis of the given ideal then applies mrcgs and finally de-homogenizes and reduces the resulting bases. (See the note of mrcgs). As a result of Wibmer's Theorem, the resulting segments are is not the homogenized ideal of the given ideal but only the ideal obtained by homogenizing the given basis. The output can be visualized using cantreetoMaple, that will write a file with the content of mrcgs that can be read in Maple The description given here is identical for mrcgs and rcgs. The elements of the list T computed by crcgs are lists representing a rooted tree. a rooted tree. Each element has as the two first entries with the following content: [1]: The label (intvec) representing the position in the rooted [1]: The label (intvec) representing the position in the rooted tree:  0 for the root (and this is a special element) i for the root of the segment i i for the root of the segment i (i,...) for the children of the segment i [2]: the number of children (int) of the vertex. 3) the rest of vertices labelled with more indices. Description of the root. Vertex type 1) There is a special vertex (the first one) whose content is There is a special vertex (the first one) whose content is the following: [3] lpp of the given ideal with an odd number of integers in the label are to be considered as substraction. As an example consider the following vertices: v1=((i),2,lpp,B), v2=((i,1),2,P_{(i,1)}), v1=((i),2,lpp,B), v2=((i,1),2,P_{(i,1)}), v3=((i,1,1),0,P_{(i,1,1)}, v4=((i,1,2),0,P_{(i,1,1)}), v5=((i,2),2,P_{(i,2)}, v5=((i,2),2,P_{(i,2)}, v6=((i,2,1),0,P_{(i,2,1)}, v7=((i,2,2),0,P_{(i,2,2)} They represent the segment: (V(i,1)\(V(i,1,1) u V(i,1,2))) u (V(i,1)\(V(i,1,1) u V(i,1,2))) u (V(i,2)\(V(i,2,1) u V(i,2,2))) where V(i,j,..) = V(P_{(i,j,..)} where V(i,j,..) = V(P_{(i,j,..)} NOTE:     There are three fundamental routines in the library: mrcgs, rcgs and crcgs. crcgs (Canonical Reduced CGS) is an algorithm that first homogenizes the the given ideal then applies mrcgs and finally de-homogenizes the given ideal then applies mrcgs and finally de-homogenizes and reduces the resulting bases. (See the note of mrcgs). As a result of Wibmer's Theorem, the resulting segments are locally closed (i.e. difference of varieties) and the partition is canonical as the homogenized ideal is uniquely associated to the given canonical as the homogenized ideal is uniquely associated to the given ideal not depending of the given basis. Nevertheless the computations to do are usually more time consuming and so it is preferable to compute first the rcgs and only if it success you can try crcgs. The output can be visualized using cantreetoMaple, that will write a file with the content of crcgs that can be read in Maple def Jp=idint(Np,Mp); setring(RR); return(imap(@P,Jp)); return(imap(@P,Jp)); } output where each segment corresponds to a single element of the list that is described as difference of two varieties. The first element of the list is identical to the first element of the list provided by the corresponding cgs algorithm, and [4]; the ideal of the second variety (radical) The segment is V([3]) \ V([4]). NOTE:     It can be called from the output of mrcgs or rcgs of crcgs KEYWORDS: mrcgs, rcgs, crcgs, Maple v=tree(intvec(i,j),L); Nn=v[1][3]; N=idintR(N,Nn); N=idintR(N,Nn); for (k=1;k<=v[1][2];k++) { w=tree(intvec(i,j,k),L); Mn=w[1][3]; M=idintR(M,Mn); M=idintR(M,Mn); } } MP=gbR(MP); setring(RR); N=imap(@P,NP); M=imap(@P,MP); N=imap(@P,NP); M=imap(@P,MP); LL[i+1]=list(u[1][3],u[1][4],N,M); } T; cantreetoMaple(T,"Tc","Tc.txt"); cantodiffcgs(T); cantodiffcgs(T); }
• Singular/LIB/sing.lib

 rfba86f8 // $Id: sing.lib,v 1.31 2008-09-24 07:54:59 Singular Exp$ // $Id: sing.lib,v 1.32 2008-10-09 09:31:58 Singular Exp$ //(GMG/BM, last modified 26.06.96, //GMG, 27.7.08: in milnor printlevel und Ausschrift gendert) /////////////////////////////////////////////////////////////////////////////// version="$Id: sing.lib,v 1.31 2008-09-24 07:54:59 Singular Exp$"; version="$Id: sing.lib,v 1.32 2008-10-09 09:31:58 Singular Exp$"; category="Singularities"; info=" PROCEDURES: codim(id1, id2);       vector space dimension of of id2/id1 if finite codim(id1, id2);       vector space dimension of id2/id1 if finite deform(i);             infinitesimal deformations of ideal i dim_slocus(i);         dimension of singular locus of ideal i
• Singular/LIB/tropical.lib

 rfba86f8 version="$Id: tropical.lib,v 1.7 2008-08-20 17:36:04 keilen Exp$"; version="$Id: tropical.lib,v 1.8 2008-10-09 09:31:58 Singular Exp$"; category="Tropical Geometry"; info=" @*               Thomas Markwig,  email: keilen@mathematik.uni-kl.de WARNING: WARNING: - tropicalLifting will only work under LINUX and if in addition gfan is installed. @*   - drawTropicalCurve and drawTropicalNewtonSubdivision will only display the tropical the torus is embedded via the map sending a point x in (K*)^n to the point (x^v0,...,x^vm). The generic hyperplane sections are just the images of the hypersurfaces in (K*)^n defined by the polynomials f=a0*x^v0+...+am*x^vm=0. Some properties of these hypersurfaces can be studied via tropicalisation. For this we suppose that K=C{{t}} is the field of Puiseux series over the field of complex the polynomials f=a0*x^v0+...+am*x^vm=0. Some properties of these hypersurfaces can be studied via tropicalisation. For this we suppose that K=C{{t}} is the field of Puiseux series over the field of complex numbers (or any other field with a valuation into the real numbers). One associates to the hypersurface given by f=a0*x^v0+...+am*x^vm the tropical hypersurface defined by the tropicalisation of the integer vector v in Z^n with the vector x=(x1,...,xn) of variables, so that trop(f) is a piecewise linear function on R^n. The corner locus of this function (i.e. the points at which the minimum is attained a least twice) is the tropical hypersurface defined by trop(f). the minimum is attained a least twice) is the tropical hypersurface defined by trop(f). The theorem of Newton-Kapranov states that this tropical hypersurface is the same as if one computes pointwise the valuation of the hypersurface given by f. The analogue holds true if one replaces one equation f by an ideal I. A constructive proof of the theorem is given by an adapted replaces one equation f by an ideal I. A constructive proof of the theorem is given by an adapted version of the Newton-Puiseux algorithm. The hard part is to find a point in the variety over C{{t}} which corresponds to a given point in the tropical variety. Of course we cannot represent the field of Puiseux series over C in its full strength, however, in order to compute interesting examples it will be sufficient to replace the complex numbers C by the rational numbers Q and to replace Puiseux series in t by rational functions in t, i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t]. Note, that this in particular by the rational numbers Q and to replace Puiseux series in t by rational functions in t, i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t]. Note, that this in particular forbits rational exponents for the t's. If, however, for some reason you prefer to work with general vi, then you have to pass right away to the tropicalisation of the equations, whereever this is allowed -- these are linear polynomials where the constant coefficient correspond to the valuation of the original coefficient and where where the constant coefficient correspond to the valuation of the original coefficient and where the non-constant coefficient correspond to the exponents of the monomials, thus they may be rational numbers respectively negative numbers: numbers respectively negative numbers: e.g. if f=t^{1/2}*x^{-2}*y^3+2t*x*y+4  then  trop(f)=min{1/2-2x+3y,1+x+y,0}. I have to be in the polynomial ring Q[t,x1,...,xn] considered as a subring of C{{t}}[x1,...,xn]; a solution will be constructed up to given order; note that several field extensions of Q might be necessary thoughout the intermediate several field extensions of Q might be necessary thoughout the intermediate computations; the procedures uses the external program gfan @*   - drawTropicalCurve  visualises a tropical plane curve either given by a polynomial in Q(t)[x,y] @*   - tropicalJInvariant computes the tropical j-invaiant of a tropical elliptic curve @*   - jInvariant         computes the j-invariant of an elliptic curve @*   - weierstrassFom     computes the Weierstrass form of an elliptic curve @*   - weierstrassFom     computes the Weierstrass form of an elliptic curve PROCEDURES CONCERNED WITH TROPICAL LIFTING: PROCEDURES CONCERNED WITH THE LATEX CONVERSION: texNumber(poly)                  outputs the texcommand for the leading coefficient of poly texPolynomial(poly)              outputs the texcommand for the polynomial poly texPolynomial(poly)              outputs the texcommand for the polynomial poly texMatrix(matrix)                outputs the texcommand for the matrix texDrawBasic(list)               embeds the output of texDrawTropical in a texdraw environment texDrawTropical(list)            computes the texdraw commands for a tropical curve texDrawNewtonSubdivision(list)   computes the texdraw commands for a Newton subdivision texDrawTriangulation(list,list)  computes the texdraw commands for a triangulation texDrawNewtonSubdivision(list)   computes the texdraw commands for a Newton subdivision texDrawTriangulation(list,list)  computes the texdraw commands for a triangulation AUXILARY PROCEDURES: dualConic(poly)                  computes the dual of the affine plane conic defined by poly parameterSubstitute(poly,int)    substitutes in the poly the parameter t by t^N tropcialSubst(poly,int,list)     computes the tropical polynomial of poly with certain substitutions tropcialSubst(poly,int,list)     computes the tropical polynomial of poly with certain substitutions randomPoly(int,int,int)          computes a polynomial with random coefficients cleanTmp()                       removes the latex and ps files from /tmp created by other procedures /// - eliminatecomponents /// - findzerosAndBasictransform /// - ordermaximalideals /// - ordermaximalideals /// - verticesTropicalCurve /// - bunchOfLines //////////////////////////////////////////////////////////////////////////////////// /// Procedures concerned with tropical parametrisation /////////////////////////////////////////////////////////////////////////////////// /// Procedures concerned with tropical parametrisation /////////////////////////////////////////////////////////////////////////////////// proc tropicalLifting (ideal i,intvec w,int ordnung,list #) "USAGE:  tropicalLifting(i,w,ord[,opt]); i ideal, w intvec, ord int, opt string ASSUME:  - i is an ideal in Q[t,x_1,...,x_n], w=(w_0,w_1,...,w_n) and (w_1/w_0,...,w_n/w_0) is in the tropical variety of i, and ord is the order up to which a point in V(i) over Q{{t}} lying over ASSUME:  - i is an ideal in Q[t,x_1,...,x_n], w=(w_0,w_1,...,w_n) and (w_1/w_0,...,w_n/w_0) is in the tropical variety of i, and ord is the order up to which a point in V(i) over Q{{t}} lying over (w_1/w_0,...,w_n/w_0) shall be computed; w_0 may NOT be ZERO @*       - the basering should not have any parameters on its own @*       - the basering should not have any parameters on its own and it should have a global monomial ordering, e.g. ring r=0,(t,x(1..n)),dp; @*       - the first variable of the basering will be treated as the parameter t @*       - the first variable of the basering will be treated as the parameter t in the Puiseux series field !!!! @*       - the optional parameter opt should be one or more strings among the following: @*         'isPrime'            : the ideal is prime over Q(t)[x_1,...,x_n]  (not to be checked); @*         'isInTrop'           : (w_1/w_0,...,w_n/w_0) is in the tropical variety (not to be checked); @*         'oldGfan'            : uses gfan version 0.2.1 or less @*         'oldGfan'            : uses gfan version 0.2.1 or less @*         'findAll'            : find all solutions of a zero-dimensional ideal over (w_1/w_0,...,w_n/w_0) @*         'noAbs'              : do NOT use absolute primary decomposition in the tropical variety of i to a point in V(i) over Puiseux series field up to the first ord terms, if the ideal is zero-dimensional over Q{{t}}; more precisely, each entry of the list is a list l as computed if more precisely, each entry of the list is a list l as computed if 'find_all' was NOT set @*       WE NOW DESCRIBE THE LIST ENTRIES IF 'findAll' WAS NOT SET: @*       - the ring l[1] contains an ideal LIFT, which contains @*       - the ring l[1] contains an ideal LIFT, which contains a point in V(i) lying over w up to the first ord terms; @*       - and if the integer l[2] is N then t has to be replaced by t^1/N in the @*       - if the k+1st entry of l[3] is  non-zero, then the kth component of LIFT has to be multiplied t^(-l[3][k]/l[3][1]) AFTER substituting t by t^1/N @*       - unless the option 'noResubst' was set, the kth entry of list l[4] @*       - unless the option 'noResubst' was set, the kth entry of list l[4] is a string which represents the kth generator of the ideal i where the coordinates have been replaced by the result of the lift; @*       - if the parameter 'findAll' is set AND the ideal i is zero-dimensional in Q{{t}}[x_1,...,x_n] then ALL points in V(i) lying over w are computed up to order ord; if the ideal is not-zero dimenisonal, then only all points in the ideal after cutting down is not-zero dimenisonal, then only all points in the ideal after cutting down to dimension zero will be computed @*       - the procedure REQUIRES that the program GFAN is installed on your computer; and thus there may not exist a point in V(i) over the Puiseux series field with the desired valuation; so there is no chance that the procedure produced a sensible output - e.g. if i=tx^p-tx-1 @*         + if the dimension of i over Z/pZ(t) is not zero the process of reduction to a sensible output - e.g. if i=tx^p-tx-1 @*         + if the dimension of i over Z/pZ(t) is not zero the process of reduction to zero might not work if the characteristic is small and you are unlucky @*         + the option 'noAbs' has to be used since absolute primary decomposition in @*         + the option 'noAbs' has to be used since absolute primary decomposition in Singular only works in characteristic zero @*       - the basefield should either be Q or Z/pZ for some prime p; field extensions @*       - the basefield should either be Q or Z/pZ for some prime p; field extensions will be computed where necessary; if you need parameters or field extensions from the beginning they should rather be simulated as variables possibly adding { Error("The first coordinate of your input w must be NON-ZERO, since it is a DENOMINATOR!"); } } // if w_0<0, then replace w by -w, so that the "denominator" w_0 is positive if (w[1]<0) w[1]=-1; } // if some entry of w is positive, we have to make a transformation, // if some entry of w is positive, we have to make a transformation, // which moves it to something non-positive for (j=2;j<=nvars(basering);j++) { variablen=variablen+var(j); } } map GRUNDPHI=BASERING,t,variablen; ideal i=GRUNDPHI(i); // compute the initial ideal of i and test if w is in the tropical variety of i // compute the initial ideal of i and test if w is in the tropical variety of i // - the last entry 1 only means that t is the last variable in the ring ideal ini=tInitialIdeal(i,w,1); if (isintrop==0) // test if w is in trop(i) only if isInTrop has not been set { { poly product=1; for (j=1;j<=nvars(basering)-1;j++) // the procedurce cutdown computes a new ring, in which there lives a zero-dimensional // ideal which has been computed by cutting down the input with generic linear forms // of the type x_i1-p_1,...,x_id-p_d for some polynomials p_1,...,p_d not depending // of the type x_i1-p_1,...,x_id-p_d for some polynomials p_1,...,p_d not depending // on the variables x_i1,...,x_id; that way we have reduced the number of variables by dd !!! // the new zero-dimensional ideal is called i, its t-initial ideal (with respect to // the new w=CUTDOWN[2]) is ini, and finally there is a list repl in the ring // the new w=CUTDOWN[2]) is ini, and finally there is a list repl in the ring // which contains at the polynomial p_j at position i_j and a zero otherwise; if (isprime==0) // the minimal associated primes of i are computed for (jj=1;jj<=size(TP);jj++) { // the list TP contains as a first entry the ring over which the tropical parametrisation // the list TP contains as a first entry the ring over which the tropical parametrisation // of the (possibly cutdown ideal) i lives def LIFTRING=TP[jj][1]; } setring LIFTRING; ideal LIFT=imap(REPLACEMENTRING,LIFT); // test now if the LIFT has the correct valuation !!! ideal LIFT=imap(REPLACEMENTRING,LIFT); // test now if the LIFT has the correct valuation !!! // note: it may happen, that when resubstituting PARA into the replacement rules //       there occured some unexpected cancellation; we only know that for SOME //       solution of the zero-dimensional reduction NO canellation will occur, //       solution of the zero-dimensional reduction NO canellation will occur, //       but for others this may very well happen; this in particular means that //       we possibly MUST compute all zero-dimensional solutions when cutting down! // replace @a by a in minpoly and in LIFT map phi=INTERRING,t,a,a; mp=phi(mp); mp=phi(mp); LIFT=phi(LIFT); // pass now to a ring whithout @a and with a as parameter ideal LIFT=imap(INTERRING,LIFT); kill INTERRING; } } // then export LIFT export(LIFT); export(LIFT); // test the  result by resubstitution setring GRUNDRING; setring GRUNDRING; list resubst; if (noresubst==0) } else { { resubst=tropicalliftingresubstitute(substitute(i,t,t^(TP[jj][2])),list(LIFTRING),N*TP[jj][2]); } } setring BASERING; // Finally, if t has been replaced by t^N, then we have to change the // Finally, if t has been replaced by t^N, then we have to change the // third entry of TP by multiplying by N. if (noabs==1) "The procedure will be restarted with the option 'findAll'."; "Go on by hitting RETURN!"; findall=1; findall=1; noabs=0; setring CUTDOWNRING; "i";i; "ini";tInitialIdeal(i,w,1); /* setring GRUNDRING; if (voice+printlevel>=2) { "The procedure has created a list of lists. The jth entry of this list contains a ring, an integer and an intvec. In this ring lives an ideal representing the wanted lifting, if the integer is N then in the parametrisation t has to be replaced by t^1/N, and if the ith component of the intvec is w[i] then the ith component in LIFT and if the ith component of the intvec is w[i] then the ith component in LIFT should be multiplied by t^-w[i]/N in order to get the parametrisation. Suppose your list has the name L, then you can access the 1st ring via: "; if (findall==1) { "def LIFTRing=L[1][1]; setring LIFTRing; LIFT; "def LIFTRing=L[1][1]; setring LIFTRing; LIFT; "; } else { "def LIFTRing=L[1]; setring LIFTRing; LIFT; "def LIFTRing=L[1]; setring LIFTRing; LIFT; "; } } } if (findall==1) // if all solutions have been computed, return a list of lists def LIFTRing=LIST[1]; setring LIFTRing; // LIFT contains the first 4 terms of a point in the variety of i // LIFT contains the first 4 terms of a point in the variety of i // over the Puiseux series field C{{t}} whose order is -w[1]/w[0]=1 LIFT; // NOTE: since the last component of v is positive, the lifting //       must start with a negative power of t, which in Singular //       is not allowed for a variable. //       is not allowed for a variable. def LIFTRing3=LIST[1]; setring LIFTRing3; } if (size(troplift)==4) // this means that tropicalLifting was called with absolute primary decomposition { { setring LIFTRing; "The lifting of the point in the tropical variety lives in the ring"; if ((size(LIFTpar)==0) and (N==1)) { Kstring+"[[t]]"; Kstring+"[[t]]"; } if ((size(LIFTpar)==0) and (N!=1)) { Kstring+"[[t^(1/"+string(N)+")]]"; Kstring+"[[t^(1/"+string(N)+")]]"; } if ((size(LIFTpar)!=0) and (N!=1)) { Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t^(1/"+string(N)+")]]"; { Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t^(1/"+string(N)+")]]"; } if ((size(LIFTpar)!=0) and (N==1)) { Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t]]"; { Kstring+"["+LIFTpar+"]/"+string(minpoly)+"[[t]]"; } } } if ((size(LIFTpar)!=0) and (N!=1)) { Kstring+"["+LIFTpar+"]/M[[t^(1/"+string(N)+")]]"; { Kstring+"["+LIFTpar+"]/M[[t^(1/"+string(N)+")]]"; "where M is the maximal ideal"; "M=<"+m+">"; } if ((size(LIFTpar)!=0) and (N==1)) { Kstring+"["+LIFTpar+"]/M[[t]]"; { Kstring+"["+LIFTpar+"]/M[[t]]"; "where M is the maximal ideal"; "M=<"+m+">"; } } } ""; } } } } } example //////////////////////////////////////////////////////////////////////////////////// /// Procedures concerned with drawing a tropical curve or a Newton subdivision /// Procedures concerned with drawing a tropical curve or a Newton subdivision //////////////////////////////////////////////////////////////////////////////////// proc tropicalCurve (def tp,list #) "USAGE:      tropicalCurve(tp[,#]); tp list, # optional list ASSUME:      tp is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c ASSUME:      tp is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c representing a tropical Laurent polynomial defining a tropical plane curve; alternatively tp can be a polynomial in Q(t)[x,y] defining a tropical plane curve via the valuation map; via the valuation map; the basering must have a global monomial ordering, two variables and up to one parameter! RETURN:      list, each entry i=1,...,size(l)-1 corresponds to a vertex in the tropical plane RETURN:      list, each entry i=1,...,size(l)-1 corresponds to a vertex in the tropical plane curve defined by tp l[i][1] = x-coordinate of the ith vertex the tropical curve is connected to the jth vertex with multiplicity given by the corresponding entry in the second row l[i][4] = list of lists, the first entry of a list is a primitive integer vector defining the direction of an unbounded edge emerging from the ith vertex l[i][4] = list of lists, the first entry of a list is a primitive integer vector defining the direction of an unbounded edge emerging from the ith vertex of the graph, the corresponding second entry in the list is the multiplicity of the unbounded edge l[i][5] = a polynomial whose monomials mark the vertices in the Newton polygon corresponding to the entries in tp which take the common minimum corresponding to the entries in tp which take the common minimum at the ith vertex -- if some coefficient a or b of the linear polynomials in the input was negative, then each monomial has to be shifted by } // if you insert a single polynomial instead of an ideal representing a tropicalised polynomial, // then we compute first the tropicalisation of this polynomial -- this feature is not // then we compute first the tropicalisation of this polynomial -- this feature is not // documented in the above help string if (typeof(tp)=="poly") if ((npars(basering)!=1) or (nvars(basering)!=2)) { ERROR("The basering should have precisely one parameter and two indeterminates!"); ERROR("The basering should have precisely one parameter and two indeterminates!"); } poly f=tp; if (nvars(basering) != 2) { ERROR("The basering should have precisely two indeterminates!"); ERROR("The basering should have precisely two indeterminates!"); } // -1) Exclude the pathological case that the defining tropical polynomial has only one term, intmat M[2][1]=0,0; return(list(list(0,0,M,list(),detropicalise(tp[1])),list(list(leadexp(detropicalise(tp[1]))),list()))); } } // 0) If the input was a list of linear polynomials, then some coefficient of x or y can be negative, //    i.e. the input corresponds to the tropical curve of a Laurent polynomial. In that case we should { bb=koeffizienten(tp[i],2); } } } if ((aa!=0) or (bb!=0)) return(bunchOfLines(tp)); } // 2) store all vertices belonging to the ith part of the // 2) store all vertices belonging to the ith part of the //    Newton subdivision in the list vtp[i] as 4th entry, //    and store those, which are not corners of the ith subdivision polygon //    in vtp[i][6] poly nwt; poly nwt; list boundaryNSD;  // stores the boundary of a Newton subdivision intmat zwsp[2][1]; // used for intermediate storage intmat zwsp[2][1]; // used for intermediate storage for (i=1;i<=size(vtp);i++) { nwt=vtp[i][3]; // the polynomial representing the ith part of the Newton subdivision // store the vertices of the ith part of the Newton subdivision in the list newton list newton; list newton; while (nwt!=0) { vtp[i][4]=boundaryNSD[1]; vtp[i][5]=boundaryNSD[2]; vtp[i][6]=zwsp; // the entries of the first row will denote to which vertex the ith one is connected vtp[i][6]=zwsp; // the entries of the first row will denote to which vertex the ith one is connected // and the entries of the second row will denote with which multiplicity kill newton; // we kill the superflous list kill ipairs; } // 4) Check for all pairs of verticies in the Newton diagram if they // 4) Check for all pairs of verticies in the Newton diagram if they //    occur in two different parts of the Newton subdivision int deleted; // if a pair occurs in two NSD, it can be removed from both - deleted is then set to 1 d=1;  // counts the inner edges for (i=1;i<=size(pairs)-1;i++) { { for (j=i+1;j<=size(pairs);j++) { deleted=0; for (l=size(pairs[j]);l>=1 and deleted==0;l--) { { if (((pairs[i][k][1]==pairs[j][l][1]) and (pairs[i][k][2]==pairs[j][l][2])) or ((pairs[i][k][1]==pairs[j][l][2]) and (pairs[i][k][2]==pairs[j][l][1]))) { for (i=1;i<=size(pairs);i++) { list ubedges; // stores the unbounded edges list ubedges; // stores the unbounded edges k=1; // counts the unbounded edges for (j=1;j<=size(pairs[i]);j++) gr[3]=vtp[i][6];  // to which vertices is the ith vertex of the tropical curve connected gr[4]=vtp[i][7];  // the directions unbounded edges emerging from the ith vertex of the trop. curve gr[5]=vtp[i][3];  // the vertices of the boundary of the ith part of the NSD gr[5]=vtp[i][3];  // the vertices of the boundary of the ith part of the NSD graph[i]=gr; } // the coordinates of the first vertex are graph[1][1],graph[1][2]; graph[1][1],graph[1][2]; // the first vertex is connected to the vertices // the first vertex is connected to the vertices //     graph[1][3][1,1..ncols(graph[1][3])] intmat M=graph[1][3]; M[1,1..ncols(graph[1][3])]; // the weights of the edges to these vertices are // the weights of the edges to these vertices are //     graph[1][3][2,1..ncols(graph[1][3])] M[2,1..ncols(graph[1][3])]; // from the first vertex emerge size(graph[1][4]) unbounded edges size(graph[1][4]); // the primitive integral direction vector of the first unbounded edge // the primitive integral direction vector of the first unbounded edge //     of the first vertex graph[1][4][1][1]; // the weight of the first unbounded edge of the first vertex graph[1][4][1][2]; // the monomials which are part of the Newton subdivision of the first vertex // the monomials which are part of the Newton subdivision of the first vertex graph[1][5]; // connecting the points in graph[size(graph)][1] we get // connecting the points in graph[size(graph)][1] we get //     the boundary of the Newton polytope graph[size(graph)][1]; // an entry in graph[size(graph)][2] is a pair of points // an entry in graph[size(graph)][2] is a pair of points //     in the Newton polytope bounding an inner edge graph[size(graph)][2][1]; proc drawTropicalCurve (def f,list #) "USAGE:      drawTropicalCurve(f[,#]); f poly or list, # optional list ASSUME:      f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c ASSUME:      f is list of linear polynomials of the form ax+by+c with integers a, b and a rational number c representing a tropical Laurent polynomial defining a tropical plane curve; alternatively f can be a polynomial in Q(t)[x,y] defining a tropical plane curve via the valuation map; via the valuation map; the basering must have a global monomial ordering, two variables and up to one parameter! RETURN:      NONE NOTE:        - the procedure produces the files /tmp/tropicalcurveNUMBER.tex and /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four digit integer; NOTE:        - the procedure produces the files /tmp/tropicalcurveNUMBER.tex and /tmp/tropicalcurveNUMBER.ps, where NUMBER is a random four digit integer; moreover it displays the tropical curve defined by f via kghostview; if you wish to remove all these files from /tmp, call the procedure cleanTmp @*           - edges with multiplicity greater than one carry this multiplicity @*           - if # is empty, then the tropical curve is computed w.r.t. minimum, if #[1] is the string 'max', then it is computed w.r.t. maximum string 'max', then it is computed w.r.t. maximum @*           - if the last optional argument is 'onlytexfile' then only the latex file is produced; this option should be used if kghostview is not installed on if ((npars(basering)!=1) or (nvars(basering)!=2)) { ERROR("The basering should have precisely one parameter and two indeterminates!"); ERROR("The basering should have precisely one parameter and two indeterminates!"); } texf=texPolynomial(f); // write the polynomial over Q(t) texf="\\mbox{\\tt The defining equation was not handed over!}"; list graph=f; } } else { // write the tropical polynomial defined by f if (size(#)==0) { { texf="\\min\\{"; } for (j=1;j<=size(f);j++) { texf=texf+texPolynomial(f[j]); texf=texf+texPolynomial(f[j]); if (j0) { list dualpoints; for (i=1;i<=size(points);i++) for (i=1;i<=size(points);i++) { dualpoints[i]=list(leadcoef(tangents[i])/substitute(tangents[i],x,0,y,0),leadcoef(tangents[i]-lead(tangents[i]))/substitute(tangents[i],x,0,y,0)); // conic[2] is the equation of the conic f passing through the five points conic[2]; // conic[3] is a list containing the equations of the tangents // conic[3] is a list containing the equations of the tangents //          through the five points conic[3]; // conic[4] is an ideal representing the tropicalisation of the conic f conic[4]; // conic[5] is a list containing the tropicalisation // conic[5] is a list containing the tropicalisation //          of the five tangents in conic[3] conic[5]; // conic[6] is a list containing the vertices of the tropical conic // conic[6] is a list containing the vertices of the tropical conic conic[6]; // conic[7] is a list containing the vertices of the five tangents conic[7]; // conic[8] contains the latex code to draw the tropical conic and //          its tropicalised tangents; it can written in a file, processed and //          displayed via kghostview write(":w /tmp/conic.tex",conic[8]); system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o; // conic[8] contains the latex code to draw the tropical conic and //          its tropicalised tangents; it can written in a file, processed and //          displayed via kghostview write(":w /tmp/conic.tex",conic[8]); system("sh","cd /tmp; latex /tmp/conic.tex; dvips /tmp/conic.dvi -o; kghostview conic.ps &"); // with an optional argument the same information for the dual conic is computed // with an optional argument the same information for the dual conic is computed //         and saved in conic[9] conic=conicWithTangents(points,1); conic[9][2]; // the equation of the dual conic } //////////////////////////////////////////////////////////////////////////////////// /// Procedures concerned with tropicalisation ASSUME:      f is a polynomial in Q(t)[x_1,...,x_n] RETURN:      list, the linear forms of the tropicalisation of f NOTE:        if # is empty, then the valuation of t will be 1, @*           if # is the string 'max' it will be -1; @*           the latter supposes that we consider the maximum of the the computed NOTE:        if # is empty, then the valuation of t will be 1, @*           if # is the string 'max' it will be -1; @*           the latter supposes that we consider the maximum of the computed linear forms, the former that we consider their minimum EXAMPLE:     example tropicalise;   shows an example" { tropicalf[i]=tropicalf[i]+exp[j]*var(j); } } f=f-lead(f); } } proc tInitialForm (poly f, intvec w) proc tInitialForm (poly f, intvec w) "USAGE:      tInitialForm(f,w); f a polynomial, w an integer vector ASSUME:      f is a polynomial in Q[t,x_1,...,x_n] and w=(w_0,w_1,...,w_n) // do the same for the remaining part of f and compare the results // keep only the smallest ones int vglgewicht; f=f-lead(f); int vglgewicht; f=f-lead(f); while (f!=0) { initialf=initialf+lead(f); } } } f=f-lead(f); } } proc tInitialIdeal (ideal i,intvec w,list #) proc tInitialIdeal (ideal i,intvec w,list #) "USAGE:      tInitialIdeal(i,w); i ideal, w intvec ASSUME:      i is an ideal in Q[t,x_1,...,x_n] and w=(w_0,...,w_n) ASSUME:      i is an ideal in Q[t,x_1,...,x_n] and w=(w_0,...,w_n) RETURN:      ideal ini, the t-initial ideal of i with respect to w" { // ... and compute a standard basis with // respect to the homogenised ordering defined by w. Since the generators // of i will be homogeneous it we can instead take the ordering wp // with the weightvector (0,w) replaced by (M,...,M)+(0,w) for some // large M, so that all entries are positive // of i will be homogeneous it we can instead take the ordering wp // with the weightvector (0,w) replaced by (M,...,M)+(0,w) for some // large M, so that all entries are positive int M=-minInIntvec(w)[1]+1; // find M such that w[j]+M is strictly positive for all j intvec whomog=M+1; } execute("ring WEIGHTRING=("+charstr(basering)+"),("+varstr(basering)+"),(wp("+string(whomog)+"));"); // map i to the new ring and compute a GB of i, then dehomogenise i, // so that we can be sure, that the // map i to the new ring and compute a GB of i, then dehomogenise i, // so that we can be sure, that the // initial forms of the generators generate the initial ideal ideal i=subst(groebner(imap(HOMOGRING,i)),@s,1); proc texDrawBasic (list texdraw) "USAGE:      texDrawBasic(texdraw); list texdraw ASSUME:      texdraw is a list of strings representing texdraw commands (as produced by ASSUME:      texdraw is a list of strings representing texdraw commands (as produced by texDrawTropical) which should be embedded into a texdraw environment RETURN:      string, a texdraw environment enclosing the input \\end{texdraw}"; return(texdrawtp); } } example { ASSUME:  graph is the output of tropicalCurve RETURN:  string, the texdraw code of the tropical plane curve encoded by graph NOTE:    - if the list # is non-empty, the first entry should be a string; if this string is 'max', NOTE:    - if the list # is non-empty, the first entry should be a string; if this string is 'max', then the tropical curve is considered with respect to the maximum; otherwise the curve is considered with respect to the minimum and the string can be used to is considered with respect to the minimum and the string can be used to insert further texdraw commands (e.g. to have a lighter image as when called from inside conicWithTangents); from inside conicWithTangents); @*       - the procedure computes a scalefactor for the texdraw command which should help to display the curve in the right way; this may, however, be a bad idea int i,j; // deal first with the pathological case that the input polynomial was a monomial // and does therefore not define a tropical curve, and check if the Newton polytope is // and does therefore not define a tropical curve, and check if the Newton polytope is // a line segment so that the curve defines a bunch of lines int bunchoflines; // go on with the case that a tropical curve is defined if (size(#)==0) { { string texdrawtp=" { if ((#[1]!="max") and (#[1]!="")) { { string texdrawtp=#[1]; } NOTE:        - the list # should contain as only entry a string; if this string is 'max', then the tropical curve is considered with respect to the maximum; otherwise the curve is considered with respect to the minimum and the string can be used to is considered with respect to the minimum and the string can be used to insert further texdraw commands (e.g. to have a lighter image as when called from inside conicWithTangents); the list # is optional and may as well be empty int i,j,k,l; list boundary=graph[size(graph)][1]; list inneredges=graph[size(graph)][2]; list inneredges=graph[size(graph)][2]; intvec shiftvector=graph[size(graph)][3]; string subdivision; poly scalefactor=minOfPolys(list(12/leadcoef(maxx),12/leadcoef(maxy))); if (scalefactor<1) { { subdivision=subdivision+" \\relunitscale"+ decimal(scalefactor); { subdivision=subdivision+" \\move ("+string(boundary[i][1])+" "+string(boundary[i][2])+") \\move ("+string(boundary[i][1])+" "+string(boundary[i][2])+") \\lvec ("+string(boundary[i+1][1])+" "+string(boundary[i+1][2])+")"; } } subdivision=subdivision+" \\move ("+string(boundary[size(boundary)][1])+" "+string(boundary[size(boundary)][2])+") \\move ("+string(boundary[size(boundary)][1])+" "+string(boundary[size(boundary)][2])+") \\lvec ("+string(boundary[1][1])+" "+string(boundary[1][2])+") { subdivision=subdivision+" \\move ("+string(inneredges[i][1][1])+" "+string(inneredges[i][1][2])+") \\move ("+string(inneredges[i][1][1])+" "+string(inneredges[i][1][2])+") \\lvec ("+string(inneredges[i][2][1])+" "+string(inneredges[i][2][2])+")"; } } } // deal with the pathological cases // deal with the pathological cases if (size(boundary)==1) // then the Newton polytope is a point { { subdivision=subdivision+" \\move ("+string(markings[i][1])+" "+string(markings[i][2])+") \\move ("+string(markings[i][1])+" "+string(markings[i][2])+") \\fcir f:0 r:"+decimal(2/(8*scalefactor),size(string(int(scalefactor)))+1); } // enclose subdivision in the texdraw environment string texsubdivision=" string texsubdivision=" \\begin{texdraw} \\drawdim cm  \\relunitscale 1 \\drawdim cm  \\relunitscale 1 \\linewd 0.05" +subdivision+" poly f=x+y+x2y+xy2+1/t*xy; list graph=tropicalCurve(f); // compute the texdraw code of the Newton subdivision of the tropical curve // compute the texdraw code of the Newton subdivision of the tropical curve texDrawNewtonSubdivision(graph); } markings[3*i-2]=triang[i][1]; markings[3*i-1]=triang[i][2]; markings[3*i]=triang[i][3]; markings[3*i]=triang[i][3]; } // delete redundant pairs which occur more than once { latex=latex+" \\move ("+string(polygon[markings[i]][1])+" "+string(polygon[markings[i]][2])+") \\move ("+string(polygon[markings[i]][1])+" "+string(polygon[markings[i]][2])+") \\fcir f:0 r:0.08"; } { latex=latex+" \\move ("+string(polygon[pairs[i][1]][1])+" "+string(polygon[pairs[i][1]][2])+") \\move ("+string(polygon[pairs[i][1]][1])+" "+string(polygon[pairs[i][1]][2])+") \\lvec ("+string(polygon[pairs[i][2]][1])+" "+string(polygon[pairs[i][2]][2])+")"; } { latex=latex+" \\move ("+string(polygon[i][1])+" "+string(polygon[i][2])+") \\move ("+string(polygon[i][1])+" "+string(polygon[i][2])+") \\fcir f:0.7 r:0.04"; } "EXAMPLE:"; echo=2; // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) // with all integer points as markings list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0), intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3); // define a triangulation by connecting the only interior point // define a triangulation by connecting the only interior point //        with the vertices list triang=intvec(1,2,5),intvec(1,5,10),intvec(1,2,10); //////////////////////////////////////////////////////////////////////////////////// /// Auxilary Procedures /// Auxilary Procedures //////////////////////////////////////////////////////////////////////////////////// // do the same for the remaining part of f and compare the results // keep only the smallest ones int vglgewicht; f=f-lead(f); int vglgewicht; f=f-lead(f); while (f!=0) { leitkoef=simplifyToOrder(f); leitkoef=simplifyToOrder(f); vglgewicht=leitkoef[1]+scalarproduct(w,leadexp(f)); if (vglgewicht x+t^b, with b a rational number, on the tropicalisation and // the j-invariant of a cubic over the Puiseux series. // - the j-invariant, and hence its valuation, does not change under the transformation jInvariant(f,"ord"); // - b=3/2, then the cycle length of the tropical cubic equals -val(j-inv) list g32=tropicalSubst(f,2,x,x+t3,y,y); // - b=3/2, then the cycle length of the tropical cubic equals -val(j-inv) list g32=tropicalSubst(f,2,x,x+t3,y,y); tropicalJInvariant(g32); // - b=1, then it is still true, but only just ... proc randomPoly (int d,int ug, int og, list #) "USAGE:      randomPoly(d,ug,og[,#]);   d, ug, og int, # list "USAGE:      randomPoly(d,ug,og[,#]);   d, ug, og int, # list ASSUME:      the basering has a parameter t RETURN:      poly, a polynomial of degree d where the coefficients are of the form t^j with j a random integer between ug and og NOTE:        if an optional argument # is given, then the coefficients are instead either of the NOTE:        if an optional argument # is given, then the coefficients are instead either of the form t^j as above or they are zero, and this is chosen randomly EXAMPLE:     example randomPoly;   shows an example" { if (size(#)!=0) { { k=random(0,1); } if (k==0) { { j=random(ug,og); randomPolynomial=randomPolynomial+t^j*m[i]; RETURN:  none" { system("sh","cd /tmp; /bin/rm -f tropicalcurve*; /bin/rm -f tropicalnewtonsubdivision*"); system("sh","cd /tmp; /bin/rm -f tropicalcurve*; /bin/rm -f tropicalnewtonsubdivision*"); } static proc cutdown (ideal jideal,intvec wvec,int dimension,list #) "USAGE:      cutdown(i,w,d); i ideal, w intvec, d int, # list ASSUME:      i an ideal in Q[t,x_1,...,x_n], (w_1,...,w_n) is in the tropical variety of jideal ASSUME:      i an ideal in Q[t,x_1,...,x_n], (w_1,...,w_n) is in the tropical variety of jideal and d=dim(i)>0, in Q(t)[x]; the optional parameter # can contain the string 'isPrime' to indicate that the input ideal is prime and no minimal associated primes have to indicate that the input ideal is prime and no minimal associated primes have to be computed RETURN:      list, the first entry is a ring, namely the basering where some variables have been wvec with the components corresponding to the eliminated variables removed NOTE:        needs the libraries random.lib and primdec.lib; is called from tropicalLifting" { // IDEA: i is an ideal of dimension d; we want to cut it with d random linear { // IDEA: i is an ideal of dimension d; we want to cut it with d random linear //       forms in such a way that the resulting //       ideal is 0-dim and still contains w in the tropical variety // NOTE: t is the last variable in the basering // NOTE: t is the last variable in the basering ideal pideal;  //this is the ideal we want to return ideal cutideal; variablen=variablen+var(j1); //read the set of variables (needed to make the quotring later) product=product*var(j1); //make product of all variables (needed for the initial-monomial-check later } } execute("ring QUOTRING=("+charstr(basering)+",t),("+string(variablen)+"),dp;"); setring BASERING; { setring QUOTRING; ideal jideal=imap(BASERING,jideal); list primp=minAssGTZ(jideal); //compute the primary decomposition ideal jideal=imap(BASERING,jideal); list primp=minAssGTZ(jideal); //compute the primary decomposition for (j1=1;j1<=size(primp);j1++) { { for(j2=1;j2<=size(primp[j1]);j2++) { primp[j1][j2]=primp[j1][j2]/content(primp[j1][j2]);// clear all denominators } } } setring BASERING; // if i is not primary itself // go through the list of min. ass. primes and find the first one which has w in its tropical variety if (size(primp)>1) if (size(primp)>1) { j1=1; //compute the t-initial of the associated prime // - the last entry 1 only means that t is the last variable in the ring primini=tInitialIdeal(primp[j1],wvec,1); primini=tInitialIdeal(primp[j1],wvec,1); // check if it contains a monomial (resp if the product of var is in the radical) if (radicalMemberShip(product,primini)==0) { if (radicalMemberShip(product,primini)==0) { jideal=primp[j1];// if w is in the tropical variety of the prime, we take that setring QUOTRING; setring BASERING; winprim=1; // and stop the checking } } j1=j1+1;  //else we look at the next associated prime } { jideal=primp[1]; //if i is primary itself we take its prime instead } } } // now we start as a first try to intersect with a hyperplane parallel to // coordinate axes, because this would make our further computations // a lot easier. // a lot easier. // We choose a subset of our n variables of size d=dim(ideal). For each of these // variables, we want to fix a value: x_i= a_i*t^-w_i. This will only work if the // (NOTE, there EXIST d variables such that a random choice of a_i's would work!). // But since this involves many computations, we prefer to choose randomly and just // try in the end if our intersected ideal satisfies our requirements. If this does not // try in the end if our intersected ideal satisfies our requirements. If this does not // work, we give up this try and use our second intersection idea, which // will work for a Zariksi-open subset (i.e. almost always). // wvec-coordinate is smallest, because this will give us the smallest powers of t and hence // less effort in following computations. Note that the smallest absolute value have those // which are biggest, because wvec is negative. // which are biggest, because wvec is negative. //print("first try"); intvec wminust=intvecdelete(wvec,1); A[2,1..size(wminust)]=1..size(wminust); // sort this matrix in order to get the d biggest entries and their position in wvec A=sortintmat(A); // we construct a vector which has 1 at entry j if j belongs to the list A=sortintmat(A); // we construct a vector which has 1 at entry j if j belongs to the list // of the d biggest entries of wvec and a 0 else for (j1=1;j1<=nvars(basering)-1;j1++) //go through the variables { setvec[j1]=1;//put a 1 } } } // using this 0/1-vector we produce a random constant (i.e. coeff in Q times something in t) } } } // using this 0/1-vector we produce a random constant (i.e. coeff in Q times something in t) // for each of the biggest variables, we add the forms x_i-random constant to the ideal // and we save the constant at the i-th place of a list we want to return for later computations { if(setvec[j1]==1)//if x_i belongs to the biggest variables { { if ((j3==1) and ((char(basering)==0) or (char(basering)>3))) { { randomp1=random(1,3); randomp=t^(A[1,j2])*randomp1;//make a random constant --- first we try small numbers } } if ((j3==2) and ((char(basering)==0) or (char(basering)>100))) { randomp1=random(1,100); randomp=t^(A[1,j2])*randomp1;//make a random constant --- next we try bigger numbers } } else { else { ergl[j1]=0; //if the variable belongs not the the d biggest ones, save 0 in the list ergl[j1]=0; //if the variable belongs not the d biggest ones, save 0 in the list erglini[j1]=0; } } } // print(ergl);print(pideal); // now we check if we made a good choice of pideal, i.e. if dim=0 and // now we check if we made a good choice of pideal, i.e. if dim=0 and // wvec is still in the tropical variety //change to quotring where we compute dimension { if(setvec[j1]==1) { cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal } { cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal } } setring QUOTRING; // and if the initial w.r.t. t contains no monomial as we want (checked with // radical-membership of the product of all variables) if (radicalMemberShip(product,pini)==0) { // we made the right choice and now we substitute the variables in the ideal if (radicalMemberShip(product,pini)==0) { // we made the right choice and now we substitute the variables in the ideal //to get an ideal in less variables // also we make a projected vector from wvec only the components of the remaining variables wvecp=wvec; variablen=0; variablen=0; j2=0; for(j1=1;j1<=nvars(basering)-1;j1++) { variablen=variablen+var(j1); //read the set of remaining variables (needed to make quotring later) } } } } // return pideal, the initial and the list ergl which tells us // which variables we replaced by which form export(ini); export(repl); return(list(BASERINGLESS1,wvecp)); return(list(BASERINGLESS1,wvecp)); } } // probability 1. // // We choose general hyperplanes, i.e. linear forms which involve all x_i. // Each x_i has to be multiplied bz t^(w_i) in order to get the same weight (namely 0) // We choose general hyperplanes, i.e. linear forms which involve all x_i. // Each x_i has to be multiplied bz t^(w_i) in order to get the same weight (namely 0) // for each term. As we cannot have negative exponents, we multiply // the whole form by t^minimumw. Notice that then in the first form, // the whole form by t^minimumw. Notice that then in the first form, // there is one term without t- the term of the variable // x_i such that w_i is minimal. That is, we can solve for this variable. // In the second form, we can replace that variable, and divide by t as much as possible. // Then there is again one term wihtout t - the term of the variable with second least w. // In the second form, we can replace that variable, and divide by t as much as possible. // Then there is again one term wihtout t - the term of the variable with second least w. // So we can solve for this one again and also replace it in the first form. // Since all our coefficients are chosen randomly, we can also from the beginning on // choose the set of variables which belong to the d smallest entries of wvec // (t not counting) and pick random forms g_i(t,x') (where x' is the set of remaining variables) // and set x_i=g_i(t,x'). // Since all our coefficients are chosen randomly, we can also from the beginning on // choose the set of variables which belong to the d smallest entries of wvec // (t not counting) and pick random forms g_i(t,x') (where x' is the set of remaining variables) // and set x_i=g_i(t,x'). // // make a matrix with first row wvec (without t) and second row 1..n //print("second try"); setring BASERING; A[1,1..size(wminust)]=wminust; A[1,1..size(wminust)]=wminust; A[2,1..size(wminust)]=1..size(wminust); // sort this matrix in otder to get the d smallest entries (without counting the t-entry) setvec=0; setvec[nvars(basering)-1]=0; // we construct a vector which has 1 at entry j if j belongs to the list of // we construct a vector which has 1 at entry j if j belongs to the list of // the d smallest entries of wvec and a 0 else for (j1=1;j1<=nvars(basering)-1;j1++) //go through the variables variablen=variablen+var(j1); //read the set of remaining variables (needed to make the quotring later) } } } setring BASERING; execute("ring BASERINGLESS2=("+charstr(BASERING)+"),("+string(variablen)+",t),(dp("+string(ncols(variablen))+"),lp(1));"); // using the 0/1-vector which tells us which variables belong to the set of smallest entries of wvec // we construct a set of d random linear polynomials of the form x_i=g_i(t,x'), // we construct a set of d random linear polynomials of the form x_i=g_i(t,x'), // where the set of all x_i is the set of // all variables which are in the list of smallest entries in wvec, and x' are the other variables. // We add these d random linear polynomials to the indeal pideal, i.e. we intersect // We add these d random linear polynomials to the indeal pideal, i.e. we intersect // with these and hope to get something // 0-dim which still contains wvec in its tropical variety. Also, we produce a list ergl // 0-dim which still contains wvec in its tropical variety. Also, we produce a list ergl // with g_i at the i-th position. // This is a list we want to return. { if ((char(basering)==0) or (char(basering)>3)) { { randomp1=random(1,3); randomp=randomp1*t^(-A[1,j1]); } //print(ergl); // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether // pideal is 0-dim and contains wvec in the tropical variety. cutideal=pideal; if(setvec[j1]==1) { cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal } cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal } } setring QUOTRING; // and if the initial w.r.t. t contains no monomial as we want (checked with // radical-membership of the product of all variables) if (radicalMemberShip(product,pini)==0) if (radicalMemberShip(product,pini)==0) { // we want to replace the variables x_i by the forms -g_i in // our ideal in order to return an ideal with less variables // our ideal in order to return an ideal with less variables // first we substitute the chosen variables for(j1=1;j1<=nvars(basering)-1;j1++) export(ini); export(repl); return(list(BASERINGLESS2,wvecp)); return(list(BASERINGLESS2,wvecp)); } } randomp=randomp1*t^(-A[1,j1]); for(j2=1;j2<=nvars(basering)-1;j2++)//go through all variables { { if(setvec[j2]==0)//if x_j belongs to the set x' { // add a random term with the suitable power of t to the random linear form if ((char(basering)==0) or (char(basering)>100)) { { randomp2=random(1,100); randomp1=randomp1+randomp2*var(j2); } //print(ergl); // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether // Again, we have to test if we made a good choice to intersect,i.e. we have to check whether // pideal is 0-dim and contains wvec in the tropical variety. cutideal=pideal; if(setvec[j1]==1) { cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal } cutideal=cutideal,var(j1)-ergl[j1];//add all forms to the ideal } } setring QUOTRING; //print(dimp); kill cutideal; setring BASERING; setring BASERING; if (dimp==0) // if it is 0 as we want { // and if the initial w.r.t. t contains no monomial as we want (checked with // radical-membership of the product of all variables) if (radicalMemberShip(product,pini)==0) if (radicalMemberShip(product,pini)==0) { // we want to replace the variables x_i by the forms -g_i in pideal=subst(pideal,var(j1),ergl[j1]);//substitute it pini=subst(pini,var(j1),erglini[j1]); } } } } // return pideal and the list ergl which tells us // which variables we replaced by which form export(ini); export(repl); return(list(BASERINGLESS2,wvecp)); return(list(BASERINGLESS2,wvecp)); } } static proc tropicalparametriseNoabs (ideal i,intvec ww,int ordnung,int gfanold,int nogfan,list #) "USAGE:  tropicalparametriseNoabs(i,tw,ord,gf,ng[,#]); i ideal, tw intvec, ord int, gf,ng int, # opt. list ASSUME:  - i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k], tw=(w_0,w_1,...,w_n,0,...,0) and (w_0,...,w_n,0,...,0) is in the tropical variety of i, and ord is the order up to which a point in V(i) over C((t)) lying over w shall be computed; ASSUME:  - i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k], tw=(w_0,w_1,...,w_n,0,...,0) and (w_0,...,w_n,0,...,0) is in the tropical variety of i, and ord is the order up to which a point in V(i) over C((t)) lying over w shall be computed; - moreover, k should be zero if the procedure is not called recursively; - the point in the tropical variety is supposed to lie in the NEGATIVE orthant; - the ideal is zero-dimensional when considered in (Q(t)[X_1,...,X_k]/m)[x_1,...,x_n], where m=#[2] is a maximal ideal in Q(t)[X_1,...,X_k]; where m=#[2] is a maximal ideal in Q(t)[X_1,...,X_k]; - gf is 0 if version 2.2 or larger is used and it is 1 else - ng is 1 if gfan should not be executed - ng is 1 if gfan should not be executed RETURN:  list, l[1] = ring Q(0,X_1,...,X_r)[[t]] l[2] = int l[3] = string NOTE:    - the procedure is also called recursively by itself, and if it is called in the first recursion, the list # is empty, if it is called in the first recursion, the list # is empty, otherwise #[1] is an integer, one more than the number of true variables x_1,...,x_n, and #[2] will contain the maximal ideal m in the variables X_1,...X_k intvec tw=ww; // in case some variables are deleted, we have to store the old weight vector deletedvariables[anzahlvariablen]=0; ideal I,LI; ideal I,LI; i=i+m; // if a field extension was necessary, then i has to be extended by m for (jj=anzahlvariablen-1;jj>=1;jj--)  // the variable t is the last one !!! if (size(LI)==0) // if no power of t is in lead(I) (where the X(i) are considered as field elements) { // get rid of var(jj) // get rid of var(jj) i=eliminate(I,var(jj)); deletedvariables[jj]=1; execute("ring NEURING=("+charstr(basering)+"),("+string(variablen)+"),(dp("+string(size(variablen)-1)+"),lp(1));"); ideal i=imap(BASERING,i); ideal gesamt_m=imap(BASERING,gesamt_m); ideal gesamt_m=imap(BASERING,gesamt_m); } // now we have to compute a point ww on the tropical variety of the transformed ideal i; def PREGFANRING=basering; if (nogfan!=1) { { // pass to a ring which has variables which are suitable for gfan execute("ring GFANRING=("+charstr(basering)+"),(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),dp;"); ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z; ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z; phiideal[nvars(PREGFANRING)]=a; // map t to a map phi=PREGFANRING,phiideal; map phi=PREGFANRING,phiideal; ideal i=phi(i); // homogenise the ideal i with the first not yet used variable in our ring, since gfan // homogenise the ideal i with the first not yet used variable in our ring, since gfan // only handles homogenous ideals; in principle for this one has first to compute a // standard basis of i and homogenise that, but for the tropical variety (says Anders) // standard basis of i and homogenise that, but for the tropical variety (says Anders) // it suffices to homogenise an arbitrary system of generators // i=groebner(i); // i=groebner(i); i=homog(i,maxideal(1)[nvars(PREGFANRING)+1]); // if gfan version >= 0.3.0 is used and the characteristic ringvariablen=ringvariablen[1..2*nvars(PREGFANRING)+1]; write(":w /tmp/gfaninput","Z/"+string(char(GFANRING))+"Z["+ringvariablen+"]"); // write the ideal to a file which gfan takes as input and call gfan // write the ideal to a file which gfan takes as input and call gfan write(":a /tmp/gfaninput","{"+string(i)+"}"); } else { // write the ideal to a file which gfan takes as input and call gfan else { // write the ideal to a file which gfan takes as input and call gfan write(":w /tmp/gfaninput","{"+string(i)+"}"); } ~ // THIS IS NOT NECESSARY !!!! IF WE COMPUTE NOT ONLY THE TROPICAL PREVARIETY // test, if wneu really is in the tropical variety // test, if wneu really is in the tropical variety while (goon==0) { // if all variables were deleted, then i=0 and thus anzahlvariablen==0 if ((ordnung>1) and (anzahlvariablen>1)) { { // we call the procedure with the transformed ideal i, the new weight vector, with the // required order lowered by one, and with additional parameters, namely the number of string PARAm=PARALIST[3]; setring PARARing; // if some variables have been eliminated in before, then we have to insert zeros // if some variables have been eliminated in before, then we have to insert zeros // into the parametrisation for those variables if (numberdeletedvariables>0) int tweight=-tw[1]; // if additional variables were necessary, we introduce them now as parameters; // in any case the parametrisation ring will have only one variable, namely t, // in any case the parametrisation ring will have only one variable, namely t, // and its order will be local, so that it displays the lowest term in t first if (anzahlvariablen+numberdeletedvariablest^w_0 { { a[j]=X(zaehler); zaehler++; { if (j!=1) // corresponds to  x_(j-1) --  note t is the last variable { { i[k]=substitute(i[k],var(j-1),(a[j]+var(j-1))*t^(-w[j])); } { if (wdegs[j]<0) // if wdegs[j]==0 there is no need to divide, and we made sure that it is no positive { { i[j]=i[j]/t^(-wdegs[j]); } static proc testw (ideal i,intvec w,int anzahlvariablen,list #) "USAGE:      testw(i,w,n); i ideal, w intvec, n number ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k] and w=(w_0,...,w_n,0,...,0) ASSUME:      i is an ideal in Q[t,x_1,...,x_n,X_1,...,X_k] and w=(w_0,...,w_n,0,...,0) RETURN:      int b, 0 if the t-initial ideal of i considered in Q(X_1,...,X_k)[t,x_1,...,x_n] is monomial free, 1 else ideal tin=tInitialIdeal(i,w,1); } int j; ideal variablen; def BASERING=basering; if (anzahlvariablen=1;j--) { { if (l<=k) { { testvariablen[l]=1; } a[k+1]=nf;             // a_k is the normal form of the kth variable modulo m neuevariablen[k+1]=0;  // no new variable is needed } } else { // if the maximal ideal contains a variable, we simply delete it if (pruefer==0) { { minassisort[j]=list(minassi[j],neuvar,neuevariablen,a); } l=j; for (k=j-1;k>=1;k--) { { if (minassisort[l][2]= 0.3.0 is used and the characteristic ~ // THIS IS NOT NECESSARY !!!! IF WE COMPUTE NOT ONLY THE TROPICAL PREVARIETY // test, if wneu really is in the tropical variety // test, if wneu really is in the tropical variety while (goon==0) { lll=0; if ((ordnung>1) and (anzahlvariablen>1)) { { partliftings=list(); // initialise partliftings // we call the procedure with the transformed ideal i, the new weight vector, with the // the maximal ideal that describes the necessary field extension for (ll=1;ll<=size(PARALIST);ll++) { { def PARARing=PARALIST[ll][1]; tweight=-ww[1]*PARALIST[ll][2]; setring PARARing; // if some variables have been eliminated in before, then we have to insert zeros // if some variables have been eliminated in before, then we have to insert zeros // into the parametrisation for those variables if (numberdeletedvariables>0) tweight=-ww[1]; // if additional variables were necessary, we introduce them now as parameters; // in any case the parametrisation ring will have only one variable, namely t, // in any case the parametrisation ring will have only one variable, namely t, // and its order will be local, so that it displays the lowest term in t first if (anzahlvariablen so that // the result lives in the maximal ideal so that // there is a solution which has strictly positive valuation /* // equal to zero then this component has a valuation with all strictly positive values!!!!; // for this we can either saturate the ideal after elimination with respect to // and see if the saturated ideal is contained in +m, // and see if the saturated ideal is contained in +m, // or ALTERNATIVELY we can pass to the ring 0,(t,x_1,...,x_n,@a),(ds(n+1),dp(1)), // compute a standard basis of the elimination ideal (plus m) there and check if the dimension 1 { string elring="ring ELIMINATERING=("+charstr(basering)+"),("+string(simplify(reduce(maxideal(1),std(var(lastvar))),2))+"),("; } } if (anzahlvariablen -- if not, then // test first, if i still is in the ideal -- if not, then // we know that i has no longer a point in the tropical variety with all components negative LI=subst(I,var(nvars(basering)),0); } if (size(LI)==0) // the entries of i have not constant part { { // check now, if the leading ideal of i contains an element which only depends on t LI=lead(I); } else { { execute("ring SATURATERING=("+charstr(basering)+"),("+varstr(basering)+"),("+ordstr(basering)+");"); ideal i=imap(BASERING,i); if (size(LI)==0) // if no power of t is in lead(I) (where the X(i) are considered as field elements) { // get rid of var(j) // get rid of var(j) i=eliminate(I,var(j)); deletedvariables[j]=1; } // if there are variables left, then pass to a ring which only realises these variables // else we are done // else we are done if (anzahlvariablen>1) { { string elring="ring ELIMINATERING=("+charstr(basering)+"),("+string(variablen)+"),("; } } if (size(deletedvariables)+1 t^-w_l*(zero_l+x_l) for (l=1;l<=anzahlvariablen;l++) for (l=1;l<=anzahlvariablen;l++) { for (k=1;k<=size(i);k++) { if (l!=1) // corresponds to  x_(l-1) --  note t is the last variable { { i[k]=substitute(i[k],var(l-1),(zeroneu[l]+var(l-1))*t^(-w[l])); } { if (wdegs[l]<0) // if wdegs[l]==0 there is no need to divide, and we made sure that it is no positive { { i[l]=i[l]/t^(-wdegs[l]); } export(i); export(m); export(zero); export(zero); extensionringlist[j]=EXTENSIONRING; kill EXTENSIONRING; polynomial of the last variable in the ring which is considered as a parameter RETURN:      list, the procedure orders the maximal ideals in minassi according to how many new variables are needed (namely none or one) to describe the zeros of the ideal, variables are needed (namely none or one) to describe the zeros of the ideal, and accordingly to the degree of the corresponding minimal polynomial l[j][1] = the minimal polynomial for the jth maximal ideal l[j][2] = list, the k+1st entry is the kth coordinate of the zero l[j][2] = list, the k+1st entry is the kth coordinate of the zero described by the maximal ideal in terms of the last variable l[j][3] = poly, the replacement for the old variable @a l[j][3] = poly, the replacement for the old variable @a NOTE:        if a maximal ideal contains a variable, it is removed from the list; the procedure is called by findzerosAndBasictransform" list zero;         // (a_1,...,a_n)=(zero[2],...,zero[n+1]) will be a common zero of the ideal m poly nf;           // normalform of a variable w.r.t. m poly minimalpolynomial;  // minimal polynomial for the field extension poly minimalpolynomial;  // minimal polynomial for the field extension poly parrep;       // the old variable @a possibly has to be replaced by a new one // compute for each maximal ideal the number of new variables, which are needed to describe // its zeros -- note, a new variable is needed if the first entry of minassi[j][1] is not the last variable // store the value a variable reduces to in the list a; // store the value a variable reduces to in the list a; for (j=size(minassi);j>=1;j--) { // if the maximal ideal contains a variable, we simply delete it if (pruefer==0) { { minassisort[j]=list(minimalpolynomial,zero,parrep); } l=j; for (k=j-1;k>=1;k--) { { if (deg(minassisort[l][1])=1;j--) { if (bunchoflines[i][1]==bunchoflines[j][1]) if (bunchoflines[i][1]==bunchoflines[j][1]) { bunchoflines=delete(bunchoflines,i); xc=substitute(bunchoflines[i][1]-cc,var(2),0,var(1),1); yc=substitute(bunchoflines[i][1]-cc,var(2),1,var(1),0); if (xc!=0) // then there is a point on the line with y-coordinate zero if (xc!=0) // then there is a point on the line with y-coordinate zero { gr[1]=-cc/leadcoef(xc); static proc clearintmat (intmat vv) "USAGE:      clearintmat(vv); vv intmat "USAGE:      clearintmat(vv); vv intmat ASSUME:      all entries of the first column of vv are non-negative, not all entries are zero unless vv has only one column RETURN:      intmat, vv has been ordered in an ascending way by the entries of the first row; if an entry in the first row occurs several times, the entries in the RETURN:      intmat, vv has been ordered in an ascending way by the entries of the first row; if an entry in the first row occurs several times, the entries in the second row have been added and only one row has been kept; colums with a zero in the first row have been removed unless vv has only one for (int i=ncols(vv)-1;i>=1;i--) { if (vv[1,i]==vv[1,i+1]) if (vv[1,i]==vv[1,i+1]) { vv[2,i]=vv[2,i]+vv[2,i+1]; k++; } else else { stop=1; { int m=nrows(M); } else return(c); } f=f-c; f=f-c; if (k==1) { return(substitute(f,var(1),1,var(2),0)); } } else { return(substitute(f,var(1),0,var(2),1)); } } } ASSUME:      f is a polynomial in Q[x_1,...,x_n], and # is either empty or #[1] is a positive integer RETURN:      string, a decimal expansion of the leading coefficient of f up to order two respectively #[1] NOTE:        the procedure is called by texDrawTropical and conicWithTangents and NOTE:        the procedure is called by texDrawTropical and conicWithTangents and f will actually be a number" { } for (j=i;j<=i+nachkomma;j++) { { news=news+s[j]; } } return(0); } } static proc stringdelete (string w,int i) { return(""); } if (i==1) k=j+2; while (k<=size(F) and ((F[k]=="0") or (F[k]=="1") or (F[k]=="2") or (F[k]=="3") or (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8") (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8") or (F[k]=="9"))) { k=j+2; while (k<=size(F) and ((F[k]=="0") or (F[k]=="1") or (F[k]=="2") or (F[k]=="3") or (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8") (F[k]=="4") or (F[k]=="5") or (F[k]=="6") or (F[k]=="7") or (F[k]=="8") or (F[k]=="9"))) { F=stringdelete(F,j); j--; } } } short=altshort; return(F); } static proc texcoefficient (poly f,list #) "USAGE:      texcoefficient(f[,#]); f poly, # optional list } if (size(koeffizient)>5) { { string tfractest=koeffizient[2..6]; if (tfractest=="tfrac") static proc coordinatechange (poly f,intmat A,intvec v) "USAGE:   coordinatechange(f,A,v);  f poly, A intmat, v intvec ASSUME:   f is a polynomial in two variables, A is a 2x2 ASSUME:   f is a polynomial in two variables, A is a 2x2 integer matrix, and v is an integer vector with 2 entries RETURN:   poly, the polynomial transformed by (x,y)->A*(x,y)+v ASSUME:      poly is a cubic polynomial RETURN:      poly, the Weierstrass normal form of the cubic, 0 if poly is not a cubic NOTE:        - the algorithm for the coefficients of the Weierstrass form is due to NOTE:        - the algorithm for the coefficients of the Weierstrass form is due to Fernando Rodriguez Villegas, villegas@math.utexas.edu - if an additional argument # is given, the simplified Weierstrass form poly a4=((-3*t0*r0+s0^2)*q1+(-3*s1*s0*q0+s1*r0^2))*q3 +(t0*r0*q2^2+(s1*s0*q1+((-3*t0*r2+s1^2)*q0+s0*r0*r2))*q2 +(t0*r2*q1^2+s1*r0*r2*q1+s0*r2^2*q0)); +(t0*r2*q1^2+s1*r0*r2*q1+s0*r2^2*q0)); poly a6=(-27*t0^2*q0^2+(9*t0*s0*r0-s0^3)*q0-t0*r0^3)*q3^2+ (((9*t0^2*q0-t0*s0*r0)*q1+((-3*t0*s0*r1+(3*t0*s1*r0+ 2*s1*s0^2))*q0+(t0*r0^2*r1-s1*s0*r0^2)))*q2+(-t0^2*q1^3 +(t0*s0*r1+(2*t0*s1*r0-s1*s0^2))*q1^2+((3*t0*s0*r2+ (-3*t0*s1*r1+2*s1^2*s0))*q0+((2*t0*r0^2-s0^2*r0)*r2+ (-t0*r0*r1^2+s1*s0*r0*r1-s1^2*r0^2)))*q1+((9*t0*s1*r2- s1^3)*q0^2+(((-3*t0*r0+s0^2)*r1-s1*s0*r0)*r2+(t0*r1^3 -s1*s0*r1^2+s1^2*r0*r1))*q0)))*q3+(-t0^2*q0*q2^3+ (-t0*s1*r0*q1+((2*t0*s0*r2+(t0*s1*r1-s1^2*s0))*q0- t0*r0^2*r2))*q2^2+(-t0*s0*r2*q1^2+(-t0*s1*r2*q0+ (t0*r0*r1-s1*s0*r0)*r2)*q1+((2*t0*r0-s0^2)*r2^2+ (-t0*r1^2+s1*s0*r1-s1^2*r0)*r2)*q0)*q2+ (-t0*r0*r2^2*q1^2+(t0*r1-s1*s0)*r2^2*q0*q1- (((9*t0^2*q0-t0*s0*r0)*q1+((-3*t0*s0*r1+(3*t0*s1*r0+ 2*s1*s0^2))*q0+(t0*r0^2*r1-s1*s0*r0^2)))*q2+(-t0^2*q1^3 +(t0*s0*r1+(2*t0*s1*r0-s1*s0^2))*q1^2+((3*t0*s0*r2+ (-3*t0*s1*r1+2*s1^2*s0))*q0+((2*t0*r0^2-s0^2*r0)*r2+ (-t0*r0*r1^2+s1*s0*r0*r1-s1^2*r0^2)))*q1+((9*t0*s1*r2- s1^3)*q0^2+(((-3*t0*r0+s0^2)*r1-s1*s0*r0)*r2+(t0*r1^3 -s1*s0*r1^2+s1^2*r0*r1))*q0)))*q3+(-t0^2*q0*q2^3+ (-t0*s1*r0*q1+((2*t0*s0*r2+(t0*s1*r1-s1^2*s0))*q0- t0*r0^2*r2))*q2^2+(-t0*s0*r2*q1^2+(-t0*s1*r2*q0+ (t0*r0*r1-s1*s0*r0)*r2)*q1+((2*t0*r0-s0^2)*r2^2+ (-t0*r1^2+s1*s0*r1-s1^2*r0)*r2)*q0)*q2+ (-t0*r0*r2^2*q1^2+(t0*r1-s1*s0)*r2^2*q0*q1- t0*r2^3*q0^2)); poly b2=a1^2+4*a2; i.e. a polynomial of the form a+bx+cx2+dy+exy+fx2y+gy2+hxy2+ix2y2 RETURN:      poly, a Weierstrass form of the elliptic curve defined by poly NOTE:        - the algorithm is based on the paper Sang Yook An, Seog Young Kim, NOTE:        - the algorithm is based on the paper Sang Yook An, Seog Young Kim, David C. Marshall, Susan H. Marshall, William G. McCallum and Alexander R. Perlis: Jacobians of Genus One Curves. Journal of Number Theory 90,2 (2001), 304-315. static proc jInvariantOfACubic (poly f,list #) "USAGE:      jInvariantOfACubic(f[,#]); f poly, # list "USAGE:      jInvariantOfACubic(f[,#]); f poly, # list ASSUME:      poly is a cubic polynomial defining an elliptic curve RETURN:      poly, the j-invariant of the elliptic curve defined by poly static proc jInvariantOfA2x2Curve (poly f,list #) "USAGE:      jInvariantOfA2x2Curve(f[,#]); f poly, # list "USAGE:      jInvariantOfA2x2Curve(f[,#]); f poly, # list ASSUME:      poly, is a polynomial defining an elliptic curve of type (2,2) on P^1xP^1, i.e. a polynomial of the form a+bx+cx2+dy+exy+fx2y+gy2+hxy2+ix2y2 static proc jInvariantOfA4x2Curve (poly f,list #) "USAGE:      jInvariantOfA4x2Curve(f[,#]); f poly, # list "USAGE:      jInvariantOfA4x2Curve(f[,#]); f poly, # list ASSUME:      poly, is a polynomial defining an elliptic curve of type (4,2), i.e. a polynomial of the form a+bx+cx2+dx3+ex4+fy+gxy+hx2y+iy2 static proc jInvariantOfAPuiseuxCubic (poly f,list #) "USAGE:      jInvariantOfAPuiseuxCubic(f[,#]); f poly, # list "USAGE:      jInvariantOfAPuiseuxCubic(f[,#]); f poly, # list ASSUME:      poly is a cubic polynomial over Q(t) defining an elliptic curve and # is empty RETURN:      list, containing two polynomials whose ratio is the j-invariant of the RETURN:      list, containing two polynomials whose ratio is the j-invariant of the elliptic curve defined by poly ASSUME:      poly is a cubic polynomial over Q(t) defining an elliptic curve and # is non-empty // Example 3 - the ideal is not zero dimensional // -------------------------------------------------------- ring r1=0,(t,x,y),dp; ring r1=0,(t,x,y),dp; poly f=(9t27-12t26-5t25+21t24+35t23-51t22-40t21+87t20+56t19-94t18-62t17+92t16+56t15-70t14-42t13+38t12+28t11+18t10-50t9-48t8+40t7+36t6-16t5-12t4+4t2)*x2+(-9t24+12t23-4t22-42t20+28t19+30t18-20t17-54t16+16t15+48t14-16t12+8t11-18t10-26t9+30t8+20t7-24t6+4t5+28t4-8t3-16t2+4)*xy+(6t16-10t15-2t14+16t13+4t12-18t11-10t10+24t9+6t8-20t7+8t6+8t5-20t4-4t3+12t2+4t-4)*y2+(-9t28+3t27+8t26-4t25-45t24-6t23+42t22+30t21-94t20-40t19+68t18+82t17-38t16-60t15+26t14+36t13-22t12-20t11+4t10+4t9+12t8+8t7-8t6-8t5+4t4)*x+(9t27-21t26+16t25+14t24+12t23-61t22+27t21+80t20-19t19-100t18+26t17+96t16-24t15-84t14+44t12-2t11-18t10+2t9+40t8+4t7-32t6-12t5+4t3+12t2-4)*y+(9t27-12t26+4t25+36t23-18t22-28t21-2t20+54t19+14t18-52t17-44t16+24t15+40t14-4t13-12t12+4t11-4t10-4t9+4t8); f; poly f=t*(x7+y7+1)+1/t*(x4+y4+x2+y2+x3y+xy3)+1/t7*x2y2; list graph=tropicalCurve(f); graph; graph; size(graph)-1; drawTropicalCurve(graph);
• Singular/LIB/tst.lib

 rfba86f8 // $Id: tst.lib,v 1.33 2005-05-18 17:54:58 Singular Exp$ // $Id: tst.lib,v 1.34 2008-10-09 09:31:58 Singular Exp$ //(obachman, last modified 6/30/98) ///////////////////////////////////////////////////////////////////////////// version="$Id: tst.lib,v 1.33 2005-05-18 17:54:58 Singular Exp$"; version="$Id: tst.lib,v 1.34 2008-10-09 09:31:58 Singular Exp$"; category="Utilities"; info=" prepending prefix \"// tst_ignore:\" tst_init()             writes some identification data to GetTstStatusFile() tst_status([any])      writes status info to to GetTstStatusFile() tst_status([any])      writes status info to GetTstStatusFile() tst_InitTimer()        initialize tst-Timer tst_StopTimer()        stop Tst-Timer { "EXAMPLE"; echo = 2; string s = tst_system("echo This is is an example of tst_system"); string s = tst_system("echo This is an example of tst_system"); "The following is what the system call wrote to stdout: " + s; }
• Singular/LIB/zeroset.lib

 rfba86f8 // Last change 12.02.2001 (Eric Westenberger) /////////////////////////////////////////////////////////////////////////////// version="$Id: zeroset.lib,v 1.17 2007-03-14 18:27:47 Singular Exp$"; version="$Id: zeroset.lib,v 1.18 2008-10-09 09:31:58 Singular Exp$"; category="Symbolic-numerical solving"; info=" list result = RootsMain(f);  // find roots of f // store the roots and the the new representation of 'a' and transform // store the roots and the new representation of 'a' and transform // the coefficients of f.
Note: See TracChangeset for help on using the changeset viewer.