# Algebraic schemes¶

An algebraic scheme is defined by a set of polynomials in some suitable affine or projective coordinates. Possible ambient spaces are

Note that while projective spaces are of course toric varieties themselves, they are implemented differently in Sage due to efficiency considerations. You still can create a projective space as a toric variety if you wish.

In the following, we call the corresponding subschemes affine algebraic schemes, projective algebraic schemes, or toric algebraic schemes. In the future other ambient spaces, perhaps by means of gluing relations, may be intoduced.

Generally, polynomials $$p_0, p_1, \dots, p_n$$ define an ideal $$I=\left<p_0, p_1, \dots, p_n\right>$$. In the projective and toric case, the polynomials (and, therefore, the ideal) must be homogeneous. The associated subscheme $$V(I)$$ of the ambient space is, roughly speaking, the subset of the ambient space on which all polynomials vanish simultaneously.

Warning

You should not construct algebraic scheme objects directly. Instead, use .subscheme() methods of ambient spaces. See below for examples.

EXAMPLES:

We first construct the ambient space, here the affine space $$\QQ^2$$:

sage: A2 = AffineSpace(2, QQ, 'x, y')
sage: A2.coordinate_ring().inject_variables()
Defining x, y


Now we can write polynomial equations in the variables $$x$$ and $$y$$. For example, one equation cuts out a curve (a one-dimensional subscheme):

sage: V = A2.subscheme([x^2+y^2-1]); V
Closed subscheme of Affine Space of dimension 2
over Rational Field defined by:
x^2 + y^2 - 1
sage: V.dimension()
1


Here is a more complicated example in a projective space:

sage: P3 = ProjectiveSpace(3, QQ, 'x')
sage: P3.inject_variables()
Defining x0, x1, x2, x3
sage: Q = matrix([[x0, x1, x2], [x1, x2, x3]]).minors(2); Q
[-x1^2 + x0*x2, -x1*x2 + x0*x3, -x2^2 + x1*x3]
sage: twisted_cubic = P3.subscheme(Q)
sage: twisted_cubic
Closed subscheme of Projective Space of dimension 3
over Rational Field defined by:
-x1^2 + x0*x2,
-x1*x2 + x0*x3,
-x2^2 + x1*x3
sage: twisted_cubic.dimension()
1


Note that there are 3 equations in the 3-dimensional ambient space, yet the subscheme is 1-dimensional. One can show that it is not possible to eliminate any of the equations, that is, the twisted cubic is not a complete intersection of two polynomial equations.

Let us look at one affine patch, for example the one where $$x_0=1$$

sage: patch = twisted_cubic.affine_patch(0)
sage: patch
Closed subscheme of Affine Space of dimension 3
over Rational Field defined by:
-x0^2 + x1,
-x0*x1 + x2,
-x1^2 + x0*x2
sage: patch.embedding_morphism()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 3
over Rational Field defined by:
-x0^2 + x1,
-x0*x1 + x2,
-x1^2 + x0*x2
To:   Closed subscheme of Projective Space of dimension 3
over Rational Field defined by:
-x1^2 + x0*x2,
-x1*x2 + x0*x3,
-x2^2 + x1*x3
Defn: Defined on coordinates by sending (x0, x1, x2) to
(1 : x0 : x1 : x2)


AUTHORS:

• David Kohel (2005): initial version.
• William Stein (2005): initial version.
• Andrey Novoseltsev (2010-05-17): subschemes of toric varieties.
• Volker Braun (2010-12-24): documentation of schemes and refactoring. Added coordinate neighborhoods and is_smooth()
• Ben Hutz (2014): subschemes of cartesian products of projective space
class sage.schemes.generic.algebraic_scheme.AlgebraicScheme(A)

An algebraic scheme presented as a subscheme in an ambient space.

This is the base class for all algebraic schemes, that is, schemes defined by equations in affine, projective, or toric ambient spaces.

ambient_space()

Return the ambient space of this algebraic scheme.

EXAMPLES:

sage: A.<x, y> = AffineSpace(2, GF(5))
sage: S = A.subscheme([])
sage: S.ambient_space()
Affine Space of dimension 2 over Finite Field of size 5

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([x-y, x-z])
sage: S.ambient_space() is P
True

coordinate_ring()

Return the coordinate ring of this algebraic scheme. The result is cached.

OUTPUT:

The coordinate ring. Usually a polynomial ring, or a quotient thereof.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([x-y, x-z])
sage: S.coordinate_ring()
Quotient of Multivariate Polynomial Ring in x, y, z over Integer Ring by the ideal (x - y, x - z)

embedding_center()

Return the distinguished point, if there is any.

If the scheme $$Y$$ was constructed as a neighbourhood of a point $$p \in X$$, then embedding_morphism() returns a local isomorphism $$f:Y\to X$$ around the preimage point $$f^{-1}(p)$$. The latter is returned by embedding_center().

OUTPUT:

A point of self. Raises AttributeError if there is no distinguished point, depending on how self was constructed.

EXAMPLES:

sage: P3.<w,x,y,z> = ProjectiveSpace(QQ,3)
sage: X = P3.subscheme( (w^2-x^2)*(y^2-z^2) )
sage: p = [1,-1,3,4]
sage: nbhd = X.neighborhood(p); nbhd
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
x0^2*x2^2 - x1^2*x2^2 + 6*x0^2*x2 - 6*x1^2*x2 + 2*x0*x2^2 +
2*x1*x2^2 - 7*x0^2 + 7*x1^2 + 12*x0*x2 + 12*x1*x2 - 14*x0 - 14*x1
sage: nbhd.embedding_center()
(0, 0, 0)
sage: nbhd.embedding_morphism()(nbhd.embedding_center())
(1/4 : -1/4 : 3/4 : 1)
sage: nbhd.embedding_morphism()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
x0^2*x2^2 - x1^2*x2^2 + 6*x0^2*x2 - 6*x1^2*x2 + 2*x0*x2^2 +
2*x1*x2^2 - 7*x0^2 + 7*x1^2 + 12*x0*x2 + 12*x1*x2 - 14*x0 - 14*x1
To:   Closed subscheme of Projective Space of dimension 3 over Rational Field defined by:
w^2*y^2 - x^2*y^2 - w^2*z^2 + x^2*z^2
Defn: Defined on coordinates by sending (x0, x1, x2) to
(x0 + 1 : x1 - 1 : x2 + 3 : 4)

embedding_morphism()

Return the default embedding morphism of self.

