# Affine variety

In algebraic geometry, an affine variety or affine algebraic variety is a certain kind of algebraic variety that can be described as a subset of an affine space.
More formally, an affine algebraic set is the set of the common zeros over an algebraically closed field k of some family of polynomials in the polynomial ring $k[x_{1},\ldots ,x_{n}].$ An affine variety is an affine algebraic set which is not the union of two smaller algebraic sets; algebraically, this means that (the radical of) the ideal generated by the defining polynomials is prime. One-dimensional affine varieties are called affine algebraic curves, while two-dimensional ones are affine algebraic surfaces.
Some texts use the term variety for any algebraic set, and irreducible variety an algebraic set whose defining ideal is prime (affine variety in the above sense).
In some contexts (see, for example, Hilbert's Nullstellensatz), it is useful to distinguish the field k in which the coefficients are considered, from the algebraically closed field K (containing k) over which the common zeros are considered (that is, the points of the affine algebraic set are in K$^n$). In this case, the variety is said defined over k, and the points of the variety that belong to k$^n$ are said k-rational or rational over k. In the common case where k is the field of real numbers, a k-rational point is called a real point. When the field k is not specified, a rational point is a point that is rational over the rational numbers. For example, Fermat's Last Theorem asserts that the affine algebraic variety (it is a curve) defined by x$^n$ + y$^n$ − 1 = 0 has no rational points for any integer n greater than two.

## Introduction

An affine algebraic set is the set of solutions in an algebraically closed field k of a system of polynomial equations with coefficients in k. More precisely, if $f_{1},\ldots ,f_{m}$ are polynomials with coefficients in k, they define an affine algebraic set
    $V(f_{1},\ldots ,f_{m})=\left\{(a_{1},\ldots ,a_{n})\in k^{n}\;|\;f_{1}(a_{1},\ldots ,a_{n})=\ldots =f_{m}(a_{1},\ldots ,a_{n})=0\right\}.$
An affine (algebraic) variety is an affine algebraic set that is not the union of two proper affine algebraic subsets. Such an affine algebraic set is often said to be irreducible.
If X is an affine algebraic set, and I is the ideal of all polynomials that are zero on X, then the quotient ring $R=k[x_{1},\ldots ,x_{n}]/I$ is called the coordinate ring of X. If X is an affine variety, then I is prime, so the coordinate ring is an integral domain. The elements of the coordinate ring R are also called the regular functions or the polynomial functions on the variety. They form the ring of regular functions on the variety, or, simply, the ring of the variety; in more technical terms (see § Structure sheaf), it is the space of global sections of the structure sheaf of X.
The dimension of a variety is an integer associated to every variety, and even to every algebraic set, whose importance relies on the large number of its equivalent definitions (see Dimension of an algebraic variety).

## Examples

* The complement of a hypersurface in an affine variety X (that is X \ { f = 0 } for some polynomial f) is affine. Its defining equations are obtained by saturating by f the defining ideal of X. The coordinate ring is thus the localization $k[X][f^{-1}]$. For instance, for X = k$^n$ and f ∈ k[x$_1$,..., x$_n$], k$^n$ \ { f = 0 } is isomorphic to the hypersurface V(1 − x$_{n+1}$f) in k$^{n+1}$.
* In particular, $k-0$ (the affine line with the origin removed) is affine, isomorphic to the curve $V(1-xy)$ in $k^{2}$ (see Algebraic group § Examples).
* On the other hand, $k^{2}-0$ (the affine plane with the origin removed) is not an affine variety (compare this to Hartogs' extension theorem in complex analysis). See Spectrum of a ring § Non-affine examples.
* The subvarieties of codimension one in the affine space $k^{n}$ are exactly the hypersurfaces, that is the varieties defined by a single polynomial.
* The normalization of an irreducible affine variety is affine; the coordinate ring of the normalization is the integral closure of the coordinate ring of the variety. (Similarly, the normalization of a projective variety is a projective variety.)

## Rational points

For an affine variety $V\subseteq K^{n}$ over an algebraically closed field K, and a subfield k of K, a k-rational point of V is a point $p\in V\cap k^{n}.$ That is, a point of V whose coordinates are elements of k. The collection of k-rational points of an affine variety V is often denoted $V(k).$ Often, if the base field is the complex numbers C, points that are R-rational (where R is the real numbers) are called real points of the variety, and Q-rational points (Q the rational numbers) are often simply called rational points.
For instance, (1, 0) is a Q-rational and an R-rational point of the variety $V=V(x^{2}+y^{2}-1)\subseteq \mathbf {C} ^{2},$ as it is in V and all its coordinates are integers. The point (√2/2, √2/2) is a real point of V that is not Q-rational, and $(i,{\sqrt {2}})$ is a point of V that is not R-rational. This variety is called a circle, because the set of its R-rational points is the unit circle. It has infinitely many Q-rational points that are the points
    $\left({\frac {1-t^{2}}{1+t^{2}}},{\frac {2t}{1+t^{2}}}\right)$
where t is a rational number.
The circle $V(x^{2}+y^{2}-3)\subseteq \mathbf {C} ^{2}$ is an example of an algebraic curve of degree two that has no Q-rational point. This can be deduced from the fact that, modulo 4, the sum of two squares cannot be 3.
It can be proved that an algebraic curve of degree two with a Q-rational point has infinitely many other Q-rational points; each such point is the second intersection point of the curve and a line with a rational slope passing through the rational point.
The complex variety $V(x^{2}+y^{2}+1)\subseteq \mathbf {C} ^{2}$ has no R-rational points, but has many complex points.
If V is an affine variety in C$^2$ defined over the complex numbers C, the R-rational points of V can be drawn on a piece of paper or by graphing software. The figure on the right shows the R-rational points of $V(y^{2}-x^{3}+x^{2}+16x)\subseteq \mathbf {C} ^{2}.$

## Singular points and tangent space

Let V be an affine variety defined by the polynomials $f_{1},\dots ,f_{r}\in k[x_{1},\dots ,x_{n}],$ and $a=(a_{1},\dots ,a_{n})$ be a point of V.
The Jacobian matrix J$_V$(a) of V at a is the matrix of the partial derivatives
    ${\frac {\partial f_{j}}{\partial {x_{i}}}}(a_{1},\dots ,a_{n}).$
The point a is regular if the rank of J$_V$(a) equals the codimension of V, and singular otherwise.
If a is regular, the tangent space to V at a is the affine subspace of $k^{n}$ defined by the linear equations
    $\sum _{i=1}^{n}{\frac {\partial f_{j}}{\partial {x_{i}}}}(a_{1},\dots ,a_{n})(x_{i}-a_{i})=0,\quad j=1,\dots ,r.$
If the point is singular, the affine subspace defined by these equations is also called a tangent space by some authors, while other authors say that there is no tangent space at a singular point. A more intrinsic definition which does not use coordinates is given by Zariski tangent space.

## The Zariski topology

The affine algebraic sets of k$^n$ form the closed sets of a topology on k$^n$, called the Zariski topology. This follows from the fact that $V(0)=k^{n},$ $V(1)=\emptyset ,$ $V(S)\cup V(T)=V(ST),$ and $V(S)\cap V(T)=V(S,T)$ (in fact, a countable intersection of affine algebraic sets is an affine algebraic set).
The Zariski topology can also be described by way of basic open sets, where Zariski-open sets are countable unions of sets of the form $U_{f}=\{p\in k^{n}:f(p)\neq 0\}$ for $f\in k[x_{1},\ldots ,x_{n}].$ These basic open sets are the complements in k$^n$ of the closed sets $V(f)=D_{f}=\{p\in k^{n}:f(p)=0\},$ zero loci of a single polynomial. If k is Noetherian (for instance, if k is a field or a principal ideal domain), then every ideal of k is finitely-generated, so every open set is a finite union of basic open sets.
If V is an affine subvariety of k$^n$ the Zariski topology on V is simply the subspace topology inherited from the Zariski topology on k$^n$.

## Geometry–algebra correspondence

The geometric structure of an affine variety is linked in a deep way to the algebraic structure of its coordinate ring. Let I and J be ideals of k[V], the coordinate ring of an affine variety V. Let I(V) be the set of all polynomials in $k[x_{1},\ldots ,x_{n}],$ that vanish on V, and let ${\sqrt {I}}$ denote the radical of the ideal I, the set of polynomials f for which some power of f is in I. The reason that the base field is required to be algebraically closed is that affine varieties automatically satisfy Hilbert's nullstellensatz: for an ideal J in $k[x_{1},\ldots ,x_{n}],$ where k is an algebraically closed field, $I(V(J))={\sqrt {J}}.$
Radical ideals (ideals that are their own radical) of k[V] correspond to algebraic subsets of V. Indeed, for radical ideals I and J, $I\subseteq J$ if and only if $V(J)\subseteq V(I).$ Hence V(I)=V(J) if and only if I=J. Furthermore, the function taking an affine algebraic set W and returning I(W), the set of all functions that also vanish on all points of W, is the inverse of the function assigning an algebraic set to a radical ideal, by the nullstellensatz. Hence the correspondence between affine algebraic sets and radical ideals is a bijection. The coordinate ring of an affine algebraic set is reduced (nilpotent-free), as an ideal I in a ring R is radical if and only if the quotient ring R/I is reduced.
Prime ideals of the coordinate ring correspond to affine subvarieties. An affine algebraic set V(I) can be written as the union of two other algebraic sets if and only if I=JK for proper ideals J and K not equal to I (in which case $V(I)=V(J)\cup V(K)$). This is the case if and only if I is not prime. Affine subvarieties are precisely those whose coordinate ring is an integral domain. This is because an ideal is prime if and only if the quotient of the ring by the ideal is an integral domain.
Maximal ideals of k[V] correspond to points of V. If I and J are radical ideals, then $V(J)\subseteq V(I)$ if and only if $I\subseteq J.$ As maximal ideals are radical, maximal ideals correspond to minimal algebraic sets (those that contain no proper algebraic subsets), which are points in V. If V is an affine variety with coordinate ring $R=k[x_{1},\ldots ,x_{n}]/\langle f_{1},\ldots ,f_{m}\rangle ,$ this correspondence becomes explicit through the map $(a_{1},\ldots ,a_{n})\mapsto \langle {\overline {x_{1}-a_{1}}},\ldots ,{\overline {x_{n}-a_{n}}}\rangle ,$ where ${\overline {x_{i}-a_{i}}}$ denotes the image in the quotient algebra R of the polynomial $x_{i}-a_{i}.$ An algebraic subset is a point if and only if the coordinate ring of the subset is a field, as the quotient of a ring by a maximal ideal is a field.
The following table summarizes this correspondence, for algebraic subsets of an affine variety and ideals of the corresponding coordinate ring:
| Type of algebraic set | Type of ideal | Type of coordinate ring |
| affine algebraic subset | radical ideal | reduced ring |
| affine subvariety | prime ideal | integral domain |
| point | maximal ideal | field |

## Products of affine varieties

A product of affine varieties can be defined using the isomorphism A$^n$ × A$^m$ = A$^{n+m}$, then embedding the product in this new affine space. Let A$^n$ and A$^m$ have coordinate rings k[x$_1$,..., x$_n$] and k[y$_1$,..., y$_m$] respectively, so that their product A$^{n+m}$ has coordinate ring k[x$_1$,..., x$_n$, y$_1$,..., y$_m$]. Let V = V( f$_1$,..., f$_N$) be an algebraic subset of A$^n$, and W = V( g$_1$,..., g$_M$) an algebraic subset of A$^m$. Then each f$_i$ is a polynomial in k[x$_1$,..., x$_n$], and each g$_j$ is in k[y$_1$,..., y$_m$]. The product of V and W is defined as the algebraic set V × W = V( f$_1$,..., f$_N$, g$_1$,..., g$_M$) in A$^{n+m}$. The product is irreducible if each V, W is irreducible.
The Zariski topology on A$^n$ × A$^m$ is not the topological product of the Zariski topologies on the two spaces. Indeed, the product topology is generated by products of the basic open sets U$_f$ = A$^n$ − V( f ) and T$_g$ = A$^m$ − V( g ). Hence, polynomials that are in k[x$_1$,..., x$_n$, y$_1$,..., y$_m$] but cannot be obtained as a product of a polynomial in k[x$_1$,..., x$_n$] with a polynomial in k[y$_1$,..., y$_m$] will define algebraic sets that are closed in the Zariski topology on A$^n$ × A$^m$ , but not in the product topology.

## Morphisms of affine varieties

A morphism, or regular map, of affine varieties is a function between affine varieties that is polynomial in each coordinate: more precisely, for affine varieties V ⊆ k$^n$ and W ⊆ k$^m$, a morphism from V to W is a map φ : V → W of the form φ(a$_1$, ..., a$_n$) = (f$_1$(a$_1$, ..., a$_n$), ..., f$_m$(a$_1$, ..., a$_n$)), where f$_i$ ∈ k[X$_1$, ..., X$_n$] for each i = 1, ..., m. These are the morphisms in the category of affine varieties.
There is a one-to-one correspondence between morphisms of affine varieties over an algebraically closed field k, and homomorphisms of coordinate rings of affine varieties over k going in the opposite direction. Because of this, along with the fact that there is a one-to-one correspondence between affine varieties over k and their coordinate rings, the category of affine varieties over k is dual to the category of coordinate rings of affine varieties over k. The category of coordinate rings of affine varieties over k is precisely the category of finitely-generated, nilpotent-free algebras over k.
More precisely, for each morphism φ : V → W of affine varieties, there is a homomorphism φ$^#$ : k[W] → k[V] between the coordinate rings (going in the opposite direction), and for each such homomorphism, there is a morphism of the varieties associated to the coordinate rings. This can be shown explicitly: let V ⊆ k$^n$ and W ⊆ k$^m$ be affine varieties with coordinate rings k[V] = k[X$_1$, ..., X$_n$] / I and k[W] = k[Y$_1$, ..., Y$_m$] / J respectively. Let φ : V → W be a morphism. Indeed, a homomorphism between polynomial rings θ : k[Y$_1$, ..., Y$_m$] / J → k[X$_1$, ..., X$_n$] / I factors uniquely through the ring k[X$_1$, ..., X$_n$], and a homomorphism ψ : k[Y$_1$, ..., Y$_m$] / J → k[X$_1$, ..., X$_n$] is determined uniquely by the images of Y$_1$, ..., Y$_m$. Hence, each homomorphism φ$^#$ : k[W] → k[V] corresponds uniquely to a choice of image for each Y$_i$. Then given any morphism φ = (f$_1$, ..., f$_m$) from V to W, a homomorphism can be constructed φ$^#$ : k[W] → k[V] that sends Y$_i$ to ${\overline {f_{i}}},$ where ${\overline {f_{i}}}$ is the equivalence class of f$_i$ in k[V].
Similarly, for each homomorphism of the coordinate rings, a morphism of the affine varieties can be constructed in the opposite direction. Mirroring the paragraph above, a homomorphism φ$^#$ : k[W] → k[V] sends Y$_i$ to a polynomial $f_{i}(X_{1},\dots ,X_{n})$ in k[V]. This corresponds to the morphism of varieties φ : V → W defined by φ(a$_1$, ... , a$_n$) = (f$_1$(a$_1$, ..., a$_n$), ..., f$_m$(a$_1$, ..., a$_n$)).

## Structure sheaf

Equipped with the structure sheaf described below, an affine variety is a locally ringed space.
Given an affine variety X with coordinate ring A, the sheaf of k-algebras ${\mathcal {O}}_{X}$ is defined by letting ${\mathcal {O}}_{X}(U)=\Gamma (U,{\mathcal {O}}_{X})$ be the ring of regular functions on U.
Let D(f) = { x | f(x) ≠ 0 } for each f in A. They form a base for the topology of X and so ${\mathcal {O}}_{X}$ is determined by its values on the open sets D(f). (See also: sheaf of modules#Sheaf associated to a module.)
The key fact, which relies on Hilbert nullstellensatz in the essential way, is the following:
Claim — $\Gamma (D(f),{\mathcal {O}}_{X})=A[f^{-1}]$ for any f in A.
Proof: The inclusion ⊃ is clear. For the opposite, let g be in the left-hand side and $J=\{h\in A|hg\in A\}$, which is an ideal. If x is in D(f), then, since g is regular near x, there is some open affine neighborhood D(h) of x such that $g\in k[D(h)]=A[h^{-1}]$; that is, h$^m$ g is in A and thus x is not in V(J). In other words, $V(J)\subset \{x|f(x)=0\}$ and thus the Hilbert nullstellensatz implies f is in the radical of J; i.e., $f^{n}g\in A$. $\square$
The claim, first of all, implies that X is a "locally ringed" space since
    ${\mathcal {O}}_{X,x}=\varinjlim _{f(x)\neq 0}A[f^{-1}]=A_{{\mathfrak {m}}_{x}}$
where ${\mathfrak {m}}_{x}=\{f\in A|f(x)=0\}$. Secondly, the claim implies that ${\mathcal {O}}_{X}$ is a sheaf; indeed, it says if a function is regular (pointwise) on D(f), then it must be in the coordinate ring of D(f); that is, "regular-ness" can be patched together.
Hence, $(X,{\mathcal {O}}_{X})$ is a locally ringed space.

## Serre's theorem on affineness

A theorem of Serre gives a cohomological characterization of an affine variety; it says an algebraic variety is affine if and only if $H^{i}(X,F)=0$ for any $i>0$ and any quasi-coherent sheaf F on X. (cf. Cartan's theorem B.) This makes the cohomological study of an affine variety non-existent, in a sharp contrast to the projective case in which cohomology groups of line bundles are of central interest.

## Affine algebraic groups

An affine variety G over an algebraically closed field k is called an affine algebraic group if it has:
* A multiplication μ: G × G → G, which is a regular morphism that follows the associativity axiom—that is, such that μ(μ(f, g), h) = μ(f, μ(g, h)) for all points f, g and h in G;
* An identity element e such that μ(e, g) = μ(g, e) = g for every g in G;
* An inverse morphism, a regular bijection ι: G → G such that μ(ι(g), g) = μ(g, ι(g)) = e for every g in G.
Together, these define a group structure on the variety. The above morphisms are often written using ordinary group notation: μ(f, g) can be written as f + g, f⋅g, or fg; the inverse ι(g) can be written as −g or g$^{−1}$. Using the multiplicative notation, the associativity, identity and inverse laws can be rewritten as: f(gh) = (fg)h, ge = eg = g and gg$^{−1}$ = g$^{−1}$g = e.
The most prominent example of an affine algebraic group is GL$_n$(k), the general linear group of degree n. This is the group of linear transformations of the vector space k$^n$; if a basis of k$^n$, is fixed, this is equivalent to the group of n×n invertible matrices with entries in k. It can be shown that any affine algebraic group is isomorphic to a subgroup of GL$_n$(k). For this reason, affine algebraic groups are often called linear algebraic groups.
Affine algebraic groups play an important role in the classification of finite simple groups, as the groups of Lie type are all sets of F$_q$-rational points of an affine algebraic group, where F$_q$ is a finite field.

## Generalizations

* If an author requires the base field of an affine variety to be algebraically closed (as this article does), then irreducible affine algebraic sets over non-algebraically closed fields are a generalization of affine varieties. This generalization notably includes affine varieties over the real numbers.
* An open subset of an affine variety is called a quasi-affine variety, so every affine variety is quasi-affine. Any quasi-affine variety is in turn a quasi-projective variety.
* Affine varieties play the role of local charts for algebraic varieties; that is to say, general algebraic varieties such as projective varieties are obtained by gluing affine varieties. Linear structures that are attached to varieties are also (trivially) affine varieties; e.g., tangent spaces, fibers of algebraic vector bundles.
* The construction given in § Structure sheaf allows for a generalization that is used in scheme theory, the modern approach to algebraic geometry. An affine variety is (up to an equivalence of categories) a special case of an affine scheme, a locally-ringed space that is isomorphic to the spectrum of a commutative ring. Each affine variety has an affine scheme associated to it: if V(I) is an affine variety in k$^n$ with coordinate ring R = k[x$_1$, ..., x$_n$] / I, then the scheme corresponding to V(I) is Spec(R), the set of prime ideals of R. The affine scheme has "classical points", which correspond with points of the variety (and hence maximal ideals of the coordinate ring of the variety), and also a point for each closed subvariety of the variety (these points correspond to prime, non-maximal ideals of the coordinate ring). This creates a more well-defined notion of the "generic point" of an affine variety, by assigning to each closed subvariety an open point that is dense in the subvariety. More generally, an affine scheme is an affine variety if it is reduced, irreducible, and of finite type over an algebraically closed field k.