Definition
Codimension is a numerical measure comparing an ambient dimension to the dimension of a subobject; for a prime ideal p in a Noetherian ring R, coheight (codimension) is dim(R) - height(p), and for a subvariety it is the difference between ambient and subvariety dimensions.

Principle

Principle
Quantify how many independent conditions are imposed by passing from the ambient object to the subobject; codimension counts the drop in Krull dimension and is additive in expected exact geometric situations.

Demonstration

Demonstration
In R = k[x,y,z] (dim 3), the ideal of a plane defined by a single linear equation has codimension 1; the ideal of a line given by two independent linear equations has codimension 2, matching the dimension drop.

Misapplication

Misapplication
Assuming codimension equals the minimal number of generators of the defining ideal in all cases; in singular or noncomplete intersections the minimal generator count can exceed the codimension.

Consequence

Consequence
Codimension predicts expected intersection dimensions and appears in dimension formulas, duality statements and counting parameters for families: a subobject of codimension c locally cuts down c dimensions from the ambient.

Reversal

Reversal
The complementary viewpoint is height: instead of measuring how far an object is from the ambient, height measures how far it sits above the bottom of Spec(R); codimension can be seen as height measured from the top.

Boundary

Boundary
Codimension requires a notion of ambient dimension; in rings without finite Krull dimension the naive difference may be undefined or infinite. For nonprime subschemes codimension can be scheme-theoretic and differ from naive topological codimension.

Semantic Tension

Semantic Tension
Codimension in algebraic geometry can conflict with linear-algebraic codimension (dimension of quotient vector space) when scheme structure or singularities are present; the algebraic codimension is Krull-theoretic rather than generator-count based.

Synthesis

Synthesis
Codimension measures the loss of Krull dimension when restricting to a subobject: a fundamental bookkeeping invariant for how many independent conditions or equations define that subobject relative to its ambient space.