Documentation

Formalizations.MusicTheory.AllPairsEvenness

Maximally even sets minimize every convex all-pairs energy #

For A ⊆ ℤ/12 and a potential V : ℕ → ℝ, the all-pairs energy is E V A = ∑ k ∈ 1..6, iv A k * V k, with iv the interval vector. A double summation by parts (abel_bridge) writes E V A - E V R as a combination of the second differences of V and of V 5 - V 6 with coefficients the double cumulative sums DD of iv A - iv R. A finite check over all subsets of a given size shows these coefficients are nonnegative, and positive off the T/I-orbit of R. Hence, for every convex V decreasing at the top, the maximally even set R minimizes the energy, uniquely up to T/I when the inequalities are strict, for the pentatonic (k = 5), whole-tone (6), diatonic (7) and octatonic (8) collections.

Main results #

Implementation notes #

The finite checks over the k-subsets of ℤ/12 are proved by decide in the kernel on a bitmask encoding of the subsets (ofBits, exists_ofBits, iv_ofBits, census_iv); no native_decide is used.

References #

Definitions #

Circular distance in ℤ/12: min(|a−b|, 12−|a−b|), a value in 0..6.

Equations
Instances For

    Interval vector entry at distance k (textbook convention): the number of UNORDERED pairs {a,b} ⊆ A with circular distance k. Each unordered pair is counted twice in A ×ˢ A (as (a,b) and (b,a), since cdist is symmetric), so we divide by 2.

    Equations
    Instances For

      The diatonic collection {0,2,4,5,7,9,11} ⊂ ℤ/12. Its interval vector is the classic ⟨2,5,4,3,6,1⟩ (verified by decide, see iv_D).

      Equations
      Instances For

        Transposition Tₙ : a ↦ a + n.

        Equations
        Instances For

          Inversion I_j : a ↦ j − a (axis j/2).

          Equations
          Instances For

            The T/I-orbit of the diatonic: all 12 transposes ∪ all inversions (= 12 distinct sets, the diatonic being inversionally symmetric).

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              The T/I-orbit of an arbitrary reference set R: all 12 transposes ∪ all 12 inversions.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                The pentatonic collection {0,2,4,7,9} ⊂ ℤ/12 (iv = ⟨0,3,2,1,4,0⟩, T/I-orbit size 12).

                Equations
                Instances For

                  The whole-tone collection {0,2,4,6,8,10} ⊂ ℤ/12 (iv = ⟨0,6,0,6,0,3⟩, T/I-orbit size 2).

                  Equations
                  Instances For

                    The octatonic collection {0,1,3,4,6,7,9,10} ⊂ ℤ/12 (iv = ⟨4,4,8,4,4,4⟩, orbit size 3).

                    Equations
                    Instances For

                      Integer interval-vector difference from the diatonic: d_j = iv A (j+1) − iv D (j+1).

                      Equations
                      Instances For

                        Double-cumulative sum DD_j = Σ_{l≤j} (j+1−l)·d_l = Σ_{l≤j} Σ_{i≤l} d_i (single-sum closed form of the double Abel cumulative).

                        Equations
                        Instances For
                          noncomputable def MusicTheory.AllPairsEvenness.E (V : ℕ → ℝ) (A : Finset (ZMod 12)) :

                          All-pairs energy of A for a real potential V : ℕ → ℝ (distance → energy): E V A = Σ_{k=1..6} iv A k · V k.

                          Equations
                          Instances For

                            The Abel bridge (general, V-independent) #

                            theorem MusicTheory.AllPairsEvenness.abel_bridge (d : ℕ → ℤ) (V : ℕ → ℝ) (hsum : d 0 + d 1 + d 2 + d 3 + d 4 + d 5 = 0) :
                            ∑ j ∈ Finset.range 6, ↑(d j) * V (j + 1) = ∑ j ∈ Finset.range 4, ↑(DD d j) * (V (j + 1) - 2 * V (j + 2) + V (j + 3)) + ↑(DD d 4) * (V 5 - V 6)

                            Double summation-by-parts (the engine). For any d : ℕ → ℤ with d₀+⋯+d₅ = 0 and any V : ℕ → ℝ, Σ_{j<6} d_j·V(j+1) = Σ_{j<4} DD_j·(V(j+1) − 2V(j+2) + V(j+3)) + DD₄·(V 5 − V 6). Both boundary terms of the first Abel pass vanish because ∑ d = 0; the residual DD₄·(V5−V6) is the surviving (decreasing) boundary of the second pass. Pure algebra.

                            theorem MusicTheory.AllPairsEvenness.abel_nonneg (d : ℕ → ℤ) (V : ℕ → ℝ) (hsum : d 0 + d 1 + d 2 + d 3 + d 4 + d 5 = 0) (h0 : 0 ≤ DD d 0) (h1 : 0 ≤ DD d 1) (h2 : 0 ≤ DD d 2) (h3 : 0 ≤ DD d 3) (h4 : 0 ≤ DD d 4) (hc0 : 0 ≤ V 1 - 2 * V 2 + V 3) (hc1 : 0 ≤ V 2 - 2 * V 3 + V 4) (hc2 : 0 ≤ V 3 - 2 * V 4 + V 5) (hc3 : 0 ≤ V 4 - 2 * V 5 + V 6) (hdec : V 6 ≤ V 5) :
                            0 ≤ ∑ j ∈ Finset.range 6, ↑(d j) * V (j + 1)

                            Nonnegativity (V-independent ≥). With DD_j ≥ 0 (j=0..4), the four second differences ≥ 0 (convexity) and V 6 ≤ V 5 (decreasing top), the energy gap is ≥ 0.

                            theorem MusicTheory.AllPairsEvenness.abel_pos (d : ℕ → ℤ) (V : ℕ → ℝ) (hsum : d 0 + d 1 + d 2 + d 3 + d 4 + d 5 = 0) (h0 : 0 ≤ DD d 0) (h1 : 0 ≤ DD d 1) (h2 : 0 ≤ DD d 2) (h3 : 0 ≤ DD d 3) (h4 : 0 ≤ DD d 4) (hc0 : 0 < V 1 - 2 * V 2 + V 3) (hc1 : 0 < V 2 - 2 * V 3 + V 4) (hc2 : 0 < V 3 - 2 * V 4 + V 5) (hc3 : 0 < V 4 - 2 * V 5 + V 6) (hdec : V 6 < V 5) (hex : 0 < DD d 0 ∨ 0 < DD d 1 ∨ 0 < DD d 2 ∨ 0 < DD d 3 ∨ 0 < DD d 4) :
                            0 < ∑ j ∈ Finset.range 6, ↑(d j) * V (j + 1)

                            Strict positivity (V-independent >). Strictly convex (> 0 second differences), strictly decreasing top (V 6 < V 5), DD_j ≥ 0, and SOME DD_j > 0 ⟹ strictly positive gap.

                            The finite censuses #

                            A census ranges over all k-subsets of ℤ/12. A subset is encoded by a bitmask m < 4096 (ofBits, onto by exists_ofBits); its interval vector is computed on the bits (ivN, equal to iv (ofBits m) by iv_ofBits), and the resulting statement about the masks is checked by decide in the kernel. Off the orbit, the masks of the orbit are listed explicitly and shown to lie in it by decide.

                            Circular distance between the residues with values a b < 12.

                            Equations
                            Instances For

                              The subset of ℤ/12 whose elements are the set bits of m.

                              Equations
                              Instances For

                                The number of elements of ofBits m, computed on the bits.

                                Equations
                                Instances For

                                  The interval vector of ofBits m, computed on the bits.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    theorem MusicTheory.AllPairsEvenness.exists_ofBits (A : Finset (ZMod 12)) :
                                    ∃ m < 4096, ofBits m = A

                                    Every subset of ℤ/12 is ofBits m for some m < 4096.

                                    theorem MusicTheory.AllPairsEvenness.census_iv (k : ℕ) (Q : (ℕ → ℕ) → Prop) (h : ∀ m < 4096, popN m = k → Q (ivN m)) (A : Finset (ZMod 12)) :

                                    A statement about the interval vectors of all k-subsets follows from the same statement about the bitmasks with k set bits.

                                    theorem MusicTheory.AllPairsEvenness.census_iv_off (k : ℕ) (orb : Finset (Finset (ZMod 12))) (L : List ℕ) (hL : ∀ m ∈ L, ofBits m ∈ orb) (Q : (ℕ → ℕ) → Prop) (h : ∀ m < 4096, popN m = k → m ∈ L ∨ Q (ivN m)) (A : Finset (ZMod 12)) :
                                    A ∈ Finset.powersetCard k Finset.univ → A ∉ orb → Q (iv A)

                                    Off-orbit version of census_iv: the masks for which the statement fails are listed in L, and they encode members of orb.

                                    @[reducible, inline]
                                    abbrev MusicTheory.AllPairsEvenness.dgv (R : Finset (ZMod 12)) (v : ℕ → ℕ) :
                                    ℕ → ℤ

                                    dg R A as a function of the interval vector v of A.

                                    Equations
                                    Instances For
                                      @[reducible, inline]

                                      The census predicates, as functions of the interval vector.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        @[reducible, inline]
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          @[reducible, inline]
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            @[reducible, inline]

                                            E0 as a function of the interval vector.

                                            Equations
                                            Instances For

                                              The bitmasks of the twelve sets of orbitTI.

                                              Equations
                                              Instances For

                                                The bitmasks of the twelve sets of orbitOf P.

                                                Equations
                                                Instances For

                                                  The bitmasks of the two sets of orbitOf W.

                                                  Equations
                                                  Instances For

                                                    The bitmasks of the three sets of orbitOf O.

                                                    Equations
                                                    Instances For
                                                      theorem MusicTheory.AllPairsEvenness.iv_D :
                                                      iv D 1 = 2 ∧ iv D 2 = 5 ∧ iv D 3 = 4 ∧ iv D 4 = 3 ∧ iv D 5 = 6 ∧ iv D 6 = 1

                                                      iv D = ⟨2,5,4,3,6,1⟩ — the classic diatonic interval vector.

                                                      Every 7-subset has C(7,2)=21 unordered pairs, so ∑ d = 0. (Census.)

                                                      theorem MusicTheory.AllPairsEvenness.census_DD (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 7 Finset.univ) :
                                                      0 ≤ DD (dvec A) 0 ∧ 0 ≤ DD (dvec A) 1 ∧ 0 ≤ DD (dvec A) 2 ∧ 0 ≤ DD (dvec A) 3 ∧ 0 ≤ DD (dvec A) 4

                                                      The double-cumulative sums are nonnegative for EVERY 7-subset. (Census — the Abel engine.)

                                                      theorem MusicTheory.AllPairsEvenness.census_offorbit (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 7 Finset.univ) (hoff : A ∉ orbitTI) :
                                                      0 < DD (dvec A) 0 ∨ 0 < DD (dvec A) 1 ∨ 0 < DD (dvec A) 2 ∨ 0 < DD (dvec A) 3 ∨ 0 < DD (dvec A) 4

                                                      OFF the T/I-orbit of the diatonic, some double-cumulative sum is strictly positive. (Census — this is what makes the diatonic the UNIQUE minimizer.)

                                                      theorem MusicTheory.AllPairsEvenness.census_onorbit (A : Finset (ZMod 12)) (hA : A ∈ orbitTI) :
                                                      iv A 1 = iv D 1 ∧ iv A 2 = iv D 2 ∧ iv A 3 = iv D 3 ∧ iv A 4 = iv D 4 ∧ iv A 5 = iv D 5 ∧ iv A 6 = iv D 6

                                                      ON the orbit, the interval vector equals the diatonic's, so dvec = 0. (Census.)

                                                      Item 1 — single-V uniqueness via finite census (anchor) #

                                                      The integer admissible potential V₀(k) = (7−k)² (strictly convex, decreasing: 36,25,16,9,4,1) and its all-pairs energy over ℕ: E₀ A = Σ_{k=1..6} iv A k · (7−k)².

                                                      Equations
                                                      Instances For

                                                        E₀ D = 313 (= 2·36+5·25+4·16+3·9+6·4+1·1).

                                                        theorem MusicTheory.AllPairsEvenness.census_E0_unique (k c : ℕ) (orb : Finset (Finset (ZMod 12))) (L : List ℕ) (hL : ∀ m ∈ L, ofBits m ∈ orb) (h : ∀ m < 4096, popN m = k → m ∈ L ∨ E0v (ivN m) ≠ c) (hon : ∀ A ∈ orb, E0 A = c) (A : Finset (ZMod 12)) :

                                                        E0 A = c exactly on an orbit, from the bitmask census off the orbit and a check on it.

                                                        theorem MusicTheory.AllPairsEvenness.item1_min_bits (m : ℕ) :
                                                        m < 4096 → popN m = 7 → 313 ≤ E0v (ivN m)

                                                        Item 1a (anchor). Among all 7-subsets of ℤ/12, the all-pairs energy E₀ is ≥ 313. (Census.)

                                                        Item 1b (anchor). The minimum 313 is attained EXACTLY on the 12 T/I-transposes of the diatonic: E₀ A = 313 ⟺ A ∈ orbitTI. (Census.)

                                                        Item 3 — V-independent uniqueness at (7,12) (capstone) #

                                                        theorem MusicTheory.AllPairsEvenness.E_sub (V : ℕ → ℝ) (A : Finset (ZMod 12)) :
                                                        E V A - E V D = ∑ j ∈ Finset.range 6, ↑(dvec A j) * V (j + 1)

                                                        Energy gap as an interval-vector sum: E V A − E V D = Σ_{j<6} dvec_j · V(j+1).

                                                        theorem MusicTheory.AllPairsEvenness.E_eq_of_mem_orbit (V : ℕ → ℝ) (A : Finset (ZMod 12)) (hA : A ∈ orbitTI) :
                                                        E V A = E V D

                                                        On the orbit, the energy gap vanishes for any V (the interval vector is T/I-invariant).

                                                        theorem MusicTheory.AllPairsEvenness.diatonic_ground_state (V : ℕ → ℝ) (hc0 : 0 ≤ V 1 - 2 * V 2 + V 3) (hc1 : 0 ≤ V 2 - 2 * V 3 + V 4) (hc2 : 0 ≤ V 3 - 2 * V 4 + V 5) (hc3 : 0 ≤ V 4 - 2 * V 5 + V 6) (hdec : V 6 ≤ V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 7 Finset.univ) :
                                                        E V D ≤ E V A

                                                        Item 3, the ≥ half (V-INDEPENDENT ground state). For EVERY decreasing-convex potential V, the diatonic minimizes the all-pairs energy: E V D ≤ E V A for every 7-subset A. The single inequality holds simultaneously for all admissible V — this is the V-independence.

                                                        theorem MusicTheory.AllPairsEvenness.diatonic_unique (V : ℕ → ℝ) (hc0 : 0 < V 1 - 2 * V 2 + V 3) (hc1 : 0 < V 2 - 2 * V 3 + V 4) (hc2 : 0 < V 3 - 2 * V 4 + V 5) (hc3 : 0 < V 4 - 2 * V 5 + V 6) (hdec : V 6 < V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 7 Finset.univ) :
                                                        E V D = E V A ↔ A ∈ orbitTI

                                                        Item 3, the capstone (V-INDEPENDENT UNIQUENESS). For EVERY STRICTLY convex, strictly decreasing potential V, the diatonic is the UNIQUE all-pairs ground state: E V D = E V A holds iff A is a transposition or inversion of the diatonic. One statement, all admissible V at once — the headline of Douthett–Krantz maximal evenness.

                                                        Generic reference-set engine (k-independent) #

                                                        Integer interval-vector difference from an arbitrary reference set R: dg R A j = iv A (j+1) − iv R (j+1). (The diatonic-specific dvec is dg D.)

                                                        Equations
                                                        Instances For
                                                          theorem MusicTheory.AllPairsEvenness.E_sub_g (V : ℕ → ℝ) (R A : Finset (ZMod 12)) :
                                                          E V A - E V R = ∑ j ∈ Finset.range 6, ↑(dg R A j) * V (j + 1)

                                                          Energy gap against an arbitrary reference: E V A − E V R = Σ_{j<6} dg R A j · V(j+1).

                                                          theorem MusicTheory.AllPairsEvenness.E_eq_g (V : ℕ → ℝ) (R A : Finset (ZMod 12)) (e1 : iv A 1 = iv R 1) (e2 : iv A 2 = iv R 2) (e3 : iv A 3 = iv R 3) (e4 : iv A 4 = iv R 4) (e5 : iv A 5 = iv R 5) (e6 : iv A 6 = iv R 6) :
                                                          E V A = E V R

                                                          When iv A agrees with iv R on all six classes, the energy is equal for any V.

                                                          theorem MusicTheory.AllPairsEvenness.groundStateG (R : Finset (ZMod 12)) (V : ℕ → ℝ) (hc0 : 0 ≤ V 1 - 2 * V 2 + V 3) (hc1 : 0 ≤ V 2 - 2 * V 3 + V 4) (hc2 : 0 ≤ V 3 - 2 * V 4 + V 5) (hc3 : 0 ≤ V 4 - 2 * V 5 + V 6) (hdec : V 6 ≤ V 5) (S : Finset (Finset (ZMod 12))) (hsum : ∀ A ∈ S, dg R A 0 + dg R A 1 + dg R A 2 + dg R A 3 + dg R A 4 + dg R A 5 = 0) (hDD : ∀ A ∈ S, 0 ≤ DD (dg R A) 0 ∧ 0 ≤ DD (dg R A) 1 ∧ 0 ≤ DD (dg R A) 2 ∧ 0 ≤ DD (dg R A) 3 ∧ 0 ≤ DD (dg R A) 4) (A : Finset (ZMod 12)) (hA : A ∈ S) :
                                                          E V R ≤ E V A

                                                          Generic V-independent ground state. Given the ∑dg=0 and DD ≥ 0 censuses over a family S, the reference R minimizes the all-pairs energy over S for every decreasing-convex V.

                                                          theorem MusicTheory.AllPairsEvenness.uniqueG (R : Finset (ZMod 12)) (V : ℕ → ℝ) (hc0 : 0 < V 1 - 2 * V 2 + V 3) (hc1 : 0 < V 2 - 2 * V 3 + V 4) (hc2 : 0 < V 3 - 2 * V 4 + V 5) (hc3 : 0 < V 4 - 2 * V 5 + V 6) (hdec : V 6 < V 5) (S orb : Finset (Finset (ZMod 12))) (hsum : ∀ A ∈ S, dg R A 0 + dg R A 1 + dg R A 2 + dg R A 3 + dg R A 4 + dg R A 5 = 0) (hDD : ∀ A ∈ S, 0 ≤ DD (dg R A) 0 ∧ 0 ≤ DD (dg R A) 1 ∧ 0 ≤ DD (dg R A) 2 ∧ 0 ≤ DD (dg R A) 3 ∧ 0 ≤ DD (dg R A) 4) (hoff : ∀ A ∈ S, A ∉ orb → 0 < DD (dg R A) 0 ∨ 0 < DD (dg R A) 1 ∨ 0 < DD (dg R A) 2 ∨ 0 < DD (dg R A) 3 ∨ 0 < DD (dg R A) 4) (hon : ∀ A ∈ orb, iv A 1 = iv R 1 ∧ iv A 2 = iv R 2 ∧ iv A 3 = iv R 3 ∧ iv A 4 = iv R 4 ∧ iv A 5 = iv R 5 ∧ iv A 6 = iv R 6) (A : Finset (ZMod 12)) (hA : A ∈ S) :
                                                          E V R = E V A ↔ A ∈ orb

                                                          Generic V-independent uniqueness. Given the ∑dg=0, DD ≥ 0, off-orbit DD>0 and on-orbit iv-agreement censuses, R is the unique all-pairs ground state over S for every strictly convex, strictly decreasing V.

                                                          k = 5 — pentatonic {0,2,4,7,9} (orbit size 12) #

                                                          theorem MusicTheory.AllPairsEvenness.iv_P :
                                                          iv P 1 = 0 ∧ iv P 2 = 3 ∧ iv P 3 = 2 ∧ iv P 4 = 1 ∧ iv P 5 = 4 ∧ iv P 6 = 0

                                                          iv P = ⟨0,3,2,1,4,0⟩.

                                                          theorem MusicTheory.AllPairsEvenness.census_hsum_P (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 5 Finset.univ → dg P A 0 + dg P A 1 + dg P A 2 + dg P A 3 + dg P A 4 + dg P A 5 = 0
                                                          theorem MusicTheory.AllPairsEvenness.census_DD_P (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 5 Finset.univ → 0 ≤ DD (dg P A) 0 ∧ 0 ≤ DD (dg P A) 1 ∧ 0 ≤ DD (dg P A) 2 ∧ 0 ≤ DD (dg P A) 3 ∧ 0 ≤ DD (dg P A) 4
                                                          theorem MusicTheory.AllPairsEvenness.census_offorbit_P (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 5 Finset.univ → A ∉ orbitOf P → 0 < DD (dg P A) 0 ∨ 0 < DD (dg P A) 1 ∨ 0 < DD (dg P A) 2 ∨ 0 < DD (dg P A) 3 ∨ 0 < DD (dg P A) 4
                                                          theorem MusicTheory.AllPairsEvenness.census_onorbit_P (A : Finset (ZMod 12)) :
                                                          A ∈ orbitOf P → iv A 1 = iv P 1 ∧ iv A 2 = iv P 2 ∧ iv A 3 = iv P 3 ∧ iv A 4 = iv P 4 ∧ iv A 5 = iv P 5 ∧ iv A 6 = iv P 6

                                                          Single-V anchor: E₀ P = 132 and E₀ A = 132 ⟺ A ∈ orbit over all 5-subsets.

                                                          theorem MusicTheory.AllPairsEvenness.pentatonic_ground_state (V : ℕ → ℝ) (hc0 : 0 ≤ V 1 - 2 * V 2 + V 3) (hc1 : 0 ≤ V 2 - 2 * V 3 + V 4) (hc2 : 0 ≤ V 3 - 2 * V 4 + V 5) (hc3 : 0 ≤ V 4 - 2 * V 5 + V 6) (hdec : V 6 ≤ V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 5 Finset.univ) :
                                                          E V P ≤ E V A

                                                          Pentatonic ground state (V-INDEPENDENT). For every decreasing-convex V, the pentatonic minimizes the all-pairs energy over all 5-subsets of ℤ/12.

                                                          theorem MusicTheory.AllPairsEvenness.pentatonic_unique (V : ℕ → ℝ) (hc0 : 0 < V 1 - 2 * V 2 + V 3) (hc1 : 0 < V 2 - 2 * V 3 + V 4) (hc2 : 0 < V 3 - 2 * V 4 + V 5) (hc3 : 0 < V 4 - 2 * V 5 + V 6) (hdec : V 6 < V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 5 Finset.univ) :
                                                          E V P = E V A ↔ A ∈ orbitOf P

                                                          Pentatonic uniqueness (V-INDEPENDENT). For every strictly convex, strictly decreasing V, the pentatonic is the unique all-pairs ground state up to T/I.

                                                          k = 8 — octatonic {0,1,3,4,6,7,9,10} (orbit size 3) #

                                                          theorem MusicTheory.AllPairsEvenness.iv_O :
                                                          iv O 1 = 4 ∧ iv O 2 = 4 ∧ iv O 3 = 8 ∧ iv O 4 = 4 ∧ iv O 5 = 4 ∧ iv O 6 = 4

                                                          iv O = ⟨4,4,8,4,4,4⟩.

                                                          theorem MusicTheory.AllPairsEvenness.census_hsum_O (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 8 Finset.univ → dg O A 0 + dg O A 1 + dg O A 2 + dg O A 3 + dg O A 4 + dg O A 5 = 0
                                                          theorem MusicTheory.AllPairsEvenness.census_DD_O (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 8 Finset.univ → 0 ≤ DD (dg O A) 0 ∧ 0 ≤ DD (dg O A) 1 ∧ 0 ≤ DD (dg O A) 2 ∧ 0 ≤ DD (dg O A) 3 ∧ 0 ≤ DD (dg O A) 4
                                                          theorem MusicTheory.AllPairsEvenness.census_offorbit_O (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 8 Finset.univ → A ∉ orbitOf O → 0 < DD (dg O A) 0 ∨ 0 < DD (dg O A) 1 ∨ 0 < DD (dg O A) 2 ∨ 0 < DD (dg O A) 3 ∨ 0 < DD (dg O A) 4
                                                          theorem MusicTheory.AllPairsEvenness.census_onorbit_O (A : Finset (ZMod 12)) :
                                                          A ∈ orbitOf O → iv A 1 = iv O 1 ∧ iv A 2 = iv O 2 ∧ iv A 3 = iv O 3 ∧ iv A 4 = iv O 4 ∧ iv A 5 = iv O 5 ∧ iv A 6 = iv O 6

                                                          Single-V anchor: E₀ O = 428 and E₀ A = 428 ⟺ A ∈ orbit over all 8-subsets.

                                                          theorem MusicTheory.AllPairsEvenness.octatonic_ground_state (V : ℕ → ℝ) (hc0 : 0 ≤ V 1 - 2 * V 2 + V 3) (hc1 : 0 ≤ V 2 - 2 * V 3 + V 4) (hc2 : 0 ≤ V 3 - 2 * V 4 + V 5) (hc3 : 0 ≤ V 4 - 2 * V 5 + V 6) (hdec : V 6 ≤ V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 8 Finset.univ) :
                                                          E V O ≤ E V A

                                                          Octatonic ground state (V-INDEPENDENT).

                                                          theorem MusicTheory.AllPairsEvenness.octatonic_unique (V : ℕ → ℝ) (hc0 : 0 < V 1 - 2 * V 2 + V 3) (hc1 : 0 < V 2 - 2 * V 3 + V 4) (hc2 : 0 < V 3 - 2 * V 4 + V 5) (hc3 : 0 < V 4 - 2 * V 5 + V 6) (hdec : V 6 < V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 8 Finset.univ) :
                                                          E V O = E V A ↔ A ∈ orbitOf O

                                                          Octatonic uniqueness (V-INDEPENDENT).

                                                          k = 6 — whole-tone {0,2,4,6,8,10} (orbit size 2, degenerate IV with zeros) #

                                                          theorem MusicTheory.AllPairsEvenness.iv_W :
                                                          iv W 1 = 0 ∧ iv W 2 = 6 ∧ iv W 3 = 0 ∧ iv W 4 = 6 ∧ iv W 5 = 0 ∧ iv W 6 = 3

                                                          iv W = ⟨0,6,0,6,0,3⟩.

                                                          theorem MusicTheory.AllPairsEvenness.census_hsum_W (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 6 Finset.univ → dg W A 0 + dg W A 1 + dg W A 2 + dg W A 3 + dg W A 4 + dg W A 5 = 0
                                                          theorem MusicTheory.AllPairsEvenness.census_DD_W (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 6 Finset.univ → 0 ≤ DD (dg W A) 0 ∧ 0 ≤ DD (dg W A) 1 ∧ 0 ≤ DD (dg W A) 2 ∧ 0 ≤ DD (dg W A) 3 ∧ 0 ≤ DD (dg W A) 4
                                                          theorem MusicTheory.AllPairsEvenness.census_offorbit_W (A : Finset (ZMod 12)) :
                                                          A ∈ Finset.powersetCard 6 Finset.univ → A ∉ orbitOf W → 0 < DD (dg W A) 0 ∨ 0 < DD (dg W A) 1 ∨ 0 < DD (dg W A) 2 ∨ 0 < DD (dg W A) 3 ∨ 0 < DD (dg W A) 4
                                                          theorem MusicTheory.AllPairsEvenness.census_onorbit_W (A : Finset (ZMod 12)) :
                                                          A ∈ orbitOf W → iv A 1 = iv W 1 ∧ iv A 2 = iv W 2 ∧ iv A 3 = iv W 3 ∧ iv A 4 = iv W 4 ∧ iv A 5 = iv W 5 ∧ iv A 6 = iv W 6

                                                          Single-V anchor: E₀ W = 207 and E₀ A = 207 ⟺ A ∈ orbit over all 6-subsets.

                                                          theorem MusicTheory.AllPairsEvenness.wholetone_ground_state (V : ℕ → ℝ) (hc0 : 0 ≤ V 1 - 2 * V 2 + V 3) (hc1 : 0 ≤ V 2 - 2 * V 3 + V 4) (hc2 : 0 ≤ V 3 - 2 * V 4 + V 5) (hc3 : 0 ≤ V 4 - 2 * V 5 + V 6) (hdec : V 6 ≤ V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 6 Finset.univ) :
                                                          E V W ≤ E V A

                                                          Whole-tone ground state (V-INDEPENDENT).

                                                          theorem MusicTheory.AllPairsEvenness.wholetone_unique (V : ℕ → ℝ) (hc0 : 0 < V 1 - 2 * V 2 + V 3) (hc1 : 0 < V 2 - 2 * V 3 + V 4) (hc2 : 0 < V 3 - 2 * V 4 + V 5) (hc3 : 0 < V 4 - 2 * V 5 + V 6) (hdec : V 6 < V 5) (A : Finset (ZMod 12)) (hA : A ∈ Finset.powersetCard 6 Finset.univ) :
                                                          E V W = E V A ↔ A ∈ orbitOf W

                                                          Whole-tone uniqueness (V-INDEPENDENT). Despite the degenerate IV (three zero classes), the off-orbit census still yields a strictly positive double-cumulative, so strict uniqueness holds for every strictly convex, strictly decreasing V.