source: git/Singular/LIB/sheafcoh.lib @ a25fbca

fieker-DuValspielwiese
Last change on this file since a25fbca was bf7b88, checked in by Hans Schönemann <hannes@…>, 14 years ago
update COPYING git-svn-id: file:///usr/local/Singular/svn/trunk@12482 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 36.5 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2version="$Id$";
3category="Commutative Algebra";
4info="
5LIBRARY:  sheafcoh.lib   Procedures for Computing Sheaf Cohomology
6AUTHORS:  Wolfram Decker, decker@mathematik.uni-kl.de
7@*        Christoph Lossen,  lossen@mathematik.uni-kl.de
8@*        Gerhard Pfister,  pfister@mathematik.uni-kl.de
9@*        Oleksandr Motsak, U@D, where U={motsak}, D={mathematik.uni-kl.de}
10
11PROCEDURES:
12 truncate(phi,d);        truncation of coker(phi) at d
13 truncateFast(phi,d);    truncation of coker(phi) at d (fast+ experimental)
14 CM_regularity(M);       Castelnuovo-Mumford regularity of coker(M)
15 sheafCohBGG(M,l,h);     cohomology of sheaf associated to coker(M)
16 sheafCohBGG2(M,l,h);    cohomology of sheaf associated to coker(M), experimental version
17 sheafCoh(M,l,h);        cohomology of sheaf associated to coker(M)
18 dimH(i,M,d);            compute h^i(F(d)), F sheaf associated to coker(M)
19 dimGradedPart()
20
21AUXILIARY PROCEDURES:
22 displayCohom(B,l,h,n);  display intmat as Betti diagram (with zero rows)
23
24KEYWORDS: sheaf cohomology
25";
26
27///////////////////////////////////////////////////////////////////////////////
28LIB "matrix.lib";
29LIB "nctools.lib";
30LIB "homolog.lib";
31
32
33///////////////////////////////////////////////////////////////////////////////
34static proc jacobM(matrix M)
35{
36   int n=nvars(basering);
37   matrix B=transpose(diff(M,var(1)));
38   int i;
39   for(i=2;i<=n;i++)
40   {
41     B=concat(B,transpose(diff(M,var(i))));
42   }
43   return(transpose(B));
44}
45
46
47///////////////////////////////////////////////////////////////////////////////
48/**
49  let M = { w_1, ..., w_k }, k = size(M) == ncols(M), n = nvars(currRing).
50  assuming that nrows(M) <= m*n;
51  computes transpose(M) * transpose( var(1) I_m | ... | var(n) I_m ) :== transpose(module{f_1, ... f_k}),
52  where f_i = \sum_{j=1}^{m} (w_i, v_j) gen(j),  (w_i, v_j) is a `scalar` multiplication.
53  that is, if w_i = (a^1_1, ... a^1_m) | (a^2_1, ..., a^2_m) | ... | (a^n_1, ..., a^n_m) then
54
55  (a^1_1, ... a^1_m) | (a^2_1, ..., a^2_m) | ... | (a^n_1, ..., a^n_m)
56*  var_1  ... var_1  |  var_2  ...  var_2  | ... |  var_n  ...  var(n)
57*  gen_1  ... gen_m  |  gen_1  ...  gen_m  | ... |  gen_1  ...  gen_m
58+ =>
59  f_i =
60
61   a^1_1 * var(1) * gen(1) + ... + a^1_m * var(1) * gen(m) +
62   a^2_1 * var(2) * gen(1) + ... + a^2_m * var(2) * gen(m) +
63                             ...
64   a^n_1 * var(n) * gen(1) + ... + a^n_m * var(n) * gen(m);
65
66   NOTE: for every f_i we run only ONCE along w_i saving partial sums into a temporary array of polys of size m
67
68*/
69static proc TensorModuleMult(int m, module M)
70{
71  return( system("tensorModuleMult", m, M) ); // trick!
72
73  int n = nvars(basering);
74  int k = ncols(M);
75
76  int g, cc, vv;
77
78  poly h;
79
80  module Temp; // = {f_1, ..., f_k }
81
82  intvec exp;
83  vector pTempSum, w;
84
85  for( int i = k; i > 0; i-- ) // for every w \in M
86  {
87    pTempSum[m] = 0;
88    w = M[i];
89
90    while(w != 0) // for each term of w...
91    {
92      exp = leadexp(w);
93      g = exp[n+1]; // module component!
94      h = w[g];
95
96      w = w - h * gen(g);
97
98      cc = g % m;
99
100      if( cc == 0)
101      {
102        cc = m;
103      }
104
105      vv = 1 + (g - cc) / m;
106
107      pTempSum = pTempSum + h * var(vv) * gen(cc);
108    }
109
110    Temp[i] = pTempSum;
111  }
112
113  Temp = transpose(Temp);
114
115  return(Temp);
116}
117
118///////////////////////////////////////////////////////////////////////////////
119static proc max(int i,int j)
120{
121  if(i>j){return(i);}
122  return(j);
123}
124
125///////////////////////////////////////////////////////////////////////////////
126static proc min(int i,int j)
127{
128  if(i>j){return(j);}
129  return(i);
130}
131
132
133///////////////////////////////////////////////////////////////////////////////
134proc truncate(module phi, int d)
135"USAGE:   truncate(M,d);  M module, d int
136ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
137         vector as an attribute
138RETURN:  module
139NOTE:    Output is a presentation matrix for the truncation of coker(M)
140         at degree d.
141EXAMPLE: example truncate; shows an example
142KEYWORDS: truncated module
143"
144{
145  if ( typeof(attrib(phi,"isHomog"))=="string" ) {
146    if (size(phi)==0) {
147      // assign weights 0 to generators of R^n (n=nrows(phi))
148      intvec v;
149      v[nrows(phi)]=0;
150      attrib(phi,"isHomog",v);
151    }
152    else {
153      ERROR("No admissible degree vector assigned");
154    }
155  }
156  else {
157   intvec v=attrib(phi,"isHomog");
158  }
159  int i,m,dummy;
160  int s = nrows(phi);
161  module L; // TOO BIG!!!
162  for (i=1; i<=s; i++) {
163    if (d>v[i]) {
164      L = L+maxideal(d-v[i])*gen(i);
165    }
166    else {
167      L = L+gen(i);
168    }
169  }
170  L = modulo(L,phi);
171  L = minbase(prune(L));
172  if (size(L)==0) {return(L);}
173
174  // it only remains to set the degrees for L:
175  // ------------------------------------------
176  m = v[1];
177  for(i=2; i<=size(v); i++) {  if(v[i]<m) { m = v[i]; } }
178  dummy = homog(L);
179  intvec vv = attrib(L,"isHomog");
180  if (d>m) { vv = vv+d; }
181  else     { vv = vv+m; }
182  attrib(L,"isHomog",vv);
183  return(L);
184}
185example
186{"EXAMPLE:";
187   echo = 2;
188   ring R=0,(x,y,z),dp;
189   module M=maxideal(3);
190   homog(M);
191   // compute presentation matrix for truncated module (R/<x,y,z>^3)_(>=2)
192   module M2=truncate(M,2);
193   print(M2);
194   dimGradedPart(M2,1);
195   dimGradedPart(M2,2);
196   // this should coincide with:
197   dimGradedPart(M,2);
198   // shift grading by 1:
199   intvec v=1;
200   attrib(M,"isHomog",v);
201   M2=truncate(M,2);
202   print(M2);
203   dimGradedPart(M2,3);
204}
205
206///////////////////////////////////////////////////////////////////////////////
207
208proc truncateFast(module M, int d)
209"USAGE:   truncateFast(M,d);  M module, d int
210ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
211         vector as an attribute 'isHomog'
212RETURN:  module
213NOTE:    Output is a presentation matrix for the truncation of coker(M)
214         at d.
215         Fast + experimental version. M shoud be a SB!
216DISPLAY: If @code{printlevel}>=1, step-by step timings will be printed.
217         If @code{printlevel}>=2 we add progress debug messages
218         if @code{printlevel}>=3, even all intermediate results...
219EXAMPLE: example truncateFast; shows an example
220KEYWORDS: truncated module
221"
222{
223//  int PL = printlevel + 1;
224  int PL = printlevel - voice + 2;
225
226  dbprint(PL-1, "// truncateFast(M: "+ string(nrows(M)) + " x " + string(ncols(M)) +", " + string(d) + "):");
227  dbprint(PL-2, M);
228
229  intvec save = option(get);
230  if( PL >= 2 )
231  {
232    option(prot);
233    option(mem);
234  }
235
236  int tTruncateBegin=timer;
237
238  if (attrib(M,"isSB")!=1)
239  {
240    ERROR("M must be a standard basis!");
241  };
242
243  dbprint(PL-1, "// M is a SB! ");
244
245  if ( typeof(attrib(M,"isHomog"))=="string" ) {
246    if (size(M)==0) {
247      // assign weights 0 to generators of R^n (n=nrows(M))
248      intvec v;
249      v[nrows(M)]=0;
250      attrib(M,"isHomog",v);
251    }
252    else {
253      ERROR("No admissible degree vector assigned");
254    }
255  }
256  else {
257   intvec v=attrib(M,"isHomog");
258  }
259
260  dbprint(PL-1, "// weighting(M): ["+ string(v) + "]");
261
262  int i,m,dummy;
263  int s = nrows(M);
264
265   int tKBaseBegin = timer;
266    module L = kbase(M, d); // TODO: check whether this is always correct!?!
267
268
269    dbprint(PL-1, "// L = kbase(M,d): "+string(nrows(L)) + " x " + string(ncols(L)) +"");
270    dbprint(PL-2, L);
271    dbprint(PL-1, "// weighting(L): ["+ string(attrib(L, "isHomog")) + "]");
272
273   int tModuloBegin = timer;
274    L = modulo(L,M);
275
276    dbprint(PL-1, "// L = modulo(L,M): "+string(nrows(L)) + " x " + string(ncols(L)) +"");
277    dbprint(PL-2, L);
278    dbprint(PL-1, "// weighting(L): ["+ string(attrib(L, "isHomog")) + "]");
279
280   int tPruneBegin = timer;
281    L = prune(L);
282
283    dbprint(PL-1, "// L = prune(L): "+string(nrows(L)) + " x " + string(ncols(L)) +"");
284    dbprint(PL-2, L);
285    dbprint(PL-1, "// weighting(L): ["+ string(attrib(L, "isHomog")) + "]");
286
287   int tPruneEnd = timer;
288    L = minbase(L);
289   int tMinBaseEnd = timer;
290
291    dbprint(PL-1, "// L = minbase(L): "+string(nrows(L)) + " x " + string(ncols(L)) +"");
292    dbprint(PL-2, L);
293    dbprint(PL-1, "// weighting(L): ["+ string(attrib(L, "isHomog")) + "]");
294
295
296
297
298  if (size(L)!=0)
299  {
300
301    // it only remains to set the degrees for L:
302    // ------------------------------------------
303    m = v[1];
304    for(i=2; i<=size(v); i++) {  if(v[i]<m) { m = v[i]; } }
305    dummy = homog(L);
306    intvec vv = attrib(L,"isHomog");
307    if (d>m) { vv = vv+d; }
308    else     { vv = vv+m; }
309    attrib(L,"isHomog",vv);
310  }
311
312  int tTruncateEnd=timer;
313
314  dbprint(PL-1, "// corrected weighting(L): ["+ string(attrib(L, "isHomog")) + "]");
315
316
317  if(PL > 0)
318  {
319  "
320  -------------- TIMINGS --------------
321  Trunc        Time: ", tTruncateEnd - tTruncateBegin, "
322    :: Before .Time: ", tKBaseBegin - tTruncateBegin, "
323    :: kBase   Time: ", tModuloBegin - tKBaseBegin, "
324    :: Modulo  Time: ", tPruneBegin - tModuloBegin, "
325    :: Prune   Time: ", tPruneEnd - tPruneBegin, "
326    :: Minbase Time: ", tMinBaseEnd - tPruneEnd, "
327    :: After  .Time: ", tTruncateEnd - tMinBaseEnd;
328  }
329
330  option(set, save);
331
332  return(L);
333}
334example
335{"EXAMPLE:";
336   echo = 2;
337   ring R=0,(x,y,z,u,v),dp;
338   module M=maxideal(3);
339   homog(M);
340   // compute presentation matrix for truncated module (R/<x,y,z,u>^3)_(>=2)
341   int t=timer;
342   module M2t=truncate(M,2);
343   t = timer - t;
344   "// Simple truncate: ", t;
345   t=timer;
346   module M2=truncateFast(std(M),2);
347   t = timer - t;
348   "// Fast truncate: ", t;
349   print(M2);
350   "// Check: M2t == M2?: ", size(NF(M2, std(M2t))) + size(NF(M2t, std(M2)));
351
352   dimGradedPart(M2,1);
353   dimGradedPart(M2,2);
354   // this should coincide with:
355   dimGradedPart(M,2);
356   // shift grading by 1:
357   intvec v=1;
358   attrib(M,"isHomog",v);
359   t=timer;
360   M2t=truncate(M,2);
361   t = timer - t;
362   "// Simple truncate: ", t;
363   t=timer;
364   M2=truncateFast(std(M),2);
365   t = timer - t;
366   "// Fast truncate: ", t;
367   print(M2);
368   "// Check: M2t == M2?: ", size(NF(M2, std(M2t))) + size(NF(M2t, std(M2))); //?
369   dimGradedPart(M2,3);
370}
371
372///////////////////////////////////////////////////////////////////////////////
373
374
375
376
377
378proc dimGradedPart(module phi, int d)
379"USAGE:   dimGradedPart(M,d);  M module, d int
380ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
381         vector as an attribute
382RETURN:  int
383NOTE:    Output is the vector space dimension of the graded part of degree d
384         of coker(M).
385EXAMPLE: example dimGradedPart; shows an example
386KEYWORDS: graded module, graded piece
387"
388{
389  if ( typeof(attrib(phi,"isHomog"))=="string" ) {
390    if (size(phi)==0) {
391      // assign weights 0 to generators of R^n (n=nrows(phi))
392      intvec v;
393      v[nrows(phi)]=0;
394    }
395    else { ERROR("No admissible degree vector assigned"); }
396  }
397  else {
398    intvec v=attrib(phi,"isHomog");
399  }
400  int s = nrows(phi);
401  int i,m,dummy;
402  module L,LL;
403  for (i=1; i<=s; i++) {
404    if (d>v[i]) {
405      L = L+maxideal(d-v[i])*gen(i);
406      LL = LL+maxideal(d+1-v[i])*gen(i);
407    }
408    else {
409      L = L+gen(i);
410      if (d==v[i]) {
411        LL = LL+maxideal(1)*gen(i);
412      }
413      else {
414        LL = LL+gen(i);
415      }
416    }
417  }
418  LL=LL,phi;
419  L = modulo(L,LL);
420  L = std(prune(L));
421  if (size(L)==0) {return(0);}
422  return(vdim(L));
423}
424example
425{"EXAMPLE:";
426   echo = 2;
427   ring R=0,(x,y,z),dp;
428   module M=maxideal(3);
429   // assign compatible weight vector (here: 0)
430   homog(M);
431   // compute dimension of graded pieces of R/<x,y,z>^3 :
432   dimGradedPart(M,0);
433   dimGradedPart(M,1);
434   dimGradedPart(M,2);
435   dimGradedPart(M,3);
436   // shift grading:
437   attrib(M,"isHomog",intvec(2));
438   dimGradedPart(M,2);
439}
440
441///////////////////////////////////////////////////////////////////////////////
442
443proc CM_regularity (module M)
444"USAGE:   CM_regularity(M);    M module
445ASSUME:   @code{M} is graded, and it comes assigned with an admissible degree
446         vector as an attribute
447RETURN:  integer, the Castelnuovo-Mumford regularity of coker(M)
448NOTE:    procedure calls mres
449EXAMPLE: example CM_regularity; shows an example
450KEYWORDS: Castelnuovo-Mumford regularity
451"
452{
453  if ( typeof(attrib(M,"isHomog"))=="string" ) {
454    if (size(M)==0) {
455      // assign weights 0 to generators of R^n (n=nrows(M))
456      intvec v;
457      v[nrows(M)]=0;
458      attrib(M,"isHomog",v);
459    }
460    else {
461      ERROR("No admissible degree vector assigned");
462    }
463  }
464
465  if( attrib(CM_regularity,"Algorithm") != "mres" )
466  {
467    def L = minres( res(M,0) ); // let's try it out!
468  } else
469  {
470    def L = mres(M,0);
471  }
472
473  intmat BeL = betti(L);
474  int r = nrows(module(matrix(BeL)));  // last non-zero row
475  if (typeof(attrib(BeL,"rowShift"))!="string") {
476    int shift = attrib(BeL,"rowShift");
477  }
478  return(r+shift-1);
479}
480example
481{"EXAMPLE:";
482   echo = 2;
483   ring R=0,(x,y,z,u),dp;
484   resolution T1=mres(maxideal(1),0);
485   module M=T1[3];
486   intvec v=2,2,2,2,2,2;
487   attrib(M,"isHomog",v);
488   CM_regularity(M);
489}
490
491///////////////////////////////////////////////////////////////////////////////
492proc sheafCohBGG(module M,int l,int h)
493"USAGE:   sheafCohBGG(M,l,h);    M module, l,h int
494ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
495         vector as an attribute, @code{h>=l}, and the basering has @code{n+1}
496         variables.
497RETURN:  intmat, cohomology of twists of the coherent sheaf F on P^n
498         associated to coker(M). The range of twists is determined by @code{l},
499         @code{h}.
500DISPLAY: The intmat is displayed in a diagram of the following form: @*
501  @format
502                l            l+1                      h
503  ----------------------------------------------------------
504      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
505           ...............................................
506      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
507      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
508  ----------------------------------------------------------
509    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
510  @end format
511         A @code{'-'} in the diagram refers to a zero entry; a @code{'*'}
512         refers to a negative entry (= dimension not yet determined).
513         refers to a not computed dimension. @*
514NOTE:    This procedure is based on the Bernstein-Gel'fand-Gel'fand
515         correspondence and on Tate resolution ( see [Eisenbud, Floystad,
516         Schreyer: Sheaf cohomology and free resolutions over exterior
517         algebras, Trans AMS 355 (2003)] ).@*
518         @code{sheafCohBGG(M,l,h)} does not compute all values in the above
519         table. To determine all values of @code{h^i(F(d))}, @code{d=l..h},
520         use @code{sheafCohBGG(M,l-n,h+n)}.
521SEE ALSO: sheafCoh, dimH
522EXAMPLE: example sheafCohBGG; shows an example
523"
524{
525  int i,j,k,row,col;
526  if( typeof(attrib(M,"isHomog"))!="intvec" )
527  {
528     if (size(M)==0) { attrib(M,"isHomog",0); }
529     else { ERROR("No admissible degree vector assigned"); }
530  }
531  int n=nvars(basering)-1;
532  int ell=l+n;
533  def R=basering;
534  int reg = CM_regularity(M);
535  int bound=max(reg+1,h-1);
536  module MT=truncate(M,bound);
537  int m=nrows(MT);
538  MT=transpose(jacobM(MT));
539  MT=syz(MT);
540  matrix ML[n+1][1]=maxideal(1);
541  matrix S=transpose(outer(ML,unitmat(m)));
542  matrix SS=transpose(S*MT);
543  //--- to the exterior algebra
544  def AR = Exterior();
545  setring AR;
546  option(redSB);
547  option(redTail);
548  module EM=imap(R,SS);
549  intvec w;
550  //--- here we are with our matrix
551  int bound1=max(1,bound-ell+1);
552  for (i=1; i<=nrows(EM); i++)
553  {
554     w[i]=-bound-1;
555  }
556  attrib(EM,"isHomog",w);
557  resolution RE=mres(EM,bound1);
558  intmat Betti=betti(RE);
559  k=ncols(Betti);
560  row=nrows(Betti);
561  int shift=attrib(Betti,"rowShift")+(k+ell-1);
562  intmat newBetti[n+1][h-l+1];
563  for (j=1; j<=row; j++)
564  {
565    for (i=l; i<=h; i++)
566    {
567      if ((k+1-j-i+ell-shift>0) and (j+i-ell+shift>=1))
568      {
569        newBetti[n+2-shift-j,i-l+1]=Betti[j,k+1-j-i+ell-shift];
570      }
571      else { newBetti[n+2-shift-j,i-l+1]=-1; }
572    }
573  }
574  for (j=2; j<=n+1; j++)
575  {
576    for (i=1; i<j; i++)
577    {
578      newBetti[j,i]=-1;
579    }
580  }
581  int d=k-h+ell-1;
582  for (j=1; j<=n; j++)
583  {
584    for (i=h-l+1; i>=k+j; i--)
585    {
586      newBetti[j,i]=-1;
587    }
588  }
589  displayCohom(newBetti,l,h,n);
590  setring R;
591  return(newBetti);
592  option(noredSB);
593  option(noredTail);
594}
595example
596{"EXAMPLE:";
597   echo = 2;
598   // cohomology of structure sheaf on P^4:
599   //-------------------------------------------
600   ring r=0,x(1..5),dp;
601   module M=0;
602   def A=sheafCohBGG(0,-9,4);
603   // cohomology of cotangential bundle on P^3:
604   //-------------------------------------------
605   ring R=0,(x,y,z,u),dp;
606   resolution T1=mres(maxideal(1),0);
607   module M=T1[3];
608   intvec v=2,2,2,2,2,2;
609   attrib(M,"isHomog",v);
610   def B=sheafCohBGG(M,-8,4);
611}
612
613
614///////////////////////////////////////////////////////////////////////////////
615static proc showResult( def R, int l, int h )
616{
617  int PL = printlevel - voice + 2;
618// int PL = printlevel + 1;
619
620  intmat Betti;
621  if(typeof(R)=="resolution")
622  {
623    Betti = betti(R);
624  } else
625  {
626    if(typeof(R)!="intmat")
627    {
628      ERROR("Wrong input!!!");
629    };
630
631    Betti = R;
632  }
633
634  int n=nvars(basering)-1;
635  int ell = l + n;
636
637  int k     = ncols(Betti);
638  int row   = nrows(Betti);
639  int shift = attrib(Betti,"rowShift") + (k + ell - 1);
640
641  intmat newBetti[ n + 1 ][ h - l + 1 ];
642
643  int i, j;
644
645  for (j=1; j<=row; j++) {
646    for (i=l; i<=h; i++) {
647      if( (n+2-shift-j)>0 ) {
648
649        if (  (k+1-j-i+ell-shift>0) and (j+i-ell+shift>=1)) {
650          newBetti[n+2-shift-j,i-l+1]=Betti[j,k+1-j-i+ell-shift];
651        }
652        else { newBetti[n+2-shift-j,i-l+1]=-1; }
653
654      }
655    }
656  }
657
658  int iWTH = h-l+1;
659  for (j=2; j<=n+1; j++) {
660    for (i=1; i<min(j, iWTH); i++) {
661      newBetti[j,i]=-1;
662    }
663  }
664  int d = k - h + ell - 1;
665  for (j=1; j<=n; j++) {
666    for (i=iWTH; i>=k+j; i--) {
667      newBetti[j,i]=-1;
668    }
669  }
670
671  if( PL > 0 )
672  {
673    "Cohomology table:";
674    displayCohom(newBetti, l, h, n);
675  }
676
677  return(newBetti);
678}
679///////////////////////////////////////////////////////////////////////////////
680
681
682
683///////////////////////////////////////////////////////////////////////////////
684proc sheafCohBGG2(module M,int l,int h)
685"USAGE:   sheafCohBGG2(M,l,h);    M module, l,h int
686ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
687         vector as an attribute, @code{h>=l}, and the basering has @code{n+1}
688         variables.
689RETURN:  intmat, cohomology of twists of the coherent sheaf F on P^n
690         associated to coker(M). The range of twists is determined by @code{l},
691         @code{h}.
692DISPLAY: The intmat is displayed in a diagram of the following form: @*
693  @format
694                l            l+1                      h
695  ----------------------------------------------------------
696      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
697           ...............................................
698      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
699      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
700  ----------------------------------------------------------
701    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
702  @end format
703         A @code{'-'} in the diagram refers to a zero entry; a @code{'*'}
704         refers to a negative entry (= dimension not yet determined).
705         refers to a not computed dimension. @*
706         If @code{printlevel}>=1, step-by step timings will be printed.
707         If @code{printlevel}>=2 we add progress debug messages
708         if @code{printlevel}>=3, even all intermediate results...
709NOTE:    This procedure is based on the Bernstein-Gel'fand-Gel'fand
710         correspondence and on Tate resolution ( see [Eisenbud, Floystad,
711         Schreyer: Sheaf cohomology and free resolutions over exterior
712         algebras, Trans AMS 355 (2003)] ).@*
713         @code{sheafCohBGG(M,l,h)} does not compute all values in the above
714         table. To determine all values of @code{h^i(F(d))}, @code{d=l..h},
715         use @code{sheafCohBGG(M,l-n,h+n)}.
716         Experimental version. Should require less memory.
717SEE ALSO: sheafCohBGG
718EXAMPLE: example sheafCohBGG2; shows an example
719"
720{
721  int PL = printlevel - voice + 2;
722//  int PL = printlevel;
723
724  dbprint(PL-1, "// sheafCohBGG2(M: "+ string(nrows(M)) + " x " + string(ncols(M)) +", " + string(l) + ", " + string(h) + "):");
725  dbprint(PL-2, M);
726
727  intvec save = option(get);
728
729  if( PL >= 2 )
730  {
731    option(prot);
732    option(mem);
733  }
734
735  def isCoker = attrib(M, "isCoker");
736  if( typeof(isCoker) == "int" )
737  {
738    if( isCoker > 0 )
739    {
740      dbprint(PL-1, "We are going to assume that M is given by coker matrix (that is, M is not a submodule presentation!)");
741    }
742  }
743
744  int i,j,k,row,col;
745
746  if( typeof(attrib(M,"isHomog"))!="intvec" )
747  {
748     if (size(M)==0) { attrib(M,"isHomog",0); }
749     else { ERROR("No admissible degree vector assigned"); }
750  }
751
752  dbprint(PL-1, "// weighting(M): ["+ string(attrib(M, "isHomog")) + "]");
753
754  option(redSB); option(redTail);
755
756  def R=basering;
757
758  int n = nvars(R) - 1;
759  int ell = l + n;
760
761
762/////////////////////////////////////////////////////////////////////////////
763// computations
764
765  int tBegin=timer;
766  int reg   = CM_regularity(M);
767  int tCMEnd = timer;
768
769  dbprint(PL-1, "// CM_reg(M): "+ string(reg));
770
771  int bound = max(reg + 1, h - 1);
772
773  dbprint(PL-1, "// bound: "+ string(bound));
774
775  ///////////////////////////////////////////////////////////////
776  int tSTDBegin=timer;
777  M = std(M); // for kbase! // NOTE: this should be after CM_regularity, since otherwise CM_regularity computes JUST TOOOOOOO LONG sometimes (see Reg_Hard examples!)
778  int tSTDEnd = timer;
779
780  dbprint(PL-1, "// M = std(M: "+string(nrows(M)) + " x " + string(ncols(M))  + ")");
781  dbprint(PL-2, M);
782  dbprint(PL-1, "// weighting(M): ["+ string(attrib(M, "isHomog")) + "]");
783
784
785  printlevel = printlevel + 1;
786  int tTruncateBegin=timer;
787  module MT = truncateFast(M, bound);
788  int tTruncateEnd=timer;
789  printlevel = printlevel - 1;
790
791  dbprint(PL-1, "// MT = truncateFast(M: "+string(nrows(MT)) + " x " + string(ncols(MT)) +", " + string(bound) + ")");
792  dbprint(PL-2, MT);
793  dbprint(PL-1, "// weighting(MT): ["+ string(attrib(MT, "isHomog")) + "]");
794
795  int m=nrows(MT);
796
797  ///////////////////////////////////////////////////////////////
798  int tTransposeJacobBegin=timer;
799  MT = jacob(MT); // ! :(
800  int tTransposeJacobEnd=timer;
801
802  dbprint(PL-1, "// MT = jacob(MT: "+string(nrows(MT)) + " x " + string(ncols(MT))  + ")");
803  dbprint(PL-2, MT);
804  dbprint(PL-1, "// weighting(MT): ["+ string(attrib(MT, "isHomog")) + "]");
805
806  int tSyzBegin=timer;
807  MT = syz(MT);
808  int tSyzEnd=timer;
809
810  dbprint(PL-1, "// MT = syz(MT: "+string(nrows(MT)) + " x " + string(ncols(MT))  + ")");
811  dbprint(PL-2, MT);
812  dbprint(PL-1, "// weighting(MT): ["+ string(attrib(MT, "isHomog")) + "]");
813
814  int tMatrixOppBegin=timer;
815  module SS = TensorModuleMult(m, MT);
816  int tMatrixOppEnd=timer;
817
818  dbprint(PL-1, "// SS = TensorModuleMult("+ string(m)+ ", MT: "+string(nrows(MT)) + " x " + string(ncols(MT))  + ")");
819  dbprint(PL-2, SS);
820  dbprint(PL-1, "// weighting(SS): ["+ string(attrib(SS, "isHomog")) + "]");
821
822  //--- to the exterior algebra
823  def AR = Exterior(); setring AR;
824
825  dbprint(PL-1, "// Test: var(1) * var(1): "+ string(var(1) * var(1)));
826
827  int maxbound = max(1, bound - ell + 1);
828//  int maxbound = max(1, bound - l + 1); // As In M2!!!
829
830  dbprint(PL-1, "// maxbound: "+ string(maxbound));
831
832  //--- here we are with our matrix
833  module EM=imap(R,SS);
834  intvec w;
835  for (i=1; i<=nrows(EM); i++)
836  {
837     w[i]=-bound-1;
838  }
839
840  attrib(EM,"isHomog",w);
841
842  ///////////////////////////////////////////////////////////////
843
844  dbprint(PL-1, "// EM: "+string(nrows(EM)) + " x " + string(ncols(EM))  + ")");
845  dbprint(PL-2, EM);
846  dbprint(PL-1, "// weighting(EM): ["+ string(attrib(EM, "isHomog")) + "]");
847
848  int tResulutionBegin=timer;
849  resolution RE = nres(EM, maxbound);
850  int tMinResBegin=timer;
851  RE = minres(RE);
852  int tBettiBegin=timer;
853  intmat Betti = betti(RE); // betti(RE, 1);?
854  int tResulutionEnd=timer;
855
856  int tEnd = tResulutionEnd;
857
858  if( PL > 0 )
859  {
860    "
861        ----      RESULTS  ----
862        Tate Resolution (Length: ", size(RE), "):
863    ";
864    RE;
865    "Betti numbers for Tate resolution (diagonal cohomology table):";
866    print(Betti, "betti"); // Diagonal form!
867  };
868
869  printlevel = printlevel + 1;
870  Betti = showResult(Betti, l, h ); // Show usual form of cohomology table
871  printlevel = printlevel - 1;
872
873  if(PL > 0)
874  {
875  "
876      ----      TIMINGS     -------
877      Trunc      Time: ", tTruncateEnd - tTruncateBegin, "
878      Reg        Time: ", tCMEnd - tBegin, "
879      kStd       Time: ", tSTDEnd - tSTDBegin, "
880      Jacob      Time: ", tTransposeJacobEnd - tTransposeJacobBegin, "
881      Syz        Time: ", tSyzEnd - tSyzBegin, "
882      Mat        Time: ", tMatrixOppEnd - tMatrixOppBegin, "
883      ------------------------------
884      Res        Time: ", tResulutionEnd - tResulutionBegin, "
885      :: NRes    Time: ", tMinResBegin - tResulutionBegin, "
886      :: MinRes .Time: ", tBettiBegin - tMinResBegin, "
887      :: Betti  .Time: ", tResulutionEnd - tBettiBegin, "
888      ---------------------------------------------------------
889      Total Time: ", tEnd - tBegin, "
890      ---------------------------------------------------------
891      ";
892  };
893
894  setring R;
895
896  option(set, save);
897
898  return(Betti);
899}
900example
901{"EXAMPLE:";
902   echo = 2;
903   int pl = printlevel;
904   // cohomology of structure sheaf on P^4:
905   //-------------------------------------------
906   ring r=32001,x(1..5),dp;
907   module M= getStructureSheaf();
908
909   int t = timer;
910   def A=sheafCohBGG(0,-9,4);
911   timer - t;
912
913   printlevel = voice; A=sheafCohBGG2(0,-9,4); printlevel = pl;
914
915   // cohomology of cotangential bundle on P^3:
916   //-------------------------------------------
917   ring R=32001,(x,y,z,u),dp;
918
919   module M = getCotangentialBundle();
920
921   int t = timer;
922   def B=sheafCohBGG(M,-8,4);
923   timer - t;
924
925   printlevel = voice; B=sheafCohBGG2(M,-8,4); printlevel = pl;
926}
927
928
929///////////////////////////////////////////////////////////////////////////////
930
931proc dimH(int i,module M,int d)
932"USAGE:   dimH(i,M,d);    M module, i,d int
933ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
934         vector as an attribute, @code{h>=l}, and the basering @code{S} has
935         @code{n+1} variables.
936RETURN:  int,  vector space dimension of @math{H^i(F(d))} for F the coherent
937         sheaf on P^n associated to coker(M).
938NOTE:    The procedure is based on local duality as described in [Eisenbud:
939         Computing cohomology. In Vasconcelos: Computational methods in
940         commutative algebra and algebraic geometry. Springer (1998)].
941SEE ALSO: sheafCoh, sheafCohBGG
942EXAMPLE: example dimH; shows an example
943"
944{
945  if( typeof(attrib(M,"isHomog"))=="string" )
946  {
947    if (size(M)==0)
948    {
949      // assign weights 0 to generators of R^n (n=nrows(M))
950      intvec v;
951      v[nrows(M)]=0;
952      attrib(M,"isHomog",v);
953    }
954    else
955    {
956      ERROR("No admissible degree vector assigned");
957    }
958  }
959  int Result;
960  int n=nvars(basering)-1;
961  if ((i>0) and (i<=n)) {
962    list L=Ext_R(n-i,M,1)[2];
963    def N=L[1];
964    return(dimGradedPart(N,-n-1-d));
965  }
966  else
967  {
968    if (i==0)
969    {
970      list L=Ext_R(intvec(n+1,n+2),M,1)[2];
971      def N0=L[2];
972      def N1=L[1];
973      Result=dimGradedPart(M,d) - dimGradedPart(N0,-n-1-d)
974                                - dimGradedPart(N1,-n-1-d);
975      return(Result);
976    }
977    else {
978      return(0);
979    }
980  }
981}
982example
983{"EXAMPLE:";
984   echo = 2;
985   ring R=0,(x,y,z,u),dp;
986   resolution T1=mres(maxideal(1),0);
987   module M=T1[3];
988   intvec v=2,2,2,2,2,2;
989   attrib(M,"isHomog",v);
990   dimH(0,M,2);
991   dimH(1,M,0);
992   dimH(2,M,1);
993   dimH(3,M,-5);
994}
995
996
997///////////////////////////////////////////////////////////////////////////////
998
999proc sheafCoh(module M,int l,int h,list #)
1000"USAGE:   sheafCoh(M,l,h);    M module, l,h int
1001ASSUME:  @code{M} is graded, and it comes assigned with an admissible degree
1002         vector as an attribute, @code{h>=l}. The basering @code{S} has
1003         @code{n+1} variables.
1004RETURN:  intmat, cohomology of twists of the coherent sheaf F on P^n
1005         associated to coker(M). The range of twists is determined by @code{l},
1006         @code{h}.
1007DISPLAY: The intmat is displayed in a diagram of the following form: @*
1008  @format
1009                l            l+1                      h
1010  ----------------------------------------------------------
1011      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
1012           ...............................................
1013      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
1014      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
1015  ----------------------------------------------------------
1016    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
1017  @end format
1018         A @code{'-'} in the diagram refers to a zero entry.
1019NOTE:    The procedure is based on local duality as described in [Eisenbud:
1020         Computing cohomology. In Vasconcelos: Computational methods in
1021         commutative algebra and algebraic geometry. Springer (1998)].@*
1022         By default, the procedure uses @code{mres} to compute the Ext
1023         modules. If called with the additional parameter @code{\"sres\"},
1024         the @code{sres} command is used instead.
1025SEE ALSO: dimH, sheafCohBGG
1026EXAMPLE: example sheafCoh; shows an example
1027"
1028{
1029  int use_sres;
1030  if( typeof(attrib(M,"isHomog"))!="intvec" )
1031  {
1032     if (size(M)==0) { attrib(M,"isHomog",0); }
1033     else { ERROR("No admissible degree vector assigned"); }
1034  }
1035  if (size(#)>0)
1036  {
1037    if (#[1]=="sres") { use_sres=1; }
1038  }
1039  int i,j;
1040  module N,N0,N1;
1041  int n=nvars(basering)-1;
1042  intvec v=0..n+1;
1043  int col=h-l+1;
1044  intmat newBetti[n+1][col];
1045  if (use_sres) { list L=Ext_R(v,M,1,"sres")[2]; }
1046  else          { list L=Ext_R(v,M,1)[2]; }
1047  for (i=l; i<=h; i++)
1048  {
1049    N0=L[n+2];
1050    N1=L[n+1];
1051    newBetti[n+1,i-l+1]=dimGradedPart(M,i) - dimGradedPart(N0,-n-1-i)
1052                             - dimGradedPart(N0,-n-1-i);
1053  }
1054  for (j=1; j<=n; j++)
1055  {
1056     N=L[j];
1057     attrib(N,"isSB",1);
1058     if (dim(N)>=0) {
1059       for (i=l; i<=h; i++)
1060       {
1061         newBetti[j,i-l+1]=dimGradedPart(N,-n-1-i);
1062       }
1063     }
1064  }
1065  displayCohom(newBetti,l,h,n);
1066  return(newBetti);
1067}
1068example
1069{"EXAMPLE:";
1070   echo = 2;
1071   //
1072   // cohomology of structure sheaf on P^4:
1073   //-------------------------------------------
1074   ring r=0,x(1..5),dp;
1075   module M=0;
1076   def A=sheafCoh(0,-7,2);
1077   //
1078   // cohomology of cotangential bundle on P^3:
1079   //-------------------------------------------
1080   ring R=0,(x,y,z,u),dp;
1081   resolution T1=mres(maxideal(1),0);
1082   module M=T1[3];
1083   intvec v=2,2,2,2,2,2;
1084   attrib(M,"isHomog",v);
1085   def B=sheafCoh(M,-6,2);
1086}
1087
1088///////////////////////////////////////////////////////////////////////////////
1089proc displayCohom (intmat data, int l, int h, int n)
1090"USAGE:   displayCohom(data,l,h,n);  data intmat, l,h,n int
1091ASSUME:  @code{h>=l}, @code{data} is the return value of
1092         @code{sheafCoh(M,l,h)} or of @code{sheafCohBGG(M,l,h)}, and the
1093         basering has @code{n+1} variables.
1094RETURN:  none
1095NOTE:    The intmat is displayed in a diagram of the following form: @*
1096  @format
1097                l            l+1                      h
1098  ----------------------------------------------------------
1099      n:     h^n(F(l))    h^n(F(l+1))   ......    h^n(F(h))
1100           ...............................................
1101      1:     h^1(F(l))    h^1(F(l+1))   ......    h^1(F(h))
1102      0:     h^0(F(l))    h^0(F(l+1))   ......    h^0(F(h))
1103  ----------------------------------------------------------
1104    chi:     chi(F(l))    chi(F(l+1))   ......    chi(F(h))
1105  @end format
1106         where @code{F} refers to the associated sheaf of @code{M} on P^n.@*
1107         A @code{'-'} in the diagram refers to a zero entry,  a @code{'*'}
1108         refers to a negative entry (= dimension not yet determined).
1109"
1110{
1111  int i,j,k,dat,maxL;
1112  intvec notSumCol;
1113  notSumCol[h-l+1]=0;
1114  string s;
1115  maxL=4;
1116  for (i=1;i<=nrows(data);i++)
1117  {
1118    for (j=1;j<=ncols(data);j++)
1119    {
1120      if (size(string(data[i,j]))>=maxL-1)
1121      {
1122        maxL=size(string(data[i,j]))+2;
1123      }
1124    }
1125  }
1126  string Row="    ";
1127  string Row1="----";
1128  for (i=l; i<=h; i++) {
1129    for (j=1; j<=maxL-size(string(i)); j++)
1130    {
1131      Row=Row+" ";
1132    }
1133    Row=Row+string(i);
1134    for (j=1; j<=maxL; j++) { Row1 = Row1+"-"; }
1135  }
1136  print(Row);
1137  print(Row1);
1138  for (j=1; j<=n+1; j++)
1139  {
1140    s = string(n+1-j);
1141    Row = "";
1142    for(k=1; k<4-size(s); k++) { Row = Row+" "; }
1143    Row = Row + s+":";
1144    for (i=0; i<=h-l; i++)
1145    {
1146      dat = data[j,i+1];
1147      if (dat>0) { s = string(dat); }
1148      else
1149      {
1150        if (dat==0) { s="-"; }
1151        else        { s="*"; notSumCol[i+1]=1; }
1152      }
1153      for(k=1; k<=maxL-size(s); k++) { Row = Row+" "; }
1154      Row = Row + s;
1155    }
1156    print(Row);
1157  }
1158  print(Row1);
1159  Row="chi:";
1160  for (i=0; i<=h-l; i++)
1161  {
1162    dat = 0;
1163    if (notSumCol[i+1]==0)
1164    {
1165      for (j=0; j<=n; j++) { dat = dat + (-1)^j * data[n+1-j,i+1]; }
1166      s = string(dat);
1167    }
1168    else { s="*"; }
1169    for (k=1; k<=maxL-size(s); k++) { Row = Row+" "; }
1170    Row = Row + s;
1171  }
1172  print(Row);
1173}
1174///////////////////////////////////////////////////////////////////////////////
1175
1176proc getStructureSheaf(list #)
1177{
1178
1179  if( size(#) == 0 )
1180  {
1181    module M = 0;
1182    intvec v = 0;
1183    attrib(M,"isHomog",v);
1184    homog(M);
1185
1186    attrib(M, "isCoker", 1);
1187
1188    attrib(M);
1189    return(M);
1190  };
1191
1192  if( typeof(#[1]) == "ideal")
1193  {
1194    ideal I = #[1];
1195
1196    if( size(#) == 2 )
1197    {
1198      if( typeof(#[2]) == "int" )
1199      {
1200        if( #[2] != 0 )
1201        {
1202          qring @@@@QQ = std(I);
1203
1204          module M = getStructureSheaf();
1205
1206          export M;
1207
1208//          keepring @@@@QQ; // This is a bad idea... :(
1209          return (@@@@QQ);
1210        }
1211      }
1212    }
1213
1214/*
1215    // This seems to be wrong!!!
1216    module M = I * gen(1);
1217    homog(M);
1218
1219    M = modulo(gen(1), module(I * gen(1))); // basering^1 / I
1220
1221    homog(M);
1222
1223    attrib(M, "isCoker", 1);
1224
1225    attrib(M);
1226    return(M);
1227*/
1228  }
1229
1230  ERROR("Wrong argument");
1231
1232}
1233example
1234{"EXAMPLE:";
1235   echo = 2; int pl = printlevel;
1236   printlevel = voice;
1237
1238
1239   ////////////////////////////////////////////////////////////////////////////////
1240   ring r;
1241   module M = getStructureSheaf();
1242   "Basering: ";
1243   basering;
1244   "Module: ", string(M), ", grading is given by weights: ", attrib(M, "isHomog");
1245
1246   def A=sheafCohBGG2(M,-9,9);
1247   print(A);
1248
1249   ////////////////////////////////////////////////////////////////////////////////
1250   setring r;
1251   module M = getStructureSheaf(ideal(var(1)), 0);
1252
1253   "Basering: ";
1254   basering;
1255   "Module: ", string(M), ", grading is given by weights: ", attrib(M, "isHomog");
1256
1257   def A=sheafCohBGG2(M,-9,9);
1258   print(A);
1259
1260   ////////////////////////////////////////////////////////////////////////////////
1261   setring r;
1262   def Q = getStructureSheaf(ideal(var(1)), 1); // returns a new ring!
1263   setring Q; // M was exported in the new ring!
1264
1265   "Basering: ";
1266   basering;
1267   "Module: ", string(M), ", grading is given by weights: ", attrib(M, "isHomog");
1268
1269   def A=sheafCohBGG2(M,-9,9);
1270   print(A);
1271
1272   printlevel = pl;
1273}
1274
1275
1276proc getCotangentialBundle()
1277{
1278  resolution T1=mres(maxideal(1),3);
1279  module M=T1[3];
1280  attrib(M,"isHomog");
1281  homog(M);
1282  attrib(M, "isCoker", 1);
1283  attrib(M);
1284  return (M);
1285};
1286
1287proc getIdealSheafPullback(ideal I, ideal pi)
1288{
1289  def save = basering;
1290  map P = save, pi;
1291  return( P(I) );
1292}
1293
1294// TODO: set attributes!
1295
1296
1297proc getIdealSheaf(ideal I)
1298{
1299  resolution FI = mres(I,2); // Syz + grading...
1300  module M = FI[2];
1301  attrib(M, "isCoker", 1);
1302  attrib(M);
1303  return(M);
1304};
1305
1306
1307
1308
1309
1310/*
1311Examples:
1312---------
1313 LIB "sheafcoh.lib";
1314
1315 ring S = 32003, x(0..4), dp;
1316 module MI=maxideal(1);
1317 attrib(MI,"isHomog",intvec(-1));
1318 resolution kos = nres(MI,0);
1319 print(betti(kos),"betti");
1320 LIB "random.lib";
1321 matrix alpha0 = random(32002,10,3);
1322 module pres = module(alpha0)+kos[3];
1323 attrib(pres,"isHomog",intvec(1,1,1,1,1,1,1,1,1,1));
1324 resolution fcokernel = mres(pres,0);
1325 print(betti(fcokernel),"betti");
1326 module dir = transpose(pres);
1327 attrib(dir,"isHomog",intvec(-1,-1,-1,-2,-2,-2,
1328                             -2,-2,-2,-2,-2,-2,-2));
1329 resolution fdir = mres(dir,2);
1330 print(betti(fdir),"betti");
1331 ideal I = groebner(flatten(fdir[2]));
1332 resolution FI = mres(I,0);
1333 print(betti(FI),"betti");
1334 module F=FI[2];
1335 int t=timer;
1336 def A1=sheafCoh(F,-8,8);
1337 timer-t;
1338 t=timer;
1339 def A2=sheafCohBGG(F,-8,8);
1340 timer-t;
1341
1342 LIB "sheafcoh.lib";
1343 LIB "random.lib";
1344 ring S = 32003, x(0..4), dp;
1345 resolution kos = nres(maxideal(1),0);
1346 betti(kos);
1347 matrix kos5 = kos[5];
1348 matrix tphi = transpose(dsum(kos5,kos5));
1349 matrix kos3 = kos[3];
1350 matrix psi = dsum(kos3,kos3);
1351 matrix beta1 = random(32002,20,2);
1352 matrix tbeta1tilde = transpose(psi*beta1);
1353 matrix tbeta0 = lift(tphi,tbeta1tilde);
1354 matrix kos4 = kos[4];
1355 matrix tkos4pluskos4 = transpose(dsum(kos4,kos4));
1356 matrix tgammamin1 = random(32002,20,1);
1357 matrix tgamma0 = tkos4pluskos4*tgammamin1;
1358 matrix talpha0 = concat(tbeta0,tgamma0);
1359 matrix zero[20][1];
1360 matrix tpsi = transpose(psi);
1361 matrix tpresg = concat(tpsi,zero);
1362 matrix pres = module(transpose(talpha0))
1363                    + module(transpose(tpresg));
1364 module dir = transpose(pres);
1365 dir = prune(dir);
1366 homog(dir);
1367 intvec deg_dir = attrib(dir,"isHomog");
1368 attrib(dir,"isHomog",deg_dir-2);        // set degrees
1369 resolution fdir = mres(prune(dir),2);
1370 print(betti(fdir),"betti");
1371 ideal I = groebner(flatten(fdir[2]));
1372 resolution FI = mres(I,0);
1373
1374 module F=FI[2];
1375 def A1=sheafCoh(F,-5,7);
1376 def A2=sheafCohBGG(F,-5,7);
1377
1378*/
Note: See TracBrowser for help on using the repository browser.