source: git/Singular/LIB/classifyMapGerms.lib @ 4c9835

fieker-DuValspielwiese
Last change on this file since 4c9835 was 4c9835, checked in by Hans Schoenemann <hannes@…>, 7 years ago
pfister: new classifyUnimodalMaps in calssifyMapGerms.lib
  • Property mode set to 100644
File size: 38.0 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2version="version classifyMapGerms.lib 4.0.3.3 Sep_2016 "; // $Id$
3category="Singularities";
4info="
5LIBRARY:   classifyMapGerms.lib
6AUTHORS:   Gerhard Pfister, pfister@mathematik.uni-kl.de
7           Deeba Afzal,     deebafzal@gmail.com
8           Shamsa Kanwal,   lotus_zone16@yahoo.com
9
10OVERVIEW:
11 A library for computing the standard basis of the tangent space at the orbit
12 of an algebraic group action. The tangent space is usually described as the sum
13 of two modules over different rings. It computes the standard basis using
14 modular methods and parallel modular methods. It also computes the normal form
15 of the germ given by Riegers classification.
16
17REFERENCES:
18[1] Idrees N.; Pfister, G.; Steidel, S.: Parallelization of modular algorithms.
19  J. Symbolic Comput. 46(2011), no. 6, 672-684.
20[2] Gibson,C.G; Hobbs,C.A.: Simple SIngularities of Space Curves.
21  Math.Proc. Comb.Phil.Soc.(1993),113,297.
22[3] Bruce, J.W.,Gaffney, T.J.: Simple singularities of mappings (C, 0) ->(C2,0).
23  J. London Math. Soc. (2) 26 (1982), 465-474.
24[4] Rieger, J. H.: Families of maps from the plane to the plane. J. London Math.
25Soc. (2)36(1987), no. 2. 351-369.
26
27PROCEDURES:
28 coDimMap(I);    computes a bound of the A-determinacy of the map germ defined by I
29 coDim(M,N,I,b); computes the K-vectorspace dimension of A^r/M+N+maxideal(b)*A^r
30 vStd(M,N,I,b);      computes a standard basis of M+N+maxideal(b)*A^r
31 modVStd(M,N,I,b);   computes a standard basis of M+N+maxideal(bound)*A^r (modular)
32 modVStd0(M,N,I,b);  computes a standard basis of M+N+maxideal(bound)*A^r (parallel)
33 classifySimpleMaps(I);  computes the normal form of a germ in Riegers classification
34 classifySimpleMaps1(I); computes the normal form of a germ in Riegers classification
35 classifyUnimodalMaps(I); computes the normal form of a germ in Riegers classification
36";
37
38LIB "general.lib";
39LIB "modstd.lib";
40LIB "teachstd.lib";
41LIB "algebra.lib";
42
43//===================================================================================
44proc coDimMap(ideal I, list #)
45"USAGE:   coDimMap(I, #);  I=ideal, #=list
46COMPUTE:  a bound of the A-determinacy of the map germ defined by I.
47RETURN:   a list in which 1st entry gives the bound of the A-determinancy and
48          the second entry gives the codimension of the map germ defined by I.
49NOTE:     if # is empty it computes A^e-codimension(the extended codimension).
50EXAMPLE:  example coDimMap; shows an example"
51{
52   int bound=10;
53   module M=jacob(I);
54   module N=freemodule(ncols(I));
55   if(size(#)==0){return(coDim(M,N,I,bound,0));}
56   M=maxideal(1)*M;
57   N=I*N;
58   list L=coDim(M,N,I,bound,0);
59   L[2]=L[2]-nvars(basering);
60   return(L);
61}
62example
63{
64 "EXAMPLE"; echo=2;
65  ring R=0,(x,y),(c,ds);
66  poly f1=x;
67  poly f2=xy+y5+y7;
68  poly f11=f1+f2*f1;
69  poly f22=f2+f1^2;
70  map phi=basering,x+y,y+y2;
71  f1=phi(f11);
72  f2=phi(f22);
73  ideal I=f1,f2;
74  coDimMap(I);
75  coDimMap(I,1);
76}
77///////////////////////////////////////////////////////////////////////////////
78proc coDim(module M, module N, ideal I,int bound, list #)
79"USAGE:   coDim(module M, module N, ideal I,int bound, list #); M is a submodule
80          in A^r over the basering=:A, N is a submodule in R^r over the subring
81          R of the basering genrated by the entries of I
82COMPUTE:  computes the K-vectorspace dimension of A^r/M+N+maxideal(bound)*A^r
83RETURN:   an integer
84NOTE:     if # is not empty the bound is corrected by computing determinacy
85EXAMPLE:  example coDim; shows an example"
86{
87//---------------------------- initialisation ---------------------------------
88   int r=nrows(M);
89   int k;
90   int oldbound=bound;
91   module M0=M;
92   module N0=N;
93   if(size(#)!=0)
94   {
95      if(#[1]==0)
96      {
97         k=boundK(M,N,I);
98         if(k<0){return(list(-1,-1));}
99      }
100      else
101      {
102         k=#[1];
103      }
104      bound=bound+k;
105   }
106   list S=vStd(M,N,I,bound);
107   M=S[1];
108   module L=S[2];
109   L=simplify(reduce(lead(L),std(lead(M)+maxideal(bound)*freemodule(r))),1);
110   L=simplify(L,6);
111   if(size(#)==0){
112   return(vdim(std(lead(M)+maxideal(bound)*freemodule(r)))-size(L));
113   }
114   if(correctBound(M,L,bound,oldbound))
115   {
116      int co=vdim(std(lead(M)+maxideal(bound)*freemodule(r)))-size(L);
117      return(list(bound,co));
118   }
119   bound++;
120   return(coDim(M0,N0,I,bound,k));
121}
122example
123{
124  "EXAMPLE"; echo=2;
125   ring R=0,(x,y),(c,ds);
126   poly f1=x;
127   poly f2=xy+y5+y7;
128   poly f11=f1+f2*f1;
129   poly f22=f2+f1^2;
130   map phi=basering,x+y,y+y2;
131   f1=phi(f11);
132   f2=phi(f22);
133   ideal I=f1,f2;
134   module M=maxideal(1)*jacob(I);
135   module N=I*freemodule(2);
136   coDim(M,N,I,15);
137}
138///////////////////////////////////////////////////////////////////////////////
139proc vStd(module M, module N, ideal I,int bound)
140"USAGE:    vStd(M, N, I, bound);M is a submodule  in A^r over the basering=:A,
141           N ist a submodule in R^r over the subring R of the basering genrated
142           by the entries of I
143COMPUTE:  a standard basis of M+N+maxideal(bound)*A^r
144RETURN:   a list whose ist entry gives a list where each entry is a  genrator of
145          standard basis and second entry gives a list of generators after the
146          reduced echelon form
147EXAMPLE:  example vStd; shows an example"
148{
149   if(size(M)!=1)
150   {
151      M=jet(std(M+maxideal(bound)*freemodule(nrows(M))),bound);
152   }
153   if (system("version")>4033)
154   {
155     N=system("reduce_bound",N,M,bound);
156   }
157   else
158   {
159     N=myReduceM(N,M,bound);
160   }
161   N=echelon(M,N,bound);
162   module L=computeN(M,N,I,bound-1);
163   L=echelon(M,L,bound);
164   return(list(M,L));
165}
166example
167{
168  "EXAMPLE"; echo=2;
169   ring R=0,(x,y),(c,ds);
170   poly f1=x;
171   poly f2=xy+y5+y7;
172   poly f11=f1+f2*f1;
173   poly f22=f2+f1^2;
174   map phi=basering,x+y,y+y2;
175   f1=phi(f11);
176   f2=phi(f22);
177   ideal I=f1,f2;
178   module M=maxideal(1)*jacob(I);
179   module N=I*freemodule(2);
180   vStd(M,N,I,15);
181}
182///////////////////////////////////////////////////////////////////////////////
183proc vStd_size1(module M, module N, ideal I, int bound)
184"USAGE:    vStd(M, N, I, bound);M is a submodule generated by one element in A^r over the
185           basering=:A, N ist a submodule in R^r over the subring R of the basering
186           genrated by the entries of I
187COMPUTE:  a standard basis of M+N+maxideal(bound)*A^r
188RETURN:   a list whose ist entry gives a list where each entry is a  genrator of
189          standard basis and second entry gives a list of generators after the
190          reduced echelon form
191EXAMPLE:  example vStd_size1; shows an example"
192{
193   if(size(M)!=1)
194   {
195      M=jet(std(M+maxideal(bound)*freemodule(nrows(M))),bound);
196   }
197   if (system("version")>4033)
198   {
199     N=system("reduce_bound",N,M,bound);
200   }
201   else
202   {
203     N=myReduceM(N,M,bound);
204   }
205   N=echelon(M,N,bound);
206   module L=computeN(M,N,I,bound-1);
207   L=echelon(M,L,bound);
208   return(L);
209}
210example
211{
212  "EXAMPLE"; echo=2;
213   ring R=0,(x,y),(c,ds);
214   poly f1=x;
215   poly f2=xy+y5+y7;
216   poly f11=f1+f2*f1;
217   poly f22=f2+f1^2;
218   map phi=basering,x+y,y+y2;
219   f1=phi(f11);
220   f2=phi(f22);
221   ideal I=f1,f2;
222   module M=maxideal(1)*jacob(I);
223   module N=I*freemodule(2);
224   vStd_size1(M,N,I,15);
225}
226
227///////////////////////////////////////////////////////////////////////////////
228static proc boundK(module M,module N, ideal I)
229"USAGE:    boundK(M, N, I);
230COMPUTE:  Let T=freemodule(nrows(M)), computes k such that
231          maxideal(k)*T<=M+I*T+maxideal(k+1)*T
232RETURN:   an integer
233REMARk:   needed to compute the determinacy
234"
235{
236   int i;
237   module T=freemodule(nrows(M));
238   module M0=M+I*T;
239   while(1)
240   {
241      i++;
242      T=maxideal(1)*T;
243
244      M=std(jet(M0,i)+maxideal(1)*T);
245      if(size(reduce(T,M,1))==0){return(i);}
246      if(i>100){M0=std(M0);if(vdim(M0)==-1){break;}}
247   }
248   return(-1);
249}
250///////////////////////////////////////////////////////////////////////////////
251static proc correctBound(module M,module L,int bound,int oldbound)
252"USAGE:     correctBound(M, L, bound, oldbound)
253COMPUTE:    let T=freemodule(nrows(M)),test if
254            maxideal(old bound)*T<=M+L+maxideal(bound)*T
255RETURN:     0 or 1
256REMARK:     needed to compute the A-determinacy and codimension
257"
258{
259   int i;
260   L=jet(L+std(lead(M)),bound-1);
261   module T=maxideal(oldbound)*freemodule(nrows(M));
262   while(i<bound-oldbound)
263   {
264      T=jet(myReduceM(T,M,bound),bound-1);
265      if(size(reduceV(M,T,L,bound))!=0)
266      {
267         return(0);
268      }
269      T=maxideal(1)*T;
270      i++;
271   }
272   return(1);
273}
274///////////////////////////////////////////////////////////////////////////////
275static proc reduceV(module M,module T, module L,int bound)
276"USAGE:     reduceV(M, T, L, bound)
277COMPUTE:    special reduction procedure for correctBound (reduction modulo a sum
278            of modules over different rings
279RETURN:     a list
280"
281{
282   int i,j;
283   vector f,g;
284   for(i=1;i<=ncols(T);i++)
285   {
286     f=T[i];
287     while(1)
288     {
289        g=reducer(f,L);
290        if(g==0){break;}
291        f=f-leadcoef(f)/leadcoef(g)*g;
292        //f=jet(system("reduce_bound",f,M,bound),bound-1);
293        f=jet(myReduce(f,M,bound),bound-1);
294        if(f==0){break;}
295     }
296     T[i]=f;
297   }
298   return(T);
299}
300///////////////////////////////////////////////////////////////////////////////
301static proc reducer(vector f, module L)
302"USAGE:     reducer(f, module L)
303COMPUTE:    find the reductor for reduceV
304RETURN:     a vector
305"
306{
307   vector g;
308   int i;
309   for(i=1;i<=size(L);i++)
310   {
311      if(leadmonom(f)==leadmonom(L[i]))
312      {
313         g=L[i];
314         break;
315      }
316   }
317   return(g);
318}
319///////////////////////////////////////////////////////////////////////////////
320static proc computeN(module M, module N, ideal I, int bound)
321"USAGE:   computeN(M, N, I, bound) M is a submodule  in A^r over the basering=:A
322          N ist a submodule in R^r over the subring R of the basering
323          genrated by the entries of I
324COMPUTE:  all products of powers of generators of I with N
325"
326{
327   I=jet(I,bound);
328   I=simplify(I,2);
329   module L;
330   int j,k;
331   int r=size(I);
332   ideal F=1;
333   ideal G;
334
335   while(F!=0)
336   {
337      for(k=1;k<=size(N);k++)
338      {
339         for(j=1;j<=size(F);j++)
340         {
341            L[size(L)+1]=jet(myReduce(F[j]*N[k],M,bound),bound);
342            //L[ncols(L)+1]=jet(system("reduce_bound",F[j]*N[k],M,bound),bound);
343         }
344      }
345      G=F;
346      F=0;
347      for(j=1;j<=size(G);j++)
348      {
349         for(k=1;k<=r;k++)
350         {
351            F=F,jet(jet(G[j],bound-ord(I[k]))*I[k],bound);
352         }
353      }
354      F=simplify(F,2);
355      F=simplify(F,4);
356      F=simplify(F,2);
357   }
358   return(L);
359}
360
361///////////////////////////////////////////////////////////////////////////////
362static proc myReduceM(module N, module M, int bound)
363"USAGE:   myReduceM(N, M, bound) M is a submodule  in A^r over the basering=:A
364          N ist a submodule in R^r over the subring R of the basering
365          genrated by the entries of I
366COMPUTE:  myReduce for ideals
367"
368{
369   int i;
370   for(i=1;i<=ncols(N);i++)
371   {
372      N[i]=myReduce(N[i],M,bound);
373   }
374   return(N);
375}
376///////////////////////////////////////////////////////////////////////////////
377static proc myReduce(vector f, module M, int bound)
378{
379   f=jet(f,bound);
380   if(f==0){return(f);}
381   vector g, vv,ww;
382   poly p;
383   number c;
384   int i;
385   vector re;
386   while(f!=0)
387   {
388      for(i=1;i<=size(M);i++)
389      {
390         if(reduce(lead(f),std(lead(M[i])))==0)
391         {
392            c=leadcoef(f)/leadcoef(M[i]);
393            vv=lead(f);ww=lead(M[i]);
394            p=quotient(vv,ww)[1];
395            g=M[i];break;
396         }
397      }
398      while((f!=0)&&(g!=0))
399      {
400         f=f-c*p*g;
401         f=jet(f,bound);
402         if(f==0){break;}
403         g=0;
404         for(i=1;i<=size(M);i++)
405         {
406            if(reduce(lead(f),std(lead(M[i])))==0)
407            {
408               c=leadcoef(f)/leadcoef(M[i]);
409               vv=lead(f);ww=lead(M[i]);
410               p=quotient(vv,ww)[1];
411               g=M[i];break;
412            }
413         }
414      }
415      re=re+lead(f);
416      f=f-lead(f);
417   }
418   return(re);
419}
420///////////////////////////////////////////////////////////////////////////////
421static proc echelon(module M, module N, int b)
422"USAGE:   echelon(M, N, b)
423COMPUTE:  the echelon form of N modulo M
424RETURN:   the echelon form of N modulo M
425"
426{
427   int i,j,d;
428   N=simplify(N,4);
429   N=simplify(N,3);
430   N=sort(N)[1];
431   d=size(N);
432   i=d;
433   while(i>=2)
434   {
435      for(j=i-1;j>=1;j=j-1)
436      {
437         if(lead(N[i])==lead(N[j]))
438         {
439            N[j]=N[j]-N[i];
440
441         }
442      }
443      N=simplify(N,4);
444      N=simplify(N,3);
445      N=sort(N)[1];
446      i=i-(d-size(N))-1;
447      d=size(N);
448   }
449   N=simplify(N,6);
450   return(N);
451}
452///////////////////////////////////////////////////////////////////////////////
453static proc reduc(poly f,ideal I, int b)
454"USAGE:   reduc(f, I, b)
455COMPUTE:  the normal form of f with respect to the algebra generated by I
456"
457{
458   list L=1;
459   map psi;
460   f=jet(f,b);
461   if(f==0){return(f);}
462   while((f!=0) && (L[1]!=0))
463   {
464     L= algebra_containment(lead(f),lead(I),1);
465     if (L[1]==1)
466     {
467        def S= L[2];
468        psi= S,maxideal(1),I;
469        f=jet(f-psi(check),b);
470        kill S;
471     }
472   }
473   return (lead(f)+reduc(f-lead(f),I,b));
474}
475///////////////////////////////////////////////////////////////////////////////
476proc classifySimpleMaps(ideal I)
477"USAGE:   classifySimpleMaps(I);  I=an ideal with 2 generators in a polynomial
478         ring with 2 variables and local ordering defining a map germ C^2 to C^2
479COMPUTE:  The normal form of the germ in Riegers classification if it is
480          simple
481RETURN:   normal form of I, of type ideal
482NOTE:     If I is not simple it returns (0,0)
483EXAMPLE:  example classifySimpleMaps; shows an example"
484{
485   if(size(jet(I,1))==0){return(ideal(0,0));}
486   list L=coDimMap(I,1);
487   int determinacy=L[1];
488   int codimension=L[2];
489   if(determinacy<0){return(ideal(0,0));}
490   I=normalMap(I,determinacy);
491   poly p=lead(I[2]);
492   if(p==0){return(ideal(0,0));}
493   if(p==var(2)){return(maxideal(1));}
494   if(p==var(2)^2){return(ideal(var(1),var(2)^2));}
495   if(p==var(1)*var(2))
496   {
497      if(codimension==2){return(ideal(var(1),p+var(2)^3));}
498      if(codimension==3){return(ideal(var(1),p+var(2)^4));}
499      if(codimension==4){return(ideal(var(1),p+var(2)^5+var(2)^7));}
500      if(codimension==5){return(ideal(var(1),p+var(2)^5));}
501      return(ideal(0,0));
502   }
503   if(p==var(2)^3)
504   {
505      return(ideal(var(1),p+var(1)^(codimension-1)*var(2)));
506   }
507   if(p==var(1)*var(2)^2)
508   {
509      if(vdim(std(I))==4)
510      {
511         return(ideal(var(1),p+var(2)^4+var(2)^(2*codimension-3)));
512      }
513      if(codimension==5){return(ideal(var(1),p+var(2)^5+var(2)^6));}
514      if(codimension==6){return(ideal(var(1),p+var(2)^5+var(2)^9));}
515      if(codimension==7){return(ideal(var(1),p+var(2)^5));}
516      return(ideal(0,0));
517   }
518   if(p==var(1)^2*var(2))
519   {
520      if(codimension==3){return(ideal(var(1),p+var(2)^3));}
521      if(codimension==5){return(ideal(var(1),p+var(2)^4+var(2)^5));}
522      if(codimension==6){return(ideal(var(1),p+var(2)^4));}
523      return(ideal(0,0));
524   }
525   return(ideal(0,0));
526}
527example
528{
529  "EXAMPLE"; echo=2;
530   ring R=0,(x,y),(c,ds);
531   poly f1=x;
532   poly f2=xy+y5+y7;
533   poly f11=f1+f2*f1;
534   poly f22=f2+f1^2;
535   map phi=basering,x+y,y+y2;
536   f1=phi(f11);
537   f2=phi(f22);
538   ideal I=f1,f2;
539   classifySimpleMaps(I);
540}
541///////////////////////////////////////////////////////////////////////////////
542proc classifySimpleMaps1(ideal I)
543"USAGE:   classifySimpleMaps1(I);  I=an ideal with 2 generators in a polynomial
544         ring with 2 variables and local ordering defining a map germ C^2 to C^2
545COMPUTE:  The normal form of the germ in Riegers classification if it is
546          simple
547RETURN:   normal form of I, of type ideal
548NOTE:     If I is not simple it returns (0,0)
549EXAMPLE:  example classifySimpleMaps1; shows an example"
550{
551   if(size(jet(I,1))==0){return(ideal(0,0));}
552   list L=coDimMap(I,1);
553   int determinacy=L[1];
554   int c=L[2];
555   if(determinacy<0){return(ideal(0,0));}
556   I=normalMap(I,determinacy);
557   int m =vdim(std(I));
558   int mu=vdim(std(jacob(diff(I[2],var(2)))));
559
560   if((mu==-1)&&(m>=2)){return(ideal(0,0));}
561   if(m==1){return(maxideal(1));}
562
563   if(mu==0)
564   {
565      if(m==2){return(ideal(var(1),var(2)^2));}
566      if(m==3){return(ideal(var(1),var(1)*var(2)+var(2)^3));}
567      if(m==4){return(ideal(var(1),var(1)*var(2)+var(2)^4));}
568      if(m==5)
569      {
570        if(c==4)
571        {
572           return(ideal(var(1),var(1)*var(2)+var(2)^5+var(2)^7));
573        }
574        if(c==5)
575        {
576           return(ideal(var(1),var(1)*var(2)+var(2)^5));
577        }
578      }
579      return(ideal(0,0));
580   }
581   if(mu==1)
582   {
583      if(m==3){return(ideal(var(1),var(1)^2*var(2)+var(2)^3));}
584      if(m==4){return(ideal(var(1),var(1)*var(2)^2+var(2)^4+var(2)^(2*c-3)));}
585      if(m==5)
586      {
587        if(c==5)
588        {
589           return(ideal(var(1),var(1)*var(2)^2+var(2)^5+var(2)^6));
590        }
591        if(c==6)
592        {
593           return(ideal(var(1),var(1)*var(2)^2+var(2)^5+var(2)^9));
594        }
595        if(c==7)
596        {
597           return(ideal(var(1),var(1)*var(2)^2+var(2)^5));
598        }
599      }
600      return(ideal(0,0));
601    }
602   if(mu==2)
603   {
604      if(m==3){return(ideal(var(1),var(2)^3+var(1)^3*var(2)));}
605      if(m==4)
606      {
607        if(c==5)
608        {
609           return(ideal(var(1),var(1)^2*var(2)+var(2)^4+var(2)^5));
610        }
611        if(c==6)
612        {
613           return(ideal(var(1),var(1)^2*var(2)+var(2)^4));
614        }
615      }
616      return(ideal(0,0));
617    }
618   if(mu>2)
619   {
620      if(m==3)
621      {
622         return(ideal(var(1),var(2)^3+var(1)^(c+1)*var(2)));
623      }
624      return(ideal(0,0));
625   }
626   return(ideal(0,0));
627}
628example
629{
630  "EXAMPLE"; echo=2;
631   ring R=0,(x,y),(c,ds);
632   poly f1=x;
633   poly f2=xy+y5+y7;
634   poly f11=f1+f2*f1;
635   poly f22=f2+f1^2;
636   map phi=basering,x+y,y+y2;
637   f1=phi(f11);
638   f2=phi(f22);
639   ideal I=f1,f2;
640   classifySimpleMaps1(I);
641}
642///////////////////////////////////////////////////////////////////////////////
643proc modVStd0(module M, module N, ideal I, int bound)
644"USAGE:   modVStd0((M, N, I,bound, #); M is a submodule
645          in A^r over the basering=:A, N ist a submodule in R^r over the subring
646          R of the basering genrated by the entries of I
647COMPUTE:  a standard basis of M+N+maxideal(bound)*A^r using the parallel modular
648          version
649RETURN:   a list whose ist entry gives a list where each entry is a  genrator of
650          standard basis and second entry gives a list of generators after the
651          reduced echelon form
652NOTE:     if # is not empty the bound is corrected by computing determinacy
653EXAMPLE:  example modVStd0; shows an example"
654{
655    /* call modular() */
656    if (size(M) > 1) {
657        list W = modular("vStd", list(M, N, I, bound),
658            Modular::primeTest_default, deleteUnluckyPrimesM0,
659            pTestSBM0, finalTestM0);
660        attrib(W[1], "isSB", 1);
661    }
662    else {
663        module L = modular("vStd_size1", list(M, N, I, bound),
664            Modular::primeTest_default, Modstd::deleteUnluckyPrimes_std,
665            pTestSBM0_size1, finalTestM0_size1);
666        attrib(M, "isSB", 1);
667        list W = list(M, L);
668    }
669
670    /* return the result */
671    return(W);
672}
673example
674{
675  "EXAMPLE"; echo=2;
676   ring R=0,(x,y),(c,ds);
677   poly f1=x;
678   poly f2=xy+y5+y7;
679   poly f11=f1+f2*f1;
680   poly f22=f2+f1^2;
681   map phi=basering,x+y,y+y2;
682   f1=phi(f11);
683   f2=phi(f22);
684   ideal I=f1,f2;
685   module M=maxideal(1)*jacob(I);
686   module N=I*freemodule(2);
687   modVStd0(M,N,I,15);
688}
689///////////////////////////////////////////////////////////////////////////////
690proc modVStd(module M, module N, ideal I,int bound,list #)
691"USAGE:   modVStd((M, N, I,bound, #); M is a submodule
692          in A^r over the basering=:A, N ist a submodule in R^r over the subring
693          R of the basering genrated by the entries of I
694COMPUTE:  a standard basis of A^r/M+N+maxideal(bound)*A^r using modular version
695RETURN:   a list whose ist entry gives a list where each entry is a  genrator of
696          standard basis and second entry gives a list of generators after the
697          reduced echelon form
698NOTE:     if # is not empty the bound is corrected by computing determinacy
699EXAMPLE:  example modVStd; shows an example"
700{
701//---------------------------- initialisation --------------------------------
702   int np=10;
703   bigint H;
704   if(size(#)>0){np=#[1];}
705   list P=2134567879;
706   int j,cc;
707   def R0 = basering;
708   module L;
709   module M0=M;
710   module N0=N;
711   list T1,T2,L1,L2;
712   list rl = ringlist(R0);
713
714   while(1)
715   {
716      cc=timer;
717      for(j = 1; j <= np; j++)
718      {
719         P[size(P)+1]=prime(P[size(P)]-1);
720      }
721      for(j = 1; j <= size(P); j++)
722      {
723         rl[1] = P[j];
724         def @r = ring(rl);
725         setring @r;
726         ideal I  = fetch(R0,I);
727         module M = fetch(R0,M0);
728         module N = fetch(R0,N0);
729         list W = vStd(M,N,I,bound);
730         setring R0;
731         list W = fetch(@r,W);
732         T1[j]=W[1];
733         T2[j]=W[2];
734         kill W;
735         kill @r;
736      }
737      L1 = deleteUnluckyPrimesM(T1,P);
738      L2 = deleteUnluckyPrimesM(T2,P);
739      if(size(M0)>1)
740      {
741         H=1;
742         for(j = 1; j <= size(L1[2]); j++)
743         {
744            H = H*L1[2][j];
745         }
746         M=  chinrem(L1[1],L1[2]);
747         M = farey(M,H);
748         attrib(M,"isSB",1);
749      }
750      else
751      {
752         M=M0;
753      }
754      H=1;
755      for(j = 1; j <= size(L2[2]); j++)
756      {
757         H = H*L2[2][j];
758      }
759      L=  chinrem(L2[1],L2[2]);
760      L = farey(L,H);
761
762      if(pTestSBM(M0,N0,I,M,L,P,bound))
763      {
764         //int bb=timer;
765         if(finalTestM(M0,N0,I,M,L,bound))
766         {
767          // "time for final test";timer-bb;
768           return(list(M,L));
769         }
770         // "time for final test";timer-bb;
771        // "final test failed";
772      }
773     // "pTest failed";size(P);
774   }
775}
776example
777{
778  "EXAMPLE"; echo=2;
779   ring R=0,(x,y),(c,ds);
780   poly f1=x;
781   poly f2=xy+y5+y7;
782   poly f11=f1+f2*f1;
783   poly f22=f2+f1^2;
784   map phi=basering,x+y,y+y2;
785   f1=phi(f11);
786   f2=phi(f22);
787   ideal I=f1,f2;
788   module M=maxideal(1)*jacob(I);
789   module N=I*freemodule(2);
790   modVStd(M,N,I,15);
791}
792///////////////////////////////////////////////////////////////////////////////
793static proc deleteUnluckyPrimesM(list T, list L)
794{
795   int j,k,c;
796   intvec hl,hc;
797   module cT,lT,cK;
798   lT = lead(T[size(T)]);
799   attrib(lT,"isSB",1);
800      for(j = 1; j < size(T); j++)
801      {
802         cT = lead(T[j]);
803         attrib(cT,"isSB",1);
804         if((size(reduce(cT,lT))!=0)||(size(reduce(lT,cT))!=0))
805         {
806            cK = cT;
807            c++;
808         }
809      }
810      if(c > size(T) div 2){ lT = cK; }
811
812   int addList;
813   j = 1;
814   attrib(lT,"isSB",1);
815   while((j <= size(T))&&(c > 0))
816   {
817      cT = lead(T[j]);
818      attrib(cT,"isSB",1);
819      if((size(reduce(cT,lT)) != 0)||(size(reduce(lT,cT)) != 0))
820      {
821         T = delete(T,j);
822         if(j == 1)
823         {
824            L = L[2..size(L)];
825            if(addList == 1) { M = M[2..size(M)]; }
826         }
827         else
828         {
829            if(j == size(L))
830            {
831               L = L[1..size(L)-1];
832               if(addList == 1) { M = M[1..size(M)-1]; }
833            }
834            else
835            {
836               L = L[1..j-1],L[j+1..size(L)];
837               if(addList == 1) { M = M[1..j-1],M[j+1..size(M)]; }
838            }
839         }
840         j--;
841      }
842      j++;
843   }
844
845   for(j = 1; j <= size(L); j++)
846   {
847      L[j] = bigint(L[j]);
848   }
849
850   if(addList == 0) { return(list(T,L,lT)); }
851   if(addList == 1) { return(list(T,L,M,lT)); }
852}
853
854static proc deleteUnluckyPrimesM0(alias list modresults)
855{
856    list T1, T2;
857    int i;
858    for (i = size(modresults); i > 0; i--) {
859        T1[i] = modresults[i][1];
860        T2[i] = modresults[i][2];
861    }
862    list indices1 = Modstd::deleteUnluckyPrimes_std(T1);
863    list indices2 = Modstd::deleteUnluckyPrimes_std(T2);
864    return(indices1+indices2);
865}
866
867///////////////////////////////////////////////////////////////////////////////
868static proc pTestSBM(module M0, module N0, ideal I, module M, module L, list P,
869int bound)
870{
871   int i,j,k,p;
872   def R0 = basering;
873   list r = ringlist(R0);
874
875   while(!j)
876   {
877      j = 1;
878      p = prime(random(1000000000,2134567879));
879      for(i = 1; i <= size(P); i++)
880      {
881         if(p == P[i]) { j = 0; break; }
882      }
883
884   }
885   r[1] = p;
886   def @R = ring(r);
887   setring @R;
888   ideal I  = fetch(R0,I);
889   module M0 = fetch(R0,M0);
890   module N0 = fetch(R0,N0);
891   list W = vStd(M0,N0,I,bound);
892   module M = fetch(R0,M);
893   module L = fetch(R0,L);
894   attrib(M,"isSB",1);
895   attrib(L,"isSB",1);
896   j=size(reduce(W[1],M))+size(reduce(W[2],L));
897   setring R0;
898   return(!j);
899}
900///////////////////////////////////////////////////////////////////////////////
901static proc pTestSBM0(string command, alias list args, def result, int p)
902{
903    def R0 = basering;
904    list r = ringlist(R0);
905    r[1] = p;
906    def @R = ring(r);
907    setring @R;
908    list args = fetch(R0, args);
909    list W = vStd(args[1..4]);
910    def result = fetch(R0, result);
911    attrib(result[1],"isSB",1);
912    attrib(result[2],"isSB",1);
913    int j=size(reduce(W[1],result[1]))+size(reduce(W[2],result[2]));
914    setring R0;
915    return(!j);
916}
917///////////////////////////////////////////////////////////////////////////////
918
919static proc pTestSBM0_size1(string command, alias list args, def result, int p)
920{
921    // adjusted copy of pTestSBM0() for the case size(args[1]) <= 1
922    def R0 = basering;
923    list r = ringlist(R0);
924    r[1] = p;
925    def @R = ring(r);
926    setring @R;
927    list args = fetch(R0, args);
928    module L = vStd_size1(args[1..4]);
929    def result = fetch(R0, result);
930    attrib(result,"isSB",1);
931    int j = size(reduce(L, result));
932    setring R0;
933
934    return(!j);
935}
936///////////////////////////////////////////////////////////////////////////////
937static proc finalTestM(module M0, module N0, ideal I, module M, module L,
938int bound)
939{
940   attrib(M,"isSB",1);
941   int a=size(myReduceM(M0,M,bound));
942   int b=testSBM(M,bound);
943   int c=size(reduceV(M,myReduceM(N0,M,bound),L,bound));
944   return(!(a+b+c));
945}
946///////////////////////////////////////////////////////////////////////////////
947static proc testSBM(module M, int bound)
948{
949   int i,j;
950   vector f;
951   for(i=1;i<size(M);i++)
952   {
953      for(j=i+1;j<=size(M);j++)
954      {
955         f=jet(spoly(M[i],M[j],1),bound);
956         f=myReduce(f,M,bound);
957         if(f!=0){return(1);}
958      }
959   }
960   return(0);
961}
962///////////////////////////////////////////////////////////////////////////////
963static proc finalTestM0(string command, alias list args, def result)
964{
965    attrib(result[1], "isSB", 1);
966    if (size(myReduceM(args[1], result[1], args[4]))) {
967        return(0);
968    }
969    if(testSBM(result[1],args[4])){return(0);}
970    if (size(reduceV(result[1], myReduceM(args[2], result[1], args[4]),
971        result[2], args[4]))) {
972        return(0);
973    }
974    return(1);
975}
976///////////////////////////////////////////////////////////////////////////////
977static proc finalTestM0_size1(string command, list args, def result)
978{
979    attrib(args[1], "isSB", 1);
980    if (size(reduceV(args[1], myReduceM(args[2], args[1], args[4]),
981        result, args[4]))) {
982        return(0);
983    }
984    return(1);
985}
986///////////////////////////////////////////////////////////////////////////////
987static proc normalMap(ideal I, int bound)
988"USAGE:    normalMap(I);  I=f1,f2 in K[x,y]
989 RETURN:   (0,0) if jet(I,1)=0
990           (x,h) A-equivalent to I modulo <x,y>^bound+1
991           if ord(h)=1 then h=y
992           if ord(h)=2 then h=xy+y^m(I)+h.o.t.if m(I)>=3 or (x,y^2)
993           if ord(h)=3 milnor(diff(h,y))=1 and m(I)>3 then h=xy2+y^m(I)+h.o.t.
994           if ord(h)=4 and m(I)=4 then h=y^4+a*x^3y+b*x^2y^2+h.o.t.
995           m(I)=vdim(std(I))
996 NOTE: the procedure is designed for simple and unimodular maps
997"
998{
999   I=jet(I,bound);
1000   //the trivial cases
1001   if(size(jet(I,1))==0){return(ideal(0,0));}
1002   if(vdim(std(jet(I,1)))==1){return(maxideal(1));}
1003   if(vdim(std(I))==2){I=var(1),var(2)^2;return(I);}
1004
1005   def R=basering;
1006   map phi;
1007   poly p;
1008   int i;
1009
1010   //transformation to (x,h)
1011   if(jet(I[1],1)==0){p=I[1];I[1]=I[2];I[2]=p;}
1012   I[1]=simplify(I[1],1);
1013   if(lead(I[1])==var(2)){phi=R,var(2),var(1);}
1014   else{phi=R,var(1)-I[1][2],var(2);}
1015   I=phi(I);
1016   while(I[1]!=var(1))
1017   {
1018      phi=R,2*var(1)-I[1],var(2);
1019      I=jet(phi(I),bound);
1020   }
1021   while((leadmonom(I[2])==var(1))||(leadmonom(I[2])==var(1)^2)||(leadmonom(I[2]
1022   )==var(1)^3)||(leadmonom(I[2])==var(1)^4))
1023   {
1024      I[2]=I[2]-lead(I[2]);
1025   }
1026   I[2]=simplify(I[2],1);
1027   if(deg(lead(I[2]))>=5){return(I);}
1028
1029   //special treatment of h
1030   //the case ord(h)=4
1031   if(deg(lead(I[2]))==4)
1032   {
1033      if(vdim(std(I))>4){return(I);}
1034      def S=changevar("var(2),var(1)",R);
1035      setring S;
1036      map psi=R,var(2),var(1);
1037      ideal I=psi(I);
1038      I[2]=simplify(I[2],1);
1039      if(leadmonom(I[2][2])==var(1)^3*var(2))
1040      {
1041         map sigma=S,var(1)-1/4*leadcoef(I[2][2])*var(2),var(2);
1042         I=sigma(I);
1043         setring R;
1044         map lambda=S,var(2),var(1);
1045         I=lambda(I);
1046         if(leadmonom(I[2])==var(1)^4){I[2]=I[2]-lead(I[2]);}
1047         return(I);
1048      }
1049      else
1050      {
1051         setring R;
1052         return(I);
1053      }
1054   }
1055
1056   //the case ord(h)=3
1057   if(deg(lead(I[2]))==3)
1058   {
1059      phi=R,var(1),var(2)-leadcoef(I[2])/(2*leadcoef(I[2][2]))*var(1);
1060      I=phi(I);
1061   }
1062   while((leadmonom(I[2])==var(1))||(leadmonom(I[2])==var(1)^2)||(leadmonom(I[2]
1063   )==var(1)^3)||(leadmonom(I[2])==var(1)^4))
1064   {
1065      I[2]=I[2]-lead(I[2]);
1066   }
1067   I[2]=simplify(I[2],1);
1068   if(leadmonom(I[2])==var(1)*var(2)^2)
1069   {
1070      while(i<bound)
1071      {
1072         i++;
1073         p=jet(I[2]/(var(1)*var(2))-var(2),i);
1074         phi=R,var(1),var(2)-1/2*p;
1075         I=jet(phi(I),bound);
1076      }
1077   }
1078
1079   //the case ord(h)=2
1080   if(leadmonom(I[2])==var(1)*var(2))
1081   {
1082      while(i<bound)
1083      {
1084         i++;
1085         p=jet(I[2]/var(1)-var(2),i);
1086         phi=R,var(1),var(2)-p;
1087         I=jet(phi(I),bound);
1088      }
1089   }
1090
1091   //all cases
1092   p=lead(I[2])+reduc(I[2]-lead(I[2]),I,bound);
1093   I[2]=p;
1094   if((leadmonom(I[2])==var(1)*var(2))||(leadmonom(I[2])==var(1)*var(2)^2))
1095   {
1096      number a=leadcoef(I[2][2]);
1097      I=subst(I,x,a*x);
1098      I=1/a*I;
1099   }
1100   return(I);
1101}
1102example
1103{
1104  "EXAMPLE"; echo=2;
1105   ring R=0,(x,y),(c,ds);
1106   ideal I1=x,xy2+y6+y7+7y9;
1107   ideal I2=x,xy+y6+y8+77y9;
1108   ideal I3=x,3x4+2x3y+7x2y2+4xy3+11y4;
1109   map phi=R,x+7y+y2,2x+y+y3;
1110   ideal J=phi(I1);
1111   normalMap(J,10);
1112   J=phi(I2);
1113   normalMap(J,10);
1114   J=I3;
1115   normalMap(J,10);
1116}
1117///////////////////////////////////////////////////////////////////////////////
1118proc classifyUnimodalMaps(ideal I)
1119"USAGE:   classifyUnimodalMaps(I);  I an ideal with 2 generators in a polynomial
1120         ring with 2 variables and local ordering defining a map germ C^2 to C^2
1121COMPUTE:  The normal form of the germ in Riegers classification if it is
1122          simple
1123RETURN:   normal form of I, of type ideal
1124NOTE:     If I is not unimodal  it returns (0,0)
1125EXAMPLE:  example classifyUnimodalMaps; shows an example"
1126{
1127   if(size(jet(I,1))==0){return(ideal(0,0));}
1128   list L=coDimMap(I,1);
1129   int determinacy=L[1];
1130   int c=L[2];
1131   if(determinacy<0){return(ideal(0,0));}
1132   I=normalMap(I,determinacy);
1133
1134   poly g=I[2];
1135   int m =vdim(std(I));
1136   int mu=vdim(std(jacob(diff(g,var(2)))));
1137   int d=doubleFoldNumber(g);
1138
1139   if((mu==-1)||((m!=4)&&(m!=6))||(deg(lead(I[2]))>4)){return(ideal(0,0));}
1140
1141   if(m==6)
1142   {
1143      if((mu==0))
1144      {
1145         if(c==6)
1146         {
1147            g=jet(g,9);
1148            I[2]=modulus(g);
1149            return(I);
1150         }
1151         if(c==7){return(ideal(var(1),var(1)*var(2)+var(2)^6+var(2)^14));}
1152         if(c==8){return(ideal(var(1),var(1)*var(2)+var(2)^6));}
1153         return(ideal(0,0));
1154      }
1155      if((mu==1)&&(c==7))
1156      {
1157         g=jet(g,9);
1158         I[2]=modulus(g);
1159         return(I);
1160      }
1161   }
1162   if((mu==4))
1163   {
1164      if(d==3)
1165      {
1166        if(c==7)
1167        {
1168           I[2]=jet(g,4)+var(1)^3*var(2)^2;
1169           return(I);
1170        }
1171        if(c==8)
1172        {
1173           I[2]=jet(g,4)+var(1)^4*var(2)^2;
1174           return(I);
1175        }
1176        if(c==9)
1177        {
1178           I[2]=jet(g,4);
1179           return(I);
1180        }
1181      }
1182      if((c==d+3)&&(d>=4))
1183      {
1184         return(ideal(var(1),var(2)^4+var(1)^2*var(2)^2+var(1)^d*var(2)));
1185      }
1186   }
1187   if((mu==5)&&(c==7)&&(d==3))
1188   {
1189      return(ideal(var(1),var(2)^4+var(1)^3*var(2)-3/2*var(1)^2*var(2)^2+var(1)^3*var(2)^2));
1190   }
1191   if((mu==6)&&(c==8)&&(d==3))
1192   {
1193      return(ideal(var(1),var(2)^4+var(1)^3*var(2)-3/2*var(1)^2*var(2)^2+var(1)^4*var(2)^2));
1194   }
1195   if((mu==c-2)&&(c>=9)&&(d==3))
1196   {
1197      I=ideal(var(1),var(2)^4+var(1)^3*var(2)-3/2*var(1)^2*var(2)^2+var(1)^(c-3)*var(2));
1198      return(I);
1199   }
1200   if((mu==7)&&(c==d+4)&&(d>=5))
1201   {
1202      return(ideal(var(1),var(2)^4+var(1)^3*var(2)^2+var(1)^d*var(2)));
1203   }
1204   if((mu==2*d-2)&&(2*d<=c)&&(c<=3*d)&&((d==4)||(d==5)))
1205   {
1206      return(ideal(var(1),var(2)^4+var(1)^d*var(2)+var(1)^(c-d-1)*var(2)^2));
1207   }
1208   return(ideal(0,0));
1209}
1210example
1211{
1212  "EXAMPLE"; echo=2;
1213   ring R=0,(x,y),(c,ds);
1214   poly f1=x;
1215   poly f2=xy+y6+y9;
1216   poly f11=f1+f2*f1;
1217   poly f22=f2+f1^2;
1218   map phi=basering,x+y,y+y2;
1219   f1=phi(f11);
1220   f2=phi(f22);
1221   ideal I=f1,f2;
1222   classifyUnimodalMaps(I);
1223}
1224///////////////////////////////////////////////////////////////////////////////
1225proc modulus(poly g)
1226// g=xy+y6+h.o.t. or xy2+y6+h.o.t.
1227{
1228   number a,b,c;
1229   matrix m=coef(g,var(2));
1230   if(m[1,1]==var(2)^9)
1231   {
1232      c=leadcoef(m[2,1]);
1233      if(m[1,2]==var(2)^8)
1234      {
1235         b=leadcoef(m[2,2]);
1236         if(m[1,3]==var(2)^7)
1237         {
1238            a=leadcoef(m[2,3]);
1239         }
1240      }
1241      else
1242      {
1243         if(m[1,2]==var(2)^7)
1244         {
1245           a=leadcoef(m[2,2]);
1246         }
1247      }
1248   }
1249   else
1250   {
1251      if(m[1,1]==var(2)^8)
1252      {
1253         b=leadcoef(m[2,1]);
1254         if(m[1,2]==var(2)^7)
1255         {
1256            a=leadcoef(m[2,2]);
1257         }
1258      }
1259      else
1260      {
1261         if(m[1,1]==var(2)^7)
1262         {
1263           a=leadcoef(m[2,1]);
1264         }
1265      }
1266   }
1267   if(leadmonom(g)==var(1)*var(2))
1268   {
1269      if(a!=0)
1270      {
1271         g=var(1)*var(2)+var(2)^6+(5*b-3*a^2)/(5*a^2)*var(2)^8+(25*c+14*a^3-35*a*b)/(25*a^3)*var(2)^9;
1272      }
1273   }
1274   if(leadmonom(g)==var(1)*var(2)^2)
1275   {
1276      if(a!=0)
1277      {
1278         g=var(1)*var(2)^2+var(2)^6+var(2)^7+(4*c*a-5*b)/(4*a^2)*var(2)^9;
1279      }
1280   }
1281   return(g);
1282}
1283///////////////////////////////////////////////////////////////////////////////
1284proc doubleFoldNumber(poly g)
1285"USAGE:   doubleFoldNumber(g) , g poly of 2 variables
1286RETURN:   the double fold number of (x,g(x,y))
1287EXAMPLE:  example doubleFoldNumber; shows an example"
1288{
1289   if(nvars(basering)!=2){ERROR("designed for 2 variables");}
1290   def R=basering;
1291   ring S=0,(x,y,t),ds;
1292   map phi=R,x,y;
1293   poly g=phi(g);
1294   poly h=subst(g,y,y+t);
1295   poly f=diff(g,y);
1296   h=(h-g-t*f)/t2;
1297   ideal I=f,h,diff(h,t);
1298   int d=vdim(std(I)) div 2;
1299   setring R;
1300   return(d);
1301}
1302example
1303{
1304  "EXAMPLE"; echo=2;
1305   ring R=0,(x,y),ds;
1306   poly g=xy+y5+y7;
1307   doubleFoldNumber(g);
1308}
1309///////////////////////////////////////////////////////////////////////////////
1310/*
1311============================== examples of Rieger  ==============
1312
1313ring R=0,(x,y),(c,ds);
1314poly f1=x;
1315
1316poly f2=xy+y3;     //2
1317poly f2=y3+x2y;    //3
1318poly f2=xy+y4;     //3
1319poly f2=xy+y5+y7;  //4
1320poly f2=xy+y5;     //5
1321poly f2=xy2+y4+y5; //4
1322poly f2=xy2+y5+y6; //5
1323poly f2=xy2+y5+y9; //6
1324poly f2=xy2+y5;    //7
1325poly f2=x2y+y4+y5; //5
1326poly f2=x2y+y4;    //6
1327
1328poly f11=f1+f2*f1;
1329poly f22=f2+f1^2;
1330map phi=basering,x+y,y+y2;
1331f1=phi(f11);
1332f2=phi(f22);
1333ideal I=f1,f2;
1334coDimMap(I,1);
1335classifySimpleMaps(I);
1336
1337==================== Examples of Gibson and Hobbs =============
1338
1339ring R=0,t,(c,ds);
1340poly f1=t4;
1341poly f2=t7+t9;
1342poly f3=t17;
1343ideal I=f1,f2,f3;
1344map phi=R,t+2t2+3t3+7t4;
1345I=phi(I);
1346coDimMap(I);
1347
1348ring R=0,t,(c,ds);
1349int k=12;
1350poly f1=t4;
1351poly f2=t6+t^(2*k-7);
1352poly f3=t^(2*k+1);
1353f1=f1+f2*f3;
1354f2=f2+f3^2;
1355f3=f3+f1*f2*f3;
1356ideal I=f1,f2,f3;
1357map phi=R,t+t2+2t3+5t4;
1358I=phi(I);
1359coDimMap(I);
1360
1361ring R=0,t,(c,ds);
1362int k=8;
1363poly f1=t4;
1364poly f2=t6+t^(2*k+1);
1365f1=f1+f2*f1;
1366f2=f2+f1^2;
1367ideal I=f1,f2,0;
1368map phi=R,t+t2+3t3+5t4;
1369I=phi(I);
1370coDimMap(I);
1371
1372ring R=0,t,(c,ds);
1373int k=8;
1374poly f1=t2;
1375poly f2=t^(2*k+1);
1376f1=f1+f2*f1;
1377f2=f2+f1^2;
1378ideal I=f1,f2,0;
1379map phi=R,t+t2+3t3+5t4;
1380I=phi(I);
1381coDimMap(I);
1382
1383ring R=0,t,(c,ds);
1384int k=8;
1385int p=11;
1386poly f1=t3;
1387poly f2=t^(3*k+1)+t^(3*p+2);
1388f1=f1+f2*f1;
1389f2=f2+f1^2;
1390ideal I=f1,f2,0;
1391map phi=R,t+t2+3t3+5t4;
1392I=phi(I);
1393coDimMap(I);
1394
1395============================  more examples ======================
1396
1397ring R=0,t,(c,ds);
1398poly f1=t8;
1399poly f2=t10+t13;
1400poly f3=t12+2t15;
1401f1=f1+231*f2*f1+311*f1*f3+71*f1^2+611*f1*f2*f3;
1402f2=f2+911*f1^2+511*f2*f3+f1^2*f2^2;
1403f3=f3+731*f1*f2*f3+1171*f3^2+f2^3;
1404ideal I=f1,f2,f3;
1405map phi=R,t+t2+3t3+5t4+7t6;
1406I=phi(I);
1407coDimMap(I);
1408
1409ring R=0,t,(c,ds);
1410poly f1=t12;
1411poly f2=t20+t30+t35;
1412f1=f1+231*f2*f1+71*f1^2;
1413f2=f2+911*f1^2+f1^2*f2^2;
1414ideal I=f1,f2;
1415map phi=R,t+t2+3t3+5t4+7t6;
1416I=phi(I);
1417coDimMap(I);
1418
1419ring R=0,t,(c,ds);
1420poly f1=t16;
1421poly f2=t24+t28+t30+t35;
1422f1=f1+231*f2*f1+71*f1^2;
1423f2=f2+911*f1^2+f1^2*f2^2;
1424ideal I=f1,f2;
1425map phi=R,t+t2+3t3+5t4+7t6;
1426I=phi(I);
1427coDimMap(I);
1428
1429ring R=0,t,(c,ds);
1430int k=7;
1431poly f1=t^(8*k);
1432poly f2=t^(10*k)+t^(13*k);
1433poly f3=t^(12*k)+2t^(15*k);
1434poly f4=t101;
1435f1=f1+231*f2*f1+311*f1*f3+71*f1^2+611*f1*f2*f3;
1436f2=f2+911*f1^2+511*f2*f3+f1^2*f2^2;
1437f3=f3+731*f1*f2*f3+1171*f3^2+f2^3;
1438ideal I=f1,f2,f3,f4;
1439map phi=R,t+22t2+323t3+555t4+777t6;
1440I=phi(I);
1441module M=jacob(I);
1442module N=freemodule(ncols(I));
1443list Re=modVStd(M,N,I,250);
1444Re=modVStd0(M,N,I,250);
1445
1446ring R=0,(x,y),(c,ds);
1447ideal I=x,xy2+y5+y9;
1448map phi=R,x+xy4,y+x2+y11;
1449I=phi(I);
1450module M=maxideal(1)*jacob(I);
1451module N=I*freemodule(2);
1452list Re=modVStd(M,N,I,15);
1453
1454 ring R=0,(x,y),(c,ds);
1455 poly f1=x;
1456 poly f2=xy+y5+y7;
1457 poly f11=f1+f2*f1;
1458 poly f22=f2+f1^2;
1459 map phi=basering,x+y,y+y2;
1460 f1=phi(f11);
1461 f2=phi(f22);
1462 ideal I=f1,f2;
1463 map si=R,x+xy3+y11,y+x3+y14+xy17;
1464 I=si(I);
1465 module M=maxideal(1)*jacob(I);
1466 module N=I*freemodule(2);
1467 list Re=modVStd(M,N,I,15);
1468
1469 ring R=0,(x,y),(c,ds);
1470 ideal I=x,x2y+y4;
1471 map phi=R,x+xy4,y+x2+y11;
1472 I=phi(I);
1473 module M=maxideal(1)*jacob(I);
1474 module N=I*freemodule(2);
1475 list Re=modVStd(M,N,I,15);
1476
1477ring R=0,t,(c,ds);
1478int k=5;
1479poly f1=t^(16*k);
1480poly f2=t^(24*k)+t^(28*k)+t^(30*k)+t^(35*k);
1481poly f3=t181;
1482f1=f1+231*f2*f1+71*f1^2;
1483f2=f2+911*f1^2+f1^2*f2^2;
1484f3=f3+f1*f2;
1485ideal I=f1,f2,f3;
1486map phi=R,t+55t2+366t3+577t4+788t6;
1487I=phi(I);
1488module M=jacob(I);
1489module N=freemodule(ncols(I));
1490list Re=modVStd(M,N,I,300);
1491
1492ring R=0,t,(c,ds);
1493int k=7;
1494poly f1=t^(12*k);
1495poly f2=t^(20*k)+t^(30*k)+t^(35*k);
1496poly f3=t139;
1497f1=f1+231*f2*f1+715*f1^2;
1498f2=f2+911*f1^2+4567*f1^2*f2^2;
1499f3=f3+333*f1*f2;
1500ideal I=f1,f2;
1501map phi=R,t+22t2+333t3+544t4+755t6+567t7;
1502I=phi(I);
1503module M=jacob(I);
1504module N=freemodule(ncols(I));
1505list Re=modVStd(M,N,I,350);
1506*/
1507
Note: See TracBrowser for help on using the repository browser.