If the scheme $$Y$$ was constructed as a neighbourhood of a point $$p \in X$$, then embedding_morphism() returns a local isomorphism $$f:Y\to X$$ around the preimage point $$f^{-1}(p)$$. The latter is returned by embedding_center().

If the algebraic scheme $$Y$$ was not constructed as a neighbourhood of a point, then the embedding in its ambient_space() is returned.

OUTPUT:

A scheme morphism whose domain() is self.

• By default, it is the tautological embedding into its own ambient space ambient_space().
• If the algebraic scheme (which itself is a subscheme of an auxiliary ambient_space()) was constructed as a patch or neighborhood of a point then the embedding is the embedding into the original scheme.
• A NotImplementedError is raised if the construction of the embedding morphism is not implemented yet.

EXAMPLES:

sage: A2.<x,y> = AffineSpace(QQ,2)
sage: C = A2.subscheme(x^2+y^2-1)
sage: C.embedding_morphism()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^2 + y^2 - 1
To:   Affine Space of dimension 2 over Rational Field
Defn: Defined on coordinates by sending (x, y) to
(x, y)
sage: P1xP1.<x,y,u,v> = toric_varieties.P1xP1()
sage: P1 = P1xP1.subscheme(x-y)
sage: P1.embedding_morphism()
Scheme morphism:
From: Closed subscheme of 2-d CPR-Fano toric variety covered
by 4 affine patches defined by:
x - y
To:   2-d CPR-Fano toric variety covered by 4 affine patches
Defn: Defined on coordinates by sending [x : y : u : v] to
[y : y : u : v]


So far, the embedding was just in the own ambient space. Now a bit more interesting examples:

sage: P2.<x,y,z> = ProjectiveSpace(QQ,2)
sage: X = P2.subscheme((x^2-y^2)*z)
sage: p = (1,1,0)
sage: nbhd = X.neighborhood(p)
sage: nbhd
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
-x0^2*x1 - 2*x0*x1


Note that $$p=(1,1,0)$$ is a singular point of $$X$$. So the neighborhood of $$p$$ is not just affine space. The :meth:neighborhood method returns a presentation of the neighborhood as a subscheme of an auxiliary 2-dimensional affine space:

sage: nbhd.ambient_space()
Affine Space of dimension 2 over Rational Field


But its embedding_morphism() is not into this auxiliary affine space, but the original subscheme $$X$$:

sage: nbhd.embedding_morphism()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
-x0^2*x1 - 2*x0*x1
To:   Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2*z - y^2*z
Defn: Defined on coordinates by sending (x0, x1) to
(1 : x0 + 1 : x1)


A couple more examples:

sage: patch1 = P1xP1.affine_patch(1)
sage: patch1
2-d affine toric variety
sage: patch1.embedding_morphism()
Scheme morphism:
From: 2-d affine toric variety
To:   2-d CPR-Fano toric variety covered by 4 affine patches
Defn: Defined on coordinates by sending [y : u] to
[1 : y : u : 1]
sage: subpatch = P1.affine_patch(1)
sage: subpatch
Closed subscheme of 2-d affine toric variety defined by:
-y + 1
sage: subpatch.embedding_morphism()
Scheme morphism:
From: Closed subscheme of 2-d affine toric variety defined by:
-y + 1
To:   Closed subscheme of 2-d CPR-Fano toric variety covered
by 4 affine patches defined by:
x - y
Defn: Defined on coordinates by sending [y : u] to
[1 : y : u : 1]

is_projective()

Return True if self is presented as a subscheme of an ambient projective space.

OUTPUT:

Boolean.

EXAMPLES:

sage: PP.<x,y,z,w> = ProjectiveSpace(3,QQ)
sage: f = x^3 + y^3 + z^3 + w^3
sage: R = f.parent()
sage: I = [f] + [f.derivative(zz) for zz in PP.gens()]
sage: V = PP.subscheme(I)
sage: V.is_projective()
True
sage: AA.<x,y,z,w> = AffineSpace(4,QQ)
sage: V = AA.subscheme(I)
sage: V.is_projective()
False


Note that toric varieties are implemented differently than projective spaces. This is why this method returns False for toric varieties:

sage: PP.<x,y,z,w> = toric_varieties.P(3)
sage: V = PP.subscheme(x^3 + y^3 + z^3 + w^3)
sage: V.is_projective()
False

ngens()

Return the number of generators of the ambient space of this algebraic scheme.

EXAMPLES:

sage: A.<x, y> = AffineSpace(2, GF(5))
sage: S = A.subscheme([])
sage: S.ngens()
2
sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([x-y, x-z])
sage: P.ngens()
3

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_quasi(X, Y)

The quasi-affine or quasi-projective scheme $$X - Y$$, where $$X$$ and $$Y$$ are both closed subschemes of a common ambient affine or projective space.

Warning

You should not create objects of this class directly. The preferred method to construct such subschemes is to use complement() method of algebraic schemes.

OUTPUT:

An instance of AlgebraicScheme_quasi.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([])
sage: T = P.subscheme([x-y])
sage: T.complement(S)
Quasi-projective subscheme X - Y of Projective Space of dimension 2 over
Integer Ring, where X is defined by:
(no polynomials)
and Y is defined by:
x - y

X()

Return the scheme $$X$$ such that self is represented as $$X - Y$$.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([])
sage: T = P.subscheme([x-y])
sage: U = T.complement(S)
sage: U.X() is S
True

Y()

Return the scheme $$Y$$ such that self is represented as $$X - Y$$.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([])
sage: T = P.subscheme([x-y])
sage: U = T.complement(S)
sage: U.Y() is T
True

rational_points(F=None, bound=0)

Return the set of rational points on this algebraic scheme over the field $$F$$.

EXAMPLES:

