Changeset 6f2edc in git for Singular/LIB/sing.lib


Ignore:
Timestamp:
Apr 28, 1997, 9:27:25 PM (27 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
Children:
8c5a578cc8481c8a133a58030c4c4c8227d82bb1
Parents:
6d09c564c80f079b501f7187cf6984d040603849
Message:
Mon Apr 28 21:00:07 1997  Olaf Bachmann
<obachman@ratchwum.mathematik.uni-kl.de (Olaf Bachmann)>

     * dunno why I am committing these libs -- have not modified any
       of them


git-svn-id: file:///usr/local/Singular/svn/trunk@205 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/sing.lib

    r6d09c56 r6f2edc  
    1 // $Id: sing.lib,v 1.1.1.1 1997-04-25 15:13:27 obachman Exp $
     1// $Id: sing.lib,v 1.2 1997-04-28 19:27:25 obachman Exp $
    22//system("random",787422842);
    3 //(GMG+BM)
    4 ///////////////////////////////////////////////////////////////////////////////
    5 
    6 LIBRARY:  sing.lib      PROCEDURES FOR SINGULARITIES         
     3//(GMG/BM, last modified 26.06.96)
     4///////////////////////////////////////////////////////////////////////////////
     5
     6LIBRARY:  sing.lib      PROCEDURES FOR SINGULARITIES
    77
    88 deform(i);             infinitesimal deformations of ideal i
     
    2222 T12(i);                T1- and T2-module of ideal i
    2323
    24 LIB "inout.lib"; 
     24LIB "inout.lib";
    2525LIB "random.lib";
    2626///////////////////////////////////////////////////////////////////////////////
    2727
    2828proc deform (ideal id)
    29 USAGE:   deform(id);  id = ideal or poly
     29USAGE:   deform(id); id=ideal or poly
    3030RETURN:  matrix, columns are kbase of infinitesimal deformations
    31 EXAMPLE: example deform; shows an example 
    32 { 
     31EXAMPLE: example deform; shows an example
     32{
    3333   list L=T1(id,"");
    34    return(L[2]*kbase(std(L[1])));
    35 }
    36 example
    37 { "EXAMPLE:"; echo = 2;
    38    ring r=32003,(x,y,z),ds;
    39    ideal i=xy,xz,yz;
    40    matrix T=deform(i);print(T);
    41    print(deform(x3+y5+z2));
     34   def K=L[1]; attrib(K,"isSB",1);
     35   return(L[2]*kbase(K));
     36}
     37example
     38{ "EXAMPLE:"; echo = 2;
     39   ring r   = 32003,(x,y,z),ds;
     40   ideal i  = xy,xz,yz;
     41   matrix T = deform(i);
     42   print(T);
     43   print(deform(x3+y5+z2));
    4244}
    4345///////////////////////////////////////////////////////////////////////////////
     
    5254example
    5355{ "EXAMPLE:"; echo = 2;
    54    ring r=32003,(x,y,z),ds;
    55    ideal i= x5+y6+z6,x2+2y2+3z2;
     56   ring r  = 32003,(x,y,z),ds;
     57   ideal i = x5+y6+z6,x2+2y2+3z2;
    5658   dim_slocus(i);
    5759}
     
    5961
    6062proc is_active (poly f, id)
    61 USAGE:   is_active(f,id); f poly, id ideal or module 
     63USAGE:   is_active(f,id); f poly, id ideal or module
    6264RETURN:  1 if f is an active element modulo id (i.e. dim(id)=dim(id+f*R^n)+1,
    6365         if id is a submodule of R^n) resp. 0 if f is not active.
    64          The basering may be a quotient ring 
     66         The basering may be a quotient ring
    6567NOTE:    regular parameters are active but not vice versa (id may have embedded
    6668         components). proc is_reg tests whether f is a regular parameter
    6769EXAMPLE: example is_active; shows an example
    6870{
    69    if( size(id)==0 ) { return(1); } 
     71   if( size(id)==0 ) { return(1); }
    7072   if( typeof(id)=="ideal" ) { ideal m=f; }
    71    if( typeof(id)=="module" ) { module m=f*freemodule(rank(id)); }
     73   if( typeof(id)=="module" ) { module m=f*freemodule(nrows(id)); }
    7274   return(dim(std(id))-dim(std(id+m)));
    7375}
    7476example
    7577{ "EXAMPLE:"; echo = 2;
    76    ring r=32003,(x,y,z),ds;
    77    ideal i=yx3+y,yz3+y3z;
    78    poly f=x;
     78   ring r   =32003,(x,y,z),ds;
     79   ideal i  = yx3+y,yz3+y3z;
     80   poly f   = x;
    7981   is_active(f,i);
    80    qring q = std(x4y5);
    81    poly f=x;
    82    module m=[yx3+x,yx3+y3x];
     82   qring q  = std(x4y5);
     83   poly f   = x;
     84   module m = [yx3+x,yx3+y3x];
    8385   is_active(f,m);
    8486}
     
    8890USAGE:   is_ci(i); i ideal
    8991RETURN:  intvec = sequence of dimensions of ideals (j[1],...,j[k]), for
    90          k=1,...,size(j), where j is minimal base of i. i is a complete
    91          intersection if last number equals nvars-size(i) 
    92 NOTE:    dim(0-ideal) = -1. You may first apply simplify(i,10); in order to
    93          delete zeroes and multiples from set of generators
     92         k=1,...,size(j), where j is minimal base of i. i is a complete
     93         intersection if last number equals nvars-size(i)
     94NOTE:    dim(0-ideal) = -1. You may first apply simplify(i,10); in order to
     95         delete zeroes and multiples from set of generators
     96         printlevel >=0: display comments (default)
    9497EXAMPLE: example is_ci; shows an example
    9598{
     
    97100   i=minbase(i);
    98101   int s = ncols(i);
     102   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    99103//--------------------------- compute dimensions ------------------------------
    100    for( n=1; n<=s; n++ )
    101    { 
     104   for( n=1; n<=s; n=n+1 )
     105   {
    102106      id = i[1..n];
    103107      dimvec[n] = dim(std(id));
    104108   }
    105109   n = dimvec[s];
    106 //--------------------------- output ------------------------------------------     
    107    if( defined(printlevel) )
    108    {
    109       if( n+s !=nvars(basering) )
    110       { dbprint(printlevel,"// no complete intersection"); }
    111       if( n+s ==nvars(basering) )
    112       { dbprint(printlevel,"// complete intersection of dim "+string(n)); }
    113       dbprint(printlevel,"// dim-sequence:");
    114    }
    115    if( voice==2 )
    116    {
    117       if( n+s !=nvars(basering)) {"// no complete intersection"; }
    118       if( n+s ==nvars(basering)) {"// complete intersection of dim",n;}
    119       "// dim-sequence:";
    120    }
     110//--------------------------- output ------------------------------------------
     111   if( n+s != nvars(basering) )
     112   { dbprint(p,"// no complete intersection"); }
     113   if( n+s == nvars(basering) )
     114   { dbprint(p,"// complete intersection of dim "+string(n)); }
     115   dbprint(p,"// dim-sequence:");
    121116   return(dimvec);
    122117}
    123118example
    124 { "EXAMPLE:";   echo = 2; 
    125    int printlevel=2;                // this forces the proc to display comments
    126    export printlevel;             
    127    ring r=32003,(x,y,z),ds;
    128    ideal i=x4+y5+z6,xyz,yx2+xz2+zy7;
     119{ "EXAMPLE:"; echo = 2;
     120   int p      = printlevel;
     121   printlevel = 1;                // display comments
     122   ring r     = 32003,(x,y,z),ds;
     123   ideal i    = x4+y5+z6,xyz,yx2+xz2+zy7;
    129124   is_ci(i);
    130    i=xy,yz;
    131    is_ci(i); 
    132    kill printlevel;
     125   i          = xy,yz;
     126   is_ci(i);
     127   printlevel = p;
    133128}
    134129///////////////////////////////////////////////////////////////////////////////
     
    139134         generated by id[1]..id[i], k = 1..size(id); dim(0-ideal) = -1;
    140135         id defines an isolated singularity if last number is 0
     136NOTE:    printlevel >=0: display comments (default)
    141137EXAMPLE: example is_is; shows an example
    142138{
    143139  int l; intvec dims; ideal j;
     140  int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    144141//--------------------------- compute dimensions ------------------------------
    145    for( l=1; l<=ncols(i); l++ )
    146    {
    147      j = i[1..l]; 
     142   for( l=1; l<=ncols(i); l=l+1 )
     143   {
     144     j = i[1..l];
    148145     dims[l] = dim(std(slocus(j)));
    149146   }
    150    if( voice==2 ) {"// dim of singular locus =",dims[size(dims)],"dim-sequence:";
    151                    "// isolated singularity if last number is 0"; }
     147   dbprint(p,"// dim of singular locus = "+string(dims[size(dims)]),
     148             "// isolated singularity if last number is 0 in dim-sequence:");
    152149   return(dims);
    153150}
    154151example
    155152{ "EXAMPLE:"; echo = 2;
    156    ring r=32003,(x,y,z),ds;
    157    ideal i=x2y,x4+y5+z6,yx2+xz2+zy7;
     153   int p      = printlevel;
     154   printlevel = 1;
     155   ring r     = 32003,(x,y,z),ds;
     156   ideal i    = x2y,x4+y5+z6,yx2+xz2+zy7;
    158157   is_is(i);
    159 // isolated singularity if last number is 0
    160    poly f=xy+yz;
     158   poly f     = xy+yz;
    161159   is_is(f);
    162 // isolated singularity if last number is 0
     160   printlevel = p;
    163161}
    164162///////////////////////////////////////////////////////////////////////////////
     
    177175   id=std(id);
    178176   d=size(q);
    179    for( ii=1; ii<=d; ii++ )
     177   for( ii=1; ii<=d; ii=ii+1 )
    180178   {
    181179      if( reduce(q[ii],id)!=0 )
     
    184182   return(1);
    185183}
    186 example
    187 { "EXAMPLE:"; echo = 2;
    188    ring r=32003,(x,y),ds;
    189    ideal i=x8,y8;ideal j=(x+y)^4;
    190    i=intersect(i,j); poly f=xy;
     184example
     185{ "EXAMPLE:"; echo = 2;
     186   ring r  = 32003,(x,y),ds;
     187   ideal i = x8,y8;
     188   ideal j = (x+y)^4;
     189   i       = intersect(i,j);
     190   poly f  = xy;
    191191   is_reg(f,i);
    192192}
     
    198198NOTE:    let R be the basering and id a submodule of R^n. The procedure checks
    199199         injectivity of multiplication with i[k] on R^n/id+i[1..k-1].
    200          The basering may be a quotient ring
     200         The basering may be a quotient ring
     201         printlevel >=0: display comments (default)
     202         printlevel >=1: display comments during computation
    201203EXAMPLE: example is_regs; shows an example
    202204{
     205   int d,ii,r;
     206   int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
    203207   if( size(#)==0 ) { ideal id; }
    204208   else { def id=#[1]; }
    205209   if( size(i)==0 ) { return(0); }
    206    int d,ii,r;
    207    d=size(i);
     210   d=size(i);
    208211   if( typeof(id)=="ideal" ) { ideal m=1; }
    209    if( typeof(id)=="module" ) { module m=freemodule(rank(id)); }
    210    for( ii=1; ii<=d; ii++ )
    211    { 
    212       if( voice==2 )
     212   if( typeof(id)=="module" ) { module m=freemodule(nrows(id)); }
     213   for( ii=1; ii<=d; ii=ii+1 )
     214   {
     215      if( p>=2 )
    213216      { "// checking whether element",ii,"is regular mod 1 ..",ii-1; }
    214       if( is_reg(i[ii],id)==0 )
    215       {
    216          if( voice==2 )
    217          {
    218             "// elements 1 ..",ii-1,"are regular,",
    219             ii,"is not regular mod 1 ..",ii-1;
    220          }
    221          return(0);
     217      if( is_reg(i[ii],id)==0 )
     218      {
     219        dbprint(p,"// elements 1.."+string(ii-1)+" are regular, " +
     220                string(ii)+" is not regular mod 1.."+string(ii-1));
     221         return(0);
    222222      }
    223       id=id+i[ii]*m; 
    224    }
    225    if( voice==2 ) { "// elements are a regular sequence of length",d; }
     223      id=id+i[ii]*m;
     224   }
     225   if( p>=1 ) { "// elements are a regular sequence of length",d; }
    226226   return(1);
    227227}
    228 example
    229 { "EXAMPLE:"; echo = 2;
    230    ring r1=32003,(x,y,z),ds;
    231    ideal i=x8,y8,(x+y)^4;
     228example
     229{ "EXAMPLE:"; echo = 2;
     230   int p      = printlevel;
     231   printlevel = 1;
     232   ring r1    = 32003,(x,y,z),ds;
     233   ideal i    = x8,y8,(x+y)^4;
    232234   is_regs(i);
    233    module m=[x,0,y];
    234    i=x8,(x+z)^4;;
     235   module m   = [x,0,y];
     236   i          = x8,(x+z)^4;;
    235237   is_regs(i,m);
     238   printlevel = p;
    236239}
    237240///////////////////////////////////////////////////////////////////////////////
     
    240243USAGE:   milnor(i); i ideal or poly
    241244RETURN:  Milnor number of i, if i is ICIS (isolated complete intersection
    242          singularity) in generic form, resp. -1 if not 
     245         singularity) in generic form, resp. -1 if not
    243246NOTE:    use proc nf_icis to put generators in generic form
     247         printlevel >=0: display comments (default)
    244248EXAMPLE: example milnor; shows an example
    245 { 
    246   i = simplify(i,10);     //delete zeroes and multiples from set of generators     
     249{
     250  i = simplify(i,10);     //delete zeroes and multiples from set of generators
    247251  int n = size(i);
    248252  int l,q,m_nr;  ideal t;  intvec disc;
    249 //---------------------------- hypersurface case ------------------------------   
    250   if( n==1 )     
     253  int p = printlevel-voice+3;  // p=printlevel+1 (default: p=1)
     254//---------------------------- hypersurface case ------------------------------
     255  if( n==1 )
    251256  {
    252257     i = std(jacob(i[1]));
    253      m_nr = vdim(i);       
    254      if( m_nr<0 and voice==2 ) { "// no isolated singularity"; }
    255      return(m_nr); 
     258     m_nr = vdim(i);
     259     if( m_nr<0 and p>=1 ) { "// no isolated singularity"; }
     260     return(m_nr);
    256261  }
    257262//------------ isolated complete intersection singularity (ICIS) --------------
    258263  for( l=n; l>0; l=l-1)
    259   {
    260       t      = minor(jacob(i),l);
    261       i[l]   = 0;
     264  {   t      = minor(jacob(i),l);
     265      i[l]   = 0;
    262266      q      = vdim(std(i+t));
    263267      disc[l]= q;
    264268      if( q ==-1 )
    265       {
    266          if( voice==2 )
     269      {  if( p>=1 )
    267270            {  "// not in generic form or no ICIS; use proc nf_icis to put";
    268             "// generators in generic form and then try milnor again!";  } 
     271            "// generators in generic form and then try milnor again!";  }
    269272         return(q);
    270273      }
    271       m_nr = q-m_nr; 
     274      m_nr = q-m_nr;
    272275  }
    273 //---------------------------- change sign ------------------------------------     
    274   if (m_nr < 0) { m_nr=-m_nr; } 
    275   if( voice==2 ) { "//sequence of discriminant numbers:",disc; }
     276//---------------------------- change sign ------------------------------------
     277  if (m_nr < 0) { m_nr=-m_nr; }
     278  if( p>=1 ) { "//sequence of discriminant numbers:",disc; }
    276279  return(m_nr);
    277280}
    278281example
    279282{ "EXAMPLE:"; echo = 2;
    280    ring r=32003,(x,y,z),ds;
    281    ideal j=x5+y6+z6,x2+2y2+3z2,xyz+yx;
     283   int p      = printlevel;
     284   printlevel = 1;
     285   ring r     = 32003,(x,y,z),ds;
     286   ideal j    = x5+y6+z6,x2+2y2+3z2,xyz+yx;
    282287   milnor(j);
    283    poly f=x7+y7+(x-y)^2*x2y2+z2;
    284    milnor(f);
     288   poly f     = x7+y7+(x-y)^2*x2y2+z2;
     289   milnor(f);
     290   printlevel = p;
    285291}
    286292///////////////////////////////////////////////////////////////////////////////
     
    291297         (isolated complete intersection singularity), return i if not
    292298NOTE:    this proc is useful in connection with proc milnor
     299         printlevel >=0: display comments (default)
    293300EXAMPLE: example nf_icis; shows an example
    294301{
    295302   i = simplify(i,10);  //delete zeroes and multiples from set of generators
    296    int p,b = 100,0; 
     303   int p,b = 100,0;
    297304   int n = size(i);
    298305   matrix mat=freemodule(n);
    299 //---------------------------- test: complete intersection? -------------------     
     306   int P = printlevel-voice+3;  // P=printlevel+1 (default: P=1)
     307//---------------------------- test: complete intersection? -------------------
    300308   intvec sl = is_ci(i);
    301    if( n+sl[n] != nvars(basering) ) 
    302    { 
    303     if( voice==2 ) { "// no complete intersection"; }
    304     return(i);
    305    }
    306 //--------------- test: isolated singularity in generic form? -----------------     
     309   if( n+sl[n] != nvars(basering) )
     310   {
     311      dbprint(P,"// no complete intersection");
     312      return(i);
     313   }
     314//--------------- test: isolated singularity in generic form? -----------------
    307315   sl = is_is(i);
    308316   if ( sl[n] != 0 )
    309317   {
    310       if( voice==2 ) { "// no isolated singularity"; }
     318      dbprint(P,"// no isolated singularity");
    311319      return(i);
    312320   }
    313 //------------ produce generic linear combinations of generators --------------   
     321//------------ produce generic linear combinations of generators --------------
    314322   int prob;
    315    while ( sum(sl) != 0 ) 
     323   while ( sum(sl) != 0 )
    316324   {  prob=prob+1;
    317       p=p-25; b=b+10; 
     325      p=p-25; b=b+10;
    318326      i = genericid(i,p,b);          // proc genericid from random.lib
    319327      sl = is_is(i);
    320328   }
    321    if( voice==2 ) { "// ICIS in generic form after",prob,"genericity loop(s)";}
    322    return(i);   
    323 }
    324 example
    325 { "EXAMPLE:"; echo = 2;
    326    ring r=32003,(x,y,z),ds;
    327    ideal i=x3+y4,z4+yx;   
    328    nf_icis(i);     
    329    ideal j=x3+y4,xy,yz;
     329   dbprint(P,"// ICIS in generic form after "+string(prob)+" genericity loop(s)");
     330   return(i);
     331}
     332example
     333{ "EXAMPLE:"; echo = 2;
     334   int p      = printlevel;
     335   printlevel = 1;
     336   ring r     = 32003,(x,y,z),ds;
     337   ideal i    = x3+y4,z4+yx;
     338   nf_icis(i);
     339   ideal j    = x3+y4,xy,yz;
    330340   nf_icis(j);
     341   printlevel = p;
    331342}
    332343///////////////////////////////////////////////////////////////////////////////
     
    340351  int cod  = nvars(basering)-dim(std(i));
    341352  i        = i+minor(jacob(i),cod);
    342   return(i);   
    343 }
    344 example
    345 { "EXAMPLE:"; echo = 2;
    346    ring r=32003,(x,y,z),ds;
    347    ideal i= x5+y6+z6,x2+2y2+3z2;
     353  return(i);
     354}
     355example
     356{ "EXAMPLE:"; echo = 2;
     357   ring r  = 32003,(x,y,z),ds;
     358   ideal i = x5+y6+z6,x2+2y2+3z2;
    348359   dim(std(slocus(i)));
    349360}
     
    351362
    352363proc Tjurina (id, list #)
    353 USAGE:   Tjurina(id[,<any>]);  id ideal or poly (assume: id=ICIS)
    354 RETURN:  Tjurina(id): standard basis of Tjurina-module of id, displays Tjurina
    355          number
    356          Tjurina(id,...): If a second argument is present (of any type) return
    357          a list of 4 objects: [1]=Tjurina number (int), [2]=basis of miniversal
    358          deformation (module), [3]=SB of Tjurina module (module), [4]=Tjurina
    359          module (module)
    360 NOTE:    if id is a poly the output will be of type ideal rather than module
    361 EXAMPLE: example Tjurina; shows an example
     364USAGE:   Tjurina(id[,<any>]);  id=ideal or poly
     365ASSUME:  id=ICIS (isolated complete intersection singularity)
     366RETURN:  standard basis of Tjurina-module of id,
     367         of type module if id=ideal, resp. of type ideal if id=poly.
     368         If a second argument is present (of any type) return a list:
     369           [1] = Tjurina number,
     370           [2] = k-basis of miniversal deformation,
     371           [3] = SB of Tjurina module,
     372           [4] = Tjurina module
     373DISPLAY: Tjurina number if printlevel >= 0 (default)
     374NOTE:    Tjurina number = -1 implies that id is not an ICIS
     375EXAMPLE: example Tjurina; shows examples
    362376{
    363377//---------------------------- initialisation ---------------------------------
    364   def i = simplify(id,10);         
     378  def i = simplify(id,10);
    365379  int tau,n = 0,size(i);
    366380  if( size(ideal(i))==1 ) { def m=i; }  // hypersurface case
     
    370384  def st1 = std(t1);                    // SB of Tjurina module/ideal
    371385  tau = vdim(st1);                      // Tjurina number
    372   def kB = kbase(st1);                  // basis of miniversal deformation
    373   if( voice==2 )  { "// Tjurina number =",tau; }
    374   if( size(#)>0 ) { return(tau,kB,st1,t1); }
     386  dbprint(printlevel-voice+3,"// Tjurina number = "+string(tau));
     387  if( size(#)>0 )
     388  {
     389     def kB = kbase(st1);               // basis of miniversal deformation
     390     return(tau,kB,st1,t1);
     391  }
    375392  return(st1);
    376393}
    377394example
    378395{ "EXAMPLE:"; echo = 2;
    379    ring r=0,(x,y,z),ds;
    380    poly f = x5+y6+z7+xyz;        // singularity T[5,6,7]
    381    list T = Tjurina(f,"");
    382    show(T[1]);                   // Tjurina number, should be 16
    383    show(T[2]);                   // basis of miniversal deformation
    384    show(T[3]);                   // SB of Tjurina ideal
    385    show(T[4]); "";               // Tjurina ideal
    386    ideal j=x2+y2+z2,x2+2y2+3z2;
    387    show(kbase(Tjurina(j)));      // basis of miniversal deformation
    388    hilb(Tjurina(j));             // Hilbert series of Tjurina module
     396   int p      = printlevel;
     397   printlevel = 1;
     398   ring r     = 0,(x,y,z),ds;
     399   poly f     = x5+y6+z7+xyz;        // singularity T[5,6,7]
     400   list T     = Tjurina(f,"");
     401   show(T[1]);                       // Tjurina number, should be 16
     402   show(T[2]);                       // basis of miniversal deformation
     403   show(T[3]);                       // SB of Tjurina ideal
     404   show(T[4]); "";                   // Tjurina ideal
     405   ideal j    = x2+y2+z2,x2+2y2+3z2;
     406   show(kbase(Tjurina(j)));          // basis of miniversal deformation
     407   hilb(Tjurina(j));                 // Hilbert series of Tjurina module
     408   printlevel = p;
    389409}
    390410///////////////////////////////////////////////////////////////////////////////
    391411
    392412proc tjurina (ideal i)
    393 USAGE:   tjurina(id);  id ideal or poly (assume: id=ICIS)
     413USAGE:   tjurina(id);  id=ideal or poly
     414ASSUME:  id=ICIS (isolated complete intersection singularity)
    394415RETURN:  int = Tjurina number of id
     416NOTE:    Tjurina number = -1 implies that id is not an ICIS
    395417EXAMPLE: example tjurina; shows an example
    396418{
    397    return(vdim(Tjurina(i))); 
     419   return(vdim(Tjurina(i)));
    398420}
    399421example
     
    401423   ring r=32003,(x,y,z),(c,ds);
    402424   ideal j=x2+y2+z2,x2+2y2+3z2;
    403    tjurina(j); 
     425   tjurina(j);
    404426}
    405427///////////////////////////////////////////////////////////////////////////////
     
    407429proc T1 (ideal id, list #)
    408430USAGE:   T1(id[,<any>]);  id = ideal or poly
    409 RETURN:  T1(id): T1-module of id or T1-ideal if id is a poly. This is a
     431RETURN:  T1(id): of type module/ideal if id is of type ideal/poly.
     432         We call T1(id) the T1-module of id. It is a std basis of the
    410433         presentation of 1st order deformations of P/id, if P is the basering.
    411          T1(id,...): If a second argument is present (of any type) return a
    412          list of 3 modules:
    413             [1]= presentation of infinitesimal deformations of id (=T1(id))
     434         If a second argument is present (of any type) return a list of
     435         3 modules:
     436            [1]= T1(id)
    414437            [2]= generators of normal bundle of id, lifted to P
    415             [3]= module of relations of [2], lifted to P ([2]*[3]=0 mod id)
    416          The list contains all non-easy objects which must be computed anyway
     438            [3]= module of relations of [2], lifted to P
     439                 (note: transpose[3]*[2]=0 mod id)
     440         The list contains all non-easy objects which must be computed
    417441         to get T1(id).
    418          The situation is described in detail in the procedure T1_expl
    419          from library explain.lib
    420 NOTE:    T1(id) itself is usually of minor importance, nevertheless, from it
    421          all relevant information can be obtained. Since no standard basis is
    422          computed, the user has first to compute a standard basis before
    423          applying vdim or hilb etc.. For example, matrix([2])*(kbase(std([1])))
    424          represents a basis of 1st order semiuniversal deformation of id
    425          (use proc 'deform', to get this in a direct and convenient way).
    426          If the input is weighted homogeneous with weights w1,...,wn, use
    427          ordering wp(w1..wn), even in the local case, which is equivalent but
    428          faster than ws(w1..wn).
     442DISPLAY: k-dimension of T1(id) if printlevel >= 0 (default)
     443NOTE:    T1(id) itself is usually of minor importance. Nevertheless, from it
     444         all relevant information can be obtained. The most important are
     445         probably vdim(T1(id)); (which computes the Tjurina number),
     446         hilb(T1(id)); and kbase(T1(id));
     447         If T1 is called with two argument, then matrix([2])*(kbase([1]))
     448         represents a basis of 1st order semiuniversal deformation of id
     449         (use proc 'deform', to get this in a direct way).
    429450         For a complete intersection the proc Tjurina is faster
    430451EXAMPLE: example T1; shows an example
     
    432453   ideal J=simplify(id,10);
    433454//--------------------------- hypersurface case -------------------------------
    434   if( size(J)<2 )
    435   {
    436      ideal t1=J[1],jacob(J[1]); module nb=[1]; module pnb;
     455  if( size(J)<2 )
     456  {
     457     ideal t1  = std(J+jacob(J[1]));
     458     module nb = [1]; module pnb;
     459     dbprint(printlevel-voice+3,"// dim T1 = "+string(vdim(t1)));
    437460     if( size(#)>0 ) { return(t1*gen(1),nb,pnb); }
    438461     return(t1);
     
    440463//--------------------------- presentation of J -------------------------------
    441464   int rk;
    442   def P=basering;
     465  def P = basering;
    443466   module jac, t1;
    444    jac=jacob(J);                 // jacobian matrix of J converted to module
    445    res(J,2,A);                   // compute presentation of J
    446    t1=transpose(A(2));           // transposed 1st syzygy module of J
     467   jac  = jacob(J);                 // jacobian matrix of J converted to module
     468   res(J,2,A);                      // compute presentation of J
     469                                    // A(2) = 1st syzygy module of J
    447470//---------- go to quotient ring mod J and compute normal bundle --------------
    448   qring  R=std(J);
    449    module jac=fetch(P,jac);
    450    module t1=fetch(P,t1);       
    451    res(t1,3,B);                  // resolve t1, B(2)=(J/J^2)*=normal_bdl
    452    t1=lift(B(2),jac)+B(3);       // pres. of normal_bdl/trivial_deformations
    453    rk=rank(t1);
     471  qring  R    = std(J);
     472   module jac = fetch(P,jac);
     473   module t1  = transpose(fetch(P,A(2)));
     474   res(t1,2,B);                     // resolve t1, B(2)=(J/J^2)*=normal_bdl
     475   t1         = modulo(B(2),jac);   // pres. of normal_bdl/trivial_deformations
     476   rk=nrows(t1);
    454477//-------------------------- pull back to basering ----------------------------
    455478  setring P;
    456479   t1 = fetch(R,t1)+J*freemodule(rk);  // T1-module, presentation of T1
    457    if( size(#)>0 )
    458    {
    459       module B2 = fetch(R,B(2));        // (generators of) normal bundle
    460       module B3 = fetch(R,B(3));        // presentation of normal bundle
    461       return(t1,B2,B3);
    462    }
    463    return(t1); 
    464 }
    465 example
    466 { "EXAMPLE:"; echo = 2;
    467    ring r=32003,(x,y,z),(c,ds);
    468    ideal i=xy,xz,yz;
    469    module T=T1(i);
    470    vdim(std(T));                 // Tjurina number = dim_K(T1), should be 3
     480   t1 = std(t1);
     481   dbprint(printlevel-voice+3,"// dim T1 = "+string(vdim(t1)));
     482   if( size(#)>0 )
     483   {
     484      module B2 = fetch(R,B(2));        // presentation of normal bundle
     485      list L = t1,B2,A(2);
     486      attrib(L[1],"isSB",1);
     487      return(L);
     488   }
     489   return(t1);
     490}
     491example
     492{ "EXAMPLE:"; echo = 2;
     493   int p      = printlevel;
     494   printlevel = 1;
     495   ring r     = 32003,(x,y,z),(c,ds);
     496   ideal i    = xy,xz,yz;
     497   module T   = T1(i);
     498   vdim(T);                      // Tjurina number = dim_K(T1), should be 3
    471499   list L=T1(i,"");
    472    module kB = kbase(std(L[1]));
     500   module kB  = kbase(L[1]);
    473501   print(L[2]*kB);               // basis of 1st order miniversal deformation
    474    size(L[1]);                   // number of generators of T1-module
    475    show(L[2]);                   // (generators of) normal bundle
    476    print(L[3]);                  // relation matrix of normal bundle (mod i)
    477    print(L[2]*L[3]);             // should be 0 (mod i)
     502   show(L[2]);                   // presentation of normal bundle
     503   print(L[3]);                  // relations of i
     504   print(transpose(L[3])*L[2]);  // should be 0 (mod i)
     505   printlevel = p;
    478506}
    479507///////////////////////////////////////////////////////////////////////////////
     
    481509proc T2 (ideal id, list #)
    482510USAGE:   T2(id[,<any>]);  id = ideal
    483 RETURN:  T2(id): T2-module of id . This is a presentation of the module of
    484            obstructions of R=P/id, if P is the basering.
    485          T2(id,...): If a second argument is present (of any type) return a
    486          list of 6 modules and 1 ideal:
    487             [1]= presentation of module of obstructions (=T2(id))
     511RETURN:  T2(id): T2-module of id . This is a std basis of a presentation of
     512         the module of obstructions of R=P/id, if P is the basering.
     513         If a second argument is present (of any type) return a list of
     514         4 modules and 1 ideal:
     515            [1]= T2(id)
    488516            [2]= standard basis of id (ideal)
    489517            [3]= module of relations of id (=1st syzygy module of id)
    490             [4]= presentation of [3] (=2nd syzygy module of id)
    491             [5]= lifting of Koszul relations kos, kos=module([3]*matrix([5]))
    492             [6]= generators of Hom_P([3]/kos,R), lifted to P
    493             [7]= relations of Hom_P([3]/kos,R), lifted to P
    494          The list contains all non-easy objects which must be computed anyway
    495          to get T2(id). The situation is described in detail in the procedure
    496          T2_expl from library explain.lib
    497 NOTE:    Since no standard basis is computed, the user has first to compute a
    498          standard basis before applying vdim or hilb etc.. 
    499          If the input is weighted homogeneous with weights w1,...,wn, use
    500          ordering wp(w1..wn), even in the local case, which is equivalent but
    501          faster than ws(w1..wn).
    502          Use proc miniversal to get equations of miniversal deformation;
     518            [4]= presentation of syz/kos
     519            [5]= relations of Hom_P([3]/kos,R), lifted to P
     520         The list contains all non-easy objects which must be computed
     521         to get T2(id).
     522DISPLAY: k-dimension of T2(id) if printlevel >= 0 (default)
     523NOTE:    The most important information is probably vdim(T2(id)).
     524         Use proc miniversal to get equations of miniversal deformation.
    503525EXAMPLE: example T2; shows an example
    504526{
    505527//--------------------------- initialisation ----------------------------------
    506528  def P = basering;
    507    ideal J = simplify(id,10);
    508    module kos,L0,t2;
     529   ideal J = id;
     530   module kos,SK,B2,t2;
     531   list L;
    509532   int n,rk;
    510 //------------------- presentation of non-trivial syzygies -------------------- 
    511    res(J,3,A);                            // resolve J, A(2)=syz
     533//------------------- presentation of non-trivial syzygies --------------------
     534   res(J,2,A);                            // resolve J, A(2)=syz
    512535   kos  = koszul(2,J);                    // module of Koszul relations
    513    L0 = lift(A(2),kos);                   // lift Koszul relations to syz
    514    t2   = L0+A(3);                        // presentation of syz/kos
     536   SK   = modulo(A(2),kos);               // presentation of syz/kos
    515537   ideal J0 = std(J);                     // standard basis of J
    516 //*** sollte bei der Berechnung von res mit anfallen, zu aendern!!
     538//?*** sollte bei der Berechnung von res mit anfallen, zu aendern!!
    517539//---------------------- fetch to quotient ring mod J -------------------------
    518540  qring R = J0;                           // make P/J the basering
    519    module A2' = transpose(fetch(P,A(2))); // dual of syz 
    520    module t2  = transpose(fetch(P,t2));   // dual of syz/kos
    521    res(t2,3,B);                           // resolve t2   
    522    t2 = lift(B(2),A2')+B(3);              // presentation of T2
    523    rk = rank(t2);
     541   module A2' = transpose(fetch(P,A(2))); // dual of syz
     542   module t2  = transpose(fetch(P,SK));   // dual of syz/kos
     543   res(t2,2,B);                           // resolve (syz/kos)*
     544   t2 = modulo(B(2),A2');                 // presentation of T2
     545   rk = nrows(t2);
    524546//---------------------  fetch back to basering -------------------------------
    525547  setring P;
    526548   t2 = fetch(R,t2)+J*freemodule(rk);
    527    if( size(#)>0 )
    528    {
    529       module B2 = fetch(R,B(2));        // generators of Hom_P(syz/kos,R)
    530       module B3 = fetch(R,B(3));        // relations of Hom_P(syz/kos,R)
    531       return(t2,J0,A(2),A(3),L0,B2,B3);
    532    }
    533    return(t2); 
    534 }
    535 example
    536 { "EXAMPLE:"; echo = 2;
    537    ring  r = 32003,(x,y),(c,dp);
    538    ideal j = x6-y4,x6y6,x2y4-x5y2;
    539    module T= std(T2(j));
    540    vdim(T);hilb(T);
    541    ring r1=0,(x,y,z),dp;
    542    ideal id=xy,xz,yz;
    543    list L=T2(id,"");
    544    vdim(std(L[1]));                      // vdim of T2
    545    L[4];                                 // 2nd syzygy module of ideal
     549   t2 = std(t2);
     550   dbprint(printlevel-voice+3,"// dim T2 = "+string(vdim(t2)));
     551   if( size(#)>0 )
     552   {
     553      B2 = fetch(R,B(2));        // generators of Hom_P(syz/kos,R)
     554      L  = t2,J0,A(2),SK,B2;
     555      return(L);
     556   }
     557   return(t2);
     558}
     559example
     560{ "EXAMPLE:"; echo = 2;
     561   int p      = printlevel;
     562   printlevel = 1;
     563   ring  r    = 32003,(x,y),(c,dp);
     564   ideal j    = x6-y4,x6y6,x2y4-x5y2;
     565   module T   = T2(j);
     566   vdim(T);
     567   hilb(T);"";
     568   ring r1    = 0,(x,y,z),dp;
     569   ideal id   = xy,xz,yz;
     570   list L     = T2(id,"");
     571   vdim(L[1]);                           // vdim of T2
     572   print(L[3]);                          // syzygy module of id
     573   printlevel = p;
    546574}
    547575///////////////////////////////////////////////////////////////////////////////
     
    549577proc T12 (ideal i, list #)
    550578USAGE:   T12(i[,any]);  i = ideal
    551 DISPLAY: dim T1 and dim T2  of i
    552 RETURN:  T12(i): list of 2 modules:
    553              presentation of T1-module =T1(i) , 1st order deformations 
    554              presentation of T2-module =T2(i) , obstructions of R=P/i
    555          T12(i,...): If a second argument is present (of any type) return
    556          a list of 9 modules, matrices, integers:
    557              [1]= presentation of T1 (module)
    558              [2]= presentation of T2 (module)
    559              [3]= matrix, whose cols present infinitesimal deformations
    560              [4]= matrix, whose cols are generators of relations of i     
    561              [5]= matrix, presenting Hom_P([4]/kos,R), lifted to P
    562              [6]= standard basis of T1-module
    563              [7]= standard basis of T2-module
    564              [8]= vdim of T1
    565              [9]= vdim of T2
     579RETURN:  T12(i): list of 2 modules:
     580             std basis of T1-module =T1(i), 1st order deformations
     581             std basid of T2-module =T2(i), obstructions of R=P/i
     582         If a second argument is present (of any type) return a list of
     583         9 modules, matrices, integers:
     584             [1]= standard basis of T1-module
     585             [2]= standard basis of T2-module
     586             [3]= vdim of T1
     587             [4]= vdim of T2
     588             [5]= matrix, whose cols present infinitesimal deformations
     589             [6]= matrix, whose cols are generators of relations of i (=syz(i))
     590             [7]= matrix, presenting Hom_P(syz/kos,R), lifted to P
     591             [8]= presentation of T1-module, no std basis
     592             [9]= presentation of T2-module, no std basis
     593DISPLAY: k-dimension of T1 and T2 if printlevel >= 0 (default)
    566594NOTE:    Use proc miniversal from deform.lib to get miniversal deformation of i,
    567595         the list contains all objects used by proc miniversal
     
    572600  def P = basering;
    573601   i = simplify(i,10);
    574    if (size(i)<2)
    575    {
    576      "// hypersurface, use proc 'Tjurina'";
    577      //return([1]);
    578    }
    579    module jac,t1,t2,kos,sbt1,sbt2;
    580    matrix L3,L4,L5;
     602   module jac,t1,t2,sbt1,sbt2;
     603   matrix Kos,Syz,SK,kbT1,Sx;
     604   list L;
    581605   ideal  i0 = std(i);
    582606//-------------------- presentation of non-trivial syzygies -------------------
    583    list I= res(i,3);                            // resolve i
    584    L4  = matrix(I[2]);                          // syz(i)
     607   list I= res(i,2);                            // resolve i
     608   Syz  = matrix(I[2]);                         // syz(i)
    585609   jac = jacob(i);                              // jacobi ideal
    586    t1  = transpose(I[2]);                       // dual of syzygies
    587    kos = koszul(2,i);                           // koszul-relations
    588    t2  = lift(I[2],kos)+I[3];                   // presentation of syz/kos
     610   Kos = koszul(2,i);                           // koszul-relations
     611   SK  = modulo(Syz,Kos);                       // presentation of syz/kos
    589612//--------------------- fetch to quotient ring  mod i -------------------------
    590613  qring   Ox  = i0;                             // make P/i the basering
    591    module jac = fetch(P,jac);
    592    module t1  = fetch(P,t1);                    // Hom(syz,R)
    593    module t2  = transpose(fetch(P,t2));         // Hom(syz/kos,R)
    594    list resS  = res(t1,3);
    595    list resR  = res(t2,3);
    596    t2 = lift(resR[2],t1)+resR[3];               // presentation of T2
    597    r2 = rank(t2);
    598    t1 = lift(resS[2],jac)+resS[3];              // presentation of T1
    599    r1 = rank(t1);
    600    matrix L3  = resS[2];
    601    matrix L5  = resR[2];
     614   module Jac = fetch(P,jac);
     615   matrix No  = transpose(fetch(P,Syz));        // ker(No) = Hom(syz,Ox)
     616   module So  = transpose(fetch(P,SK));         // Hom(syz/kos,R)
     617   list resS  = res(So,2);
     618   matrix Sx  = resS[2];
     619   list resN  = res(No,2);
     620   matrix Nx  = resN[2];
     621   module T2  = modulo(Sx,No);                  // presentation of T2
     622   r2         = nrows(T2);
     623   module T1  = modulo(Nx,Jac);                 // presentation of T1
     624   r1         = nrows(T1);
    602625//------------------------ pull back to basering ------------------------------
    603626  setring P;
    604    t1   = fetch(Ox,t1)+i*freemodule(r1);
    605    t2   = fetch(Ox,t2)+i*freemodule(r2);
     627   t1   = fetch(Ox,T1)+i*freemodule(r1);
     628   t2   = fetch(Ox,T2)+i*freemodule(r2);
    606629   sbt1 = std(t1);
    607630   d1   = vdim(sbt1);
    608    sbt2=std(t2);
     631   sbt2 = std(t2);
    609632   d2   = vdim(sbt2);
    610    "// dim T1  = ",d1;
    611    "// dim T2  = ",d2;
     633   dbprint(printlevel-voice+3,"// dim T1 = "+string(d1),"// dim T2 = "+string(d2));
    612634   if  ( size(#)>0)
    613635   {
    614      L3 = fetch(Ox,L3)*kbase(sbt1);
    615      L5 = fetch(Ox,L5);
    616      return(t1,t2,L3,L4,L5,sbt1,sbt2,d1,d2);
    617    }
    618    return(t1,t2);
    619 }
    620 example
    621 { "EXAMPLE:"; echo = 2;
    622    ring r=200,(x,y,z,u,v),(c,ws(4,3,2,3,4));
    623    ideal i=xz-y2,yz2-xu,xv-yzu,yu-z3,z2u-yv,zv-u2;
    624    //a cyclic quotient singularity
    625    list L = T12(i,1);
    626    print(L[3]);
    627 }
    628 ///////////////////////////////////////////////////////////////////////////////
     636      kbT1 = fetch(Ox,Nx)*kbase(sbt1);
     637      Sx   = fetch(Ox,Sx);
     638      L = sbt1,sbt2,d1,d2,kbT1,Syz,Sx,t1,t2;
     639      return(L);
     640   }
     641   L = sbt1,sbt2;
     642   return(L);
     643}
     644example
     645{ "EXAMPLE:"; echo = 2;
     646   int p      = printlevel;
     647   printlevel = 1;
     648   ring r     = 200,(x,y,z,u,v),(c,ws(4,3,2,3,4));
     649   ideal i    = xz-y2,yz2-xu,xv-yzu,yu-z3,z2u-yv,zv-u2;
     650                            //a cyclic quotient singularity
     651   list L     = T12(i,1);
     652   print(L[5]);             //matrix of infin. deformations
     653   printlevel = p;
     654}
     655///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.