By definition, the dimension of a scheme X is the dimension of the underlying topological space: the supremum of the lengths ℓ of chains of irreducible closed subsets:
In particular, if is an affine scheme, then such chains correspond to chains of prime ideals (inclusion reversed), so the dimension of X is precisely the Krull dimension of A.
If Y is an irreducible closed subset of a scheme X, then the codimension of Y in X is the supremum of the lengths ℓ of chains of irreducible closed subsets:
An irreducible subset of X is an irreducible component of X if and only if its codimension in X is zero. If is affine, then the codimension of Y in X is precisely the height of the prime ideal defining Y in X.
Examples
If a finite-dimensional vector spaceV over a field is viewed as a scheme over the field,[note 1] then the dimension of the scheme V is the same as the vector-space dimension of V.
Let , k a field. Then it has dimension 2 (since it contains the hyperplane as an irreducible component). If x is a closed point of X, then is 2 if x lies in H and is 1 if it is in . Thus, for closed points x can vary.
Let be an algebraic pre-variety; i.e., an integral scheme of finite type over a field . Then the dimension of is the transcendence degree of the function field of over .[3] Also, if is a nonempty open subset of , then .[4]
Let R be a discrete valuation ring and the affine line over it. Let be the projection. consists of 2 points, corresponding to the maximal ideal and closed and the zero ideal and open. Then the fibers are closed and open, respectively. We note that has dimension one,[note 2] while has dimension and is dense in . Thus, the dimension of the closure of an open subset can be strictly bigger than that of the open set.
Continuing the same example, let be the maximal ideal of R and a generator. We note that has height-two and height-one maximal ideals; namely, and the kernel of . The first ideal is maximal since the field of fractions of R. Also, has height one by Krull's principal ideal theorem and has height two since . Consequently,
while X is irreducible.
Equidimensional scheme
An equidimensional scheme (or, pure dimensional scheme) is a scheme whose irreducible components are of the same dimension (implicitly assuming the dimensions are all well-defined).
In an affine space, the union of a line and a point not on the line is not equidimensional. Generally, if two closed subschemes of some scheme, neither containing the other, have unequal dimensions, then their union is not equidimensional.
If a scheme is smooth (for instance, étale) over Spec k for some field k, then every connected component (which is then, in fact, an irreducible component) is equidimensional.
Relative dimension
Let be a morphism locally of finite type between two schemes and . The relative dimension of at a point is the dimension of the fiber. If all the nonempty fibers [clarification needed] are purely of the same dimension , then one says that is of relative dimension .[6]