1 | //////////////////////////////////////////////////////////////////////////// |
---|
2 | version="version reesclos.lib 4.1.1.0 Dec_2017 "; // $Id$ |
---|
3 | category="Commutative Algebra"; |
---|
4 | |
---|
5 | info=" |
---|
6 | LIBRARY: reesclos.lib PROCEDURES TO COMPUTE THE INT. CLOSURE OF AN IDEAL |
---|
7 | AUTHOR: Tobias Hirsch, email: hirsch@math.tu-cottbus.de |
---|
8 | Janko Boehm, email: boehm@mathematik.uni-kl.de |
---|
9 | Magdaleen Marais, email: magdaleen@aims.ac.za |
---|
10 | |
---|
11 | OVERVIEW: |
---|
12 | A library to compute the integral closure of an ideal I in a polynomial ring |
---|
13 | R=k[x(1),...,x(n)] using the Rees Algebra R[It] of I. It computes the integral |
---|
14 | closure of R[It], |
---|
15 | which is a graded subalgebra of R[t]. The degree-k-component is the integral |
---|
16 | closure of the k-th power of I. |
---|
17 | |
---|
18 | In contrast to the previous version, the library uses 'normal.lib' to compute the |
---|
19 | integral closure of R[It]. This improves the performance considerably. |
---|
20 | |
---|
21 | PROCEDURES: |
---|
22 | ReesAlgebra(I); computes the Rees Algebra of an ideal I |
---|
23 | normalI(I[,p[,r]]); computes the integral closure of an ideal I using R[It] |
---|
24 | "; |
---|
25 | |
---|
26 | LIB "locnormal.lib"; // for HomJJ |
---|
27 | LIB "standard.lib"; // for groebner |
---|
28 | |
---|
29 | /////////////////////////////////////////////////////////////////////////////// |
---|
30 | |
---|
31 | proc ReesAlgebra (ideal I) |
---|
32 | "USAGE: ReesAlgebra (I); I = ideal |
---|
33 | RETURN: The Rees algebra R[It] as an affine ring, where I is an ideal in R. |
---|
34 | The procedure returns a list containing two rings: |
---|
35 | [1]: a ring, say RR; in the ring an ideal ker such that R[It]=RR/ker |
---|
36 | |
---|
37 | [2]: a ring, say Kxt; the basering with additional variable t |
---|
38 | containing an ideal mapI that defines the map RR-->Kxt |
---|
39 | EXAMPLE: example ReesAlgebra; shows an example |
---|
40 | " |
---|
41 | { |
---|
42 | // remember the data of the basering |
---|
43 | |
---|
44 | def oldring = basering; |
---|
45 | string oldchar = charstr(basering); |
---|
46 | string oldvar = varstr(basering); |
---|
47 | string oldord = ordstr(basering); |
---|
48 | int n = ncols(I); |
---|
49 | ideal m = maxideal(1); |
---|
50 | |
---|
51 | |
---|
52 | // Create a new ring with variables for each generator of I |
---|
53 | |
---|
54 | execute ("ring Rees = "+oldchar+",("+oldvar+",U(1.."+string(n)+")),dp"); |
---|
55 | |
---|
56 | |
---|
57 | // Kxt is the old ring with additional variable t |
---|
58 | // Here I -> t*I, so the generators of I generate the subalgebra R[It] in Kxt |
---|
59 | |
---|
60 | execute ("ring Kxt = "+oldchar+",("+oldvar+",t),dp"); |
---|
61 | ideal I = fetch(oldring,I); |
---|
62 | ideal m = fetch(oldring,m); |
---|
63 | int k; |
---|
64 | for (k=1;k<=n;k++) |
---|
65 | { |
---|
66 | I[k]=t*I[k]; |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | // Now we map from Rees to Kxt, identity on the original variables, and |
---|
71 | // U(k) -> I[k] |
---|
72 | |
---|
73 | ideal mapI = m,I; |
---|
74 | map phi = Rees,mapI; |
---|
75 | ideal zero = 0; |
---|
76 | export (mapI); |
---|
77 | |
---|
78 | // Now the Rees-Algebra is Rees/ker(phi) |
---|
79 | |
---|
80 | setring Rees; |
---|
81 | ideal ker = preimage(Kxt,phi,zero); |
---|
82 | export (ker); |
---|
83 | |
---|
84 | list result = Rees,Kxt; |
---|
85 | |
---|
86 | return(result); |
---|
87 | |
---|
88 | } |
---|
89 | example |
---|
90 | { |
---|
91 | "EXAMPLE:"; echo=2; |
---|
92 | ring R = 0,(x,y),dp; |
---|
93 | ideal I = x2,xy4,y5; |
---|
94 | list L = ReesAlgebra(I); |
---|
95 | def Rees = L[1]; // defines the ring Rees, containing the ideal ker |
---|
96 | setring Rees; // passes to the ring Rees |
---|
97 | Rees; |
---|
98 | ker; // R[It] is isomorphic to Rees/ker |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | //////////////////////////////////////////////////////////////////////////// |
---|
103 | |
---|
104 | static |
---|
105 | proc ClosureRees (list L, int useLocNormal) |
---|
106 | "USAGE: ClosureRees (L,useLocNormal); L a list, useLocNormal an integer |
---|
107 | ASSUME: L is a list containing |
---|
108 | - a ring L[1], inside L[1] an ideal ker such that L[1]/ker is |
---|
109 | isomorphic to the Rees Algebra R[It] of an ideal I in k[x] |
---|
110 | - a ring L[2]=k[x,t], inside L[1] an ideal mapI defining the |
---|
111 | map L[1] --> L[2] with image R[It] |
---|
112 | RETURN: quotients of elements of k[x,t] representing generators of the |
---|
113 | integral closure of R[It]. The result of ClosureRees is a list |
---|
114 | images, the first size(images)-1 entries are the numerators of the |
---|
115 | generators, the last one is the universal denominator |
---|
116 | " |
---|
117 | { |
---|
118 | int dblvl=printlevel-voice+2; // toggles how much data is printed |
---|
119 | // during the procedure |
---|
120 | |
---|
121 | def Kxt = basering; |
---|
122 | def R(1) = L[1]; |
---|
123 | setring R(1); // declaration of variables used later |
---|
124 | ideal ker(1)=ker; // in STEP 2 |
---|
125 | if (useLocNormal==1) { |
---|
126 | list preimages1 = locNormal(ker); |
---|
127 | ideal preimagesI=preimages1[1]; |
---|
128 | list preimagesL = list(preimagesI[2..size(preimagesI)])+list(preimagesI[1]); |
---|
129 | ideal preimages = ideal(preimagesL[1..size(preimagesL)]); |
---|
130 | } else { |
---|
131 | list nor = normal(ker); |
---|
132 | ideal preimages=nor[2][1]; |
---|
133 | } |
---|
134 | setring Kxt; |
---|
135 | map psi=R(1),mapI; // from ReesAlgebra: the map Rees->Kxt |
---|
136 | ideal images=psi(preimages); |
---|
137 | ideal psii = images[size(images)]*ideal(psi); |
---|
138 | list imagesl = images[1..size(images)]; |
---|
139 | list psil =psii[1..size(psii)]; |
---|
140 | imagesl=psil+imagesl; |
---|
141 | return(imagesl); |
---|
142 | } |
---|
143 | |
---|
144 | |
---|
145 | //////////////////////////////////////////////////////////////////////////// |
---|
146 | |
---|
147 | static |
---|
148 | proc ClosurePower(list images, list #) |
---|
149 | "USAGE: ClosurePower (L [,#]); L a list, # an optional list containing an |
---|
150 | integer |
---|
151 | ASSUME: - L is a list containing generators of the closure of R[It] in k[x,t] |
---|
152 | (the first size(L)-1 elements are the numerators, the last one |
---|
153 | is the denominator) |
---|
154 | - if # is given: #[1] is an integer, compute generators for the |
---|
155 | closure of I, I^2, ..., I^#[1] |
---|
156 | RETURN: the integral closure of I, ... I^#[1]. If # is not given, compute |
---|
157 | the closure of all powers up to the maximum degree in t occurring |
---|
158 | in the closure of R[It] (so this is the last power whose closure is |
---|
159 | not just the sum/product of the smaller powers). The returned |
---|
160 | result is a list of elements of k[x,t] containing generators of the |
---|
161 | closure of the desired powers of I. " |
---|
162 | { |
---|
163 | int dblvl=printlevel-voice+2; // toggles how much data is printed |
---|
164 | // during the procedure |
---|
165 | |
---|
166 | int j,k,d,computepow; // some counters |
---|
167 | int pow=0; |
---|
168 | int length = size(images)-1; // the number of generators |
---|
169 | poly image; |
---|
170 | poly @denominator = images[length+1]; // the universal denominator |
---|
171 | |
---|
172 | if (size(#)>0) |
---|
173 | { |
---|
174 | pow=#[1]; |
---|
175 | } |
---|
176 | computepow=pow; |
---|
177 | |
---|
178 | if (dblvl>0) |
---|
179 | { |
---|
180 | ""; |
---|
181 | "// The generators of the closure of R[It]:"; |
---|
182 | } |
---|
183 | |
---|
184 | intmat m[nvars(basering)-1][1]; // an intvec used for jet and maxdeg1 |
---|
185 | intvec tw=m,1; // such that t has weight 1 and all |
---|
186 | // other variables have weight 0 |
---|
187 | |
---|
188 | // Construct the generators of the closure of R[It] as elements of k[x,t] |
---|
189 | // If # is not given, determine the highest degree pow in t that occurs. |
---|
190 | |
---|
191 | for (j=1;j<=length;j++) |
---|
192 | { |
---|
193 | images[j] = (images[j]/@denominator); // construct the fraction |
---|
194 | image = images[j]; |
---|
195 | if (dblvl>0) |
---|
196 | { |
---|
197 | "generator",j,":",image; |
---|
198 | } |
---|
199 | |
---|
200 | if (computepow==0) // #[1] not given or ==0 => compute pow |
---|
201 | { |
---|
202 | if (maxdeg1(image,tw)>pow) // from poly.lib |
---|
203 | { |
---|
204 | pow=maxdeg1(image,tw); |
---|
205 | } |
---|
206 | } |
---|
207 | } |
---|
208 | |
---|
209 | if (dblvl>0) |
---|
210 | { |
---|
211 | ""; |
---|
212 | if (computepow==0) |
---|
213 | { |
---|
214 | "// Compute the closure up to the given powers of I"; |
---|
215 | } |
---|
216 | else |
---|
217 | { |
---|
218 | "// Compute the closure up to the maximal power of t that occurred:",pow; |
---|
219 | } |
---|
220 | } |
---|
221 | |
---|
222 | // Construct a list consisting of #[1] resp. pow times the zero ideal |
---|
223 | |
---|
224 | ideal CurrentPower=0; |
---|
225 | list result; |
---|
226 | for (k=1;k<=pow;k++) |
---|
227 | { |
---|
228 | result=insert(result,CurrentPower); |
---|
229 | } |
---|
230 | |
---|
231 | // For each generator and each k, add its degree-k-coefficient to the # |
---|
232 | // closure of I^k |
---|
233 | |
---|
234 | for (j=1;j<=length;j++) |
---|
235 | { |
---|
236 | for (k=1;k<=pow;k++) |
---|
237 | { |
---|
238 | image=images[j]-jet(images[j],k-1,tw); |
---|
239 | if (image<>0) |
---|
240 | { |
---|
241 | image=subst(image/t^k,t,0); |
---|
242 | if (image<>0) |
---|
243 | { |
---|
244 | result[k]=result[k]+image; |
---|
245 | } |
---|
246 | } |
---|
247 | } |
---|
248 | } |
---|
249 | |
---|
250 | if (dblvl>0) |
---|
251 | { |
---|
252 | ""; |
---|
253 | "// The 'pure' parts of degrees 1..pow:"; |
---|
254 | result; |
---|
255 | ""; |
---|
256 | } |
---|
257 | |
---|
258 | // finally, add the suitable products of generators in lower degrees |
---|
259 | |
---|
260 | for (k=2;k<=pow;k++) |
---|
261 | { |
---|
262 | for (j=1;j<=(k div 2);j++) |
---|
263 | { |
---|
264 | result[k]=result[k]+result[j]*result[k-j]; |
---|
265 | } |
---|
266 | } |
---|
267 | |
---|
268 | return(result); |
---|
269 | } |
---|
270 | |
---|
271 | //////////////////////////////////////////////////////////////////////////// |
---|
272 | |
---|
273 | proc normalI(ideal I, list #) |
---|
274 | "USAGE: normalI (I [,p [,r [,l]]]); I an ideal, p, r, and l optional integers |
---|
275 | RETURN: the integral closure of I, ..., I^p, where I is an ideal in the |
---|
276 | polynomial ring R=k[x(1),...x(n)]. If p is not given, or p==0, |
---|
277 | compute the closure of all powers up to the maximum degree in t |
---|
278 | occurring in the closure of R[It] (so this is the last power whose |
---|
279 | closure is not just the sum/product of the smaller). If r |
---|
280 | is given and r==1, normalI starts with a check whether I is already a |
---|
281 | radical ideal. |
---|
282 | If l==1 then locNormal instead of normal is used to compute normalization. |
---|
283 | The result is a list containing the closure of the desired powers of |
---|
284 | I as ideals of the basering. |
---|
285 | DISPLAY: The procedure displays more comments for higher printlevel. |
---|
286 | EXAMPLE: example normalI; shows an example |
---|
287 | " |
---|
288 | { |
---|
289 | int dblvl=printlevel-voice+2; // toggles how much data is printed |
---|
290 | // during the procedure |
---|
291 | |
---|
292 | def BAS=basering; // remember the basering |
---|
293 | |
---|
294 | // two simple cases: principal ideals and radical ideals are always |
---|
295 | // integrally closed |
---|
296 | |
---|
297 | if (size(I)<=1) // includes the case I=(0) |
---|
298 | { |
---|
299 | if (dblvl>0) |
---|
300 | { |
---|
301 | "// Trivial case: I is a principal ideal"; |
---|
302 | } |
---|
303 | list result=I; |
---|
304 | if (size(#)>0) |
---|
305 | { |
---|
306 | for (int k=1;k<=#[1]-1;k++) |
---|
307 | { |
---|
308 | result=insert(result,I*result[k],k); |
---|
309 | } |
---|
310 | } |
---|
311 | return(result); |
---|
312 | } |
---|
313 | |
---|
314 | int testrad=0; // do the radical check? |
---|
315 | int uselocNormal=0; |
---|
316 | if (size(#)>1) |
---|
317 | { |
---|
318 | testrad=#[2]; |
---|
319 | if (size(#)==3) { |
---|
320 | uselocNormal=#[3]; |
---|
321 | } |
---|
322 | } |
---|
323 | |
---|
324 | if (testrad==1) |
---|
325 | { |
---|
326 | if (dblvl>0) |
---|
327 | { |
---|
328 | "//Check whether I is radical"; |
---|
329 | } |
---|
330 | |
---|
331 | if (size(reduce(radical(I),std(I),5))==0) |
---|
332 | { |
---|
333 | if (dblvl>0) |
---|
334 | { |
---|
335 | "//Trivial case: I is a radical ideal"; |
---|
336 | } |
---|
337 | list result=I; |
---|
338 | if (size(#)>0) |
---|
339 | { |
---|
340 | for (int k=1;k<=#[1]-1;k++) |
---|
341 | { |
---|
342 | result=insert(result,I*result[k],k); |
---|
343 | } |
---|
344 | } |
---|
345 | return(result); |
---|
346 | } |
---|
347 | } |
---|
348 | |
---|
349 | // start with the computation of the Rees Algebra R[It] of I |
---|
350 | |
---|
351 | if (dblvl>0) |
---|
352 | { |
---|
353 | "// We start with the Rees Algebra of I:"; |
---|
354 | } |
---|
355 | |
---|
356 | list Rees = ReesAlgebra(I); |
---|
357 | def R(1)=Rees[1]; |
---|
358 | def Kxt=Rees[2]; |
---|
359 | setring R(1); |
---|
360 | |
---|
361 | if (dblvl>0) |
---|
362 | { |
---|
363 | R(1); |
---|
364 | ker; |
---|
365 | ""; |
---|
366 | "// Now ClosureRees computes generators for the integral closure"; |
---|
367 | "// of R[It] step by step"; |
---|
368 | } |
---|
369 | |
---|
370 | // ClosureRees computes fractions in R[x,t] representing the generators |
---|
371 | // of the closure of R[It] in k[x,t], which is the same as the closure |
---|
372 | // in Q(R[It]). |
---|
373 | // the first size(images)-1 entries are the numerators of the gene- |
---|
374 | // rators, the last entry is the 'universal' denominator |
---|
375 | |
---|
376 | setring Kxt; |
---|
377 | list images = ClosureRees(Rees,uselocNormal); |
---|
378 | |
---|
379 | // ClosureRees was done after the first HomJJ-call |
---|
380 | // ==> I is integrally closed, and images consists of the only entry "closed" |
---|
381 | |
---|
382 | if ((size(images)==1) && (typeof(images[1])=="string")) |
---|
383 | { |
---|
384 | if (dblvl>0) |
---|
385 | { |
---|
386 | "//I is integrally closed!"; |
---|
387 | } |
---|
388 | |
---|
389 | setring BAS; |
---|
390 | list result=I; |
---|
391 | if (size(#)>0) |
---|
392 | { |
---|
393 | for (int k=1;k<=#[1]-1;k++) |
---|
394 | { |
---|
395 | result=insert(result,I*result[k],k); |
---|
396 | } |
---|
397 | } |
---|
398 | return(result); |
---|
399 | } |
---|
400 | |
---|
401 | // construct the fractions corresponding to the generators of the |
---|
402 | // closure of I and its powers, depending on # (in fact, they will |
---|
403 | // not be real fractions, of course). This is done in ClosurePower. |
---|
404 | list result = ClosurePower(images,#); |
---|
405 | |
---|
406 | // finally fetch the result to the old basering |
---|
407 | |
---|
408 | setring BAS; |
---|
409 | list result=fetch(Kxt,result); |
---|
410 | return(result); |
---|
411 | } |
---|
412 | example |
---|
413 | { |
---|
414 | "EXAMPLE:"; echo=2; |
---|
415 | ring R=0,(x,y),dp; |
---|
416 | ideal I = x2,xy4,y5; |
---|
417 | list J = normalI(I); |
---|
418 | I; |
---|
419 | J; // J[1] is the integral closure of I |
---|
420 | } |
---|
421 | |
---|
422 | /* |
---|
423 | LIB"reesclos.lib"; |
---|
424 | |
---|
425 | |
---|
426 | // 1. x^i,y^i in k[x,y] |
---|
427 | // geht bis i = 19 (800sec), bis i=10 wenige Sekunden, |
---|
428 | // bei i = 20 ueber 1GB Hauptspeicher, in der 9. Iteration no memory |
---|
429 | // (braucht 20 Iterationen) |
---|
430 | |
---|
431 | ring r = 0,(x,y),dp; |
---|
432 | int i = 6; |
---|
433 | ideal I = x^i,y^i; |
---|
434 | list J = normalI(I); |
---|
435 | I; |
---|
436 | J; |
---|
437 | |
---|
438 | |
---|
439 | //================================================================ |
---|
440 | |
---|
441 | |
---|
442 | // 2. x^i,y^i,z^i in k[x,y,z] |
---|
443 | // aehnlich wie 1., funktioniert aber nur bis i=5 und dauert dort |
---|
444 | // >1 h |
---|
445 | |
---|
446 | |
---|
447 | //================================================================ |
---|
448 | |
---|
449 | |
---|
450 | // 3. scheitert in der ersten Iteration beim Radikal |
---|
451 | // Standardbasis des singulaeren Ortes: 7h (in char0), |
---|
452 | // in char(p) viel schneller, obwohl kleine Koeffizienten |
---|
453 | // schon bei Radikal -Test braucht er zu lang (>1h) |
---|
454 | |
---|
455 | ring r = 0,(x,y,z),dp; |
---|
456 | //ring r = 32003,(x,y,z),dp; |
---|
457 | |
---|
458 | ideal I = x2+xy3-5z,z3+y2-xzy,x2y3z5+y3-y5; |
---|
459 | list l= ReesAlgebra(I); |
---|
460 | list J = normalI(I); |
---|
461 | I; |
---|
462 | J; |
---|
463 | |
---|
464 | */ |
---|
465 | |
---|