source: git/Singular/LIB/resjung.lib @ 4bde6b

spielwiese
Last change on this file since 4bde6b was 4bde6b, checked in by Hans Schoenemann <hannes@…>, 4 years ago
spelling p1
  • Property mode set to 100644
File size: 22.7 KB
Line 
1////////////////////////////////////////////////////////////////////////////
2version="version resjung.lib 4.1.2.0 Feb_2019 "; // $Id$
3category="Commutative Algebra";
4info="
5LIBRARY:  jung.lib      Resolution of surface singularities (Desingularization)
6                           Algorithm of Jung
7AUTHOR:  Philipp Renner,   philipp_renner@web.de
8
9PROCEDURES:
10 jungresolve(J[,is_noeth])  computes a resolution (!not a strong one) of the
11                            surface given by the ideal J using Jungs Method,
12 jungnormal(J[,is_noeth])   computes a representation of J such that all it's
13                            singularities are of Hirzebruch-Jung type,
14 jungfib(J[,is_noeth])      computes a representation of J such that all it's
15                            singularities are quasi-ordinary
16";
17
18LIB "resolve.lib";
19LIB "mregular.lib";
20LIB "sing.lib";
21LIB "normal.lib";
22LIB "primdec.lib";
23
24
25//-----------------------------------------------------------------------------------------
26//Main procedure
27//-----------------------------------------------------------------------------------------
28
29proc jungfib(ideal id, list #)
30"USAGE:  jungfib(J[,is_noeth]);
31@*       J = ideal
32@*       j = int
33ASSUME:  J  = two dimensional ideal
34RETURN:  a list l of rings
35         l[i] is a ring containing two Ideals: QIdeal and BMap.
36         BMap defines a birational morphism from V(QIdeal)-->V(J), such that
37         V(QIdeal) has only quasi-ordinary singularities.
38         If is_noeth=1 the algorithm assumes J is in noether position with respect to
39         the last two variables. As a default or if is_noeth = 0 the algorithm computes
40         a coordinate change such that J is in noether position.
41         NOTE: since the noether position algorithm is randomized the performance
42         can vary significantly.
43EXAMPLE: example jungfib; shows an example.
44"
45{
46  int noeth = 0;
47  if(size(#) == 0)
48  {
49     #[1]=0;
50     noeth=0;
51  }
52  if(#[1]==1){
53    noeth=1;
54  }
55  ideal I = id;
56  I = radical(id);
57  def A = basering;
58  int n = nvars(A);
59  if(deg(NF(1,groebner(slocus(id)))) == -1){
60    list result;
61    ideal QIdeal = I;
62    ideal BMap = maxideal(1);
63    export(QIdeal);
64    export(BMap);
65    result[1] = A;
66    return(result);
67  }
68  if(char(A) <> 0){ERROR("only works for characterisitc 0");}  //dummy check
69  if(dim(I)<> 2){ERROR("dimension is unequal 2");}  //dummy check
70//Noether Normalization
71  if(noeth == 0){
72    if(n==3){
73      int pos = NoetherP_test(I);
74      if(pos ==0){
75        ideal noethpos = NoetherPosition(I);
76        map phi = A,noethpos;
77        kill noethpos,pos;
78      }
79      else{
80        ideal NoetherPos = var(pos);
81        for(int i = 1;i<=3;i++){
82          if(i<>pos){
83            NoetherPos = NoetherPos + var(i);
84          }
85        }
86        map phi = A,NoetherPos;
87        kill i,pos,NoetherPos;
88      }
89    }
90    else{
91      map phi = A,NoetherPosition(I);
92    }
93    ideal NoetherN = ideal(phi(I));  //image of id under the NoetherN coordinate change
94  }
95  else{
96    ideal NoetherN = I;
97    map phi = A,maxideal(1);
98  }
99  kill I;
100//Critical Locus
101  def C2 = branchlocus(NoetherN);
102  setring C2;
103//dim of critical locus is 0 then the normalization is an resolution
104  if(dim(clocus) == 0){
105    setring A;
106    list nor = normal(NoetherN);
107    list result;
108    int sizeofnor = size(nor[1]);
109    for(int i = 1;i<=sizeofnor;i++){
110      def R = nor[1][i];
111      setring R;
112      ideal QIdeal = norid;
113      ideal BMap = BMap;
114      export(QIdeal);
115      export(BMap);
116      result[size(result)+1] = R;
117      kill R;
118      setring A;
119    }
120    kill sizeofnor;
121    print("This is a resolution.");
122    return(result);
123  }
124
125//dim of critical locus is 1, so compute embedded resolution of the discriminant curve
126  list embresolvee = embresolve(clocus);
127
128//build the fibreproduct
129  setring A;
130  list fibreP = buildFP(embresolvee,NoetherN,phi);
131  //a list of lists, where fibreP[i] contains the information concerning
132  //the i-th chart of the fibrepoduct
133  //fibreP[i] is the ring; QIdeal the quotientideal; BMap is the map from A
134  return(fibreP);
135}
136example{
137 "EXAMPLE:";echo = 2;
138//Computing a resolution of singularities of the variety z2-x3-y3
139 ring r = 0,(x,y,z),dp;
140 ideal I = z2-x3-y3;
141//The ideal is in noether position
142 list l = jungfib(I,1);
143 def R1 = l[1];
144 def R2 = l[2];
145 setring R1;
146 QIdeal;
147 BMap;
148 setring R2;
149 QIdeal;
150 BMap;
151}
152
153proc jungnormal(ideal id,list #)
154"USAGE:  jungnormal(ideal J[,is_noeth]);
155@*       J = ideal
156@*       i = int
157ASSUME:  J  = two dimensional ideal
158RETURN:  a list l of rings
159         l[i] is a ring containing two Ideals: QIdeal and BMap.
160         BMap defines a birational morphism from V(QIdeal)-->V(J), such that
161         V(QIdeal) has only singularities of Hizebuch-Jung type.
162         If is_noeth=1 the algorithm assumes J is in noether position with respect to
163         the last two variables. As a default or if is_noeth = 0 the algorithm computes
164         a coordinate change such that J is in noether position.
165         NOTE: since the noether position algorithm is randomized the performance
166         can vary significantly.
167EXAMPLE: example jungnormal; gives an example.
168"
169{
170  int noeth = 0;
171  if(size(#) == 0)
172  {
173     #[1]=0;
174     noeth=0;
175  }
176  if(#[1]==1){
177    noeth=1;
178  }
179  def A = basering;
180  list fibreP = jungfib(id,noeth);
181  list result;
182  for(int i =1;i<=size(fibreP);i++){
183    def R1 = fibreP[i];
184    setring R1;
185    map f1 = A,BMap;
186    list nor = normal(QIdeal);
187    int sizeofnor = size(nor[1]);
188    for(int j = 1;j<=sizeofnor;j++){
189      def Ri2 = nor[1][j];
190      setring Ri2;
191      map f2 = R1,normap;
192      ideal BMap = ideal(f2(f1));
193      ideal QIdeal = norid;
194      export(BMap);
195      export(QIdeal);
196      result[size(result)+1] = Ri2;
197      kill Ri2,f2;
198      setring R1;
199    }
200    kill j,sizeofnor,R1;
201  }
202  return(result);
203}
204example{
205    "EXAMPLE:";echo = 2;
206//Computing a resolution of singularities of the variety z2-x3-y3
207    ring r = 0,(x,y,z),dp;
208    ideal I = z2-x3-y3;
209//The ideal is in noether position
210    list l = jungnormal(I,1);
211    def R1 = l[1];
212    def R2 = l[2];
213    setring R1;
214    QIdeal;
215    BMap;
216    setring R2;
217    QIdeal;
218    BMap;
219}
220
221proc jungresolve(ideal id,list #)
222"USAGE:  jungresolve(ideal J[,is_noeth]);
223@*       J = ideal
224@*       i = int
225ASSUME:  J  = two dimensional ideal
226RETURN:  a list l of rings
227         l[i] is a ring containing two Ideals: QIdeal and BMap.
228         BMap defines a birational morphism from V(QIdeal)-->V(J), such that
229         V(QIdeal) is smooth. For this the algorithm computes first with
230         jungnormal a representation of V(J) with Hirzebruch-Jung singularities
231         and then it uses Villamayor's algorithm to resolve these singularities
232         If is_noeth=1 the algorithm assumes J is in noether position with respect to
233         the last two variables. As a default or if is_noeth = 0 the algorithm computes
234         a coordinate change such that J is in noether position.
235         NOTE: since the noether position algorithm is randomized the performance
236         can vary significantly.
237EXAMPLE: example jungresolve; shows an example.
238"
239{
240  int noeth = 0;
241  if(size(#) == 0)
242  {
243     #[1]=0;
244     noeth=0;
245  }
246  if(#[1]==1){
247    noeth=1;
248  }
249  def A = basering;
250  list result;
251  list nor = jungnormal(id,noeth);
252  for(int i = 1;i<=size(nor);i++){
253    if(defined(R)==voice){kill R;}
254    def R3 = nor[i];
255    setring R3;
256    def R = changeord(list(list("dp",1:nvars(basering))));
257    setring R;
258    ideal QIdeal = imap(R3,QIdeal);
259    ideal BMap = imap(R3,BMap);
260    map f = A,BMap;
261    if(QIdeal <> 0){
262      list res = resolve(QIdeal);
263      for(int j =1;j<=size(res[1]);j++){
264        def R2 = res[1][j];
265        setring R2;
266        if(defined(QIdeal)==voice){kill QIdeal;}
267        if(defined(BMap)==voice){kill BMap;}
268        if(BO[1]<>0){ideal QIdeal = BO[1]+BO[2];}
269        else{ideal QIdeal = BO[2];}
270        map g = R,BO[5];
271        ideal BMap = ideal(g(f));
272        export(QIdeal);
273        export(BMap);
274        result[size(result)+1] = R2;
275        kill R2;
276      }
277      kill j,res;
278    }
279    else{
280      result[size(result)+1] = nor[i];
281    }
282    setring A;
283    kill R,R3;
284  }
285  return(result);
286}
287example{
288    "EXAMPLE:";echo = 2;
289//Computing a resolution of singularities of the variety z2-x3-y3
290    ring r = 0,(x,y,z),dp;
291    ideal I = z2-x3-y3;
292//The ideal is in noether position
293    list l = jungresolve(I,1);
294    def R1 = l[1];
295    def R2 = l[2];
296    setring R1;
297    QIdeal;
298    BMap;
299    setring R2;
300    QIdeal;
301    BMap;
302}
303
304//---------------------------------------------------------------------------------------
305//Critical locus for the Weierstrass map induced by the noether normalization
306//---------------------------------------------------------------------------------------
307static proc branchlocus(ideal id)
308{
309//"USAGE:  branchlocus(ideal J);
310//       J = ideal
311//ASSUME:  J  = two dimensional ideal in noether position with respect of
312//         the last two variables
313//RETURN:  A ring containing the ideal clocus respresenting the criticallocus
314// of the projection V(J)-->C^2 on the last two coordinates
315//EXAMPLE: none"
316  def A = basering;
317  int n = nvars(A);
318  list l = equidim(id);
319  int k = size(l);
320  ideal LastTwo = var(n-1),var(n);
321  ideal lowdim = 1;           //the components of id with dimension smaller 2
322  if(k>1){
323    for(int j=1;j<k;j++){
324      lowdim = intersect(lowdim,radical(l[j]));
325    }
326  }
327  kill k;
328  lowdim = radical(lowdim);
329  ideal I = radical(l[size(l)]);
330  poly product=1;
331  kill l;
332  for(int i=1; i < n-1; i++){ //elimination of all variables except var(i),var(n-1),var(n)
333    intvec v;
334    for(int j=1; j < n-1; j++){
335      if(j<>i){
336        v[j]=1;
337      }
338      else{
339        v[j]=0;
340      }
341    }
342    v[size(v)+1]=0;
343    v[size(v)+1]=0;
344    list ringl = ringlist(A);
345    list l;
346    l[1] = "a";
347    l[2] = v;
348    list ll = insert(ringl[3],l);
349    ringl[3]=ll;
350    kill l,ll;
351    def R = ring(ringl); //now x_j > x_i > x_n-1 > x_n forall j <> i,n-1,n
352    setring R;
353    ideal J = groebner(fetch(A,I));//this eliminates the variables
354    setring A;
355    ideal J = fetch(R,J);
356    attrib(J,"isPrincipal",0);
357    if(size(J)==1){
358      attrib(J,"isPrincipal",1);
359    }
360    int index = 1;
361    if(attrib(J,"isPrincipal")==0){
362      setring R;
363      for(int j = 1;j<=size(J);j++){//determines the monic polynomial in var(i) with coefficients in C2
364        intvec w = leadexp(J[j]);
365        attrib(w,"isMonic",1);
366        for(int k = 1;k<=size(w);k++){
367          if(w[k] <> 0 && k <> i){
368            attrib(w,"isMonic",0);
369            break;
370          }
371        }
372        //kill k;
373        if(attrib(w,"isMonic")==1){
374          index = j;
375          break;
376        }
377        kill w;
378      }
379      kill j;
380      setring A;
381    }
382    product = product*resultant(J[index],diff(J[index],var(i)),var(i));
383    //Product of the discriminants, which lies in C2
384    kill index,J,v;
385  }
386  ring C2 = 0,(var(n-1),var(n)),dp;
387  setring C2;
388  ideal clocus= imap(A,product);      //the critical locus is contained in this
389  ideal I = preimage(A,LastTwo,lowdim);
390  clocus= radical(intersect(clocus,I));
391  //radical is necessary since the resultant is in general not reduced
392  export(clocus);
393  return(C2);
394}
395
396//-----------------------------------------------------------------------------------------
397//Build the fibre product of the embedded resolution and the coordinate ring of the variety
398//-----------------------------------------------------------------------------------------
399
400static proc buildFP(list embresolve,ideal NoetherN, map phi){
401  def A = basering;
402  list fibreP;
403  int n = nvars(A);
404  for(int i=1;i<=size(embresolve);i++){
405    def R = embresolve[i];
406    setring R;
407    list temp = ringlist(A);
408    //data for the new ring which is, if A=K[x_1,..,x_n] and
409    //R=K[y_1,..,y_m], K[x_1,..,x_n-2,y_1,..,y_m]
410    for(int j = 1; j<= nvars(R);j++){
411       string st = string(var(j));
412       temp[2][n-2+j] = st;
413       kill st;
414    }
415    temp[4] = BO[1];
416    ideal J = BO[5];             //ideal of the resolution map
417    export(J);
418    int m = size(J);
419    def R2 = ring(temp);
420    kill temp;
421    setring R2;
422    ideal Temp=0;              //defines map from R to R2 which is the inclusion
423    for(int k=n-1;k<n-1+nvars(R);k++){
424      Temp = Temp + ideal(var(k));
425    }
426    map f = R,Temp;
427    kill Temp,k;
428    ideal FibPMI = ideal(0);    //defines the map from A to R2
429    for(int k=1;k<=nvars(A)-m;k++){
430      FibPMI=FibPMI+var(k);
431    }
432    FibPMI= FibPMI+ideal(f(J));
433    map FibMap = A,FibPMI;
434    kill f,FibPMI;
435    ideal TotalT = groebner(FibMap(NoetherN));
436    ideal QIdeal = TotalT;
437    export(QIdeal);
438    ideal FibPMap = ideal(FibMap(phi));
439    ideal BMap = FibPMap;
440    export(BMap);
441    fibreP[i] = R2;
442    setring R;
443    kill J,R,R2,k,j,m;
444  }
445  return(fibreP);
446}
447
448//-------------------------------------------------------------------------------
449//embedded resolution for curves
450//-------------------------------------------------------------------------------
451
452static proc embresolve(ideal C)
453"USAGE:  embresolve(ideal C);
454@*       C = ideal
455ASSUME:  C  = ideal of plane curve
456RETURN:  a list l of rings
457         l[i] is a ring containing a basic object BO, the result of the
458         resolution. Whereas the algorithm does not resolve normal
459         crossings of V(C)
460EXAMPLE: example embresolve shows an example
461"
462{
463  ideal J = 1;
464  attrib(J,"iswholeRing",1);
465  list primdec = equidim(C);
466  if(size(primdec)==2){
467  //zero dimensional components of the discrimiant curve are smooth
468  //an cross normally so they can be ignored in the resolution process
469    ideal Lowdim = radical(primdec[1]);
470  }
471  else{
472    J=radical(C);
473  }
474  kill primdec;
475  list l;
476  list BO = createBO(J,l);
477  kill J,l;
478  list result = resolve2(BO);
479  if(defined(Lowdim)==voice)
480  {
481    for(int i = 1;i<=size(result);i++)
482    {
483    //had zero dimensional components which I add now to the end result
484      def RingforEmbeddedResolution = result[i];
485      setring RingforEmbeddedResolution;
486      map f = R2,BO[5];
487      BO[2]=BO[2]*f(Lowdim);
488      kill RingforEmbeddedResolution,f;
489    }
490  }
491  return(result);
492}
493example
494{
495  "EXAMPLE:";echo=2;
496  //The following curve is the critical locus of the projection z2-x3-y3
497  //onto y,z-coordinates.
498  ring R = 0,(y,z),dp;
499  ideal C = z2-y3;
500  list l = embresolve(C);
501  def R1 = l[1];
502  def R2 = l[2];
503  setring R1;
504  showBO(BO);
505  setring R2;
506  showBO(BO);
507}
508
509static proc resolve2(list BO){
510//computes an embedded resolution for the basic object BO and returns
511//a list of rings with BO
512  def H = basering;
513  setring H;
514  attrib(BO[2],"smoothC",0);
515  export(BO);
516  list result;
517  result[1]=H;
518  attrib(result[1],"isResolved",0);    //has only simple normal crossings
519  attrib(result[1],"smoothC",0);       //has smooth components
520  int safety=0;                        //number of runs restricted to 30
521  while(1){
522    int count2 = 0;         //counts the number of smooth charts
523    int p = size(result);
524    for(int j = 1;j<=p;j++){
525      if(attrib(result[j],"isResolved")==0){
526        if(defined(R)){kill R;}
527        def R = result[j];
528        setring R;
529        if(attrib(result[j],"smoothC")==0){
530        //has possibly singular components so choose a singular point and blow up
531          list primdecPC = primdecGTZ(BO[2]);
532          attrib(result[j],"smoothC",1);
533          for(int i = 1;i<=size(primdecPC);i++){
534            ideal Sl = groebner(slocus(primdecPC[i][2]));
535            if(deg(NF(1,Sl))<>-1){
536              list primdecSL = primdecGTZ(Sl);
537              for(int h =1;h<=size(primdecSL);h++){
538                attrib(primdecSL[h],"isRational",1);
539              }
540              kill h;
541              if(!defined(index)){int index = 1;}
542              if(defined(blowup)){kill blowup;}
543              list blowup = blowUpBO(BO,primdecSL[index][2],3);
544              //if it has a rational singularity blow it up else choose
545              //some arbitrary singular point
546              if(attrib(primdecSL[1],"isRational")==0){
547              //if we blow up a non rational singularity the exceptional divisors
548              //are reduzible so we need to separate them
549                for(int k=1;k<=size(blowup);k++){
550                  def R2=blowup[k];
551                  setring R2;
552                  list L;
553                  for(int l = 1;l<=size(BO[4]);l++){
554                    list primdecED=primdecGTZ(BO[4][l]);
555                    L = L + primdecED;
556                    kill primdecED;
557                  }
558                  kill l;
559                  BO[4] = L;
560                  blowup[k]=R2;
561                  kill L,R2;
562                }
563                kill k;
564              }
565              kill primdecSL;
566              list hlp;
567              for(int k = 1;k<j;k++){
568                hlp[k]=result[k];
569                attrib(hlp[k],"isResolved",attrib(result[k],"isResolved"));
570                attrib(hlp[k],"smoothC",attrib(result[k],"smoothC"));
571              }
572              kill k;
573              for(int k =1;k<=size(blowup);k++){
574                hlp[size(hlp)+1]=blowup[k];
575                attrib(hlp[size(hlp)],"isResolved",0);
576                attrib(hlp[size(hlp)],"smoothC",0);
577              }
578              kill k;
579              for(int k = j+1;k<=size(result);k++){
580                hlp[size(hlp)+1]=result[k];
581                attrib(hlp[size(hlp)],"isResolved",attrib(result[k],"isResolved"));
582                attrib(hlp[size(hlp)],"smoothC",attrib(result[k],"smoothC"));
583              }
584              result = hlp;
585              kill hlp,k;
586              i=size(primdecPC);
587            }
588            else{
589              attrib(result[j],"smoothC",1);
590            }
591            kill Sl;
592          }
593          kill i,primdecPC;
594          j=p;
595          break;
596        }
597        else{ //if it has smooth components determine all the intersection
598              //points and check whether they are snc or not
599          int count = 0;
600          ideal Collect = BO[2];
601          for(int i = 1;i<=size(BO[4]);i++){
602            Collect = Collect*BO[4][i];
603          }
604          list primdecSL = primdecGTZ(slocus(Collect));
605          for(int k = 1;k<=size(primdecSL);k++){
606             attrib(primdecSL[k],"isRational",1);
607
608          }
609          kill k;
610          if(defined(blowup)){kill blowup;}
611          list blowup = blowUpBO(BO,primdecSL[1][2],3);
612          if(attrib(primdecSL[1],"isRational")==0){
613            for(int k=1;k<=size(blowup);k++){
614              def R2=blowup[k];
615              setring R2;
616              list L;
617              for(int l = 1;l<=size(BO[4]);l++){
618                list primdecED=primdecGTZ(BO[4][l]);
619                L = L + primdecED;
620                kill primdecED;
621              }
622              kill l;
623              BO[4] = L;
624              blowup[k]=R2;
625              kill L,R2;
626            }
627            kill k;
628          }
629          kill Collect,i;
630          for(int i=1;i<=size(primdecSL);i++){
631            list L = BO[4];
632            L[size(L)+1]=BO[2];
633            for(int l = 1;l<=size(L);l++){
634              if(L[l][1]==1){L=delete(L,l);}
635            }
636            kill l;
637            if(normalCrossing(ideal(0),L,primdecSL[i][2])==0){
638              if(defined(blowup)){kill blowup;}
639              list blowup = blowUpBO(BO,primdecSL[i][2],3);
640              list hlp;
641              for(int k = 1;k<j;k++){
642                hlp[k]=result[k];
643                attrib(hlp[k],"isResolved",attrib(result[k],"isResolved"));
644                attrib(hlp[k],"smoothC",attrib(result[k],"smoothC"));
645              }
646              kill k;
647              for(int k =1;k<=size(blowup);k++){
648                hlp[size(hlp)+1]=blowup[k];
649                attrib(hlp[size(hlp)],"isResolved",0);
650                attrib(hlp[size(hlp)],"smoothC",1);
651              }
652              kill k;
653              for(int k = j+1;k<=size(result);k++){
654                hlp[size(hlp)+1]=result[k];
655                attrib(hlp[size(hlp)],"isResolved",attrib(result[k],"isResolved"));
656                attrib(hlp[size(hlp)],"smoothC",attrib(result[k],"smoothC"));
657              }
658              result = hlp;
659              kill hlp,k;
660              j = p;
661              break;
662            }
663            else{
664              count++;
665            }
666            kill L;
667          }
668          kill i;
669          if(count == size(primdecSL)){
670            attrib(result[j],"isResolved",1);
671          }
672          kill count,primdecSL;
673        }
674        kill R;
675      }
676      else{
677        count2++;
678      }
679    }
680    if(count2==size(result)){
681      break;
682    }
683    kill count2,j,p;
684    safety++;
685  }
686  return(result);
687}
688
689static proc NoetherP_test(ideal id)
690{
691  def A = basering;
692  list ringA=ringlist(A);
693  int index = 0;
694  if(size(id)==1 && nvars(A))
695  {  //test if V(id) = C[x,y,z]/<f>
696    list L;
697    intvec v = 1,1,1;
698    L[1] = "lp";
699    L[2] = v;
700    kill v;
701    poly f = id[1];
702    int j = 0;
703    for(int i = 1;i<=3;i++)
704    {
705      setring A;
706      list l = ringA;  //change ordering to lp and var(i)>var(j) j<>i
707      list vari = ringA[2];
708      string h = vari[1];
709      vari[1] = vari[i];
710      vari[i] = h;
711      l[2] = vari;
712      kill h,vari;
713      l[3][1] = L;
714      def R = ring(l);
715      kill l;
716      setring R;
717      ideal I = imap(A,id);
718      if(defined(v)){kill v;}
719      intvec v = leadexp(I[1]);
720      attrib(v,"isMonic",1);
721      //if(defined(k)==voice){kill k;}
722      for(int k = 2;k<=3;k++)
723      {  //checks whether f is monic in var(i)
724        if(v[k] <> 0 || v[1] == 0)
725        {
726          attrib(v,"isMonic",0);
727          j++;
728          break;
729        }
730      }
731      kill k;
732      if(attrib(v,"isMonic")==1)
733      {
734        index = i;
735        return(index);
736      }
737      kill R;
738    }
739    if(j == 3){ return(0); }
740  }
741  else{     //not yet a test for more variables
742    return(index);
743  }
744}
745
746////copied from resolve.lib/////////////////
747static proc normalCrossing(ideal J,list E,ideal V)
748"Internal procedure - no help and no example available
749"
750{
751   int i,d,j;
752   int n=nvars(basering);
753   list E1,E2;
754   ideal K,M,Estd;
755   intvec v,w;
756
757   for(i=1;i<=size(E);i++)
758   {
759      Estd=std(E[i]+J);
760      if(deg(Estd[1])>0)
761      {
762         E1[size(E1)+1]=Estd;
763      }
764   }
765   E=E1;
766   for(i=1;i<=size(E);i++)
767   {
768      v=i;
769      E1[i]=list(E[i],v);
770   }
771   list ll;
772   int re=1;
773
774   while((size(E1)>0)&&(re==1))
775   {
776      K=E1[1][1];
777      v=E1[1][2];
778      attrib(K,"isSB",1);
779      E1=delete(E1,1);
780      d=n-dim(K);
781      M=minor(jacob(K),d)+K;
782      if(deg(std(M+V)[1])>0)
783      {
784         re=0;
785         break;
786      }
787      for(i=1;i<=size(E);i++)
788      {
789         for(j=1;j<=size(v);j++){if(v[j]==i){break;}}
790         if(j<=size(v)){if(v[j]==i){i++;continue;}}
791         Estd=std(K+E[i]);
792         w=v;
793         if(deg(Estd[1])==0){i++;continue;}
794         if(d==n-dim(Estd))
795         {
796            if(deg(std(Estd+V)[1])>0)
797            {
798               re=0;
799               break;
800            }
801         }
802         w[size(w)+1]=i;
803         E2[size(E2)+1]=list(Estd,w);
804      }
805      if(size(E2)>0)
806      {
807         if(size(E1)>0)
808         {
809            E1[size(E1)+1..size(E1)+size(E2)]=E2[1..size(E2)];
810         }
811         else
812         {
813            E1=E2;
814         }
815      }
816      kill E2;
817      list E2;
818   }
819   return(re);
820}
Note: See TracBrowser for help on using the repository browser.