Skip to content

Commit

Permalink
Add sheaf cohomology for projective schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Apr 11, 2024
1 parent 8ea5214 commit d11f801
Show file tree
Hide file tree
Showing 9 changed files with 971 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4070,6 +4070,10 @@ REFERENCES:
293-311 (1987).
:doi:`10.1007/BF00337892`
.. [Kudo2017] Momonari Kudo, "Analysis of an algorithm to compute the cohomology
groups of coherent sheaves and its applications", Japan Journal of
Industrial and Applied Mathematics 34 (2017), 1--40.
.. [Kuh1987] \W. Kühnel, "Minimal triangulations of Kummer varieties",
Abh. Math. Sem. Univ. Hamburg 57 (1987), 7-20.
Expand Down
5 changes: 5 additions & 0 deletions src/doc/en/reference/schemes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Projective Schemes
sage/schemes/projective/projective_subscheme
sage/schemes/projective/projective_rational_point
sage/schemes/projective/projective_homset
sage/schemes/projective/coherent_sheaf
sage/schemes/projective/cohomology

Products of Projective Spaces
-----------------------------
Expand All @@ -61,6 +63,7 @@ Products of Projective Spaces

Toric Varieties
---------------

.. toctree::
:maxdepth: 1

Expand All @@ -85,6 +88,7 @@ Toric Varieties

Cyclic Covers
---------------

.. toctree::
:maxdepth: 1

Expand All @@ -95,6 +99,7 @@ Cyclic Covers

Berkovich Analytic Space
------------------------

.. toctree::
:maxdepth: 1

