For an algebraic variety V over a field K, the dimension of V is the transcendence degree over K of the function field K(V) of all rational functions on V, with values in K.
For the function field even to be defined, V here must be an irreducible algebraic set; in which case the function field (for an affine variety) is just the field of fractions of the co-ordinate ring of V. It is easy to define by polynomials sets that have 'mixed dimension': a union of a curve and a plane in space, for example. These fail to be irreducible.Formal definition