Documentation

Formalizations.MusicTheory.TonnetzSpectrum

The adjacency spectrum of the Tonnetz #

The Tonnetz is the 3-regular graph on the 24 triads ZMod 12 × Bool with t — t' iff t' ∈ {P t, L t, R t}, the Cayley graph of the PLR group. Its adjacency matrix A over ℂ is symmetric, and the graph is bipartite on major/minor, so A v = λ v implies A (sign • v) = -λ (sign • v). Explicit eigenvectors give the eigenvalues ± {3, √5, 2 cos (π/12), √3, 1, 2 cos (5π/12)}, the values |1 + ζ⁴ + ζ⁻³| for ζ a 12th root of unity. That these are all the eigenvalues is proved in TonnetzCompleteness.

Main results #

References #

Local re-statement of the triad type and the neo-Riemannian operations. #

The same definitions as in NeoRiemannian (Triad, Pf, Lf, Rf). These are plain functions Triad → Triad (involutions); we only need them as the neighbour map of the Cayley graph.

@[reducible, inline]

A triad: root pitch-class in ZMod 12, quality bit (true = major). 24 of them.

Equations
Instances For

    Parallel: same root, flip quality.

    Equations
    Instances For

      The Cayley-graph adjacency operator over ℂ. #

      The neighbour relation: t — t' iff t' ∈ {P t, L t, R t}.

      Equations
      Instances For

        The adjacency matrix of the PLR/Tonnetz Cayley graph, over ℂ.

        Equations
        Instances For
          @[simp]
          theorem MusicTheory.TonnetzSpectrum.A_apply (t t' : Triad) :
          A t t' = adj t t'

          T1a — symmetry. P, L, R are involutions, so the neighbour relation is symmetric. #

          theorem MusicTheory.TonnetzSpectrum.neighbour_symm (t t' : Triad) :
          t' = Pf t ∨ t' = Lf t ∨ t' = Rf t ↔ t = Pf t' ∨ t = Lf t' ∨ t = Rf t'

          The neighbour relation as a Bool-decidable Prop is symmetric: t' ∈ {Pt,Lt,Rt} ↔ t ∈ {Pt',Lt',Rt'}. A finite check over all 24 × 24 triad pairs by decide.

          theorem MusicTheory.TonnetzSpectrum.adj_symm (t t' : Triad) :
          adj t t' = adj t' t

          adj is symmetric (over ℂ): proved via the underlying decidable Prop, NOT decide over ℂ.

          T1a. The Tonnetz adjacency matrix is symmetric.

          T1b — 3-regularity. The three neighbours P t, L t, R t are pairwise distinct. #

          The three neighbours are pairwise distinct for every triad (decidable Prop over Triad).

          T1b (3-regularity). Every triad has exactly three neighbours.

          T1c — the +3 eigenvector (all-ones; row sum = #neighbours = 3). #

          For a fixed t, the matrix row adj t · is the indicator of the neighbour set nbhd t: adj t t' = if t' ∈ nbhd t then 1 else 0.

          theorem MusicTheory.TonnetzSpectrum.A_mulVec_ones :
          (A.mulVec fun (x : Triad) => 1) = 3 • fun (x : Triad) => 1

          T1c. The all-ones vector is an eigenvector of A with eigenvalue +3 (row sum = 3 neighbours).

          T1d — the −3 eigenvector. P, L, R all FLIP the quality bit, so every edge crosses #

          major↔minor (the graph is bipartite on Bool); the sign vector s t = ±1 by quality is an eigenvector with eigenvalue −3.

          The maj/min sign vector: +1 on major triads, −1 on minor.

          Equations
          Instances For
            theorem MusicTheory.TonnetzSpectrum.neighbours_flip (t : Triad) :
            (Pf t).2 = !t.2 ∧ (Lf t).2 = !t.2 ∧ (Rf t).2 = !t.2

            P, L, R all flip the quality bit (decidable Prop over Triad).

            The sign of a flipped quality is the negated sign: s on any neighbour is −(s t).

            theorem MusicTheory.TonnetzSpectrum.row_sign_sum (t : Triad) :
            ∑ t' : Triad, adj t t' * sign t' = 3 * -sign t

            The row adj t · weighted by sign sums to 3 · (−sign t): rewrite the sum over the explicit 3-element neighbour set, on each of which sign = −sign t.

            T1d. The maj/min sign vector is an eigenvector of A with eigenvalue −3 — every edge of the Tonnetz graph crosses major↔minor (bipartite on quality).

            T1e — bipartiteness, as a named fact. Every neighbour has the opposite quality. #

            theorem MusicTheory.TonnetzSpectrum.A_bipartite (t t' : Triad) (h : adj t t' = 1) :
            t'.2 = !t.2

            Bipartite on quality. Every Tonnetz edge crosses major↔minor: if t — t' then t'.2 = !t.2. (Immediate from neighbours_flip.)

            T1f — bipartite negation. Because every edge crosses major↔minor, multiplying any #

            eigenvector by the maj/min sign vector negates its eigenvalue. One lemma, and every positive eigenvalue immediately yields its negative (and A_mulVec_sign falls out of A_mulVec_ones).

            sign-twist of a vector: flip sign on the minor triads.

            Equations
            Instances For

              On any edge the row weight times sign equals the row weight times −sign t (bipartiteness: adj t t' = 1 ⇒ sign t' = −sign t; otherwise both sides are 0).

              theorem MusicTheory.TonnetzSpectrum.bipartite_neg_eigen (v : Triad → ℂ) (lam : ℂ) (h : A.mulVec v = lam • v) :

              T1f (bipartite negation). If v is an eigenvector with eigenvalue λ, then its sign-twist signMul v is an eigenvector with eigenvalue −λ. The Tonnetz graph is bipartite on quality, so the spectrum is symmetric about 0.

              T2 — the golden eigenvalue √5. (GREEN.) #

              The j = 3 dihedral irrep. With ω = e^{2πi/12} the j = 3 value is |1 + ω³ + ω⁹| = |1 + i + i| = |1 + 2i| = √5 (since ω³ = i). Concretely, the diagonalizing character on roots is χ x = i^x (I is ω³, of order 4, and 12 is divisible by 4 so χ descends to ZMod 12). The explicit golden eigenvector is

                u (x, major) = χ x · (2 + i),      u (x, minor) = χ x · √5.
              

              Verification, neighbour by neighbour. P, L, R send a major (x,true) to the three minors (x,false), (x+4,false), (x−3,false); using χ(x+4) = χ x and χ(x−3) = χ x · i:

                (A u)(x,major) = √5 · χ x · (1 + 1 + i) = √5 · χ x · (2 + i) = √5 · u(x,major).   ✓ (no √5²)
              

              For a minor (x,false) the neighbours are the majors (x,true), (x−4,true), (x+3,true); with χ(x−4) = χ x, χ(x+3) = χ x · (−i):

                (A u)(x,minor) = (2+i) · χ x · (1 + 1 − i) = (2+i)(2−i) · χ x = 5 · χ x = √5 · u(x,minor),
              

              the only place the identity (√5)² = 5 enters (Real.sq_sqrt). All i^k reduce by i⁴ = 1.

              noncomputable def MusicTheory.TonnetzSpectrum.chi (x : ZMod 12) :

              The order-4 character χ x = iˣ on the roots (i = ω³). Well-defined on ZMod 12 because i¹² = 1.

              Equations
              Instances For

                i¹² = 1 (so χ descends to ZMod 12).

                Character shift law: χ (x + c) = χ x · i^(c.val). (Exponents agree mod 12, and i¹² = 1.)

                noncomputable def MusicTheory.TonnetzSpectrum.u :

                The golden eigenvector of the Tonnetz adjacency operator (the j = 3 dihedral irrep): χ x · (2 + i) on majors, χ x · √5 on minors.

                Equations
                Instances For
                  @[simp]

                  (√5 : ℂ)² = 5 — the single irrational identity the minor case needs.

                  theorem MusicTheory.TonnetzSpectrum.row_sum (f : Triad → ℂ) (t : Triad) :
                  ∑ t' : Triad, adj t t' * f t' = f (Pf t) + f (Lf t) + f (Rf t)

                  A generic row sum: Σ_{t'} adj t t' · f t' = f (P t) + f (L t) + f (R t) (reduce to the explicit 3-element neighbour set; NOT decide over ℂ).

                  T2 (the headline). The golden eigenvector u realizes the eigenvalue √5: A *ᵥ u = (√5 : ℂ) • u. This is the j = 3 dihedral-irrep eigenvalue |1 + ω³ + ω⁹| = √5, machine-checked component-wise over the 24 triads.

                  T3 — the remaining two-dimensional irreps, via a generic character. #

                  For each j the diagonalizing character on roots is χ_ζ x = ζ^x with ζ = ω^j a 12th root of unity (ζ¹² = 1), and the eigenvector is u_ζ(x,maj) = ζ^x · p, u_ζ(x,min) = ζ^x · λ, with p = 1 + ζ⁴ + ζ⁻³ and λ = |p|. The major equation needs only p; the minor equation needs the single irrational identity p · conj p = λ². We package this once and specialize per j.

                  noncomputable def MusicTheory.TonnetzSpectrum.chiG (z : ℂ) (x : ZMod 12) :

                  A generic 12th-root character χ_z x = z^x (well-defined on ZMod 12 exactly when z¹² = 1).

                  Equations
                  Instances For
                    theorem MusicTheory.TonnetzSpectrum.chiG_shift (z : ℂ) (hz : z ^ 12 = 1) (x c : ZMod 12) :
                    chiG z (x + c) = chiG z x * z ^ c.val

                    Generic character-shift law: for any z with z¹² = 1, χ_z (x + c) = χ_z x · z^(c.val).

                    noncomputable def MusicTheory.TonnetzSpectrum.uG (z p lam : ℂ) :

                    Generic eigenvector for parameters (z, p, lam): z^x · p on majors, z^x · lam on minors.

                    Equations
                    Instances For
                      @[simp]
                      theorem MusicTheory.TonnetzSpectrum.uG_maj (z p lam : ℂ) (x : ZMod 12) :
                      uG z p lam (x, true) = chiG z x * p
                      @[simp]
                      theorem MusicTheory.TonnetzSpectrum.uG_min (z p lam : ℂ) (x : ZMod 12) :
                      uG z p lam (x, false) = chiG z x * lam
                      theorem MusicTheory.TonnetzSpectrum.A_mulVec_uG (z p lam : ℂ) (hz : z ^ 12 = 1) (hp : 1 + z ^ ZMod.val 4 + z ^ (-3).val = p) (hlam : p * (1 + z ^ (-4).val + z ^ ZMod.val 3) = lam ^ 2) :
                      A.mulVec (uG z p lam) = lam • uG z p lam

                      Generic two-dimensional-irrep eigenvector lemma. Given a 12th root of unity z and scalars p, lam satisfying the structural relations p = 1 + z⁴ + z⁻³ (root-walk closes on the major side), lam² = p · (1 + z⁻⁴ + z³) (minor side; the irrational step), and lam · 1 = lam, lam·(z⁴.val…) handled by the shift law, the vector uG z p lam is an A-eigenvector with eigenvalue lam. The two hypotheses are hp : 1 + z^(4) + z^((-3:ZMod 12).val) = p and hlam : p * (1 + z^((-4:ZMod 12).val) + z^3) = lam^2.

                      j = 4 → eigenvalue √3. ζ = ω⁴ = e^{2πi/3}, a primitive cube root; p = 2 + ζ, |p| = √3. #

                      The primitive cube root ζ = ω⁴ = (−1 + √3·i)/2.

                      Equations
                      Instances For

                        (√3 : ℂ)² = 3.

                        z4² + z4 + 1 = 0 (z4 is a primitive cube root). Irrational inputs: (√3)² = 3, I² = −1.

                        z4³ = 1 (primitive cube root), from the quadratic relation.

                        T3 (j = 4). Eigenvalue √3 = |1 + ω⁴ + ω¹²·ⁱ…|: the eigenvector uG z4 (2+z4) √3 satisfies A *ᵥ u = (√3 : ℂ) • u.

                        j = 2 → eigenvalue 1. ζ = ω² = e^{2πi/6}, a primitive 6th root; p = ζ⁸ = ω¹⁶, |p| = 1. #

                        The primitive 6th root ζ = ω² = (1 + √3·i)/2.

                        Equations
                        Instances For

                          z2² − z2 + 1 = 0 (z2 is a primitive 6th root). Irrational inputs: (√3)² = 3, I² = −1.

                          z2³ = −1 (so z2⁶ = 1), from the quadratic relation.

                          T3 (j = 2). Eigenvalue 1: the eigenvector uG z2 (−z2) 1 satisfies A *ᵥ u = 1 • u. Here p = 1 + ζ⁴ + ζ⁹ = 1 − ζ − 1 = −ζ = −z2 (using ζ⁴ = ζ³·ζ = −ζ, ζ⁹ = ζ³ = −1) and λ = |p| = 1.

                          j = 1 → eigenvalue 2cos(5π/12) = √(2−√3). ζ = ω = e^{iπ/6} = (√3 + i)/2, a primitive #

                          12th root. p = 1 + ζ⁴ + ζ⁻³ = 1 + ζ⁴ + ζ⁹, |p|² = 2 − √3. (The "hard" 12th-root case; closed via ζ³ = i, so every needed power is an explicit {1, ζ, ζ², i}-combination.)

                          The primitive 12th root ζ = ω = (√3 + i)/2.

                          Equations
                          Instances For

                            z1³ = i. Irrational inputs (√3)² = 3, I² = −1.

                            z1¹² = 1 (= (z1³)⁴ = i⁴).

                            (√(2−√3) : ℂ)² = 2 − √3.

                            T3 (j = 1). Eigenvalue 2cos(5π/12) = √(2−√3).

                            j = 5 → eigenvalue 2cos(π/12) = √(2+√3). ζ = ω⁵ = e^{5iπ/6} = (−√3 + i)/2, a primitive #

                            12th root. p = 1 + ζ⁴ + ζ⁹, |p|² = 2 + √3. Same machinery; ζ³ = i.

                            The primitive 12th root ζ = ω⁵ = (−√3 + i)/2.

                            Equations
                            Instances For

                              (√(2+√3) : ℂ)² = 2 + √3.

                              T3 (j = 5). Eigenvalue 2cos(π/12) = √(2+√3).

                              T3⁻ — the negative half of the spectrum, for free via bipartite negation. #

                              Each positive eigenvector, twisted by sign, gives the matching negative eigenvalue. This realizes the full symmetric multiset ± {3, √5, 2cos(π/12), √3, 1, 2cos(5π/12)} without re-proving anything. (A_mulVec_sign above is the λ = 3 instance of the same fact, kept as a standalone for the header.)

                              theorem MusicTheory.TonnetzSpectrum.A_mulVec_neg3 :
                              A.mulVec (signMul fun (x : Triad) => 1) = -3 • signMul fun (x : Triad) => 1

                              −3 (from the all-ones +3 eigenvector).

                              −√5 (the golden eigenvalue's reflection).

                              −√3 (j = 4 reflection).

                              −1 (j = 2 reflection).

                              −2cos(5π/12) = −√(2−√3) (j = 1 reflection).

                              −2cos(π/12) = −√(2+√3) (j = 5 reflection).

                              Ramanujan bound. The PLR/Tonnetz graph is 3-regular (nbhd_card), so its degree is #

                              d = 3 and the Ramanujan threshold for a d-regular graph is 2√(d−1) = 2√2. Among the non-trivial eigenvalues (i.e. excluding the Perron pair ±3) the one of largest modulus is the golden eigenvalue √5 = 2φ−1 (the j = 3 dihedral irrep, A_mulVec_golden). The core arithmetic fact is that √5 lies strictly below the bound 2√2 = √8 (since 5 < 8); hence the PLR graph satisfies the Ramanujan inequality λ_nontrivial ≤ 2√(d−1).

                              Graph: Douthett–Steinbach 1998 (chicken-wire torus / PLR cycles). Identification PLR ≅ D₂₄ = Cay(D₂₄, {P,L,R}): Crans–Fiore–Satyendra, "Musical actions of dihedral groups", AMM 116 (2009). Ramanujan graphs / the 2√(d−1) bound: Lubotzky–Phillips–Sarnak, "Ramanujan graphs", Combinatorica 8 (1988).

                              This corollary certifies the controlling inequality √5 < 2√2 and relies on the explicit eigenvectors above for the eigenvalue facts. That ±{3, √5, 2cos(π/12), √3, 1, 2cos(5π/12)} is the complete spectrum — and hence that √5 really is the largest non-trivial modulus — is proved in TonnetzCompleteness.

                              The Ramanujan inequality for the PLR/Tonnetz graph (core). The golden eigenvalue √5 (the largest non-trivial PLR-graph eigenvalue) lies strictly below the 3-regular Ramanujan bound 2√(d−1) = 2√2. Arithmetic core: 2√2 = √8 and 5 < 8.