Expand Down
4 changes: 4 additions & 0 deletions src/sage/misc/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ def latex_extra_preamble():
\newcommand{\PSL}{\mathrm{PSL}}
\newcommand{\lcm}{\mathop{\operatorname{lcm}}}
\newcommand{\dist}{\mathrm{dist}}
\newcommand{\im}{\mathop{\operatorname{im}}}
\newcommand{\rank}{\mathop{\operatorname{rank}}}
\newcommand{\PP}{\mathbf{P}}
\newcommand{\OO}{\mathcal{O}}
\newcommand{\Bold}[1]{\mathbf{#1}}
<BLANKLINE>
"""
Expand Down
7 changes: 6 additions & 1 deletion src/sage/misc/latex_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ def convert_latex_macro_to_mathjax(macro):
latex_macros = [r"\newcommand{\SL}{\mathrm{SL}}",
r"\newcommand{\PSL}{\mathrm{PSL}}",
r"\newcommand{\lcm}{\mathop{\operatorname{lcm}}}",
r"\newcommand{\dist}{\mathrm{dist}}"]
r"\newcommand{\dist}{\mathrm{dist}}",
r"\newcommand{\im}{\mathop{\operatorname{im}}}",
r"\newcommand{\rank}{\mathop{\operatorname{rank}}}",
r"\newcommand{\PP}{\mathbf{P}}",
r"\newcommand{\OO}{\mathcal{O}}",
]

# The following is to allow customization of typesetting of rings:
# mathbf vs mathbb. See latex.py for more information.
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/affine/affine_space.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Affine `n` space over a ring
Affine `n`-space over a ring
"""

# ****************************************************************************
Expand Down
308 changes: 308 additions & 0 deletions src/sage/schemes/projective/coherent_sheaf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
r"""
Coherent sheaves on projective schemes
EXAMPLES:
We define the Fermat cubic surface in \PP^2 and examine its structure sheaf::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: sh = X.structure_sheaf()
sage: sh
Coherent sheaf on Closed subscheme of Projective Space of dimension 2
over Rational Field defined by: x^4 + y^4 + z^4
sage: sh.euler_characteristic()
-2
AUTHORS:
- Kwankyu Lee (2024-01-22): initial version
"""

from functools import cached_property
from sage.structure.sage_object import SageObject
from sage.modules.free_module import FreeModule


class CoherentSheaf(SageObject):
r"""
Coherent sheaf on a projective scheme.
INPUT:
- ``scheme`` -- the base scheme on which the sheaf is defined
- ``module`` -- a free module or its quotient by a submodule
- ``twist`` -- (default: 0) an integer
This class constructs the coherent sheaf `\tilde M(n)` if `M` is the
``module`` and `n` is the ``twist``.
"""
def __init__(self, scheme, module, twist=0):
"""
Initialize ``self``.
TESTS::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: sheaf = X.structure_sheaf()
sage: TestSuite(sheaf).run(skip=['_test_pickling'])
"""
try:
if module.is_ambient():
module = module.quotient(module.zero_submodule())
except AttributeError:
pass

assert module.cover() == module.free_cover()

self._base_scheme = scheme
self._module = module
self._twist = twist

@cached_property
def _cohomology(self):
"""
Return an object that computes the cohomology.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: sheaf = X.structure_sheaf()
sage: c = sheaf._cohomology
sage: c.H(1).dimension()
3
sage: c.h(1)
3
"""
raise NotImplementedError('_cohomology is not implemented')

def _repr_(self):
"""
Return the string representation of this sheaf.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: s = X.structure_sheaf()
sage: s
Coherent sheaf on Closed subscheme of Projective Space of dimension 2
over Rational Field defined by: x^4 + y^4 + z^4
sage: s.twist(2)
Twisted coherent sheaf on Closed subscheme of Projective Space of dimension 2
over Rational Field defined by: x^4 + y^4 + z^4
"""
sheaf = 'Twisted coherent sheaf' if self._twist else 'Coherent sheaf'
return f'{sheaf} on {self._base_scheme}'

def base_scheme(self):
"""
Return the base scheme on which this sheaf is defined.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: s = X.structure_sheaf()
sage: s.base_scheme()
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^4 + y^4 + z^4
"""
return self._base_scheme

def defining_twist(self):
"""
Return the integer by which the module defining this coherent sheaf is
twisted.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: s = X.structure_sheaf(3)
sage: s.defining_twist()
3
"""
return self._twist

def defining_module(self):
"""
Return the module defining this coherent sheaf.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: s = X.structure_sheaf()
sage: s.defining_module()
Quotient module by Submodule of Ambient free module of rank 1 over the integral domain Quotient
of Multivariate Polynomial Ring in x, y, z over Rational Field by the ideal (x^4 + y^4 + z^4)
Generated by the rows of the matrix:
[]
"""
return self._module

def cohomology_group(self, r=0):
"""
Return the `r`-th cohomology as a vector space.
INPUT:
- ``r`` -- (default: 0) a non-negative integer
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: s = X.structure_sheaf()
sage: s.cohomology_group(1).dimension()
3
"""
return self._cohomology.H(r)

def cohomology(self, r=0):
"""
Return the dimension of the `r`-th cohomology as a vector space.
INPUT:
- ``r`` -- (default: 0) a non-negative integer
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: sheaf = X.structure_sheaf()
sage: sheaf.cohomology(0)
1
sage: sheaf.cohomology(1)
3
sage: sheaf.cohomology(2)
0
"""
return self._cohomology.h(r)

def twist(self, t=0):
r"""
Return the twisted sheaf `F(n)` of this sheaf `F`.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: sh = X.structure_sheaf()
sage: sh.twist(1).euler_characteristic()
2
sage: sh.twist(2).euler_characteristic()
6
"""
return type(self)(self._base_scheme, self._module, self._twist + t)

def euler_characteristic(self):
"""
Return the Euler characteristic of this coherent sheaf.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: sh = X.structure_sheaf()
sage: sh.euler_characteristic()
-2
"""
d = self._base_scheme.dimension()
chi = 0
for r in range(d + 1): # for Grothendieck's vanishing theorem
d = self.cohomology(r)
if r % 2:
chi = chi - d
else:
chi = chi + d
return chi


class CoherentSheaf_on_projective_space(CoherentSheaf):
r"""
Coherent sheaf on a projective space.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: P2.structure_sheaf()
Coherent sheaf on Projective Space of dimension 2 over Rational Field
"""
@cached_property
def _cohomology(self):
"""
This property keeps the cohomology object for this sheaf.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: P2.structure_sheaf()._cohomology
Maruyama Complex induced from S(0) <-- 0
"""
from sage.schemes.projective.cohomology import MaruyamaComplex
return MaruyamaComplex(self._module, twist=self._twist)


class CoherentSheaf_on_projective_subscheme(CoherentSheaf):
r"""
Coherent sheaf on a projective subscheme.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: X.structure_sheaf()
Coherent sheaf on Closed subscheme of Projective Space of dimension 2
over Rational Field defined by: x^4 + y^4 + z^4
"""
@cached_property
def _cohomology(self):
"""
This property keeps the cohomology object for this sheaf.
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: X.structure_sheaf()._cohomology
Maruyama Complex induced from S(0) <-- S(-4) <-- 0
"""
return self.image_to_ambient_space()._cohomology

def image_to_ambient_space(self):
"""
Return the direct image of this sheaf to the ambient space.
The image is with respect to the inclusion morphism from the base
scheme into the projective Space.
INPUT:
- ``twist`` -- (default: `0`) an integer
EXAMPLES::
sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: X = P2.subscheme(x^4 + y^4 + z^4)
sage: X.structure_sheaf().image_to_ambient_space()
Coherent sheaf on Projective Space of dimension 2 over Rational Field
"""
X = self._base_scheme
A = X.ambient_space()
S = A.coordinate_ring()

d = self._module.degree()
M = FreeModule(S, d)
I = X.defining_polynomials()
J = self._module.relations().gens()
G = [f * M.gen(i) for i in range(d) for f in I] + [v.change_ring(S) for v in J]
N = M.submodule(G)
return A.coherent_sheaf(M.quotient(N), twist=self._twist)
Loading

0 comments on commit d11f801

Please sign in to comment.