source: git/Singular/LIB/sing.lib @ d2b2a7

spielwiese
Last change on this file since d2b2a7 was d2b2a7, checked in by Kai Krüger <krueger@…>, 25 years ago
Modified Files: libparse.l utils.cc LIB/classify.lib LIB/deform.lib LIB/elim.lib LIB/factor.lib LIB/fastsolv.lib LIB/finvar.lib LIB/general.lib LIB/hnoether.lib LIB/homolog.lib LIB/inout.lib LIB/invar.lib LIB/makedbm.lib LIB/matrix.lib LIB/normal.lib LIB/poly.lib LIB/presolve.lib LIB/primdec.lib LIB/primitiv.lib LIB/random.lib LIB/ring.lib LIB/sing.lib LIB/standard.lib LIB/tex.lib LIB/tst.lib Changed help section o procedures to have an quoted help-string between proc-definition and proc-body. git-svn-id: file:///usr/local/Singular/svn/trunk@1601 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 28.5 KB
Line 
1// $Id: sing.lib,v 1.10 1998-05-05 11:55:38 krueger Exp $
2//system("random",787422842);
3//(GMG/BM, last modified 26.06.96)
4///////////////////////////////////////////////////////////////////////////////
5
6version="$Id: sing.lib,v 1.10 1998-05-05 11:55:38 krueger Exp $";
7info="
8LIBRARY:  sing.lib      PROCEDURES FOR SINGULARITIES
9
10 codim (id1, id2);      vector space dimension of of id2/id1 if finite
11 deform(i);             infinitesimal deformations of ideal i
12 dim_slocus(i);         dimension of singular locus of ideal i
13 is_active(f,id);       is poly f an active element mod id? (id ideal/module)
14 is_ci(i);              is ideal i a complete intersection?
15 is_is(i);              is ideal i an isolated singularity?
16 is_reg(f,id);          is poly f a regular element mod id? (id ideal/module)
17 is_regs(i[,id]);       are gen's of ideal i regular sequence modulo id?
18 milnor(i);             milnor number of ideal i; (assume i is ICIS in nf)
19 nf_icis(i);            generic combinations of generators; get ICIS in nf
20 slocus(i);             ideal of singular locus of ideal i
21 spectrum(f,w);         spectrum numbers of w-homogeneous polynomial f
22 Tjurina(i);            SB of Tjurina module of ideal i (assume i is ICIS)
23 tjurina(i);            Tjurina number of ideal i (assume i is ICIS)
24 T1(i);                 T1-module of ideal i
25 T2((i);                T2-module of ideal i
26 T12(i);                T1- and T2-module of ideal i
27";
28
29LIB "inout.lib";
30LIB "random.lib";
31///////////////////////////////////////////////////////////////////////////////
32
33proc deform (ideal id)
34"USAGE:   deform(id); id=ideal or poly
35RETURN:  matrix, columns are kbase of infinitesimal deformations
36EXAMPLE: example deform; shows an example
37"
38{
39   list L=T1(id,"");
40   def K=L[1]; attrib(K,"isSB",1);
41   return(L[2]*kbase(K));
42}
43example
44{ "EXAMPLE:"; echo = 2;
45   ring r   = 32003,(x,y,z),ds;
46   ideal i  = xy,xz,yz;
47   matrix T = deform(i);
48   print(T);
49   print(deform(x3+y5+z2));
50}
51///////////////////////////////////////////////////////////////////////////////
52
53proc dim_slocus (ideal i)
54"USAGE:   dim_slocus(i);  i ideal or poly
55RETURN:  dimension of singular locus of i
56EXAMPLE: example dim_slocus; shows an example
57"
58{
59   return(dim(std(slocus(i))));
60}
61example
62{ "EXAMPLE:"; echo = 2;
63   ring r  = 32003,(x,y,z),ds;
64   ideal i = x5+y6+z6,x2+2y2+3z2;
65   dim_slocus(i);
66}
67///////////////////////////////////////////////////////////////////////////////
68
69proc is_active (poly f, id)
70"USAGE:   is_active(f,id); f poly, id ideal or module
71RETURN:  1 if f is an active element modulo id (i.e. dim(id)=dim(id+f*R^n)+1,
72         if id is a submodule of R^n) resp. 0 if f is not active.
73         The basering may be a quotient ring
74NOTE:    regular parameters are active but not vice versa (id may have embedded
75         components). proc is_reg tests whether f is a regular parameter
76EXAMPLE: example is_active; shows an example
77"
78{
79   if( size(id)==0 ) { return(1); }
80   if( typeof(id)=="ideal" ) { ideal m=f; }
81   if( typeof(id)=="module" ) { module m=f*freemodule(nrows(id)); }
82   return(dim(std(id))-dim(std(id+m)));
83}
84example
85{ "EXAMPLE:"; echo = 2;
86   ring r   =32003,(x,y,z),ds;
87   ideal i  = yx3+y,yz3+y3z;
88   poly f   = x;
89   is_active(f,i);
90   qring q  = std(x4y5);
91   poly f   = x;
92   module m = [yx3+x,yx3+y3x];
93   is_active(f,m);
94}
95///////////////////////////////////////////////////////////////////////////////
96
97proc is_ci (ideal i)
98"USAGE:   is_ci(i); i ideal
99RETURN:  intvec = sequence of dimensions of ideals (j[1],...,j[k]), for
100         k=1,...,size(j), where j is minimal base of i. i is a complete
101         intersection if last number equals nvars-size(i)
102NOTE:    dim(0-ideal) = -1. You may first apply simplify(i,10); in order to
103         delete zeroes and multiples from set of generators
104         printlevel >=0: display comments (default)
105EXAMPLE: example is_ci; shows an example
106"
107{
108   int n; intvec dimvec; ideal id;
109   i=minbase(i);
110   int s = ncols(i);
111   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
112//--------------------------- compute dimensions ------------------------------
113   for( n=1; n<=s; n=n+1 )
114   {
115      id = i[1..n];
116      dimvec[n] = dim(std(id));
117   }
118   n = dimvec[s];
119//--------------------------- output ------------------------------------------
120   if( n+s != nvars(basering) )
121   { dbprint(p,"// no complete intersection"); }
122   if( n+s == nvars(basering) )
123   { dbprint(p,"// complete intersection of dim "+string(n)); }
124   dbprint(p,"// dim-sequence:");
125   return(dimvec);
126}
127example
128{ "EXAMPLE:"; echo = 2;
129   int p      = printlevel;
130   printlevel = 1;                // display comments
131   ring r     = 32003,(x,y,z),ds;
132   ideal i    = x4+y5+z6,xyz,yx2+xz2+zy7;
133   is_ci(i);
134   i          = xy,yz;
135   is_ci(i);
136   printlevel = p;
137}
138///////////////////////////////////////////////////////////////////////////////
139
140proc is_is (ideal i)
141"USAGE:   is_is(id);  id ideal or poly
142RETURN:  intvec = sequence of dimensions of singular loci of ideals
143         generated by id[1]..id[i], k = 1..size(id); dim(0-ideal) = -1;
144         id defines an isolated singularity if last number is 0
145NOTE:    printlevel >=0: display comments (default)
146EXAMPLE: example is_is; shows an example
147"
148{
149  int l; intvec dims; ideal j;
150  int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
151//--------------------------- compute dimensions ------------------------------
152   for( l=1; l<=ncols(i); l=l+1 )
153   {
154     j = i[1..l];
155     dims[l] = dim(std(slocus(j)));
156   }
157   dbprint(p,"// dim of singular locus = "+string(dims[size(dims)]),
158             "// isolated singularity if last number is 0 in dim-sequence:");
159   return(dims);
160}
161example
162{ "EXAMPLE:"; echo = 2;
163   int p      = printlevel;
164   printlevel = 1;
165   ring r     = 32003,(x,y,z),ds;
166   ideal i    = x2y,x4+y5+z6,yx2+xz2+zy7;
167   is_is(i);
168   poly f     = xy+yz;
169   is_is(f);
170   printlevel = p;
171}
172///////////////////////////////////////////////////////////////////////////////
173
174proc is_reg (poly f, id)
175"USAGE:   is_reg(f,id); f poly, id ideal or module
176RETURN:  1 if multiplication with f is injective modulo id, 0 otherwise
177NOTE:    let R be the basering and id a submodule of R^n. The procedure checks
178         injectivity of multiplication with f on R^n/id. The basering may be a
179         //**quotient ring
180EXAMPLE: example is_reg; shows an example
181"
182{
183   if( f==0 ) { return(0); }
184   int d,ii;
185   def q = quotient(id,ideal(f));
186   id=std(id);
187   d=size(q);
188   for( ii=1; ii<=d; ii=ii+1 )
189   {
190      if( reduce(q[ii],id)!=0 )
191      { return(0); }
192   }
193   return(1);
194}
195example
196{ "EXAMPLE:"; echo = 2;
197   ring r  = 32003,(x,y),ds;
198   ideal i = x8,y8;
199   ideal j = (x+y)^4;
200   i       = intersect(i,j);
201   poly f  = xy;
202   is_reg(f,i);
203}
204///////////////////////////////////////////////////////////////////////////////
205
206proc is_regs (ideal i, list #)
207"USAGE:   is_regs(i[,id]); i poly, id ideal or module (default: id=0)
208RETURN:  1 if generators of i are a regular sequence modulo id, 0 otherwise
209NOTE:    let R be the basering and id a submodule of R^n. The procedure checks
210         injectivity of multiplication with i[k] on R^n/id+i[1..k-1].
211         The basering may be a quotient ring
212         printlevel >=0: display comments (default)
213         printlevel >=1: display comments during computation
214EXAMPLE: example is_regs; shows an example
215"
216{
217   int d,ii,r;
218   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
219   if( size(#)==0 ) { ideal id; }
220   else { def id=#[1]; }
221   if( size(i)==0 ) { return(0); }
222   d=size(i);
223   if( typeof(id)=="ideal" ) { ideal m=1; }
224   if( typeof(id)=="module" ) { module m=freemodule(nrows(id)); }
225   for( ii=1; ii<=d; ii=ii+1 )
226   {
227      if( p>=2 )
228      { "// checking whether element",ii,"is regular mod 1 ..",ii-1; }
229      if( is_reg(i[ii],id)==0 )
230      {
231        dbprint(p,"// elements 1.."+string(ii-1)+" are regular, " +
232                string(ii)+" is not regular mod 1.."+string(ii-1));
233         return(0);
234      }
235      id=id+i[ii]*m;
236   }
237   if( p>=1 ) { "// elements are a regular sequence of length",d; }
238   return(1);
239}
240example
241{ "EXAMPLE:"; echo = 2;
242   int p      = printlevel;
243   printlevel = 1;
244   ring r1    = 32003,(x,y,z),ds;
245   ideal i    = x8,y8,(x+y)^4;
246   is_regs(i);
247   module m   = [x,0,y];
248   i          = x8,(x+z)^4;;
249   is_regs(i,m);
250   printlevel = p;
251}
252///////////////////////////////////////////////////////////////////////////////
253
254proc milnor (ideal i)
255"USAGE:   milnor(i); i ideal or poly
256RETURN:  Milnor number of i, if i is ICIS (isolated complete intersection
257         singularity) in generic form, resp. -1 if not
258NOTE:    use proc nf_icis to put generators in generic form
259         printlevel >=0: display comments (default)
260EXAMPLE: example milnor; shows an example
261"
262{
263  i = simplify(i,10);     //delete zeroes and multiples from set of generators
264  int n = size(i);
265  int l,q,m_nr;  ideal t;  intvec disc;
266  int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
267//---------------------------- hypersurface case ------------------------------
268  if( n==1 or i==0 )
269  {
270     i = std(jacob(i[1]));
271     m_nr = vdim(i);
272     if( m_nr<0 and p>=1 ) { "// no isolated singularity"; }
273     return(m_nr);
274  }
275//------------ isolated complete intersection singularity (ICIS) --------------
276  for( l=n; l>0; l=l-1)
277  {   t      = minor(jacob(i),l);
278      i[l]   = 0;
279      q      = vdim(std(i+t));
280      disc[l]= q;
281      if( q ==-1 )
282      {  if( p>=1 )
283            {  "// not in generic form or no ICIS; use proc nf_icis to put";
284            "// generators in generic form and then try milnor again!";  }
285         return(q);
286      }
287      m_nr = q-m_nr;
288  }
289//---------------------------- change sign ------------------------------------
290  if (m_nr < 0) { m_nr=-m_nr; }
291  if( p>=1 ) { "//sequence of discriminant numbers:",disc; }
292  return(m_nr);
293}
294example
295{ "EXAMPLE:"; echo = 2;
296   int p      = printlevel;
297   printlevel = 1;
298   ring r     = 32003,(x,y,z),ds;
299   ideal j    = x5+y6+z6,x2+2y2+3z2,xyz+yx;
300   milnor(j);
301   poly f     = x7+y7+(x-y)^2*x2y2+z2;
302   milnor(f);
303   printlevel = p;
304}
305///////////////////////////////////////////////////////////////////////////////
306
307proc nf_icis (ideal i)
308"USAGE:   nf_icis(i); i ideal
309RETURN:  ideal = generic linear combination of generators of i if i is an ICIS
310         (isolated complete intersection singularity), return i if not
311NOTE:    this proc is useful in connection with proc milnor
312         printlevel >=0: display comments (default)
313EXAMPLE: example nf_icis; shows an example
314"
315{
316   i = simplify(i,10);  //delete zeroes and multiples from set of generators
317   int p,b = 100,0;
318   int n = size(i);
319   matrix mat=freemodule(n);
320   int P = printlevel-voice+3;  // P=printlevel+1 (default: P=1)
321//---------------------------- test: complete intersection? -------------------
322   intvec sl = is_ci(i);
323   if( n+sl[n] != nvars(basering) )
324   {
325      dbprint(P,"// no complete intersection");
326      return(i);
327   }
328//--------------- test: isolated singularity in generic form? -----------------
329   sl = is_is(i);
330   if ( sl[n] != 0 )
331   {
332      dbprint(P,"// no isolated singularity");
333      return(i);
334   }
335//------------ produce generic linear combinations of generators --------------
336   int prob;
337   while ( sum(sl) != 0 )
338   {  prob=prob+1;
339      p=p-25; b=b+10;
340      i = genericid(i,p,b);          // proc genericid from random.lib
341      sl = is_is(i);
342   }
343   dbprint(P,"// ICIS in generic form after "+string(prob)+" genericity loop(s)");
344   return(i);
345}
346example
347{ "EXAMPLE:"; echo = 2;
348   int p      = printlevel;
349   printlevel = 1;
350   ring r     = 32003,(x,y,z),ds;
351   ideal i    = x3+y4,z4+yx;
352   nf_icis(i);
353   ideal j    = x3+y4,xy,yz;
354   nf_icis(j);
355   printlevel = p;
356}
357///////////////////////////////////////////////////////////////////////////////
358
359proc slocus (ideal i)
360"USAGE:   slocus(i);  i dieal
361RETURN:  ideal of singular locus of i
362NOTE:    this proc considers lower dimensional components as singular
363EXAMPLE: example slocus; shows an example
364"
365{
366  int cod  = nvars(basering)-dim(std(i));
367  i        = i+minor(jacob(i),cod);
368  return(i);
369}
370example
371{ "EXAMPLE:"; echo = 2;
372   ring r  = 32003,(x,y,z),ds;
373   ideal i = x5+y6+z6,x2+2y2+3z2;
374   dim(std(slocus(i)));
375}
376///////////////////////////////////////////////////////////////////////////////
377
378proc spectrum (poly f, intvec w)
379"USAGE:   spectrum(f,w);  f=poly, w=intvec;
380ASSUME:  f is a weighted homogeneous isolated singularity w.r.t. the weights
381         given by w; w must consist of as many positive integers as there
382         are variables of the basering
383COMPUTE: the spectral numbers of the w-homogeneous polynomial f, computed in a
384         ring of charcteristik 0
385RETURN:  intvec  d,s1,...,su  where:
386         d = w-degree(f)  and  si/d = ith spectral-number(f)
387         No return value if basering has parameters or if f is no isolated
388         singularity, displays a warning in this case
389EXAMPLE: example spectrum; shows an example
390"
391{
392   int i,d,W;
393   intvec sp;
394   def r   = basering;
395   if( find(charstr(r),",")!=0 )
396   {
397       "// coefficient field must not have parameters!";
398       return();
399    }
400   ring s  = 0,x(1..nvars(r)),ws(w);
401   map phi = r,maxideal(1);
402   poly f  = phi(f);
403   d       = ord(f);
404   W       = sum(w)-d;
405   ideal k = std(jacob(f));
406   if( vdim(k) == -1 )
407   {
408       "// f is no isolated singuarity!";
409       return();
410    }
411   k = kbase(k);
412   for (i=1; i<=size(k); i++)
413   {
414      sp[i]=W+ord(k[i]);
415   }
416   list L  = sort(sp);
417   sp      = d,L[1];
418   return(sp);
419}
420example
421{ "EXAMPLE:"; echo = 2;
422   ring r;
423   poly f=x3+y5+z2;
424   intvec w=10,6,15;
425   spectrum(f,w);
426   // the spectrum numbers are:
427   // 1/30,7/30,11/30,13/30,17/30,19/30,23/30,29/30
428}
429///////////////////////////////////////////////////////////////////////////////
430
431proc Tjurina (id, list #)
432"USAGE:   Tjurina(id[,<any>]);  id=ideal or poly
433ASSUME:  id=ICIS (isolated complete intersection singularity)
434RETURN:  standard basis of Tjurina-module of id,
435         of type module if id=ideal, resp. of type ideal if id=poly.
436         If a second argument is present (of any type) return a list:
437           [1] = Tjurina number,
438           [2] = k-basis of miniversal deformation,
439           [3] = SB of Tjurina module,
440           [4] = Tjurina module
441DISPLAY: Tjurina number if printlevel >= 0 (default)
442NOTE:    Tjurina number = -1 implies that id is not an ICIS
443EXAMPLE: example Tjurina; shows examples
444"
445{
446//---------------------------- initialisation ---------------------------------
447  def i = simplify(id,10);
448  int tau,n = 0,size(i);
449  if( size(ideal(i))==1 ) { def m=i; }  // hypersurface case
450  else { def m=i*freemodule(n); }       // complete intersection case
451//--------------- compute Tjurina module, Tjurina number etc ------------------
452  def t1 = jacob(i)+m;                  // Tjurina module/ideal
453  def st1 = std(t1);                    // SB of Tjurina module/ideal
454  tau = vdim(st1);                      // Tjurina number
455  dbprint(printlevel-voice+3,"// Tjurina number = "+string(tau));
456  if( size(#)>0 )
457  {
458     def kB = kbase(st1);               // basis of miniversal deformation
459     return(tau,kB,st1,t1);
460  }
461  return(st1);
462}
463example
464{ "EXAMPLE:"; echo = 2;
465   int p      = printlevel;
466   printlevel = 1;
467   ring r     = 0,(x,y,z),ds;
468   poly f     = x5+y6+z7+xyz;        // singularity T[5,6,7]
469   list T     = Tjurina(f,"");
470   show(T[1]);                       // Tjurina number, should be 16
471   show(T[2]);                       // basis of miniversal deformation
472   show(T[3]);                       // SB of Tjurina ideal
473   show(T[4]); "";                   // Tjurina ideal
474   ideal j    = x2+y2+z2,x2+2y2+3z2;
475   show(kbase(Tjurina(j)));          // basis of miniversal deformation
476   hilb(Tjurina(j));                 // Hilbert series of Tjurina module
477   printlevel = p;
478}
479///////////////////////////////////////////////////////////////////////////////
480
481proc tjurina (ideal i)
482"USAGE:   tjurina(id);  id=ideal or poly
483ASSUME:  id=ICIS (isolated complete intersection singularity)
484RETURN:  int = Tjurina number of id
485NOTE:    Tjurina number = -1 implies that id is not an ICIS
486EXAMPLE: example tjurina; shows an example
487"
488{
489   return(vdim(Tjurina(i)));
490}
491example
492{ "EXAMPLE:"; echo = 2;
493   ring r=32003,(x,y,z),(c,ds);
494   ideal j=x2+y2+z2,x2+2y2+3z2;
495   tjurina(j);
496}
497///////////////////////////////////////////////////////////////////////////////
498
499proc T1 (ideal id, list #)
500"USAGE:   T1(id[,<any>]);  id = ideal or poly
501RETURN:  T1(id): of type module/ideal if id is of type ideal/poly.
502         We call T1(id) the T1-module of id. It is a std basis of the
503         presentation of 1st order deformations of P/id, if P is the basering.
504         If a second argument is present (of any type) return a list of
505         3 modules:
506            [1]= T1(id)
507            [2]= generators of normal bundle of id, lifted to P
508            [3]= module of relations of [2], lifted to P
509                 (note: transpose[3]*[2]=0 mod id)
510         The list contains all non-easy objects which must be computed
511         to get T1(id).
512DISPLAY: k-dimension of T1(id) if printlevel >= 0 (default)
513NOTE:    T1(id) itself is usually of minor importance. Nevertheless, from it
514         all relevant information can be obtained. The most important are
515         probably vdim(T1(id)); (which computes the Tjurina number),
516         hilb(T1(id)); and kbase(T1(id));
517         If T1 is called with two argument, then matrix([2])*(kbase([1]))
518         represents a basis of 1st order semiuniversal deformation of id
519         (use proc 'deform', to get this in a direct way).
520         For a complete intersection the proc Tjurina is faster
521EXAMPLE: example T1; shows an example
522"
523{
524   ideal J=simplify(id,10);
525//--------------------------- hypersurface case -------------------------------
526  if( size(J)<2 )
527  {
528     ideal t1  = std(J+jacob(J[1]));
529     module nb = [1]; module pnb;
530     dbprint(printlevel-voice+3,"// dim T1 = "+string(vdim(t1)));
531     if( size(#)>0 )
532     {
533        module st1 = t1*gen(1);
534        attrib(st1,"isSB",1);
535        return(st1,nb,pnb);
536     }
537     return(t1);
538  }
539//--------------------------- presentation of J -------------------------------
540   int rk;
541  def P = basering;
542   module jac, t1;
543   jac  = jacob(J);                 // jacobian matrix of J converted to module
544   res(J,2,A);                      // compute presentation of J
545                                    // A(2) = 1st syzygy module of J
546//---------- go to quotient ring mod J and compute normal bundle --------------
547  qring  R    = std(J);
548   module jac = fetch(P,jac);
549   module t1  = transpose(fetch(P,A(2)));
550   res(t1,2,B);                     // resolve t1, B(2)=(J/J^2)*=normal_bdl
551   t1         = modulo(B(2),jac);   // pres. of normal_bdl/trivial_deformations
552   rk=nrows(t1);
553//-------------------------- pull back to basering ----------------------------
554  setring P;
555   t1 = fetch(R,t1)+J*freemodule(rk);  // T1-module, presentation of T1
556   t1 = std(t1);
557   dbprint(printlevel-voice+3,"// dim T1 = "+string(vdim(t1)));
558   if( size(#)>0 )
559   {
560      module B2 = fetch(R,B(2));        // presentation of normal bundle
561      list L = t1,B2,A(2);
562      attrib(L[1],"isSB",1);
563      return(L);
564   }
565   return(t1);
566}
567example
568{ "EXAMPLE:"; echo = 2;
569   int p      = printlevel;
570   printlevel = 1;
571   ring r     = 32003,(x,y,z),(c,ds);
572   ideal i    = xy,xz,yz;
573   module T   = T1(i);
574   vdim(T);                      // Tjurina number = dim_K(T1), should be 3
575   list L=T1(i,"");
576   module kB  = kbase(L[1]);
577   print(L[2]*kB);               // basis of 1st order miniversal deformation
578   show(L[2]);                   // presentation of normal bundle
579   print(L[3]);                  // relations of i
580   print(transpose(L[3])*L[2]);  // should be 0 (mod i)
581   printlevel = p;
582}
583///////////////////////////////////////////////////////////////////////////////
584
585proc T2 (ideal id, list #)
586"USAGE:   T2(id[,<any>]);  id = ideal
587RETURN:  T2(id): T2-module of id . This is a std basis of a presentation of
588         the module of obstructions of R=P/id, if P is the basering.
589         If a second argument is present (of any type) return a list of
590         4 modules and 1 ideal:
591            [1]= T2(id)
592            [2]= standard basis of id (ideal)
593            [3]= module of relations of id (=1st syzygy module of id)
594            [4]= presentation of syz/kos
595            [5]= relations of Hom_P([3]/kos,R), lifted to P
596         The list contains all non-easy objects which must be computed
597         to get T2(id).
598DISPLAY: k-dimension of T2(id) if printlevel >= 0 (default)
599NOTE:    The most important information is probably vdim(T2(id)).
600         Use proc miniversal to get equations of miniversal deformation.
601EXAMPLE: example T2; shows an example
602"
603{
604//--------------------------- initialisation ----------------------------------
605  def P = basering;
606   ideal J = id;
607   module kos,SK,B2,t2;
608   list L;
609   int n,rk;
610//------------------- presentation of non-trivial syzygies --------------------
611   res(J,2,A);                            // resolve J, A(2)=syz
612   kos  = koszul(2,J);                    // module of Koszul relations
613   SK   = modulo(A(2),kos);               // presentation of syz/kos
614   ideal J0 = std(J);                     // standard basis of J
615//?*** sollte bei der Berechnung von res mit anfallen, zu aendern!!
616//---------------------- fetch to quotient ring mod J -------------------------
617  qring R = J0;                           // make P/J the basering
618   module A2' = transpose(fetch(P,A(2))); // dual of syz
619   module t2  = transpose(fetch(P,SK));   // dual of syz/kos
620   res(t2,2,B);                           // resolve (syz/kos)*
621   t2 = modulo(B(2),A2');                 // presentation of T2
622   rk = nrows(t2);
623//---------------------  fetch back to basering -------------------------------
624  setring P;
625   t2 = fetch(R,t2)+J*freemodule(rk);
626   t2 = std(t2);
627   dbprint(printlevel-voice+3,"// dim T2 = "+string(vdim(t2)));
628   if( size(#)>0 )
629   {
630      B2 = fetch(R,B(2));        // generators of Hom_P(syz/kos,R)
631      L  = t2,J0,A(2),SK,B2;
632      return(L);
633   }
634   return(t2);
635}
636example
637{ "EXAMPLE:"; echo = 2;
638   int p      = printlevel;
639   printlevel = 1;
640   ring  r    = 32003,(x,y),(c,dp);
641   ideal j    = x6-y4,x6y6,x2y4-x5y2;
642   module T   = T2(j);
643   vdim(T);
644   hilb(T);"";
645   ring r1    = 0,(x,y,z),dp;
646   ideal id   = xy,xz,yz;
647   list L     = T2(id,"");
648   vdim(L[1]);                           // vdim of T2
649   print(L[3]);                          // syzygy module of id
650   printlevel = p;
651}
652///////////////////////////////////////////////////////////////////////////////
653
654proc T12 (ideal i, list #)
655"USAGE:   T12(i[,any]);  i = ideal
656RETURN:  T12(i): list of 2 modules:
657             std basis of T1-module =T1(i), 1st order deformations
658             std basid of T2-module =T2(i), obstructions of R=P/i
659         If a second argument is present (of any type) return a list of
660         9 modules, matrices, integers:
661             [1]= standard basis of T1-module
662             [2]= standard basis of T2-module
663             [3]= vdim of T1
664             [4]= vdim of T2
665             [5]= matrix, whose cols present infinitesimal deformations
666             [6]= matrix, whose cols are generators of relations of i (=syz(i))
667             [7]= matrix, presenting Hom_P(syz/kos,R), lifted to P
668             [8]= presentation of T1-module, no std basis
669             [9]= presentation of T2-module, no std basis
670DISPLAY: k-dimension of T1 and T2 if printlevel >= 0 (default)
671NOTE:    Use proc miniversal from deform.lib to get miniversal deformation of i,
672         the list contains all objects used by proc miniversal
673EXAMPLE: example T12; shows an example
674"
675{
676//--------------------------- initialisation ----------------------------------
677   int  n,r1,r2,d1,d2;
678   def P = basering;
679   i = simplify(i,10);
680   module jac,t1,t2,sbt1,sbt2;
681   matrix Kos,Syz,SK,kbT1,Sx;
682   list L;
683   ideal  i0 = std(i);
684//-------------------- presentation of non-trivial syzygies -------------------
685   list I= res(i,2);                            // resolve i
686   Syz  = matrix(I[2]);                         // syz(i)
687   jac = jacob(i);                              // jacobi ideal
688   Kos = koszul(2,i);                           // koszul-relations
689   SK  = modulo(Syz,Kos);                       // presentation of syz/kos
690//--------------------- fetch to quotient ring  mod i -------------------------
691   qring   Ox  = i0;                             // make P/i the basering
692   module Jac = fetch(P,jac);
693   matrix No  = transpose(fetch(P,Syz));        // ker(No) = Hom(syz,Ox)
694   module So  = transpose(fetch(P,SK));         // Hom(syz/kos,R)
695   list resS  = res(So,2);
696   matrix Sx  = resS[2];
697   list resN  = res(No,2);
698   matrix Nx  = resN[2];
699   module T2  = modulo(Sx,No);                  // presentation of T2
700   r2         = nrows(T2);
701   module T1  = modulo(Nx,Jac);                 // presentation of T1
702   r1         = nrows(T1);
703//------------------------ pull back to basering ------------------------------
704   setring P;
705   t1   = fetch(Ox,T1)+i*freemodule(r1);
706   t2   = fetch(Ox,T2)+i*freemodule(r2);
707   sbt1 = std(t1);
708   d1   = vdim(sbt1);
709   sbt2 = std(t2);
710   d2   = vdim(sbt2);
711   dbprint(printlevel-voice+3,"// dim T1 = "+string(d1),"// dim T2 = "+string(d2));
712   if  ( size(#)>0)
713   {
714     if (d1>0)
715     {
716       kbT1 = fetch(Ox,Nx)*kbase(sbt1);
717     }
718     else
719     {
720       kbT1 = 0;
721     } 
722     Sx   = fetch(Ox,Sx);
723     L = sbt1,sbt2,d1,d2,kbT1,Syz,Sx,t1,t2;
724     return(L);
725   }
726   L = sbt1,sbt2;
727   return(L);
728}
729example
730{ "EXAMPLE:"; echo = 2;
731   int p      = printlevel;
732   printlevel = 1;
733   ring r     = 200,(x,y,z,u,v),(c,ws(4,3,2,3,4));
734   ideal i    = xz-y2,yz2-xu,xv-yzu,yu-z3,z2u-yv,zv-u2;
735                            //a cyclic quotient singularity
736   list L     = T12(i,1);
737   print(L[5]);             //matrix of infin. deformations
738   printlevel = p;
739}
740///////////////////////////////////////////////////////////////////////////////
741proc codim (id1, id2)
742"USAGE:   codim(id1,id2); id1,id2 ideal or module, both must be standard bases
743RETURN:  int, which is:
744         1. the codimension of id2 in id1, i.e. the vectorspace dimension of
745            id1/id2 if id2 is contained in id1 and if this number is finite
746         2. -1 if the dimension of id1/id2 is infinite
747         3. -2 if id2 is not contained in id1,
748COMPUTE: consider the two hilberseries iv1(t) and iv2(t), then, in case 1.,
749         q(t)=(iv2(t)-iv1(t))/(1-t)^n must be rational, and the result is the
750         sum of the coefficients of q(t) (n dimension of basering)
751EXAMPLE: example codim; shows an example
752"
753{
754   intvec iv1, iv2, iv;
755   int i, d1, d2, dd, i1, i2, ia, ie;
756  //--------------------------- check id2 < id1 -------------------------------
757   ideal led = lead(id1);
758   attrib(led, "isSB",1);
759   i = size(NF(lead(id2),led));
760   if ( i > 0 )
761   {
762     return(-2);
763   }
764  //--------------------------- 1. check finiteness ---------------------------
765   i1 = dim(id1);
766   i2 = dim(id2);
767   if (i1 < 0)
768   {
769     if (i2 == 0)
770     {
771       return vdim(id2);
772     }
773     else
774     {
775       return(-1);
776     }
777   }
778   if (i2 != i1)
779   {
780     return(-1);
781   }
782   if (i2 <= 0)
783   {
784     return(vdim(id2)-vdim(id1));
785   }
786 // if (mult(id2) != mult(id1))
787 //{
788 //  return(-1);
789 // }
790  //--------------------------- module ---------------------------------------
791   d1 = nrows(id1);
792   d2 = nrows(id2);
793   dd = 0;
794   if (d1 > d2)
795   {
796     id2=id2,maxideal(1)*gen(d1);
797     dd = -1;
798   }
799   if (d2 > d1)
800   {
801     id1=id1,maxideal(1)*gen(d2);
802     dd = 1;
803   }
804  //--------------------------- compute first hilbertseries ------------------
805   iv1 = hilb(id1,1);
806   i1 = size(iv1);
807   iv2 = hilb(id2,1);
808   i2 = size(iv2);
809  //--------------------------- difference of hilbertseries ------------------
810   if (i2 > i1)
811   {
812     for ( i=1; i<=i1; i=i+1)
813     {
814       iv2[i] = iv2[i]-iv1[i];
815     }
816     ie = i2;
817     iv = iv2;
818   }
819   else
820   {
821     for ( i=1; i<=i2; i=i+1)
822     {
823       iv1[i] = iv2[i]-iv1[i];
824     }
825     iv = iv1;
826     for (ie=i1;ie>=0;ie=ie-1)
827     {
828       if (ie == 0)
829       {
830         return(0);
831       }
832       if (iv[ie] != 0)
833       {
834         break;
835       }
836     }
837   }
838   ia = 1;
839   while (iv[ia] == 0) { ia=ia+1; }
840  //--------------------------- ia <= nonzeros <= ie -------------------------
841   iv1 = iv[ia];
842   for(i=ia+1;i<=ie;i=i+1)
843   {
844     iv1=iv1,iv[i];
845   }
846  //--------------------------- compute second hilbertseries -----------------
847   iv2 = hilb(iv1);
848  //--------------------------- check finitenes ------------------------------
849   i2 = size(iv2);
850   i1 = ie - ia + 1 - i2;
851   if (i1 != nvars(basering))
852   {
853     return(-1);
854   }
855  //--------------------------- compute result -------------------------------
856   i1 = 0;
857   for ( i=1; i<=i2; i=i+1)
858   {
859     i1 = i1 + iv2[i];
860   }
861   return(i1+dd);
862}
863example
864{ "EXAMPLE:"; echo = 2;
865   ring r  = 0,(x,y,z),dp;
866   ideal j = y6,x4;
867   ideal m = x,y;
868   attrib(m,"isSB",1);  //let Singular know that ideals are a standard basis
869   attrib(j,"isSB",1); 
870   codim(m,j);          // should be 23 (Milnor number -1 of y7-x5)
871}
Note: See TracBrowser for help on using the repository browser.