# Spectrum of a ring as affine scheme.¶

class sage.schemes.generic.spec.Spec(R, S=None)

The spectrum of a commutative ring, as a scheme.

Note

Calling Spec(R) twice produces two distinct (but equal) schemes, which is important for gluing to construct more general schemes.

INPUT:

• R – a commutative ring.
• S – a commutative ring (optional, default:$$\ZZ$$). The base ring.

EXAMPLES:

sage: Spec(QQ)
Spectrum of Rational Field
sage: Spec(PolynomialRing(QQ, 'x'))
Spectrum of Univariate Polynomial Ring in x over Rational Field
sage: Spec(PolynomialRing(QQ, 'x', 3))
Spectrum of Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
sage: X = Spec(PolynomialRing(GF(49,'a'), 3, 'x')); X
Spectrum of Multivariate Polynomial Ring in x0, x1, x2 over Finite Field in a of size 7^2
sage: TestSuite(X).run(skip = ["_test_an_element", "_test_elements",
...                            "_test_some_elements"])

sage: A = Spec(ZZ); B = Spec(ZZ)
sage: A is B
False
sage: A == B
True


A TypeError is raised if the input is not a commutative ring:

sage: Spec(5)
Traceback (most recent call last):
...
TypeError: R (=5) must be a commutative ring
sage: Spec(FreeAlgebra(QQ,2, 'x'))
Traceback (most recent call last):
...
TypeError: R (=Free Algebra on 2 generators (x0, x1) over
Rational Field) must be a commutative ring


TESTS:

sage: X = Spec(ZZ)
sage: X
Spectrum of Integer Ring
sage: X.base_scheme()
Spectrum of Integer Ring
sage: X.base_ring()
Integer Ring
sage: X.dimension()
1
sage: Spec(QQ,QQ).base_scheme()
Spectrum of Rational Field
sage: Spec(RDF,QQ).base_scheme()
Spectrum of Rational Field

base_extend(R)

Extend the base ring/scheme.

INPUT:

• R – an affine scheme or a commutative ring.

EXAMPLES:

sage: Spec_ZZ = Spec(ZZ);  Spec_ZZ
Spectrum of Integer Ring
sage: Spec_ZZ.base_extend(QQ)
Spectrum of Rational Field

coordinate_ring()

Return the underlying ring of this scheme.

OUTPUT:

A commutative ring.

EXAMPLES:

sage: Spec(QQ).coordinate_ring()
Rational Field
sage: Spec(PolynomialRing(QQ, 3, 'x')).coordinate_ring()
Multivariate Polynomial Ring in x0, x1, x2 over Rational Field

dimension()

Return the absolute dimension of this scheme.

OUTPUT:

Integer.

EXAMPLES:

sage: S = Spec(ZZ)
sage: S.dimension_absolute()
1
sage: S.dimension()
1

dimension_absolute()

Return the absolute dimension of this scheme.

OUTPUT:

Integer.

EXAMPLES:

sage: S = Spec(ZZ)
sage: S.dimension_absolute()
1
sage: S.dimension()
1

dimension_relative()

Return the relative dimension of this scheme over its base.

OUTPUT:

Integer.

EXAMPLES:

sage: S = Spec(ZZ)
sage: S.dimension_relative()
0

is_noetherian()

Test whether self is Noetherian.

OUTPUT:

Boolean. Return True if this scheme is Noetherian.

EXAMPLES:

sage: Spec(ZZ).is_noetherian()
True

sage.schemes.generic.spec.is_Spec(X)

Test whether X is a Spec.

INPUT:

• X – anything.

OUTPUT:

Boolean.

EXAMPLES:

sage: from sage.schemes.generic.spec import is_Spec
sage: is_Spec(QQ^3)
False
sage: X = Spec(QQ); X
Spectrum of Rational Field
sage: is_Spec(X)
True


Schemes

#### Next topic

Scheme obtained by gluing two other schemes