From 1aba602a1112515c75f4168f8b6d8ba9bf165b5d Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 15 Mar 2026 01:02:11 -0700 Subject: [PATCH 01/14] Update "matrix Vector" --- M2/Macaulay2/m2/modules.m2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/M2/Macaulay2/m2/modules.m2 b/M2/Macaulay2/m2/modules.m2 index af281368b41..fd2c9e2f843 100644 --- a/M2/Macaulay2/m2/modules.m2 +++ b/M2/Macaulay2/m2/modules.m2 @@ -97,9 +97,9 @@ leadTerm (ZZ, Vector) := (n,v) -> new class v from leadTerm(n,v#0) degree Vector := v -> ( f := ambient v#0; first degrees source map(target f,,f)) -matrix Vector := opts -> v -> v#0 +matrix Vector := opts -> v -> map(class v,,v#0) vector Vector := identity -new Matrix from Vector := (Matrix,v) -> v#0 +new Matrix from Vector := (Matrix,v) -> map(class v,,v#0) new Vector from Matrix := (M,f) -> ( if not isFreeModule source f or numgens source f =!= 1 then error "expected source to be free with rank 1"; if M =!= target f then error "module must be target of matrix"; @@ -356,7 +356,7 @@ isSubset(Module, Module) := (M, N) -> ( ambient M === ambient N and if not M.?relations and not N.?relations then issub(generators M, generators N) else if M.?relations and N.?relations then ( - isequal(M.relations, N.relations) and issub(generators M, generators N | N.relations)) + isequal(M.relations, N.relations) and issub(generators M, fullgens N)) -- see the code for subquotient: if present, M.relations is nonzero; same for N -- so one of the modules has nonzero relations and the other doesn't else false) From dec888bafe7f1f036045a78ed2d0ada95b8f414d Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Fri, 20 Mar 2026 16:26:57 -0700 Subject: [PATCH 02/14] Update "matrix Vector" --- M2/Macaulay2/m2/modules.m2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/m2/modules.m2 b/M2/Macaulay2/m2/modules.m2 index fd2c9e2f843..b35311f8c47 100644 --- a/M2/Macaulay2/m2/modules.m2 +++ b/M2/Macaulay2/m2/modules.m2 @@ -97,9 +97,10 @@ leadTerm (ZZ, Vector) := (n,v) -> new class v from leadTerm(n,v#0) degree Vector := v -> ( f := ambient v#0; first degrees source map(target f,,f)) + matrix Vector := opts -> v -> map(class v,,v#0) vector Vector := identity -new Matrix from Vector := (Matrix,v) -> map(class v,,v#0) +new Matrix from Vector := (Matrix,v) -> v#0 new Vector from Matrix := (M,f) -> ( if not isFreeModule source f or numgens source f =!= 1 then error "expected source to be free with rank 1"; if M =!= target f then error "module must be target of matrix"; @@ -356,7 +357,7 @@ isSubset(Module, Module) := (M, N) -> ( ambient M === ambient N and if not M.?relations and not N.?relations then issub(generators M, generators N) else if M.?relations and N.?relations then ( - isequal(M.relations, N.relations) and issub(generators M, fullgens N)) + isequal(M.relations, N.relations) and issub(generators M, generators N | N.relations)) -- see the code for subquotient: if present, M.relations is nonzero; same for N -- so one of the modules has nonzero relations and the other doesn't else false) From 9607befcba034cc07863fc9a258c96de837d59bf Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 22 Mar 2026 12:57:39 -0700 Subject: [PATCH 03/14] Updated "matrix Vector" in "stable", while updating several other files as in "development" --- M2/Macaulay2/m2/gb.m2 | 9 ++++++--- M2/Macaulay2/m2/intersect.m2 | 2 +- M2/Macaulay2/m2/matrix.m2 | 19 ++++++------------- M2/Macaulay2/m2/matrix2.m2 | 6 +++--- M2/Macaulay2/m2/modules.m2 | 5 ++--- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/M2/Macaulay2/m2/gb.m2 b/M2/Macaulay2/m2/gb.m2 index e5cb5e49b7b..474a78636fc 100644 --- a/M2/Macaulay2/m2/gb.m2 +++ b/M2/Macaulay2/m2/gb.m2 @@ -301,12 +301,15 @@ degreeToHeft = (R, d) -> ( -- gb ----------------------------------------------------------------------------- +-- TODO: find better name and export this +fullgens = M -> M.cache#"full gens" ??= ( + if M.?relations then generators M | M.relations else generators M) + gb = method(TypicalValue => GroebnerBasis, Options => gbDefaults) gb Ideal := GroebnerBasis => opts -> I -> gb (module I, opts) gb Module := GroebnerBasis => opts -> M -> ( - if M.?relations then ( - M.cache#"full gens" ??= generators M | relations M; - gb(M.cache#"full gens", opts, SyzygyRows => numgens source generators M)) + if M.?relations + then gb(fullgens M, opts, SyzygyRows => numgens source generators M) else gb(generators M, opts)) gb Matrix := GroebnerBasis => opts -> m -> ( checkArgGB m; diff --git a/M2/Macaulay2/m2/intersect.m2 b/M2/Macaulay2/m2/intersect.m2 index 197adf05efc..e4af54ca29d 100644 --- a/M2/Macaulay2/m2/intersect.m2 +++ b/M2/Macaulay2/m2/intersect.m2 @@ -98,7 +98,7 @@ algorithms#(intersect, Module, Module) = new MutableHashTable from { or not same apply(L, N -> N.?relations and (N.relations == M.relations or image N.relations == image M.relations)) then error "intersect: all modules must be submodules of the same module"; -- - relns := directSum apply(L, N -> if N.?relations then generators N | N.relations else generators N); + relns := directSum apply(L, fullgens); g := map(R^(#L), R^1, table(#L, 1, x -> 1)) ** id_(ambient M); h := modulo(g, relns); -- diff --git a/M2/Macaulay2/m2/matrix.m2 b/M2/Macaulay2/m2/matrix.m2 index 1eb4b71a385..fb376824760 100644 --- a/M2/Macaulay2/m2/matrix.m2 +++ b/M2/Macaulay2/m2/matrix.m2 @@ -656,7 +656,7 @@ isSubquotient(Module,Module) := (M,N) -> ( and ambient M === ambient N and - (generators M | relations M) % (generators N | relations N) == 0 + fullgens M % fullgens N == 0 and relations N % relations M == 0 ) @@ -735,11 +735,12 @@ inducesWellDefinedMap(Nothing,Nothing,Matrix) := (M,N,f) -> true ----------------------------------------------------------------------------- -vars Ring := Matrix => R -> ( - g := generators R; - if R.?vars then R.vars else R.vars = - map(R^1,,{g})) +vars Ring := Matrix => R -> R.vars ??= map(module R, , {generators R}) +relations Module := Matrix => M -> ( + if M.?relations then M.relations + else map(ambient M, (ring M)^0, 0)) +-- TODO: why are there two places for generators? generators Module := Matrix => opts -> M -> ( if M.?generators then M.generators else if M.cache.?generators then M.cache.generators @@ -747,14 +748,6 @@ generators Module := Matrix => opts -> M -> ( Module_* := M -> apply(numgens M, i -> M_i) -relations Module := Matrix => M -> ( - if M.?relations then M.relations - else ( - R := ring M; - map(ambient M,R^0,0) - ) - ) - degrees Matrix := f -> {degrees target f, degrees source f} coverMap(Module) := Matrix => (M) -> map(M, cover M, id_(cover M)) diff --git a/M2/Macaulay2/m2/matrix2.m2 b/M2/Macaulay2/m2/matrix2.m2 index 595700ed651..4b8172cef6c 100644 --- a/M2/Macaulay2/m2/matrix2.m2 +++ b/M2/Macaulay2/m2/matrix2.m2 @@ -202,10 +202,10 @@ mingens Module := Matrix => opts -> M -> M.cache.mingens ??= if isFreeModule M t if M.?generators then ( if M.?relations then ( if opts.Strategy === Complement and isHomogeneous M and isAffineRing ring M then ( - c := mingens mingb (M.generators|M.relations); + c := mingens mingb fullgens M; c * complement(M.relations // c)) else ( - tot := mingb(M.generators|M.relations); + tot := mingb fullgens M; rel := mingb(M.relations); mingens mingb (mingens tot % rel))) else mingens mingb M.generators) @@ -243,7 +243,7 @@ trim Module := Module => opts -> M -> M.cache#(symbol trim => opts) ??= if isFre if gns === M.generators and rlns === M.relations then M else subquotient(F, gns, zr rlns)) else if opts.Strategy === Inhomogeneous then ( - tot := mingb(M.generators|M.relations); + tot := mingb fullgens M; rel := mingb(M.relations); if tot === M.generators and rel === M.relations then M diff --git a/M2/Macaulay2/m2/modules.m2 b/M2/Macaulay2/m2/modules.m2 index b35311f8c47..fd2c9e2f843 100644 --- a/M2/Macaulay2/m2/modules.m2 +++ b/M2/Macaulay2/m2/modules.m2 @@ -97,10 +97,9 @@ leadTerm (ZZ, Vector) := (n,v) -> new class v from leadTerm(n,v#0) degree Vector := v -> ( f := ambient v#0; first degrees source map(target f,,f)) - matrix Vector := opts -> v -> map(class v,,v#0) vector Vector := identity -new Matrix from Vector := (Matrix,v) -> v#0 +new Matrix from Vector := (Matrix,v) -> map(class v,,v#0) new Vector from Matrix := (M,f) -> ( if not isFreeModule source f or numgens source f =!= 1 then error "expected source to be free with rank 1"; if M =!= target f then error "module must be target of matrix"; @@ -357,7 +356,7 @@ isSubset(Module, Module) := (M, N) -> ( ambient M === ambient N and if not M.?relations and not N.?relations then issub(generators M, generators N) else if M.?relations and N.?relations then ( - isequal(M.relations, N.relations) and issub(generators M, generators N | N.relations)) + isequal(M.relations, N.relations) and issub(generators M, fullgens N)) -- see the code for subquotient: if present, M.relations is nonzero; same for N -- so one of the modules has nonzero relations and the other doesn't else false) From 3d207d2b9135590025eeb43cd6ac8b293d029783 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 22 Mar 2026 13:23:43 -0700 Subject: [PATCH 04/14] Removed one degree test from MatrixFactorizationsDOC.m2 (the degree of a matrix in Macaulay2 is not very meaningful) --- .../packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 b/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 index 443590c2c1b..74902a8024c 100644 --- a/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 +++ b/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 @@ -4634,7 +4634,7 @@ doc /// degree, the random element is constructed as maps of modules with this degree. Example q = randomFactorizationMap(D, C, Boundary => true, InternalDegree => 2) - assert all({0,1,2}, i -> degree q_i === {2}) + --assert all({0,1,2}, i -> degree q_i === {2}) assert isWellDefined q assert isCommutative q assert isFactorizationMorphism q From 1668d49413f8c724f4cabcd841b02cc96b7ce5b3 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 22 Mar 2026 15:36:46 -0700 Subject: [PATCH 05/14] Dropped one step of a test from MatrixFactorizations (the degree of an inhomogeneous matrix is not very meaningful) --- M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 b/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 index 45be18017ee..8494d0d53a1 100644 --- a/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 +++ b/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 @@ -933,7 +933,7 @@ TEST /// assert not isFactorizationMorphism p assert(degree p === 1) q = randomFactorizationMap(D, C, Boundary => true, InternalDegree => 2) - assert all({0,1,2}, i -> degree q_i === {2}) + --assert all({0,1,2}, i -> degree q_i === {2}) assert isWellDefined q assert isCommutative q assert isFactorizationMorphism q From 147812d861f3eaff1822398225c12a708751021a Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sat, 28 Mar 2026 23:25:24 -0700 Subject: [PATCH 06/14] Added weightedRegularity --- M2/Macaulay2/packages/Complexes.m2 | 2 + .../packages/Complexes/ChainComplex.m2 | 33 ++++++- .../packages/Complexes/ChainComplexDoc.m2 | 99 ++++++++++++++++++- .../Macaulay2Doc/functions/regularity-doc.m2 | 17 +++- 4 files changed, 144 insertions(+), 7 deletions(-) diff --git a/M2/Macaulay2/packages/Complexes.m2 b/M2/Macaulay2/packages/Complexes.m2 index 1854e97fe8a..945c530197b 100644 --- a/M2/Macaulay2/packages/Complexes.m2 +++ b/M2/Macaulay2/packages/Complexes.m2 @@ -60,6 +60,7 @@ export { "resolutionMap", "tensorCommutativity", "torSymmetry", + "weightedRegularity", "yonedaExtension", "yonedaExtension'", "yonedaMap", @@ -80,6 +81,7 @@ export { importFrom_Core { "isPackageLoaded", + "flattenModule", "flattenMorphism", } -- keys into the type `Complex` diff --git a/M2/Macaulay2/packages/Complexes/ChainComplex.m2 b/M2/Macaulay2/packages/Complexes/ChainComplex.m2 index 82a5b4595ef..c97190f5578 100644 --- a/M2/Macaulay2/packages/Complexes/ChainComplex.m2 +++ b/M2/Macaulay2/packages/Complexes/ChainComplex.m2 @@ -603,24 +603,45 @@ betti Complex := opts -> C -> ( ) ) -pdim Module := M -> length freeResolution minimalPresentation M +pdim Module := M -> length freeResolution flattenModule minimalPresentation M regularity Ideal := opts -> I -> ( if I == 0 then -infinity else if I == 1 then 0 - else 1 + regularity betti(freeResolution comodule I, opts)) + else 1 + regularity betti(freeResolution flattenModule comodule I, opts)) +-- cf. https://github.com/Macaulay2/M2/issues/3321 regularity Module := opts -> M -> ( if not isHomogeneous M then error "regularity: expected homogeneous module"; - regularity betti(freeResolution minimalPresentation M, opts)) + regularity betti(freeResolution flattenModule minimalPresentation M, opts)) regularity Complex := opts -> C -> ( if numgens degreesRing ring C =!= 1 then - error "expected the underlying ring to be standard graded"; + error "expected the underlying ring to be singly graded"; if not isFree C then error "expected a complex whose terms are all free"; regularity betti(C,opts) ) +symondsShift = R -> ( + -- For a graded polynomial ring R with positive integer weights a_0,...,a_(n-1), + -- symondsShift(R) means sum_i (a_i-1). + if degreeLength R =!= 1 then error "expected degree length 1"; + degs := flatten degrees R; -- This is a list of the form {a_0,...,a_(n-1)}. + -#degs + fold(plus, degs)) + +weightedRegularity = method(TypicalValue => ZZ, Options => {}) + +-- For a graded polynomial ring R with positive integer weights a_0,...,a_(n-1) and a graded R-module M, +-- weightedRegularity(M) means regularity(M) - sum_i (a_i-1), as suggested by Peter Symonds. +-- (Thus it agrees with the usual regularity when the weights are 1.) The point is +-- that the weighted regularity has a simple relation to local cohomology at the irrelevant ideal m: +-- it is equal to +-- sup_{i>=0} (maximum degree of H^i_m(R, M) + i). +-- For example, if the module M is bounded above, then the weighted regularity of M is equal +-- to the maximum degree of M, and it should be a fast way to compute that. +weightedRegularity Module := weightedRegularity Ideal := weightedRegularity Complex := opts -> M -> ( + -symondsShift ring M + regularity M) + poincare Complex := C -> ( S := degreesRing ring C; (lo,hi) := concentration C; @@ -1341,3 +1362,7 @@ koszulComplex List := Complex => {Concentration => null} >> opts -> L -> ( if #L === 0 then error "expected a non-empty list"; koszulComplex(matrix{L}, opts) ) + +koszul Matrix := Complex => f -> koszulComplex f + +-- TODO: eagonNorthcott diff --git a/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 b/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 index 957b7a63bf5..bc8c9e58487 100644 --- a/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 +++ b/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 @@ -135,6 +135,7 @@ doc /// TO (min, Complex), TO (length, Complex), TO (regularity, Complex), + TO (weightedRegularity, Complex), TO (betti, Complex), TO (poincare, Complex), TO (poincareN, Complex), @@ -4329,7 +4330,7 @@ doc /// :ZZ Description Text - Given a free complex $C$ over a standard graded polynomial ring, + Given a free complex $C$ over a singly graded polynomial ring, the regularity $r$ of $C$ is the smallest integer such that each basis element of $C_i$ has degree at most $i + r$. Example @@ -4356,18 +4357,112 @@ doc /// regularity FJ Text Although Castelnuovo-Mumford regularity is defined - in more general settings (e.g. toric varieties with multi-degrees) + in more general settings (e.g., toric varieties with multi-degrees), this method does not currently handle these extensions. Similarly, Castelnuovo-Mumford regularity can be defined for non-free complexes, but this method doesn't handle that case either. SeeAlso + (weightedRegularity, Complex) "Basic invariants and properties" regularity betti freeResolution /// +doc /// +Node + Key + weightedRegularity + (weightedRegularity, Ideal) + (weightedRegularity, Module) + Headline + compute the weighted Castelnuovo-Mumford regularity + Usage + r = weightedRegularity C + Inputs + C: -- an Ideal, a Module, or a ChainComplex + Outputs + r:ZZ + Description + Text + Let @TT "R"@ be a graded polynomial algebra over a field, with generators $x_0,\ldots,x_{n-1}$ + in positive integer weights $a_0,...,a_{n-1}$, + and let $\mathfrak{m}$ be the maximal ideal $(x_0,\ldots,x_{n-1})$. + For a graded module @TT "R"@-module @TT "M"@, the weighted regularity of @TT "M"@ is defined + in terms of local cohomology, as + $$\sup_{i\geq 0} (i + \text{maximum degree of }H^i_{\mathfrak{m}}(R, M)).$$ + For example, if @TT "M"@ is bounded above, then the weighted regularity of @TT "M"@ + is the maximum degree of @TT "M"@, and this should be a fast way to compute the maximum degree. + Text + If the weights are equal to 1, this is the same as @TO2{(regularity,Module),"regularity(M)"}@. + In general, the weighted regularity is equal to the regularity minus $\sum_i (a_i-1)$. + What we call weighted regularity was proposed by Peter Symonds as the definition of regularity. + Text + In the following example, the module @TT "M"@ is bounded above, with top-degree element $xy$ in degree 12. + Example + R = QQ[x,y,Degrees=>{5,7}]; + M = R^1/(x^2,y^2); + regularity M + weightedRegularity M + SeeAlso + (regularity, Module) + "OldChainComplexes :: resolution" + betti + comodule + "VirtualResolutions :: multigradedRegularity" +/// + +doc /// + Key + (weightedRegularity, Complex) + Headline + compute the weighted Castelnuovo-Mumford regularity + Usage + weightedRegularity C + Inputs + C:Complex + Outputs + :ZZ + Description + Text + Given a complex @TT "C"@ of free modules over a singly graded polynomial ring $R$, + the @TO2 {(regularity,Complex),"regularity"}@ of $C$ is the smallest integer $r$ such that + each basis element of $C_i$ has degree at most $i + r$. Let the generators of $R$ + have weights $a_0,\ldots,a_{n-1}$. Then @TT "weightedRegularity C"@ is defined + as the regularity of @TT "C"@ minus $\sum_i (a_i-1)$. (Thus the two notions + are the same when the weights are equal to 1.) + Text + This is motivated by the case where @TT "C"@ is the minimal free resolution of a graded $R$-module @TT "M"@. + In that case, @TT "weightedRegularity C"@ is equal to the weighted regularity of @TT "M"@, defined + in terms of local cohomology as + $$\sup_{i\geq 0} (i+\text{maximum degree of }H^i_{\m}(R, M)).$$ + For example, if @TT "M"@ is bounded above, then this is the maximum degree of @TT "M"@. + Text + In the following example, the module @TT "M"@ is bounded above, with top-degree element $xy$ in degree 7. + Example + R = ZZ/101[x,y,Degrees=>{2,5}]; + M = R^1/(x^2,y^2); + C = freeResolution M + betti C + regularity C + weightedRegularity C + weightedRegularity M + Text + Although Castelnuovo-Mumford regularity is defined + in more general settings (e.g., toric varieties with multi-degrees), + this method does not currently handle these + extensions. Similarly, Castelnuovo-Mumford + regularity can be defined for non-free complexes, + but this method doesn't handle that case either. + SeeAlso + "Basic invariants and properties" + (regularity, Complex) + regularity + betti + freeResolution +/// + doc /// Key (Ext,Module,Module) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 index 488fe618522..66023e9465a 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 @@ -22,7 +22,8 @@ Node r:ZZ Description Text - For a free chain complex @TT "C"@, the regularity @TT "r"@ is the smallest number so that each + For a free chain complex @TT "C"@ over a graded polynomial ring, + the regularity is the smallest number @TT "r"@ such that each basis element of @TT "C_i"@ has degree at most @TT "i+r"@. For an ideal @TT "I"@, regularity is one plus the regularity of the minimal free resolution of the quotient of the ambient ring by @TT "I"@. For a module @TT "M"@, regularity is the regularity of a minimal free resolution of @TT "M"@. @@ -34,6 +35,19 @@ Node regularity comodule I regularity I regularity module I + Text + A closely related notion is the @TO2 {(weightedRegularity,Module),"weightedRegularity"} of a module. + Let @TT "R"@ be a graded polynomial algebra over a field, with generators $x_0,\ldots,x_{n-1}$ + in positive integer weights $a_0,...,a_{n-1}$, + and let $\mathfrak{m}$ be the maximal ideal $(x_0,\ldots,x_{n-1})$. + Then the weighted regularity of a graded @TT "R"@-module @TT "M"@ is defined + using local cohomology as + $$\sup_{i\geq 0} (i + \text{maximum degree of }H^i_{\mathfrak{m}}(R, M)).$$ + For example, if $M$ is bounded above, then the weighted regularity of @TT "M"@ is the maximum degree of $M$. + Text + If the weights are equal to 1, then weighted regularity is the same as regularity. In general, the weighted + regularity is equal to the regularity minus $\sum_i (a_i-1)$. + What we call weighted regularity was proposed by Peter Symonds as the definition of regularity. Text The regularity is the label of the last row in the @TO2 {betti, "Betti diagram"}@ of a chain complex. However, this depends on the total degree weights in the Betti tally, which are computed based on the @@ -48,6 +62,7 @@ Node betti(C, Weights => {2}) regularity(C, Weights => {2}) SeeAlso + (weightedRegularity, Module) "OldChainComplexes :: resolution" betti comodule From 368c52296e0c088ea02e9a9cacf840154c4143ea Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sat, 28 Mar 2026 23:43:45 -0700 Subject: [PATCH 07/14] Fixed typo in regularity-doc.m2 --- M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 index 66023e9465a..7b27c67fd1a 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 @@ -36,7 +36,7 @@ Node regularity I regularity module I Text - A closely related notion is the @TO2 {(weightedRegularity,Module),"weightedRegularity"} of a module. + A closely related notion is the @TO2 {(weightedRegularity,Module),"weightedRegularity"}@ of a module. Let @TT "R"@ be a graded polynomial algebra over a field, with generators $x_0,\ldots,x_{n-1}$ in positive integer weights $a_0,...,a_{n-1}$, and let $\mathfrak{m}$ be the maximal ideal $(x_0,\ldots,x_{n-1})$. From 64c06480a71c4f1b747bdd7a3c9211677ae4732c Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 29 Mar 2026 00:03:50 -0700 Subject: [PATCH 08/14] Removed a link from regularity-doc.m2 --- .../packages/Macaulay2Doc/functions/regularity-doc.m2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 index 7b27c67fd1a..23fca2f5200 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 @@ -36,11 +36,11 @@ Node regularity I regularity module I Text - A closely related notion is the @TO2 {(weightedRegularity,Module),"weightedRegularity"}@ of a module. + A closely related notion is the @TT "weightedRegularity"@ of a module. Let @TT "R"@ be a graded polynomial algebra over a field, with generators $x_0,\ldots,x_{n-1}$ in positive integer weights $a_0,...,a_{n-1}$, and let $\mathfrak{m}$ be the maximal ideal $(x_0,\ldots,x_{n-1})$. - Then the weighted regularity of a graded @TT "R"@-module @TT "M"@ is defined + For a graded @TT "R"@-module @TT "M"@, @TT "weightedRegularity(M)"@ is defined using local cohomology as $$\sup_{i\geq 0} (i + \text{maximum degree of }H^i_{\mathfrak{m}}(R, M)).$$ For example, if $M$ is bounded above, then the weighted regularity of @TT "M"@ is the maximum degree of $M$. From 76180e299d2307a0131c04b8d9bc8056ff3602d2 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 29 Mar 2026 00:16:57 -0700 Subject: [PATCH 09/14] Removed another link from regularity-doc.m2 --- M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 | 1 - 1 file changed, 1 deletion(-) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 index 23fca2f5200..4b94b3a0466 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 @@ -62,7 +62,6 @@ Node betti(C, Weights => {2}) regularity(C, Weights => {2}) SeeAlso - (weightedRegularity, Module) "OldChainComplexes :: resolution" betti comodule From e1edcccd960d707af3479befbd6ac00342a66576 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sun, 29 Mar 2026 01:01:36 -0700 Subject: [PATCH 10/14] Added flattenModule and flattenMorphism to pushforward.m2 --- M2/Macaulay2/m2/pushforward.m2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/M2/Macaulay2/m2/pushforward.m2 b/M2/Macaulay2/m2/pushforward.m2 index 45894f132e0..c1adb737797 100644 --- a/M2/Macaulay2/m2/pushforward.m2 +++ b/M2/Macaulay2/m2/pushforward.m2 @@ -235,6 +235,27 @@ addHook((kernel, Matrix), Strategy => "PushForward", M := coimage map(target m, f ** source m, raw m); image pushNonLinear(options pushForward, f, M))) +----------------------------------------------------------------------------- + +-- pushforward the module to PP^n via S/I <-- S +-- this is used for instance before computing pdim +-- or regularity of a module over a quotient ring. +-- cf. https://github.com/Macaulay2/M2/issues/3321 +flattenModule = M -> ( + if instance(ring M, PolynomialRing) then M + else cokernel flattenMorphism presentation M) +-- TODO: find a name that can't be confused with flatness. +-- Currently this is simply named after flattenRing. +flattenMorphism = f -> f.cache#"flattenMorphism" ??= ( + if instance(ring f, PolynomialRing) then return f; + g := presentation ring f; + -- FIXME: if ring f is a quotient of another quotient ring Q, + -- "ambient ring f" would give Q, not a polynomial ring as we want. + S := ring g; + -- TODO: sometimes lifting to ring g is enough, how can we detect this? + -- TODO: why doesn't lift(f, ring g) do this automatically? + map(target f ** S, source f ** S, lift(cover f, S)) ** cokernel g) + -- Local Variables: -- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " -- End: From cde7ec6bf75c1aff560a69edbe1f0474e3453d85 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Wed, 8 Apr 2026 22:44:54 -0700 Subject: [PATCH 11/14] Revert all commits from 147812d861f3eaff1822398225c12a708751021a to HEAD --- M2/Macaulay2/m2/pushforward.m2 | 21 ---- M2/Macaulay2/packages/Complexes.m2 | 2 - .../packages/Complexes/ChainComplex.m2 | 33 +------ .../packages/Complexes/ChainComplexDoc.m2 | 99 +------------------ .../Macaulay2Doc/functions/regularity-doc.m2 | 16 +-- 5 files changed, 7 insertions(+), 164 deletions(-) diff --git a/M2/Macaulay2/m2/pushforward.m2 b/M2/Macaulay2/m2/pushforward.m2 index c1adb737797..45894f132e0 100644 --- a/M2/Macaulay2/m2/pushforward.m2 +++ b/M2/Macaulay2/m2/pushforward.m2 @@ -235,27 +235,6 @@ addHook((kernel, Matrix), Strategy => "PushForward", M := coimage map(target m, f ** source m, raw m); image pushNonLinear(options pushForward, f, M))) ------------------------------------------------------------------------------ - --- pushforward the module to PP^n via S/I <-- S --- this is used for instance before computing pdim --- or regularity of a module over a quotient ring. --- cf. https://github.com/Macaulay2/M2/issues/3321 -flattenModule = M -> ( - if instance(ring M, PolynomialRing) then M - else cokernel flattenMorphism presentation M) --- TODO: find a name that can't be confused with flatness. --- Currently this is simply named after flattenRing. -flattenMorphism = f -> f.cache#"flattenMorphism" ??= ( - if instance(ring f, PolynomialRing) then return f; - g := presentation ring f; - -- FIXME: if ring f is a quotient of another quotient ring Q, - -- "ambient ring f" would give Q, not a polynomial ring as we want. - S := ring g; - -- TODO: sometimes lifting to ring g is enough, how can we detect this? - -- TODO: why doesn't lift(f, ring g) do this automatically? - map(target f ** S, source f ** S, lift(cover f, S)) ** cokernel g) - -- Local Variables: -- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 " -- End: diff --git a/M2/Macaulay2/packages/Complexes.m2 b/M2/Macaulay2/packages/Complexes.m2 index 945c530197b..1854e97fe8a 100644 --- a/M2/Macaulay2/packages/Complexes.m2 +++ b/M2/Macaulay2/packages/Complexes.m2 @@ -60,7 +60,6 @@ export { "resolutionMap", "tensorCommutativity", "torSymmetry", - "weightedRegularity", "yonedaExtension", "yonedaExtension'", "yonedaMap", @@ -81,7 +80,6 @@ export { importFrom_Core { "isPackageLoaded", - "flattenModule", "flattenMorphism", } -- keys into the type `Complex` diff --git a/M2/Macaulay2/packages/Complexes/ChainComplex.m2 b/M2/Macaulay2/packages/Complexes/ChainComplex.m2 index c97190f5578..82a5b4595ef 100644 --- a/M2/Macaulay2/packages/Complexes/ChainComplex.m2 +++ b/M2/Macaulay2/packages/Complexes/ChainComplex.m2 @@ -603,45 +603,24 @@ betti Complex := opts -> C -> ( ) ) -pdim Module := M -> length freeResolution flattenModule minimalPresentation M +pdim Module := M -> length freeResolution minimalPresentation M regularity Ideal := opts -> I -> ( if I == 0 then -infinity else if I == 1 then 0 - else 1 + regularity betti(freeResolution flattenModule comodule I, opts)) + else 1 + regularity betti(freeResolution comodule I, opts)) --- cf. https://github.com/Macaulay2/M2/issues/3321 regularity Module := opts -> M -> ( if not isHomogeneous M then error "regularity: expected homogeneous module"; - regularity betti(freeResolution flattenModule minimalPresentation M, opts)) + regularity betti(freeResolution minimalPresentation M, opts)) regularity Complex := opts -> C -> ( if numgens degreesRing ring C =!= 1 then - error "expected the underlying ring to be singly graded"; + error "expected the underlying ring to be standard graded"; if not isFree C then error "expected a complex whose terms are all free"; regularity betti(C,opts) ) -symondsShift = R -> ( - -- For a graded polynomial ring R with positive integer weights a_0,...,a_(n-1), - -- symondsShift(R) means sum_i (a_i-1). - if degreeLength R =!= 1 then error "expected degree length 1"; - degs := flatten degrees R; -- This is a list of the form {a_0,...,a_(n-1)}. - -#degs + fold(plus, degs)) - -weightedRegularity = method(TypicalValue => ZZ, Options => {}) - --- For a graded polynomial ring R with positive integer weights a_0,...,a_(n-1) and a graded R-module M, --- weightedRegularity(M) means regularity(M) - sum_i (a_i-1), as suggested by Peter Symonds. --- (Thus it agrees with the usual regularity when the weights are 1.) The point is --- that the weighted regularity has a simple relation to local cohomology at the irrelevant ideal m: --- it is equal to --- sup_{i>=0} (maximum degree of H^i_m(R, M) + i). --- For example, if the module M is bounded above, then the weighted regularity of M is equal --- to the maximum degree of M, and it should be a fast way to compute that. -weightedRegularity Module := weightedRegularity Ideal := weightedRegularity Complex := opts -> M -> ( - -symondsShift ring M + regularity M) - poincare Complex := C -> ( S := degreesRing ring C; (lo,hi) := concentration C; @@ -1362,7 +1341,3 @@ koszulComplex List := Complex => {Concentration => null} >> opts -> L -> ( if #L === 0 then error "expected a non-empty list"; koszulComplex(matrix{L}, opts) ) - -koszul Matrix := Complex => f -> koszulComplex f - --- TODO: eagonNorthcott diff --git a/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 b/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 index bc8c9e58487..957b7a63bf5 100644 --- a/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 +++ b/M2/Macaulay2/packages/Complexes/ChainComplexDoc.m2 @@ -135,7 +135,6 @@ doc /// TO (min, Complex), TO (length, Complex), TO (regularity, Complex), - TO (weightedRegularity, Complex), TO (betti, Complex), TO (poincare, Complex), TO (poincareN, Complex), @@ -4330,7 +4329,7 @@ doc /// :ZZ Description Text - Given a free complex $C$ over a singly graded polynomial ring, + Given a free complex $C$ over a standard graded polynomial ring, the regularity $r$ of $C$ is the smallest integer such that each basis element of $C_i$ has degree at most $i + r$. Example @@ -4357,112 +4356,18 @@ doc /// regularity FJ Text Although Castelnuovo-Mumford regularity is defined - in more general settings (e.g., toric varieties with multi-degrees), + in more general settings (e.g. toric varieties with multi-degrees) this method does not currently handle these extensions. Similarly, Castelnuovo-Mumford regularity can be defined for non-free complexes, but this method doesn't handle that case either. SeeAlso - (weightedRegularity, Complex) "Basic invariants and properties" regularity betti freeResolution /// -doc /// -Node - Key - weightedRegularity - (weightedRegularity, Ideal) - (weightedRegularity, Module) - Headline - compute the weighted Castelnuovo-Mumford regularity - Usage - r = weightedRegularity C - Inputs - C: -- an Ideal, a Module, or a ChainComplex - Outputs - r:ZZ - Description - Text - Let @TT "R"@ be a graded polynomial algebra over a field, with generators $x_0,\ldots,x_{n-1}$ - in positive integer weights $a_0,...,a_{n-1}$, - and let $\mathfrak{m}$ be the maximal ideal $(x_0,\ldots,x_{n-1})$. - For a graded module @TT "R"@-module @TT "M"@, the weighted regularity of @TT "M"@ is defined - in terms of local cohomology, as - $$\sup_{i\geq 0} (i + \text{maximum degree of }H^i_{\mathfrak{m}}(R, M)).$$ - For example, if @TT "M"@ is bounded above, then the weighted regularity of @TT "M"@ - is the maximum degree of @TT "M"@, and this should be a fast way to compute the maximum degree. - Text - If the weights are equal to 1, this is the same as @TO2{(regularity,Module),"regularity(M)"}@. - In general, the weighted regularity is equal to the regularity minus $\sum_i (a_i-1)$. - What we call weighted regularity was proposed by Peter Symonds as the definition of regularity. - Text - In the following example, the module @TT "M"@ is bounded above, with top-degree element $xy$ in degree 12. - Example - R = QQ[x,y,Degrees=>{5,7}]; - M = R^1/(x^2,y^2); - regularity M - weightedRegularity M - SeeAlso - (regularity, Module) - "OldChainComplexes :: resolution" - betti - comodule - "VirtualResolutions :: multigradedRegularity" -/// - -doc /// - Key - (weightedRegularity, Complex) - Headline - compute the weighted Castelnuovo-Mumford regularity - Usage - weightedRegularity C - Inputs - C:Complex - Outputs - :ZZ - Description - Text - Given a complex @TT "C"@ of free modules over a singly graded polynomial ring $R$, - the @TO2 {(regularity,Complex),"regularity"}@ of $C$ is the smallest integer $r$ such that - each basis element of $C_i$ has degree at most $i + r$. Let the generators of $R$ - have weights $a_0,\ldots,a_{n-1}$. Then @TT "weightedRegularity C"@ is defined - as the regularity of @TT "C"@ minus $\sum_i (a_i-1)$. (Thus the two notions - are the same when the weights are equal to 1.) - Text - This is motivated by the case where @TT "C"@ is the minimal free resolution of a graded $R$-module @TT "M"@. - In that case, @TT "weightedRegularity C"@ is equal to the weighted regularity of @TT "M"@, defined - in terms of local cohomology as - $$\sup_{i\geq 0} (i+\text{maximum degree of }H^i_{\m}(R, M)).$$ - For example, if @TT "M"@ is bounded above, then this is the maximum degree of @TT "M"@. - Text - In the following example, the module @TT "M"@ is bounded above, with top-degree element $xy$ in degree 7. - Example - R = ZZ/101[x,y,Degrees=>{2,5}]; - M = R^1/(x^2,y^2); - C = freeResolution M - betti C - regularity C - weightedRegularity C - weightedRegularity M - Text - Although Castelnuovo-Mumford regularity is defined - in more general settings (e.g., toric varieties with multi-degrees), - this method does not currently handle these - extensions. Similarly, Castelnuovo-Mumford - regularity can be defined for non-free complexes, - but this method doesn't handle that case either. - SeeAlso - "Basic invariants and properties" - (regularity, Complex) - regularity - betti - freeResolution -/// - doc /// Key (Ext,Module,Module) diff --git a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 index 4b94b3a0466..488fe618522 100644 --- a/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 +++ b/M2/Macaulay2/packages/Macaulay2Doc/functions/regularity-doc.m2 @@ -22,8 +22,7 @@ Node r:ZZ Description Text - For a free chain complex @TT "C"@ over a graded polynomial ring, - the regularity is the smallest number @TT "r"@ such that each + For a free chain complex @TT "C"@, the regularity @TT "r"@ is the smallest number so that each basis element of @TT "C_i"@ has degree at most @TT "i+r"@. For an ideal @TT "I"@, regularity is one plus the regularity of the minimal free resolution of the quotient of the ambient ring by @TT "I"@. For a module @TT "M"@, regularity is the regularity of a minimal free resolution of @TT "M"@. @@ -35,19 +34,6 @@ Node regularity comodule I regularity I regularity module I - Text - A closely related notion is the @TT "weightedRegularity"@ of a module. - Let @TT "R"@ be a graded polynomial algebra over a field, with generators $x_0,\ldots,x_{n-1}$ - in positive integer weights $a_0,...,a_{n-1}$, - and let $\mathfrak{m}$ be the maximal ideal $(x_0,\ldots,x_{n-1})$. - For a graded @TT "R"@-module @TT "M"@, @TT "weightedRegularity(M)"@ is defined - using local cohomology as - $$\sup_{i\geq 0} (i + \text{maximum degree of }H^i_{\mathfrak{m}}(R, M)).$$ - For example, if $M$ is bounded above, then the weighted regularity of @TT "M"@ is the maximum degree of $M$. - Text - If the weights are equal to 1, then weighted regularity is the same as regularity. In general, the weighted - regularity is equal to the regularity minus $\sum_i (a_i-1)$. - What we call weighted regularity was proposed by Peter Symonds as the definition of regularity. Text The regularity is the label of the last row in the @TO2 {betti, "Betti diagram"}@ of a chain complex. However, this depends on the total degree weights in the Betti tally, which are computed based on the From 6458b652a565c124c01673349ae59ae8d4146fa5 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Fri, 19 Jun 2026 22:58:43 -0700 Subject: [PATCH 12/14] Revision of Schubert2 (skewDegeneracyLocus, weightedProjectiveSpace, etc.) --- M2/Macaulay2/packages/Schubert2.m2 | 295 +++++++++++++- M2/Macaulay2/packages/Schubert2/demo3.m2 | 40 ++ M2/Macaulay2/packages/Schubert2/doc.m2 | 466 ++++++++++++++++++++++- 3 files changed, 778 insertions(+), 23 deletions(-) diff --git a/M2/Macaulay2/packages/Schubert2.m2 b/M2/Macaulay2/packages/Schubert2.m2 index d9a4590051c..c3881c5c373 100644 --- a/M2/Macaulay2/packages/Schubert2.m2 +++ b/M2/Macaulay2/packages/Schubert2.m2 @@ -2,14 +2,16 @@ newPackage( "Schubert2", AuxiliaryFiles => true, - Version => "0.7", - Date => "April 24, 2013", + Version => "0.8", + Date => "May 28, 2026", Authors => { - {Name => "Daniel R. Grayson", Email => "dan@math.uiuc.edu", HomePage => "http://www.math.uiuc.edu/~dan/"}, - {Name => "Michael E. Stillman", Email => "mike@math.cornell.edu", HomePage => "http://www.math.cornell.edu/People/Faculty/stillman.html"}, - {Name => "Stein A. Strømme", Email => "stromme@math.uib.no", HomePage => "http://stromme.uib.no/home/" }, - {Name => "David Eisenbud", Email => "de@msri.org", HomePage => "http://www.msri.org/~de/"}, - {Name => "Charley Crissman", Email => "charleyc@math.berkeley.edu", HomePage => "http://math.berkeley.edu/~charleyc/"} + {Name => "Daniel R. Grayson", Email => "danielrichardgrayson@gmail.com", HomePage => "https://www.graysonfamily.org/dan/"}, + {Name => "Michael E. Stillman", Email => "mes15@cornell.edu", HomePage => "https://pi.math.cornell.edu/~mike/"}, + {Name => "Stein A. Strømme" }, + {Name => "David Eisenbud", Email => "de@msri.org", HomePage => "https://eisenbud.github.io/"}, + {Name => "Charley Crissman", Email => "charley.crissman@bellevuecollege.edu" }, + {Name => "Burt Totaro", Email => "totaro@math.ucla.edu", HomePage => "https://www.math.ucla.edu/~totaro/"}, + {Name => "Jiahe Wang", Email => "jiahewang@math.ucla.edu", HomePage => "https://sites.google.com/view/jiahewang/home"}, }, HomePage => "https://macaulay2.com/", Headline => "characteristic classes for varieties without equations", @@ -35,7 +37,10 @@ export { "AbstractSheaf", "abstractSheaf", "AbstractVariety", "abstractVariety", "tautologicalLineBundle", "bundles", "schubertRing", "DefaultPushForward", "DefaultPullBack", "DefaultIntegral", "abstractVarietyMap", "extensionAlgebra", "inclusion", "SubTangent", "SuperTangent", - "SubDimension", "SuperDimension", "NormalClass", "Codimension"} + "SubDimension", "SuperDimension", "NormalClass", "Codimension", + "symmetricDegeneracyLocus", "symmetricDegeneracyLocus2", "skewDegeneracyLocus", "skewDegeneracyLocus2", + "symmetricKernelBundle", "skewKernelBundle", "weightedProjectiveBundle", "weightedProjectiveSpace", + } -- not exported, for now: "logg", "expp", "reciprocal", "ToddClass" protect ChernCharacter @@ -1842,6 +1847,280 @@ degeneracyLocus(ZZ,AbstractSheaf,AbstractSheaf) := (k,B,A) -> ( S := first G.Bundles; sectionZeroLocus Hom(S,(G/X)^* B)) + + +------------------------------------------------------------ +-- Symmetric degeneracy locus as an abstract variety. +-- This yields an abstract variety S that is a resolution of singularities of the locus S_0 +-- where a general symmetric map E -> E^* tensor L has rank at most k, +-- following Fulton's Intersection Theory, Example 14.4.11. +-- Here E is a vector bundle and L is a line bundle. +-- (It is assumed that there are enough such maps that S_0 has the expected dimension.) +-- If the map E -> E^* tensor L never has rank less than k, then S is isomorphic +-- to the actual degeneracy locus S_0. +------------------------------------------------------------ + +symmetricDegeneracyLocus = method(TypicalValue => AbstractVariety) + +symmetricDegeneracyLocus(ZZ,AbstractSheaf) := (k, E) -> ( + X := variety E; + symmetricDegeneracyLocus(k, E, OO_X) + ) + +symmetricDegeneracyLocus(ZZ,AbstractSheaf,AbstractSheaf) := (k, E, L) -> ( + X := variety E; + if X =!= variety L then error "expected bundles on the same variety"; + if rank L != 1 then error "the second sheaf should be a line bundle"; + e := rank E; + G := flagBundle({e-k,k}, E); + S := G.Bundles#0; + Q := G.Bundles#1; + p := G/X; + sectionZeroLocus( + ((dual(Q) ** dual(S)) ** (p^*L)) ++ (symmetricPower(2,dual(S)) ** (p^*L)) + ) + ) + +------------------------------------------------------------ +-- This yields an abstract variety S that is a resolution of singularities of the locus S_0 +-- where a general skew-symmetric map E -> E^* tensor L has rank at most k, +-- following Fulton's Intersection Theory, Example 14.4.11. +-- Here E is a vector bundle, L is a line bundle, and k is even. +-- (It is assumed that there are enough such maps that S_0 has the expected dimension.) +-- If the map E -> E^* tensor L never has rank less than k, then S is isomorphic +-- to the actual degeneracy locus S_0. +------------------------------------------------------------ + +skewDegeneracyLocus = method(TypicalValue => AbstractVariety) + +skewDegeneracyLocus(ZZ,AbstractSheaf) := (k, E) -> ( + X := variety E; + skewDegeneracyLocus(k, E, OO_X) + ) + +skewDegeneracyLocus(ZZ,AbstractSheaf,AbstractSheaf) := (k, E, L) -> ( + X := variety E; + if X =!= variety L then error "expected bundles on the same variety"; + if rank L != 1 then error "the second sheaf should be a line bundle"; + e := rank E; + if not even k then error "the rank bound should be even"; + G := flagBundle({e-k,k}, E); + S := G.Bundles#0; + Q := G.Bundles#1; + p := G/X; + sectionZeroLocus( + ((dual(Q) ** dual(S)) ** (p^*L)) ++ (exteriorPower(2,dual(S)) ** (p^*L)) + ) + ) +------------------------------------------------------------ +-- Helper: Schur class s_lambda(F). +-- +-- This is the Schur polynomial in the Chern classes of F: +-- +-- s_lambda(F) = det(c_{lambda_i + j - i}(F)). +-- +-- It is different from ch(schur(lambda,F)). +------------------------------------------------------------ + +schurClass = (lambda,F) -> ( + X := variety F; + A := intersectionRing X; + l := #lambda; + + c := i -> ( + if i == 0 then 1_A + else if i < 0 then 0_A + else chern(i,F) + ); + + det matrix apply(l, i -> apply(l, j -> c(lambda#i + j - i))) + ) + +------------------------------------------------------------ +-- Symmetric degeneracy class on the original base. +-- This is the Harris--Tu closed formula, Theorems 1 and 10. +-- Convention: a general symmetric map E -> E^* tensor L. +------------------------------------------------------------ + +symmetricDegeneracyLocus2 = method(TypicalValue => RingElement) + +symmetricDegeneracyLocus2(ZZ,AbstractSheaf) := (k,E) -> ( + X := variety E; + symmetricDegeneracyLocus2(k,E,OO_X) + ) + +symmetricDegeneracyLocus2(ZZ,AbstractSheaf,AbstractSheaf) := (k,E,L) -> ( + X := variety E; + if X =!= variety L then error "expected bundles on the same variety"; + if rank L != 1 then error "the second sheaf should be a line bundle"; + n := rank E; + if k < 0 or k > n then error "the rank bound should be between 0 and the rank of the first bundle"; + + d := n-k; + codim := d*(d+1)//2; + + F := dual(E) ** (L ^** (1/2)); + + if d == 0 then 1_(intersectionRing X) + else part(codim, (2^d) * schurClass(reverse toList(1..d), F)) + ) + +------------------------------------------------------------ +-- Skew-symmetric degeneracy class on the original base. +-- This is the Harris--Tu closed formula, Theorems 8 and 10. +-- Convention: a general skew-symmetric map E -> E^* tensor L. +------------------------------------------------------------ + +skewDegeneracyLocus2 = method(TypicalValue => RingElement) + +skewDegeneracyLocus2(ZZ,AbstractSheaf) := (k,E) -> ( + X := variety E; + skewDegeneracyLocus2(k,E,OO_X) + ) + +skewDegeneracyLocus2(ZZ,AbstractSheaf,AbstractSheaf) := (k,E,L) -> ( + X := variety E; + if X =!= variety L then error "expected bundles on the same variety"; + if rank L != 1 then error "the second sheaf should be a line bundle"; + n := rank E; + if k < 0 or k > n then error "the rank bound should be between 0 and the rank of the first bundle"; + if not even k then error "the rank bound should be even"; + + d := n-k; + codim := d*(d-1)//2; + + F := dual(E) ** (L ^** (1/2)); + + if d <= 1 then 1_(intersectionRing X) + else part(codim, schurClass(reverse toList(1..d-1), F)) + ) + +------------------------------------------------------------ +--kernel bundle for a symmetric map +------------------------------------------------------------ +symmetricKernelBundle = method(TypicalValue => AbstractSheaf) + +symmetricKernelBundle(ZZ,AbstractSheaf) := (k,E) -> ( + X := variety E; + symmetricKernelBundle(k,E,OO_X) + ) + +symmetricKernelBundle(ZZ,AbstractSheaf,AbstractSheaf) := (k,E,L) -> ( + X := variety E; + Z := symmetricDegeneracyLocus(k,E,L); + G := target Z.StructureMap; + S := first G.Bundles; + K := (Z/G)^* S; + Z.StructureMap = Z/X; + K + ) + +------------------------------------------------------------ +--kernel bundle for a skew-symmetric map +------------------------------------------------------------ + +skewKernelBundle = method(TypicalValue => AbstractSheaf) + +skewKernelBundle(ZZ,AbstractSheaf) := (k,E) -> ( + X := variety E; + skewKernelBundle(k,E,OO_X) + ) + +skewKernelBundle(ZZ,AbstractSheaf,AbstractSheaf) := (k,E,L) -> ( + X := variety E; + Z := skewDegeneracyLocus(k,E,L); + G := target Z.StructureMap; + S := first G.Bundles; + K := (Z/G)^* S; + Z.StructureMap = Z/X; + K + ) + +------------------------------------------------------------ +--trivial weighted projective bundle over X +------------------------------------------------------------ +weightedProjectiveBundle = method( + Options => {VariableName => "h"}, + TypicalValue => AbstractVariety + ) + +weightedProjectiveBundle(List,AbstractVariety) := opts -> (weights,X) -> ( + if #weights == 0 then error "expected a nonempty list of weights"; + if not all(weights, a -> instance(a,ZZ) and a > 0) + then error "expected positive integer weights"; + + n := #weights - 1; + prodW := product weights; + + Hsym := if instance(opts.VariableName,String) + then getSymbol opts.VariableName + else opts.VariableName; + + S := intersectionRing X; + + -- A^*(X)[h]/(h^(n+1)). + U := S(monoid [{Hsym}, + Degrees => {1}, + Join => false, + DegreeRank => 1]); + + H := U_0; + A := U / ideal(H^(n+1)); + h := A_0; + + WP := abstractVariety(dim X + n,A); + + WP.Base = X; + WP.Weights = weights; + + -- Pullback from the base. + pullback := method(); + pullback S := r -> promote(r,A); + pullback ZZ := a -> promote(a,A); + pullback QQ := a -> promote(a,A); + + -- Pushforward: pi_*(alpha H^n) = alpha/(a_0...a_n). + pushforward := method(); + pushforward A := f -> promote(coefficient(h^n,f),S) / prodW; + pushforward ZZ := a -> pushforward promote(a,A); + pushforward QQ := a -> pushforward promote(a,A); + + Trel := sum(weights, a -> OO_WP(a*h)) - OO_WP; + + p := abstractVarietyMap(X,WP,pullback,pushforward, + TangentBundle => Trel); + + WP.StructureMap = p; + + -- Integration on WP is integration after pushing forward to X. + integral A := f -> integral (p_* f); + + WP.TautologicalLineBundle = + abstractSheaf(WP, Rank => 1, ChernClass => 1_A + h); + + if X.?TangentBundle + then WP.TangentBundle = Trel + p^*(tangentBundle X) + else WP.TangentBundle = Trel; + + use WP; + WP + ) + +weightedProjectiveBundle List := opts -> weights -> ( + weightedProjectiveBundle(weights,point,VariableName => opts.VariableName) + ) + +weightedProjectiveSpace = method( + Options => {VariableName => "h"}, + TypicalValue => AbstractVariety + ) + +weightedProjectiveSpace List := opts -> weights -> ( + weightedProjectiveBundle(weights,point,VariableName => opts.VariableName) + ) + + + kernelBundle = method(TypicalValue => AbstractVariety) kernelBundle(ZZ,AbstractSheaf,AbstractSheaf) := (k,B,A) -> ( X := variety A; diff --git a/M2/Macaulay2/packages/Schubert2/demo3.m2 b/M2/Macaulay2/packages/Schubert2/demo3.m2 index 385624601f4..7be9a618bf6 100644 --- a/M2/Macaulay2/packages/Schubert2/demo3.m2 +++ b/M2/Macaulay2/packages/Schubert2/demo3.m2 @@ -17,3 +17,43 @@ assert( b == t ) d = flatten for i from 0 to 4 list for j from 0 to i list F_{i,j} assert( d == t ) +clearAll + +W = abstractProjectiveSpace 7; +h = chern_1(OO_W(1)); +assert(integral(h^7) == 1) +E = 4*OO_W ++ OO_W(-1); +L = OO_W(1); +classY = skewDegeneracyLocus2(2,E,L); +assert(integral(h^4*classY) == 13) +Y = skewDegeneracyLocus(2,E,L); +assert(chi(tangentBundle Y) == -80) + +clearAll + +W = weightedProjectiveSpace {1,1,1,1,1,1,2,2} +h = chern_1(OO_W(1)); +assert(integral(h^7) == 1/4) +E = 3*OO_W ++ 2*OO_W(-1); +L = OO_W(1); +classY = skewDegeneracyLocus2(2,E,L); +assert(integral(h^4*classY) == 7) +Y = skewDegeneracyLocus(2,E,L); +assert(chi(tangentBundle Y) == -94) +-- Y is a smooth 4-fold that avoids the points of W with nontrivial stabilizer group, +-- and so "chi" gives meaningful answers on Y. + +clearAll + +W = abstractProjectiveSpace 9; +h = chern_1(OO_W(1)); +E = 5*OO_W; +L = OO_W(1); +classY = symmetricDegeneracyLocus2(2,E,L); +assert(integral(h^3*classY) == 35) +Y = symmetricDegeneracyLocus(2,E,L); +assert(chern_1(tangentBundle Y) == 0) +-- That is, Y is a Calabi-Yau 3-fold of degree 35 in P^9. + +clearAll + diff --git a/M2/Macaulay2/packages/Schubert2/doc.m2 b/M2/Macaulay2/packages/Schubert2/doc.m2 index b015588e809..b37df1f94c5 100644 --- a/M2/Macaulay2/packages/Schubert2/doc.m2 +++ b/M2/Macaulay2/packages/Schubert2/doc.m2 @@ -10,14 +10,16 @@ Node variety"}@ is not given by equations. Instead, one gives its graded intersection ring of algebraic cycle classes modulo numerical equivalence (tensored with the rational numbers or perhaps with some algebra over the rational numbers), its dimension, a method for counting the number of points in a cycle class - of dimension zero (integration), and the Chern class of its tangent bundle (if + of dimension zero (integration), and the Chern character of its tangent bundle (if known). The intersection ring is represented as a {\em Macaulay2} @ TO2{Ring,"ring"} @, and its elements are {\em - Macaulay2} @ TO2{RingElement,"ring elements"} @. + Macaulay2} @ TO2{RingElement,"ring elements"} @. (More precisely, the intersection ring used by Schubert2 may be + only the subalgebra of the Chow ring tensored with the rationals generated by some explicit classes.) An @TO2{AbstractSheaf,"abstract sheaf"}@ on an abstract variety is represented by an object of class - @ TO AbstractSheaf @ that contains the total Chern character of the sheaf. It should be thought of as an element of + @ TO AbstractSheaf @ that contains the total Chern character of the sheaf in the intersection ring. + It should be thought of as an element of the Grothendieck ring of the variety tensored with the rational numbers, which, by the - Grothendieck-Riemann-Roch theorem, is isomorphic to the intersection ring; the isomorphism is provided + Grothendieck-Riemann-Roch theorem, is isomorphic to the Chow ring tensored with the rationals; the isomorphism is provided by the Chern character. An @TO2{AbstractVarietyMap,"abstract variety map"}@ is a map between abstract varieties: the information encoded @@ -28,14 +30,18 @@ Node unknown integers in formulas, along with variables of positive degree that can be used as Chern classes of generic abstract sheaves. - This package is inspired by @ HREF{"http://stromme.uib.no/home/schubert/", "schubert"} @, which was written by - @ HREF{"http://www.math.uiuc.edu/~katz/", "Sheldon Katz"} @ and @ HREF{"http://stromme.uib.no/", "Stein A. Strømme"} @. + This package is inspired by @ HREF{"https://jmokland.github.io/schubert/", "schubert"} @, which was written by + @ HREF{"https://katzs.web.illinois.edu/", "Sheldon Katz"} @ + and @ HREF{"https://mathshistory.st-andrews.ac.uk/Biographies/Stromme/", "Stein A. Strømme"} @. The theory behind the computations of intersection rings of flag bundles has been made rigorous in the paper {\em Computations in intersection rings of flag bundles} by Grayson, Seceleanu, and Stillman: see @ HREF {"http://arxiv.org/abs/1205.4190","arXiv:1205.4190"} @. The paper also treats the case of isotropic flag bundles, with the corresponding algorithms appearing here for the first time. + In 2026, functions for weighted projective spaces and symmetric and skew-symmetric degeneracy loci + were added. + Subnodes "Lines on hypersurfaces" "Conics on a quintic threefold" @@ -75,7 +81,6 @@ Node LI {"make an easy way to specify maps from a variety to a flag bundle, by specifying where all (but one) of the tautological subquotients go"}, LI {"make it possible to call the toric package"}, - LI {"add the blow up of a subvariety with known normal bundle and known restriction function"}, LI {"add a function that goes from the Hilbert series of a sheaf on projective space to the Chern class"}, LI {"add knowledge of the intersection ring of an abelian variety, in particular of the Jacobian of a curve"}, LI {"add knowledge of the tautological ring (as far as it's known!) of M_(g,n)"}, @@ -394,7 +399,7 @@ Node S : AbstractVariety if omitted, then @ TO point @ is used for it VariableName => Symbol - the symbol to use for the variable representing the first Chern class of the tautological line bundle on the resulting projective space + the symbol to use for the variable representing the first Chern class of the tautological line bundle $O(1)$ on the resulting projective space Outputs : the projective space of rank 1 quotient bundles of the trivial bundle of rank $n+1$ on @@ -449,7 +454,7 @@ Node S : AbstractVariety if omitted, then @ TO point @ is used for it VariableName => Symbol - the symbol to use for the variable representing the first Chern class of the tautological line bundle on the resulting projective space + the symbol to use for the variable representing the first Chern class of the tautological line bundle $O(1)$ on the resulting projective space Outputs : the projective space of rank 1 subbundles of the trivial bundle of rank $n+1$ on @@ -464,7 +469,7 @@ Node todd P chi OO_P(3) Text - The name is quite long. Here is one way to make it shorter + The name is quite long. Here is one way to make it shorter. Example PP = abstractProjectiveSpace X = PP 4 @@ -1033,7 +1038,7 @@ Node a symbol used internally as a key Description Text - If $X$ is an abstract variety and its tautological line bundle has already been built, + If $X$ is an abstract variety and its tautological line bundle {\tt OO_X(1)} has already been built, it is stored in {\tt X.TautologicalLineBundle}. However, because building this bundle can be computationally intensive, it is often not built unless it is requested by @TO tautologicalLineBundle@. The programmer is warned not to make direct reference to this @@ -1344,6 +1349,89 @@ Node bundles X/rank Caveat Perhaps this should be merged with @ TO abstractProjectiveSpace @. (The optional arguments are slightly different.) + + +Node + Key + weightedProjectiveSpace + (weightedProjectiveSpace,List) + [weightedProjectiveSpace,VariableName] + weightedProjectiveBundle + (weightedProjectiveBundle,List,AbstractVariety) + (weightedProjectiveBundle,List) + [weightedProjectiveBundle,VariableName] + Headline + make a weighted projective space, as an abstract variety + Description + Text + The function weightedProjectiveSpace {a_0,...,a_n} yields the weighted projective space + $\PP^n(a_0,\ldots,a_n)$, as an abstract variety. More generally, weightedProjectiveBundle({a_0,...,a_n},X) + is the product $\PP^n(a_0,\ldots,a_n)\times X$, viewed as a bundle over X. + Synopsis + Usage + weightedProjectiveSpace weights + Inputs + weights : List + VariableName => Thing + Outputs + : + the weighted projective space $\PP^n(a_0,\ldots,a_n)$, + given a list of positive integer weights $\{ a_0,\ldots,a_n\}$. + Description + Text + A weighted projective space is viewed as a smooth Deligne-Mumford stack, not as a singular variety. + Explicitly, $W = \PP^n(a_0,\ldots,a_n)$ is the quotient stack $[(A^{n+1}-0)/G_m]$, + where the multiplicative group $G_m$ acts on affine space by $t(x_0,\ldots,x_n)=(t^{a_0}x_0,\ldots,t^{a_n}x_n)$. + Since $W$ is smooth, the tangent bundle $TW$ is a vector bundle on $W$, and Schubert2 can make computations + with its Chern classes. Explicitly, the Euler sequence for $W$ has the form + $$0\to O_W\to \oplus_{i=0}^n O_W(a_i)\to TW\to 0.$$ + The intersection ring of $W$ is $\mathbf{Q}[h]/(h^{n+1})$, where $h = c_1(O_W(1))$, + as with the usual projective space; but the degree of the zero-cycle $h^n$ is $1/(a_0\ldots a_n)$ rather than 1. + Text + Note that the Schubert2 function @TO2 {(chi,AbstractSheaf),"chi"} @ + uses the Hirzebruch-Riemann-Roch formula to compute Euler characteristics + of vector bundles, and that gives meaningless answers on a stack such as $W$. + Likewise for @TO2 {(euler,AbstractVariety),"euler W"} @. However, functions such + as @TO sectionZeroLocus@, @TO degeneracyLocus@, and @TO skewDegeneracyLocus@ can + yield subvarieties $Y$ of $W$ that miss the points with nontrivial stabilizer group, + and then @TO2 {(chi,AbstractSheaf),"chi"} @ on $Y$ gives meaningful results. + Text + For example, consider the weighted projective space $W = \PP^7(1^7,2)$. + We can define + a smooth Fano 4-fold $Y$ in $W$ by 5 Pfaffian equations (the locus where a general skew-symmetric map $E\to E^*\otimes L$ + has rank at most 2, in terms of the vector bundles below). We compute that $Y$ has degree $(-K_Y)^4 = c_1(O_Y(1))^4 = 10. + Here $Y$ misses the point + of $W$ with nontrivial stabilizer; so we can use Schubert2 to compute that $\chi(Y, TY) = -81$. + Example + W = weightedProjectiveSpace {1,1,1,1,1,1,1,2} + h = chern_1(OO_W(1)); + integral(h^7) + E = 4*OO_W(-1) ++ OO_W; + L = OO_W; + Y = skewDegeneracyLocus(2,E,L) + classY = (Y/W)_*(1); + integral(h^4*classY) + chi(tangentBundle Y) + Synopsis + Usage + weightedProjectiveBundle weights + weightedProjectiveBundle(weights,X) + Inputs + weights : List + X : AbstractVariety + VariableName => Thing + Outputs + : + the product $W = \PP^n(a_0,\ldots,a_n) \times X$, + given a list of positive integer weights $\{ a_0,\ldots,a_n\}$. + If $X$ is omitted, then @ TO point @ is used as the base. The projection morphism $W\to X$ + is given in Schubert2 by the notation $W/X$ (with whatever names you choose for these varieties). + SeeAlso + projectiveBundle + abstractProjectiveSpace + + + -------- Node Key @@ -2087,11 +2175,15 @@ Node the {\tt n}-th Cartesian power of {\tt F}, which amounts to multiplication by {\tt n} in the Grothendieck group Description Text - Maybe we should remove this operation, in favor of @ TO (symbol *, ZZ, AbstractSheaf) @. + Maybe we should remove this operation, in favor of @ TO (symbol *, ZZ, AbstractSheaf) @. As indicated below, + Schubert2 interprets (OO_X(1))^10 as a vector bundle of rank 10, whereas OO_X(1)^10 is the line bundle OO_X(10). + So it is probably wiser to write 10*OO_X(1) when you want the bundle of rank 10. Example X = abstractProjectiveSpace 1 F = OO_X(1) + F^10 chi F^10 + OO_X(1)^10 -------- Node Key @@ -2137,7 +2229,7 @@ Node : which depends on the degree of {\tt n}. In the case where {\tt n} has degree 0, the sheaf returned is the tensor product of {\tt F} with - the {\tt n}-th (tensor) power of the tautological line bundle on the variety of {\tt F}. + the {\tt n}-th (tensor) power of the tautological line bundle $O_X(1)$ on the variety $X$ of {\tt F}. In the case where {\tt n} has degree 1, the sheaf returned is the tensor product of {\tt F} with the line bundle whose first Chern class is {\tt n}. Description @@ -2550,6 +2642,8 @@ Node Key (sectionZeroLocus,AbstractSheaf) sectionZeroLocus + Headline + the zero locus of a general section of a vector bundle, as an abstract variety Usage sectionZeroLocus F Inputs @@ -2558,6 +2652,8 @@ Node : the zero locus of a generic section of {\tt F} Description + Text + If you just want the cycle class of the zero locus, that can be obtained by the function @TO2 {(ctop,AbstractSheaf),"ctop"} @. Example X = base(5, n, Bundle => (E,3,c), Bundle => (T,5,t), Bundle => (L,1,{h})) X.TangentBundle = T @@ -2573,6 +2669,8 @@ Node Key (degeneracyLocus2,ZZ,AbstractSheaf,AbstractSheaf) degeneracyLocus2 + Headline + the class of a rank locus for a general map between vector bundles Usage degeneracyLocus2(k,B,A) Inputs @@ -2583,6 +2681,12 @@ Node : the cycle class of the locus where the rank of a generic map from {\tt A} to {\tt B} is at most {\tt k} Description + Text + It is assumed that there are enough such maps that the locus has the expected dimension. Namely, + in terms of $a := \text{rank}(A)$ and $b := \text{rank}(B)$, the class is in codimension $(a-k)(b-k)$. + The formula for this class was given by Porteous. + The degeneracy locus as an abstract variety + can be obtained by @TO degeneracyLocus@. Example X = base(5, Bundle => (L,1,{l}), Bundle => (M,1,{m}), Bundle => (N,1,{n})) degeneracyLocus2(0,L+M+N,OO_X) @@ -2595,10 +2699,19 @@ Node degeneracyLocus2(1,B,A) degeneracyLocus2(2,B,A) degeneracyLocus2(3,B,A) + SeeAlso + degeneracyLocus + kernelBundle + symmetricDegeneracyLocus2 + skewDegeneracyLocus2 + ctop + Node Key (degeneracyLocus,ZZ,AbstractSheaf,AbstractSheaf) degeneracyLocus + Headline + a rank locus for a general map between vector bundles, as an abstract variety Usage degeneracyLocus(k,B,A) Inputs @@ -2609,15 +2722,34 @@ Node : the locus where the rank of a generic map from {\tt A} to {\tt B} is at most {\tt k} Description + Text + More precisely, the function yields an abstract variety $S$ that is a resolution of singularities of the locus $S_0$ + where a general symmetric map $A \to B$ has rank at most $k$, + following Fulton's Intersection Theory, section 14.4. + Text + It is assumed that there are enough such maps that $S_0$ has the expected dimension. Namely, + in terms of $a := \text{rank}(A)$ and $b := \text{rank}(B)$, this locus is in codimension $(a-k)(b-k)$. + If the map $A \to B$ never has rank less than $k$ on the base variety $X$, then $S$ is isomorphic + to the actual degeneracy locus $S_0$. The class of the degeneracy locus + in the intersection ring of $X$ can be obtained by @TO degeneracyLocus2@. Example X = base(5, Bundle => (A,3,a), Bundle => (B,3,b)) Z = degeneracyLocus(2,B,A) Z/X (Z/X)_* 1 + SeeAlso + degeneracyLocus2 + kernelBundle + symmetricDegeneracyLocus + skewDegeneracyLocus + sectionZeroLocus + Node Key (kernelBundle,ZZ,AbstractSheaf,AbstractSheaf) kernelBundle + Headline + the kernel bundle on a rank locus of a general map between vector bundles Usage kernelBundle(k,B,A) Inputs @@ -2626,9 +2758,14 @@ Node A: Outputs : - the kernel bundle on the locus where the rank of a generic map from {\tt A} to {\tt B} is at most {\tt k}, assuming + the kernel bundle on the locus where the rank of a general map from {\tt A} to {\tt B} is at most {\tt k}, assuming that the rank doesn't drop further Description + Text + More precisely, the function yields a vector bundle of rank $\rank(A)-k$ on + @TO2{(degeneracyLocus,ZZ,AbstractSheaf,AbstractSheaf),"degeneracyLocus(k,B,A)"}@, + which is a resolution of singularities of the locus $S_0$ + where a general map $A \to B$ has rank at most $k$. Example X = base(5, Bundle => (A,3,a), Bundle => (B,3,b)) E = kernelBundle(2,B,A) @@ -2645,6 +2782,305 @@ Node W = variety F j = W/X j_* chern_1 F + SeeAlso + degeneracyLocus + symmetricKernelBundle + skewKernelBundle + +Node + Key + (symmetricDegeneracyLocus2,ZZ,AbstractSheaf,AbstractSheaf) + (symmetricDegeneracyLocus2,ZZ,AbstractSheaf) + symmetricDegeneracyLocus2 + Headline + the class of a rank locus for a general symmetric map + Usage + symmetricDegeneracyLocus2(k,E,L) + Inputs + k: + E: + L: + Outputs + : + the cycle class of the locus where the rank of a general symmetric map from $E$ to $E^*\otimes L$ is at most $k$. + Description + Text + The function yields the class in the intersection ring of the locus + where a general symmetric map $E \to E^*\otimes L$ has rank at most $k$. + Here $E$ is a vector bundle and $L$ is a line bundle, on an abstract variety $X$. + If $L$ is omitted, it is taken to be the trivial line bundle. + Text + It is assumed that there are enough such maps that the locus has the expected dimension. Namely, + in terms of $d := \text{rank}(E)-k$, the class is in codimension $\binom{d+1}{2}$. + The formula for this class was given by Harris-Tu and J\'{o}zefiak-Lascoux-Pragacz. + The degeneracy locus as an abstract variety + can be obtained by @TO symmetricDegeneracyLocus@. + Text + For example, consider the locus where a $3\times 3$ symmetric matrix (up to scalars) + has rank at most 1. + Geometrically, this is the Veronese embedding of $\PP^2$ in $\PP^5$ via the line bundle $O(2)$, + so it is a surface of degree 4 in $\PP^5$. Let us check that. + Example + X = abstractProjectiveSpace 5; + E = 3*OO_X; + L = OO_X(1); + h = chern_1(OO_X(1)); + locus1 = symmetricDegeneracyLocus2(1,E,L); + integral(h^2*locus1) + Text + Next, consider the locus where a $3\times 3$ symmetric matrix (up to scalars) has rank at most 2. + This is given by the vanishing of the determinant, so it is a cubic 4-fold in $\PP^5$. + Let us check that. + Example + locus2 = symmetricDegeneracyLocus2(2,E,L); + integral(h^4*locus2) + SeeAlso + symmetricDegeneracyLocus + degeneracyLocus2 + skewDegeneracyLocus2 + ctop + +Node + Key + (symmetricDegeneracyLocus,ZZ,AbstractSheaf,AbstractSheaf) + (symmetricDegeneracyLocus,ZZ,AbstractSheaf) + symmetricDegeneracyLocus + Headline + a rank locus for a general symmetric map, as an abstract variety + Usage + symmetricDegeneracyLocus(k,E,L) + Inputs + k: + E: + L: + Outputs + : + the locus where the rank of a general symmetric map from $E$ to $E^*\otimes L$ is at most $k$. + Description + Text + More precisely, the function yields an abstract variety $S$ that is a resolution of singularities of the locus $S_0$ + where a general symmetric map $E \to E^*\otimes L$ has rank at most $k$, + following Fulton's Intersection Theory, Example 14.4.11. + Here $E$ is a vector bundle and $L$ is a line bundle, on an abstract variety $X$. + If $L$ is omitted, it is taken to be the trivial line bundle. + Text + It is assumed that there are enough such maps that $S_0$ has the expected dimension. Namely, + in terms of $d := \text{rank}(E)-k$, this locus is in codimension $\binom{d+1}{2}$. + If the map $E \to E^* \otimes L$ never has rank less than $k$ on $X$, then $S$ is isomorphic + to the actual degeneracy locus $S_0$. The class of the degeneracy locus + in the intersection ring of $X$ can be obtained by @TO symmetricDegeneracyLocus2@. + Text + For example, consider the locus $W$ where a $3\times 3$ symmetric matrix (up to scalars) + has rank at most 1. + Geometrically, this should be the Veronese embedding of $\PP^2$ in $\PP^5$ via the line bundle $O(2)$, + which is a surface of degree 4 in $\PP^5$. Let us check that, and also + that $\chi(\PP^2,T\PP^2) = 8$. + Example + X = abstractProjectiveSpace 5; + E = 3*OO_X; + L = OO_X(1); + h = chern_1(OO_X(1)); + S = symmetricDegeneracyLocus(1,E,L) + chi(tangentBundle S) + f = S/X + locus1 = f_*(1); + integral(h^2*locus1) + SeeAlso + symmetricKernelBundle + symmetricDegeneracyLocus2 + degeneracyLocus + skewDegeneracyLocus + sectionZeroLocus + +Node + Key + (symmetricKernelBundle,ZZ,AbstractSheaf,AbstractSheaf) + symmetricKernelBundle + Headline + the kernel bundle on a rank locus of a general symmetric map + Usage + symmetricKernelBundle(k,E,L) + Inputs + k: + E: + L: + Outputs + : + the kernel bundle on the locus where the rank of a general symmetric map from $E$ to $E^*\otimes L$ is $k$ + Description + Text + More precisely, the function yields a vector bundle of rank $\rank(E)-k$ on + @TO2{(symmetricDegeneracyLocus,ZZ,AbstractSheaf,AbstractSheaf),"symmetricDegeneracyLocus(k,E,L)"}@, + which is a resolution of singularities of the locus $S_0$ + where a general symmetric map $E \to E^*\otimes L$ has rank at most $k$. + Here $E$ is a vector bundle and $L$ is a line bundle, on an abstract variety $X$. + If $L$ is omitted, it is taken to be the trivial line bundle. + Text + For example, consider the locus $W$ where a $3\times 3$ symmetric matrix (up to scalars) + has rank at most 1. + Geometrically, this is the Veronese embedding of $\PP^2$ in $\PP^5$ via the line bundle $O(2)$, + which is a surface of degree 4 in $\PP^5$. Viewing this surface as $\PP^2$, the kernel bundle $K$ + is the kernel of the natural map $O_{\PP^2}^3\to O_{\PP^2}(1)$ on $\PP^2$. + Let us check that $\chi(\PP^2,K)=0$ and $\chi(\PP^2,K^*)=3$. + Example + X = abstractProjectiveSpace 5; + E = 3*OO_X; + L = OO_X(1); + h = chern_1(OO_X(1)); + K = symmetricKernelBundle(1,E,L) + chi(K) + chi(dual(K)) + SeeAlso + kernelBundle + skewKernelBundle + symmetricDegeneracyLocus + +Node + Key + (skewDegeneracyLocus2,ZZ,AbstractSheaf,AbstractSheaf) + (skewDegeneracyLocus2,ZZ,AbstractSheaf) + skewDegeneracyLocus2 + Headline + the class of a rank locus for a general skew-symmetric map + Usage + skewDegeneracyLocus2(k,E,L) + Inputs + k: + E: + L: + Outputs + : + the cycle class of the locus where the rank of a generic skew-symmetric map from $E$ to $E^*\otimes L$ is at most $k$. + Description + Text + In other words, this is a locus defined by Pfaffian equations. + The function yields the class in the intersection ring of the locus + where a general skew-symmetric map $E \to E^*\otimes L$ has rank at most $k$. + The number $k$ must be even. Here $E$ is a vector bundle and $L$ is a line bundle, on an abstract variety $X$. + If $L$ is omitted, it is taken to be the trivial line bundle. + Text + It is assumed that there are enough such maps that the locus has the expected dimension. Namely, + in terms of $d := \text{rank}(E)-k$, the class is in codimension $\binom{d}{2}$. + The formula for this class was given by Harris-Tu and J\'{o}zefiak-Lascoux-Pragacz. + The degeneracy locus as an abstract variety + can be obtained by @TO skewDegeneracyLocus@. + Text + For example, consider the locus where a $6\times 6$ skew-symmetric matrix (up to scalars) + has rank less than 6 (hence at most 4). This is the cubic hypersurface in $\PP^{14}$ defined by the Pfaffian. + Let us check that. + Example + X = abstractProjectiveSpace 14; + E = 6*OO_X; + L = OO_X(1); + h = chern_1(OO_X(1)); + locus4 = skewDegeneracyLocus2(4,E,L); + integral(h^(13)*locus4) + Text + Next, consider the locus where a $6\times 6$ skew-symmetric matrix (up to scalars) has rank at most 2. + This is the Grassmannian $\text{Gr}(2,6)$ of lines in $\PP^5$; it is an 8-fold of degree 14 in $\PP^{14}$. + Let us check that. + Example + locus2 = skewDegeneracyLocus2(2,E,L); + integral(h^8*locus2) + SeeAlso + skewDegeneracyLocus + degeneracyLocus2 + symmetricDegeneracyLocus2 + ctop + +Node + Key + (skewDegeneracyLocus,ZZ,AbstractSheaf,AbstractSheaf) + skewDegeneracyLocus + Headline + a rank locus for a general skew-symmetric map, as an abstract variety + Usage + skewDegeneracyLocus(k,E,L) + Inputs + k: + E: + L: + Outputs + : + the locus where the rank of a generic skew-symmetric map from $E$ to $E^*\otimes L$ is at most $k$. + Description + Text + In other words, this is a locus defined by Pfaffian equations. + More precisely, the function yields an abstract variety $S$ that is a resolution of singularities of the locus $S_0$ + where a general skew-symmetric map $E \to E^*\otimes L$ has rank at most $k$, + following Fulton's Intersection Theory, Example 14.4.11. + The number $k$ must be even. Here $E$ is a vector bundle and $L$ is a line bundle, on an abstract variety $X$. + If $L$ is omitted, it is taken to be the trivial line bundle. + Text + It is assumed that there are enough such maps that $S_0$ has the expected dimension. Namely, + in terms of $d := \text{rank}(E)-k$, this locus is in codimension $\binom{d}{2}$. + If the map $E \to E^* \otimes L$ never has rank less than $k$ on $X$, then $S$ is isomorphic + to the actual degeneracy locus $S_0$. + The class of the degeneracy locus + in the intersection ring of $X$ can be obtained by @TO skewDegeneracyLocus2@. + Text + For example, consider the locus $W$ where a $6\times 6$ skew-symmetric matrix (up to scalars) + has rank at most 2. + This is the Grassmannian $\text{Gr}(2,6)$ of lines in $\PP^5$; it is an 8-fold of degree 14 in $\PP^{14}$. + Let us check this, and also that $\chi(\text{Gr}(2,6),T\text{Gr}(2,6)) = 35$. + Example + X = abstractProjectiveSpace 14; + E = 6*OO_X; + L = OO_X(1); + h = chern_1(OO_X(1)); + W = skewDegeneracyLocus(2,E,L) + chi(tangentBundle W) + f = W/X + locus2 = f_*(1); + integral(h^8*locus2) + SeeAlso + skewKernelBundle + skewDegeneracyLocus2 + degeneracyLocus + symmetricDegeneracyLocus + sectionZeroLocus + +Node + Key + (skewKernelBundle,ZZ,AbstractSheaf,AbstractSheaf) + skewKernelBundle + Headline + the kernel bundle on a rank locus of a general skew-symmetric map + Usage + skewKernelBundle(k,E,L) + Inputs + k: + E: + L: + Outputs + : + the kernel bundle on the locus where the rank of a general skew-symmetric map from $E$ to $E^*\otimes L$ is $k$ + Description + Text + More precisely, the function yields a vector bundle of rank $\rank(E)-k$ on + @TO2{(skewDegeneracyLocus,ZZ,AbstractSheaf,AbstractSheaf),"skewDegeneracyLocus(k,E,L)"}@, + which is a resolution of singularities of the locus $S_0$ + where a general skew-symmetric map $E \to E^*\otimes L$ has rank at most $k$. The number $k$ must be even. + Here $E$ is a vector bundle and $L$ is a line bundle, on an abstract variety $X$. + If $L$ is omitted, it is taken to be the trivial line bundle. + Text + For example, consider the locus where a $6\times 6$ skew-symmetric matrix (up to scalars) + has rank at most 2. + This is the Grassmannian $W = \text{Gr}(2,6)$ of lines in $\PP^5$. The kernel bundle $K$ is the dual of the rank-4 + quotient bundle $Q$, $0\to S\to O_W^6\to Q\to 0$ over the Grassmannian. Let us check that $\chi(W, K)=0$ + and $\chi(W,dual(K))=6$. + Example + X = abstractProjectiveSpace 14; + E = 6*OO_X; + L = OO_X(1); + K = skewKernelBundle(2,E,L) + chi(K) + chi(dual(K)) + SeeAlso + kernelBundle + symmetricKernelBundle + skewDegeneracyLocus + ------- Node Key @@ -3455,7 +3891,7 @@ Node tautologicalLineBundle X Description Text - Returns the tautological line bundle of the variety $X$. In the case of a + Returns the tautological line bundle of the variety $X$, also called {\tt OO_X(1)}. In the case of a @TO FlagBundle@, this is the line bundle defining the Pl\"ucker embedding. Used in @TO (symbol SPACE,AbstractSheaf,ZZ)@. From 86b1ce14a90f56dd08bdab954e1d1fa72e0444e9 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sat, 20 Jun 2026 21:43:33 -0700 Subject: [PATCH 13/14] Remove changes related to "matrix Vector" --- M2/Macaulay2/m2/modules.m2 | 4 ++-- M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 | 2 +- .../packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/M2/Macaulay2/m2/modules.m2 b/M2/Macaulay2/m2/modules.m2 index 4d0d37c4981..38d667f440b 100644 --- a/M2/Macaulay2/m2/modules.m2 +++ b/M2/Macaulay2/m2/modules.m2 @@ -100,9 +100,9 @@ leadTerm (ZZ, Vector) := (n,v) -> new class v from leadTerm(n,v#0) degree Vector := v -> ( f := ambient v#0; first degrees source map(target f,,f)) -matrix Vector := opts -> v -> map(class v,,v#0) +matrix Vector := opts -> v -> v#0 vector Vector := identity -new Matrix from Vector := (Matrix,v) -> map(class v,,v#0) +new Matrix from Vector := (Matrix,v) -> v#0 new Vector from Matrix := (M,f) -> ( if not isFreeModule source f or numgens source f =!= 1 then error "expected source to be free with rank 1"; if M =!= target f then error "module must be target of matrix"; diff --git a/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 b/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 index 033d83252a2..037ef28ea5a 100644 --- a/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 +++ b/M2/Macaulay2/packages/MatrixFactorizations/KellerTests.m2 @@ -933,7 +933,7 @@ TEST /// assert not isFactorizationMorphism p assert(degree p === 1) q = randomFactorizationMap(D, C, Boundary => true, InternalDegree => 2) - --assert all({0,1,2}, i -> degree q_i === {2}) + assert all({0,1,2}, i -> degree q_i === {2}) assert isWellDefined q assert isCommutative q assert isFactorizationMorphism q diff --git a/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 b/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 index 6753ebd25ec..03804779ae3 100644 --- a/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 +++ b/M2/Macaulay2/packages/MatrixFactorizations/MatrixFactorizationsDOC.m2 @@ -4632,7 +4632,7 @@ doc /// degree, the random element is constructed as maps of modules with this degree. Example q = randomFactorizationMap(D, C, Boundary => true, InternalDegree => 2) - --assert all({0,1,2}, i -> degree q_i === {2}) + assert all({0,1,2}, i -> degree q_i === {2}) assert isWellDefined q assert isCommutative q assert isFactorizationMorphism q From 215a16d982713c16a65c4e3c5807f906ee796842 Mon Sep 17 00:00:00 2001 From: Burt Totaro Date: Sat, 20 Jun 2026 23:39:26 -0700 Subject: [PATCH 14/14] Change name from "weightedProjectiveSpace" to "WPS", to avoid a conflict with NormalToricVarieties --- M2/Macaulay2/packages/Schubert2.m2 | 6 +++--- M2/Macaulay2/packages/Schubert2/demo3.m2 | 2 +- M2/Macaulay2/packages/Schubert2/doc.m2 | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/M2/Macaulay2/packages/Schubert2.m2 b/M2/Macaulay2/packages/Schubert2.m2 index c3881c5c373..24d23eb7ea6 100644 --- a/M2/Macaulay2/packages/Schubert2.m2 +++ b/M2/Macaulay2/packages/Schubert2.m2 @@ -39,7 +39,7 @@ export { "AbstractSheaf", "abstractSheaf", "AbstractVariety", "abstractVariety", "extensionAlgebra", "inclusion", "SubTangent", "SuperTangent", "SubDimension", "SuperDimension", "NormalClass", "Codimension", "symmetricDegeneracyLocus", "symmetricDegeneracyLocus2", "skewDegeneracyLocus", "skewDegeneracyLocus2", - "symmetricKernelBundle", "skewKernelBundle", "weightedProjectiveBundle", "weightedProjectiveSpace", + "symmetricKernelBundle", "skewKernelBundle", "weightedProjectiveBundle", "WPS", } -- not exported, for now: "logg", "expp", "reciprocal", "ToddClass" @@ -2110,12 +2110,12 @@ weightedProjectiveBundle List := opts -> weights -> ( weightedProjectiveBundle(weights,point,VariableName => opts.VariableName) ) -weightedProjectiveSpace = method( +WPS = method( Options => {VariableName => "h"}, TypicalValue => AbstractVariety ) -weightedProjectiveSpace List := opts -> weights -> ( +WPS List := opts -> weights -> ( weightedProjectiveBundle(weights,point,VariableName => opts.VariableName) ) diff --git a/M2/Macaulay2/packages/Schubert2/demo3.m2 b/M2/Macaulay2/packages/Schubert2/demo3.m2 index 7be9a618bf6..181384e09f4 100644 --- a/M2/Macaulay2/packages/Schubert2/demo3.m2 +++ b/M2/Macaulay2/packages/Schubert2/demo3.m2 @@ -31,7 +31,7 @@ assert(chi(tangentBundle Y) == -80) clearAll -W = weightedProjectiveSpace {1,1,1,1,1,1,2,2} +W = WPS {1,1,1,1,1,1,2,2} h = chern_1(OO_W(1)); assert(integral(h^7) == 1/4) E = 3*OO_W ++ 2*OO_W(-1); diff --git a/M2/Macaulay2/packages/Schubert2/doc.m2 b/M2/Macaulay2/packages/Schubert2/doc.m2 index b37df1f94c5..a7721faff1a 100644 --- a/M2/Macaulay2/packages/Schubert2/doc.m2 +++ b/M2/Macaulay2/packages/Schubert2/doc.m2 @@ -1353,9 +1353,9 @@ Node Node Key - weightedProjectiveSpace - (weightedProjectiveSpace,List) - [weightedProjectiveSpace,VariableName] + WPS + (WPS,List) + [WPS,VariableName] weightedProjectiveBundle (weightedProjectiveBundle,List,AbstractVariety) (weightedProjectiveBundle,List) @@ -1364,12 +1364,12 @@ Node make a weighted projective space, as an abstract variety Description Text - The function weightedProjectiveSpace {a_0,...,a_n} yields the weighted projective space + The function WPS {a_0,...,a_n} yields the weighted projective space $\PP^n(a_0,\ldots,a_n)$, as an abstract variety. More generally, weightedProjectiveBundle({a_0,...,a_n},X) is the product $\PP^n(a_0,\ldots,a_n)\times X$, viewed as a bundle over X. Synopsis Usage - weightedProjectiveSpace weights + WPS weights Inputs weights : List VariableName => Thing @@ -1403,7 +1403,7 @@ Node Here $Y$ misses the point of $W$ with nontrivial stabilizer; so we can use Schubert2 to compute that $\chi(Y, TY) = -81$. Example - W = weightedProjectiveSpace {1,1,1,1,1,1,1,2} + W = WPS {1,1,1,1,1,1,1,2} h = chern_1(OO_W(1)); integral(h^7) E = 4*OO_W(-1) ++ OO_W;