# Weil norm, Tenney-Weil norm, and TWp interval and tuning space

If p/q is a positive rational number reduced to its lowest terms, then the **Weil height** is the integer [math]\max(p, q)[/math]. This is sometimes referred to as the **multiplicative** Weil height, whereas often it is common to take the logarithm of this quantity, which is called the **logarithmic** Weil height.

In number theory, this is often just called *the* "height" of the rational, or sometimes the "classical height" or "naive height", although Gene Smith suggested the use of the term Weil height to differentiate it from the other height functions we use, such as Tenney height.

## Relationship to Kees expressibility

If we first remove all factors of 2 before taking the Weil height, we get an octave-equivalent measure called the Kees height or Kees expressibility, depending on if you are using the multiplicative or logarithmic version.

## Relationship to Tenney height and span

The Weil height has some interesting properties which make it very suitable for use in tuning theory. For starters, we have the following identity:

[math]\displaystyle \log \max(p, q) = \frac12\log(pq) + \frac12|\log(p/q)|[/math]

On the right hand side of this equation (ignoring the factors of [math]\frac12[/math]), the first term represents the Tenney height and the second represents the span of the interval. Thus, the Weil height can be thought of as an altered version of the Tenney height which also incorporates the span of an interval into the calculation, so that larger intervals are increased in complexity relative to smaller intervals. The log base in the above equation is arbitrary, but it is conventionally taken to be either base 2, in which case the span will be in octaves, or sometimes base e, in which the units are in nepers, where one neper is about 1731.234 cents.

## Generalized Tenney-Weil height

We can immediately derive a family of "interpolated" complexity measures, intermediate to the Tenney and Weil heights, by changing the coefficients in the right-hand side of the above equation from [math]\frac12[/math] to something else.

Although there are several ways to write it, we will simply take a weighted average of the Tenney and Weil height at first, adding a new free parameter [math]k[/math]. We also note that for the Tenney height to scale properly with the Weil height, we will want to take the logarithm of the square root of [math]pq[/math], rather than just the logarithm of [math]pq[/math]. We get:

[math]\displaystyle \text{TW}_k(p, q) = (1-k)\log((pq)^{\frac12}) + k\log \max(p,q)[/math]

So that we have, for [math]k=0[/math], (half of) the Tenney height and [math]k=1[/math], the Weil height. This can be rewritten as

[math]\text{TW}_k(p, q) = (\frac12 - \frac{k}{2})\log(pq) + k\log \max(p,q)[/math]

And using the previous identity, we get

[math] \text{TW}_k(p, q) = (\frac12 - \frac{k}{2})\log(pq) + k(\frac12\log(pq) + \frac12|\log(p/q)|)\\ = \text{TW}_k(p, q) = \frac12\log(pq) + \frac{k}{2}|\log(p/q)|[/math]

So that we can see the parameter [math]k[/math] also simply measures how much priority we place on the span.

Since we only care about dyads, we can also drop the factor of [math]\frac12[/math] to get

[math]\text{TW}_k(p, q) = \log(pq) + k|\log(p/q)|[/math]

although it is noteworthy that this factor becomes important when looking at generalizations of the Weil norm to larger chords; see Chord complexity.

## Weil and Tenney-Weil interval space

The Tenney height can also be thought of as a norm on monzos. This is a Banach space called Tenney interval space, where the Tenney norm is a type of scaled [math]L_1[/math] norm. The logarithmic Weil norm also has the property of being a norm on interval space, as does the entire family of Tenney-Weil norms, and thus we may refer to Weil or Tenney-Weil interval space.

