Skip to content

Commit 688eb8b

Browse files
committed
Merge branch 'dev'
2 parents e1a6d99 + 7fe750e commit 688eb8b

File tree

1 file changed

+249
-18
lines changed

1 file changed

+249
-18
lines changed

Jets.m2

Lines changed: 249 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--------------------------------------------------------------------------------
2-
-- Copyright 2021-2022 Federico Galetto, Nicholas Iammarino
2+
-- Copyright 2021-2024 Federico Galetto, Nicholas Iammarino
33
--
44
-- This program is free software: you can redistribute it and/or modify it under
55
-- the terms of the GNU General Public License as published by the Free Software
@@ -17,8 +17,8 @@
1717

1818
newPackage(
1919
"Jets",
20-
Version => "1.1",
21-
Date => "June 10, 2022",
20+
Version => "1.2",
21+
Date => "October 15, 2024",
2222
AuxiliaryFiles => true,
2323
Authors => {
2424
{
@@ -32,14 +32,14 @@ newPackage(
3232
}
3333
},
3434
Headline => "compute jets of various algebraic, geometric and combinatorial objects",
35-
PackageImports => {"SimpleDoc","EdgeIdeals"},
35+
PackageImports => {"Varieties"},
3636
PackageExports => {"EdgeIdeals"},
3737
DebuggingMode => false
3838
)
3939

4040

4141

42-
importFrom(MinimalPrimes, {"radical"});
42+
importFrom(MinimalPrimes, {"radical","minimalPrimes"});
4343

4444
export {
4545
"JJ",
@@ -54,7 +54,9 @@ export {
5454
"jetsProjection",
5555
"jetsInfo",
5656
"principalComponent",
57-
"Saturate"
57+
"Saturate",
58+
"liftingFunction",
59+
"liftingMatrix"
5860
}
5961

6062
jetsOptions = {
@@ -339,7 +341,7 @@ jets(ZZ,HyperGraph) := HyperGraph => o -> (n,G) -> (
339341
hyperGraph E
340342
)
341343

342-
jets(ZZ,AffineVariety) := o -> (n,V) -> (
344+
jets(ZZ,AffineVariety) := Variety => o -> (n,V) -> (
343345
if n<0 then error("jets order must be a non-negative integer");
344346
R := ring V;
345347
JR := jets(n,R,Projective=> o.Projective);
@@ -402,30 +404,83 @@ JJ = new ScriptedFunctor from {
402404

403405
--compute an ideal whose vanishing locus is the
404406
--principal component of the jets of an ideal
407+
--changed in v1.2 with a faster algorithm for monomial ideals
408+
--and to fix the behavior for reducible varieties
409+
-- FG's note: I tried an option for bypassing the computation
410+
-- of minimal primes, but for some reason this method appears to
411+
-- work faster if minimal primes are found first
412+
-- (at least for 2x2 minors of a generic 3x3 matrix)
405413
principalComponent = method(Options=>{Saturate=>true},TypicalValue=>Ideal)
406414
principalComponent(ZZ,Ideal) := o -> (n,I) -> (
407415
if n<0 then error("jets order must be a non-negative integer");
416+
-- find minimal primes
417+
mp := minimalPrimes I;
418+
-- for a monomial ideal use shortcut from Galetto-Iammarino-Yu
419+
if isMonomialIdeal(I) then (
420+
return intersect(apply(mp, P -> jets(n,P)));
421+
);
422+
-- compute the singular locus of I by breaking up components
423+
-- and finding singular locus of each
424+
-- (this is necessary as of v1.24.05 because the singularLocus
425+
-- method only works for irreducible ideals)
426+
singComp := apply(mp, P -> ideal singularLocus P);
427+
-- then also intersect components two at a time
428+
pairwiseInt := apply(subsets(mp,2),sum);
429+
-- and finally take the union
430+
sing := intersect(singComp|pairwiseInt);
408431
-- compute jets of I
409432
JI := jets(n,I);
410433
-- get the jets projection
411434
R := ring I;
412435
p := jetsProjection(n,0,R);
413436
-- identify original ambient ring with 0-jets
414437
i := map(source p,R,vars source p);
415-
--compute the singular locus of I
416-
--map it to the zero jets via the map i
438+
--map the singular locus to the zero jets via the map i
417439
--then to the n jets via the map p
418-
sing := p(i(ideal singularLocus I));
440+
sing0 := p i sing;
419441
--default is to saturate JI wrt sing
420442
if o.Saturate then (
421-
saturate(JI,sing)
443+
saturate(JI,sing0)
422444
)
423445
--if JI is radical, colon is enough
424446
else (
425-
JI:sing
447+
JI:sing0
426448
)
427449
)
428450

451+
-- the following methods (liftingFunction, liftingMatrix)
452+
-- follow the definitions in the paper by Galetto-Iammarino-Yu
453+
-- unexported recursive computation of lifting function
454+
lf = (s,j,k) -> (
455+
-- deal with edge cases
456+
if (k<j or k>(s+1)*j) then return 0_ZZ;
457+
if (k==j) then return ((s+1)^j)_ZZ;
458+
if (k==(s+1)*j) then return 1_ZZ;
459+
-- recursive computation
460+
sum(min(k,s+1), i -> binomial(s+1,i+1) * mlf(s,j-1,k-i-1) )
461+
)
462+
463+
-- speeds up computation by storing values
464+
mlf = memoize lf
465+
466+
-- lifting function method for user
467+
liftingFunction = method(TypicalValue => ZZ);
468+
liftingFunction(ZZ,ZZ,ZZ) := ZZ => (s,j,k) -> (
469+
-- check arguments are nonnegative
470+
if (s<0 or j<0 or k<0) then error("arguments should be nonnegative");
471+
mlf(s,j,k)
472+
)
473+
474+
-- enter values of lifting function in a matrix
475+
-- row/column indices start at zero
476+
liftingMatrix = method(TypicalValue => Matrix);
477+
liftingMatrix(ZZ,ZZ,ZZ) := Matrix => (s,r,c) -> (
478+
-- check arguments are nonnegative
479+
if (s<0) then error("first argument should be nonnegative");
480+
if (r<=0 or c<=0) then error("second and third argument should be positive");
481+
matrix table(r,c, (j,k) -> mlf(s,j,k) )
482+
)
483+
429484
beginDocumentation()
430485
----------------------------------------------------------------------
431486
-- TESTS
@@ -532,6 +587,22 @@ TEST ///
532587
p = jetsProjection(3,1,R)
533588
assert(ring p JI === jets(3,R))
534589
///
590+
591+
-- for lifting function
592+
TEST ///
593+
M=matrix{{1,0,0,0,0,0,0,0,0},
594+
{0,2,1,0,0,0,0,0,0},
595+
{0,0,4,4,1,0,0,0,0},
596+
{0,0,0,8,12,6,1,0,0},
597+
{0,0,0,0,16,32,24,8,1}}
598+
assert(liftingMatrix(1,5,9) === M)
599+
N=matrix{{1,0,0,0,0,0,0,0,0,0,0,0,0},
600+
{0,3,3,1,0,0,0,0,0,0,0,0,0},
601+
{0,0,9,18,15,6,1,0,0,0,0,0,0},
602+
{0,0,0,27,81,108,81,36,9,1,0,0,0},
603+
{0,0,0,0,81,324,594,648,459,216,66,12,1}}
604+
assert(liftingMatrix(2,5,13) === N)
605+
///
535606
----------------------------------------------------------------------
536607
-- Documentation
537608
----------------------------------------------------------------------
@@ -556,29 +627,42 @@ Node
556627
the radical of jets of monomial ideals, a function
557628
to construct jets of graphs, a method for principal components of jets,
558629
and an option for jets with "projective" gradings.
630+
631+
@HEADER4 "Version history:"@
632+
633+
@UL {(BOLD "1.1: ", "JSAG version."),
634+
(BOLD "1.2: ", "Improved method for principal components.
635+
Added methods for invariants of principal components
636+
of monomial ideals.")
637+
}@
559638
References
560639
@arXiv("math/0612862","L. Ein and M. Mustaţă,
561640
Jet schemes and singularities.")@
562-
563-
@arXiv("2104.08933","F. Galetto, E. Helmick, and M. Walsh,
564-
Jet graphs.")@
641+
642+
@arXiv("math/0407113","P. Vojta,
643+
Jets via Hasse-Schmidt Derivations.")@
565644

566645
@HREF("https://doi.org/10.1080/00927870500454927",
567646
"R.A. Goward and K.E. Smith,
568647
The jet scheme of a monomial scheme.")@
569-
570-
@arXiv("math/0407113","P. Vojta,
571-
Jets via Hasse-Schmidt Derivations.")@
648+
649+
@arXiv("2104.08933","F. Galetto, E. Helmick, and M. Walsh,
650+
Jet graphs.")@
651+
652+
@arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu,
653+
Jets and principal components of monomial ideals, and very well-covered graphs")@
572654
Subnodes
573655
:Package methods
574656
jets
575657
jetsProjection
576658
jetsRadical
577659
principalComponent
660+
liftingFunction
578661
:Examples from the literature
579662
"Example 1"
580663
"Example 2"
581664
"Example 3"
665+
"Example 4"
582666
:Technical information
583667
"Storing Computations"
584668

@@ -1211,6 +1295,11 @@ Node
12111295
P = primaryDecomposition jets(2,I)
12121296
any(P,c -> c == PC)
12131297
PC == intersect(select(P,c -> degree c == 1))
1298+
Text
1299+
If $I$ is a monomial ideal, this method uses a different characterization
1300+
of the principal component (see Theorem 6.7 in
1301+
@arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu,
1302+
Jets and principal components of monomial ideals, and very well-covered graphs")@).
12141303
Caveat
12151304
This function requires computation of a singular locus,
12161305
a saturation (or quotient), and jets, with each step being
@@ -1248,6 +1337,82 @@ Node
12481337
JJ_2 R
12491338
JJ_2 I
12501339

1340+
Node
1341+
Key
1342+
liftingFunction
1343+
(liftingFunction,ZZ,ZZ,ZZ)
1344+
Headline
1345+
compute values of a lifting function
1346+
Usage
1347+
liftingFunction(s,j,k)
1348+
Inputs
1349+
s:ZZ
1350+
a natural number
1351+
j:ZZ
1352+
a natural number
1353+
k:ZZ
1354+
a natural number
1355+
Outputs
1356+
:ZZ
1357+
the number of cardinality $k$ lifts of a cardinality $j$ set under depolarization
1358+
Description
1359+
Text
1360+
This function was added in version 1.2 of the package @TO Jets@.
1361+
1362+
Given a set $X$ and a natural number $s$, let $\mathcal{J}_s (X)$
1363+
be the set that contains the elements $x_0,\dots,x_s$ for every
1364+
element $x\in X$. The @EM "depolarization"@ map
1365+
$\delta_s \colon \mathcal{J}_s (X)\to X$ is defined by
1366+
$\delta_s (x_i) = x$ for every $x\in X$ and $i\in \{0,\dots,s\}$.
1367+
1368+
The @EM "lifting function"@ $l_s (j,k)$ counts the number
1369+
of subsets $V\subseteq \mathcal{J}_s (X)$ of cardinality $k$
1370+
such that $\delta_s (V) = U$, where $U\subseteq X$ is a fixed
1371+
subset of cardinality $j$. Note that this number does not
1372+
depend on $U$ but only on its cardinality.
1373+
See @arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu,
1374+
Jets and principal components of monomial ideals, and very well-covered graphs")@
1375+
for computing this function.
1376+
Example
1377+
liftingFunction(1,2,3)
1378+
liftingFunction(2,2,3)
1379+
liftingFunction(1,3,2)
1380+
liftingFunction(1,0,0)
1381+
Text
1382+
For uses of the lifting function, see @TO "Example 4"@.
1383+
Subnodes
1384+
liftingMatrix
1385+
1386+
Node
1387+
Key
1388+
liftingMatrix
1389+
(liftingMatrix,ZZ,ZZ,ZZ)
1390+
Headline
1391+
arrange values of lifting function in a matrix
1392+
Usage
1393+
liftingMatrix(s,r,c)
1394+
Inputs
1395+
s:ZZ
1396+
a natural number
1397+
r:ZZ
1398+
a positive integer
1399+
c:ZZ
1400+
a positive integer
1401+
Outputs
1402+
:Matrix
1403+
@TT "r"@ by @TT "c"@, whose entries are the values of the order @TT "s"@ lifting function
1404+
Description
1405+
Text
1406+
This function was added in version 1.2 of the package @TO Jets@.
1407+
1408+
This function collects the values of the @TO "liftingFunction"@
1409+
$l_s (j,k)$ and arranges them in an @TT "r"@ by @TT "c"@ matrix $L_s (j,k)$
1410+
with row index $j\geqslant 0$ and column index $k\geqslant 0$.
1411+
Example
1412+
liftingMatrix(2,3,5)
1413+
Text
1414+
For uses of the lifting matrix, see @TO "Example 4"@.
1415+
12511416
Node
12521417
Key
12531418
"Example 1"
@@ -1417,5 +1582,71 @@ Node
14171582
Example
14181583
apply({P_0,I2}, X -> hilbertSeries(X,Reduce=>true))
14191584
numerator (first oo) == (numerator last oo)^2
1585+
1586+
Node
1587+
Key
1588+
"Example 4"
1589+
Headline
1590+
invariants of principal jets of monomial ideals
1591+
Description
1592+
Text
1593+
This follows Examples 7.5 and 7.7 in
1594+
@arXiv("2407.01836","F. Galetto, N. Iammarino, and T. Yu,
1595+
Jets and principal components of monomial ideals, and very well-covered graphs")@.
1596+
1597+
Consider the following squarefree monomial ideal in a standard graded polynomial ring.
1598+
Example
1599+
R = QQ[v..z]
1600+
I = ideal(v*w*x,x*y,y*z)
1601+
Text
1602+
This is the Stanley-Reisner ideal of a simplicial complex $\Delta$
1603+
whose $f$-vector we compute below.
1604+
Example
1605+
needsPackage "SimplicialComplexes"
1606+
Δ = simplicialComplex I
1607+
f = matrix{fVector(Δ)}
1608+
Text
1609+
Next, we construct the ideal $\mathcal{P}_1 (I)$ of principal 1-jets of $I$
1610+
(see @TO "principalComponent"@ for details).
1611+
This is also the Stanley-Reisner ideal of a simplicial complex
1612+
$\Gamma_1$ and we can compute its $f$-vector.
1613+
Example
1614+
P1 = principalComponent(1,I)
1615+
phi = last flattenRing ring P1;
1616+
Γ1 = simplicialComplex phi P1
1617+
F = matrix{fVector Γ1}
1618+
Text
1619+
The $f$-vector of $\Gamma_1$ can be obtained by multiplying
1620+
the $f$-vector of $\Delta$ with a @TO "liftingMatrix"@ of the
1621+
appropriate size.
1622+
Example
1623+
L = liftingMatrix(1,4,7)
1624+
F == f*L
1625+
Text
1626+
There is a similar relation between the Betti numbers of
1627+
the Stanley-Reisner rings $\Bbbk [\Delta]$
1628+
and $\Bbbk [\Gamma_1]$. First, we compute the Betti
1629+
diagram of $\Bbbk [\Delta]$ and turn it into a matrix by
1630+
sliding the $i$-th row $i$ units to the right.
1631+
Example
1632+
betti res I
1633+
b = mutableMatrix(ZZ,3,5);
1634+
scanPairs(betti res I, (k,v) -> b_(k_2-k_0,k_2) = v);
1635+
b = matrix b
1636+
Text
1637+
Next, we do the same with the Betti diagram of $\Bbbk [\Gamma_1]$.
1638+
Example
1639+
betti res P1
1640+
B = mutableMatrix(ZZ,3,9);
1641+
scanPairs(betti res P1, (k,v) -> B_(k_2-k_0,k_2) = v);
1642+
B = matrix B
1643+
Text
1644+
The matrix containing the Betti numbers of $\Bbbk [\Gamma_1]$
1645+
can be obtained by multiplying the matrix containing the Betti
1646+
numbers of $\Bbbk [\Delta]$ with a @TO "liftingMatrix"@ of the
1647+
appropriate size.
1648+
Example
1649+
L = liftingMatrix(1,5,9)
1650+
B == b*L
14201651
///
14211652
end

0 commit comments

Comments
 (0)