-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jets.m2
1667 lines (1542 loc) · 51 KB
/
Jets.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
--------------------------------------------------------------------------------
-- Copyright 2021-2024 Federico Galetto, Nicholas Iammarino
--
-- This program is free software: you can redistribute it and/or modify it under
-- the terms of the GNU General Public License as published by the Free Software
-- Foundation, either version 3 of the License, or (at your option) any later
-- version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-- details.
--
-- You should have received a copy of the GNU General Public License along with
-- this program. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
newPackage(
"Jets",
Version => "1.2",
Date => "October 15, 2024",
AuxiliaryFiles => true,
Authors => {
{
Name => "Federico Galetto",
Email => "[email protected]",
HomePage => "http://math.galetto.org"
},
{
Name=> "Nicholas Iammarino",
Email=> "[email protected]"
}
},
Headline => "compute jets of various algebraic, geometric and combinatorial objects",
PackageImports => {"Varieties"},
PackageExports => {"EdgeIdeals"},
DebuggingMode => false,
Keywords => {"Algebraic Geometry"},
Certification => {
"journal name" => "The Journal of Software for Algebra and Geometry",
"journal URI" => "https://msp.org/jsag/",
"article title" => "Computing with jets",
"acceptance date" => "20 October 2022",
"published article URI" => "https://msp.org/jsag/2022/12-1/p06.xhtml",
"published article DOI" => "10.2140/jsag.2022.12.43",
"published code URI" => "https://msp.org/jsag/2022/12-1/jsag-v12-n1-x06-Jets.m2",
"repository code URI" => "https://github.com/Macaulay2/M2/blob/master/M2/Macaulay2/packages/Jets.m2",
"release at publication" => "b0d482205848caeda2616f4ed58be2a6783e88a2", -- git commit number in hex
"version at publication" => "1.1",
"volume number" => "12",
"volume URI" => "https://msp.org/jsag/2022/12-1/"
}
)
importFrom(MinimalPrimes, {"radical","minimalPrimes"});
export {
"JJ",
"jets",
"jetsMaxOrder",
"jetsBase",
"jetsRing",
"projet",
"jet",
"jetsMatrix",
"jetsRadical",
"jetsProjection",
"jetsInfo",
"principalComponent",
"Saturate",
"liftingFunction",
"liftingMatrix"
}
jetsOptions = {
Projective=> false
-- these are set up in case one needs to pass these options
-- to jets of a RingMap
-- DegreeMap=> null,
-- DegreeLift=> null
};
---------------------------------------------------------------------------
--helpers------------------------------------------------------------------
---------------------------------------------------------------------------
--create new-tier variables for jets ring
--by appending the order n as a string to the variable names
-*
jetsVariables = (n,R) -> (
symList := apply(gens R, baseName);
nString := toString n;
varNames:=
for s in symList list (
if instance(s,IndexedVariable) then (
name := separate("_", toString s);
name#0 | nString | "_" | name#1
) else (
toString s | nString
)
);
varNames = apply(varNames,value)
)
*-
jetsVariables= (n,R) -> (
symList := apply(gens R, baseName);
nString := toString n;
for s in symList list (
if instance(s,IndexedVariable) then (
name := (toString s#0) | nString;
(getSymbol name)_(s#1)
) else (
getSymbol (toString s | nString)
)
)
)
--generate degree list for order n jets variables
--this is used to create the rings of projective jets
degGenerator = (n,R) -> apply(degrees R, d -> toList((#d):n))
--generate degrees/map for truncation ring in ideal calculation
jetsDegrees = jetsOptions >> o -> R -> (
Tdegrees := null;
degreeMap := null;
if o.Projective then (
Tdegrees = -1* {degree R_0};
degreeMap = d -> degree 1_R;
) else (
Tdegrees = {degree 1_R};
degreeMap = identity;
);
(Tdegrees, degreeMap)
)
--------------------------------------------------------------------------
--method functions--------------------------------------------------------
--------------------------------------------------------------------------
--Jets (Main Method)------------------------------------------------------
jets = method(Options=>jetsOptions);
jets(ZZ,PolynomialRing) := PolynomialRing => o -> (n,R) -> (
if n<0 then error("jets order must be a non-negative integer");
if not isCommutative R then error("jets method does not support noncommutative rings");
--name to assign "storage" hashtable to be cached in the base ring
typeName := if o.Projective then (projet) else (jet);
jetDegs := null;--initialize degree list for jets variables
if not R#? typeName then (
jetDegs = if o.Projective then degGenerator(0, R) else degrees R;
R#typeName = new CacheTable from {
(symbol jetsMaxOrder)=> 0,
(symbol jetsRing)=> coefficientRing R[jetsVariables(0,R),
Join=> false,
Degrees=> jetDegs],
}
);
m := R#typeName#jetsMaxOrder;
S := R#typeName#jetsRing;
--build jet ring tower incrementally up to order n
if n>m then (
for i from m+1 to n do(
jetDegs = if o.Projective then degGenerator(i,R) else degrees R;
S = S[jetsVariables(i,R),
Join=> false,
Degrees=> jetDegs];
);
R#typeName#jetsMaxOrder = n;
R#typeName#jetsRing = S;
) else if m>n then (
for i from 0 to m-n-1 do (
S = coefficientRing S;
)
);
S#jetsInfo = new CacheTable from {
(symbol jetsBase)=> R,
(symbol Projective)=> o.Projective
};
S
)
jets(ZZ,Ideal) := Ideal => o -> (n,I) -> (
if n<0 then error("jets order must be a non-negative integer");
R := ring I;
S := null;--initializes jets ring
t := local t;--initializes truncation variable
typeName := if o.Projective then (projet) else (jet);
if not I.cache#? typeName then (
S = jets(0,R, Projective=> o.Projective);
I.cache#typeName = new CacheTable from {
(symbol jetsMaxOrder)=> 0,
(symbol jetsMatrix)=> (map(S,R,vars S)) gens I
};
);
m := I.cache#typeName#jetsMaxOrder;
--calculate higher order entries if needed
if n>m then (
S = jets(n,R, Projective=> o.Projective);
(Tdegrees, degreeMap) := jetsDegrees (R, Projective=> o.Projective);
T := S[t, Degrees=> Tdegrees, Join=> false]/(ideal(t^(n+1)));
--a row matrix of substitution polynomials in t with coefficients
--in the jets ring. Calculated incrementally from variables of each
--level of the tower.
tempS := S;
Tpolys := sum join(
(for i from 0 to n-1 list(
promote(matrix t^(n-i),T) * vars tempS
) do (
tempS = coefficientRing tempS)),
{promote (matrix t^0,T) * vars tempS}
);
phi := map(T,R,Tpolys,DegreeMap=> degreeMap);
--a list of generators for I is obtained to avoid dropping/repeating
geners := I_*;
--condition determining if all generators of the ideal are constants
constCond := all(geners,isConstant);
--add dummy generator to avoid loss of zeros
gensI := if constCond then matrix{geners | {R_0}} else matrix{geners};
c := last coefficients(phi gensI);
--remove dummy generators if necessary
if constCond then c = c_{0..(numColumns c - 2)};
resultMatrix := lift(c,S);
--update value in ideal cache
I.cache#typeName#jetsMatrix = resultMatrix;
I.cache#typeName#jetsMaxOrder = n;
m=n;
);
--retrieve ideal of appropriate order
JMatrix := I.cache#typeName#jetsMatrix;
if zero JMatrix then return ideal(0_(jets(n,R)));
f := map(jets(n,R,Projective=> o.Projective),jets(m,R, Projective=> o.Projective));
J := f ideal (JMatrix^{m-n..m});
J.cache#jetsInfo = new CacheTable from {
jetsBase=> I,
Projective=> o.Projective
};
J
)
jets(ZZ,QuotientRing) := QuotientRing => o -> (n,R) -> (
if n<0 then error("jets order must be a non-negative integer");
splitQuotient := presentation R;
ambientRing := ring splitQuotient;
base := null; --jets ring to be used in quotient
modI := null; --jets ideal to be used in quotient
Q := null; --variable to store quotient ring
typeName := if o.Projective then (projet) else (jet);
if not R#? typeName then (
base = jets(0, ambientRing, Projective=> o.Projective);
modI = jets(0, ideal(splitQuotient), Projective=> o.Projective);
R#typeName = new CacheTable from {
(symbol jetsRing)=> new CacheTable from {
0 => base/modI
},
};
);
--form the jets of a quotient ring by taking the quotients of a jets
--ring and a jets ideal. Each order of the quotient is stored in a
--cache table with the integer value of the order as the key
if R#typeName#jetsRing#? n then (
Q = R#typeName#jetsRing#n;
) else (
base = jets(n, ambientRing, Projective=> o.Projective);
modI = jets(n, ideal(splitQuotient), Projective=> o.Projective);
Q = base/modI;
R#typeName#jetsRing#n = Q;
Q#jetsInfo = new CacheTable from {
jetsBase=> R,
Projective=> o.Projective
}
);
Q
)
jets(ZZ,RingMap) := RingMap => o -> (n,phi) -> (
if n<0 then error("jets order must be a non-negative integer");
I := ideal(phi.matrix);
typeName := if o.Projective then (projet) else (jet);
-- check whether jets have been calculated for this map
if (not phi.cache#? typeName) then (
jets(0,I, Projective=> o.Projective);
phi.cache#typeName = new CacheTable from {
(symbol jetsMaxOrder)=> 0,
(symbol jetsMatrix)=> (map(jets(0,phi.target, Projective=> o.Projective),
jets(0,phi.source, Projective=> o.Projective),
I.cache#typeName#jetsMatrix)).matrix
};
);
JR := jets(n,phi.source, Projective=> o.Projective);
JS := jets(n,phi.target, Projective=> o.Projective);
targets := null;
--check whether lower order jets have already been calculated
m := phi.cache#typeName#jetsMaxOrder;
if m < n then (
jets(n,I, Projective=> o.Projective);
targets = (I.cache#typeName#jetsMatrix);
phi.cache#typeName#jetsMaxOrder = n;
phi.cache#typeName#jetsMatrix = targets;
) else (
targets = phi.cache#typeName#jetsMatrix^{m-n..m};
--need to lift 'targets' to jets of order m-n
targets=lift(targets,JS);
);
psi := map(JS,JR,flatten transpose targets);
psi.cache#jetsInfo = new CacheTable from {
jetsBase=> phi,
Projective=> o.Projective
};
psi
)
jets(ZZ,Graph) := Graph => o -> (n,G) -> (
if n<0 then error("jets order must be a non-negative integer");
--get the list of edges of the jets of the (hyper)graph
--ring is flattened because graphs don't play well with towers of rings
E := (flattenRing(jetsRadical(n,edgeIdeal G),Result=>1)) / support;
--create graph
graph E
)
jets(ZZ,HyperGraph) := HyperGraph => o -> (n,G) -> (
if n<0 then error("jets order must be a non-negative integer");
--get the list of edges of the jets of the (hyper)graph
--ring is flattened because graphs don't play well with towers of rings
E := (flattenRing(jetsRadical(n,edgeIdeal G),Result=>1)) / support;
--create hypergraph
hyperGraph E
)
jets(ZZ,AffineVariety) := Variety => o -> (n,V) -> (
if n<0 then error("jets order must be a non-negative integer");
R := ring V;
JR := jets(n,R,Projective=> o.Projective);
if o.Projective then return Proj JR else return Spec JR;
)
---Secondary Methods--------------------------------------------------
--to potentially reduce computation time for monomial jet ideals
--(see documentation)
jetsRadical = method(TypicalValue=>Ideal);
jetsRadical(ZZ,Ideal) := (n,I) -> (
if n<0 then error("jets order must be a non-negative integer");
if isMonomialIdeal I then (
baseIdeal := jets(n,I);
R := ring I;
gensList := flatten entries gens baseIdeal;
termList := apply(gensList, t-> terms(coefficientRing R, t));
squarefreeGens := apply(apply(flatten termList, support),product);
ideal(squarefreeGens)
) else (
radical jets(n,I)
)
)
--to create a map sending elements of a jets ring to a jets ring of
--higher order
jetsProjection = method(Options=>jetsOptions,TypicalValue=>RingMap);
jetsProjection(ZZ,ZZ,PolynomialRing) :=
jetsProjection(ZZ,ZZ,QuotientRing) := o -> (t,s,R) -> (
if t < s then error("first argument must be less than or equal to the second");
if t<0 or s<0 then error("jets orders must be non-negative integers");
(map(jets(t,R,Projective=> o.Projective),jets(s,R,Projective=> o.Projective)))
)
--scripted functor for jets
--this modeled after the code for Tor
--if new jets methods are added, this will automatically work
JJ = new ScriptedFunctor from {
subscript => (
i -> new ScriptedFunctor from {
argument => (X -> (
jetsOptions >> o -> Y -> (
f := lookup(jets,class i,class Y);
if f === null then error "no method available"
else (f o)(i,Y)
)
) X
)
}
)
}
--compute an ideal whose vanishing locus is the
--principal component of the jets of an ideal
--changed in v1.2 with a faster algorithm for monomial ideals
--and to fix the behavior for reducible varieties
-- FG's note: I tried an option for bypassing the computation
-- of minimal primes, but for some reason this method appears to
-- work faster if minimal primes are found first
-- (at least for 2x2 minors of a generic 3x3 matrix)
principalComponent = method(Options=>{Saturate=>true},TypicalValue=>Ideal)
principalComponent(ZZ,Ideal) := o -> (n,I) -> (
if n<0 then error("jets order must be a non-negative integer");
-- find minimal primes
mp := minimalPrimes I;
-- for a monomial ideal use shortcut from Galetto-Iammarino-Yu
if isMonomialIdeal(I) then (
return intersect(apply(mp, P -> jets(n,P)));
);
-- compute the singular locus of I by breaking up components
-- and finding singular locus of each
-- (this is necessary as of v1.24.05 because the singularLocus
-- method only works for irreducible ideals)
singComp := apply(mp, P -> ideal singularLocus P);
-- then also intersect components two at a time
pairwiseInt := apply(subsets(mp,2),sum);
-- and finally take the union
sing := intersect(singComp|pairwiseInt);
-- compute jets of I
JI := jets(n,I);
-- get the jets projection
R := ring I;
p := jetsProjection(n,0,R);
-- identify original ambient ring with 0-jets
i := map(source p,R,vars source p);
--map the singular locus to the zero jets via the map i
--then to the n jets via the map p
sing0 := p i sing;
--default is to saturate JI wrt sing
if o.Saturate then (
saturate(JI,sing0)
)
--if JI is radical, colon is enough
else (
JI:sing0
)
)
-- the following methods (liftingFunction, liftingMatrix)
-- follow the definitions in the paper by Galetto-Iammarino-Yu
-- unexported recursive computation of lifting function
lf = (s,j,k) -> (
-- deal with edge cases
if (k<j or k>(s+1)*j) then return 0_ZZ;
if (k==j) then return ((s+1)^j)_ZZ;
if (k==(s+1)*j) then return 1_ZZ;
-- recursive computation
sum(min(k,s+1), i -> binomial(s+1,i+1) * mlf(s,j-1,k-i-1) )
)
-- speeds up computation by storing values
mlf = memoize lf
-- lifting function method for user
liftingFunction = method(TypicalValue => ZZ);
liftingFunction(ZZ,ZZ,ZZ) := ZZ => (s,j,k) -> (
-- check arguments are nonnegative
if (s<0 or j<0 or k<0) then error("arguments should be nonnegative");
mlf(s,j,k)
)
-- enter values of lifting function in a matrix
-- row/column indices start at zero
liftingMatrix = method(TypicalValue => Matrix);
liftingMatrix(ZZ,ZZ,ZZ) := Matrix => (s,r,c) -> (
-- check arguments are nonnegative
if (s<0) then error("first argument should be nonnegative");
if (r<=0 or c<=0) then error("second and third argument should be positive");
matrix table(r,c, (j,k) -> mlf(s,j,k) )
)
beginDocumentation()
----------------------------------------------------------------------
-- TESTS
----------------------------------------------------------------------
TEST ///
R = QQ[x,y,z];
assert(degrees jets(2,R) === {{1}, {1}, {1}})
assert(degrees jets(2,R,Projective=> true) === {{2}, {2}, {2}})
I=ideal(y-x^2,z-x^3);
assert(not(isHomogeneous jets(2,I)))
assert(isHomogeneous jets(2,I,Projective=>true))
///
--for non uniform degrees
TEST ///
R = QQ[x,y,z, Degrees=> {2,3,1}];
assert(degrees jets(2,R) === {{2}, {3}, {1}})
assert(degrees jets(2,R,Projective=> true) === {{2}, {2}, {2}})
I = ideal(x*y, x*z^2);
J = ideal(x^3-y*z^3, y+x*z);
assert(isHomogeneous jets(2,I))
assert(isHomogeneous jets(2,I,Projective=>true))
assert(isHomogeneous jets(2,J))
assert(isHomogeneous jets(2,J,Projective=>true))
X = radical jets(2,I);
Y = jetsRadical(2,I);
assert(X == Y)
assert(mingens X === mingens Y);
///
TEST ///
R=QQ[x,y, Degrees=> {2,3}];
S=QQ[a,b,c, Degrees=> {1,1,2}]
phi = map(S,R, {a^2 + c, b*c});
f = jets(2,phi);
testx = c2+2*a0*a2+a1^2;
testy = b0*c2+c0*b2+b1*c1;
assert(f x2 === testx)
assert(f y2 === testy)
assert(isHomogeneous jets(3,phi))
assert(isHomogeneous jets(3,phi,Projective=>true))
///
--for ideals with constant generators
TEST ///
R=QQ[x]
I0 = ideal(2_R)
Ftest0=jets(2,I0)
assert(Ftest0 == jets(2,R))
I1 = ideal(2_R,x)
Ftest1=jets(2,I1)
assert(Ftest1 == jets(2,R))
S=ZZ[x]
J0 = ideal(2_S)
Ztest0 = jets(2,J0)
assert(Ztest0!=jets(2,S))
J1 = ideal(2_S,x)
Ztest1=jets(2,J1)
assert(Ztest1!=jets(2,S))
///
--for principal component
TEST ///
R=QQ[x,y]
I=ideal(y^2-x^3)
PC=principalComponent(2,I)
P=primaryDecomposition jets(2,I)
C=first select(P,c -> degree c == 6)
assert(PC == C)
///
--for quotients and varieties
TEST ///
R = QQ[x,y]
I = ideal(y^2,x^3)
Q = R/I
JR = jets(2,R)
JI = jets(2,I)
JQ = jets(2,Q)
assert(JR === ambient JQ)
assert(JI === ideal JQ)
assert(presentation (JR/JI) === presentation JQ)
V = Spec Q
JV = jets(2,V)
assert(ring JV === JQ)
///
--for graphs
TEST ///
R=QQ[x,y,z]
G = graph(R,{{x,y},{y,z},{x,z}})
JG = jets(1,G)
JR = jets(1,R)
use ring JG
test = {{x0,y0},{x0,z0},{y0,z0},{x1,y0},{x1,z0},{y1,x0},{y1,z0},{z1,x0},{z1,y0}}
assert((set edges JG) === (set test))
///
--for projections
TEST ///
R=QQ[x,y,z]
I = ideal(y-x^2,z-x^3)
JI = jets(1,I)
p = jetsProjection(3,1,R)
assert(ring p JI === jets(3,R))
///
-- for lifting function
TEST ///
M=matrix{{1,0,0,0,0,0,0,0,0},
{0,2,1,0,0,0,0,0,0},
{0,0,4,4,1,0,0,0,0},
{0,0,0,8,12,6,1,0,0},
{0,0,0,0,16,32,24,8,1}}
assert(liftingMatrix(1,5,9) === M)
N=matrix{{1,0,0,0,0,0,0,0,0,0,0,0,0},
{0,3,3,1,0,0,0,0,0,0,0,0,0},
{0,0,9,18,15,6,1,0,0,0,0,0,0},
{0,0,0,27,81,108,81,36,9,1,0,0,0},
{0,0,0,0,81,324,594,648,459,216,66,12,1}}
assert(liftingMatrix(2,5,13) === N)
///
----------------------------------------------------------------------
-- Documentation
----------------------------------------------------------------------
doc ///
Node
Key
Jets
Headline
compute jets of various algebraic, geometric and combinatorial objects
Description
Text
This package enables computations with jet functors.
It introduces the @TO jets@ method to compute jets of
polynomial rings, ideals, quotients, ring homomorphisms,
and varieties.
The construction of jets follows an algebraic procedure
discussed in several sources, including the first three
references below.
Additional features include an alternative algorithm to compute
the radical of jets of monomial ideals, a function
to construct jets of graphs, a method for principal components of jets,
and an option for jets with "projective" gradings.
@HEADER4 "Version history:"@
@UL {(BOLD "1.1: ", "JSAG version."),
(BOLD "1.2: ", "Improved method for principal components.
Added methods for invariants of principal components
of monomial ideals.")
}@
References
@arXiv("math/0612862","L. Ein and M. Mustaţă,
Jet schemes and singularities.")@
@arXiv("math/0407113","P. Vojta,
Jets via Hasse-Schmidt Derivations.")@
@HREF("https://doi.org/10.1080/00927870500454927",
"R.A. Goward and K.E. Smith,
The jet scheme of a monomial scheme.")@
@arXiv("2104.08933","F. Galetto, E. Helmick, and M. Walsh,
Jet graphs.")@
@arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu,
Jets and principal components of monomial ideals, and very well-covered graphs")@
Subnodes
:Package methods
jets
jetsProjection
jetsRadical
principalComponent
liftingFunction
:Examples from the literature
"Example 1"
"Example 2"
"Example 3"
"Example 4"
:Technical information
"Storing Computations"
Node
Key
jets
Headline
compute the jets of an object
Subnodes
(jets,ZZ,PolynomialRing)
(jets,ZZ,Ideal)
(jets,ZZ,QuotientRing)
(jets,ZZ,RingMap)
(jets,ZZ,Graph)
(jets,ZZ,AffineVariety)
[jets,Projective]
JJ
Node
Key
"Storing Computations"
Headline
caching scheme for jets computations
Description
Text
In many cases, the @TO jets@ method will store its results inside
a @TO CacheTable@ in the base object. When the method is called
again with the same or a lower jets order, the result is pulled
from the cache.
For polynomial rings, data is stored under @TT "*.jet"@.
Example
R = QQ[x,y]
R.?jet
jets(3,R)
R.?jet
peek R.jet
Text
Note also that rings of jets are built as towers from lower to
higher jets orders. Therefore it is possible to store a single
ring of the highest order computed thus far.
For ideals, data is stored under @TT "*.cache.jet"@.
A single matrix is stored containing generators for the
highest order of jets computed thus far.
Generators for lower orders are recovered from this matrix
without additional computations.
Example
I = ideal (x^2 - y)
I.cache.?jet
elapsedTime jets(3,I)
I.cache.?jet
peek I.cache.jet
elapsedTime jets(3,I)
elapsedTime jets(2,I)
Text
For quotient rings, data is stored under @TT "*.jet"@.
Each jets order gives rise to a different quotient
that is stored separately under @TT "*.jet.jetsRing"@
(order zero jets are always included by default).
Example
Q = R/I
Q.?jet
jets(3,Q)
Q.?jet
peek Q.jet.jetsRing
jets(2,Q)
peek Q.jet.jetsRing
Text
For ring homomorphisms, data is stored under @TT "*.cache.jet"@.
A single matrix is stored describing the map for the
highest order of jets computed thus far.
Lower orders map are recovered from this matrix
without additional computations.
Example
S = QQ[t]
f = map(S,Q,{t,t^2})
isWellDefined f
f.cache.?jet
elapsedTime jets(3,f)
f.cache.?jet
peek f.cache.jet
elapsedTime jets(2,f)
Text
Projective jets data is stored separately under @TT "*.projet"@
or @TT "*.cache.projet"@ to accommodate for the different grading.
Example
jets(2,I,Projective=>true)
peek I.cache.projet
peek R.projet
Caveat
No data is cached when computing jets of affine varieties and (hyper)graphs,
radicals, or principal components.
Subnodes
jet
projet
jetsRing
jetsMaxOrder
jetsMatrix
jetsBase
jetsInfo
Node
Key
(jets,ZZ,PolynomialRing)
Headline
compute jets of a polynomial ring
Usage
jets (n,R)
Inputs
n:ZZ
R:PolynomialRing
Outputs
:PolynomialRing
of jets order @TT "n"@.
Description
Text
This function is provided by the package @TO Jets@. Rings are
constructed incrementally as towers. The function returns the
ring with variables in the jets order requested, and coefficients
in all lower orders. The grading or multigrading of the jets ring
follows from that of the base ring.
Example
R = QQ[x,y,z,Degrees=>{2,1,3}]
JR = jets(2,R)
describe JR
degrees (flattenRing JR)_0
Text
When the @TO [jets,Projective]@ option is set to true, the degree
of each jets variable matches the jets order, in accordance with
Proposition 6.6 (c) of @arXiv("math/0407113","P. Vojta,
Jets via Hasse-Schmidt Derivations")@.
Example
R = QQ[x,y,z,Degrees=>{2,1,3}]
JR = jets(2,R,Projective=>true)
degrees (flattenRing JR)_0
Text
The convention for labeling variables in the jets of polynomial ring
is to append the order of the jets to name of the variables in the
base ring. Existing subscripts are preserved.
Example
A = QQ[a_1..a_3]
JA = jets(1,A)
describe JA
Text
Note that the coefficient ring of the polynomial ring does not need
to be a field. The jets of the input polynomial ring will be a
polynomial ring with the same coefficient ring as the input.
Example
Zi = ZZ[i]/ideal(i^2+1)
B = Zi[b_1..b_3]
JB = jets(1,B)
describe JB
Caveat
With @TT "Projective=>true"@ the jet variables of order zero have degree 0,
therefore no heft vector exist for the ambient ring of the jets.
As a result, certain computations will not be supported, and others may run more slowly.
See @TO "Macaulay2Doc::heft vectors"@ for more information.
Node
Key
(jets,ZZ,Ideal)
Headline
compute jets of a an ideal in a polynomial ring
Usage
jets (n,I)
Inputs
n:ZZ
I:Ideal
Outputs
:Ideal
generated by the jets of the generators of @TT "I"@
Description
Text
This function is provided by the package
@TO Jets@.
Example
R = QQ[x,y]
I = ideal (x^3 + y^3 - 3*x*y)
J = jets(3,I);
netList J_*
Text
When the @TO [jets,Projective]@ option is set to true, the degree
of each jets variable matches its order, in accordance with
Proposition 6.6 (c) of @arXiv("math/0407113","P. Vojta,
Jets via Hasse-Schmidt Derivations")@.
As a result, the jets of any ideal will be homogeneous regardless
of the homogeneity of the base ideal, or that of its affine jets.
Example
R = QQ[x,y,z]
I = ideal (y-x^2, z-x^3)
JI = jets(2,I)
isHomogeneous JI
JIproj = jets(2,I,Projective=>true)
isHomogeneous JIproj
Caveat
With @TT "Projective=>true"@ the jet variables of order zero have degree 0,
therefore no heft vector exist for the ambient ring of the jets.
As a result, certain computations will not be supported, and others may run more slowly.
See @TO "Macaulay2Doc::heft vectors"@ for more information.
Node
Key
(jets,ZZ,QuotientRing)
Headline
the jets of an affine algebra
Usage
jets (n,Q)
Inputs
n:ZZ
Q:QuotientRing
Outputs
:QuotientRing
Description
Text
This function is provided by the package @TO Jets@. Forms the jets of a @TO QuotientRing@ by forming the quotient of
@TO (jets,ZZ,PolynomialRing)@ of the ambient ring of @TT "Q"@ with
@TO (jets,ZZ,Ideal)@ of the ideal defining @TT "Q"@
Example
R = QQ[x,y];
I = ideal(y^2-x^3);
Q = R/I;
JQ = jets(2,Q);
describe JQ
Caveat
Forming quotients triggers a Groebner basis computation, which may be time consuming.
Node
Key
(jets,ZZ,RingMap)
Headline
the jets of a homomorphism of rings
Usage
jets (n,f)
Inputs
n:ZZ
f:RingMap
Outputs
:RingMap
obtained by applying the @TT "n"@-th jets functor to @TT "f"@
Description
Text
This function is provided by the package
@TO Jets@.
Example
R = QQ[x,y,z]
S = QQ[t]
f = map(S,R,{t,t^2,t^3})
Jf = jets(2,f);
matrix Jf
Text
This function can also be applied when the source and/or the target
of the ring homomorphism are quotients of a polynomial ring
Example
I = ideal(y-x^2,z-x^3)
Q = R/I
g = map(S,Q,{t,t^2,t^3})
isWellDefined g
Jg = jets(2,g);
isWellDefined Jg
Node
Key
(jets,ZZ,Graph)
(jets,ZZ,HyperGraph)
Headline
the jets of a graph
Usage
jets (n,G)
Inputs
n:ZZ
G:Graph
undirected, finite, and simple graph or hypergraph
Outputs
:Graph
the (hyper)graph of @TT "n"@-jets of @TT "G"@
Description
Text
This function is provided by the package
@TO Jets@.
Jets of graphs are defined in § 2 of
@arXiv("2104.08933","F. Galetto, E. Helmick, and M. Walsh,
Jet graphs")@.
The input is of type @TO "EdgeIdeals::Graph"@ as defined by
the @TO EdgeIdeals@ package, which is automatically exported
when loading @TO Jets@.
Example
R = QQ[x,y,z]
G = graph(R,{{x,y},{y,z}})
JG = jets(2,G)
vertexCovers JG
Text
We can also calculate the jets of a @TO "EdgeIdeals::HyperGraph"@.
Example
R = QQ[u,v,w,x,y,z]
H = hyperGraph(R,{{u},{v,w},{x,y,z}})
jets(1,H)
Caveat
Rings of jets are usually constructed as towers of rings with
tiers corresponding to jets of different orders. However, the
tower is flattened out before constructing the edge ideal of
the jets of a (hyper)graph. This is done in order to ensure
compatibility with the @TO "EdgeIdeals::EdgeIdeals"@ package.
Node
Key
(jets,ZZ,AffineVariety)
Headline
the jets of an affine variety
Usage
jets (n,V)
Inputs
n:ZZ
V:AffineVariety
Outputs
:Variety
an @TO AffineVariety@ or a @TO ProjectiveVariety@