-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTateOnProducts.m2
7259 lines (6511 loc) · 229 KB
/
TateOnProducts.m2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-*
restart
uninstallPackage"TateOnProducts"
restart
installPackage("TateOnProducts")--,FileName=>schreyer/Dropbox/SVDComplexes/from-git/TateOnProducts.m2)
loadPackage("TateOnProducts",Reload=>true)
viewHelp "TateOnProducts"
peek loadedFiles
check "TateOnProducts"
*-
newPackage(
"TateOnProducts",
Version => "1.2",
Date => "January 30, 2020",
Headline => "Tate resolutions on products of projective spaces",
Authors => {
{ Name => "Daniel Erman", Email => "[email protected]", HomePage => "http://www.math.wisc.edu/~derman/" },
{ Name => "David Eisenbud", Email => "[email protected]", HomePage => "http://www.msri.org/~de/" },
{ Name => "Frank-Olaf Schreyer", Email => "[email protected]", HomePage => "http://www.math.uni-sb.de/ag/schreyer/" },
{ Name => "Michael E. Stillman", Email => "[email protected]", HomePage => "http://www.math.cornell.edu/People/Faculty/stillman.html" },
{ Name => "Yeongrak Kim", Email => "[email protected]", HomePage => "http://sites.google.com/view/yeongrak/"}
},
Keywords => {"Commutative Algebra"},
PackageImports => {"Truncations", "SVDComplexes"},
PackageExports => {"SVDComplexes"},
DebuggingMode => false
)
export {
"symExt",
"cohomologyMatrix",
"cohomologyHashTable",
"composedFunctions",
"eulerPolynomialTable",
"tallyDegrees",
"lowerCorner",
"upperCorner",
"beilinsonWindow",
"tateResolution",
"tateExtension",
"firstQuadrantComplex",
"lastQuadrantComplex",
"cornerComplex",
"regionComplex",
"strand",
-- beilinson functor
"beilinsonContraction",
"beilinsonBundle",
"beilinson",
-- "quotientPresentationComplex",
"ContractionData",
"tateData",
"productOfProjectiveSpaces",
"contractionData", -- probably doesn't need to be exported
"BundleType",
"PrunedQuotient",
"QuotientBundle",
"SubBundle",
"FreeBundle",
"MapsBetweenFreeBundles",
"DummyQuotientBundle",
--
-- "cornerCohomologyTablesOfUa",
"coarseMultigradedRegularity",
"CoefficientField",
"CohomologyVariables",
"Rings",
-- "CohomRing",
-- "TateRingData",
"TateData",
"bgg",
"directImageComplex",
"actionOnDirectImage",
--the following could all be part of ChainComplexExtras
"isIsomorphic",
-- "prependZeroMap",
-- "appendZeroMap",
-- "removeZeroTrailingTerms",
"trivialHomologicalTruncation",
-- "isChainComplex",
-- "nonzeroMin",
-- "nonzeroMax",
-- "minimize",
-- "isMinimalChainComplex",
-- "resolutionOfChainComplex",
-- "chainComplexMap",
"InitialDegree",
"isQuism",
"isAction"
-- Check
}
protect TateData
protect CohomRing
protect Rings
protect TateRingData
protect BeilinsonBundles
protect LargeBases
protect ChangeBases
--needsPackage "ChainComplexExtras"
----------------------------------------------
-- from graded modules to Tate resolutions --
----------------------------------------------
-- Helper functions for findMatrixCorners
extendRows = (I, r) -> (S := ring I; transpose (transpose I | matrix map(S^(numColumns I), S^r, 0)))
extendCols = (I, c) -> (S := ring I; matrix map(S^(numRows I), S^c, 0) | I)
extendMatrix = (I, r, c) -> extendCols(extendRows(I, r), c)
shiftRight = m -> (S := ring m; m * extendMatrix(id_(S^(numColumns m - 1)), 1,1))
shiftLeft = m -> (S := ring m; extendMatrix(id_(S^(numRows m - 1)), 1,1) * m)
shiftHoms = m -> (S := ring m; m' := diff(S_0, m); shiftLeft m' + shiftRight m')
taxiCabCover = mat -> (
nat := shiftHoms mat;
oat := nat;
while nat != 0 do (nat = shiftHoms nat; oat = oat + nat);
oat
)
-- Only usable for product of two projective spaces
findMatrixCorners = m -> (
corners := {};
(rows, cols) := (new MutableList, new MutableList);
for r to numrows m - 1 do (
rows#r = null;
for c to numcols m - 1 do (
if m_(r, c) != 0 then (
if rows#r === null then rows#r = -1;
if not cols#?c or cols#c === null then cols#c = infinity;
rows#r = max(c + 1, rows#r);
cols#c = min(r - 1, cols#c);
)));
if cols#0 === null then cols#0 = -1;
for r to numrows m - 2 do (
if rows#(r+1) === null then rows#(r+1) = infinity;
if rows#r > rows#(r+1) then rows#(r+1) = rows#r;
for c from 1 to numcols m - 1 do (
if cols#c === null then cols#c = -1;
if cols#(c-1) > cols#c then cols#(c-1) = cols#c;
));
for r to numrows m - 2 do (
if rows#r < rows#(r+1) then (
for c from 1 to numcols m - 1 do (
if cols#(c-1) < cols#c then (
if r === cols#c and rows#r === c then corners = append(corners, {r, c});
))));
corners
)
-- borrowed from LinearTruncations:
multigradedPolynomialRing = n -> (
x := local x;
xx := flatten apply(#n, i -> apply(n_i+1, j -> x_(i,j)));
degs := flatten apply(#n, i -> apply(n_i+1, k ->
apply(#n, j -> if i == j then 1 else 0)));
ZZ/32003[xx, Degrees=>degs]
)
-- Usable for products of any number of projective spaces
findHashTableCorners = ht -> (
L := pairs ht;
t := #L_0_0_0;
P := multigradedPolynomialRing toList(t:0);
low := apply(t, i -> min (L / (ell -> ell_0_0_i - 1)));
gt := new MutableHashTable;
apply(L, ell -> if ell_1 != 0 and ell_0_1 > 0 then (
gt#(ell_0_0) = true;
apply(t, j -> gt#(ell_0_0 + degree P_j) = true);
));
I := ideal apply(L, ell -> if not gt#?(ell_0_0) then product(t, j -> P_j^(ell_0_0_j - low_j)) else 0);
apply(flatten entries mingens I, g -> (flatten exponents g) + low)
)
findCorners = method()
findCorners Matrix := List => m -> findMatrixCorners taxiCabCover m
findCorners(Matrix, List, List) := List => (m, low, high) -> (
findCorners m / (ell -> {low_0 + ell_1, high_1 - ell_0})
)
findCorners HashTable := List => ht -> findHashTableCorners ht
multigradedRegularity = method()
multigradedRegularity Module := List => M -> (
S := ring M;
n := #(degrees S)_0;
low := -toList(n:#(gens S) - n);
high := toList(n:regularity M);
-- m := cohomologyMatrix(M, low, high);
-- findCorners(m, low, high)
ht := cohomologyHashTable(M, low, high);
findCorners ht
)
coarseMultigradedRegularity = method(Options =>
{Strategy =>"MinimalResolution"})
-*coarseMultigradedRegularity ChainComplex := o-> F -> (
--we assume F starts in homol degree 0.
el := length F;
r := degreeLength ring F;
D := apply((min F..max F), i-> degrees F_i);
--replace with D = hashTable
L := flatten apply(length D, i-> apply(D_i, s -> s-toList(r:i)));
regs := apply(r, p-> max(apply(L, q-> q_p)));
d := max(regularity F, sum regs);
e := d-sum regs;
e' := floor(e/r);
f := e-r*e';
regs + toList(#regs:e') + (toList(f:1)|toList((#regs-f):0))
)
coarseMultigradedRegularity Module := o-> M -> (
if o.Strategy == "MinimalResolution" then F :=res M else
if o.Strategy == "FastNonminimal" then (
S := ring M;
S' := coefficientRing S[gens S];
m := presentation M;
Tm := target m;
Tm':= S'^(degrees Tm/sum);
M' := coker map(Tm',,sub(presentation M, S'));
assert(isHomogeneous M');
F' := res(M', FastNonminimal=>true);
3 F = allGradings(F',Tm, S));
coarseMultigradedRegularity F
)
*-
LL = method()
LL (ZZ,ZZ) := (d,t) -> (
if t==1 then {{d}} else
flatten apply(d+1, i->
apply(LL(d-i,t-1),ell ->flatten prepend(i,ell)))
)
LL (ZZ,List) := (d,n) -> (
L1 := LL(d,#n);
select(L1, ell -> all(#n, i-> ell_i<= (1+n_i)));
)
coarseMultigradedRegularity ChainComplex := o-> F -> (
--we assume F starts in homol degree 0.
t := degreeLength ring F;
range := toList(min F..max F-1);
degsF := flatten apply(range,i -> degrees (F_i));
--lowerbounds := flatten flatten apply(range, i->(
-- apply(degsF_i, d -> apply(LL(i,t), ell -> d-ell))
-- ));
--only changes degsF if t=1
apply(t, i-> max apply(degsF, ell->ell_i))
)
coarseMultigradedRegularity Module := o-> M-> (
t := degreeLength ring M;
if o.Strategy == "MinimalResolution" then F := res M else
if o.Strategy == "FastNonminimal" then (
S := ring M;
S' := coefficientRing S[gens S];
m := presentation M;
Tm := target m;
Tm':= S'^(degrees Tm/sum);
M' := coker map(Tm',,sub(presentation M, S'));
assert(isHomogeneous M');
F' := res(M', FastNonminimal=>true);
F = allGradings(F',Tm, S));
coarseMultigradedRegularity(F, Strategy => o.Strategy)
)
allGradings=method()
allGradings (ChainComplex,Module, Ring) := (fJ,F0,Sall) -> (
fJall := new ChainComplex;
fJall.Ring = Sall;
fJall_0 = F0;
for i from 1 to length fJ do (
m := map(fJall_(i-1),,sub(fJ.dd_i,Sall));
fJall_i = source m;
fJall.dd_i=m);
chainComplex apply(length fJ,i->fJall.dd_(i+1))
)
productOfProjectiveSpaces = method(Options=>
{CoefficientField=>ZZ/32003,
Variables=>{getSymbol "x", getSymbol "e"},
CohomologyVariables => {getSymbol "h", getSymbol "k"}})
productOfProjectiveSpaces(List) := opts -> n -> (
kk := opts.CoefficientField;
x:= opts.Variables#0; -- symbol x;
e:= opts.Variables#1; -- symbol e;
h := opts.CohomologyVariables#0; -- symbol h
k := opts.CohomologyVariables#1; -- symbol k
t:= #n;
xx:=flatten apply(t,i->apply(n_i+1,j->x_(i,j)));
degs:=flatten apply(t,i->apply(n_i+1,k->apply(t,j->if i==j then 1 else 0)));
S:=kk[xx,Degrees=>degs];
ee:=flatten apply(t,i->apply(n_i+1,j->e_(i,j)));
E:=kk[ee,Degrees=>degs,SkewCommutative=>true];
CR := ZZ[h,k];
tateData := new MutableHashTable;
tateData#Rings = (S,E);
tateData#CohomRing = CR;
tateData#BeilinsonBundles = new MutableHashTable;
S.TateData = tateData;
E.TateData = tateData;
(S,E))
productOfProjectiveSpaces ZZ := opt -> n -> (productOfProjectiveSpaces(toList(n:1)))
///
restart
loadPackage ("TateOnProducts", Reload =>true)
peek loadedFiles
(P,E) = productOfProjectiveSpaces{2,2}
M = coker random(P^1, P^{{-1,-2},{-2,-1},{-1,-1}})
rowdegs = {{0,0}, {-1,1},{-1,-1},{-1,-2},{-2,-2}}
coldegs = apply(rowdegs, r->{-3,-3}-r)
m1 = random(P^rowdegs, P^coldegs)
M = coker gens pfaffians(4, m1-transpose m1)
R = coarseMultigradedRegularity M
R ={4,4}
netList apply(1+ length G, i-> tally degrees G_i)
betti (G =res M)
R = {} %{1,4} also works.
betti (G = res truncate(R, M))
netList apply(1+ length G, i-> tally degrees G_i)
regularity G
(P,E) = productOfProjectiveSpaces{5}
M = coker random(P^1, P^{-3,-4,-5})
M = P^1/ideal(P_0^3,P_1^4,P_2^5)
R = coarseMultigradedRegularity M
minimalBetti truncate(R, M)
apply(1+ length G, i-> tally degrees G_i)
///
tateData = method()
tateData Ring := (S) -> if not S.?TateData then
error "expected ring created with 'productOfProjectiveSpaces'" else S.TateData
ringData = method()
ringData Ring := E -> if not E.?TateRingData then E.TateRingData = (
differentDegrees := unique last degrees vars E;
varsLists := apply(differentDegrees, deg -> select (gens E, x-> degree x == deg));
t := #varsLists;
irrList := apply(varsLists, L -> ideal(L));
v := varsLists/(L->#L);
n := apply(v, i-> i-1);
(t,v,n,varsLists,irrList)
) else E.TateRingData
ringData Module := M -> ringData ring M
///
(S,E) = productOfProjectiveSpaces {1,2}
ringData E
ringData S
v = {2,3}
E = kk[e_0..e_1, f_0..f_2, Degrees => {v_0:{1,0},v_1:{0,1}}, SkewCommutative => true]
ringData E
(S,E) = productOfProjectiveSpaces{2,2}
ringData S
///
symExt=method()
symExt(Matrix,Ring) := (m,E) -> (
ev := map(E,ring m,vars E);
mt := transpose jacobian m;
jn := ev(syz mt);
a:=(vars E**E^(rank target m));
--betti a,tally degrees source a, isHomogeneous a
--betti jn, tally degrees target jn, tally degrees source jn, isHomogeneous jn
--tally( degrees target jn+degrees source a)
b:=a*jn;
--betti b, tally degrees target b, tally degrees source b
c:=map(target b,E^(degrees source jn),b);
transpose c)
subMatrix=(m,d,e) -> (
columns:=select(rank source m, i-> degree m_i==e);
rows:=select(rank target m, i-> (degrees target m)_i ==d);
transpose (transpose m_columns)_rows)
upperCorner=method()
-- needs update if we work with negative grading on exterior algebra.
upperCorner(ChainComplex,List) := (F,deg) ->(
E:=ring F;
degsE:= unique degrees E;
n:=apply(degsE,dege->#select(degrees E,d->d==dege)-1);
assert(
#(degrees E)_0 == # deg
);
-- sign change for k
k:=sum deg;
degsa:=degrees F_(-k-1);
-- sign change -deg_j three times and inequalities
L1:=select(#degsa,i->#select(#deg,j->degsa_i_j <= -deg_j and degsa_i_j >= -(deg_j+n_j+1) )==#deg);
degsb:=degrees F_(-k);
L2:=select(#degsb,i->#select(#deg,j->degsb_i_j==-deg_j)==#deg);
((F.dd_(-k))^L1)_L2
)
lowerCorner=method()
lowerCorner(ChainComplex,List) := (F,deg) ->(
E:=ring F;
degsE:= unique degrees E;
n:=apply(degsE,dege->#select(degrees E,d->d==dege)-1);
assert(
#(degrees E)_0 == # deg
);
-- sign change for k
k:= sum deg;
degsa:=degrees F_(-k);
-- sign change -deg_j three times and inequalities
L1:=select(#degsa,i->#select(#deg,j->degsa_i_j==-deg_j)==#deg);
degsb:=degrees F_(-k+1);
L2:=select(#degsb,i->#select(#deg,j->degsb_i_j<=-(deg_j-n_j-1) and degsb_i_j>=-deg_j)==#deg);
((F.dd_(-k+1))^L1)_L2
)
-*
corner=method()
corner(ChainComplex,List) := (F,deg) ->(
E:=ring F;
degsE:= unique degrees E;
assert(
#(degrees E)_0 == # deg
);
box:=boxDegrees E;
k:=-sum deg;
degsa:=degrees F_k;
L1:=flatten apply(box,boxdeg->select(#degsa,i->degsa_i==-deg+boxdeg));
degsb:=degrees F_(k-1);
L2:=unique flatten apply(degsE,degE-> flatten apply(box,boxdeg->select(#degsb,i->degsb_i==-deg+boxdeg-degE)));
transpose (transpose F.dd_k_L1)_L2
)
corner(ChainComplex,ZZ,List) := (F,k,deg) ->(
--Frank: I do not understand why we want this function, most likely for a bit more flexibility
E:=ring F;
degsE:= unique degrees E;
n:=apply(degsE,dege->#select(degrees E,d->d==dege)-1);
assert(
#(degrees E)_0 == # deg
);
degsa:=degrees F_k;
L1:=select(#degsa,i->#select(#deg,j->degsa_i_j<=-deg_j+n_j)==#deg);
degsb:=degrees F_(k-1);
L2:=select(#degsb,i->#select(#deg,j->degsb_i_j<=-deg_j+n_j)==#deg);
transpose (transpose F.dd_k_L1)_L2
)
*-
---------------------------------------------------------
-- numerical information --
---------------------------------------------------------
cohomologyMatrix=method()
cohomologyMatrix(ChainComplex,List,List) := (F,da,db) -> (
--Under the assumption that T is part of a Tate resolution of a sheaf F on a product of
--two projective space P^{n_1} x P^{n_2}, the function returns a matrix of cohomology polynomials
--$$\sum_{i=0}^{|n|} \, dim H^i(\mathbb P^{n_1}\times \mathbb P^{n_2},\mathcal F(c_1,c_2)) * h^i \in \, \mathbb Z[h,k]$$
--for every c=(c_1,c_2) with $a_1 \le c_1 \le b_1$ and $a_2 \le c_2 \le b_2$.
--In case T corresponds to an object in the derived category D^b(P^{n_1}x P^{n_2}), then
--hypercohomology polynomials are returned, with the convention that k stands for k=h^{ -1}.
--If T is not a large enough part of the Tate resolution, such as W below,
--then the function collects only
--the contribution of T to the cohomology table of the Tate resolution, according to the formula in
--Corollary 0.2 of @ HREF("http://arxiv.org/abs/","Tate Resolutions on Products of Projective Spaces") @.
--The polynomial for
--(b_1,b_2) sits in the north-east corner, the one corresponding to (a_1,a_2) in the south-west
--corner.
E:= ring F;
if not #unique degrees E==2 then error "works only for two factors";
L:=flatten apply(toList(min F..max F), k->
apply(degrees F_k, deg->
sum deg-k));
minL:=min L;maxL := max L;
h:=symbol h; k:=symbol k;p:=0;
H:=ZZ[h,k];
C:=matrix apply(toList(-db_1..-da_1),j->
apply(toList(da_0..db_0),i->
sum(min F..max F,d-> (p=d+i-j;
if p<=0 then h^(-p) else k^(p))*(tally degrees F_(d))_({ -i,j}))));
C
)
cohomologyMatrix(Module, List, List) := (M, low, high) -> (
if degreeLength M != 2 then error"this version works only with a product of two projective spaces.";
if #low !=2 or #high !=2 then error"expected degree lists of length 2";
if not all(#low, i-> low_i<=high_i) then error"low should be less than high";
C := tateResolution(M, low, high);
cohomologyMatrix(C, low , high))
eulerPolynomialTable = method()
eulerPolynomialTable HashTable := H ->(
nonzeros := unique ((keys H)/first);
low := {min (nonzeros/first), min(nonzeros/last)};
high := {max (nonzeros/first), max(nonzeros/last)};
h := getSymbol "h";
k := getSymbol "k";
coh := ZZ[h,k];
p:=0;
hashTable apply(nonzeros,c->
(c, sum(select(keys H,cp-> cp_0==c),cp->
(p=cp_1;
if p>=0 then (H#cp)*(coh_0)^p else (H#cp)*(coh_1)^(-p)
))))
)
eulerPolynomialTable(Module, List, List) := (M,low,high) ->
eulerPolynomialTable cohomologyHashTable(M,low,high)
eulerPolynomialTable(ChainComplex, List, List) := (T,low,high) ->
eulerPolynomialTable cohomologyHashTable(T,low,high)
cohomologyHashTable=method()
cohomologyHashTable(ChainComplex,List,List) := (F,low,high) -> (
--Under the assumption that T is part of a Tate resolution of a sheaf F on a product of
--projective spaces P^{n_1} x ... x P^{n_t}, the function returns a hashTable
--In case T corresponds to an object in the derived category D^b(P^{n_1}x P^{n_2}), then
--hypercohomology is returned.
--If T is not a large enough part of the Tate resolution, such as W below,
--then the function collects only
--the contribution of T to the cohomology table of the Tate resolution, according to the formula in
--Corollary 0.2 of @ HREF("http://arxiv.org/abs/","Tate Resolutions on Products of Projective Spaces") @.
E:= ring F;
deglen := degreeLength E;
minF := min F;
maxF := max F;
if #low != deglen or #high != deglen then error"Expected list of length the number of factors of the projective product.";
keylist := toList(low..high);
hashTable flatten apply(keylist, a ->
(suma := sum a;
apply(toList(minF..maxF), d->
({a,-d-suma},#select(degrees F_d, c->c==-a)))))
)
cohomologyHashTable(Module, List, List) := (M, low, high) -> (
if not all(#low, i-> low_i<=high_i) then error"low should be less than high";
C := tateResolution(M, low, high);
cohomologyHashTable(C, low , high))
tallyDegrees=method()
tallyDegrees(ChainComplex) := C -> (
apply(min C..max C,k->tally degrees C_k))
boxDegrees=method()
boxDegrees(Ring) := E -> (
degs:= unique degrees E;
t:=#degs;
n:=apply(t,k->#select(degrees E,d->d==degs_k)-1);
deg:=0*n;
box:={deg};
scan(#n,k->
box=flatten apply(box,deg-> apply(n_k+1,i->deg+i*degs_k))
);
box)
beilinsonWindow=method()
beilinsonWindow ChainComplex := (C)-> (
tD := tateData ring C;
(S,E) := tD.Rings;
(minC, maxC, mapsC) := toSequence chainComplexData C;
windows := for i from minC to maxC list (
degs := degrees C_i;
positions(degs, a -> inBeilinsonWindow(a,E))
);
maps := for i from minC + 1 to maxC list (
submatrix(C.dd_i, windows_(i-minC-1), windows_(i-minC))
);
removeZeroTrailingTerms chainComplexFromData{minC, maxC, maps}
)
isChainComplex=method()
isChainComplex(ChainComplex) := W -> (
lengthW:= max W- min W;
#select(min W+1..max W-1,i->( if (source W.dd_i==0 or W.dd_(i+1)==0) then true else W.dd_i*W.dd_(i+1)==0)) ==lengthW-1)
outsideBeilinsonRange=method()
outsideBeilinsonRange(Matrix) := m -> (
E:= ring m;
t:=#unique degrees E;
n:=apply(unique degrees E,d-> (#select( degrees E, e-> e==d)-1));
d:=0;
--source indices not in the Beilison window
sourcem := select(rank source m,i-> (d=degree (source m)_i;#select(#d,i->d_i<0 or d_i>n_i)>0));
m_sourcem)
-*
-- is still needed in one of the examples in TateExtension -- should go eventually
truncateInE=method()
truncateInE(List,Module):= (d,M) -> (
base:=basis(M);
degs:=degrees source base;
m:=base_(select(#degs,k->#select(#d,i->degs_k_i >= d_i)==#d));
image m
)
*-
--------------------------
-- The corner Complex --
--------------------------
cornerComplex=method()
cornerComplex(ChainComplex,List) := (C,c) ->(
d:=c-toList(#c:1);
cornerComplex1(C,d)
)
cornerComplex1=method()
cornerComplex1(ChainComplex,List) := (C,c) -> (
-- added this line to make the function work for the zero complex
if C==0 then return C;
--
t:= numFactors ring C; -- list from 0 to the number of factors -1.
-- if max C -min C < #t then error " need a complex of length at least t";
C':= C[min C+1]; -- last term in C' is C'_(-1)
Cge := firstQuadrantComplex1(C'[-#t+1],c);
Cle := lastQuadrantComplex1(C',c);
-- <<(betti Cge, betti Cle) <<endl;
A:=0;B:=0;AB:=0;d:=0;
Ccorner:= chainComplex apply(max C- min C - #t-1, e-> (
d:=e+#t; A=Cge.dd_(d);
B= Cle.dd_(d); AB = cornerMap(C',c,d);
-- print((betti A,betti AB,betti B));
(A|AB)||(map(target B, source A,0)|B))
);
return Ccorner[-min C-1])
-*
cornerComplex(Module, List, List) := (M,low, high) ->(
--high, low are lists of length = degreeLength ring M
(S,E) := (tateData ring M)#Rings;
regs := coarseMultigradedRegularity M; --regs
hi := apply(#regs, i->max(regs_i, high_i+1)); --hi
N := presentation truncate(hi, M)**S^{hi};-- betti N
Q := symExt(N,E); --betti Q
(res (coker Q,LengthLimit=>(sum hi-sum low)))**E^{hi}[sum hi]
)
*-
tateResolution=method()
tateResolution(Module, List, List) := (M,low, high) ->(
-- make the Tate resolution or rather a free subquotient complex of it
-- which covers all contributions in sheaf cohomological range between high and low
--high, low are lists of length = degreeLength ring M
(S,E) := (tateData ring M)#Rings;
regs := coarseMultigradedRegularity M; --regs
hi := apply(#regs, i->max(regs_i, high_i+1)); --hi
N := presentation truncate(hi, M)**S^{hi};-- betti N
Q := symExt(N,E); --betti Q
(res (coker Q,LengthLimit=>(sum hi-sum low)))**E^{hi}[sum hi-#regs+2]
)
tateResolution(Matrix, List, List) := (A, low, high) -> (
-- if we have a map A : M -> N between two modules,
-- then compute the induced map T(A) : T(M) -> T(N)
M := source A;
N := target A;
(S,E) := (tateData ring M)#Rings;
regM := coarseMultigradedRegularity M;
regN := coarseMultigradedRegularity N;
hi := apply (#high, i->max(regM_i, regN_i, high_i+1));
linearPresentationM := presentation truncate(hi, M)**S^{hi};
linearPresentationN := presentation truncate(hi, N)**S^{hi};
truncatedMapMtoN := (truncate(hi, A)**S^{hi});
QM := symExt(linearPresentationM,E);
QN := symExt(linearPresentationN,E);
CM := (res (coker QM,LengthLimit=>(sum hi-sum low)));
CN := (res (coker QN,LengthLimit=>(sum hi-sum low)));
extPos := extend(CN[1], CM[1], sub(matrix truncatedMapMtoN, E));
extNeg := dual extend(dual CM[-1], dual CN[-1], transpose sub(matrix truncatedMapMtoN,E));
-- shift does not change the sign of map of complexes
extAll := map(CN, CM, i->(if i<1 then extNeg#(i-1) else extPos#(i-1)));
extAll**E^{hi}[sum hi-#regM+2]
)
///
---------------------------------
restart
debug needsPackage "TateOnProducts"
needsPackage "ChainComplexExtras"
kk=ZZ/101
n={3}
(S,E)=productOfProjectiveSpaces n
A=random(S^{1:-1, 2:1}, S^{3:-2})
M=source A
N=target A
TA = tateResolution(A, -n, n);
TM = tateResolution(M, -n, n);
betti TM
TN = tateResolution(N, -n, n);
betti TN
source TA == TM
target TA == TN
isChainComplexMap TA
isIsomorphic (truncate(regularity M, HH^0 (beilinson TM)), truncate(regularity M, M))
isIsomorphic (truncate(regularity N, HH^0 (beilinson TN)), truncate(regularity N, N))
------------------------------
restart
debug needsPackage "TateOnProducts"
needsPackage "ChainComplexExtras"
kk=ZZ/101
n={2,1}
(S,E)=productOfProjectiveSpaces n
A=map(S^1, S^{1:{-1,0}}, {{S_0}})
M=source A
N=target A
regM=coarseMultigradedRegularity M
regN=coarseMultigradedRegularity N
TA = tateResolution(A, -n, n);
TM = tateResolution(M, -n, n);
betti TM
TN = tateResolution(N, -n, n);
betti TN
source TA == TM
target TA == TN
isChainComplexMap TA
isIsomorphic (truncate(regM, HH^0 (beilinson TM)), truncate(regM, M))
isIsomorphic (truncate(regN, HH^0 (beilinson TN)), truncate(regN, N))
------------------------
///
numFactors=method(TypicalValue=>List)
-- given the symmetric or exterior Cox ring E of the product pf projective spaces
-- compute the number t of factors and return the List {0,...,t-1}
numFactors(Ring) := E-> (
t:= #unique degrees E;
return toList(0..(t-1)))
quadrantMap=method()
quadrantMap(Matrix,List,List,List) := (M,c,I,J) -> (
degSource:=degrees source M;
degTarget:=degrees target M;
t:= numFactors ring M; --the list {0,...,t-1}
I':=select(t,j-> not member(j,I));
J':=select(t,j-> not member(j,J));
--sign change for c ??
cc:=c;
goodColumns:=select(#degSource,k ->
(#select(I,i-> degSource_k_i >= cc_i)==#I and
#select(I',i->degSource_k_i < cc_i)==#I'));
goodRows:=select(#degTarget,k ->
(#select(J,i-> degTarget_k_i >= cc_i)==#J and
#select(J',i->degTarget_k_i < cc_i)==#J'));
return ((M^goodRows)_goodColumns))
quadrantMap1 = method()
quadrantMap1(Matrix,List) := (M,c) -> (
if M == 0 then return M;
--the case I = J = {}
--quadrantMap1(M,c) is the submatrix of M of all rows and cols
--with row and col degrees < c in the partial order.
degSource:=degrees source M;
degTarget:=degrees target M;
t:= numFactors ring M; --the list {0,...,t-1}
-- I':=select(t,j-> not member(j,I)); I' = t
-- J':=select(t,j-> not member(j,J)); J' = t
--sign change for c ??
-- cc:=c;
goodColumns:=select(#degSource,k -> all(t,i->degSource_k_i < c_i));
goodRows:=select(#degTarget,k -> all(t,i->degTarget_k_i < c_i));
return ((M^goodRows)_goodColumns))
firstQuadrantComplex=method()
firstQuadrantComplex(ChainComplex,List) := (C,c) -> (
-- c index of the lower corner of the first quadrant
firstQuadrantComplex1(C,c-toList(#c:1)) )
firstQuadrantComplex1=method()
firstQuadrantComplex1(ChainComplex,List) := (C,c) -> (
-- c index of upper corner of the complementary last quadrant
-- added this line to make the function work for the zero complex
if C==0 then return C;
--
s:=min C;
C':=C[s];
-- I:= numFactors ring C;
-- sign change for c (1x)
--now replace each map in C' with the corresponding "quadrantMap"
-- Cge:=chainComplex apply(max C'-1,d -> quadrantMap(C'.dd_(d+1),-c,{},{}));
Cge:=chainComplex apply(max C'-1,d -> quadrantMap1(C'.dd_(d+1),-c));
return Cge[-s])
///
restart
loadPackage "TateOnProducts"
restart
uninstallPackage "TateOnProducts"
restart
installPackage "TateOnProducts"
(S,E) = productOfProjectiveSpaces {1,1};
T1= (dual res( trim (ideal vars E)^2,LengthLimit=>8))[1];
T=trivialHomologicalTruncation(T2=res(coker upperCorner(T1,{4,3}),LengthLimit=>13)[7],-5,6);
betti T
cohomologyMatrix(T,-{4,4},{3,2})
fqT=firstQuadrantComplex(T,-{2,1});
betti fqT
cohomologyMatrix(fqT,-{4,4},{3,2})
cohomologyMatrix(fqT,-{2,1},-{1,0})
lqT=lastQuadrantComplex(T,-{2,1});
betti lqT
cohomologyMatrix(lqT,-{4,4},{3,2})
cohomologyMatrix(lqT,-{3,2},-{2,1})
cT=cornerComplex(T,-{2,1});
betti cT
cohomologyMatrix(cT,-{4,4},{3,2})
viewHelp TateOnProducts
///
lastQuadrantComplex=method()
lastQuadrantComplex(ChainComplex,List) := (C,c) -> (
-- c index of the lower corner of the complentary first quadrant
lastQuadrantComplex1(C,c-toList(#c:1)))
lastQuadrantComplex1=method()
lastQuadrantComplex1(ChainComplex,List) := (C,c) -> (
-- c index of the upper corner of the last quadrant
-- added this line to make the function work for the zero complex
if C==0 then return C;
--
s:=min C;
C':=C[s];
I:= numFactors ring C;
--sign chain for c (1x)
Cge:=chainComplex apply(max C'-1,d -> quadrantMap(C'.dd_(d+1),-c,I,I));
return Cge[-s])
cornerMap=method()
cornerMap(ChainComplex,List,ZZ) := (C,c,d) -> (
-- added this line to make the function work for the zero complex
if C==0 then return C;
--
E := ring C;
t := numFactors E;
Is:=reverse apply(t,i->select(t,j->j<i));
--sign change for c (2x)
M:= quadrantMap(C.dd_d,-c,t,Is_0);
Ms:=apply(#t-1,j->quadrantMap(C.dd_(d-j-1),-c,Is_j,Is_(j+1)));
-- multiplication of empty matrices some times does not work! so there is a work around.
scan(Ms, N-> if source N == E^0 then M=map(target N, source M,0) else M=N*M);
return M)
regionComplex=method()
regionComplex(ChainComplex,List,Sequence) := (T,c,IJK) -> (
T1:=trivialHomologicalTruncation(T,nonzeroMin T, nonzeroMax T);
T2:=T1[min T1];
Ls:=apply(toList(min T2..max T2),k->goodColumns(T2_k,c,IJK));
rT:=chainComplex apply(min T2+1..max T2,k-> ((T2.dd_k))^(Ls_(k-1))_(Ls_(k)));
rT[-min T1])
goodColumns=method()
goodColumns(Module,List,Sequence) := (F,c,IJK) -> (
degF:=degrees F;
--sensitive to signs
--select(#degF,g-> goodDegree(degF_g,c,IJK))
select(#degF,g-> goodDegree(-degF_g,c,IJK))
)
--Daniel: I'm not exactly sure what the correct notation for this function is.
goodDegree=method()
goodDegree(List,List,Sequence) := (d,c,IJK) -> (
(I,J,K) := IJK;
#select(I,i-> d_i<c_i)==#I and #select(J,j->d_j==c_j)==#J and #select(K,k->d_k>=c_k)==#K
)
strand=method()
strand(ChainComplex,List,List) := (T,c,I) -> (
regionComplex(T,c,({},I,{})))
--------------------------------------------------
-- formal ChainComplex manipulations --
--------------------------------------------------
chainComplexData = C->(
minC := min C;
maxC := max C;
C':=C[minC];
{minC, maxC, apply(toList(1..maxC-minC), i-> (C').dd_i)}
)
chainComplexFromData = method()
chainComplexFromData List := L ->(
--format of L is desired min, desired max, list of
--shifted maps
C := chainComplex L_2;
assert( min C == 0);
C[-L_0])
chainComplexFromData(ZZ, List) := (minC,L) ->(
--minC will become the min of the output complex
C := chainComplex L;
assert( min C ==0);
C[-minC])
trivialHomologicalTruncation=method()
trivialHomologicalTruncation(ChainComplex,ZZ,ZZ) := (C,d,e) -> (
F := C;
-- given a chain complex
-- ... <- C_{k-1} <- C_{k} <- C_{k+1} <- ...
-- return the trivial truncation
-- 0 <- C_d <- C_{d+1} <- ... < C_e <- 0
if d>e then error "expect d <= e";
while min F > d do (F =prependZeroMap F);
while max F < e do (F=appendZeroMap F);
G := F[d];
if d==e then (G= prependZeroMap chainComplex map(G_0,(ring G)^0,0)) else (
G=prependZeroMap appendZeroMap chainComplex apply(toList(1..e-d),k->G.dd_k));
G[-d])
///
E=ZZ/101[e_0,e_1,SkewCommutative=>true]
F=res ideal vars E
betti F
C=dual res (coker transpose F.dd_3,LengthLimit=>8)[-3]
betti C
C1=trivialHomologicalTruncation(C,-2,2)
trivialHomologicalTruncation(C1,-3,3)
///
prependZeroMap= method()
prependZeroMap ChainComplex := C->(
L := chainComplexData(C[-1]);
minC := L_0;
newd := map((ring C)^0, target L_2_0, 0);
(chainComplexFromData(minC-1,prepend(newd,L_2)))[1]
)
appendZeroMap= method()
appendZeroMap ChainComplex := C->(
L := chainComplexData(C);
minC := L_0;
newd := map(source last L_2,(ring C)^0, 0);
chainComplexFromData(minC,append(L_2,newd))
)
nonzeroMin = method()
nonzeroMin(ChainComplex) := C -> (
--assert( not C==0);
if C==0 then return min C;
m:= min C;
while C_m==0 do (m=m+1);
m)