36.7 Affine $ n$ space over a ring

Module: sage.schemes.generic.affine_space

Affine $ n$ space over a ring.

Module-level Functions

AffineSpace( n, [R=None], [names=x])

Return affine space of dimension $ n$ over the ring $ R$ .

The dimension and ring can be given in either order.

sage: AffineSpace(3, QQ, 'x')
Affine Space of dimension 3 over Rational Field
sage: AffineSpace(5, QQ, 'x')
Affine Space of dimension 5 over Rational Field
sage: A = AffineSpace(2, QQ, names='XY'); A
Affine Space of dimension 2 over Rational Field
sage: A.coordinate_ring()
Multivariate Polynomial Ring in X, Y over Rational Field

Use the divide operator for base extension.

sage: AffineSpace(5, names='x')/GF(17)
Affine Space of dimension 5 over Finite Field of size 17

The default base ring is $ \mathbf{Z}$ .

sage: AffineSpace(5, names='x')
Affine Space of dimension 5 over Integer Ring

There is also an affine space associated each polynomial ring.

sage: R = GF(7)['x,y,z']
sage: A = AffineSpace(R); A
Affine Space of dimension 3 over Finite Field of size 7
sage: A.coordinate_ring() is R
True

is_AffineSpace( x)

Returns True if x is an affine space, i.e., an ambient space $ \mathbf{A}^n_R$ , where $ R$ is a ring and $ n \geq 0$ is an integer.

sage: is_AffineSpace(AffineSpace(5, names='x'))
True
sage: is_AffineSpace(AffineSpace(5, GF(9,'alpha'), names='x'))
True
sage: is_AffineSpace(Spec(ZZ))
False

Class: AffineSpace_generic

class AffineSpace_generic
Affine space of dimension $ n$ over the ring $ R$ .

sage: X.<x,y,z> = AffineSpace(3, QQ)
sage: X.base_scheme()
Spectrum of Rational Field
sage: X.base_ring()
Rational Field
sage: X.structure_morphism ()
Scheme morphism:
  From: Affine Space of dimension 3 over Rational Field
  To:   Spectrum of Rational Field
  Defn: Structure map

Loading and saving:

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

We create several other examples of affine spaces.

sage: AffineSpace(5, PolynomialRing(QQ, 'z'), 'Z')
Affine Space of dimension 5 over Univariate Polynomial Ring in z over
Rational Field

sage: AffineSpace(RealField(), 3, 'Z')
Affine Space of dimension 3 over Real Field with 53 bits of precision

sage: AffineSpace(Qp(7), 2, 'x')
Affine Space of dimension 2 over 7-adic Field with capped relative
precision 20

Even 0-dimensional affine spaces are supported.

sage: AffineSpace(0)
Affine Space of dimension 0 over Integer Ring
AffineSpace_generic( self, n, R, names)

Functions: coordinate_ring,$ \,$ ngens,$ \,$ projective_embedding,$ \,$ rational_points,$ \,$ subscheme,$ \,$ subscheme_complement

coordinate_ring( self)

Return the coordinate ring of this scheme, if defined. Otherwise raise a ValueError.

sage: R = AffineSpace(2, GF(9,'alpha'), 'z').coordinate_ring(); R
Multivariate Polynomial Ring in z0, z1 over Finite Field in alpha of size
3^2
sage: AffineSpace(3, R, 'x').coordinate_ring()
Multivariate Polynomial Ring in x0, x1, x2 over Multivariate Polynomial
Ring in z0, z1 over Finite Field in alpha of size 3^2

projective_embedding( self, [i=None], [PP=None])

Returns a morphism from this space 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., codomain of morphism; this is constructed if it is not given.

sage: AA = AffineSpace(2, QQ, 'x')
sage: pi = AA.projective_embedding(0); pi
Scheme morphism:
  From: Affine Space of dimension 2 over Rational Field
  To:   Projective Space of dimension 2 over Rational Field
  Defn: Defined on coordinates by sending (x0, x1) to
        (1 : x0 : x1)
sage: z = AA(3,4)
sage: pi(z)
(1/4 : 3/4 : 1)
sage: pi(AA(0,2))
(1/2 : 0 : 1)
sage: pi = AA.projective_embedding(1); pi
Scheme morphism:
  From: Affine Space of dimension 2 over Rational Field
  To:   Projective Space of dimension 2 over Rational Field
  Defn: Defined on coordinates by sending (x0, x1) to
        (x0 : 1 : x1)
sage: pi(z)
(3/4 : 1/4 : 1)
sage: pi = AA.projective_embedding(2)
sage: pi(z)
(3 : 4 : 1)

subscheme( self, X)

Return the closed subscheme defined by X.

Input:

X
- a list or tuple of equations

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

sage: X.defining_polynomials ()
(x, y^2, x*y^2)
sage: I = X.defining_ideal(); I
Ideal (x, y^2, x*y^2) of Multivariate Polynomial Ring in x, y over Rational
Field
sage: I.groebner_basis()
[x, y^2]
sage: X.dimension()
0
sage: X.base_ring()
Rational Field
sage: X.base_scheme()
Spectrum of Rational Field
sage: X.structure_morphism()
Scheme morphism:
  From: Closed subscheme of Affine Space of dimension 2 over Rational Field
defined by:
  x
  y^2
  x*y^2
  To:   Spectrum of Rational Field
  Defn: Structure map
sage: X.dimension()
0

Special Functions: __cmp__,$ \,$ __init__,$ \,$ __iter__,$ \,$ __pow__,$ \,$ _constructor,$ \,$ _homset_class,$ \,$ _latex_,$ \,$ _latex_generic_point,$ \,$ _point_class,$ \,$ _point_morphism_class,$ \,$ _repr_,$ \,$ _repr_generic_point

__cmp__( self, right)

sage: AffineSpace(QQ, 3, 'a') == AffineSpace(ZZ, 3, 'a')
False
sage: AffineSpace(ZZ,1, 'a') == AffineSpace(ZZ, 0, 'a')
False
sage: loads(AffineSpace(ZZ, 1, 'x').dumps()) == AffineSpace(ZZ, 1, 'x')
True

__iter__( self)

Return iterator over the elements of this affine space when defined over a finite field.

sage: FF = FiniteField(3)
sage: AA = AffineSpace(FF, 0)
sage: [ x for x in AA ]
[()]
sage: AA = AffineSpace(FF, 1, 'Z')
sage: [ x for x in AA ]
[(0), (1), (2)]
sage: AA.<z,w> = AffineSpace(FF, 2)
sage: [ x for x in AA ]
[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]

Author: David Kohel (kohel@maths.usyd.edu.au)

__pow__( self, m)

sage: A = AffineSpace(1, QQ, 'x')
sage: A^5
Affine Space of dimension 5 over Rational Field

_latex_( self)

sage: print latex(AffineSpace(1, ZZ, 'x'))
\mathbf{A}_{\mathbf{Z}}^1

See About this document... for information on suggesting changes.