sage: A.<x, y> = AffineSpace(2, GF(7))
sage: S = A.subscheme([x^2-y])
sage: T = A.subscheme([x-y])
sage: U = T.complement(S)
sage: U.rational_points()
[(2, 4), (3, 2), (4, 2), (5, 4), (6, 1)]
sage: U.rational_points(GF(7^2, 'b'))
[(2, 4), (3, 2), (4, 2), (5, 4), (6, 1), (b, b + 4), (b + 1, 3*b + 5), (b + 2, 5*b + 1),
(b + 3, 6), (b + 4, 2*b + 6), (b + 5, 4*b + 1), (b + 6, 6*b + 5), (2*b, 4*b + 2),
(2*b + 1, b + 3), (2*b + 2, 5*b + 6), (2*b + 3, 2*b + 4), (2*b + 4, 6*b + 4),
(2*b + 5, 3*b + 6), (2*b + 6, 3), (3*b, 2*b + 1), (3*b + 1, b + 2), (3*b + 2, 5),
(3*b + 3, 6*b + 3), (3*b + 4, 5*b + 3), (3*b + 5, 4*b + 5), (3*b + 6, 3*b + 2),
(4*b, 2*b + 1), (4*b + 1, 3*b + 2), (4*b + 2, 4*b + 5), (4*b + 3, 5*b + 3),
(4*b + 4, 6*b + 3), (4*b + 5, 5), (4*b + 6, b + 2), (5*b, 4*b + 2), (5*b + 1, 3),
(5*b + 2, 3*b + 6), (5*b + 3, 6*b + 4), (5*b + 4, 2*b + 4), (5*b + 5, 5*b + 6),
(5*b + 6, b + 3), (6*b, b + 4), (6*b + 1, 6*b + 5), (6*b + 2, 4*b + 1), (6*b + 3, 2*b + 6),
(6*b + 4, 6), (6*b + 5, 5*b + 1), (6*b + 6, 3*b + 5)]

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme(A, polynomials)

An algebraic scheme presented as a closed subscheme is defined by explicit polynomial equations. This is as opposed to a general scheme, which could, e.g., be the Neron model of some object, and for which we do not want to give explicit equations.

INPUT:

• A - ambient space (e.g. affine or projective $$n$$-space)

• polynomials - single polynomial, ideal or iterable of defining

polynomials; in any case polynomials must belong to the coordinate ring of the ambient space and define valid polynomial functions (e.g. they should be homogeneous in the case of a projective space)

OUTPUT:

• algebraic scheme

EXAMPLES:

sage: from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme
sage: P.<x, y, z> = ProjectiveSpace(2, QQ)
sage: P.subscheme([x^2-y*z])
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2 - y*z
sage: AlgebraicScheme_subscheme(P, [x^2-y*z])
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2 - y*z

Jacobian()

Return the Jacobian ideal.

This is the ideal generated by

• the $$d\times d$$ minors of the Jacobian matrix, where $$d$$ is the codimension() of the algebraic scheme, and
• the defining polynomials of the algebraic scheme. Note that some authors do not include these in the definition of the Jacobian ideal. An example of a reference that does include the defining equations is [LazarsfeldJacobian].

OUTPUT:

An ideal in the coordinate ring of the ambient space.

REFERENCES:

 [LazarsfeldJacobian] Robert Lazarsfeld: Positivity in algebraic geometry II; Positivity for Vector Bundles, and Multiplier Ideals, page 181.

EXAMPLES:

sage: P3.<w,x,y,z> = ProjectiveSpace(3, QQ)
sage: twisted_cubic = P3.subscheme(matrix([[w, x, y],[x, y, z]]).minors(2))
sage: twisted_cubic.Jacobian()
Ideal (-x^2 + w*y, -x*y + w*z, -y^2 + x*z, x*z, -2*w*z, w*y, 3*w*y, -2*w*x,
w^2, y*z, -2*x*z, w*z, 3*w*z, -2*w*y, w*x, z^2, -2*y*z, x*z, 3*x*z, -2*w*z,
w*y) of Multivariate Polynomial Ring in w, x, y, z over Rational Field
sage: twisted_cubic.defining_ideal()
Ideal (-x^2 + w*y, -x*y + w*z, -y^2 + x*z) of Multivariate Polynomial Ring
in w, x, y, z over Rational Field

Jacobian_matrix()

Return the matrix $$\frac{\partial f_i}{\partial x_j}$$ of (formal) partial derivatives.

OUTPUT:

A matrix of polynomials.

EXAMPLES:

sage: P3.<w,x,y,z> = ProjectiveSpace(3, QQ)
sage: twisted_cubic = P3.subscheme(matrix([[w, x, y],[x, y, z]]).minors(2))
sage: twisted_cubic.Jacobian_matrix()
[   y -2*x    w    0]
[   z   -y   -x    w]
[   0    z -2*y    x]

base_extend(R)

Return the base change to the ring $$R$$ of this scheme.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, GF(11))
sage: S = P.subscheme([x^2-y*z])
sage: S.base_extend(GF(11^2, 'b'))
Closed subscheme of Projective Space of dimension 2 over Finite Field in b of size 11^2 defined by:
x^2 - y*z
sage: S.base_extend(ZZ)
Traceback (most recent call last):
...
ValueError: no natural map from the base ring (=Finite Field of size 11) to R (=Integer Ring)!

change_ring(R)

Returns a new projective subscheme whose base ring is self coerced to R.

EXAMPLES:

sage: P.<x,y>=ProjectiveSpace(QQ,1)
sage: X=P.subscheme([3*x^2-y^2])
sage: H=Hom(X,X)
sage: X.change_ring(GF(3))
Closed subscheme of Projective Space of dimension 1 over Finite Field of size 3 defined by:
-y^2

codimension()

Return the codimension of the algebraic subscheme.

OUTPUT:

Integer.

EXAMPLES:

sage: PP.<x,y,z,w,v> = ProjectiveSpace(4,QQ)
sage: V = PP.subscheme(x*y)
sage: V.codimension()
1
sage: V.dimension()
3

complement(other=None)

Return the scheme-theoretic complement other - self, where self and other are both closed algebraic subschemes of the same ambient space.

If other is unspecified, it is taken to be the ambient space of self.

EXAMPLES:

sage: A.<x, y, z> = AffineSpace(3, ZZ)
sage: X = A.subscheme([x+y-z])
sage: Y = A.subscheme([x-y+z])
sage: Y.complement(X)
Quasi-affine subscheme X - Y of Affine Space of
dimension 3 over Integer Ring, where X is defined by:
x + y - z
and Y is defined by:
x - y + z
sage: Y.complement()
Quasi-affine subscheme X - Y of Affine Space of
dimension 3 over Integer Ring, where X is defined by:
(no polynomials)
and Y is defined by:
x - y + z
sage: P.<x, y, z> = ProjectiveSpace(2, QQ)
sage: X = P.subscheme([x^2+y^2+z^2])
sage: Y = P.subscheme([x*y+y*z+z*x])
sage: Y.complement(X)
Quasi-projective subscheme X - Y of Projective Space of
dimension 2 over Rational Field, where X is defined by:
x^2 + y^2 + z^2
and Y is defined by:
x*y + x*z + y*z
sage: Y.complement(P)
Quasi-projective subscheme X - Y of Projective Space of
dimension 2 over Rational Field, where X is defined by:
(no polynomials)
and Y is defined by:
x*y + x*z + y*z

defining_ideal()

Return the ideal that defines this scheme as a subscheme of its ambient space.

OUTPUT:

An ideal in the coordinate ring of the ambient space.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([x^2-y*z, x^3+z^3])
sage: S.defining_ideal()
Ideal (x^2 - y*z, x^3 + z^3) of Multivariate Polynomial Ring in x, y, z over Integer Ring

defining_polynomials()

Return the polynomials that define this scheme as a subscheme of its ambient space.

OUTPUT:

A tuple of polynomials in the coordinate ring of the ambient space.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: S = P.subscheme([x^2-y*z, x^3+z^3])
sage: S.defining_polynomials()
(x^2 - y*z, x^3 + z^3)

intersection(other)

Return the scheme-theoretic intersection of self and other in their common ambient space.

EXAMPLES:

sage: A.<x, y> = AffineSpace(2, ZZ)
sage: X = A.subscheme([x^2-y])
sage: Y = A.subscheme([y])
sage: X.intersection(Y)
Closed subscheme of Affine Space of dimension 2 over Integer Ring defined by:
x^2 - y,
y

irreducible_components()

Return the irreducible components of this algebraic scheme, as subschemes of the same ambient space.

OUTPUT:

an immutable sequence of irreducible subschemes of the ambient space of this scheme

The components are cached.

EXAMPLES:

We define what is clearly a union of four hypersurfaces in $$\P^4_{\QQ}$$ then find the irreducible components:

sage: PP.<x,y,z,w,v> = ProjectiveSpace(4,QQ)
sage: V = PP.subscheme( (x^2 - y^2 - z^2)*(w^5 -  2*v^2*z^3)* w * (v^3 - x^2*z) )
sage: V.irreducible_components()
[
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
w,
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
x^2 - y^2 - z^2,
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
x^2*z - v^3,
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
w^5 - 2*z^3*v^2
]


We verify that the irrelevant ideal isn’t accidently returned (see trac 6920):

sage: PP.<x,y,z,w> = ProjectiveSpace(3,QQ)
sage: f = x^3 + y^3 + z^3 + w^3
sage: R = f.parent()
sage: I = [f] + [f.derivative(zz) for zz in PP.gens()]
sage: V = PP.subscheme(I)
sage: V.irreducible_components()
[

]


The same polynomial as above defines a scheme with a nontrivial irreducible component in affine space (instead of the empty scheme as above):

sage: AA.<x,y,z,w> = AffineSpace(4,QQ)
sage: V = AA.subscheme(I)
sage: V.irreducible_components()
[
Closed subscheme of Affine Space of dimension 4 over Rational Field defined by:
w,
z,
y,
x
]

rational_points(F=None, bound=0)

Return the rational points on the algebraic subscheme.

EXAMPLES:

One can enumerate points up to a given bound on a projective scheme over the rationals:

sage: E = EllipticCurve('37a')
sage: E.rational_points(bound=8)
[(-1 : -1 : 1), (-1 : 0 : 1), (0 : -1 : 1), (0 : 0 : 1), (0 : 1 : 0), (1/4 : -5/8 : 1), (1/4 : -3/8 : 1), (1 : -1 : 1), (1 : 0 : 1), (2 : -3 : 1), (2 : 2 : 1)]


For a small finite field, the complete set of points can be enumerated.

sage: Etilde = E.base_extend(GF(3))
sage: Etilde.rational_points()
[(0 : 0 : 1), (0 : 1 : 0), (0 : 2 : 1), (1 : 0 : 1),
(1 : 2 : 1), (2 : 0 : 1), (2 : 2 : 1)]


The class of hyperelliptic curves does not (yet) support desingularization of the places at infinity into two points:

sage: FF = FiniteField(7)
sage: P.<x> = PolynomialRing(FiniteField(7))
sage: C = HyperellipticCurve(x^8+x+1)
sage: C.rational_points()
[(0 : 1 : 0), (0 : 1 : 1), (0 : 6 : 1), (2 : 0 : 1),
(4 : 0 : 1), (6 : 1 : 1), (6 : 6 : 1)]


TODO:

1. The above algorithms enumerate all projective points and test whether they lie on the scheme; Implement a more naive sieve at least for covers of the projective line.
2. Implement Stoll’s model in weighted projective space to resolve singularities and find two points (1 : 1 : 0) and (-1 : 1 : 0) at infinity.
reduce()

Return the corresponding reduced algebraic space associated to this scheme.

EXAMPLES: First we construct the union of a doubled and tripled line in the affine plane over $$\QQ$$

sage: A.<x,y> = AffineSpace(2, QQ)
sage: X = A.subscheme([(x-1)^2*(x-y)^3]); X
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^5 - 3*x^4*y + 3*x^3*y^2 - x^2*y^3 - 2*x^4 + 6*x^3*y
- 6*x^2*y^2 + 2*x*y^3 + x^3 - 3*x^2*y + 3*x*y^2 - y^3
sage: X.dimension()
1


Then we compute the corresponding reduced scheme:

sage: Y = X.reduce(); Y
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^2 - x*y - x + y


Finally, we verify that the reduced scheme $$Y$$ is the union of those two lines:

sage: L1 = A.subscheme([x-1]); L1
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x - 1
sage: L2 = A.subscheme([x-y]); L2
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x - y
sage: W = L1.union(L2); W             # taken in ambient space
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^2 - x*y - x + y
sage: Y == W
True

union(other)

Return the scheme-theoretic union of self and other in their common ambient space.

EXAMPLES: We construct the union of a line and a tripled-point on the line.

sage: A.<x,y> = AffineSpace(2, QQ)
sage: I = ideal([x,y])^3
sage: P = A.subscheme(I)
sage: L = A.subscheme([y-1])
sage: S = L.union(P); S
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
y^4 - y^3,
x*y^3 - x*y^2,
x^2*y^2 - x^2*y,
x^3*y - x^3
sage: S.dimension()
1
sage: S.reduce()
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
y^2 - y,
x*y - x


We can also use the notation “+” for the union:

sage: A.subscheme([x]) + A.subscheme([y^2 - (x^3+1)])
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^4 - x*y^2 + x


sage: loads(S.dumps()) == S
True

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme_affine(A, polynomials)

Construct an algebraic subscheme of affine space.

Warning

You should not create objects of this class directly. The preferred method to construct such subschemes is to use subscheme() method of affine space.

INPUT:

• A – ambient affine space
• polynomials – single polynomial, ideal or iterable of defining polynomials.

EXAMPLES:

sage: A3.<x, y, z> = AffineSpace(3, QQ)
sage: A3.subscheme([x^2-y*z])
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
x^2 - y*z


TESTS:

