# Interval basis

An interval basis is a basis for intervals.

# Formal primes and non-standard interval bases

Interval bases are expressed as lists of formal primes, the building blocks of the intervals. They are notated by separating these formal primes with periods. The most common interval bases consist of literal prime numbers, which are the building blocks of the rational numbers we use for justly intoned interval ratios. Examples of such interval bases are 2.3.5, or 2.3.7.11.

When left unspecified, the interval basis is the $d$ prime limit, or in other words, the sequence of the first $d$ primes where $d$ is the dimensionality. So, for example, given the regular temperament mapping [1 0 -4 -13 -25] 0 1 4 10 18], we should assume that its interval basis is 2.3.5.7.11. This is called a standard interval basis, and any other interval basis is called a non-standard interval basis.

The "formal" part of the term "formal prime" is there to capture an intentional flexibility: interval bases are possible which use non-primes as their building blocks, such as 2.9.5, or 2.15.7. There are also those with rational numbers, like 2.3/5.11/7, or even those with irrational numbers, like 2.√5.e.π.

The only real requirement is that each formal prime be positive and not equal to 1 (and we usually use formal primes greater than 1).

# Interval bases for intervals

In the simplest case, an interval basis is like a label for an interval vector; the entries of the vector provide the counts of harmonics in the interval, and the basis tells us what those harmonic values actually are. So the vector [-1 -1 1 with the interval basis 2.5.11 represents 11/10.

$\begin{array} {ccc} \scriptsize{2} \\ \scriptsize{5} \\ \scriptsize{11} \\ \end{array} \left[ \begin{array} {rrr} -1 \\ -1 \\ 1 \\ \end{array} \right] = 2^{-1}5^{-1}11^{1} = \dfrac{11}{2·5} = \dfrac{11}{10}$

And the same vector [-1 -1 1 but without any specified interval basis is assumed to the standard prime-limit based one. In this case, the interval has 3 entries, so that means the dimensionality $d$ is equal to 3. So we want the prime limit up through the 3rd prime. The 3rd prime is 5, so our interval basis is 2.3.5. With that interval basis, this vector represents the interval 5/6.

$\begin{array} {ccc} \scriptsize{(2)} \\ \scriptsize{(3)} \\ \scriptsize{(5)} \\ \end{array} \left[ \begin{array} {rrr} -1 \\ -1 \\ 1 \\ \end{array} \right] = 2^{-1}3^{-1}5^{1} = \dfrac{5}{2·3} = \dfrac{5}{6}$

# Interval bases for temperaments

In the context of a regular temperament, an interval basis serves as a minimal representation of all the intervals this temperament can temper (some of which it completely tempers out). The full set of these possible-to-temper intervals is called the interval subspace; it is a subspace with respect to the full interval space which includes all conceivable intervals, even those outside the temperament.

So, for instance, a temperament in the 2.3.5 interval subspace cannot temper the intervals 7/6 or 11/8, because there is no way to represent either of those intervals using only the primes 2, 3, and 5. It could, however, temper 6/5, 5/4, 10/9, or 9/8, etc., because those intervals can be represented using only those three primes.

A regular temperament mapping is a kind of function, and its domain is an interval subspace. So, an interval basis may be used to label the columns of a mapping, with one formal prime per column. Here's slendric, a temperament with a 2.3.7 interval basis:

$\begin{array} {ccc} \begin{array} {ccc} \scriptsize{2} & \scriptsize{3} & \scriptsize{7} \\ \end{array} \\ \left[ \begin{array} {rrr} 1 & 1 & 3 \\ 0 & 3 & -1 \\ \end{array} \right] \end{array}$

Similarly, an interval basis may be used to label the rows of a comma basis: one formal prime per row, just how we initially described could be done for individual interval vectors. Here's the comma basis for 5-ET with a 2.3.7 interval basis:

$\begin{array} {ccc} \scriptsize{2} \\ \scriptsize{3} \\ \scriptsize{7} \\ \end{array} \left[ \begin{array} {rrr} -8 & -6 \\ 5 & 2 \\ 0 & 1 \\ \end{array} \right]$

Note for comparison that a comma basis is also a type of basis. In the same way that an interval basis is a minimal representation of all the intervals in the temperament, a comma basis is a minimal representation of all the commas in the temperament — to be precise, the subspace of all commas that are tempered out.

# Nonstandard JI interval subspaces

For additional information about non-standard just intonation (JI) interval subspaces, as well as a gateway to browse temperaments within popular interval subspaces of this sort, see this page.

# Canonical form

The canonical form of an interval basis requires a few steps to achieve:

1. Find the matrix representation of the interval basis, which we can call a formal primes matrix.
2. Put the formal primes matrix into column Hermite normal form. This step has the effect of sorting the formal primes so that those with higher primes in their factorizations come later, e.g. so that 7 comes after 9 even though 9 is a bigger number, because 9 factorizes into 3's.
3. Eliminate any columns that are all zeros.
4. Convert the formal primes matrix back into a list of numbers (separated by periods).
5. Take the undirected value of each number; that is, if it is less than 1, replace it with its reciprocal (which will be greater than 1). So this would flip e.g. the "subratio" 3/5 into its "superratio" 5/3, or little phi φ (~0.618) into big phi Φ (~1.618).

## Formal primes matrix conversion

The reduction method we will use as part of canonicalization is the Hermite normal form. If you are previously familiar with it, you may be surprised to see it here, because you may realize that it is defined for matrices, not lists of numbers. So far, when we've looked at subspaces — or at least looked at the bases that represent them — we've simply notated them as lists of numbers, such as 2.3.7. And in most contexts this number list notation is sufficient. However, in order to merge interval subspaces, we need to temporarily convert them into matrix form, in order to use the Hermite normal form.

Well, let's get to the matrix-ifying!

We can do this by factorizing the formal primes in just the same way we factorize intervals into prime-count vectors, such as 5/4 factorizing to [-2 0 1. This is also the same way we represent comma intervals within the other key RTT basis: the comma basis.

But here, we're going one step deeper down! Now we're breaking down our formal primes — the building blocks of our intervals — into their own building blocks. And these, finally, are just actual prime numbers.

Then, each resulting vector becomes a column of our desired matrix.

So, for example, 2.9/7.5 in the form of a matrix $F$ ("formal primes matrix") looks like this. For convenience, we've labeled each column with the formal prime, and each row with the prime:

$\begin{array} {ccc} \begin{array} {rrr} \\ \end{array} \\ \begin{array} {rrr} \scriptsize{2} \\ \scriptsize{3} \\ \scriptsize{5} \\ \scriptsize{7} \\ \end{array} \end{array} \begin{array} {ccc} \begin{array} {ccc} \scriptsize{2} & \scriptsize{9/7} & \scriptsize{5} \\ \end{array} \\ \left[ \begin{array} {rrr} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & -1 & 1 \\ \end{array} \right] \end{array}$

To make a popular culture reference, you may be starting to get an Inception vibe here: we're breaking primes into deeper primes (perhaps we could call this "intervalception"?). Indeed, this might all seem dizzyingly abstract, but fortunately, we don't need to go any deeper than this. And we assure you that this matrix representation of the interval basis (again, called the "formal primes matrix") will be quite helpful for comparing different interval bases.

## Column Hermite normal form

To be exact, we want to use the column-style Hermite normal form, sometimes called column Hermite normal form for short. All this means is that we put the HNF call in an anti-transpose sandwich, as described here).

## Vs. canonical form for temperaments themselves: do not defactor

There's an important difference between the canonical form of comma bases and mappings and the canonical form of interval bases (via formal prime matrices). With the former, it's typical to fully defactor them as well as normalize them, because enfactored representations of temperaments are pathological. Enfactored formal prime matrices, however, are not pathological; they represent meaningfully distinct interval bases.

For example, if we were to defactor the formal prime matrix for the 2.9.5 interval basis, we'd get 2.3.5. But 2.9.5 is a perfectly reasonable interval basis that we don't wish to conflate with 2.3.5.

## Example

Let's canonicalize 2.5/3.7/5.

First, we get a matrix representation of that, $F$:

$\begin{array} {ccc} \begin{array} {ccc} \\ \end{array} \\ \begin{array} {rrr} \scriptsize{2} \\ \scriptsize{3} \\ \scriptsize{5} \\ \scriptsize{7} \\ \end{array} \\ \end{array} \begin{array} {lll} \begin{array} {lll} & \scriptsize{2} & \scriptsize{5/3} & \scriptsize{7/5} \\ \end{array} \\ \left[ \begin{array} {rrr} 1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \\ \end{array} \right] \\ \end{array}$

Now, column HNF it.

$\begin{array} {ccc} \begin{array} {ccc} \\ \end{array} \\ \begin{array} {rrr} \scriptsize{2} \\ \scriptsize{3} \\ \scriptsize{5} \\ \scriptsize{7} \\ \end{array} \\ \end{array} \begin{array} {lll} \begin{array} {lll} & \scriptsize{2} & \scriptsize{5/3} & \scriptsize{7/3} \\ \end{array} \\ \left[ \begin{array} {rrr} 1 & 0 & 0 \\ 0 & -1 & -1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right] \\ \end{array}$

There are no zero columns to eliminate, we've already got the thing as a list of numbers since we've updated the labels on the matrix columns, and all of those numbers are super already, so we're done! The answer is 2.5/3.7/3.

# Non-JI interval subspaces

The behavior of these are not yet well-described. For, for instance, is best to represent them as matrices? If a formal prime is $π/ɸ$, does the vinculum allow us to treat the two irrational numbers as separate basis elements (where the basis elements are expanded to include not only prime numbers)? Perhaps, but as far as this author understands, this hasn't been pinned down yet. And so, for example, irrational numbers are not supported yet in the RTT library in Wolfram Language.

# Terminology: interval basis vs. subgroup

In some other RTT writings on the wiki, the term "subgroup basis", or sometimes "subgroup" for short, is used to refer to non-standard interval bases. This article breaks from that terminology, considering it to be confusing and unhelpful, for a number of reasons.

## Mixing terminology from different mathematical fields

The term "subgroup basis" mixes mathematical terminology from different mathematical fields: "subgroup" comes from group theory, while "basis" comes from linear algebra. The equivalent term for "subgroup" in linear algebra is "subspace", and the equivalent term for "basis" in group theory is "minimal generating set". So the consistent terminology would be to either call something a "subspace basis" (such as a "null-space basis") or to call it a "subgroup minimal generating set". So "subgroup basis" is already problematic as an inconsistent mix of different fields' terminology.

## Simple vs. advanced math: linear algebra vs. group theory

Regarding the choice between these two internally consistent versions of this term, then, this article prefers "subspace basis". This is because group theory is a relatively obscure and advanced field of mathematics, and this article prefers to leverage terminology from the more well-known and basic field of linear algebra whenever possible.

"Subgroup" and "subspace" are indeed analogous, but due to differences between group theory and linear algebra, they are not completely synonymous. Essentially, group theory takes some of the convenient assumptions which we rely on when doing linear algebra and sets them aside. Doing so can be powerful, and some argue that RTT cannot be sufficiently described using only linear algebra. This article, however, prioritizes pedagogy of the basics over any potential considerations arising from such advanced RTT problems.

## Generic math terms vs. specialized application terms

For the previous two reasons — consistency, and simplicity — choosing "subspace basis" over "subgroup basis" would be preferable. But this article thinks it can do even better.

Setting aside the specialized use it has taken on in these RTT writings, a subgroup (or subspace) in the general mathematical sense is just a generic mathematical structure, like a matrix or vector. This article prefers to use specialized terminology for objects in our RTT application, so that we can clearly discuss them independently from the mathematical structures that represent them. Just like how we call certain objects represented by matrices "mappings" and certain objects represented by vectors "intervals", this article prefers using a specialized term for this RTT object — one that cannot be confused with a generic mathematical structure.

A common need when dealing with interval subspaces is determining whether they are subspaces of other interval subspaces (as discussed in Temperament merging across interval bases#Interval subspaces as subspaces of other interval subspaces). If the name for the specialized RTT object was simply "subspace" instead of "interval subspace", then each use of the word "subspace" could be unclear whether it was referring to the specialized RTT object or to the generic mathematical structure. Communicating about such things would become terribly confusing (as it is at present, in existing writings that use the term "subgroup" in both senses).

Furthermore, interval subspaces are not the only subspaces in our RTT application. Comma bases, being bases, are just as much subspace bases: bases for comma subspaces. It may be argued that interval bases, being a more fundamental mathematical object, have more right to the generic "subspace basis" term than comma bases do. But there's another powerful argument that comma bases are the more basic concept that far more users of regular temperaments will ever need to understand, and so they should be the basis that gets the generic name "subspace". Neither argument can win, and why fight anyway. Why needlessly obfuscate the issue when we could simply choose less ambiguous terminology.

## A fresh start re: not excluding standard prime-limit interval subspaces

"Subgroup" in its typical RTT usage is apparently intended to exclude the standard prime-limit subgroups. This article sees several issues with this:

• It is confusing because prime-limit subgroups are still very much subgroups — of the entire space of primes, for one example.
• It's also simply an unnecessary complexity that doesn't help much.
• And it hurts by making it more difficult than necessary to communicate about the standard prime-limit interval bases.

For all these three reasons, the interval basis terminology makes no such exclusion.

# Footnotes

1. In the case of a comma basis, both the basis vectors and all of the spanned vectors are commas. But in the case of an interval basis, only the basis vectors are formal primes. The spanned vectors in general are not formal primes. This is why we do not call an interval basis a "formal prime basis".
2. Here's a key difference between an enfactored comma basis and an enfactored formal prime matrix, by example. 2-enfactored meantone is [-8 8 -2], representing a temperoid where somehow 6561/6400 = (81/80)² is tempered out but 81/80 is not, a situation which is musically absurd, and this is the crux of why comma basis enfactoring is pathological. We can achieve a similar but non-pathological situation with a nonstandard interval basis. In the 2.3.25 interval basis, the comma basis [-8 8 1] represents the temperament where 6561/6400 is tempered out. But this isn't absurd, because the temperament doesn't explicitly say that 81/80 is not tempered out. In this temperament, 81/80 doesn't even exist! The page Sane and insane temperaments contains some more discussion of ideas in this vicinity.
3. Even 4.9.25 is an acceptable interval basis. It's not a special situation where there's a common factor in the powers on each formal prime, which in this case is 2.