source: git/Singular/LIB/reesclos.lib @ f8c998c

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