sage: from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme_affine
sage: AlgebraicScheme_subscheme_affine(A3, [x^2-y*z])
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
x^2 - y*z

dimension()

Return the dimension of the affine algebraic subscheme.

OUTPUT:

Integer.

EXAMPLES:

sage: A.<x,y> = AffineSpace(2, QQ)
sage: A.subscheme([]).dimension()
2
sage: A.subscheme([x]).dimension()
1
sage: A.subscheme([x^5]).dimension()
1
sage: A.subscheme([x^2 + y^2 - 1]).dimension()
1
sage: A.subscheme([x*(x-1), y*(y-1)]).dimension()
0


Something less obvious:

sage: A.<x,y,z,w> = AffineSpace(4, QQ)
sage: X = A.subscheme([x^2, x^2*y^2 + z^2, z^2 - w^2, 10*x^2 + w^2 - z^2])
sage: X
Closed subscheme of Affine Space of dimension 4 over Rational Field defined by:
x^2,
x^2*y^2 + z^2,
z^2 - w^2,
10*x^2 - z^2 + w^2
sage: X.dimension()
1

is_smooth(point=None)

Test whether the algebraic subscheme is smooth.

INPUT:

• point – A point or None (default). The point to test smoothness at.

OUTPUT:

Boolean. If no point was specified, returns whether the algebraic subscheme is smooth everywhere. Otherwise, smoothness at the specified point is tested.

EXAMPLES:

sage: A2.<x,y> = AffineSpace(2,QQ)
sage: cuspidal_curve = A2.subscheme([y^2-x^3])
sage: cuspidal_curve
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
-x^3 + y^2
sage: smooth_point = cuspidal_curve.point([1,1])
sage: smooth_point in cuspidal_curve
True
sage: singular_point = cuspidal_curve.point([0,0])
sage: singular_point in cuspidal_curve
True
sage: cuspidal_curve.is_smooth(smooth_point)
True
sage: cuspidal_curve.is_smooth(singular_point)
False
sage: cuspidal_curve.is_smooth()
False

projective_embedding(i=None, PP=None)

Returns a morphism from this affine scheme into an ambient projective space of the same dimension.

INPUT:

• i – integer (default: dimension of self = last coordinate) determines which projective embedding to compute. The embedding is that which has a 1 in the i-th coordinate, numbered from 0.

• PP – (default: None) ambient projective space, i.e., ambient space

of codomain of morphism; this is constructed if it is not given.

EXAMPLES:

sage: A.<x, y, z> = AffineSpace(3, ZZ)
sage: S = A.subscheme([x*y-z])
sage: S.projective_embedding()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 3 over Integer Ring defined by:
x*y - z
To:   Closed subscheme of Projective Space of dimension 3 over Integer Ring defined by:
x0*x1 - x2*x3
Defn: Defined on coordinates by sending (x, y, z) to
(x : y : z : 1)

sage: A.<x, y, z> = AffineSpace(3, ZZ)
sage: P = ProjectiveSpace(3,ZZ,'u')
sage: S = A.subscheme([x^2-y*z])
sage: S.projective_embedding(1,P)
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 3 over Integer
Ring defined by:
x^2 - y*z
To:   Closed subscheme of Projective Space of dimension 3 over Integer
Ring defined by:
u0^2 - u2*u3
Defn: Defined on coordinates by sending (x, y, z) to
(x : 1 : y : z)

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme_affine_toric(toric_variety, polynomials)

Construct an algebraic subscheme of an affine toric variety.

Warning

You should not create objects of this class directly. The preferred method to construct such subschemes is to use subscheme() method of toric varieties.

INPUT:

• toric_variety – ambient affine toric variety;
• polynomials – single polynomial, list, or ideal of defining polynomials in the coordinate ring of toric_variety.

OUTPUT:

TESTS:

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1xP1.inject_variables()
Defining s, t, x, y
sage: import sage.schemes.generic.algebraic_scheme as SCM
sage: X = SCM.AlgebraicScheme_subscheme_toric(
...         P1xP1, [x*s + y*t, x^3+y^3])
sage: X
Closed subscheme of 2-d CPR-Fano toric variety
covered by 4 affine patches defined by:
s*x + t*y,
x^3 + y^3


A better way to construct the same scheme as above:

sage: P1xP1.subscheme([x*s + y*t, x^3+y^3])
Closed subscheme of 2-d CPR-Fano toric variety
covered by 4 affine patches defined by:
s*x + t*y,
x^3 + y^3

dimension()

Return the dimension of self.

OUTPUT:

• integer.

EXAMPLES:

sage: P1xP1.<s0,s1,t0,t1> = toric_varieties.P1xP1()
sage: P1 = P1xP1.subscheme(s0-s1)
sage: P1.dimension()
1


A more complicated example where the ambient toric variety is not smooth:

sage: X.<x,y> = toric_varieties.A2_Z2()
sage: X.is_smooth()
False
sage: Y = X.subscheme([x*y, x^2])
sage: Y
Closed subscheme of 2-d affine toric variety defined by:
x*y,
x^2
sage: Y.dimension()
1

is_smooth(point=None)

Test whether the algebraic subscheme is smooth.

INPUT:

• point – A point or None (default). The point to test smoothness at.

OUTPUT:

Boolean. If no point was specified, returns whether the algebraic subscheme is smooth everywhere. Otherwise, smoothness at the specified point is tested.

EXAMPLES:

sage: A2.<x,y> = toric_varieties.A2()
sage: cuspidal_curve = A2.subscheme([y^2-x^3])
sage: cuspidal_curve
Closed subscheme of 2-d affine toric variety defined by:
-x^3 + y^2
sage: cuspidal_curve.is_smooth([1,1])
True
sage: cuspidal_curve.is_smooth([0,0])
False
sage: cuspidal_curve.is_smooth()
False
sage: circle = A2.subscheme(x^2+y^2-1)
sage: circle.is_smooth([1,0])
True
sage: circle.is_smooth()
True


A more complicated example where the ambient toric variety is not smooth:

sage: X.<x,y> = toric_varieties.A2_Z2()    # 2-d affine space mod Z/2
sage: X.is_smooth()
False
sage: Y = X.subscheme([x*y, x^2])   # (twice the x=0 curve) mod Z/2
sage: Y
Closed subscheme of 2-d affine toric variety defined by:
x*y,
x^2
sage: Y.dimension()   # Y is a Weil divisor but not Cartier
1
sage: Y.is_smooth()
True
sage: Y.is_smooth([0,0])
True

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme_product_projective(A, polynomials)

See AlgebraicScheme_subscheme for documentation.

TESTS:

