# Codimension

In mathematics, **codimension** is a basic geometric idea that applies to subspaces in vector spaces, and more generally to submanifolds in manifolds, and suitable subsets of algebraic varieties.

If *W* is a vector space of dimension *n*, and *V* a linear subspace of *W* of dimension *k*, then the **codimension** of *V* is

*n*−*k*.

The fundamental property of codimension lies in its relation to intersection: if *W*_{1} has codimension *k*_{1}, and *W*_{2} has codimension *k*_{2}, then if *U* is their intersection with codimension *j* we have

- max (
*k*_{1},*k*_{2}) ≤*j*≤*k*_{1}+*k*_{2}.

In fact *j* may take any integer value in this range. This statement is more perspicuous than the translation in terms of dimensions, because the RHS is just the sum of the codimensions. In words

*codimensions (at most) add*.

In terms of the dual space, it is quite evident why that is. The subspaces being defined by the vanishing of a certain number of linear functionals, which we can take to be linearly independent, that number is the codimension. Therefore we see that *U* is defined by taking the union of the sets of linear functionals defining the *W*_{i}. That union may introduce some degree of linear dependence: the possible values of *j* express that dependence, with the RHS sum being the case where there is no dependence.

In other language, which is basic for any kind of intersection theory, we are taking the union of a certain number of constraints. We have two phenomena to look out for:

- the two sets of constraints may not be independent;
- the two sets of constraints may not be compatible.

The first of these is often expressed as the **principle of counting constants**: if we have a number *N* of parameters to adjust (i.e. we have *N* degrees of freedom), and a constraint means we have to 'consume' a parameter to satisfy it, then the codimension of the solution set is *at most* the number of constraints. We do not expect to be able to find a solution if the predicted codimension, i.e. the number of *independent* constraints, exceeds *N* (in the linear algebra case, there is always a *trivial*, null vector solution, which is therefore discounted).

The second is a matter of geometry, on the model of parallel lines; it is something that can be discussed for linear problems by methods of linear algebra, and for non-linear problems in projective space, over the complex number field.

Codimension also has some clear meaning in geometric topology: on a manifold (real) codimension 1 is the dimension of topological disconnection by a submanifold, while codimension 2 is the dimension of ramification and knot theory.