The Krull dimension of a commutative ring R is the supremum of the lengths of chains of prime ideals P_0 ⊊ P_1 ⊊ ... ⊊ P_n. The height of a prime ideal P (the supremum of chain lengths descending from P) measures its "codimension." Krull's Hauptidealsatz -- the single most important theorem in dimension theory -- states that in a Noetherian ring, a principal ideal (f) with f a non-unit has all minimal primes of height at most 1. This connects the algebraic notion of dimension to geometric intuition: a single equation cuts the dimension by at most one.
Krull dimension is the algebraic formalization of geometric dimension. For a commutative ring R, it is defined as the supremum of lengths n of chains of prime ideals P_0 ⊊ P_1 ⊊ ... ⊊ P_n in R. A field has dimension 0, the integers Z have dimension 1, and the polynomial ring k[x_1, ..., x_n] over a field has dimension n. For an affine variety V with coordinate ring k[V], the Krull dimension of k[V] equals the geometric dimension of V (the dimension of the tangent space at a generic point, or equivalently the transcendence degree of the function field over k).
The height of a prime ideal P, denoted ht(P), is the supremum of lengths of chains of primes contained in P. Geometrically, height corresponds to codimension: if V(P) is the subvariety defined by P in Spec R, then ht(P) is the codimension of V(P) in Spec R. In a Noetherian ring, height and Krull dimension are related by the inequality ht(P) + dim(R/P) ≤ dim(R), with equality holding in important cases (such as polynomial rings over fields and regular local rings).
Krull's Hauptidealsatz (principal ideal theorem) is the cornerstone of dimension theory. It states: in a Noetherian ring R, if f is a non-unit, then every minimal prime ideal over (f) has height at most 1. The geometric content is that a single equation can cut the dimension by at most one. The generalized principal ideal theorem extends this: an ideal generated by r elements has all minimal primes of height at most r. The proofs use localization to reduce to the local case, then analyze the structure of the local ring at the minimal prime.
Dimension theory becomes especially powerful in local rings (R, m), where the dimension equals the height of m. The dimension of a Noetherian local ring can be characterized in multiple equivalent ways: as the Krull dimension, as the minimum number of generators of an m-primary ideal (the "system of parameters"), and (in the regular case) as the embedding dimension (the dimension of m/m^2 as a vector space over R/m). When the Krull dimension equals the embedding dimension, the local ring is regular, which is the algebraic analogue of smoothness. These connections between algebraic dimension and geometric properties are the beating heart of modern algebraic geometry.