/-Copyright (c) 2026 Carles MarΓn. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles MarΓn-/module public import Formalizations.MusicTheory.CycleGraphSpectrum /-!# CRT coordinates of the characters of `β€/12` Under `β€/12 β β€/3 Γ β€/4`, the character `Ο_k = dftChar k` (`j β¦ exp(2ΟiΒ·jk/12)`) factors throughthe projection to `β€/3` exactly when `k β {0, 4, 8}` and through the projection to `β€/4` exactly when`k β {0, 3, 6, 9}`. So `Ο_4` generates the augmented (`β€/3`) axis, `Ο_3` the diminished (`β€/4`) axis,and the tritone `Ο_6` is the element of order `2` of the `β€/4` part: the indices `3` and `4` swap. ## Main results * `dftChar_eq_dftChar_iff`: two values of a character agree iff `x * k = y * k` in `ZMod N`.* `factorsThrough_three_iff`: `Ο_k` factors through `β€/12 β β€/3` iff `k β {0, 4, 8}`.* `factorsThrough_four_iff`: `Ο_k` factors through `β€/12 β β€/4` iff `k β {0, 3, 6, 9}`.* `three_axis_eq_multiples_four`, `four_axis_eq_multiples_three`, `six_order_two`: the two axes are generated by `4` and by `3`, and `6` has order `2`. ## References * C. MarΓn, *The Tonnetz spectrum is the generating triad's Fourier balance profile*, Zenodo (2026), doi:10.5281/zenodo.20862821, Proposition 2.-/ @[expose] public section namespace MusicTheory namespace CRTCharacters open CycleGraphSpectrum /-- Two values of the character `dftChar k` agree iff `x * k = y * k`: `stdAddChar` is injective. -/theorem dftChar_eq_dftChar_iff {N : β} [NeZero N] (k x y : ZMod N) : dftChar k x = dftChar k y β x * k = y * k := by simp only [dftChar_apply, ZMod.injective_stdAddChar.eq_iff] /-- The character `Ο_k` of `β€/12` factors through the map `f`: it is constant on the fibres of `f`. -/def FactorsThrough {M : Type*} (f : ZMod 12 β M) (k : ZMod 12) : Prop := β x y : ZMod 12, f x = f y β dftChar k x = dftChar k y /-- The projection `β€/12 β β€/3`. -/abbrev toThree : ZMod 12 β+* ZMod 3 := ZMod.castHom (by norm_num) (ZMod 3) /-- The projection `β€/12 β β€/4`. -/abbrev toFour : ZMod 12 β+* ZMod 4 := ZMod.castHom (by norm_num) (ZMod 4) /-- For a ring homomorphism `f`, `Ο_k` factors through `f` iff `k` kills the kernel of `f`. -/theorem factorsThrough_iff {R : Type*} [CommRing R] (f : ZMod 12 β+* R) (k : ZMod 12) : FactorsThrough f k β β d : ZMod 12, f d = 0 β d * k = 0 := by simp only [FactorsThrough, dftChar_eq_dftChar_iff] constructor Β· intro h d hd simpa using h d 0 (by simp [hd]) Β· intro h x y hxy exact sub_eq_zero.mp (by rw [β sub_mul]; exact h (x - y) (by simp [hxy])) /-- **Proposition 2, first half.** `Ο_k` factors through `β€/3` iff `k β {0, 4, 8}`. -/theorem factorsThrough_three_iff (k : ZMod 12) : FactorsThrough toThree k β k β ({0, 4, 8} : Finset (ZMod 12)) := by rw [factorsThrough_iff] revert k decide /-- **Proposition 2, second half.** `Ο_k` factors through `β€/4` iff `k β {0, 3, 6, 9}`. -/theorem factorsThrough_four_iff (k : ZMod 12) : FactorsThrough toFour k β k β ({0, 3, 6, 9} : Finset (ZMod 12)) := by rw [factorsThrough_iff] revert k decide /-- The `β€/3` axis is generated by `4`. -/theorem three_axis_eq_multiples_four : (Finset.univ.image fun j : ZMod 12 => j * 4) = ({0, 4, 8} : Finset (ZMod 12)) := by decide /-- The `β€/4` axis is generated by `3`. -/theorem four_axis_eq_multiples_three : (Finset.univ.image fun j : ZMod 12 => j * 3) = ({0, 3, 6, 9} : Finset (ZMod 12)) := by decide /-- The tritone `6` is the element of order `2` of the `β€/4` axis. -/theorem six_order_two : (6 : ZMod 12) β 0 β§ 2 * (6 : ZMod 12) = 0 β§ (6 : ZMod 12) β ({0, 3, 6, 9} : Finset (ZMod 12)) := by decide end CRTCharacters end MusicTheory