sage: from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme
sage: P.<x, y, z> = ProjectiveSpace(2, QQ)
sage: P.subscheme([x^2-y*z])
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2 - y*z
sage: AlgebraicScheme_subscheme(P, [x^2-y*z])
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2 - y*z

affine_patch(I, return_embedding=False)

Return the $$I^{th}$$ affine patch of this projective scheme where ‘I’ is a multi-index.

INPUT:

• I – a list or tuple of positive integers
• return_embedding – Boolean, if true the projective embedding is also returned

OUTPUT:

• An affine algebraic scheme
• An embedding into a product of projective space (optional)

EXAMPLES:

sage: PP.<x,y,z,w,u,v> = ProductProjectiveSpaces([3,1],QQ)
sage: W = PP.subscheme([y^2*z-x^3,z^2-w^2,u^3-v^3])
sage: W.affine_patch([0,1],True)
(Closed subscheme of Affine Space of dimension 4 over Rational Field defined by:
x0^2*x1 - 1,
x1^2 - x2^2,
x3^3 - 1, Scheme morphism:
From: Closed subscheme of Affine Space of dimension 4 over Rational Field defined by:
x0^2*x1 - 1,
x1^2 - x2^2,
x3^3 - 1
To:   Closed subscheme of Product of projective spaces P^3 x P^1 over Rational Field defined by:
-x^3 + y^2*z,
z^2 - w^2,
u^3 - v^3
Defn: Defined on coordinates by sending (x0, x1, x2, x3) to
(1 : x0 : x1 : x2 , x3 : 1))

dimension()

Return the dimension of the algebraic subscheme.

OUTPUT:

Integer.

EXAMPLES:

sage: X.<x,y,z,w,u,v> = ProductProjectiveSpaces([2,2],QQ)
sage: L = (-w - v)*x + (-w*y - u*z)
sage: Q = (-u*w - v^2)*x^2 + ((-w^2 - u*w + (-u*v - u^2))*y + (-w^2 - u*v)*z)*x +             ((-w^2 - u*w - u^2)*y^2 + (-u*w - v^2)*z*y + (-w^2 + (-v - u)*w)*z^2)
sage: W = X.subscheme([L,Q])
sage: W.dimension()
2

is_smooth(point=None)

Test whether the algebraic subscheme is smooth.

EXAMPLES:

sage: X.<x,y,z,w,u,v> = ProductProjectiveSpaces([2,2],QQ)
sage: L = (-w - v)*x + (-w*y - u*z)
sage: Q = (-u*w - v^2)*x^2 + ((-w^2 - u*w + (-u*v - u^2))*y + (-w^2 - u*v)*z)*x + \
((-w^2 - u*w - u^2)*y^2 + (-u*w - v^2)*z*y + (-w^2 + (-v - u)*w)*z^2)
sage: W = X.subscheme([L,Q])
sage: W.is_smooth()
Traceback (most recent call last):
...
NotImplementedError: Not Implemented

segre_embedding(PP=None)

Return the Segre embedding of self into the appropriate projective space.

INPUT:

• PP – (default: None) ambient image projective space; this is constructed if it is not given.

OUTPUT:

Hom from self to the appropriate subscheme of projective space

Todo

products with more than two components

EXAMPLES:

sage: X.<x,y,z,w,u,v> = ProductProjectiveSpaces([2,2],QQ)
sage: P = ProjectiveSpace(QQ,8,'t')
sage: L = (-w - v)*x + (-w*y - u*z)
sage: Q = (-u*w - v^2)*x^2 + ((-w^2 - u*w + (-u*v - u^2))*y + (-w^2 - u*v)*z)*x + \
((-w^2 - u*w - u^2)*y^2 + (-u*w - v^2)*z*y + (-w^2 + (-v - u)*w)*z^2)
sage: W = X.subscheme([L,Q])
sage: phi = W.segre_embedding(P)
sage: phi.codomain().ambient_space() == P
True

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme_projective(A, polynomials)

Construct an algebraic subscheme of projective space.

Warning

You should not create objects of this class directly. The preferred method to construct such subschemes is to use subscheme() method of projective space.

INPUT:

• A – ambient projective space.
• polynomials – single polynomial, ideal or iterable of defining homogeneous polynomials.

EXAMPLES:

sage: P.<x, y, z> = ProjectiveSpace(2, QQ)
sage: P.subscheme([x^2-y*z])
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2 - y*z


TESTS:

sage: from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme_projective
sage: AlgebraicScheme_subscheme_projective(P, [x^2-y*z])
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x^2 - y*z

affine_patch(i, AA=None)

Return the $$i^{th}$$ affine patch of this projective scheme. This is the intersection with this $$i^{th}$$ affine patch of its ambient space.

INPUT:

• i – integer between 0 and dimension of self, inclusive.

• AA – (default: None) ambient affine space, this is constructed

if it is not given.

OUTPUT:

An affine algebraic scheme with fixed embedding_morphism() equal to the default projective_embedding() map.

EXAMPLES:

sage: PP = ProjectiveSpace(2, QQ, names='X,Y,Z')
sage: X,Y,Z = PP.gens()
sage: C = PP.subscheme(X^3*Y + Y^3*Z + Z^3*X)
sage: U = C.affine_patch(0)
sage: U
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x0^3*x1 + x1^3 + x0
sage: U.embedding_morphism()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x0^3*x1 + x1^3 + x0
To:   Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
X^3*Y + Y^3*Z + X*Z^3
Defn: Defined on coordinates by sending (x0, x1) to
(1 : x0 : x1)
sage: U.projective_embedding() is U.embedding_morphism()
True

sage: A.<x,y,z> = AffineSpace(QQ,3)
sage: X = A.subscheme([x-y*z])
sage: Y = X.projective_embedding(1).codomain()
sage: Y.affine_patch(1,A).ambient_space() == A
True

sage: P.<u,v,w> = ProjectiveSpace(2,ZZ)
sage: S = P.subscheme([u^2-v*w])
sage: A.<x, y> = AffineSpace(2, ZZ)
sage: S.affine_patch(1, A)
Closed subscheme of Affine Space of dimension 2 over Integer Ring
defined by:
x^2 - y

dimension()

Return the dimension of the projective algebraic subscheme.

OUTPUT:

Integer.

EXAMPLES:

sage: P2.<x,y,z> = ProjectiveSpace(2, QQ)
sage: P2.subscheme([]).dimension()
2
sage: P2.subscheme([x]).dimension()
1
sage: P2.subscheme([x^5]).dimension()
1
sage: P2.subscheme([x^2 + y^2 - z^2]).dimension()
1
sage: P2.subscheme([x*(x-z), y*(y-z)]).dimension()
0


