# Rank and codimension

The **rank** of a regular temperament is the number of independent intervals, called *generators*, which can be combined together to obtain any interval of the temperament. For instance, every interval of meantone can be obtained as a combination of a certain number of octaves up or down, plus a certain number of flattened meantone fifths up or down. The terminology originally comes from group theory and linear algebra, although we are using the term "co-rank" slightly differently here.

In the parlance of group theory, the intervals of a regular temperament comprise a finitely generated free abelian group with a rank equal to the number of generators. In the parlance of linear algebra, the rank of the temperament is also the rank of any mapping matrix defining the temperament.

The **codimension** or co-rank of a temperament is the number of commas needed to completely define the temperament. If the temperament tempers the p-limit just intonation group generated by the first n primes, then if it tempers out n-r independent commas, it will be of rank r and codimension n-r. The terminology can also be applied to just intonation subgroups. In all cases care must be taken to specify the exact just intonation group which is being tempered by the tempering out of a set of commas.

Looking only at the number of independent generators of a tuning can obscure its real nature, at least as it is being applied. For instance, a 31et tuning of meantone temperament, with a meantone fifth of 18\31 octaves, is of rank one in the sense that all the intervals in the tuning are generated from 1\31; however, it is being used as a rank two tuning. This issue can be gotten around by means of abstract regular temperaments; an abstract regular temperament is of rank r if it is defined by a normal val list of r vals, or equivalently by an r-multival. The abstractly characterized intervals of the abstract temperament can then be mapped to a tuning; if the mapping is to a rank one tuning such as 31et, that does not affect the rank of the temperament.

Although the term "rank" as used here is exactly the same as used in group theory and linear algebra, it is important to note that the term "co-rank" is being used slightly differently. In both cases, the co-rank is the dimension of the cokernel (the quotient of codomain by image), and hence can be thought of as measuring the degree to which a homomorphism fails to be surjective. However, for any so-called temperament, if the group-theoretic co-rank isn't 0, it isn't a temperament at all - it is contorted. And if the linear-algebraic co-rank isn't 0, that's even worse - it means you have a completely free generator with no mapping specified at any point along the chain. So the both the group-theoretic co-rank and the linear-algebraic co-rank are useless pieces of information for a temperament - they are always 0.

The thing called "codimension" above can be interpreted in linear algebra terms as the codimension of the subspace of supporting vals, relative to the ambient space of all vals. For any mapping matrix mapping from monzos to tmonzos, it's also the co-rank of the dual transformation from tvals back to vals.