Changeset cc5e38 in git


Ignore:
Timestamp:
May 19, 2005, 10:14:51 AM (19 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
8f4b234e137fff311254fc393c2db21a430013ca
Parents:
4caa6c6e0405901a99cfb2dad38944688dee60dc
Message:
*lossen: new version


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/sheafcoh.lib

    r4caa6c rcc5e38  
    1 ///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: sheafcoh.lib,v 1.3 2005-05-18 15:59:37 Singular Exp $";
     1S///////////////////////////////////////////////////////////////////////////////
     2version="$Id: sheafcoh.lib,v 1.4 2005-05-19 08:14:51 Singular Exp $";
    33category="Commutative Algebra";
    44info="
     
    1212 CM_regularity(M);       Castelnuovo-Mumford regularity of coker(M)
    1313 sheafCohBGG(M,l,h);     cohomology of sheaf associated to coker(M)
    14  sheafCohE(M,l,h);       cohomology of sheaf associated to coker(M)
     14 sheafCoh(M,l,h);        cohomology of sheaf associated to coker(M)
     15 dimH(i,M,d);            compute h^i(F(d)), F sheaf associated to coker(M)
    1516
    1617AUXILIARY PROCEDURES:
     
    4950proc truncate(module phi, int d)
    5051"USAGE:   truncate(M,d);  M module, d int
    51 ASSUME:  M comes assigned with an admissible degree vector as an attribute
     52ASSUME:  @code{M} is graded and is either 0 or comes assigned with an
     53         admissible degree vector as an attribute
    5254RETURN:  module
    5355NOTE:    Output is a presentation matrix for the truncation of coker(M)
     
    5860{
    5961  if ( typeof(attrib(phi,"isHomog"))=="string" ) { 
     62    if (size(phi)==0) { attrib(phi,"isHomog",0); }
    6063    ERROR("No admissible degree vector assigned");
    6164  }
     
    115118proc dimGradedPart(module phi, int d)
    116119"USAGE:   dimGradedPart(M,d);  M module, d int
    117 ASSUME:  M comes assigned with an admissible degree vector as an attribute
     120ASSUME:   @code{M} is graded and is either 0 or comes assigned with an
     121         admissible degree vector as an attribute
    118122RETURN:  int
    119123NOTE:    Output is the vector space dimension of the graded part of degree d
     
    123127"
    124128{
    125   if ( typeof(attrib(phi,"isHomog"))=="string" ) { 
    126     ERROR("No admissible degree vector assigned");
     129  if ( typeof(attrib(phi,"isHomog"))=="string" ) {
     130    if (size(phi)==0) { intvec v=0; }
     131    else { ERROR("No admissible degree vector assigned"); }
    127132  }
    128133  else {
     
    174179proc CM_regularity (module M)
    175180"USAGE:   CM_regularity(M);    M module
    176 ASSUME:  @code{M} comes assigned with an admissible degree vector as an
    177          attribute.
     181ASSUME:   @code{M} is graded and is either 0 or comes assigned with an
     182         admissible degree vector as an attribute
    178183RETURN:  integer, the Castelnuovo-Mumford regularity of coker(M)
    179184NOTE:    procedure calls mres
     
    183188{
    184189  if ( typeof(attrib(M,"isHomog"))=="string" ) { 
     190    if (size(M)==0) { attrib(M,"isHomog",0); }
    185191    ERROR("No admissible degree vector assigned");
    186192  } 
     
    208214proc sheafCohBGG(module M,int l,int h)
    209215"USAGE:   sheafCohBGG(M,l,h);    M module, l,h int
    210 ASSUME:  @code{M} comes assigned with an admissible degree vector as an
    211          attribute, @code{h>=l}, and the basering has @code{n+1} variables.
    212 RETURN:  intmat, cohomology of the associated sheaf F of coker(M) on P^n.
    213 DISPLAY: The intmat is displayed in a Betti-like diagram: @*
     216ASSUME:  @code{M} is graded and is either 0 or comes assigned with an
     217         admissible degree vector as an attribute, @code{h>=l}, and the
     218         basering has @code{n+1} variables.
     219RETURN:  intmat, cohomology of twists of the coherent sheaf F on P^n
     220         associated to coker(M). The range of twists is determined by @code{l},
     221         @code{h}.
     222DISPLAY: The intmat is displayed in a diagram of the following form: @*
    214223  @format
    215                 0             1                     h-l
     224                l            l+1                      h
    216225  ----------------------------------------------------------
    217      -h:     h^0(F(h))    h^0(F(h-1))   ......    h^0(F(l))
    218    -h+1:   h^1(F(h-1))    h^1(F(h-2))   ......  h^1(F(l-1))
    219            .........................................
    220    -h+n:   h^n(F(h-n))  h^n(F(h-n-1))   ......  h^n(F(l-n))
     226      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
     227           ...............................................
     228      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
     229      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
    221230  ----------------------------------------------------------
    222   total:         .................................
     231    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
    223232  @end format
    224          A @code{'-'} in the diagram refers to a zero entry, a @code{'*'}
    225          refers to a negative entry (= dimension not yet determined). 
    226 NOTE:    procedure is based on the Bernstein-Gel'fand-Gel'fand correspondence
    227          and on Tate resolution ( see [Eisenbud, Floystad, Schreyer: Sheaf
    228          cohomology and free resolutions over exterior algebras, Trans AMS
    229          355 (2003)] ).
     233         A @code{'-'} in the diagram refers to a zero entry; a @code{'*'}
     234         refers to a negative entry (= dimension not yet determined).
     235         refers to a not computed dimension. @*
     236NOTE:    This procedure is based on the Bernstein-Gel'fand-Gel'fand
     237         correspondence and on Tate resolution ( see [Eisenbud, Floystad,
     238         Schreyer: Sheaf cohomology and free resolutions over exterior
     239         algebras, Trans AMS 355 (2003)] ).@*
     240         @code{sheafCohBGG(M,l,h)} does not compute all values in the above
     241         table. To determine all values of @code{h^i(F(d))}, @code{d=l..h},
     242         use @code{sheafCohBGG(M,l-n,h+n)}.
     243SEE ALSO: sheafCoh, dimH
    230244EXAMPLE: example sheafCohBGG; shows an example
    231245"
    232246{
    233   int i,j,k,row,row1,col;
    234   if( typeof(attrib(M,"isHomog"))!="intvec" )
    235   {
    236      ERROR("The module has no weights");
    237   }
     247  int i,j,k,row,col;
     248  if( typeof(attrib(M,"isHomog"))!="intvec" ) {
     249     if (size(M)==0) { attrib(M,"isHomog",0); }
     250     else { ERROR("No admissible degree vector assigned"); }
     251  }
     252  int n=nvars(basering)-1;
     253  int ell=l+n;
    238254  def R=basering;
    239255  int reg = CM_regularity(M);
     
    243259  MT=transpose(jacobM(MT));
    244260  MT=syz(MT);
    245   int n=nvars(basering);
    246   matrix ML[n][1]=maxideal(1);
     261  matrix ML[n+1][1]=maxideal(1);
    247262  matrix S=transpose(outer(ML,unitmat(m)));
    248263  matrix SS=transpose(S*MT);
     
    255270  intvec w;
    256271  //--- here we are with our matrix
    257   int bound1=max(1,bound-l+1);
     272  int bound1=max(1,bound-ell+1);
    258273  for (i=1; i<=nrows(EM); i++)
    259274  {
     
    264279  intmat Betti=betti(RE);
    265280  k=ncols(Betti);
    266   int d=k-h+l-1;
    267   if (d>0)
    268   {
    269    // select relevant k-d columns from Betti diagram:
    270    row=nrows(Betti);
    271    intmat newBetti[row][k-d]=Betti[1..row,d+1..k];
    272    int shift=attrib(Betti,"rowShift");
    273    attrib(newBetti,"rowShift",shift+d);
    274    Betti=newBetti;
    275   }
    276 
    277   row1=attrib(Betti,"rowShift");
    278281  row=nrows(Betti);
    279   col=ncols(Betti);
    280   if ((row<n) or (row1>-h) ) {
    281    // insert top and bottom zero lines (diagram is n x (h-l+1))
    282    intmat newBetti1[n][col];
    283    for (i=1; i<=row; i++) {
    284      for (j=1; j<=col; j++) {
    285         newBetti1[i+row1+h,j]=Betti[i,j];
    286      }
    287    }
    288    attrib(newBetti1,"rowShift",-h);
    289    Betti=newBetti1;
    290   }
    291   displayCohom(Betti,l,h,n-1);
     282  int shift=attrib(Betti,"rowShift")+(k+ell-1);
     283  intmat newBetti[n+1][h-l+1];
     284  for (j=1; j<=row; j++) {
     285    for (i=l; i<=h; i++) {
     286      if ((k+1-j-i+ell-shift>0) and (j+i-ell+shift>=1)) {
     287        newBetti[n+2-shift-j,i-l+1]=Betti[j,k+1-j-i+ell-shift];
     288      }
     289      else { newBetti[n+2-shift-j,i-l+1]=-1; }
     290    }
     291  }
     292  for (j=2; j<=n+1; j++) {
     293    for (i=1; i<j; i++) {
     294      newBetti[j,i]=-1;
     295    }
     296  }
     297  int d=k-h+ell-1;
     298  for (j=1; j<=n; j++) {
     299    for (i=h-l+1; i>=k+j; i--) {
     300      newBetti[j,i]=-1;
     301    }
     302  }
     303  displayCohom(newBetti,l,h,n);
    292304  setring R;
    293305  return(Betti);
     
    295307  option(noredTail);
    296308}
     309example
     310{"EXAMPLE:";
     311   echo = 2;
     312   // cohomology of structure sheaf on P^4:
     313   //-------------------------------------------
     314   ring r=0,x(1..5),dp;
     315   module M=0;
     316   def A=sheafCohBGG(0,-9,4);
     317   // cohomology of cotangential bundle on P^3:
     318   //-------------------------------------------
     319   ring R=0,(x,y,z,u),dp;
     320   resolution T1=mres(maxideal(1),0);
     321   module M=T1[3];
     322   intvec v=2,2,2,2,2,2;
     323   attrib(M,"isHomog",v);
     324   def B=sheafCohBGG(M,-8,4);
     325}
     326
     327///////////////////////////////////////////////////////////////////////////////
     328
     329proc dimH(int i,module M,int d)
     330"USAGE:   dimH(i,M,d);    M module, i,d int
     331ASSUME:  @code{M} is graded and is either 0 or comes assigned with an
     332         admissible degree vector as an attribute, @code{h>=l}, and the
     333         basering @code{S} has @code{n+1} variables.
     334RETURN:  int,  vector space dimension of @math{H^i(F(d))} for F the coherent
     335         sheaf on P^n associated to coker(M).
     336NOTE:    The procedure is based on local duality as described in [Eisenbud:
     337         Computing cohomology. In Vasconcelos: Computational methods in
     338         commutative algebra and algebraic geometry. Springer (1998)].
     339SEE ALSO: sheafCoh, sheafCohBGG
     340EXAMPLE: example dimH; shows an example
     341"
     342{
     343  if( typeof(attrib(M,"isHomog"))!="intvec" ) {
     344     if (size(M)==0) { attrib(M,"isHomog",0); }
     345     else { ERROR("No admissible degree vector assigned"); }
     346  }
     347  int Result;
     348  int n=nvars(basering)-1;
     349  if ((i>0) and (i<=n)) {
     350    list L=Ext_R(n-i,M,1)[2];
     351    def N=L[1];
     352    return(dimGradedPart(N,-n-1-d));
     353  }
     354  else {
     355    if (i==0) {
     356      list L=Ext_R(intvec(n+1,n+2),M,1)[2];
     357      def N0=L[2];   
     358      def N1=L[1];
     359      Result=dimGradedPart(M,d) - dimGradedPart(N0,-n-1-d)
     360                                - dimGradedPart(N1,-n-1-d);
     361      return(Result);
     362    }
     363    else {
     364      return(0);
     365    }
     366  }
     367
    297368example
    298369{"EXAMPLE:";
     
    303374   intvec v=2,2,2,2,2,2;
    304375   attrib(M,"isHomog",v);
    305    def B=sheafCohBGG(M,-6,2);
    306 }
    307 
    308 ///////////////////////////////////////////////////////////////////////////////
    309 
    310 proc sheafCohE(module M,int l,int h)
    311 "USAGE:   sheafCohE(M,l,h);    M module, l,h int
    312 ASSUME:  @code{M} comes assigned with an admissible degree vector as an
    313          attribute, @code{h>=l}, and the basering @code{S} has @code{n+1}
    314          variables.
    315 RETURN:  intmat, cohomology of the associated sheaf F of coker(M) on P^n.
    316 DISPLAY: The intmat is displayed in a Betti-like diagram: @*
     376   dimH(0,M,2);
     377   dimH(1,M,0);
     378   dimH(2,M,1);
     379   dimH(3,M,-5);
     380}
     381
     382
     383///////////////////////////////////////////////////////////////////////////////
     384
     385proc sheafCoh(module M,int l,int h)
     386"USAGE:   sheafCoh(M,l,h);    M module, l,h int
     387ASSUME:  @code{M} is graded and is either 0 or comes assigned with an
     388         admissible degree vector as an attribute, @code{h>=l}. The basering
     389         @code{S} has @code{n+1} variables.
     390RETURN:  intmat, cohomology of twists of the coherent sheaf F on P^n
     391         associated to coker(M). The range of twists is determined by @code{l},
     392         @code{h}.
     393DISPLAY: The intmat is displayed in a diagram of the following form: @*
    317394  @format
    318                 0             1                     h-l
     395                l            l+1                      h
    319396  ----------------------------------------------------------
    320      -h:     h^0(F(h))    h^0(F(h-1))   ......    h^0(F(l))
    321    -h+1:   h^1(F(h-1))    h^1(F(h-2))   ......  h^1(F(l-1))
    322            .........................................
    323    -h+n:   h^n(F(h-n))  h^n(F(h-n-1))   ......  h^n(F(l-n))
     397      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
     398           ...............................................
     399      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
     400      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
    324401  ----------------------------------------------------------
    325   total:         .................................
     402    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
    326403  @end format
    327          A @code{'-'} in the diagram refers to a zero entry, a @code{'*'}
    328          refers to a negative entry (= dimension not yet determined). 
    329 NOTE:    procedure is based on the local duality as described in [Eisenbud:
     404         A @code{'-'} in the diagram refers to a zero entry.
     405NOTE:    The procedure is based on local duality as described in [Eisenbud:
    330406         Computing cohomology. In Vasconcelos: Computational methods in
    331          commutative algebra and algebraic geometry. Springer (1998)]:
    332    @format
    333            h^i(F(j)) = dim_K Ext_S^(n-i) (M,S)_(-j-n-1).
    334    @end format
    335 EXAMPLE: example sheafCohE; shows an example
     407         commutative algebra and algebraic geometry. Springer (1998)].
     408SEE ALSO: dimH, sheafCohBGG
     409EXAMPLE: example sheafCoh; shows an example
    336410"
    337411{
     412  if( typeof(attrib(M,"isHomog"))!="intvec" ) {
     413     if (size(M)==0) { attrib(M,"isHomog",0); }
     414     else { ERROR("No admissible degree vector assigned"); }
     415  }
    338416  int i,j;
    339   module N;
     417  module N,N0,N1;
    340418  int n=nvars(basering)-1;
    341   intvec v=0..n-1;
     419  intvec v=0..n+1;
    342420  int col=h-l+1;
    343421  intmat newBetti[n+1][col];
    344422  list L=Ext_R(v,M,1)[2];     // list of GB for Ext_R
    345   for (i=1; i<=col; i++) {
    346     newBetti[1,i]=-1;
     423  for (i=l; i<=h; i++) {
     424    N0=L[n+2];   
     425    N1=L[n+1];
     426    newBetti[n+1,i-l+1]=dimGradedPart(M,i) - dimGradedPart(N0,-n-1-i)
     427                             - dimGradedPart(N0,-n-1-i);
    347428  }
    348429  for (j=1; j<=n; j++) {
    349      N=L[n+1-j];
     430     N=L[j];
    350431     attrib(N,"isSB",1);
    351432     if (dim(N)>=0) {
    352        for (i=1; i<=col; i++) {
    353          newBetti[j+1,i]=dimGradedPart(N,-h-n-2+j+i);
     433       for (i=l; i<=h; i++) {
     434         newBetti[j,i-l+1]=dimGradedPart(N,-n-1-i);
    354435       }
    355436     }
     
    361442{"EXAMPLE:";
    362443   echo = 2;
     444   //
     445   // cohomology of structure sheaf on P^4:
     446   //-------------------------------------------
     447   ring r=0,x(1..5),dp;
     448   module M=0;
     449   def A=sheafCoh(0,-7,2);
     450   //
     451   // cohomology of cotangential bundle on P^3:
     452   //-------------------------------------------
    363453   ring R=0,(x,y,z,u),dp;
    364454   resolution T1=mres(maxideal(1),0);
     
    366456   intvec v=2,2,2,2,2,2;
    367457   attrib(M,"isHomog",v);
    368    def B=sheafCohE(M,-6,2);
    369 }
    370 
    371 /*
    372    To compute dim_K Ext_S^(n-j) ( M, S(-n-1) )_i
    373                  = dim_K Ext_S^(n-j) ( M, S )_i-n-1
    374    we just need the following input lines:
    375        
    376        module N = Ext_R(n-j,phi);
    377        homog(N);   // Hier muss man momentan noch von Hand eingreifen...
    378                    // (siehe unten)
    379        dimGradedPart( N, i-n-1);
    380 */
     458   def B=sheafCoh(M,-6,2);
     459}
    381460
    382461///////////////////////////////////////////////////////////////////////////////
     
    384463"USAGE:   displayCohom(data,l,h,n);  data intmat, l,h,n int
    385464ASSUME:  @code{h>=l}, @code{data} is the return value of
    386          @code{sheafCohE(M,l,h)} or of @code{sheafCohBGG(M,l,h)}, and the
     465         @code{sheafCoh(M,l,h)} or of @code{sheafCohBGG(M,l,h)}, and the
    387466         basering has @code{n+1} variables.
    388467RETURN:  none
    389 NOTE:    The intmat is displayed in a Betti-like diagram: @*
     468NOTE:    The intmat is displayed in a diagram of the following form: @*
    390469  @format
    391                 0             1                     h-l
     470                l            l+1                      h
    392471  ----------------------------------------------------------
    393      -h:     h^0(F(h))    h^0(F(h-1))   ......    h^0(F(l))
    394    -h+1:   h^1(F(h-1))    h^1(F(h-2))   ......  h^1(F(l-1))
    395            .........................................
    396    -h+n:   h^n(F(h-n))  h^n(F(h-n-1))   ......  h^n(F(l-n))
     472      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
     473           ...............................................
     474      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
     475      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
    397476  ----------------------------------------------------------
    398   total:         .................................
     477    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
    399478  @end format
    400479         where @code{F} refers to the associated sheaf of @code{M} on P^n.@*
    401          A @code{'-'} in the diagram refers to a zero entry, a @code{'*'}
    402          refers to a negative entry (= dimension not yet determined). 
     480         A @code{'-'} in the diagram refers to a zero entry,  a @code{'*'}
     481         refers to a negative entry (= dimension not yet determined).
    403482EXAMPLE: example truncate; shows an example
    404483"
    405484{
    406   int i,j,k,dat;
     485  int i,j,k,dat,maxL;
    407486  intvec notSumCol;
    408487  notSumCol[h-l+1]=0;
    409488  string s;
    410   string Row="      ";
    411   string Row1="------";
    412   for (i=0; i<=h-l; i++) {
    413     if (i<10) { Row=Row+"     "+string(i); }
    414     else      { Row=Row+"    "+string(i); }
    415     Row1 = Row1+"------";
     489  maxL=4;
     490  for (i=1;i<=nrows(data);i++) {
     491    for (j=1;j<=ncols(data);j++) {
     492      if (size(string(data[i,j]))>=maxL-1) {
     493        maxL=size(string(data[i,j]))+2;
     494      }
     495    }
     496  }
     497  string Row="    ";
     498  string Row1="----";
     499  for (i=l; i<=h; i++) {
     500    for (j=1; j<=maxL-size(string(i)); j++) {
     501      Row=Row+" ";
     502    }
     503    Row=Row+string(i);
     504    for (j=1; j<=maxL; j++) { Row1 = Row1+"-"; }
    416505  }
    417506  print(Row);
    418507  print(Row1);
    419508  for (j=1; j<=n+1; j++) {
    420     s = string(j-h-1);
     509    s = string(n+1-j);
    421510    Row = "";
    422     for(k=1; k<6-size(s); k++) { Row = Row+" "; }
     511    for(k=1; k<4-size(s); k++) { Row = Row+" "; }
    423512    Row = Row + s+":";
    424513    for (i=0; i<=h-l; i++) {
     
    429518        else        { s="*"; notSumCol[i+1]=1; }
    430519      }
    431       for(k=1; k<=6-size(s); k++) { Row = Row+" "; }
     520      for(k=1; k<=maxL-size(s); k++) { Row = Row+" "; }
    432521      Row = Row + s;
    433522    }
     
    435524  }
    436525  print(Row1);
    437   Row="total:";
     526  Row="chi:";
    438527  for (i=0; i<=h-l; i++) {
    439528    dat = 0;
    440529    if (notSumCol[i+1]==0) {
    441       for (j=1; j<=n+1; j++) { dat = dat + data[j,i+1]; }
    442       if (dat>0) { s = string(dat); }
     530      for (j=0; j<=n; j++) { dat = dat + (-1)^j * data[n+1-j,i+1]; }
     531      s = string(dat);
    443532    }
    444533    else { s="*"; }
    445     for (k=1; k<=6-size(s); k++) { Row = Row+" "; }
     534    for (k=1; k<=maxL-size(s); k++) { Row = Row+" "; }
    446535    Row = Row + s;
    447536  }
     
    476565 print(betti(FI),"betti");
    477566 module F=FI[2];
    478  def A1=sheafCohE(F,-2,6);
    479  def A2=sheafCohBGG(F,-2,6);
     567 def A1=sheafCoh(F,-6,6);
     568 def A2=sheafCohBGG(F,-6,6);
    480569
    481570 LIB "sheafcoh.lib";
     
    512601
    513602 module F=FI[2];
    514  def A1=sheafCohE(F,0,8);
    515  def A2=sheafCohBGG(F,0,8);
     603 def A1=sheafCoh(F,-5,7);
     604 def A2=sheafCohBGG(F,-5,7);
    516605
    517606*/
Note: See TracChangeset for help on using the changeset viewer.