Something less obvious:

sage: P3.<x,y,z,w,t> = ProjectiveSpace(4, QQ)
sage: X = P3.subscheme([x^2, x^2*y^2 + z^2*t^2, z^2 - w^2, 10*x^2 + w^2 - z^2])
sage: X
Closed subscheme of Projective Space of dimension 4 over Rational Field defined by:
x^2,
x^2*y^2 + z^2*t^2,
z^2 - w^2,
10*x^2 - z^2 + w^2
sage: X.dimension()
1

is_smooth(point=None)

Test whether the algebraic subscheme is smooth.

INPUT:

• point – A point or None (default). The point to test smoothness at.

OUTPUT:

Boolean. If no point was specified, returns whether the algebraic subscheme is smooth everywhere. Otherwise, smoothness at the specified point is tested.

EXAMPLES:

sage: P2.<x,y,z> = ProjectiveSpace(2,QQ)
sage: cuspidal_curve = P2.subscheme([y^2*z-x^3])
sage: cuspidal_curve
Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
-x^3 + y^2*z
sage: cuspidal_curve.is_smooth([1,1,1])
True
sage: cuspidal_curve.is_smooth([0,0,1])
False
sage: cuspidal_curve.is_smooth()
False
sage: P2.subscheme([y^2*z-x^3+z^3+1/10*x*y*z]).is_smooth()
True


TESTS:

sage: H = P2.subscheme(x)
sage: H.is_smooth()  # one of the few cases where the cone over the subvariety is smooth
True

neighborhood(point)

Return an affine algebraic subscheme isomorphic to a neighborhood of the point.

INPUT:

• point – a point of the projective subscheme.

OUTPUT:

An affine algebraic scheme (polynomial equations in affine space) result such that

EXAMPLES:

sage: P.<x,y,z>= ProjectiveSpace(QQ,2)
sage: S = P.subscheme(x+2*y+3*z)
sage: s = S.point([0,-3,2]); s
(0 : -3/2 : 1)
sage: patch = S.neighborhood(s); patch
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x0 + 3*x1
sage: patch.embedding_morphism()
Scheme morphism:
From: Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x0 + 3*x1
To:   Closed subscheme of Projective Space of dimension 2 over Rational Field defined by:
x + 2*y + 3*z
Defn: Defined on coordinates by sending (x0, x1) to
(x0 : -3/2 : x1 + 1)
sage: patch.embedding_center()
(0, 0)
sage: patch.embedding_morphism()([0,0])
(0 : -3/2 : 1)
sage: patch.embedding_morphism()(patch.embedding_center())
(0 : -3/2 : 1)

class sage.schemes.generic.algebraic_scheme.AlgebraicScheme_subscheme_toric(toric_variety, polynomials)

Construct an algebraic subscheme of a toric variety.

Warning

You should not create objects of this class directly. The preferred method to construct such subschemes is to use subscheme() method of toric varieties.

INPUT:

• toric_variety – ambient toric variety;
• polynomials – single polynomial, list, or ideal of defining polynomials in the coordinate ring of toric_variety.

OUTPUT:

TESTS:

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1xP1.inject_variables()
Defining s, t, x, y
sage: import sage.schemes.generic.algebraic_scheme as SCM
sage: X = SCM.AlgebraicScheme_subscheme_toric(
...         P1xP1, [x*s + y*t, x^3+y^3])
sage: X
Closed subscheme of 2-d CPR-Fano toric variety
covered by 4 affine patches defined by:
s*x + t*y,
x^3 + y^3


A better way to construct the same scheme as above:

sage: P1xP1.subscheme([x*s + y*t, x^3+y^3])
Closed subscheme of 2-d CPR-Fano toric variety
covered by 4 affine patches defined by:
s*x + t*y,
x^3 + y^3

affine_algebraic_patch(cone=None, names=None)

Return the affine patch corresponding to cone as an affine algebraic scheme.

INPUT:

• cone – a Cone $$\sigma$$ of the fan. It can be omitted for an affine toric variety, in which case the single generating cone is used.

OUTPUT:

An affine algebraic subscheme corresponding to the patch $$\mathop{Spec}(\sigma^\vee \cap M)$$ associated to the cone $$\sigma$$.

REFERENCES:

David A. Cox, “The Homogeneous Coordinate Ring of a Toric Variety”, Lemma 2.2. http://www.arxiv.org/abs/alg-geom/9210008v2

EXAMPLES:

sage: P2.<x,y,z> = toric_varieties.P2()
sage: cone = P2.fan().generating_cone(0)
sage: V = P2.subscheme(x^3+y^3+z^3)
sage: V.affine_algebraic_patch(cone)
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
z0^3 + z1^3 + 1

sage: cone = Cone([(0,1),(2,1)])
sage: A2Z2.<x,y> = AffineToricVariety(cone)
sage: A2Z2.affine_algebraic_patch()
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
-z0*z1 + z2^2
sage: V = A2Z2.subscheme(x^2+y^2-1)
sage: patch = V.affine_algebraic_patch();  patch
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
-z0*z1 + z2^2,
z0 + z1 - 1
sage: nbhd_patch = V.neighborhood([1,0]).affine_algebraic_patch();  nbhd_patch
Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
-z0*z1 + z2^2,
z0 + z1 - 1
sage: nbhd_patch.embedding_center()
(0, 1, 0)


Here we got two defining equations. The first one describes the singularity of the ambient space and the second is the pull-back of $$x^2+y^2-1$$

sage: lp = LatticePolytope([(1,0,0),(1,1,0),(1,1,1),(1,0,1),(-2,-1,-1)],
...                        lattice=ToricLattice(3))
sage: X.<x,y,u,v,t> = CPRFanoToricVariety(Delta_polar=lp)
sage: Y = X.subscheme(x*v+y*u+t)
sage: cone = Cone([(1,0,0),(1,1,0),(1,1,1),(1,0,1)])
sage: Y.affine_algebraic_patch(cone)
Closed subscheme of Affine Space of dimension 4 over Rational Field defined by:
z0*z2 - z1*z3,
z1 + z3 + 1

affine_patch(i)

Return the i-th affine patch of self as an affine toric algebraic scheme.

INPUT:

• i – integer, index of a generating cone of the fan of the ambient space of self.

OUTPUT:

The result is cached, so the i-th patch is always the same object in memory.

EXAMPLES:

