source: git/Singular/LIB/sing.lib @ 0b59f5

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