πŸ›οΈ Atlasβœ’οΈFormalizations.MusicTheory.CRTCharacters view on GitHub β†—7 theorems
/-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