source: git/Singular/LIB/normal.lib @ 3de58c

spielwiese
Last change on this file since 3de58c was 676724, checked in by Gert-Martin Greuel <greuel@…>, 23 years ago
* GMG: normal.lib: normalizationPrimes voellig neu kommentiert * Bei Berechnung des singulaeren Ortes das Minorenideal mit simplify(..,16) * verkleinert. Das kann zwar ein kleinerse Ideal erzeugen (bei der * anschliessenden mstd Berechnung hat sich aber nie ein Unterschied ergeben), * das ist fuer diesen Algorithmus aber erlaubt. Bei kleinen Beispielen hat das * keinen Unterschied gezeigt, bei grosse die Berechnung aber bis zum Faktor * 10 beschleunigt. git-svn-id: file:///usr/local/Singular/svn/trunk@5324 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 43.2 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2version="$Id: normal.lib,v 1.35 2001-03-19 22:57:16 greuel Exp $";
3category="Commutative Algebra";
4info="
5LIBRARY:  normal.lib     Normalization of Affine Rings
6AUTHORS:  G.-M. Greuel,  greuel@mathematik.uni-kl.de,
7@*        G. Pfister,    pfister@mathematik.uni-kl.de
8
9PROCEDURES:
10 normal(I);             computes the normalization of basering/I
11 HomJJ(L);              presentation of End_R(J) as affine ring, L a list
12";
13
14LIB "general.lib";
15LIB "sing.lib";
16LIB "primdec.lib";
17LIB "elim.lib";
18LIB "presolve.lib";
19LIB "inout.lib";
20LIB "ring.lib";
21///////////////////////////////////////////////////////////////////////////////
22static proc isR_HomJR (list Li)
23"USAGE:   isR_HomJR (Li);  Li = list: ideal SBid, ideal J, poly p
24COMPUTE: module Hom_R(J,R) = R:J and compare with R
25ASSUME:  R    = P/SBid,  P = basering
26         SBid = standard basis of an ideal in P,
27         J    = ideal in P containing the polynomial p,
28         p    = nonzero divisor of R
29RETURN:  1 if R = R:J, 0 if not
30EXAMPLE: example isR_HomJR;  shows an example
31"
32{
33   int n, ii;
34 def P = basering;
35   ideal SBid = Li[1];
36   ideal J = Li[2];
37   poly p = Li[3];
38   attrib(SBid,"isSB",1);
39   attrib(p,"isSB",1);
40 qring R    = SBid;
41   ideal J  = fetch(P,J);
42   poly p   = fetch(P,p);
43   ideal f  = quotient(p,J);
44   ideal lp = std(p);
45   n=1;
46   for (ii=1; ii<=size(f); ii++ )
47   {
48      if ( reduce(f[ii],lp) != 0)
49      { n = 0; break; }
50   }
51   return (n);
52 //?spaeter hier einen Test ob Hom(I,R) = Hom(I,I)?
53}
54example
55{"EXAMPLE:";  echo = 2;
56  ring r   = 0,(x,y,z),dp;
57  ideal id = y7-x5+z2;
58  ideal J  = x3,y+z;
59  poly p   = xy;
60  list Li  = std(id),J,p;
61  isR_HomJR (Li);
62
63  ring s   = 0,(t,x,y),dp;
64  ideal id = x2-y2*(y-t);
65  ideal J  = jacob(id);
66  poly p   = J[1];
67  list Li  = std(id),J,p;
68  isR_HomJR (Li);
69}
70///////////////////////////////////////////////////////////////////////////////
71
72proc HomJJ (list Li)
73"USAGE:   HomJJ (Li); Li list: ideal SBid, ideal id, ideal J, poly p, int count
74ASSUME:  R    = P/id,  P = basering, a polynomial ring, id an ideal of P,
75@*       SBid = standard basis of id,
76@*       J    = ideal of P containing the polynomial p,
77@*       p    = nonzero divisor of R
78@*       count controls printlevel during recursive call
79COMPUTE: Endomorphism ring End_R(J)=Hom_R(J,J) with its ring structure as
80         affine ring, together with the canonical map R --> Hom_R(J,J),
81         where R is the quotient ring of P modulo the standard basis SBid.
82RETURN:  a list l of two objects
83@format
84         l[1] : a polynomial ring, containing two ideals, 'endid' and 'endphi'
85               such that l[1]/endid = Hom_R(J,J) and
86               endphi describes the canonical map R -> Hom_R(J,J)
87         l[2] : an integer which is 1 if phi is an isomorphism, 0 if not
88@end format
89NOTE:    printlevel >=1: display comments (default: printlevel=0)
90EXAMPLE: example HomJJ;  shows an example
91"
92{
93//---------- initialisation ---------------------------------------------------
94
95   int isIso,isPr,isCo,isRe,isEq,ii,jj,q,y,count;
96   intvec rw,rw1;
97   list L;
98   if(size(Li)>=5)
99   {
100     count = Li[5];
101   }
102   y = printlevel-voice+count; 
103 def P = basering;
104   ideal SBid, id, J = Li[1], Li[2], Li[3];
105   poly p = Li[4];
106   attrib(SBid,"isSB",1);
107   int homo = homog(Li[2]);               //is 1 if id is homogeneous, 0 if not
108
109//---- set attributes for special cases where algorithm can be simplified -----
110   if( homo==1 )
111   {
112      rw = ringweights(P);
113   }
114   if( typeof(attrib(id,"isPrim"))=="int" )
115   {
116      if(attrib(id,"isPrim")==1)  { isPr=1; }
117   }
118   if( typeof(attrib(id,"isIsolatedSingularity"))=="int" )
119   {
120      if(attrib(id,"isIsolatedSingularity")==1) { isIso=1; }
121   }
122   if( typeof(attrib(id,"isCohenMacaulay"))=="int" )
123   {
124      if(attrib(id,"isCohenMacaulay")==1) { isCo=1; }
125   }
126   if( typeof(attrib(id,"isRegInCodim2"))=="int" )
127   {
128      if(attrib(id,"isRegInCodim2")==1) { isRe=1; }
129   }
130   if( typeof(attrib(id,"isEquidimensional"))=="int" )
131   {
132      if(attrib(id,"isEquidimensional")==1) { isEq=1; }
133   }
134//-------------------------- go to quotient ring ------------------------------
135 qring R  = SBid;
136   ideal id = fetch(P,id);
137   ideal J  = fetch(P,J);
138   poly p   = fetch(P,p);
139   ideal f,rf,f2;
140   module syzf;
141
142//---------- computation of p*Hom(J,J) as R-ideal -----------------------------
143   if ( y>=1 )
144   {
145     "// compute p*Hom(J,J) = p*J:J, p a non-zerodivisor";
146     "//   p is equal to:"; "";
147     p;
148     "";
149   }
150   f  = quotient(p*J,J);
151   if ( y>=1 )
152   { "// the module p*Hom(J,J) = p*J:J, p a non-zerodivisor";
153      "// p"; p;
154      "// f=p*J:J";
155      if( y>=2 ) { f; }     
156   }
157   f2 = std(p);
158
159   if(isIso==0)
160   {
161     ideal f1=std(f);
162     attrib(f1,"isSB",1);
163    // if( codim(f1,f2) >= 0 )
164    // {
165    //  dbprint(printlevel-voice+3,"// dimension of non-normal locus is zero");
166    //    isIso=1;
167    // }
168  }
169//---------- Test: Hom(J,J) == R ?, if yes, go home ---------------------------
170
171   rf = interred(reduce(f,f2));       // represents p*Hom(J,J)/p*R = Hom(J,J)/R
172   if ( size(rf) == 0 )
173   {
174      if ( homog(f) && find(ordstr(basering),"s")==0 )
175      {
176         ring newR1 = char(P),(X(1..nvars(P))),(a(rw),dp);
177      }
178      else
179      {
180         ring newR1 = char(P),(X(1..nvars(P))),dp;
181      }
182      ideal endphi = maxideal(1);
183      ideal endid = fetch(P,id);
184      L=substpart(endid,endphi,homo,rw);
185      def lastRing=L[1];
186      setring lastRing;
187
188      attrib(endid,"isCohenMacaulay",isCo);
189      attrib(endid,"isPrim",isPr);
190      attrib(endid,"isIsolatedSingularity",isIso);
191      attrib(endid,"isRegInCodim2",isRe);
192      attrib(endid,"isEqudimensional",isEq);
193      attrib(endid,"isCompleteIntersection",0);
194      attrib(endid,"isRad",0);
195      L=lastRing;
196      L = insert(L,1,1);
197      if(y>=1)
198      {
199         "// case R = Hom(J,J), we are ready with this component";
200         "   ";
201       if( y>=2 )
202       {
203        lastRing;
204         "   ";
205         "//   the new ideal";
206         if( y>=2 ) { endid; }
207         "   ";
208         "//   the old ring";
209         "   ";
210         P;
211         "   ";
212         "//   the old ideal";
213         "   ";
214         setring P;
215         id;
216         "   ";
217         setring lastRing;
218         "//   the map";
219         "   ";
220         endphi;
221         "   ";
222         pause();
223         newline;
224       }
225      }
226      setring P;
227      return(L);
228   }
229   if(y>=1)
230   {
231      "// R is not equal to Hom(J,J), we have to try again";
232    if( y>=2 )
233    {  pause();
234       newline;
235    }   
236   }
237//---------- Hom(J,J) != R: create new ring and map from old ring -------------
238// the ring newR1/SBid+syzf will be isomorphic to Hom(J,J) as R-module
239
240   f = p,rf;          // generates pJ:J mod(p), i.e. p*Hom(J,J)/p*R as R-module
241   q = size(f);
242   syzf = syz(f);
243
244   if ( homo==1 )
245   {
246      rw1 = rw,0;
247      for ( ii=2; ii<=q; ii++ )
248      {
249         rw  = rw, deg(f[ii])-deg(f[1]);
250         rw1 = rw1, deg(f[ii])-deg(f[1]);
251      }
252      ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),(a(rw1),dp);
253   }
254   else
255   {
256      ring newR1 = char(R),(X(1..nvars(R)),T(1..q)),dp;
257   }
258
259   map psi1 = P,maxideal(1);
260   ideal SBid = psi1(SBid);
261   attrib(SBid,"isSB",1);
262
263 qring newR = std(SBid);
264   map psi = R,ideal(X(1..nvars(R)));
265   ideal id = psi(id);
266   ideal f = psi(f);
267   module syzf = psi(syzf);
268   ideal pf,Lin,Quad,Q;
269   matrix T,A;
270   list L1;
271
272//---------- computation of Hom(J,J) as affine ring ---------------------------
273// determine kernel of: R[T1,...,Tq] -> J:J >-> R[1/p]=R[t]/(t*p-1),
274// Ti -> fi/p -> t*fi (p=f1=f[1]), to get ring structure. This is of course
275// the same as the kernel of R[T1,...,Tq] -> pJ:J >-> R, Ti -> fi.
276// It is a fact, that the kernel is generated by the linear and the quadratic
277// relations
278
279   pf = f[1]*f;
280   T = matrix(ideal(T(1..q)),1,q);
281   Lin = ideal(T*syzf);
282   if(y>=1)
283   {
284      "// the ring structure of Hom(J,J) as R-algebra";
285      " ";
286      "//   the linear relations";
287      " ";
288      if( y>=2 )
289      {  Lin;     
290         pause();
291         "";
292      }
293   }
294   for (ii=2; ii<=q; ii++ )
295   {
296      for ( jj=2; jj<=ii; jj++ )
297      {
298         A = lift(pf,f[ii]*f[jj]);
299         Quad = Quad, ideal(T(jj)*T(ii) - T*A);          // quadratic relations
300      }
301   }
302   if(y>=1)
303   {
304      "//   the quadratic relations";
305        if( y>=2 )
306      {     
307          "   ";
308         interred(Quad);
309         pause();
310         newline;
311      }
312   }
313   Q = Lin+Quad;
314   Q = subst(Q,T(1),1);
315   Q = interred(reduce(Q,std(0)));
316//---------- reduce number of variables by substitution, if possible ----------
317   if (homo==1)
318   {
319      ring newRing = char(R),(X(1..nvars(R)),T(2..q)),(a(rw),dp);
320   }
321   else
322   {
323      ring newRing = char(R),(X(1..nvars(R)),T(2..q)),dp;
324   }
325
326   ideal endid  = imap(newR,id)+imap(newR,Q);
327   ideal endphi = ideal(X(1..nvars(R)));
328
329   L=substpart(endid,endphi,homo,rw);
330   def lastRing=L[1];
331   setring lastRing;
332   attrib(endid,"isCohenMacaulay",isCo);
333   attrib(endid,"isPrim",isPr);
334   attrib(endid,"isIsolatedSingularity",isIso);
335   attrib(endid,"isRegInCodim2",isRe);
336   attrib(endid,"isEquidimensional",isEq);
337   attrib(endid,"isCompleteIntersection",0);
338   attrib(endid,"isRad",0);
339  // export(endid);
340  // export(endphi);
341   if(y>=1)
342   {
343      "//   the new ring after reduction of the number of variables";
344      show(lastRing);
345      pause(); "
346      ";
347    if(y >=2)
348    {
349      lastRing;
350      "   ";
351      "//   the new ideal";
352      "   ";
353      endid;
354      "   ";
355      "//   the old ring";
356      "   ";
357      P;
358      "   ";
359      "//   the old ideal";
360      "   ";
361      setring P;
362      id;
363      "   ";
364      setring lastRing;
365      "//   the map";
366      "   ";
367      endphi;
368      "   ";
369      pause();
370      newline;
371    }
372   }
373   L = lastRing;
374   L = insert(L,0,1);
375   return(L);
376}
377example
378{"EXAMPLE:";  echo = 2;
379  ring r   = 0,(x,y),wp(2,3);
380  ideal id = y^2-x^3;
381  ideal J  = x,y;
382  poly p   = x;
383  list Li = std(id),id,J,p;
384  list L   = HomJJ(Li);
385  def end = L[1];    // defines ring L[1], containing ideals endid, endphi
386  setring end;       // makes end the basering
387  end;
388  endid;             // end/endid is isomorphic to End(r/id) as ring
389  map psi = r,endphi;// defines the canonical map r/id -> End(r/id)
390  psi;
391}
392
393///////////////////////////////////////////////////////////////////////////////
394
395proc normal(ideal id, list #)
396"USAGE:   normal(i [,choose]);  i a radical ideal, choose empty or 1
397         if choose=1 the normalization of the associated primes is computed
398         (which is sometimes more efficient)
399ASSUME:  The ideal must be radical, for non radical ideals the output may
400         be wrong (i=radical(i); makes i radical)
401RETURN:   a list of rings, say nor:
402@format
403         each ring nor[i] contains two ideals
404         with given names norid and normap such that
405           - the direct sum of the rings nor[i]/norid is
406             the normalization of basering/id;
407           - normap gives the normalization map from basering/id
408             to nor[i]/norid (for each i)
409@end format
410NOTE:    to use the i-th ring type: def R=nor[i]; setring R;.
411@*       Not implemented for local or mixed orderings and quotient rings.
412@*       If the input ideal i is weighted homogeneous a weighted ordering may
413         be used (qhweight(i); computes weights).
414@*       printlevel = 1: count normalization loops (default: printlevel=0)
415@*       printlevel > 1: protocoll of normalization steps
416@*       printlevel > 2: protocoll of all normalization steps, pauses
417@*       printlevel > 3: display some (>4 all) intermediate results, pauses
418EXAMPLE: example normal; shows an example
419"
420{
421   int i,j,y;
422   string sr;
423   list result,prim,keepresult;
424   y = printlevel-voice+2;
425
426   attrib(id,"isRadical",1);
427   if ( ord_test(basering) != 1)
428   {
429     "";
430     "// Not implemented for this ordering,";
431     "// please change to global ordering!";
432     return(result);
433   }
434   if( typeof(attrib(id,"isCompleteIntersection"))=="int" )
435   {
436      if(attrib(id,"isCompleteIntersection")==1)
437      {
438         attrib(id,"isCohenMacaulay",1);
439         attrib(id,"isEquidimensional",1);
440      }
441   }
442   if( typeof(attrib(id,"isCohenMacaulay"))=="int" )
443   {
444      if(attrib(id,"isCohenMacaulay")==1)
445      {
446         attrib(id,"isEquidimensional",1);
447      }
448   }
449   if( typeof(attrib(id,"isPrim"))=="int" )
450   {
451      if(attrib(id,"isPrim")==1)
452      {
453         attrib(id,"isEquidimensional",1);
454      }
455   }
456   if(size(#)==0)
457   {
458      if( typeof(attrib(id,"isEquidimensional"))=="int" )
459      {
460         if(attrib(id,"isEquidimensional")==1)
461         {
462            prim[1]=id;
463         }
464         else
465         {
466            prim=equidim(id);
467         }
468      }
469      else
470      {
471         prim=equidim(id);
472      }
473      if(y>=1)
474      {
475        "";
476         "// we have ",size(prim),"equidimensional component(s)";
477      }
478   }
479   else
480   {
481      if( typeof(attrib(id,"isPrim"))=="int" )
482      {
483         if(attrib(id,"isPrim")==1)
484         {
485            prim[1]=id;
486         }
487         else
488         {
489            prim=minAssGTZ(id);
490         }
491      }
492      else
493      {
494         prim=minAssGTZ(id);
495      }
496      if(y>=1)
497      {
498         "";
499         "// we have ",size(prim),"irreducible component(s)";
500      }
501   }
502   for(i=1; i<=size(prim); i++)
503   {
504      if(y>=1)
505      {
506         "";
507         "// BEGIN with equidimensional/irreducible component",i;
508      }
509      attrib(prim[i],"isCohenMacaulay",0);
510      if(size(#)!=0)
511      {
512         attrib(prim[i],"isPrim",1);
513      }
514      else
515      {
516         attrib(prim[i],"isPrim",0);
517      }
518      attrib(prim[i],"isRegInCodim2",0);
519      attrib(prim[i],"isIsolatedSingularity",0);
520      attrib(prim[i],"isEquidimensional",1);
521      attrib(prim[i],"isCompleteIntersection",0);
522
523      if( typeof(attrib(id,"isIsolatedSingularity"))=="int" )
524      {
525            if(attrib(id,"isIsolatedSingularity")==1)
526             {attrib(prim[i],"isIsolatedSingularity",1); }
527      }
528
529      if( typeof(attrib(id,"isCompleteIntersection"))=="int" )
530      {
531            if((attrib(id,"isIsolatedSingularity")==1)&&(size(#)==0))
532             {attrib(prim[i],"isIsolatedSingularity",1); }
533      }
534      keepresult=normalizationPrimes(prim[i],maxideal(1),0);
535      for(j=1;j<=size(keepresult);j++)
536      {
537         result=insert(result,keepresult[j]);
538      }
539      sr = string(size(result));
540   }
541      dbprint(y+1,"
542// 'normal' created a list of "+sr+" ring(s).
543// To see the rings, type (if the name of your list is nor):
544     show(nor);
545// To access the 1-st ring and map (similar for the others), type:
546     def R = nor[1]; setring R;  norid; normap;
547// R/norid is the 1-st ring of the normalization and
548// normap the map from the original basering to R/norid");
549
550      //kill endphi,endid;
551      return(result);
552}
553example
554{ "EXAMPLE:"; echo = 2;
555   ring r=32003,(x,y,z),wp(2,1,2);
556   ideal i=z3-xy4;
557   list nor=normal(i);
558   show(nor);
559   def r1=nor[1];
560   setring r1;
561   norid;
562   normap;
563}
564
565///////////////////////////////////////////////////////////////////////////////
566static proc normalizationPrimes(ideal i,ideal ihp, int count, list #)
567"USAGE:   normalizationPrimes(i,ihp[,si,countt]);  i prime ideal, ihp map
568         (partial normalization), si ideal of singular locus,
569         count = integer to count the number of normalization loops
570RETURN:  a list of one ring L=R, in  R are two ideals
571         S,M such that R/M is the normalization of original basering
572         S is a standardbasis of M
573NOTE:    to use the ring: def r=L[1];setring r;
574         printlevel = 1: count normalization loops (default: printlevel=0)
575         printlevel > 1: protocoll of normalization steps
576         printlevel > 2: protocoll of all normalization steps, pauses
577         printlevel > 3: display some (>4 all) intermediate results, pauses
578EXAMPLE: example normalizationPrimes; shows an example
579"
580{
581   count = count+1;   
582   int y = printlevel-voice+count+1;  // y=printlevel (default: y=0)
583   if(y>=0)
584   {
585     "// START normalization LOOP ",count;
586   }
587   if( y>=3)
588   {
589     "// with ideal";  "";
590     i;  "";
591     basering;  "";
592     pause();
593     newline;
594   }
595
596
597   def BAS=basering;
598   list result,keepresult1,keepresult2;
599   ideal J,SB,MB;
600   int depth,lauf,prdim;
601   int ti=timer;
602
603   if(size(i)==0)
604   {
605      if(y>=1)
606      {
607          "// the ideal was the zero-ideal";
608      }
609         execute("ring newR7="+charstr(basering)+",("+varstr(basering)+"),("
610                      +ordstr(basering)+");");
611         ideal norid=ideal(0);
612         ideal normap=fetch(BAS,ihp);
613         export norid;
614         export normap;
615         result=newR7;
616         setring BAS;
617         return(result);
618   }
619
620   if(y>=1)
621   {
622   "// SB-computation of ideal of size",size(i),"in ring with",nvars(basering),"variables";
623   }
624// -------------- SB-computation of the input ideal ----------------------
625   list SM=mstd(i);                //here the work starts, SM[1] a SB of i
626                                   //SM[2] a smaller set of generators of i
627   int dimSM =  dim(SM[1]);        //dimension of i, V(i)=variety to normalize
628  // Case: Get an ideal containing a unit
629   if( dimSM == -1)
630   {  "";
631      "      // A unit ideal was found.";
632      "      // Stop with partial result computed so far";"";
633
634         MB=SM[2];
635         intvec rw;
636         list LL=substpart(MB,ihp,0,rw);
637         def newR6=LL[1];
638         setring newR6;
639         ideal norid=endid;
640         ideal normap=endphi;
641         kill endid,endphi;
642         export norid;
643         export normap;
644         result=newR6;
645         setring BAS;
646         return(result);
647   }
648
649   if(y>=1)
650   {
651      "//   the dimension is:"; "";
652      dimSM;"";
653   }
654
655   if(size(#)>0)                   //ideal of sing locus is given in #[1]
656   {
657      list JM=mstd(#[1]);
658      if( typeof(attrib(#[1],"isRad"))!="int" )
659      {
660         attrib(JM[2],"isRad",0);
661      }
662   }
663
664// -------- transfer attributes from ideal i to SM[2], SM = mstd(i) --------
665   if(attrib(i,"isPrim")==1)
666   {
667      attrib(SM[2],"isPrim",1);
668   }
669   else
670   {
671      attrib(SM[2],"isPrim",0);
672   }
673   if(attrib(i,"isIsolatedSingularity")==1)
674   {
675      attrib(SM[2],"isIsolatedSingularity",1);
676   }
677   else
678   {
679      attrib(SM[2],"isIsolatedSingularity",0);
680   }
681   if(attrib(i,"isCohenMacaulay")==1)
682   {
683      attrib(SM[2],"isCohenMacaulay",1);
684   }
685   else
686   {
687      attrib(SM[2],"isCohenMacaulay",0);
688   }
689   if(attrib(i,"isRegInCodim2")==1)
690   {
691      attrib(SM[2],"isRegInCodim2",1);
692   }
693   else
694   {
695      attrib(SM[2],"isRegInCodim2",0);
696   }
697   if(attrib(i,"isEquidimensional")==1)
698   {
699      attrib(SM[2],"isEquidimensional",1);
700   }
701   else
702   {
703      attrib(SM[2],"isEquidimensional",0);
704   }
705    if(attrib(i,"isCompleteIntersection")==1)
706   {
707      attrib(SM[2],"isCompleteIntersection",1);
708   }
709   else
710   {
711      attrib(SM[2],"isCompleteIntersection",0);
712   }
713
714//************* case 0: check and prepare special cases ****************
715//no computation for the normalization in case 0
716
717//-------------------------- the smooth case ----------------------------
718   if(size(#)>0)
719   {
720      if(dim(JM[1])==-1)
721      {
722         if(y>=1)
723         {
724            "// the ideal was smooth";
725         }
726         MB=SM[2];
727         intvec rw;
728         list LL=substpart(MB,ihp,0,rw);
729         def newR6=LL[1];
730         setring newR6;
731         ideal norid=endid;
732         ideal normap=endphi;
733         kill endid,endphi;
734         export norid;
735         export normap;
736         result=newR6;
737         setring BAS;
738         return(result);
739     }
740   }
741   // recall: SM = mstd(i), i = ideal to start with in normaliztion loop
742   //         JM = mstd(#[1]), #[1]= ideal of singular locus of i
743   //              #[1] is given after the first normalization loop
744
745//---------------- the homogeneous zero-dimensional case ----------------
746   if((dim(SM[1])==0)&&(homog(SM[2])==1))
747   {
748      if(y>=1)
749      {
750         "// the ideal was zero-dimensional and homogeneous";
751      }
752      MB=maxideal(1);
753      intvec rw;
754      list LL=substpart(MB,ihp,0,rw);
755      def newR5=LL[1];
756      setring newR5;
757      ideal norid=endid;
758      ideal normap=endphi;
759      kill endid,endphi;
760      export norid;
761      export normap;
762      result=newR5;
763      setring BAS;
764      return(result);
765   }
766
767//------------- the homogeneous one-dimensional case -------------------
768//in this case i defines a line because it is irreducible and homogeneous
769   if((dim(SM[1])==1)&&(attrib(SM[2],"isPrim")==1)
770        &&(homog(SM[2])==1))
771   {
772      if(y>=1)
773      {
774         "// the ideal defines a line";
775      }
776      MB=SM[2];
777      intvec rw;
778      list LL=substpart(MB,ihp,0,rw);
779      def newR4=LL[1];
780      setring newR4;
781      ideal norid=endid;
782      ideal normap=endphi;
783      kill endid,endphi;
784      export norid;
785      export normap;
786      result=newR4;
787      setring BAS;
788      return(result);
789   }
790//----------------------- the higher dimensional case ----------------------
791   //we test first of all CohenMacaulay and
792   //complete intersection
793   if(((size(SM[2])+dim(SM[1]))==nvars(basering))&&(homog(SM[2])==1))
794   {
795      //test for complete intersection
796      attrib(SM[2],"isCohenMacaulay",1);
797      attrib(SM[2],"isCompleteIntersection",1);
798      attrib(SM[2],"isEquidimensional",1);
799      if(y>=1)
800      {
801         "// the ideal is a complete intersection";
802      }
803   }
804
805   //compute the singular locus+lower dimensional components
806
807//------- case: not(isolated singularity and homogeneous) -------------------
808   if((attrib(SM[2],"isIsolatedSingularity")==0) && (size(#)==0))
809   {
810//---------- computation of ideal of singular locus -------------------------
811      J=minor(jacob(SM[2]),nvars(basering)-dim(SM[1]));
812      //ti=timer;
813      if(y >=1 )
814      {
815         "// SB of singular locus will be computed ";
816         if(y >=2 )
817         {
818           "//in ring:";
819           show(basering);
820         }
821      }
822     
823      J = simplify(J,16);  //this makes ist for huge J much faster
824      ideal sin=J,SM[2];
825      list JM=mstd(sin);
826     
827      //JM[1] SB of singular locus, JM[2] minbasis of singular locus
828      //SM[1] SB of ideal in normalisation loop, SM[2] minbasis
829
830      if(y>=1)
831      {
832         "//   the dimension of the singular locus is:";"";
833         dim(JM[1]); "";
834      }
835      //   timer-ti;
836      attrib(JM[1],"isSB",1);
837      if(dim(JM[1])==-1)
838      {
839         if(y>=1)
840         {
841            "// the ideal is smooth";
842         }
843         MB=SM[2];
844         intvec rw;
845         list LL=substpart(MB,ihp,0,rw);
846         def newR3=LL[1];
847         setring newR3;
848         ideal norid=endid;
849         ideal normap=endphi;
850         kill endid,endphi;
851         export norid;
852         export normap;
853         result=newR3;
854         setring BAS;
855         return(result);
856      }
857      if(dim(JM[1])==0 && (homog(SM[2])==1))
858      {
859         attrib(SM[2],"isIsolatedSingularity",1);
860      }
861      if(dim(JM[1])<=dim(SM[1])-2)
862      {
863         attrib(SM[2],"isRegInCodim2",1);
864      }
865   }
866   
867//------------ case: isolated singularity and homogeneous -----------------
868   if(attrib(SM[2],"isIsolatedSingularity")==1)   
869   {
870     if(size(#)==0)
871     {
872        if(defined(JM)==voice)
873        {  JM=maxideal(1),maxideal(1);
874        }
875        else
876        {  list JM=maxideal(1),maxideal(1);
877       
878        }
879        attrib(JM[1],"isSB",1);
880     }
881   }
882
883//------------ case: Cohen Macaulay and regular in codim 2 -----------------
884//in this case we are ready, the ring is normal 
885   if((attrib(SM[2],"isRegInCodim2")==1)&&(attrib(SM[2],"isCohenMacaulay")==1))
886   {
887      if(y>=1)
888      {
889            "// the ideal was CohenMacaulay and regular in codimension 2";
890      }
891      MB=SM[2];
892      intvec rw;
893      list LL=substpart(MB,ihp,0,rw);
894      def newR6=LL[1];
895      setring newR6;
896      ideal norid=endid;
897      ideal normap=endphi;
898      kill endid,endphi;
899      export norid;
900      export normap;
901      result=newR6;
902      setring BAS;
903      return(result);
904   }
905
906//************* case 1: isolated singularity and homogeneous ****************
907
908   // recall: SM = mstd(i), i = ideal to start with in normaliztion loop
909   //         JM = mstd(#[1]), #[1]= ideal of singular locus of i
910   //              #[1] is given after the first normalization loop
911   //if SM is an isolated singularity and homogeneous, we know that this
912   //persists in the following normalization loops and things are easier
913   //since the radical of the singular locus is the maximal ideal
914   //JM ideal of singular locus, SM ideal of variety
915
916   if(attrib(SM[2],"isIsolatedSingularity")==1)
917   {
918      if(y>=1)
919      {
920         "// CASE 1: unique isolated singularity at 0";
921         "// radial of singular locus is the maximal ideal";
922      }
923      ideal SL=simplify(reduce(maxideal(1),SM[1]),2);
924      //SL = vars not contained in ideal
925      ideal Ann=quotient(SM[2],SL[1]);
926      ideal qAnn=simplify(reduce(Ann,SM[1]),2);     
927      //qAnn=0 ==> the first var(=SL[1]) not contained in SM is a nzd of R/SM
928  //--------------- case: a nonzero-divisor was found ---------------
929      if(size(qAnn)==0)
930      {
931         if(y>=1)
932         {
933            "";
934            "//   a nonzero-divisor was found";
935            "//   the ideal rad(J):";
936            "";
937            maxideal(1);
938            newline;
939            "// TEST for normality: R=Hom(J,J)?";
940            "";
941         }
942    //test for normality:
943         //?spaeter: test for normality, Hom(I,R)==R?
944         list RR;
945         RR=SM[1],SM[2],maxideal(1),SL[1],count;
946         //  ti=timer;
947         RR=HomJJ(RR);
948         //  timer-ti;
949         if(RR[2]==0)
950    //the ring is not normal, start a new normalization loop
951         {
952            def newR=RR[1];
953            setring newR;
954            map psi=BAS,endphi;
955         //  ti=timer;
956            list tluser=normalizationPrimes(endid,psi(ihp),count);
957         //  timer-ti;
958            setring BAS;
959            return(tluser);
960         }
961    //the ring is normal, prepare output and go home
962         MB=SM[2];
963         execute("ring newR7="+charstr(basering)+",("+varstr(basering)+"),("
964                      +ordstr(basering)+");");
965         ideal norid=fetch(BAS,MB);
966         ideal normap=fetch(BAS,ihp);
967         export norid;
968         export normap;
969         result=newR7;
970         setring BAS;
971         return(result);
972
973       }
974  //--------------- case: a zero-divisor was found ---------------
975      //Now the case where qAnn!=0, i.e.SL[1] is a zero-divisor of R/SM
976      //and we have found a splitting: id and id1
977      //id=qAnn+SM[2] defines components of R/SM in the complement of V(SL[1])
978      //id1 defines components of R/SM in the complement of V(id)
979      //?????instead of id1 we can take SL[1]+Ann+SM[2]???????????
980       else
981       {
982         if(y>=0)
983         {
984            "//   a zero-divisor was found, we have SPLITTING of ideals";
985           if(y >=2 )
986           {
987             "// in ring:";
988             show(basering);
989            }
990            "";
991         }
992         
993          ideal id=qAnn+SM[2];
994
995          attrib(id,"isCohenMacaulay",0);
996          attrib(id,"isPrim",0);
997          attrib(id,"isIsolatedSingularity",1);
998          attrib(id,"isRegInCodim2",0);
999          attrib(id,"isCompleteIntersection",0);
1000          attrib(id,"isEquidimensional",0);
1001
1002          if(y>=0)
1003          {
1004    "//   start a normalization loop with 1st split ideal (size",size(id),"in",nvars(basering),"vars)";
1005          }
1006          keepresult1=normalizationPrimes(id,ihp,count);
1007          ideal id1=quotient(SM[2],Ann)+SM[2];
1008//          evtl. qAnn statt Ann nehmen
1009//          ideal id=SL[1]+SM[2];
1010
1011          attrib(id1,"isCohenMacaulay",0);
1012          attrib(id1,"isPrim",0);
1013          attrib(id1,"isIsolatedSingularity",1);
1014          attrib(id1,"isRegInCodim2",0);
1015          attrib(id1,"isCompleteIntersection",0);
1016          attrib(id1,"isEquidimensional",0);
1017
1018          if(y>=0)
1019          {
1020              "//   start a normalization loop with 2nd split ideal (size",size(id),"in",nvars(basering),"vars)";
1021          }
1022          keepresult2=normalizationPrimes(id1,ihp,count);
1023
1024          for(lauf=1;lauf<=size(keepresult2);lauf++)
1025          {
1026             keepresult1=insert(keepresult1,keepresult2[lauf]);
1027          }
1028          return(keepresult1);
1029       }
1030   }
1031
1032//********** case 2: no unique isolated singularity at 0 *************
1033
1034   //in this case the radical must be computed
1035   // recall: SM = mstd(i), i = ideal to start with in normaliztion loop
1036   //         JM = mstd(#[1]), #[1]= ideal of singular locus of i
1037   //              #[1] is given after the first normalization loop
1038   //test for normality:  Hom(J,J)=R
1039   //test for non-normality: Hom(J,J)!=R, we can use Hom(J,J) to continue
1040
1041      if(y>=1)
1042      {
1043         "// CASE 2: no unique isolated singularity";
1044         "// radical has to be computed";
1045      }
1046
1047   ideal SL=simplify(reduce(JM[2],SM[1]),2);
1048   //SL = elements of ideal of singular locus not contained in ideal i
1049   ideal Ann=quotient(SM[2],SL[1]);
1050   ideal qAnn=simplify(reduce(Ann,SM[1]),2);
1051   //qAnn=0 ==> SL[1] is a nonzero-divisor of R/SM
1052
1053  //--------------- case: a nonzero-divisor was found ---------------
1054   if(size(qAnn)==0)
1055   {
1056      list RR;
1057      list RS;
1058    //now we have to compute the radical
1059      if(y>=1)
1060      {
1061        "";
1062         "//   a nonzero-divisor was found";
1063         "//   radical computation of ideal of singular locus";
1064      }
1065     
1066    //-------------- computation of the radical J --------------------
1067    //We have at least two possibilities:
1068    //J=radical(JM[2]), the radical of the full singular locus, or
1069    //J=radical(SM[2]+ideal(SL[1])), JM[2] contains SM[2]+ideal(SL[1])
1070      //the first is usually better!
1071
1072      if(y>=1)
1073      {
1074        "// compute radical J of ideal of singular locus";"";
1075      }
1076
1077      J=radical(JM[2]);
1078      // alternativ:   J=radical(SM[2]+ideal(SL[1]));
1079
1080      if(y>=2)
1081      {
1082          "// the radical is equal to:";       
1083          J;
1084          newline;
1085      }
1086      if(y>=1)
1087      {       
1088        "// TEST for normality: R=Hom(J,J)?";
1089        "";
1090      }
1091
1092      JM=J,J;              //J = new ideal for singular locus
1093      //evtl. fuer SL[1] anderen Nichtnullteiler aus J waehlen
1094
1095    //test for normality:
1096      RR=SM[1],SM[2],JM[2],SL[1],count;
1097      RS=HomJJ(RR);
1098     
1099    //--- the ring is normal, prepare output and go home
1100      if(RS[2]==1)
1101      {
1102         def lastR=RS[1];
1103         setring lastR;
1104         map psi1=BAS,endphi;
1105         ideal norid=endid;
1106         ideal normap=psi1(ihp);
1107         kill endid,endphi;
1108         export norid;
1109         export normap;
1110         setring BAS;
1111         return(lastR);
1112      }
1113
1114    //--- the ring is not normal, start a new normalization loop       
1115      int n=nvars(basering);
1116      ideal MJ=JM[2];
1117
1118      def newR=RS[1];
1119      setring newR;
1120
1121      map psi=BAS,endphi;
1122      list tluser=
1123           normalizationPrimes(endid,psi(ihp),count,simplify(psi(MJ)+endid,4));
1124      setring BAS;
1125      return(tluser);
1126   }
1127  //--------------- case: a zero-divisor was found ---------------
1128  //Now the case where qAnn!=0, i.e.SL[1] is a zero-divisor of R/SM
1129  //and we have found a splitting: id and id1
1130  //id=qAnn+SM[2] defines components of R/SM in the complement of V(SL[1])
1131  //id1 defines components of R/SM in the complement of V(id)
1132      //?????instead of id1 we can take SL[1]+Ann+SM[2]???????????
1133
1134   // A component with singular locus the whole component found:
1135   if( Ann == 1)
1136   {
1137      "// Input appeared not to be a radical ideal!";
1138      "// A (everywhere singular) component with ideal";
1139      "// equal to its Jacobian ideal was found";
1140      "// Procedure will stop with partial result computed so far";"";
1141
1142         MB=SM[2];
1143         intvec rw;
1144         list LL=substpart(MB,ihp,0,rw);
1145         def newR6=LL[1];
1146         setring newR6;
1147         ideal norid=endid;
1148         ideal normap=endphi;
1149         kill endid,endphi;
1150         export norid;
1151         export normap;
1152         result=newR6;
1153         setring BAS;
1154         return(result);
1155   }
1156   // The general case with splitting of ring, i.e. qAnn!=0
1157   else
1158   {
1159      int equi=attrib(SM[2],"isEquidimensional");
1160      ideal new1=qAnn+SM[2];
1161      execute("ring newR1="+charstr(basering)+",("+varstr(basering)+"),("
1162                      +ordstr(basering)+");");
1163      if(y>=0)
1164      {
1165            "//   a zero-divisor was found, we have SPLITTING of ideals";
1166            "";
1167      }
1168      ideal vid=fetch(BAS,new1);
1169      ideal ihp=fetch(BAS,ihp);
1170      attrib(vid,"isCohenMacaulay",0);
1171      attrib(vid,"isPrim",0);
1172      attrib(vid,"isIsolatedSingularity",0);
1173      attrib(vid,"isRegInCodim2",0);
1174      if(equi==1)
1175      {
1176         attrib(vid,"isEquidimensional",1);
1177      }
1178      else
1179      {
1180         attrib(vid,"isEquidimensional",0);
1181      }
1182      attrib(vid,"isCompleteIntersection",0);
1183
1184      if(y>=0)
1185      {
1186            "// start a normalization loop with 1st split ideal (size",size(vid),"in",nvars(basering),"vars)";
1187      }
1188
1189      keepresult1=normalizationPrimes(vid,ihp,count);
1190
1191      setring BAS;
1192      ideal new2=quotient(SM[2],Ann)+SM[2];
1193// evtl. qAnn nehmen
1194      execute("ring newR2="+charstr(basering)+",("+varstr(basering)+"),("
1195                      +ordstr(basering)+");");
1196
1197      ideal vid=fetch(BAS,new2);
1198      ideal ihp=fetch(BAS,ihp);
1199      attrib(vid,"isCohenMacaulay",0);
1200      attrib(vid,"isPrim",0);
1201      attrib(vid,"isIsolatedSingularity",0);
1202      attrib(vid,"isRegInCodim2",0);
1203      if(equi==1)
1204      {
1205         attrib(vid,"isEquidimensional",1);
1206      }
1207      else
1208      {
1209         attrib(vid,"isEquidimensional",0);
1210      }
1211      attrib(vid,"isCompleteIntersection",0);
1212
1213      if(y>=0)
1214      {
1215            "// start a normalization loop with 2nd split ideal (size",size(vid),"in",nvars(basering),"vars)";
1216      }
1217
1218      keepresult2=normalizationPrimes(vid,ihp,count);
1219
1220      setring BAS;
1221      for(lauf=1;lauf<=size(keepresult2);lauf++)
1222      {
1223         keepresult1=insert(keepresult1,keepresult2[lauf]);
1224      }
1225      return(keepresult1);
1226   }
1227}
1228example
1229{ "EXAMPLE:";echo = 2;
1230   // Huneke
1231   ring qr=31991,(a,b,c,d,e),dp;
1232   ideal i=
1233   5abcde-a5-b5-c5-d5-e5,
1234   ab3c+bc3d+a3be+cd3e+ade3,
1235   a2bc2+b2cd2+a2d2e+ab2e2+c2de2,
1236   abc5-b4c2d-2a2b2cde+ac3d2e-a4de2+bcd2e3+abe5,
1237   ab2c4-b5cd-a2b3de+2abc2d2e+ad4e2-a2bce3-cde5,
1238   a3b2cd-bc2d4+ab2c3e-b5de-d6e+3abcd2e2-a2be4-de6,
1239   a4b2c-abc2d3-ab5e-b3c2de-ad5e+2a2bcde2+cd2e4,
1240   b6c+bc6+a2b4e-3ab2c2de+c4d2e-a3cde2-abd3e2+bce5;
1241
1242   list pr=normalizationPrimes(i,maxideal(1),1);
1243   def r1=pr[1];
1244   setring r1;
1245   norid;
1246   normap;
1247}
1248///////////////////////////////////////////////////////////////////////////////
1249static proc substpart(ideal endid, ideal endphi, int homo, intvec rw)
1250
1251"//Repeated application of elimpart to endid, until no variables can be
1252//directy substituded. homo=1 if input is homogeneous, rw contains
1253//original weights, endphi (partial) normalization map";
1254
1255{
1256   def newRing=basering;
1257   int ii,jj;
1258   map phi = basering,maxideal(1);
1259
1260   //endid=diagon(endid);
1261
1262   list Le = elimpart(endid);
1263                                     //this proc and the next loop try to
1264   int q = size(Le[2]);              //substitute as many variables as possible
1265   intvec rw1 = 0;                   //indices of substituted variables
1266   rw1[nvars(basering)] = 0;
1267   rw1 = rw1+1;
1268
1269   while( size(Le[2]) != 0 )
1270   {
1271      endid = Le[1];
1272      map ps = newRing,Le[5];
1273
1274      phi = ps(phi);
1275      for(ii=1;ii<=size(Le[2])-1;ii++)
1276      {
1277         phi=phi(phi);
1278      }
1279      //eingefuegt wegen x2-y2z2+z3
1280      kill ps;
1281
1282      for( ii=1; ii<=size(rw1); ii++ )
1283      {
1284         if( Le[4][ii]==0 )
1285         {
1286            rw1[ii]=0;                             //look for substituted vars
1287         }
1288      }
1289      Le=elimpart(endid);
1290      q = q + size(Le[2]);
1291   }
1292   endphi = phi(endphi);
1293
1294//---------- return -----------------------------------------------------------
1295// in the homogeneous case put weights for the remaining vars correctly, i.e.
1296// delete from rw those weights for which the corresponding entry of rw1 is 0
1297
1298   if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 )
1299   {
1300      jj=1;
1301      for( ii=2; ii<size(rw1); ii++)
1302      {
1303         jj++;
1304         if( rw1[ii]==0 )
1305         {
1306            rw=rw[1..jj-1],rw[jj+1..size(rw)];
1307            jj=jj-1;
1308         }
1309      }
1310      if( rw1[1]==0 ) { rw=rw[2..size(rw)]; }
1311      if( rw1[size(rw1)]==0 ){ rw=rw[1..size(rw)-1]; }
1312
1313      ring lastRing = char(basering),(T(1..nvars(newRing)-q)),(a(rw),dp);
1314   }
1315   else
1316   {
1317      ring lastRing = char(basering),(T(1..nvars(newRing)-q)),dp;
1318   }
1319
1320   ideal lastmap;
1321   q = 1;
1322   for(ii=1; ii<=size(rw1); ii++ )
1323   {
1324      if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; }
1325      if ( rw1[ii]==0 ) { lastmap[ii] = 0; }
1326   }
1327   map phi1 = newRing,lastmap;
1328   ideal endid  = phi1(endid);
1329   ideal endphi = phi1(endphi);
1330   export(endid);
1331   export(endphi);
1332   list L = lastRing;
1333   setring newRing;
1334   return(L);
1335}
1336///////////////////////////////////////////////////////////////////////////////
1337static
1338proc diagon(ideal i)
1339{
1340   matrix m;
1341   intvec iv = option(get);
1342   option(redSB);
1343   ideal j=liftstd(jet(i,1),m);
1344   option(set,iv);
1345   return(ideal(matrix(i)*m));
1346}
1347/////////////////////////////////////////////////////////////////////////////
1348/*
1349Aenderungen:
13501. normal kommentiert, bei Berechnung de singulaeren Ortes ein simplify(J,16)
1351eingefuehrt, um bei riesigen Minorenzahlen, das Ideal zu verkleinern (bis
1352Faktor 10 Beschleunigung).
1353Protokoll mit printlevel so gesteuert, dass es bei rekursivem Aufruf korrekt
1354arbeitet.
1355list nor = normal(i);     //mit equidim Zerlegung
1356list nor = normal(i,1);   //mit prim Zerlegung
1357Zeiten au sony_pumuckel (P2, 500)
1358                           Examples:
1359LIB"normal.lib";
1360//1. Huneke, 1 Komponente
1361//prim: 2 sec equidim:1sec
1362ring qr=31991,(a,b,c,d,e),dp;
1363ideal i=
13645abcde-a5-b5-c5-d5-e5,
1365ab3c+bc3d+a3be+cd3e+ade3,
1366a2bc2+b2cd2+a2d2e+ab2e2+c2de2,
1367abc5-b4c2d-2a2b2cde+ac3d2e-a4de2+bcd2e3+abe5,
1368ab2c4-b5cd-a2b3de+2abc2d2e+ad4e2-a2bce3-cde5,
1369a3b2cd-bc2d4+ab2c3e-b5de-d6e+3abcd2e2-a2be4-de6,
1370a4b2c-abc2d3-ab5e-b3c2de-ad5e+2a2bcde2+cd2e4,
1371b6c+bc6+a2b4e-3ab2c2de+c4d2e-a3cde2-abd3e2+bce5;
1372
1373
1374//2. Vasconcelos (dauert laenger: 83 sec auf sony_pumuckel)
1375ring r=32003,(x,y,z,w,t),dp;
1376ideal i=
1377x2+zw,
1378y3+xwt,
1379xw3+z3t+ywt2,
1380y2w4-xy2z2t-w3t3;
1381
1382//2a. Vasconcelos verkleinert
1383//prim:2Komp, 2 Ringe, 16 sec (manchmal lange, haengt am Faktorisierer)
1384//equidim: 1 Komp, 7 loops, 2 ringe, 12sec
1385ring r=32003,(x,y,z,w,t),dp;
1386ideal i=
1387x+zw,
1388y3+xwt,
1389xw3+z3t+ywt2;
1390
1391//3. GM1
1392// irreducible, 13 normalization loops, 1 Ring
1393//2sec mit prim, 1 sec mit equidim
1394ring r=32003,(x,y,z,u),dp;
1395ideal i = x2+y3,z2+u3,y2+z3;
1396
1397//3a. GM1
1398ring r=32003,(x,y),dp;
1399ideal i = intersect(y3+x2,y2+x3);  // beide 0 sec
1400ideal i = intersect(y3+x2,y2+x3,y2+x2+x3);
1401//prim 0sec,
1402//equidim sehr lange (Relationen in HomJJ zu gross)
1403
1404//4. GM2
1405//i nicht reduziert, equidim bricht ab (0 sec)
1406//prim: 11 irred comp, 11 loops, (1sec)
1407ring r=32003,(x,y,z,u),dp;
1408ideal i = x2+y3,z2+u3,y2+z3,x2+z3;
1409
1410//5. GM3,  radical von GM2
1411//prim: 11 irred comp, 11 loops, 11 Ringe, (1sec)
1412//equidim: 1 equidim comp, 1 loop, 1 Ring, (0sec)
1413ring r=32003,(x,y,z,u),dp;
1414ideal i =yu+u,yz+z,y2+y,xy+x,x2+y,u3+z2,z3-y;
1415
1416//GM4
1417//equidim: 2 equidim comp, 3 Ringe, (0sec);
1418//prim: 3 Komp, (0sec)
1419ring r=32003,(x,y,z,u),dp;
1420ideal i1 = x2+y3,u,z;
1421ideal i2 = u2+z3,x,y;
1422ideal i3 = x2+y2+z2+u4;
1423ideal i = intersect(i1,i2,i3);
1424
1425//GM4a  Hier dauert prim laenger! (## facstd)
1426//equidim: 3 equidim Komp, 4 Ringe(0sec)
1427//prim 13 Komp (63 sec), wegen facstd
1428//##ev minAssGTZ(i,1) verwenden (ohne facstd, ist noch fehlerhaft)
1429ring r=32003,(x,y,z,u),dp;
1430ideal i1 = x2+y3,u,z;
1431ideal i2 = u2+z3,x,y;
1432ideal i3 = x2+y2+z2+u4;
1433ideal i4 =yu+u,yz+z,y2+y,xy+x,x2+y,u3+z2,z3-y;
1434ideal i = intersect(i1,i2,i3,i4);
1435
1436//GM5
1437//equidim: 4 Komp,0sec, prim 13 Komp, 1sec
1438ring r=32003,(x,y,z,u,v),dp;
1439ideal i1 = x2+y3,v;                            //2dim
1440ideal i2 = u2+z3,x,y;                          //3dim
1441ideal i3 = x2+y2+z2+u4;                        //4dim
1442ideal i4 =yu+u,yz+z,y2+y,xy+x,x2+y,u3+z2,z3-y; //1dim
1443ideal i = intersect(i1,i2,i3,i4);
1444
1445//cyclic 5
1446//equidim: 1 Komp 0sec, prim: 20 Komp, 3 sec
1447ring r=32003,(x,y,z,u,v),dp;
1448ideal i =
1449x+y+z+u+v,
1450xy+yz+zu+xv+uv,
1451xyz+yzu+xyv+xuv+zuv,
1452xyzu+xyzv+xyuv+xzuv+yzuv,
1453xyzuv-1;
1454
1455// cyclic 5 hat Normalisierung (1 embim weniger)
1456///equidim: 1 Komp 0sec, prim: 20 Komp, 2 sec
1457ring r=32003,(x,y,z,u),dp;
1458ideal i =
1459x2+xz-yz+2xu+yu+u2,
1460xy2-xyz+y2z-y2u+xzu+yzu+z2u-xu2-2yu2+zu2-u3,
1461xyz2+xyzu+y2zu-xz2u+yz2u-z3u-xyu2-xzu2-2z2u2+xu3+yu3-zu3+u4,
14622xyzu2+y2zu2+2yz2u2-xyu3-2xzu3-yzu3-z2u3+xu4+yu4-2zu4+u5-1;
1463
1464//cyclic(6)
1465//equidim: 1Komp in 5 vars 1sec
1466//prim: 90 (!) Ringe, 12 sec
1467
1468//Theo1
1469ring r=32003,(x,y,z),wp(2,3,6);
1470ideal i=zy2-zx3-x6;
1471
1472//Theo1a (CohenMacaulay and regular in codimension 2)
1473ring r=32003,(x,y,z,u),wp(2,3,6,6);
1474ideal i=zy2-zx3-x6+u2;
1475
1476
1477//Theo2
1478ring r=32003,(x,y,z),wp(3,4,12);
1479ideal i=z*(y3-x4)+x8;
1480
1481//Theo2a
1482ring r=32003,(T(1..4)),wp(3,4,12,17);
1483ideal i=
1484T(1)^8-T(1)^4*T(3)+T(2)^3*T(3),
1485T(1)^4*T(2)^2-T(2)^2*T(3)+T(1)*T(4),
1486T(1)^7+T(1)^3*T(2)^3-T(1)^3*T(3)+T(2)*T(4),
1487T(1)^6*T(2)*T(3)+T(1)^2*T(2)^4*T(3)+T(1)^3*T(2)^2*T(4)-T(1)^2*T(2)*T(3)^2+T(4)^2;
1488
1489//Theo3
1490ring r=32003,(x,y,z),wp(3,5,15);
1491ideal i=z*(y3-x5)+x10;
1492
1493
1494//Theo4
1495ring r=32003,(x,y,z),dp;
1496ideal i=(x-y)*(x-z)*(y-z);
1497
1498//Theo5
1499ring r=32003,(x,y,z),wp(2,1,2);
1500ideal i=z3-xy4;
1501
1502//Theo6
1503ring r=32003,(x,y,z),dp;
1504ideal i=x2y2+x2z2+y2z2;
1505
1506ring r=32003,(a,b,c,d,e,f),dp;
1507ideal i=
1508bf,
1509af,
1510bd,
1511ad;
1512
1513//Sturmfels, wo vorher Prim schneller (2 sec,sonst 860 sec)
1514//ist CM
1515//prim: 15 loops, 15 Komp, 1 sec,
1516//equidim:15 Ringe, 93 sec mit simplify(J,16),
1517//ohne simlify(J,16) 860sec?,
1518//andere simplify sind z.T. viel langsamer
1519ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
1520ideal i=
1521bv+su,
1522bw+tu,
1523sw+tv,
1524by+sx,
1525bz+tx,
1526sz+ty,
1527uy+vx,
1528uz+wx,
1529vz+wy,
1530bvz;
1531
1532//J S/Y
1533ring r=32003,(x,y,z,t),dp;
1534ideal i=
1535x2z+xzt,
1536xyz,
1537xy2-xyt,
1538x2y+xyt;
1539
1540//St_S/Y
1541ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
1542ideal i=
1543wy-vz,
1544vx-uy,
1545tv-sw,
1546su-bv,
1547tuy-bvz;
1548
1549//Horrocks:
1550//CHAR 32003:mit prim 1 sec, equidim: 115 sec, beide 6 Ringe
1551//           Singulaere Ort hat zu Beginn > 106 000 Erzeuger!!
1552//char 31991: prim 1sec, 8 Ringe, equidim: 25 Ringe(!), 162 sec,
1553//            nicht reduziert!
1554//            Singulaere Ort hat zu Beginn > 28 000 Erzeuger!!
1555//            i=radical(i) -> 8 Ringe, 1sec (radical <1 sec)
1556//Horrocks:
1557ring r=31991,(a,b,c,d,e,f),dp;
1558ideal i=
1559adef-16000be2f+16001cef2,
1560ad2f+8002bdef+8001cdf2,
1561abdf-16000b2ef+16001bcf2,
1562a2df+8002abef+8001acf2,
1563ad2e-8000bde2-7999cdef,
1564acde-16000bce2+16001c2ef,
1565a2de-8000abe2-7999acef,
1566acd2+8002bcde+8001c2df,
1567abd2-8000b2de-7999bcdf,
1568a2d2+9603abde-10800b2e2-9601acdf+800bcef+11601c2f2,
1569abde-8000b2e2-acdf-16001bcef-8001c2f2,
1570abcd-16000b2ce+16001bc2f,
1571a2cd+8002abce+8001ac2f,
1572a2bd-8000ab2e-7999abcf,
1573ab3f-3bdf3,
1574a2b2f-2adf3-16000bef3+16001cf4,
1575a3bf+4aef3,
1576ac3e-10668cde3,
1577a2c2e+10667ade3+16001be4+5334ce3f,
1578a3ce+10669ae3f,
1579bc3d+8001cd3e,
1580ac3d+8000bc3e+16001cd2e2+8001c4f,
1581b2c2d+16001ad4+4000bd3e+12001cd3f,
1582b2c2e-10668bc3f-10667cd2ef,
1583abc2e-cde2f,
1584b3cd-8000bd3f,
1585b3ce-10668b2c2f-10667bd2ef,
1586abc2f-cdef2,
1587a2bce-16000be3f+16001ce2f2,
1588ab3d-8000b4e-8001b3cf+16000bd2f2,
1589ab2cf-bdef2,
1590a2bcf-16000be2f2+16001cef3,
1591a4d-8000a3be+8001a3cf-2ae2f2;
1592
1593
1594ring r=32003,(b,s,t,u,v,w,x,y,z),dp;   //3sec
1595ideal k=
1596wy-vz,
1597vx-uy,
1598tv-sw,
1599su-bv,
1600tuy-bvz;
1601ideal j=x2y2+x2z2+y2z2;
1602ideal i=mstd(intersect(j,k))[2];
1603
1604//22,
1605// neu, prim: 3 sec, equidim 1 sec, je 4 Ringe
1606ring r=32003,(b,s,t,u,v,w,x,y,z),dp;
1607ideal i=
1608wx2y3-vx2y2z+wx2yz2+wy3z2-vx2z3-vy2z3,
1609vx3y2-ux2y3+vx3z2-ux2yz2+vxy2z2-uy3z2,
1610tvx2y2-swx2y2+tvx2z2-swx2z2+tvy2z2-swy2z2,
1611sux2y2-bvx2y2+sux2z2-bvx2z2+suy2z2-bvy2z2,
1612tux2y3-bvx2y2z+tux2yz2+tuy3z2-bvx2z3-bvy2z3;
1613
1614
1615//riemenschneider, 5 Komponenten
1616//33(alte Zeiten), normal+primary 3, primary 9, radical 1, minAssGTZ; 2
1617//neu: prim 0sec, equi 1 sec, je 5 Ringe
1618ring r=32000,(p,q,s,t,u,v,w,x,y,z),wp(1,1,1,1,1,1,2,1,1,1);
1619ideal i=
1620xz,
1621vx,
1622ux,
1623su,
1624qu,
1625txy,
1626stx,
1627qtx,
1628uv2z-uwz,
1629uv3-uvw,
1630puv2-puw;
1631
1632ring r=0,(u,v,w,x,y,z),wp(1,1,1,3,2,1);
1633ideal i=wx,wy,wz,vx,vy,vz,ux,uy,uz,y3-x2;   //0sec
1634*/
1635
Note: See TracBrowser for help on using the repository browser.