source: git/Singular/LIB/curvepar.lib @ 27d4bb

spielwiese
Last change on this file since 27d4bb was 27d4bb, checked in by Hans Schoenemann <hannes@…>, 14 years ago
format git-svn-id: file:///usr/local/Singular/svn/trunk@13536 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 21.6 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2version="$Id$";
3category="Singularities";
4info="
5LIBRARY:  space_curve.lib
6
7AUTHOR:   Viazovska Maryna, email: viazovsk@mathematik.uni-kl.de
8
9PROCEDURES:
10BlowingUp(f,I,l);          BlowingUp of V(I) at the point 0;
11CurveRes(I);               Resolution of V(I)
12CurveParam(I);             Parametrization of algebraic branches of V(I)
13WSemigroup(X,b);           Weierstrass semigroup of the curve
14";
15
16LIB "sing.lib";
17LIB "primdec.lib";
18LIB "linalg.lib";
19
20//////////////////////////////////////////////////////////////
21//----------Resolution of singular curve--------------------//
22//////////////////////////////////////////////////////////////
23
24proc BlowingUp(poly f,ideal I,list l)
25"USAGE:   BlowingUp(f,I,l);
26          f=poly
27          b=ideal
28          l=list
29
30ASSUME:   The basering is r=0,(x(1..n),a),dp
31          f is an irrreducible polynomial in k[a],
32          I is an ideal of a curve(if we consider a as a parameter)
33
34COMPUTE:  Blowing-up of the curve at point 0.
35
36RETURN:   list C of charts.
37          Each chart C[i] is a list of size 5
38          C[i][1] is an integer j. It shows, which standard chart do we consider.
39          C[i][2] is an irreducible polynomial g in k[a]. It is a minimal polynomial for the new parameter.
40          C[i][3] is an ideal H in k[a].
41                  c_i=F_i(a_new) for i=1..n,
42                  a_old=H[n+1](a_new).
43          C[i][4] is a map teta:k[x(1)..x(n),a]-->k[x(1)..x(n),a] from the new curve to the one one.
44                  x(1)-->x(j)*x(1)
45                  . . .
46                  x(j)-->x(j)
47                  . . .
48                  x(n)-->x(j)*(c_n+x(n))
49          C[i][5] is an ideal J of a new curve. J=teta(I).
50
51EXAMPLE: example BlowingUp; shows an example"
52{
53  def r=basering;
54  int n=nvars(r)-1;
55  ring r1=(0,a),(x(1..n)),ds;
56  number f=leadcoef(imap(r,f));
57  minpoly=f;
58  ideal I=imap(r,I);
59  ideal locI=std(I);
60  ideal J=tangentcone(I);
61
62  setring r;
63  ideal J=imap(r1,J);
64  ideal locI=imap(r1,locI);
65  int i,j,k,ind;
66  list C,C1,Z,Z1;
67  ideal B;
68  poly g,b;
69  ideal F,D,D1,I1,I2;
70  map teta,teta1;
71
72  list w=mlist(l,n);
73
74  for(j=1;j<=n;j++)
75  {
76    B=J;
77    for(i=1;i<j;i++)
78    {
79      B=B+x(w[i]);
80    }
81    B=B+(x(w[j])-1);
82    B=B+f;
83    Z=Z1;
84    if(dim(std(B))==0)
85    {
86      Z=ZeroIdeal(B);
87      for(i=1;i<j;i++)
88      {
89        D[w[i]]=x(w[j])*x(w[i]);
90      }
91      D[w[j]]=x(w[j]);
92      for(i=j+1;i<=n;i++)
93      {
94        D[w[i]]=x(w[j])*x(w[i]);
95      }
96      D[n+1]=a;
97      teta=r,D;
98      I1=teta(locI);
99      I1=reduce(I1,std(f));
100      ind=1;
101      for(i=1;i<=size(I1);i++)
102      {
103        ind=1;
104        while(ind==1)
105        {
106          if(gcd(x(w[j]),I1[i])==x(w[j]))
107          {
108            I1[i]=I1[i]/x(w[j]);
109          }
110          else
111          {ind=0;}
112        }
113      }
114    }
115
116    for(k=1;k<=size(Z);k++)
117    {
118      g=Z[k][1];
119      for(i=1;i<=n;i++){F[i]=Z[k][2][i];}
120      b=Z[k][3];
121      C1[1]=w[j];
122      C1[2]=g;
123      C1[3]=F;
124      for(i=1;i<j;i++)
125      {
126        D[w[i]]=x(w[j])*x(w[i]);
127      }
128      D[w[j]]=x(w[j]);
129      for(i=j+1;i<=n;i++)
130      {
131        D[w[i]]=x(w[j])*(F[w[i]]+x(w[i]));
132      }
133      D[n+1]=Z[k][2][n+1];
134      teta=r,D;
135      C1[4]=D;
136      for(i=1;i<=j;i++)
137      {
138        D1[w[i]]=x(w[i]);
139      }
140      for(i=j+1;i<=n;i++)
141      {
142        D1[w[i]]=F[w[i]]+x(w[i]);
143      }
144      D1[n+1]=a;
145      teta1=r,D1;
146      I2=teta1(I1);
147      I2=reduce(I2,std(g));
148      C1[5]=I2;
149      C=insert(C,C1);
150    }
151  }
152  return(C);
153}
154example
155{ "EXAMPLE:"; echo=2;
156  ring r=0,(x(1..3),a),dp;
157  poly f=a2+1;
158  ideal i=x(1)^2+a*x(2)^3,x(3)^2-x(2);
159  list l=1,3,2;
160  list B=BlowingUp(f,i,l);
161  B;
162}
163
164
165//////////////////////////////////////////////////////////////////////////////////////////
166static proc ZeroIdeal(ideal J)
167"USAGE:   ZeroIdeal(J);
168          J=ideal
169ASSUME:   J is a zero-dimensional ideal in k[x(1),...,x(n)].
170COMPUTE:  Primary decomposition of radical(J). Each prime ideal J[i] has the form:
171          x(1)-f[1](b),...,x(n)-f[n](b),
172          f(b)=0, f irreducible
173          for some b=x(1)*a(1)+...+x(n)*a(n), a(i) in k.
174
175RETURN:   list Z of lists.
176          Each list Z[k] is a list of size 3
177          Z[k][1] is a poly f(b)
178          Z[k][2] is an ideal H, H[n]=f[n],
179          Z[k][3] is a poly x(1)*a(1)+...+x(n)*a(n)
180"
181{
182  def r=basering;
183  int n=nvars(r);
184  if(dim(std(J))!=0){return(0);}
185  ring s=0,(x(1..n)),lp;
186  ideal A,S;
187  int i,j,ind,q;
188  for(i=1;i<=n;i++)
189  {A[i]=x(i);}
190  map phi=r,A;
191  ideal J=phi(J);
192  ideal I=radical(J);
193  list D=zerodec(I);
194  list Z,u;
195  ideal H,T,Di;
196  intvec w,v;
197  map tau;
198  poly h;
199
200  for(i=1;i<=size(D);i++)
201  {
202    option(redSB);
203    ind=0;q=n;
204    while(ind==0 and q>0)
205    {
206      for(j=1;j<=n;j++){T[j]=x(j);}
207      T[q]=x(n);
208      T[n]=x(q);
209      tau=s,T;
210      Di=D[i];
211      S=std(tau(Di));
212      ind=1;
213      v=leadexp(S[1]);
214      if(leadmonom(S[1])!=x(n)^v[n]){ind=0;}
215      for(j=2;j<=n;j++)
216      {
217        if(leadmonom(S[j])!=x(n-j+1)){ind=0;}
218        H[n-j+1]= -S[j]/leadcoef(S[j])+x(n-j+1);
219        v=leadexp(H[n-j+1]);
220        if(leadcoef(H[n-j+1])*leadmonom(H[n-j+1])!=leadcoef(H[n-j+1])*x(n)^v[n])
221        {ind=0;}
222      }
223      if(ind==1)
224      {
225        u[1]=S[1];
226        H[n]=x(n);
227        H[n]=H[q];
228        H[q]=x(n);
229        u[2]=H;
230        u[3]=x(q);
231        Z[i]=u;
232      }
233      q--;
234    }
235    if(ind==0)
236    {
237      vector a;
238      while(ind==0)
239      {
240        h=x(n);
241        for(j=1;j<=n-1;j++){a=a+random(-10,10)*gen(j);h=h+a[j]*x(j);}
242        T=subst(S,x(n),h);
243        option(redSB);
244        T=std(T);
245        ind=1;
246        w=leadexp(T[1]);
247        if(leadmonom(T[1])!=x(n)^w[n]){ind=0;}
248        for(j=2;j<=n;j++)
249        {
250          if(leadmonom(T[j])!=x(n-j+1)){ind=0;}
251          H[n-j+1]= -T[j]/leadcoef(T[j])+x(n-j+1);
252          w=leadexp(H[n-j+1]);
253          if(leadmonom(H[n-j+1])*leadcoef(H[n-j+1])!=leadcoef(H[n-j+1])*x(n)^w[n])
254          {ind=0;}
255        }
256        if(ind==1)
257        {
258          list l;
259          l[1]=T[1];
260          H[n]=x(n);h=x(n);
261          for(j=1;j<=n-1;j++){H[n]=H[n]+a[j]*H[j];h=h-a[j]*x(j);}
262          l[2]=H;
263          l[3]=h;
264          Z[i]=l;
265        }
266      }
267    }
268  }
269  setring r;
270  ideal A;
271  list Z;
272  for(i=1;i<=n;i++)
273  {
274    A[i]=var(i);
275  }
276  map psi=s,A;
277  Z=psi(Z);
278  return(Z);
279}
280
281/////////////////////////////////////////////////////////////////////////////////////////////
282//assume that the basering is k[x(1),...,x(n),a]
283
284static proc main(ideal I,ideal Psi,poly f,list m,list l,list HN)
285{
286  def s=basering;
287  int i,j;
288  list C,C1,C2,C3,l1,m1,HN1;
289  ideal J;
290  map psi;
291
292  if(SmoothTest(I,f)==1)
293  {
294    C2[1]=I;
295    C2[2]=Psi;
296    C2[3]=f;
297    C2[4]=m;
298    C2[5]=l;
299    C2[6]=HN;
300    C[1]=C2;
301  }
302  if(SmoothTest(I,f)==0)
303  {
304    int mm=mmult(I,f);
305    m1=insert(m,mm,size(m));
306    C1=BlowingUp(f,I,l);
307    for(j=1;j<=size(C1);j++)
308    {
309      C2[1]=C1[j][5];
310      J=C1[j][4];
311      psi=s,J;
312      C2[2]=psi(Psi);
313      C2[3]=C1[j][2];
314      C2[4]=m1;
315      l1=insert(l,C1[j][1],size(l));
316      C2[5]=l1;
317      HN1=psi(HN);
318      HN1=insert(HN1,C1[j][3],size(HN1)-1);
319      C2[6]=HN1;
320      C3=main(C2[1],C2[2],C2[3],C2[4],C2[5],C2[6]);
321      C=C+C3;
322    }
323  }
324  return(C);
325}
326
327////////////////////////////////////////////////////////////////////////////////////////////////
328
329static proc SmoothTest(ideal I,poly f)
330//Assume I is a radical ideal of dimension 1 in a ring k[x(1..n),a]
331//Returns 1 if a curve V(I) is smooth at point 0 and returns 0 otherwise
332{
333  int ind,l;
334  def t=basering;
335  int n=nvars(t)-1;
336  ring r1=(0,a),(x(1..n)),dp;
337  number f=leadcoef(imap(t,f));
338  minpoly=f;
339  ideal I=imap(t,I);
340  matrix M=jacob(I);
341  for(l=1;l<=n;l++){M=subst(M,x(l),0);}
342  if(mat_rk(M)==(n-1)){ind=1;}
343  return(ind);
344}
345
346
347////////////////////////////////////////////////////////////////////////////////////////////////
348
349proc CurveRes(ideal I)
350"USAGE:   CurveRes(I);
351          I ideal
352
353ASSUME:   The basering is r=0,(x(1..n))
354          V(I) is a curve with a singular point 0.
355
356COMPUTE:  Resolution of the curve V(I).
357
358RETURN:   a ring R=basering+k[a]
359          Ring R contains a list Resolve
360          Resolve is a list of charts
361          Each Resolve[i] is a list of size 6
362
363          Resolve[i][1] is an ideal J of a new curve. J=teta(I).
364          Resolve[i][2] ideal which represents the map
365                        teta:k[x(1)..x(n),a]-->k[x(1)..x(n),a] from the
366                        new curve to the old one.
367          Resolve[i][3] is an irreducible polynomial g in k[a]. It is a minimal polynomial for the new parameter a.
368          Resolve[i][4] sequence of multiplicities
369          Resolve[i][5] is a list of integers l. It shows, which standard charts we considered.
370          Resolve[i][6] HN matrix
371
372EXAMPLE: example CurveRes; shows an example"
373{
374  def r=basering;
375  int n=nvars(r);
376  ring s=0,(x(1..n),a),dp;
377  ideal A;
378  int i,j;
379  for(i=1;i<=n;i++)
380  {A[i]=x(i);}
381  map phi=r,A;
382  ideal I=phi(I);
383  poly f=a;
384  list l,m;
385  list HN=x(1);
386  ideal psi;
387  for(i=1;i<=n;i++)
388  {psi[i]=x(i);}
389  psi[n+1]=a;
390  list Resolve=main(I,psi,f,m,l,HN);
391  for(i=1;i<=size(Resolve);i++)
392  {
393    Resolve[i][6]=delete(Resolve[i][6],size(Resolve[i][6]));
394  }
395  export(Resolve);
396  return(s);
397}
398example
399{"EXAMPLE:"; echo=2;
400  ring r=0,(x,y,z),dp;
401  ideal i=x2-y3,z2-y5;
402  def s=CurveRes(i);
403  setring s;
404  Resolve;
405}
406
407//////////////////////////////////////////////////////////////////
408
409static proc mlist(list l,int n)
410{
411  list N,M;
412  int i,j;
413  for(i=1;i<=n;i++)
414  {
415    M[i]=i;
416  }
417  N=l+M;
418  for(i=1;i<=size(N)-1;i++)
419  {
420    j=i+1;
421    while(j<=size(N))
422    {
423      if(N[i]==N[j]){N=delete(N,j);}
424      else{j++;}
425    }
426  }
427  return(N);
428}
429
430/////////////////////////////////////////////////////////////////////
431//Assume that the basering is k[x(1..n),a]
432
433static proc mmult(ideal I,poly f)
434{
435  def r=basering;
436  int n=nvars(r)-1;
437  ring r1=(0,a),(x(1..n)),ds;
438  number f=leadcoef(imap(r,f));
439  minpoly=f;
440  ideal I=imap(r,I);
441  int m=mult(std(I));
442  return(m);
443}
444
445//////////////////////////////////////////////////////////////
446//--------Parametrization of smooth curve-------------------//
447//////////////////////////////////////////////////////////////
448
449
450////////////////////////////////////////////////////////////////////////
451//computes jacobian matrix, considering x(1..n) as variables and a(1..m) as parameters
452
453static proc mjacob(ideal I)
454{
455  def r=basering;
456  int n=nvars(r);
457  int k=size(I);
458  matrix M[k][n];
459  int i,j,l;
460  for(i=1;i<=k;i++)
461  {
462    for(j=1;j<=n;j++)
463    {
464      M[i,j]=diff(I[i],x(j));
465      for(l=1;l<=n;l++){M[i,j]=subst(M[i,j],x(l),0);}
466    }
467  }
468  return(M);
469}
470
471
472//////////////////////////////////////////////////////////
473
474static proc mmi(matrix M,int n)
475{
476  ideal l;
477  int k=nrows(M);
478  int i,j;
479  for(i=1;i<=k;i++)
480  {
481    l[i]=0;
482    for(j=1;j<=n;j++)
483    {
484      l[i]=l[i]+x(j)*M[i,j];
485    }
486  }
487  l=std(l);
488  int t=size(l);
489  i=1;
490  int mi=0;
491  while( mi==0 and i<=n-1)
492  {
493    if(diff(l[i],x(n-i))!=0){mi=n-i+1;}
494    else{i++;}
495  }
496  if(mi==0){mi=1;}
497  matrix Mi[k][n-1];
498  for(i=1;i<=k;i++)
499  {
500    for(j=1;j<=mi-1;j++)
501    {
502      Mi[i,j]=M[i,j];
503    }
504    for(j=mi;j<=n-1;j++)
505    {
506      Mi[i,j]=M[i,j+1];
507    }
508  }
509  list lmi=mi,Mi;
510  return(lmi);
511}
512
513
514//////////////////////////////////////////////////////////
515
516static proc mC(matrix Mi,int n)
517{
518  int k=nrows(Mi);
519  ideal c;
520  int i,j;
521  for(i=1;i<=n-1;i++)
522  {
523    c[i]=0;
524    for(j=1;j<=k;j++)
525    {
526      c[i]=c[i]+y(j)*Mi[j,i];
527    }
528  }
529  c=std(c);
530  return(c);
531}
532
533//////////////////////////////////////////////////////////
534
535proc mmF(ideal C, matrix Mi,int n,int k)
536{
537  int s=size(C);
538  intvec mf;
539  int p=0;
540  int t=0;
541  int i, j;
542  int v=0;
543  for(i=s;i>0;i--)
544  {
545    p=t;
546    j=1;
547    while(t==p and p+j<=k)
548    {
549      if(diff(C[i],y(p+j))==0){j++;}
550      if(diff(C[i],y(p+j))!=0){t=p+j;v++;mf[v]=t;}
551    }
552  }
553  matrix B[n-1][n-1];
554  for(i=1;i<=n-1;i++)
555  {
556    for(j=1;j<=n-1;j++)
557    {
558      B[i,j]=Mi[ mf[i],j];
559    }
560  }
561  list mmf=mf,B;
562  return(mmf);
563}
564
565
566/////////////////////////////////////////////////////
567
568static proc cparam(ideal I,poly f,int n,int m,int N)
569{
570  def r=basering;
571  ring s=(0,a),(x(1..n)),lp;
572  number f=leadcoef(imap(r,f));
573  minpoly=f;
574  ideal I=imap(r,I);
575  matrix M=mjacob(I);
576  list l0=mmi(M,n);
577  int mi=l0[1];
578  matrix Mi=l0[2];
579  int k=nrows(Mi);
580  ring q=(0,a),(y(1..k)),lp;
581  number f=leadcoef(imap(r,f));
582  minpoly=f;
583  matrix Mi=imap(s,Mi);
584  ideal D=mC(Mi,n);
585  list l1=mmF(D,Mi,n,k);
586  intvec mf=l1[1];
587  matrix B=l1[2];
588  setring s;
589  matrix B=imap(q,B);
590  matrix C=inverse(B);
591
592  int i,j,l;
593  ideal P;
594  for(i=1;i<mi;i++){P[i]=x(i);}
595  P[mi]=x(n);
596  for(i=1;i<=n-mi;i++){P[mi+i]=x(mi+i-1);}
597  map phi=s,P;
598  ideal I1=phi(I);
599  list X;
600  matrix d[n-1][1];
601  matrix b[n-1][1];
602  ideal Q;
603  map psi;
604  for(i=1;i<=N;i++)
605  {
606    for(j=1;j<=n-1;j++)
607    {
608      d[j,1]=diff(I1[mf[j]],x(n));
609      for(l=1;l<=n;l++){d[j,1]=subst(d[j,1],x(l),0);}
610    }
611    b=-C*d;
612    I1=jet(I1,N-i+2);
613    X[i]=b;
614    for(j=1;j<=n-1;j++){Q[j]=x(n)*(b[j,1]+x(j));}
615    Q[n]=x(n);
616    psi=s,Q;
617    I1=psi(I1);
618    I1=I1/x(n);
619  }
620  list Y=X,mi;
621  setring r;
622  list Y=imap(s,Y);
623  return(Y);
624}
625
626//////////////////////////////////////////////////////////////
627//--------Parametrization of singular curve-----------------//
628//////////////////////////////////////////////////////////////
629
630proc CurveParam (ideal I)
631"USAGE:   CurveParam(I);
632          I ideal
633
634ASSUME:   I is an ideal of a curve C with a singular point 0.
635
636COMPUTE:  Parametrization for algebraic branches of the curve C.
637
638RETURN:   list L of size 1.
639          L[1] is a ring ring rt=0,(t,a),ds;
640          Ring R contains a list Param
641          Param is a list of algebraic branches
642          Each Param[i] is a list of size 3
643
644          Param[i][1] is a list of polynomials
645          Param[i][2] is an irredusible polynomial f\in k[a].It is a minimal polynomial for the parameter a.
646          Param[i][3] is an integer b--upper bound for the conductor of Weierstrass semigroup
647
648
649EXAMPLE: example curveparam; shows an example"
650{
651  int i, j,mi,b,k;
652  def s=CurveRes(I);
653  setring s;
654  int n=nvars(s)-1;
655  list Param,l;
656  ideal D,P,Q,T;
657  poly f;
658  map tau;
659  list Z, Y,X;
660  for(j=1;j<=size(Resolve);j++)
661  {
662    b=0;
663    for(k=1;k<=size(Resolve[j][4]);k++)
664    {
665      b=b+Resolve[j][4][k]*(Resolve[j][4][k]+1);
666    }
667    if(b==0){b=1;}
668    Y=cparam(Resolve[j][1],Resolve[j][3],n,1,b);
669    X=Y[1];
670    mi=Y[2];
671    f=Resolve[j][3];
672    for(i=1;i<mi;i++)
673    {
674      P[i]=0;
675      for(k=1;k<=b;k++){P[i]=P[i]+X[k][i,1]*(x(1)^k);}
676    }
677    P[mi]=x(1);
678    for(i=mi+1;i<=n;i++)
679    {
680      P[i]=0;
681      for(k=1;k<=b;k++){P[i]=P[i]+X[k][i-1,1]*(x(1)^k);}
682    }
683    P[n+1]=a;
684    tau=s,P;
685    T=Resolve[j][2];
686    Q=tau(T);
687    for(i=1;i<=n;i++){Z[i]=jet(reduce(Q[i],std(f)),b+1);}
688    l[1]=Z;
689    l[2]=f;
690    l[3]=b;
691    Param[j]=l;
692  }
693  ring rt=0,(t,a),ds;
694  ideal D;
695  D[1]=t;
696  D[n+1]=a;
697  map delta=s,D;
698  list Param=delta(Param);
699  export(Param);
700  return(rt);
701}
702
703example
704{"EXAMPLE:";echo=2;
705  ring r=0,(x,y,z),dp;
706  ideal i=x2-y3,z2-y5;
707  def s=CurveParam(i);
708  setring s;
709  Param;
710  ring r=0,(x,y,z),dp;
711  ideal i=x2-y3,z2-y5;
712  def s=CurveParam(i);
713  setring s;
714  Param;
715}
716
717///////////////////////////////////////////////////////////////////////////////////////////
718//----------Computation of Weierstrass Semigroup from parametrization--------------------//
719///////////////////////////////////////////////////////////////////////////////////////////
720
721proc Semi(intvec G,int b)
722"USAGE:   Semi(G,b);
723          G=intvec
724          b=int
725
726ASSUME:   G[1]<=G[2]<=...<=G[k],
727
728COMPUTE:  elements of semigroup S generated by the enteries of G till the bound b.
729          For each element i of S computes the list of integer vectors v of dimension
730          k=size(G), such that g[1]*v[1]+g[2]*v[2]+...+g[k]*v[k]=i. If there exists
731          conductor  of semigroup S  c<b-n, where n is minimal element of G, then
732          computes also c+n.
733
734RETURN:   list M of size 2.
735          L=M[1] is a list  of size min(b,c+n).
736          L[i] is a list of integer vectors.
737          If i is not in a semigroup S than L[i] is empty.
738          M[2] is an integer =min(b,c+n)
739          M[3] minimal generators of S
740"
741{
742  list L,l;
743  int i,j,t,q;
744  for(i=1;i<=b;i++){L[i]=l;}
745  int k=size(G);
746  int n=G[1];
747  int c=0;
748  intvec w,v;
749  for(i=1;i<=k;i++)
750  {
751    for(j=1;j<=k;j++)
752    {
753      if(j==i){w[j]=1;}
754      else{w[j]=0;}
755    }
756    L[G[i]]=insert(L[G[i]],w);
757  }
758  list L1=L;
759  int s=0;
760  int s1=0;
761  i=1;
762  int p;
763  while(i<=b and s<n)
764  {
765    for(j=1;j<=k;j++)
766    {
767      if(i-G[j]>0)
768      {
769        if(size(L[i-G[j]])>0)
770        {
771          for(t=1;t<=size(L[i-G[j]]);t++)
772          {
773            v=L[i-G[j]][t];
774            p=1;
775            for(q=1;q<j;q++)
776            {
777              if(v[q]>0){p=0;}
778            }
779            if(p==1){v[j]=v[j]+1;L[i]=insert(L[i],v);}
780          }
781        }
782      }
783    }
784    if(size(L[i])>0){s1=1;}
785    s=s1*(s+1);
786    s1=0;
787    i++;
788  }
789  intvec Gmin;
790  int jmin=1;
791  for(j=1;j<=k;j++)
792  {
793    if(size(L[G[j]])==size(L1[G[j]]))
794    {
795      Gmin[jmin]=G[j];
796      L1[G[j]]=insert(L1[G[j]],0);
797      jmin++;
798    }
799  }
800  list M=L,i-1,Gmin;
801  return(M);
802}
803
804///////////////////////////////////////////////////////////////////////////////////////////
805static proc AddElem(list L,int b,int k,int g,int n)
806"ASSUME:  L list of size b. L[i] list of integer vectors of dimension k.
807          b=int
808          k=int as above
809          g=int new generator
810          n=int. minimal generator
811
812RETURN: list M
813        M[1]=new L;
814        M[2]=new b;"
815{
816  int i,j;
817  intvec v;
818  for(i=1;i<=b;i++)
819  {
820    if(size(L[i])>0)
821    {
822      for(j=1;j<=size(L[i]);j++)
823      {
824        v=L[i][j];
825        v[k+1]=0;
826        L[i][j]=v;
827      }
828    }
829  }
830  intvec w;
831  w[k+1]=1;
832  L[g]=insert(L[g],w);
833  int s=0;
834  int s1=0;
835  i=1;
836  while(i<=b and s<n)
837  {
838    if(i-g>0)
839    {
840      if(size(L[i-g])>0)
841      {
842        for(j=1;j<=size(L[i-g]);j++)
843        {
844          v=L[i-g][j];
845          v[k+1]=v[k+1]+1;
846          L[i]=insert(L[i],v);
847        }
848      }
849    }
850    if(size(L[i])>0){s1=1;}
851    s=s1*(s+1);
852    s1=0;
853    i++;
854  }
855  int b1=i-1;
856  list M=L,b1;
857  return(M);
858}
859
860///////////////////////////////////////////////////////////////////////////////////////////
861proc WSemigroup(list X,int b0)
862"USAGE:    WSemigroup(X,b0);
863           X a list of polinomials in one vaiable, say t.
864           b0 an integer
865
866COMPUTE:   Weierstrass semigroup of space curve C,which is given by a parametrization X[1](t),...,X[k](t), till the bound b0.
867
868ASSUME:    b0 is greater then conductor
869
870RETURN:    list M of size 5.
871           M[1]= list of integers, which are minimal generators set of the Weierstrass semigroup.
872           M[2]=integer, conductor of the Weierstrass semigroup.
873           M[3]=intvec, all elements of the Weierstrass semigroup till some bound b,
874           which is greather than conductor.
875
876
877
878
879WARNING:   works only over the ring with one variable with ordering ds
880
881EXAMPLE: example WSemigroup; shows an example"
882{
883  int k=size(X);
884  intvec G;
885  int i,i2,g;
886  poly t=var(1);
887  poly h;
888  for(i=1;i<=k;i++)
889  {
890    G[i]=ord(X[i]);
891  }
892  for(i=1;i<k;i++)
893  {
894    for(i2=i;i2<=k;i2++)
895    {
896      if(G[i]>G[i2])
897      {
898        g=G[i];G[i]=G[i2];G[i2]=g;
899        h=X[i];X[i]=X[i2];X[i2]=h;
900      }
901    }
902  }
903  list U=Semi(G,b0);
904  list L=U[1];
905  int b=U[2];
906  G=U[3];
907  int k1=size(G);
908  list N, l;
909  for(i=1;i<=b;i++){N[i]=l;}
910  int j;
911  for(j=b0;j>b;j--){L=delete(L,j);}
912  poly p;
913  int s, e;
914  for(i=1;i<=b;i++)
915  {
916    for(j=1;j<=size(L[i]);j++)
917    {
918      p=1;
919      for(s=1;s<=k;s++)
920      {
921        for(e=1;e<=L[i][j][s];e++)
922        {
923          p=p*X[s];
924          p=jet(p,b);
925        }
926      }
927      N[i]=insert(N[i],p);
928    }
929  }
930  int j1, j2,m,b1,q,i1;
931  list M;
932  poly c1, c2, f;
933  ideal I;
934  matrix C, C1;
935  i=1;
936  while(i<=b)
937  {
938    for(j1=2;j1<=size(N[i]);j1++)
939    {
940      for(j2=1;j2<j1;j2++)
941      {
942        c1=coeffs(N[i][j1],t)[i+1,1];
943        c2=coeffs(N[i][j2],t)[i+1,1];
944        f=c2*N[i][j1]-c1*N[i][j2];
945        m=ord(f);
946        if(m>=0)
947        {
948          if(size(N[m])==0)
949          {
950            N[m]=insert(N[m],f);
951            if(size(L[m])==0)
952            {
953              M=AddElem(L,b,k,m,G[1]);
954              L=M[1];
955              b1=M[2];
956              G[k1+1]=m;
957              X[k+1]=f;
958              N[m]=insert(N[m],f);
959              k=k+1;
960              k1=k1+1;
961              if(b1<b)
962              {
963                for(i1=1;i1<=b1;i1++)
964                {
965                  for(s=1;s<=size(N[i1]);s++){N[i1][s]=jet(N[i1][s],b1);}
966                }
967                for(s=size(N);s>b1;s--){N=delete(N,s);}
968                for(s=size(L);s>b1;s--){L=delete(L,s);}
969              }
970              b=b1;
971            }
972          }
973          else
974          {
975            for(q=1;q<=size(N[m]);q++){I[q]=N[m][q];}
976            I[size(N[m])+1]=f;
977            C=coeffs(I,t);
978            C1=gauss_col(C);
979            if(C1[size(N[m])+1]!=0){N[m]=insert(N[m],f);}
980          }
981        }
982      }
983    }
984    i++;
985  }
986  intvec S;
987  j=1;
988  for(i=1;i<=b;i++)
989  {
990    if(size(L[i])>0){S[j]=i;j++;}
991  }
992  U=Semi(G,b);
993  G=U[3];
994  list Q=G,b-G[1]+1,S;
995  return(Q);
996}
997example
998{"EXAMPLE:";echo=2;
999  ring r=0,(t),ds;
1000  list X=t4,t5+t11,t9+2*t7;
1001  list L=WSemigroup(X,30);
1002  L;
1003}
1004
1005////////////////////////////////////////////////////////////////////////////////////////////
1006/*
1007LIB"spacecurve.lib";
1008
1009ring r=0,(x,y,z),dp;
1010ideal i=x2-y3,z2-y5;
1011def s=CurveParam(i);
1012setring s;
1013Param;
1014
1015ring r=0,(t),ds;
1016list X=t4,t5+t11,t9+2*t7;
1017list L=WSemigroup(X,30);
1018L;
1019
1020
1021ring r=0,(x,y,z,t),dp;
1022ideal I=x-t4,y-t5-t11,z-t9-2t7;
1023I=eliminate(I,t);
1024ring r1=0,(x,y,z),dp;
1025ideal I=imap(r,I);
1026def s=CurveParam(I);
1027setring s;
1028Param;
1029WSemigroup(Param[1][1],30);
1030
1031ring r=0,(x,y,z),dp;
1032ideal I=(x5-y11)*(x2+(y+1)^3),z;
1033def s=CurveParam(I);
1034setring s;
1035Param;
1036
1037
1038ring r=0,(x,y,z),dp;
1039ideal I=y2-x3-x2,z;
1040def s=CurveParam(I);
1041setring s;
1042Param;
1043setring r;
1044I=intersect(I,ideal(y2-x3,z));
1045s=CurveParam(I);
1046setring s;
1047Param;
1048
1049ring r=0,(x,y,z),dp;
1050ideal I=y2+x3+x2,z;
1051def s=CurveParam(I);
1052setring s;
1053Param;
1054*/
Note: See TracBrowser for help on using the repository browser.