General schemes
Arbitrary schemes over a base ring $\mathbb k$ which are given by means of their affine patches and glueings are instances of
Scheme ā TypeScheme{BaseRingType<:Ring, BaseRingElemType<:RingElement}A scheme over a ring $š$ of type BaseRingType with elements of type BaseRingElemType.
Affine schemes over noetherian base rings
Let $\mathbb k$ be a commutative noetherian base ring (in practice: an algebraic extension of $\mathbb Q$ or $\mathbb F_p$). An affine scheme $X$ over $\mathbb k$ is given as
\[ X = \mathrm{Spec} \left(\mathbb k[x_1,\dots,x_n]/I\right)\]
for some polynomial ring $R = \mathbb k[x_1,\dots,x_n]$ and an ideal $I \subset R$. More generally, we can form the Spec of any localized affine algebra $L$ as an instance of
Spec ā TypeSpec{BRT, BRET, RT, RET, MST} <: Scheme{BRT, BRET}An affine scheme $X = Spec ((R/I)[Sā»Ā¹])$ with $R = k[xā,ā¦,xā]$ a free polynomial algebra of type RT over a base ring $k$ of type BRT, $I ā R$ a finitely generated ideal with elements of type RET, and $S$ a multiplicative set in $R$ of type MST.
Internally, this merely stores an instance $L$ of MPolyQuoLocalizedRing. This ring can be obtained using
OO ā MethodOO(X::Spec)For $X = Spec ((š[xā,ā¦,xā]/I)[Sā»Ā¹])$ this returns $(š[xā,ā¦,xā]/I)[Sā»Ā¹]$.
One of the main reasons to allow such general schemes is that principal open subsets $U = \{ f \neq 0\}$ of affine schemes $X$, $f \in \mathcal O_X(X)$ are again affine; basically due to Rabinowitsch's trick:
\[ U = \mathrm{Spec} \left(\mathcal O_X(X)[f^{-1}]\right) = \mathrm{Spec} \left(\mathcal O_X(X)[t]/\langle 1 - t\cdot f \rangle\right).\]
This flexibility allows us to introduce and handle subschemes using the natural relations on their rings. Thus, we can, for instance, define subschemes via
subscheme ā Methodsubscheme(X::Spec, f::RingElem)For a scheme $X = Spec ((š[xā,ā¦,xā]/I)[Sā»Ā¹])$ and an element $f ā š[xā,ā¦,xā]$ this returns the closed subscheme defined by the ideal $I' = I + āØfā©$.
hypersurface_complement ā Methodhypersurface_complement(X::Spec, f::RingElem)For a scheme $X = Spec ((š[xā,ā¦,xā]/I)[Sā»Ā¹])$ and an element $f ā š[xā,ā¦,xā]$ this returns the open subscheme $U = X ā V(f)$ defined by the complement of the vanishing locus of $f$.
Containments can be checked using
issubset ā Methodissubset(X::Spec, Y::Spec)Checks whether $X$ is a subset of $Y$ based on the comparison of their coordinate rings.
is_open_embedding ā Methodis_open_embedding(X::Spec, Y::Spec)Checks whether $X$ is openly embedded in $Y$.
is_closed_embedding ā Methodis_closed_embedding(X::Spec, Y::Spec)Checks whether $X$ is closed embedded in $Y$.
The closure of a subscheme can be computed via
closure ā Methodclosure(X::Spec, Y::Spec)Returns the closure of $X$ in $Y$.
Among the basic functionality for affine schemes we have
product ā Methodproduct(X::Spec, Y::Spec)Returns a triple $(XĆY, pā, pā)$ consisting of the product $XĆY$ and the two projections $pā : XĆY ā X$ and $pā : XĆY ā Y$.