//////////////////////////////////////////////////////////////////////////// version="version reesclos.lib 4.0.0.0 Jun_2013 "; // $Id$ category="Commutative Algebra"; info=" LIBRARY: reesclos.lib PROCEDURES TO COMPUTE THE INT. CLOSURE OF AN IDEAL AUTHOR: Tobias Hirsch, email: hirsch@math.tu-cottbus.de Janko Boehm, email: boehm@mathematik.uni-kl.de Magdaleen Marais, email: magdaleen@aims.ac.za OVERVIEW: A library to compute the integral closure of an ideal I in a polynomial ring R=k[x(1),...,x(n)] using the Rees Algebra R[It] of I. It computes the integral closure of R[It], which is a graded subalgebra of R[t]. The degree-k-component is the integral closure of the k-th power of I. In contrast to the previous version, the library uses 'normal.lib' to compute the integral closure of R[It]. This improves the performance considerably. PROCEDURES: ReesAlgebra(I); computes the Rees Algebra of an ideal I normalI(I[,p[,r]]); computes the integral closure of an ideal I using R[It] "; LIB "locnormal.lib"; // for HomJJ LIB "standard.lib"; // for groebner /////////////////////////////////////////////////////////////////////////////// proc ReesAlgebra (ideal I) "USAGE: ReesAlgebra (I); I = ideal RETURN: The Rees algebra R[It] as an affine ring, where I is an ideal in R. The procedure returns a list containing two rings: [1]: a ring, say RR; in the ring an ideal ker such that R[It]=RR/ker [2]: a ring, say Kxt; the basering with additional variable t containing an ideal mapI that defines the map RR-->Kxt EXAMPLE: example ReesAlgebra; shows an example " { // remember the data of the basering def oldring = basering; string oldchar = charstr(basering); string oldvar = varstr(basering); string oldord = ordstr(basering); int n = ncols(I); ideal m = maxideal(1); // Create a new ring with variables for each generator of I execute ("ring Rees = "+oldchar+",("+oldvar+",U(1.."+string(n)+")),dp"); // Kxt is the old ring with additional variable t // Here I -> t*I, so the generators of I generate the subalgebra R[It] in Kxt execute ("ring Kxt = "+oldchar+",("+oldvar+",t),dp"); ideal I = fetch(oldring,I); ideal m = fetch(oldring,m); int k; for (k=1;k<=n;k++) { I[k]=t*I[k]; } // Now we map from Rees to Kxt, identity on the original variables, and // U(k) -> I[k] ideal mapI = m,I; map phi = Rees,mapI; ideal zero = 0; export (mapI); // Now the Rees-Algebra is Rees/ker(phi) setring Rees; ideal ker = preimage(Kxt,phi,zero); export (ker); list result = Rees,Kxt; return(result); } example { "EXAMPLE:"; echo=2; ring R = 0,(x,y),dp; ideal I = x2,xy4,y5; list L = ReesAlgebra(I); def Rees = L[1]; // defines the ring Rees, containing the ideal ker setring Rees; // passes to the ring Rees Rees; ker; // R[It] is isomorphic to Rees/ker } //////////////////////////////////////////////////////////////////////////// static proc ClosureRees (list L, int useLocNormal) "USAGE: ClosureRees (L,useLocNormal); L a list, useLocNormal an integer ASSUME: L is a list containing - a ring L[1], inside L[1] an ideal ker such that L[1]/ker is isomorphic to the Rees Algebra R[It] of an ideal I in k[x] - a ring L[2]=k[x,t], inside L[1] an ideal mapI defining the map L[1] --> L[2] with image R[It] RETURN: quotients of elements of k[x,t] representing generators of the integral closure of R[It]. The result of ClosureRees is a list images, the first size(images)-1 entries are the numerators of the generators, the last one is the universal denominator " { int dblvl=printlevel-voice+2; // toggles how much data is printed // during the procedure def Kxt = basering; def R(1) = L[1]; setring R(1); // declaration of variables used later ideal ker(1)=ker; // in STEP 2 if (useLocNormal==1) { list preimages1 = locNormal(ker); ideal preimagesI=preimages1[1]; list preimagesL = list(preimagesI[2..size(preimagesI)])+list(preimagesI[1]); ideal preimages = ideal(preimagesL[1..size(preimagesL)]); } else { list nor = normal(ker); ideal preimages=nor[2][1]; } setring Kxt; map psi=R(1),mapI; // from ReesAlgebra: the map Rees->Kxt ideal images=psi(preimages); ideal psii = images[size(images)]*ideal(psi); list imagesl = images[1..size(images)]; list psil =psii[1..size(psii)]; imagesl=psil+imagesl; return(imagesl); } //////////////////////////////////////////////////////////////////////////// static proc ClosurePower(list images, list #) "USAGE: ClosurePower (L [,#]); L a list, # an optional list containing an integer ASSUME: - L is a list containing generators of the closure of R[It] in k[x,t] (the first size(L)-1 elements are the numerators, the last one is the denominator) - if # is given: #[1] is an integer, compute generators for the closure of I, I^2, ..., I^#[1] RETURN: the integral closure of I, ... I^#[1]. If # is not given, compute the closure of all powers up to the maximum degree in t occurring in the closure of R[It] (so this is the last power whose closure is not just the sum/product of the smaller powers). The returned result is a list of elements of k[x,t] containing generators of the closure of the desired powers of I. " { int dblvl=printlevel-voice+2; // toggles how much data is printed // during the procedure int j,k,d,computepow; // some counters int pow=0; int length = size(images)-1; // the number of generators poly image; poly @denominator = images[length+1]; // the universal denominator if (size(#)>0) { pow=#[1]; } computepow=pow; if (dblvl>0) { ""; "// The generators of the closure of R[It]:"; } intmat m[nvars(basering)-1][1]; // an intvec used for jet and maxdeg1 intvec tw=m,1; // such that t has weight 1 and all // other variables have weight 0 // Construct the generators of the closure of R[It] as elements of k[x,t] // If # is not given, determine the highest degree pow in t that occurs. for (j=1;j<=length;j++) { images[j] = (images[j]/@denominator); // construct the fraction image = images[j]; if (dblvl>0) { "generator",j,":",image; } if (computepow==0) // #[1] not given or ==0 => compute pow { if (maxdeg1(image,tw)>pow) // from poly.lib { pow=maxdeg1(image,tw); } } } if (dblvl>0) { ""; if (computepow==0) { "// Compute the closure up to the given powers of I"; } else { "// Compute the closure up to the maximal power of t that occured:",pow; } } // Construct a list consisting of #[1] resp. pow times the zero ideal ideal CurrentPower=0; list result; for (k=1;k<=pow;k++) { result=insert(result,CurrentPower); } // For each generator and each k, add its degree-k-coefficient to the # // closure of I^k for (j=1;j<=length;j++) { for (k=1;k<=pow;k++) { image=images[j]-jet(images[j],k-1,tw); if (image<>0) { image=subst(image/t^k,t,0); if (image<>0) { result[k]=result[k]+image; } } } } if (dblvl>0) { ""; "// The 'pure' parts of degrees 1..pow:"; result; ""; } // finally, add the suitable products of generators in lower degrees for (k=2;k<=pow;k++) { for (j=1;j<=(k div 2);j++) { result[k]=result[k]+result[j]*result[k-j]; } } return(result); } //////////////////////////////////////////////////////////////////////////// proc normalI(ideal I, list #) "USAGE: normalI (I [,p [,r [,l]]]); I an ideal, p, r, and l optional integers RETURN: the integral closure of I, ..., I^p, where I is an ideal in the polynomial ring R=k[x(1),...x(n)]. If p is not given, or p==0, compute the closure of all powers up to the maximum degree in t occurring in the closure of R[It] (so this is the last power whose closure is not just the sum/product of the smaller). If r is given and r==1, normalI starts with a check whether I is already a radical ideal. If l==1 then locNormal instead of normal is used to compute normalization. The result is a list containing the closure of the desired powers of I as ideals of the basering. DISPLAY: The procedure displays more comments for higher printlevel. EXAMPLE: example normalI; shows an example " { int dblvl=printlevel-voice+2; // toggles how much data is printed // during the procedure def BAS=basering; // remember the basering // two simple cases: principal ideals and radical ideals are always // integrally closed if (size(I)<=1) // includes the case I=(0) { if (dblvl>0) { "// Trivial case: I is a principal ideal"; } list result=I; if (size(#)>0) { for (int k=1;k<=#[1]-1;k++) { result=insert(result,I*result[k],k); } } return(result); } int testrad=0; // do the radical check? int uselocNormal=0; if (size(#)>1) { testrad=#[2]; if (size(#)==3) { uselocNormal=#[3]; } } if (testrad==1) { if (dblvl>0) { "//Check whether I is radical"; } if (size(reduce(radical(I),std(I)))==0) { if (dblvl>0) { "//Trivial case: I is a radical ideal"; } list result=I; if (size(#)>0) { for (int k=1;k<=#[1]-1;k++) { result=insert(result,I*result[k],k); } } return(result); } } // start with the computation of the Rees Algebra R[It] of I if (dblvl>0) { "// We start with the Rees Algebra of I:"; } list Rees = ReesAlgebra(I); def R(1)=Rees[1]; def Kxt=Rees[2]; setring R(1); if (dblvl>0) { R(1); ker; ""; "// Now ClosureRees computes generators for the integral closure"; "// of R[It] step by step"; } // ClosureRees computes fractions in R[x,t] representing the generators // of the closure of R[It] in k[x,t], which is the same as the closure // in Q(R[It]). // the first size(images)-1 entries are the numerators of the gene- // rators, the last entry is the 'universal' denominator setring Kxt; list images = ClosureRees(Rees,uselocNormal); // ClosureRees was done after the first HomJJ-call // ==> I is integrally closed, and images consists of the only entry "closed" if ((size(images)==1) && (typeof(images[1])=="string")) { if (dblvl>0) { "//I is integrally closed!"; } setring BAS; list result=I; if (size(#)>0) { for (int k=1;k<=#[1]-1;k++) { result=insert(result,I*result[k],k); } } return(result); } // construct the fractions corresponding to the generators of the // closure of I and its powers, depending on # (in fact, they will // not be real fractions, of course). This is done in ClosurePower. list result = ClosurePower(images,#); // finally fetch the result to the old basering setring BAS; list result=fetch(Kxt,result); return(result); } example { "EXAMPLE:"; echo=2; ring R=0,(x,y),dp; ideal I = x2,xy4,y5; list J = normalI(I); I; J; // J[1] is the integral closure of I } /* LIB"reesclos.lib"; // 1. x^i,y^i in k[x,y] // geht bis i = 19 (800sec), bis i=10 wenige Sekunden, // bei i = 20 ueber 1GB Hauptspeicher, in der 9. Iteration no memory // (braucht 20 Iterationen) ring r = 0,(x,y),dp; int i = 6; ideal I = x^i,y^i; list J = normalI(I); I; J; //================================================================ // 2. x^i,y^i,z^i in k[x,y,z] // aehnlich wie 1., funktioniert aber nur bis i=5 und dauert dort // >1 h //================================================================ // 3. scheitert in der ersten Iteration beim Radikal // Standardbasis des singulaeren Ortes: 7h (in char0), // in char(p) viel schneller, obwohl kleine Koeffizienten // schon bei Radikal -Test braucht er zu lang (>1h) ring r = 0,(x,y,z),dp; //ring r = 32003,(x,y,z),dp; ideal I = x2+xy3-5z,z3+y2-xzy,x2y3z5+y3-y5; list l= ReesAlgebra(I); list J = normalI(I); I; J; */