Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/schemes/generic/glue.py
4079 views
1
"""
2
Scheme obtained by gluing two other schemes
3
"""
4
5
#*******************************************************************************
6
# Copyright (C) 2006 William Stein
7
# Distributed under the terms of the GNU General Public License (GPL)
8
# http://www.gnu.org/licenses/
9
#*******************************************************************************
10
11
import morphism
12
import scheme
13
14
class GluedScheme(scheme.Scheme):
15
r"""
16
INPUT:
17
18
19
- ``f`` - open immersion from a scheme U to a scheme
20
X
21
22
- ``g`` - open immersion from U to a scheme Y
23
24
25
OUTPUT: The scheme obtained by gluing X and Y along the open set
26
U.
27
28
.. note::
29
30
Checking that `f` and `g` are open
31
immersions is not implemented.
32
"""
33
def __init__(self, f, g, check=True):
34
if check:
35
if not morphism.is_SchemeMorphism(f):
36
raise TypeError, "f (=%s) must be a scheme morphism"%f
37
if not morphism.is_SchemeMorphism(g):
38
raise TypeError, "g (=%s) must be a scheme morphism"%g
39
if f.domain() != g.domain():
40
raise ValueError, "f (=%s) and g (=%s) must have the same domain"%(f,g)
41
self.__f = f
42
self.__g = g
43
44
def gluing_maps(self):
45
return self.__f, self.__g
46
47
def _repr_(self):
48
return "Scheme obtained by gluing X and Y along U, where\n X: %s\n Y: %s\n U: %s"%(
49
self.__f.codomain(), self.__g.codomain(), self.__f.domain())
50
51
52