Perfectoid Rings Breakdance in Sonic Pi?
One of the ideas that comes to mind when I think about prime numbers is their staticness, that naive definition we’ve known forever. I wanted primes to spin, or do something different; to become scores, in the musical sense of the word.
But that’s exactly what happens when we run a loop to check their divisors (I won’t cite that here because it’s a classic), when we put them through a computer. We iterate, we move something. In that sense, I discovered long ago that this obsession with iteration exists in number theory as a beautiful notion called p-adic numbers.
P-adics in Sonic Pi
In my library figurate_numbers for Sonic Pi, I introduced some time ago a transformation of sequences into their -adic versions.
You can istall it with the next command:
gem install figurate_numbers
Since I loved the taste of algebra (and of course Serre’s book), I implemented it as an inverse limit, that is, iterating over powers of primes. I phrase it like this:
To the topological eye, we have discrete groups that, through a system of modular reductions, give rise to a profinite topology.
I also added a couple of important definitions: the p-adic valuation and the p-adic norm (both of which I had already read about in 2018 in the opening pages of Koblitz’s book). What you can do in figurate_numbers is summarized in these commands:
# Simply copy the entry point path
# from the lib/figurate_numbers.rb file
# where the gem is installed.
require "<PATH>"
amp_seq = SpaceFigurateNumbers.centered_hendecagonal_pyramidal
100.times do
# p-adic amplitude control
sample :bd_sone, amp: ArithTransform.padic_norm(amp_seq.next, 3)
sleep 0.25
end
Afterwards I became interested in the p-adic versions of many other mathematical objects. Once you pick up a new lens, it’s natural to want to test how the mathematics deforms under the new structure to find the analogues.
But since I saw no further comments on the Sonic Pi forum. I decided to leave things in suspense, and not only for that reason.
I’m also watching the evolution of the new software Sam Aaron is building with SuperSonic and the version 5 of Sonic Pi, still in beta. And I need to see the terrain made of rocks so I can think of something interesting to build on top of it first.
Up to now, these are the commands available for a single note (n) or an array (seq) in Sonic Pi or Ruby:
ArithTransform.padic_val(n, p)
ArithTransform.ring_padic_val(seq, p)
ArithTransform.ring_padic_norm(seq, p)
Below, I will present the function that is perhaps the most natural way to start thinking about the main ideas of this post.
Perfectoid rings
The p-adic theory has grown enormously, and a great deal of current mathematical research revolves around its methods. One definition I plan to eventually develop for Sonic Pi (once the new version drops) is that of a perfectoid ring, at least in its most naive form.
I’ll use . Also, calling in the integers, let’s look at . To begin, a number can be written in this three-phase universe as
The values of each are simply the set . For instance: . Yes, one example is enough.
Let’s see this in a number of vertices of the absurd four-dimensional dodecagonal pyramidal infinite sequence:
dode_pyr_4D = FigurateNumbers.four_dimensional_dodecagonal_pyramidal.take(10)
# [1, 14, 60, 170, 385, 756, 1344, 2220, 3465, 5170]
ArithTransform.padic_expansion(dode_pyr_4D[1], 3, precision = 11, reverse: false)
# [2, 1, 1, 0, 0, 0, 0, 0, 0, 0]
# reads as 2 + 1·3 + 1·9 = 14 (exactly as shown above)
But, as in many things in life, we need to plant the tree by its roots, not with the crown in the dirt. We need many of these roots, an infinite myriad of them
and so on. With this you can now denote the slightly more general form of the ring , keep it in memory like this
You can see that raising to powers gives and , and so on down the chain.
As I mentioned at the start of this post, this obsession with iteration shows up again and again.
Now, as in many theories in algebra, we need a special element. Here that element is called the pseudo-uniformizer,
and is the uniformizer raised to , meaning .
This tells us that lives inside (keep that membership handy, it’ll come in useful in a moment).
Perfectoid magnifying glasses
What do numbers in this ring actually look like? An might appear as
or as an infinite series (which reminds me of figurate numbers interacting with other figurate numbers, almost like a two-voice counterpoint)
Well, what we note here is that, unlike ordinary expansions, these expressions allow fractional exponents with ever-growing denominators. As a result, the digits are placed at increasingly refined scales; each new root adds a finer layer of -adic resolution.
And we can already perform reductions that were not available before. The element allows reductions to ignore every multiple of itself, so
Frobenius
Finally, the last thing to file away for quick access is the Frobenius. Here is what we do with the ring
given by .
The second sufficient example: set . We expand as a cubic polynomial (borrow the silhouette of ) in the pseudo-uniformizer by raising to the third power:
Now here is why we spent years grinding through mechanical substitutions. Since , we get
because and . Every term has order . Topologically, this is of small size (with respect to the -adic topology). So we have
because, grouping the expression like this
we can see it lies in .
So far, we haven’t tried anything new. Before serving the main course, what follows is a rough draft, kind of an attempt to give the expansion a voice in musical lines.
use_bpm 30
a_i = (ring 1.0, 1.0/3, 1.0/9, 1.0/27)
# a_0, large-scale structure ::
with_fx :reverb, room: 0.9, mix: 0.7 do
live_loop :a_0 do
synth :organ_tonewheel, note: :a1, amp: a_i[0],
release: a_i[0] + rand(0.3), cutoff: 60
sleep a_i[0]
end
end
# a_1·3^(1/3) ::
with_fx :reverb, room: 0.7, mix: 0.7 do
live_loop :a_1 do
synth :prophet, note: (chord :a3, :m).choose,
amp: 0.4, release: 0.25, cutoff: 80
sleep a_i[1]
end
end
# a_2·3^(1/9) ::
with_fx :reverb, room: 0.5, mix: 0.7 do
live_loop :a_2 do
synth :rhodey, note: (chord :a2, :m).choose,
amp: 0.1, release: 0.1, cutoff: 100
sleep a_i[2]
end
end
# a_3·3^(1/27), almost imperceptible 1 + 3^{1/3} \equiv 1 \pmod{\pi}
# muting this changes nothing fundamental ::
with_fx :reverb, room: 0.3, mix: 0.7 do
live_loop :a_3 do
synth :fm, note: (chord :a4, :m).choose,
amp: 0.08, release: 0.05, cutoff: 120
sleep [a_i[3], 0.05].max
end
end
The Capsule Corp
After all these divagations, everything above is captured in the following more formal definition. If is a topological ring, we will call it an integral perfectoid ring if there exists an element (non zero divisor) such that
, and the Frobenius map
is an isomorphism.
But, note the isomorphism earns its place. The ring is a musical echo of characteristic . This echo is the tilt of , which is beautifully denoted with a flat musical symbol: . And an interval, a semitone transition between mixed characteristic, can be tilted to characteristic , solved there, and returned (Da Capo al Fine).
Towards Sonic Pi Again
At this point I’m genuinely unsure what direction the translation of all this into Sonic Pi’s musical sand might take. I’ll definitely post something in the community at some point to see if anyone’s interested. The perfectoid structure carries infinite root towers, profinite completions, Frobenius symmetry, all of which feel rich enough to generate interesting live coding material.
Stepping out for a moment before the ice melts and Watanabe’s ice cream vendor fails: I also found a distant resemblance in my interest for objects that repeat in different places, something I wrote some time ago for carpentry (sawtooth in electronic music) with Fourier, like the repeated figures of an album.
For instance, rewriting the classical real trigonometric functions as solutions to the harmonic oscillator,
which is required to vanish. Yes, evidently as a game under the sun, this could be the case :
But how to map that faithfully, or even playfully, into sequences, amplitudes, or rhythmic patterns is still an open question for me. I’ll leave it here, as an unresolved -chord, with .