sage: P1xP1 = toric_varieties.P1xP1()
sage: patch1 = P1xP1.affine_patch(1)
sage: patch1.embedding_morphism()
Scheme morphism:
From: 2-d affine toric variety
To:   2-d CPR-Fano toric variety covered by 4 affine patches
Defn: Defined on coordinates by sending [t : x] to
[1 : t : x : 1]
sage: P1xP1.inject_variables()
Defining s, t, x, y
sage: P1 = P1xP1.subscheme(x-y)
sage: subpatch = P1.affine_patch(1)
sage: subpatch
Closed subscheme of 2-d affine toric variety defined by:
x - 1

dimension()

Return the dimension of self.

OUTPUT:

Integer. If self is empty, $$-1$$ is returned.

EXAMPLES:

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1xP1.inject_variables()
Defining s, t, x, y
sage: P1 = P1xP1.subscheme(s-t)
sage: P1.dimension()
1
sage: P1xP1.subscheme([s-t, (s-t)^2]).dimension()
1
sage: P1xP1.subscheme([s, t]).dimension()
-1

fan()

Return the fan of the ambient space.

OUTPUT:

A fan.

EXAMPLES:

sage: P2.<x,y,z> = toric_varieties.P(2)
sage: E = P2.subscheme([x^2+y^2+z^2])
sage: E.fan()
Rational polyhedral fan in 2-d lattice N

is_smooth(point=None)

Test whether the algebraic subscheme is smooth.

INPUT:

• point – A point or None (default). The point to test smoothness at.

OUTPUT:

Boolean. If no point was specified, returns whether the algebraic subscheme is smooth everywhere. Otherwise, smoothness at the specified point is tested.

EXAMPLES:

sage: P2.<x,y,z> = toric_varieties.P2()
sage: cuspidal_curve = P2.subscheme([y^2*z-x^3])
sage: cuspidal_curve
Closed subscheme of 2-d CPR-Fano toric variety covered by 3 affine patches defined by:
-x^3 + y^2*z
sage: cuspidal_curve.is_smooth([1,1,1])
True
sage: cuspidal_curve.is_smooth([0,0,1])
False
sage: cuspidal_curve.is_smooth()
False


Any sufficiently generic cubic hypersurface is smooth:

sage: P2.subscheme([y^2*z-x^3+z^3+1/10*x*y*z]).is_smooth()
True


A more complicated example:

sage: dP6.<x0,x1,x2,x3,x4,x5> = toric_varieties.dP6()
sage: disjointP1s = dP6.subscheme(x0*x3)
sage: disjointP1s.is_smooth()
True
sage: intersectingP1s = dP6.subscheme(x0*x1)
sage: intersectingP1s.is_smooth()
False


A smooth hypersurface in a compact singular toric variety:

sage: lp = LatticePolytope([(1,0,0),(1,1,0),(1,1,1),(1,0,1),(-2,-1,-1)],
...                        lattice=ToricLattice(3))
sage: X.<x,y,u,v,t> = CPRFanoToricVariety(Delta_polar=lp)
sage: Y = X.subscheme(x*v+y*u+t)
sage: cone = Cone([(1,0,0),(1,1,0),(1,1,1),(1,0,1)])
sage: Y.is_smooth()
True

neighborhood(point)

Return an toric algebraic scheme isomorphic to neighborhood of the point.

INPUT:

• point – a point of the toric algebraic scheme.

OUTPUT

An affine toric algebraic scheme (polynomial equations in an affine toric variety) with fixed embedding_morphism() and embedding_center().

EXAMPLES:

sage: P.<x,y,z>= toric_varieties.P2()
sage: S = P.subscheme(x+2*y+3*z)
sage: s = S.point([0,-3,2]); s
[0 : -3 : 2]
sage: patch = S.neighborhood(s); patch
Closed subscheme of 2-d affine toric variety defined by:
x + 2*y + 6
sage: patch.embedding_morphism()
Scheme morphism:
From: Closed subscheme of 2-d affine toric variety defined by:
x + 2*y + 6
To:   Closed subscheme of 2-d CPR-Fano toric variety covered by 3 affine patches defined by:
x + 2*y + 3*z
Defn: Defined on coordinates by sending [x : y] to
[-2*y - 6 : y : 2]
sage: patch.embedding_center()
[0 : -3]
sage: patch.embedding_morphism()(patch.embedding_center())
[0 : -3 : 2]


A more complicated example:

sage: dP6.<x0,x1,x2,x3,x4,x5> = toric_varieties.dP6()
sage: twoP1 = dP6.subscheme(x0*x3)
sage: patch = twoP1.neighborhood([0,1,2, 3,4,5]); patch
Closed subscheme of 2-d affine toric variety defined by:
3*x0
sage: patch.embedding_morphism()
Scheme morphism:
From: Closed subscheme of 2-d affine toric variety defined by:
3*x0
To:   Closed subscheme of 2-d CPR-Fano toric variety covered by 6 affine patches defined by:
x0*x3
Defn: Defined on coordinates by sending [x0 : x1] to
[0 : x1 : 2 : 3 : 4 : 5]
sage: patch.embedding_center()
[0 : 1]
sage: patch.embedding_morphism()(patch.embedding_center())
[0 : 1 : 2 : 3 : 4 : 5]

sage.schemes.generic.algebraic_scheme.is_AlgebraicScheme(x)

Test whether x is an algebraic scheme.

INPUT:

• x – anything.

OUTPUT:

Boolean. Whether x is an an algebraic scheme, that is, a subscheme of an ambient space over a ring defined by polynomial equations.

EXAMPLES:

sage: A2 = AffineSpace(2, QQ, 'x, y')
sage: A2.coordinate_ring().inject_variables()
Defining x, y
sage: V = A2.subscheme([x^2+y^2]); V
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^2 + y^2
sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme
sage: is_AlgebraicScheme(V)
True


Affine space is itself not an algebraic scheme, though the closed subscheme defined by no equations is:

sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme
sage: is_AlgebraicScheme(AffineSpace(10, QQ))
False
sage: V = AffineSpace(10, QQ).subscheme([]); V
Closed subscheme of Affine Space of dimension 10 over Rational Field defined by:
(no polynomials)
sage: is_AlgebraicScheme(V)
True


We create a more complicated closed subscheme:

sage: A, x = AffineSpace(10, QQ).objgens()
sage: X = A.subscheme([sum(x)]); X
Closed subscheme of Affine Space of dimension 10 over Rational Field defined by:
x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
sage: is_AlgebraicScheme(X)
True

sage: is_AlgebraicScheme(QQ)
False
sage: S = Spec(QQ)
sage: is_AlgebraicScheme(S)
False


Ambient Spaces

#### Next topic

Hypersurfaces in affine and projective space