Given some [math]n[/math]-limit monzo [math]m[/math] = [[math]x_2[/math] [math]x_3[/math] [math]x_5[/math] [math]\ldots[/math] [math]x_n[/math]⟩, using the identity above, the Weil norm can be expressed as

[math] \displaystyle \|m\|_{W_1} = |x_2| \log(2) + |x_3| \log(3) + \ldots + |x_n| \log(n) + |x_2\log(2) + x_3\log(3) + \ldots + x_n\log(n)| [/math]

where [math]W_1[/math] refers to the Weil norm (this notation will be explained later below). For the general Tenney-Weil norm, we have

[math] \displaystyle \|m\|_{TW_{1,k}} = |x_2| \log(2) + |x_3| \log(3) + \ldots + |x_n| \log(n) + k \cdot|x_2\log(2) + x_3\log(3) + \ldots + x_n\log(n)| [/math]

Note that the last term on the right is equal to the span. If we have [math]k=0[/math], we get the Tenney norm, and if we have [math]k=1[/math], we get the Weil norm.

This can be expressed as a matrix multiplication. We can form the following matrix

[math] X_{k} = \begin{bmatrix} \log(2) & 0 & 0 & \cdots & 0 \\ 0 & \log(3) & 0 & \cdots & 0 \\ 0 & 0 & \log(5) & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & 0 \\ 0 & 0 & 0 & \cdots & \log(n) \\ k\log(2) & k\log(3) & k\log(5) & \cdots & k\log(n) \end{bmatrix} [/math]

Or, if [math]W[/math] is the usual monzo-weighting matrix, and [math]J[/math] is the JIP, we can think of this as forming the block matrix

[math]\displaystyle X_{k} = \begin{bmatrix} W \\ \hline k\cdot J \end{bmatrix} [/math]

Then we have the Tenney-Weil norm of our monzo [math]m[/math] is simply

[math]\|m\|_{TW_{1,k}} = \|X_{k} \cdot m\|_1[/math]

This maps every monzo [math]m[/math] = [[math]x_2[/math] [math]x_3[/math] [math]x_5[/math] [math]\ldots[/math] [math]x_n[/math]⟩ to the "weighted augmented vector" [[math]w_2[/math] [math]w_3[/math] [math]w_5[/math] [math]\ldots[/math] [math]w_n;[/math] [math]k[/math] [math]\cdots[/math]⟩ in a one-dimensional-larger space, where the [math]w_n[/math] are weighted coordinates, [math]k[/math] is the coefficient on the span, and the semicolon is just to make clear where this extra spurious coefficient is. The [math]L_1[/math] norm of this augmented vector is the result.

So that even the arbitrary Tenney-Weil norm can be thought of as an [math]L_1[/math] norm, although in a vector space expanded by one dimension. This definition can easily be extended to arbitrary subgroup by first embedding the subgroup monzos into the full [math]n[/math]-limit, and then applying the above.

**TODO**: add pictures of 2D unit sphere for different values of [math]k[/math]

## Generalized Weil and Tenney-Weil "[math]W_p[/math]" and "[math]TW_{p,k}[/math]" norms

Similarly to the Tenney-Euclidean norm, we can use this to define a variety of generalized "[math]L_p[/math]-style" norms, some of which are easier to work with than the original Weil norm. To do this, we simply change the above expression from an [math]L_1[/math] norm to some other kind of norm. So we get

[math] \displaystyle \|m\|_{TW_{p,k}} = \left((|x_2| \log(2))^p + (|x_3| \log(3))^p + \ldots + (|x_n| \log(n))^p + (k \cdot|x_2\log(2) + x_3\log(3) + \ldots + x_n\log(n)|)^p \right)^{1/p} [/math]

We can rewrite this simply using our matrix notation as

[math]\|m\|_{TW_{p,k}} = \|X_{k} \cdot m\|_p[/math]

Where we have simply changed the [math]p[/math]-norm from 1 to a different value of [math]p[/math].

### Weil-Euclidean norm

The special value of [math]p=2[/math] is called the **Weil-Euclidean** or **WE norm**, analogously to the **Tenney-Euclidean** or **TE norm**. We can similarly declare the **Tenney-Weil-Euclidean** or **TWE** family of norms for different values of [math]k[/math], with the TE and WE norms being special cases.

However, it so happens that our TWE norm is really just a reinvention of the **Cangwu norm**, although with some difference in scaling with our parameter [math]k[/math]. Still, it is the same thing, up to a simple change in variables. We will treat these as generally synonymous.

The unit sphere of this norm is an ellipsoid which has been "squished" in monzo space along the axis measuring the span of a comma (this can be visualized as a squishing along the direction of the JIP, but treated as though it were a monzo). As the value of [math]k[/math] increases, this sphere is increasingly squished, meaning that larger commas are given a greater norm.

### Kees-Euclidean seminorm

Given the Kees-Euclidean norm, we can quotient out by octaves to arrive at the **Kees-Euclidean seminorm.** This seminorm can be thought of as a "L2-ified" version of the Kees expressibility, similarly to how the Weil-Euclidean norm is an L2-ified version of the Weil height. With some care in dealing with the divergences, this can be used to compute a **Kees-Euclidean tuning** which very closely approximates, but is not exactly equal to, the POTE tuning. This unique tuning happens to be identical to the "octaves-constrained" Weil-Euclidean tuning.

## Geometric interpretation and alternative formulation

The Weil norm skews the interval space by way of introducing an extra dimension. If we remove a layer of Tenney weight from the Weil norm, we get the equilateral-Weil norm. The figure shows an equilateral-Weil interval space. As each instance of either prime contributes positively to the extra dimension, the angle *θ* between two formal primes decreases. The measure cos *θ* is the cosine similarity between any two formal primes. If the length of each prime is set to unity, and if the contribution factor to the extra dimension is sqrt (*s*), then the contribution factor to the original dimension is sqrt (1 - *s*). It can be shown that cos *θ* = *s*.

*k* is the slope of the extra dimension. *s* and *k* can be related by

[math]\displaystyle k = \sqrt {s/(1-s)} \\ [/math]

When *k* = 1, *s* = 1/2. So we see the Weil norm skews the space to *θ* = arccos *s* = 60 degrees.

An alternative formulation which gives identical results in the Euclidean space as above is to skew the space within the dimension through constructing each unit vector that is 60 degrees from all previous unit vectors. Here is an algorithm to do so.

- Let the first unit vector be x
_{1}= [1⟩. - Given the first
*j*-th unit vectors, to find the (*j*+ 1)-th, solve the*j*+ 1 equations of the form

[math]\displaystyle \vec x_{j + 1} \cdot \vec x_i = \cos (\theta), i = 1, 2, \ldots, j \\ \left\Vert \vec x_{j + 1} \right\Vert_2 = 1 [/math] - Compose the transformation matrix X as

[math]\displaystyle X = \begin{bmatrix} \vec x_1 & \vec x_2 & \ldots & \vec x_n \end{bmatrix}[/math] - Return X.

The result is without Tenney weighting. For the Tenney-weighted form, multiply it by the Tenney height transformation matrix on the right.

## Dual norms

*See also: Dual of the Weil norm proof*

These norms also induce dual norms on the dual space of vals and tuning maps. In general, the [math]TW_{p,k}[/math] norm on any [math]n[/math]-limit monzo can be given by first embedding it into another vector space augmented with one extra dimension, and then taking the [math]p[/math]-norm on that space. The free parameter [math]k[/math] determines at which angle the [math]n[/math]-limit is being embedded into this augmented space. The norm on the original space is then induced as a "slice" through this larger space.

To get the "dual [math]TW_{p,k}[/math]" norm on the space of vals, we first build the dual on this augmented space in the standard fashion; this is just the dual of the [math]L_p[/math] norm on the larger space. Then, since the norm on the original space was induced as a subspace of this larger space, the norm on the original dual space of vals will be induced as a *quotient space* of the dual of this larger space, as a corollary to the Hahn-Banach theorem.

Since we are mapping monzos to these "augmented monzos", which we are doing via the aforementioned matrix multiplication, the dual space of this larger space is made up of "augmented vals" of the form ⟨[math]v_2[/math] [math]v_3[/math] [math]v_5[/math] [math]\ldots[/math] [math]v_n;[/math] [math]\text{junk}[/math]] where "junk" is an extra junk coefficient that we don't care about, formed as a byproduct of adding the augmented coefficient to monzos. The dual transformation of our matrix maps back from these augmented vals to regular ones, in effect "co-tempering" them to the original vals. We do this simply by multiplying the matrix on the other side, so that instead of mapping from monzos to augmented monzos via [math]\hat m = X_k \cdot m[/math], we map from augmented vals to regular vals via [math]v = \hat v \cdot X_k[/math].

Every val in our original space corresponds to an entire equivalence class or coset of augmented vals which are in the preimage of this dual transformation. It so happens that two of these augmented vals are in the same equivalence class if they differ by the augmented val ⟨[math]k[/math] [math]k[/math] [math]k[/math] [math]\ldots[/math] [math]k;[/math] [math]-1[/math]], which is the left nullspace of our [math]X_k[/math] above.

So to make this clear, if we want to compute the dual [math]TW_{p,k}[/math] norm of some [math]n[/math]-limit val

[math]v = \langle v_2 \, v_3 \, v_5 \ldots v_n][/math]

It so happens that all of the vals in the preimage of this, in our augmented val space, will be of the form

[math]v = \langle v_2 \, v_3 \, v_5 \ldots v_n;0| + r\cdot \langle k \, k \, k \ldots k;-1][/math]

Note that [math]k[/math] is determined ahead of time as the free parameter we have chosen from our [math]TW_{p,k}[/math] norm, so the only free variable we have here is [math]r[/math]. Then the norm on our original val [math]v[/math] is the quotient norm induced on this new space:

[math]\|v\|_{TW_{p,k}} = \min_r{\|\langle v_2 \, v_3 \, v_5 \ldots v_n;0] + r\cdot \langle k \, k \, k \ldots k;-1]\|_q}[/math]

where [math]q[/math] is the [math]q[/math]-norm such that [math]\frac1q + \frac1p = 1[/math] (the standard definition of the dual of the [math]p[/math]-norm).

Solving the minimization problem, we find the val transformation matrix X in the equilateral-weighted space is of the form

[math]\displaystyle X = \begin{bmatrix} I - krJ & r\vec j \end{bmatrix} [/math]

where J is the all-ones matrix, and similarly j is the all-ones vector. For the Tenney-weighted space, multiply it by the Tenney weighter on the left.

The special case of the Tenney-Weil-Euclidean or Cangwu norm can be easily computed using the pseudoinverse, and *r* is given by

[math]\displaystyle r = k/(nk^2 + 1)[/math]

where *n* is the dimensionality of the subgroup.