# Weil Norms, Tenney-Weil Norms, 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 max(p, q). 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" (see https://en.wikipedia.org/wiki/Height_function), 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) = \frac{1}{2}\log(pq) + \frac{1}{2}\log|p/q|[/math]

On the right hand side of this equation, 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. It is noteworthy that the span, in the above equation, is in strange units of "nepers" rather than cents, where one neper is about 1731.234 cents; we could rewrite in terms of cents but the above is simpler.

# 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 1/2 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)^{1/2}) + k\log \max(p,q)[/math]

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

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

And using the previous identity, we get

[math] \text{TW}_k(p, q) = (\frac{1}{2} - \frac{k}{2})\log(pq) + k(\frac{1}{2}\log(pq) + \frac{1}{2}\log|p/q|)\\ = \text{TW}_k(p, q) = \frac{1}{2}\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 1/2 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 L1 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 n-limit monzo m = {monzo|x_2 x_3 x_5 ... x_n}, 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 k=0, we get the Tenney norm, and if we have k=1, 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 = |x_2 \, x_3 \, x_5 ... x_n\rangle[/math] to the "weighted augmented vector" [math]|w_2 \, w_3 \, w_5 ... w_n;k\cdots\rangle[/math]in a one-dimensional-larger space, where the [math]w_n[/math] are weighted coordinates, [math]s[/math] is the span, and the semicolon is just to make clear where this extra spurious coefficient is. The L1 norm of this augmented vector is the result.

So that even the arbitrary Tenney-Weil norm can be thought of as an L1 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 n-limit, and then applying the above.

**TODO**: add pictures of 2D unit sphere for different values of k

# Generalized Weil and Tenney-Weil "Wp" and "TW_{p,k}" Norms

Similarly to the Tenney-Euclidean norm, we can use this to define a variety of generalized "Lp"-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 L1 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 p-norm from 1 to a different value of p.

## Weil-Euclidean Norm

The special value of p=2 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 k, 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 k. 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 k increases, this sphere is increasingly squished, meaning that larger commas are given a greater norm.

# Dual Norms

These norms also induce dual norms on the dual space of vals and tuning maps. In general, the TW_{p,k} norm on any n-limit monzo can be given by first embedding it into another vector space augmented with one extra dimension, and then taking the p-norm on that space. The free parameter k determines at which angle the n-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 TW_{p,k}" 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 Lp 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 (see [1]).

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]\langle v_2 \, v_3 \, v_5 \ldots v_n;\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]\langle k \, k \, k \ldots k;-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 TW_{p,k} norm of some n-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 TW_{p,k} 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_k{\|\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 q-norm such that [math]1/q + 1/p = 1[/math] (the standard definition of the dual of the p-norm).

For the special case of the Tenney-Weil-Euclidean or Cangwu norm, this can be easily computed using the pseudoinverse.