-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTSpreadIdeals.m2
1702 lines (1564 loc) · 79.8 KB
/
TSpreadIdeals.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
-- -*- coding: utf-8 -*-
newPackage(
"TSpreadIdeals",
Version => "1.0",
Date => "February 01, 2021",
Authors => {{Name => "Luca Amata", Email => "[email protected]", HomePage => "http://mat521.unime.it/amata"}
},
Headline => "A Macaulay2 package to deal with t-spread ideals of a polynomial ring",
DebuggingMode => false
)
export{
"tNextMon", "tLastMon", "tLexSeg", "isTLexSeg", "tLexMon", "countTLexMon", "tVeroneseSet", "tVeroneseIdeal", "tPascalIdeal", "tSpreadList", "tSpreadIdeal", "isTSpread", "tShadow", "fTVector", "isFTVector", "tLexIdeal", "isTLexIdeal", "tStronglyStableSeg", "isTStronglyStableSeg", "tStronglyStableMon", "countTStronglyStableMon", "tStronglyStableIdeal", "isTStronglyStableIdeal", "tExtremalBettiCorners", "tExtremalBettiMonomials",
--service
"tMacaulayExpansion", "solveBinomialExpansion", "initialDegree", "initialIdeal", "minimalBettiNumbers", "minimalBettiNumbersIdeal",
--option
"FixedMax", "MaxInd", "Shift"
}
-------------------------------------------------------------------------------------------
-- Compute the next monomial (optionally with max index fixed) respect to mon
-------------------------------------------------------------------------------------------
tNextMon = method(TypicalValue=>RingElement, Options=>{FixedMax=>false})
tNextMon (RingElement,ZZ) := opts -> (mon,t) -> (
if isTSpread(mon,t) then (
S:=ring mon;
n:=numgens S;
oldmon:=support mon;
mu:=max(index\oldmon);
j:=#oldmon-1;
g:=n-1;
if opts.FixedMax then g=mu;
while ((index oldmon#j)+1>g) do (
g=g-t;
j=j-1;
if j<0 then error "no t-spread monomial exists";
);
newmon:=take(oldmon,j);
g=(index oldmon#j)+1;
k:=#oldmon-j;
if opts.FixedMax then (
k=#oldmon-j-1;
newmon=newmon|{S_mu};
);
while k>0 do (
if g<n then newmon=newmon|{S_g} else error "no t-spread monomial exists";
k=k-1;
g=g+t;
);
) else error "expected a t-spread monomial";
product newmon
)
-------------------------------------------------------------------------------------------
-- Compute the last monomial (optionally with max index fixed) of the shadow of mon
-------------------------------------------------------------------------------------------
tLastMon = method(TypicalValue=>RingElement, Options=>{MaxInd=>-1})
tLastMon (RingElement,ZZ,ZZ) := opts -> (mon,gap,t) -> (
if isTSpread(mon,t) then (
S:=ring mon;
n:=numgens S;
oldmon:=support mon;
mu:=n-1;
if opts.MaxInd>-1 then mu=opts.MaxInd-1;
g:=mu;
ind:=#select(index\oldmon,x->x<=mu);
j:=0;
while mu-index oldmon#(ind-1)<t*(gap+j) do (
ind=ind-1;
if ind<0 then error "no t-spread monomial exists";
j=j+1;
);
oldmon=take(oldmon,ind)|{S_g};
k:=gap+#(support mon)-ind-1;
while k>0 do (
if not isSubset({g},index\oldmon) then (
if g>-1 then (
oldmon=oldmon|{S_g};
) else error "no t-spread monomial exists";
k=k-1;
);
g=g-t;
);
) else error "expected a t-spread monomial";
product oldmon
)
------------------------------------------------------------------------
-- return the t-spread segment of S between ini and fin
------------------------------------------------------------------------
tLexSeg = method(TypicalValue => List)
tLexSeg(RingElement,RingElement,ZZ) := List => (ini,fin,t) -> (
S:=ring ini;
R:=newRing(S,MonomialOrder=>GLex);
RM:=map(R,S);
IRM:=map(S,R);
n:=numgens R;
l:={};
mon:=RM ini;
if isTSpread(ini,t) and isTSpread(fin,t) and (degree ini)#0 == (degree fin)#0 and ring fin===S then (
if mon>=RM fin then (
l={mon}|while mon!=RM fin list mon=tNextMon(mon,t);
) else error "expected the first monomial greater than the second one with respect to lex order";
) else error "expected t-spread monomials of the same degree";
IRM\l
)
---------------------------------------------------------------------
-- whether a t-spread set is a t-spread segment
---------------------------------------------------------------------
isTLexSeg = method(TypicalValue=>Boolean)
isTLexSeg (List,ZZ) := (l,t) -> (
S:=ring l#0;
SL:=newRing(S, MonomialOrder=>Lex);
RM:=map(SL,S);
l=RM\l;
deg:=sort flatten degree l#0;
if unique(l/(x->isTSpread(x,t)))=={true} then (
if tLexSeg(max l, min l,t)!= rsort l then return false;
) else error "expected t-spread monomials";
true
)
-------------------------------------------------------------------------------------------
-- Compute the Borel monomials generated by mon
-------------------------------------------------------------------------------------------
tLexMon = method(TypicalValue=>List)
tLexMon (RingElement,ZZ) := (mon,t) -> (
S:=ring mon;
l:={};
if isTSpread(mon,t) then (
ini:=product for i to ((degree mon)#0-1) list S_(i*t);
l=tLexSeg(ini,mon,t);
) else error "expected a t-spread monomial";
l
)
-------------------------------------------------------------------------------------------
-- count the number of monomials of the initial lex segment with assigned minimum
----------------------------------------------------------------------------------------------
countTLexMon = method(TypicalValue=>ZZ, Options=>{FixedMax=>false})
countTLexMon (RingElement,ZZ) := opts -> (mon,t) -> (
if isTSpread(mon,t) then (
n:=numgens ring mon;
supp:=index \ support mon;
d:=#supp;
dd:=0;
if opts.FixedMax then (
n=max supp+1;
dd=1;
);
l:=for i from 1 to n-(d-1)*t list {n-(d-1)*(t-1)-i-dd,d-1-dd};
c:=0;
sub:=0;
for j to d-1-dd do (
s:=0;
if j>0 then sub=supp#(j-1)+t;
while s < supp#j-sub do (
c=c+binomial(l#s#0,l#s#1);
s=s+1;
);
l=for i to l#s#0-l#s#1 list {l#s#0-i-1,l#s#1-1};
);
) else error "expected a t-spread monomial";
c+1
)
------------------------------------------------------------------------
-- return all the t-spread monomials of S of degree d
------------------------------------------------------------------------
tVeroneseSet = method(TypicalValue => List)
tVeroneseSet(Ring,ZZ,ZZ) := List => (S,d,t) -> (
n:=numgens S-1;
l:={};
if 1+t*(d-1)<=n+1 then (
ini:=product for i to (d-1) list S_(i*t);
fin:=product for i to (d-1) list S_(n-i*t);
if ini!=1 and fin!=1 then
l=tLexSeg(ini,fin,t)
else l={};
);
l
)
------------------------------------------------------------------------
-- return the t-spread Veronese ideal of S of degree d
------------------------------------------------------------------------
tVeroneseIdeal = method(TypicalValue => Ideal)
tVeroneseIdeal(Ring,ZZ,ZZ) := Ideal => (S,d,t) -> (
l:=tVeroneseSet(S,d,t);
if l=={} then l={0_S};
ideal l
)
------------------------------------------------------------------------
-- return tha t-spread Pascal Ideal
------------------------------------------------------------------------
tPascalIdeal = method(TypicalValue => Ideal)
tPascalIdeal(Ring,ZZ) := Ideal => (S,t) -> (
if t>numgens S then error "expected value of t less than the number of variables";
ideal for j to t-1 list product((k->S_k)\select(numgens S,i->i%t==j))
)
------------------------------------------------------------------------
-- return all the t-spread monomials of a list
------------------------------------------------------------------------
tSpreadList = method(TypicalValue => List)
tSpreadList(List,ZZ) := List => (l,t) -> (
if #l>0 then (
S:=ring l#0;
n:=numgens S;
lt:=flatten for i to n-t+1 list for j from i to min(i+t-1,n-1) list product {S_i,S_j};
K:=ideal lt;
l=select(l/(x->x%K),y->y!=0);
);
l
)
------------------------------------------------------------------------
-- return all the t-spread generators of a monomial ideal
------------------------------------------------------------------------
tSpreadIdeal = method(TypicalValue => Ideal)
tSpreadIdeal(Ideal,ZZ) := Ideal => (I,t) -> ideal tSpreadList(flatten entries compress gens I,t)
------------------------------------------------------------------------
-- whether a monomial is a t-spread monomial of S
------------------------------------------------------------------------
isTSpread = method(TypicalValue => Boolean)
isTSpread(RingElement,ZZ) := Boolean => (mon,t) -> (
sup:=index\ support mon;
if (degree mon)#0 != #sup or #(flatten entries monomials mon)!=1 then return false;
sup=for i to #sup-2 list sup#(i+1)-sup#i;
if min sup < t then return false;
true
)
------------------------------------------------------------------------
-- wheter a list of monomials is a t-spread
------------------------------------------------------------------------
isTSpread(List,ZZ) := Boolean => (l,t) -> (
if isSubset({false},l/(x->isTSpread(x,t))) then return false;
true
)
------------------------------------------------------------------------
-- wheter an ideal is a t-spread ideal of S
------------------------------------------------------------------------
isTSpread(Ideal,ZZ) := Boolean => (I,t) -> (
S:=ring I;
if isMonomialIdeal I then ( -- or I==ideal(0_S)
gen:=flatten entries mingens I;
if isSubset({false},gen/(x->isTSpread(x,t))) then return false;
) else error "expected a monomial ideal";
true
)
------------------------------------------------------------------------
-- return the t-shadow of a t-spread monomial
------------------------------------------------------------------------
tShadow = method(TypicalValue=>List)
tShadow (RingElement,ZZ) := (mon,t) -> (
S:=ring mon;
n:=numgens S;
l:={};
if isTSpread(mon,t) then (
supp:=index\support mon;
supp={0}|flatten(supp/(i->{i-t,i+t}))|{n-1};
ind:=0;
l=flatten while ind<#supp list (
for i from supp#ind to supp#(ind+1) list mon*S_i
) do ind=ind+2;
);
l
)
------------------------------------------------------------------------
-- return the t-shadow of a set of t-sprea monomials
------------------------------------------------------------------------
tShadow (List,ZZ) := (l,t) -> (
if l=={} then return {};
S:=ring l#0;
n:=numgens S;
SL:=newRing(S, MonomialOrder=>{GLex});
RM:=map(SL,S);
IRM:=map(S,SL);
l=RM\l;
IRM\(rsort unique flatten apply(l,x->tShadow(x,t)))
)
------------------------------------------------------------------------
-- return the ft-vector of a t-spread ideal
------------------------------------------------------------------------
fTVector = method(TypicalValue=>List)
fTVector (Ideal,ZZ) := (I,t) -> (
S:=ring I;
n:=numgens S;
f:={};
if isTSpread(I,t) then (
indeg:=initialDegree I;
f=for i to indeg-1 list binomial(n-(t-1)*(i-1),i);
sh:={};
for i from indeg to (n+t-1)//t do (
sh=join(tShadow(sh,t),select(flatten entries mingens I,x->(degree x)#0==i));
f=join(f,{binomial(n-(t-1)*(i-1),i)-#sh});
);
) else error "expected a t-spread ideal";
f
)
------------------------------------------------------------------------
-- Compute the i-th Macaulay expansion of a (Shift=>false)
-- Compute the i-th shifted Macaulay expansion of a (Shift=>true)
------------------------------------------------------------------------
tMacaulayExpansion = method(TypicalValue=>List, Options=>{Shift=>false})
tMacaulayExpansion(ZZ,ZZ,ZZ,ZZ) := opts -> (a,n,d,t) -> (
macexp:={};
as:={};
dw:=d;
up:=dw;
if opts.Shift and a==0 then macexp={{0,2}};
while a>0 and d>0 do (
while binomial(up,dw)<a do up=up+1;
if binomial(up,dw)!=a then up=up-1;
macexp=macexp|{{up,dw}};
as={up}|as;
a=a-binomial(up,dw);
dw=dw-1;
up=dw;
);
r:=dw+1;
as={r-2}|as;
as=as|{n-(d-1)*(t-1)};
as=as|{n-d*(t-1)+2*t};
k:=d-r+1;
while as#(d-k+1-dw)-as#(d-k-dw)<t+1 do k=k-1;
tmacexp:={};
if k==-1 then tmacexp={{n-d*(t-1),d+1}}
else (
-- for j in r..(d-k) do tmacexp={{as#(j-dw),j}}|tmacexp;
-- tmacexp={{as#(d-k-dw)-2*t+1,d-k+1}}|tmacexp;
-- for j in (d+1-k)..d do tmacexp={{as#(j-dw)-t+1,j+1}}|tmacexp;
tmacexp=reverse(for j in (d+1-k)..d list {as#(j-dw)-t+1,j+1})|{{as#(d-k-dw)-2*t+1,d-k+1}}|reverse(for j in r..(d-k) list {as#(j-dw),j});
);
if not opts.Shift then select(macexp,x->x#0>=0)
else select(tmacexp,x->x#0>=0)
)
------------------------------------------------------------------------
-- whether the given sequence is a ft-vector
------------------------------------------------------------------------
isFTVector = method(TypicalValue=>Boolean)
isFTVector(Ring,List,ZZ) := (S,f,t) -> (
n:=numgens S;
f=join(f,((n+t-1)//t-#f+1):0);
if f#0>1 or f#1>n or #f-2>(n+t-1)//t then return false
else (
for k from 1 to #f-2 do (
val:=solveBinomialExpansion tMacaulayExpansion(f#k,n,k,t,Shift=>true);
if f#(k+1)<0 or f#(k+1)>val then return false
);
);
true
)
----------------------------------------------------------------------------------
-- return the t-lex ideal with the ft-vector
----------------------------------------------------------------------------------
tLexIdeal = method(TypicalValue=>Ideal)
tLexIdeal (Ring, List, ZZ) := (S,f,t) -> (
n:=numgens S;
ind:=0;
l:={};
ltempold:={};
if isFTVector(S,f,t) then (
f=join(f,((n+t-1)//t-#f+1):0);
for d from 0 to #f-1 do (
completeLex:=tVeroneseSet(S,d,t);
shad:=tShadow(ltempold,t);
if shad=={} then shad={0_S};
ind=binomial(n-(t-1)*(d-1),d)-f#d;
ltemp:=take(completeLex,ind);
ltemp=rsort toList(set ltemp - set shad);
l=join(l,ltemp);
ltempold=unique select(join(ltemp,shad),x->x!=0);
);
if #l==0 then l={0_S};
) else error "expected a valid ft-vector";
ideal l
)
----------------------------------------------------------------------------------
-- return the t-lex ideal sharing the same ft-vector of I
----------------------------------------------------------------------------------
tLexIdeal (Ideal,ZZ) := (I,t) -> if isTStronglyStableIdeal(I,t) then tLexIdeal(ring I, fTVector(I,t), t) else error "expected a t-strongly stable ideal"
---------------------------------------------------------------------
-- whether a t-spread ideal is t-spread lex
---------------------------------------------------------------------
isTLexIdeal = method(TypicalValue=>Boolean)
isTLexIdeal (Ideal,ZZ) := (I,t) -> (
S:=ring I;
SL:=newRing(S, MonomialOrder=>Lex);
RM:=map(SL,S);
I=RM ideal mingens I;
degs:=sort flatten degrees I;
if isTSpread(I,t) then -- or I==ideal(0_SL)
for d from degs#0 to last degs do (
monI:=select(rsort flatten entries compress (super basis(d,I)),x->isTSpread(x,t));
monLex:=take(tVeroneseSet(SL,d,t),#monI);
if monI!=monLex then return false;
)
else error "expected a t-spread ideal";
true
)
-------------------------------------------------------------------------------------------
-- Compute the Borel-segment of monomials between ini and fin
-------------------------------------------------------------------------------------------
tStronglyStableSeg = method(TypicalValue=>List)
tStronglyStableSeg (RingElement,RingElement,ZZ) := (ini,fin,t) -> (
S:=ring fin;
n:=numgens S;
l:={};
sup:=index\support fin;
inf:=index\support ini;
if isTSpread(ini,t) and isTSpread(fin,t) and (degree ini)#0 == (degree fin)#0 and ring ini===S then (
if min(sup-inf)>=0 then (
l={product(inf/(x->S_x))};
while inf!=sup do(
j:=#sup-1;
while j>=0 and (inf#j)+1>sup#j do (
j=j-1;
);
g:=(inf#j)+1;
inf=take(inf,j);
k:=#sup-j;
while k>0 do (
inf=inf|{g};
k=k-1;
g=g+t;
);
l=join(l,{product(inf/(x->S_x))});
);
) else error "expected the first monomial greater than the second one with respect to Borel order";
) else error "expected t-spread monomials of the same degree";
l
)
---------------------------------------------------------------------
-- whether a t-spread set is a t-spread strongly stable segment
---------------------------------------------------------------------
isTStronglyStableSeg = method(TypicalValue=>Boolean)
isTStronglyStableSeg (List,ZZ) := (l,t) -> (
S:=ring l#0;
SL:=newRing(S, MonomialOrder=>Lex);
RM:=map(SL,S);
l=RM\l;
deg:=sort flatten degree l#0;
if unique(l/(x->isTSpread(x,t)))=={true} then (
if tStronglyStableSeg(max l, min l,t)!= rsort l then return false;
) else error "expected t-spread monomials";
true
)
-------------------------------------------------------------------------------------------
-- Compute the Borel monomials generated by mon
-------------------------------------------------------------------------------------------
tStronglyStableMon = method(TypicalValue=>List)
tStronglyStableMon (RingElement,ZZ) := (mon,t) -> (
S:=ring mon;
l:={};
if isTSpread(mon,t) then (
ini:=product for i to ((degree mon)#0-1) list S_(i*t);
l=tStronglyStableSeg(ini,mon,t);
) else error "expected a t-spread monomial";
l
)
-------------------------------------------------------------------------------------------
-- Count the number of t-strongly stable monomials generated by mon
-------------------------------------------------------------------------------------------
countTStronglyStableMon = method(TypicalValue=>ZZ)
countTStronglyStableMon (RingElement,ZZ) := (mon,t) -> (
if isTSpread(mon,t) then (
supp:=index \ support mon;
m:=max supp;
d:=#supp;
p:=d-2;
c:=0;
ind:=new MutableList from toList(d-1:1);
while ind#0<=supp#0+1 do (
c=c+m+1-(d-1)*(t-1)- sum toList ind;
ind#p=ind#p+1;
while p>0 and ind#p > (supp#p+1)-(sum take(toList ind,p)+p*t-p+1)+1 do (
ind#p=1;
p=p-1;
ind#p=ind#p+1;
);
p=d-2;
);
) else error "expected a t-spread monomial";
c
)
-------------------------------------------------------------------------------------------
-- Compute the Borel ideal generated by I
-------------------------------------------------------------------------------------------
tStronglyStableIdeal = method(TypicalValue=>Ideal)
tStronglyStableIdeal (Ideal,ZZ) := (I,t) -> (
S:=ring I;
n:=numgens S;
SL:=newRing(S, MonomialOrder=>{Weights=>toList(1..n)});
RM:=map(SL,S);
IRM:=map(S,SL);
if isTSpread(I,t) then (
gen:=flatten entries mingens RM I;
l:=unique flatten for x in gen list tStronglyStableMon(x,t);
) else error "expected a t-spread ideal";
IRM trim ideal l
)
-------------------------------------------------------------------------------------------
-- whether a t-spread ideal is Borel
-------------------------------------------------------------------------------------------
isTStronglyStableIdeal = method(TypicalValue=>Boolean)
isTStronglyStableIdeal (Ideal,ZZ) := (I,t) -> (
S:=ring I;
n:=numgens S;
if isTSpread(I,t) then (
gen:=flatten entries mingens I;
l:={};
for x in gen do (
l=unique join(l,tStronglyStableMon(x,t));
if #select(l/(x->x%I),x->x!=0)>0 then return false;
);
) else error "expected a t-spread ideal";
true
)
-------------------------------------------------------------------------------------------
-- returns the corners of the extremal Betti numbers of I
----------------------------------------------------------------------------------------------
tExtremalBettiCorners = method(TypicalValue=>List)
tExtremalBettiCorners (Ideal,ZZ) := (I,t) -> (
gr:=unique flatten degrees I;
dseq:={};
corners:={};
if isTStronglyStableIdeal(I,t) then (
for d in gr do (
l:=select(flatten entries gens I,x->(degree x)#0==d);
m:=max apply( l,x->support x / index //max+1);
dseq=join(dseq,{(m-t*(d-1)-1,d)});
);
while #dseq>1 do (
if dseq#0#0 > max (take(dseq,{1,#dseq}) / (y->y#0)) then
corners=join(corners,{dseq#0});
dseq=take(dseq,{1,#dseq});
);
) else error "expected a t-strongly stable ideal";
join(corners,{dseq#0})
)
-------------------------------------------------------------------------------------------
-- returns the basic t-spread monomials with extremal Betti numbers assigned as positions as values
----------------------------------------------------------------------------------------------
tExtremalBettiMonomials = method(TypicalValue=>List)
tExtremalBettiMonomials (Ring,List,List,ZZ) := (S,corners,a,t) -> (
n:=numgens S;
SL:=newRing(S, MonomialOrder=>Lex);
vrs:=flatten entries vars SL;
RM:=map(SL,S);
IRM:=map(S,SL);
r:=#corners;
cond:=r<n and #corners==r and #a==r;
cond=cond and rsort unique (corners / (x->x#0))== corners / (x->x#0);
cond=cond and sort unique (corners / (x->x#1))== corners / (x->x#1);
cond= cond and max(corners / (x->x#0+x#1))<=n;
if cond then (
mu:=corners#0#0+t*(corners#0#1-1)+1;
g:=mu-1;
bound:=binomial(corners#0#0+corners#0#1-1,corners#0#1-1);
if a#0>bound then error "Ideal does not exists";
mon:=product((t*toList(0..corners#0#1-2)/(i->SL_i))|{SL_g});
l:={mon};
for j from 2 to a#0 do (
try mon=tNextMon(mon,t,FixedMax=>true) then
l=join(l,{mon})
else error "no t-strongly stable ideal exists";
);
for i from 1 to r-1 do (
mu=corners#i#0+t*(corners#i#1-1)+1;
g=mu-1;
--last monomial of the shadow
try mon=tLastMon(mon,corners#i#1-corners#(i-1)#1,t,MaxInd=>g+1)
else error "no t-strongly stable ideal exists";
--first monomial over the shadow
for j from 1 to a#i do (
try mon=tNextMon(mon,t,FixedMax=>true) then
l=join(l,{mon})
else error "no t-strongly stable ideal exists";
);
);
) else error "the hypotheses do not hold";
IRM\l
)
------------------------------------------------------------------------
-- Compute the sum of a binomial expansion.
------------------------------------------------------------------------
solveBinomialExpansion = method(TypicalValue=>ZZ)
solveBinomialExpansion List := l -> sum apply(l,x->binomial(toSequence x))
------------------------------------------------------------------------
-- returns the initial degree of a graded ideal
------------------------------------------------------------------------
initialDegree = method(TypicalValue=>ZZ)
initialDegree Ideal := I -> (
if isHomogeneous I then return min flatten degrees ideal mingens I
else error "expected a graded ideal";
)
-------------------------------------------------------------------------------------------
-- returns the initial ideal of an ideal
----------------------------------------------------------------------------------------------
initialIdeal = method(TypicalValue=>Ideal)
initialIdeal Ideal := I -> ideal rsort leadTerm I
-------------------------------------------------------------------------------------------
-- returns the minimal Betti numbers of the quotient S/I
----------------------------------------------------------------------------------------------
minimalBettiNumbers = method(TypicalValue=>BettiTally)
minimalBettiNumbers Ideal := I -> betti res ideal flatten entries mingens I
-------------------------------------------------------------------------------------------
-- Computes the minimal Betti numbers of I
----------------------------------------------------------------------------------------------
minimalBettiNumbersIdeal = method(TypicalValue=>BettiTally)
minimalBettiNumbersIdeal Ideal := I -> betti res pushForward(map(ring I,ring I), image mingens I)
beginDocumentation()
-------------------------------------------------------
--DOCUMENTATION ExteriorIdeals
-------------------------------------------------------
document {
Key => {TSpreadIdeals},
Headline => "A package for working with t-spread ideals of polynomial rings",
"TSpreadIdeals is a package for creating and manipulating t-spread ideals of polynomial rings. Let ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///, " a monomial of ", TEX///$S=K[x_1,\ldots,x_n]$///, ", with ", TEX///$1\le i_1\le i_2\le\dots\le i_d\le n$///, ". The monomial ", TT "u", " is called ", TEX///$t$///, "-spread if ", TEX///$i_{j+1}-i_j\ge t$///, " for all ", TEX///$j\in [d-1].$///, BR{},
"A list of monomials is ", TT "t", "-spread if all the monomials of the list are ", TT "t", "-spread. A monomial ideal is called ", TT "t", "-spread if it is generated by ", TT "t", "-spread monomals.",BR{},
"Some references can be found in the papers ", HREF("http://arxiv.org","Computational methods for t-spread monomial ideals"), " and ", HREF("http://arxiv.org","A numerical characterization of the extremal Betti numbers of t-spread strongly stable ideals"), ".",
Subnodes => {
"T-spread managing",
TO "tLastMon",
TO "tPascalIdeal",
TO "tSpreadList",
TO "tSpreadIdeal",
TO "isTSpread",
TO "tShadow",
"T-lex structures",
TO "tNextMon",
TO "tLexSeg",
TO "isTLexSeg",
TO "tLexMon",
TO "countTLexMon",
TO "tVeroneseSet",
TO "tVeroneseIdeal",
TO "isTLexIdeal",
"T-strongly stable structures",
TO "tStronglyStableSeg",
TO "isTStronglyStableSeg",
TO "tStronglyStableMon",
TO "countTStronglyStableMon",
TO "tStronglyStableIdeal",
TO "isTStronglyStableIdeal",
"Kruskal-Katona's Theorem",
TO "tMacaulayExpansion",
TO "fTVector",
TO "isFTVector",
TO "tLexIdeal",
"Extremal Betti numbers",
TO "tExtremalBettiCorners",
TO "tExtremalBettiMonomials",
"Services",
TO "solveBinomialExpansion",
TO "initialDegree",
TO "initialIdeal",
TO "minimalBettiNumbers",
TO "minimalBettiNumbersIdeal",
"Options",
TO "Shift",
TO "FixedMax",
TO "MaxInd"
},
}
document {
Key => {tNextMon,(tNextMon,RingElement,ZZ)},
Headline => "give the t-lex successor of a given t-spread monomial",
Usage => "tNextMon(u,t)",
Inputs => {"u" => {"a t-spread monomial of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {RingElement => {"the greatest ", TT "t", "-spread monomial less than ", TT "u", ", with respect to lexcografic order"}},
"the function ", TT "tNextMon(u,t)", " gives the ", TT "t" , "-lex successor of ", TT "t", ", that is, the greatest ", TT "t" , "-spread monomial less than ", , TT "u", " with respect to ", TEX///$>_\mathrm{slex}.$///,BR{},
"If ", TT "FixedMax", " is ",TT "true", " the function ", TT "tNextMon(u,t,FixedMax=>true)", " gives the ", TT "t" , "-lex successor for which the maximum of the support is ", TEX///$\max\textrm{supp}(\texttt{u}).$///,BR{},
"Given a ", TEX///$t$///, "-spread monomial ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///,", we define ", TEX///$\textrm{supp}(u)=\{i_1,i_2,\ldots, i_d\}$///, ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_16]
tNextMon(x_2*x_6*x_10*x_13,3)
tNextMon(x_2*x_6*x_10*x_13,3,FixedMax=>true)
///,
SeeAlso =>{FixedMax, tLexSeg, tLexIdeal},
}
document {
Key => {tLastMon,(tLastMon,RingElement,ZZ,ZZ)},
Headline => "give the last t-spread monomial of the Borel shadow a given t-spread monomial",
Usage => "tLastMon(u,gap,t)",
Inputs => {"u" => {"a t-spread monomial of a polynomial ring"},
"gap" => {"a positive integer representing the difference between the degrees"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {RingElement => {"the smallest ", TT "t", "-spread monomial of the Borel shadow of ", TT "u", ", with respect to lexcografic order"}},
"the function ", TT "tLastMon(u,gap,t)", " gives the smallest ", TT "t" , "-spread monomials of the Borel shadow iterated ", TT "gap", "times of ", TT "u", ", that is, the smallest monomial of ", TEX///$B_\texttt{t}\{\texttt{u}\}$///, ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{},
"If ", TT "MaxInd", " is greater than -1 the function ", TT "tLastMon(u,gap,t,MaxInd=>m)", " gives the smallest ", TT "t" , "-spread monomial for which the maximum of the support is ", TT "m", BR{},
"The Borel shadow of a ", TT "t", "-spread monomial ", TT "u", ", is defined as the shadow of the strongly stable set generated by ", TT "u", ". To work in a ", TT "t", "-spread contest, the Borel shadow of ", TT "u", " is the ", TT "t", "-shadow of ", TEX///$B_\texttt{t}\{u\}$///, ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_16]
tLastMon(x_2*x_6*x_10*x_13,1,3)
tLastMon(x_2*x_6*x_10*x_13,1,3,MaxInd=>14)
///,
SeeAlso =>{FixedMax, tShadow},
}
document {
Key => {tLexSeg,(tLexSeg,RingElement,RingElement,ZZ)},
Headline => "give the t-lex segment with given extremes",
Usage => "tLexSeg(v,u,t)",
Inputs => {"v" => {"a t-spread monomial of a polynomial ring"},
"u" => {"a t-spread monomial of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {List => {"the set of all the ", TT "t", "-spread monomials smaller than ", TT "v", " and greater than ", TT "u", ", with respect to lexcografic order"}},
"the function ", TT "tLexSeg(v,u,t)", " gives the ", TT "t" , "-lex segment defined by ", TT "v", " and ", TT "u", ", that is, the set of all the ", TT "t" , "-spread monomials smaller than ", , TT "v", " and greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{},
"This function iteratively uses the method ", TT "tNextMon(u,t)", " until the returned monomial is ",TT "u", ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_14]
tLexSeg(x_2*x_5*x_10*x_13,x_2*x_6*x_9*x_12,2)
tLexSeg(x_2*x_5*x_10*x_13,x_2*x_6*x_9*x_12,3)
///,
SeeAlso =>{tNextMon, tLexIdeal},
}
document {
Key => {isTLexSeg,(isTLexSeg,List,ZZ)},
Headline => "whether a set of t-spread monomials is a t-lex segment",
Usage => "isTLexSeg(l,t)",
Inputs => {"l" => {"a list of t-spread monomials of a polynomial ring"}
},
Outputs => {Boolean => {"whether the list ", TT "l", " of monomials is a t-lex segment"}},
"the function ", TT "isTLexSeg(l,t)", " is ", TT "true", " whether the list of monomials ", TT "l" , " is a ", TT "t", "-lex segment, that is, the set of all the ", TT "t" , "-spread monomials smaller than the maximum of ", TT "l", " and greater than the minimum of ", TT "l", ", with respect to ", TEX///$>_\mathrm{slex}.$///,
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_7]
isTLexSeg({x_1*x_4*x_7,x_1*x_5*x_7,x_2*x_4*x_6,x_2*x_4*x_7,x_2*x_5*x_7},2)
isTLexSeg({x_1*x_4*x_7,x_2*x_4*x_6,x_2*x_4*x_7,x_2*x_5*x_7},2)
///,
SeeAlso =>{tLexSeg, tNextMon},
}
document {
Key => {tLexMon,(tLexMon,RingElement,ZZ)},
Headline => "give the smallest initial t-lex segment containing a given monomial",
Usage => "tLexMon(u,t)",
Inputs => {"u" => {"a t-spread monomial of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {List => {"the set of all the ", TT "t", "-spread monomials greater than ", TT "u", ", with respect to lexcografic order"}},
"the function ", TT "tLexMon(u,t)", " gives the initial ", TT "t" , "-lex segment defined by ", TT "u", ", that is, the set of all the ", TT "t" , "-spread monomials greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{},
"This function calls the method ", TT "tLexSeg(v,u,t)", ", where ",TT "v", " is the greatest ", TT "t" , "-spread monomial of the polynomial ring.", " Let ", TEX///$S=K[x_1,\ldots,x_n]$///, " and ", TEX///$u\in M_{n,d,t}$///, ", then ", TEX///$v=x_1x_{1+t}\cdots x_{1+(d-1)t}$///, ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_9]
tLexMon(x_2*x_5*x_8,2)
tLexMon(x_2*x_5*x_8,3)
///,
SeeAlso =>{tNextMon, tLexSeg, isTLexSeg},
}
document {
Key => {countTLexMon,(countTLexMon,RingElement,ZZ)},
Headline => "give the cardinality of the smallest initial t-lex segment containing a given monomial",
Usage => "countTLexMon(u,t)",
Inputs => {"u" => {"a t-spread monomial of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {ZZ => {"the number of all the ", TT "t", "-spread monomials greater than ", TT "u", ", with respect to lexcografic order"}},
"the function ", TT "countTLexMon(u,t)", " gives the cardinality of ", TEX///$L_t\{u\}$///, ", the initial ", TT "t" , "-lex segment defined by ", TT "u", ", that is, the number of all the ", TT "t" , "-spread monomials greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{},
"If ", TT "FixedMax", " is ",TT "true", " the function ", TT "countTLexMon(u,t,FixedMax=>true)", " gives the number of all the ", TT "t" , "-spread monomials having maximum of the support equal to ", TEX///$\max\textrm{supp}(u)$///, " and greater than ", TT "u", ", with respect to ", TEX///$>_\mathrm{slex}.$///,BR{},
"Given a ", TEX///$t$///, "-spread monomial ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///,", we define ", TEX///$\textrm{supp}(u)=\{i_1,i_2,\ldots, i_d\}$///, ".", BR{},
"This method is not constructive. It uses a theoretical result to obtain the cardinality as the sum of suitable binomial coefficients. The procedure only concerns ", TEX///$\textrm{supp}(\texttt{u}),$///, " that is, the set ", TEX///$\{i_1,i_2,\ldots, i_d\}$///, ", when ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///, " is a ", TEX///$t$///, "-spread monomial.",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_9]
countTLexMon(x_2*x_5*x_8,2)
countTLexMon(x_2*x_5*x_8,3)
///,
SeeAlso =>{tLexMon},
}
document {
Key => {tVeroneseSet,(tVeroneseSet,Ring,ZZ,ZZ)},
Headline => "give the Veronese set of t-spread monomials of a given degree",
Usage => "tVeroneseSet(S,d,t)",
Inputs => {"S" => {"a polynomial ring"},
"d" => {"a nonnegative integer that identifies the degree of the monomials"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {List => {"the set of all the ", TT "t", "-spread monomials of ", TT "S", " of degree ", TT "d"}},
"the function ", TT "tVeroneseSet(S,d,t)", " gives the Veronese set of ", TT "t" , "-spread monomials of degree ", TT "d", ", that is, the set of all the ", TT "t" , "-spread monomials of ", TT "S", " of degree ", TT "d",
"This function calls the method ", TT "tLexSeg(v,u,t)", ", where ",TT "v", " is the greatest ", TT "t" , "-spread monomial of the polynomial ring and ", TT "u", " the smallest one. If ", TEX///$S=K[x_1,\ldots,x_n]$///, " then ", TEX///$v=x_1x_{1+t}\cdots x_{1+(d-1)t}$///, " and ", TEX///$u=x_{n-(d-1)t}\cdots x_{n-t} x_{n}$///, ". This set is also denoted by ", TEX///$M_{n,d,t}$///, ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_8]
tVeroneseSet(S,3,2)
tVeroneseSet(S,3,3)
///,
SeeAlso =>{tNextMon, tLexSeg, isTLexSeg, tLexMon, tVeroneseIdeal},
}
document {
Key => {tVeroneseIdeal,(tVeroneseIdeal,Ring,ZZ,ZZ)},
Headline => "give the Veronese ideal of t-spread monomials of a given degree",
Usage => "tVeroneseIdeal(S,d,t)",
Inputs => {"S" => {"a polynomial ring"},
"d" => {"a nonnegative integer that identifies the degree of the monomials"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {Ideal => {"the ideal generated by all the ", TT "t", "-spread monomials of ", TT "S", " of degree ", TT "d"}},
"the function ", TT "tVeroneseIdeal(S,d,t)", " returns the Veronese ideal of ", TT "t" , "-spread monomials of degree ", TT "d", ", that is, the ideal generated by all the ", TT "t" , "-spread monomials of ", TT "S", " of degree ", TT "d",
"This function calls the method ", TT "tVeroneseSet(S,d,t)", ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_8]
tVeroneseIdeal(S,3,2)
tVeroneseIdeal(S,3,4)
///,
SeeAlso =>{tNextMon, tLexSeg, isTLexSeg, tLexMon, tVeroneseSet},
}
document {
Key => {tPascalIdeal,(tPascalIdeal,Ring,ZZ)},
Headline => "give the Pascal ideal of t-spread monomials of a given polynomial ring",
Usage => "tPascalIdeal(S,t)",
Inputs => {"S" => {"a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {Ideal => {"the Pascal ideal of ", TT "t", "-spread monomials of ", TT "S"}},
"the function ", TT "tPascalIdeal(S,t)", " returns the Pascal ideal of ", TT "t" , "-spread monomials of ", TT "S", ", that is, the ideal generated by the minimun number of ", TT "t" , "-spread monomials of ", TT "S", " with the greatest possible degrees and such that the supports of the generators are pairwise disjoint.",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_10]
tPascalIdeal(S,3)
tPascalIdeal(S,4)
///,
}
document {
Key => {tSpreadList,(tSpreadList,List,ZZ)},
Headline => "give the set of all t-spread monomials of a given list",
Usage => "tSpreadList(l,t)",
Inputs => {"l" => {"a list of t-spread monomials of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {List => {"the set of all the ", TT "t", "-spread monomials belonging to ", TT "l"}},
"the function ", TT "tSpreadList(l,t)", " gives the list of all the ", TT "t" , "-spread monomials ", TT "l", ".",BR{},
"This function calls the method ", TT "isTSpread(u,t)", " to check whether the monomial ", TT "u", " is ", TT "t" , "-spread, for all the monomials that belong to the list ", TT "l", ".", BR{},
"Let ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///, " a monomial of ", TEX///$S=K[x_1,\ldots,x_n]$///, ", with ", TEX///$1\le i_1\le i_2\le\dots\le i_d\le n$///, ". The monomial ", TT "u", " is called ", TEX///$t$///, "-spread if ", TEX///$i_{j+1}-i_j\ge t$///, " for all ", TEX///$j\in [d-1]$///, ".",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_14]
l={x_3*x_7*x_10*x_14, x_1*x_5*x_9*x_13}
tSpreadList(l,4)
tSpreadList(l,5)
///,
SeeAlso =>{tSpreadIdeal, isTSpread},
}
document {
Key => {tSpreadIdeal,(tSpreadIdeal,Ideal,ZZ)},
Headline => "give the ideal generated by the t-spread monomials which are among the generators of a given ideal",
Usage => "tSpreadIdeal(I,t)",
Inputs => {"I" => {"a graded ideal of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {Ideal => {"the ideal generated by all the ", TT "t", "-spread monomials belonging to the generator set of the ideal ", TT "I"}},
"the function ", TT "tSpreadIdeal(I,t)", " gives the ideal generated by all the ", TT "t" , "-spread monomials which are among the generators of the ideal ", TT "I", ".",BR{},
"This function calls the method ", TT "tSpreadList(l,t)", " to sieve the ", TT "t" , "-spread monomials from the list ", TT "l", ", of the generators of the ideal ", TT "I", ".", BR{},
"Let ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///, " a monomial of ", TEX///$S=K[x_1,\ldots,x_n]$///, ", with ", TEX///$1\le i_1\le i_2\le\dots\le i_d\le n$///, ". The monomial ", TT "u", " is called ", TEX///$t$///, "-spread if ", TEX///$i_{j+1}-i_j\ge t$///, " for all ", TEX///$j\in [d-1]$///, ". A monomial ideal is called ", TT "t", "-spread if it is generated by ", TT "t", "-spread monomals.",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_14]
I=ideal {x_3*x_7*x_10*x_14, x_1*x_5*x_9*x_13}
tSpreadIdeal(I,3)
tSpreadIdeal(I,4)
///,
SeeAlso =>{tSpreadList, isTSpread},
}
document {
Key => {isTSpread,(isTSpread,RingElement,ZZ),(isTSpread,List,ZZ),(isTSpread,Ideal,ZZ)},
Headline => "whether a monomial, a list of monomials or a monomial ideal is t-spread",
Usage => "isTSpread(u,t), isTSpread(l,t) or isTSpread(I,t)",
Inputs => {"u" => {"a monomial of a polynomial ring"},
"l" => {"a list of monomials of a polynomial ring"},
"I" => {"a monomial ideal of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {Boolean => {"whether a given monomial ", TT "u", ", a list of monomials " , TT "l", " or a monomial ideal ", TT "I", " is ", TT "t", "-spread"}},
"the function ", TT "isTSpread(-,t)", " has three overloading changing for the first parameter. It checks whether a given monomial ", TT "u", ", a list of monomials ", TT "l", " or a monomial ideal ", TT "I", " is ", TT "t" , "-spread.",BR{},
"Let ", TEX///$u=x_{i_1}x_{i_2}\cdots x_{i_d}$///, " a monomial of ", TEX///$S=K[x_1,\ldots,x_n]$///, ", with ", TEX///$1\le i_1\le i_2\le\dots\le i_d\le n$///, ". The monomial ", TT "u", " is called ", TEX///$t$///, "-spread if ", TEX///$i_{j+1}-i_j\ge t$///, " for all ", TEX///$j\in [d-1].$///, BR{},
"A list of monomials is ", TT "t", "-spread if all the monomials of the list are ", TT "t", "-spread. A monomial ideal is called ", TT "t", "-spread if it is generated by ", TT "t", "-spread monomals.",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_14]
l={x_3*x_7*x_10*x_14, x_1*x_5*x_9*x_13}
isTSpread(l#0,3)
isTSpread(l,3)
isTSpread(ideal l,3)
isTSpread(ideal l,4)
///
}
document {
Key => {tShadow,(tShadow,RingElement,ZZ),(tShadow,List,ZZ)},
Headline => "give the t-spread shadow of a given t-spread monomial or a given list of t-spread monomials",
Usage => "tShadow(u,t)",
Inputs => {"u" => {"a t-spread monomial of a polynomial ring"},
"l" => {"a list of t-spread monomials of a polynomial ring"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {List => {"the list of all the ", TT "t", "-spread monomial of the shadow of the ", TT "t", "-spread monomial ", TT "u", " or of the list ", TT "l"}},
"the function ", TT "tShadow(u,t)", " gives the ", TT "t" , "-spread shadow of ", TT "u", ", that is, the set of all the ", TT "t" , "-spread monomials of the shadow of ", TT "u", ". The overloading function ", TT "tShadow(l,t)", " gives the ", TT "t" , "-spread shadow of ", TT "l", ", that is, the set of all the ", TT "t" , "-spread monomials of the shadow of each ", TT "t", "-spread monomial belonging to ", TT "l", ".",BR{},
"Let ", TEX///$S=K[x_1,\ldots,x_n]$///, " and ", TEX///$u\in M_{n,d,t}$///, ", that is, ", TT "u", " is a ", TEX///$t$///, "-spread monomial of degree ", TEX///$d$///, ". The ", TT "t", "-spread shadow of ", TT "u", ", is defined as ", TEX///$\mathrm{Shad}_t(u)=\{ux_i\ :\ i\in [n]\}\cap M_{n,d+1,t}$///, ". The algorithm is optimized for the ", TEX///$t$///, "-spread environment.",
PARA {"Examples:"},
EXAMPLE lines ///
S=QQ[x_1..x_14]
u=x_2*x_6*x_10
tShadow(u,3)
tShadow(u,4)
l={x_3*x_6*x_10, x_1*x_5*x_9}
tShadow(l,3)
tShadow(l,4)
///,
SeeAlso =>{isTSpread},
}
document {
Key => {tMacaulayExpansion,(tMacaulayExpansion,ZZ,ZZ,ZZ,ZZ)},
Headline => "compute the t-Macaulay expansion of a positive integer",
Usage => "tMacaulayExpansion(a,n,d,t)",
Inputs => {"a" => {"a positive integer to be expanded"},
"n" => {"a positive integer that identifies the number of indeterminates"},
"d" => {"a positive integer that identifies the degree"},
"t" => {"a positive integer that idenfies the t-spread contest"}
},
Outputs => {List => {"pairs of positive integers representing the ", TT "d", "-th (shifted) t-Macaulay expansion of ", TT "a", " with a given ", TT "n"}},
"Given four positive integers ", TT "(a,n,d,t)", " there is a unique expression of ", TT "a", " as a sum of binomials ", TEX///$a=\binom{a_d}{d} + \binom{a_{d-1}}{d-1} + \cdots + \binom{a_j}{j}.$///, " where ", TEX///$a_i > a_{i-1} > \cdots > a_j > j >= 1.$///,BR{},
"If the optional parameter ", TT "Shift", " is ", TT "true", ", then the method ", TT "tMacaulayExpansion(a,n,d,t,Shift=>true)", " returns the shifted t-Macaulay expansion of ", TT "a", ", that is, ", TEX///$a^{(d)}=\binom{a_d}{d+1} + \binom{a_{d-1}}{d} + \cdots + \binom{a_j}{j+1}.$///,