🏛️ Atlas✒️Formalizations.MusicTheory.TritoneNormal view on GitHub ↗8 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 Mathlib.GroupTheory.SpecificGroups.Dihedralpublic import Mathlib.Data.ZMod.QuotientGrouppublic import Mathlib.SetTheory.Cardinal.Finite /-!# The tritone is the unique normal involution subgroup of `D₁₂` In the `T/I` group `DihedralGroup 12` (`r i = Tᵢ`, `sr j` an inversion), the tritone `T₆ = r 6`is the unique rotation of order `2`, the center is `{T₀, T₆}`, and this center is the unique normalsubgroup of order `2`. A single inversion generates an order-`2` subgroup that is not normal. ## Main results * `orderOf_r_eq_two_iff`: `T₆` is the unique element of order `2` in the rotation group.* `center_eq_zpowers_r_six`, `mem_center_iff`: `Z(D₁₂) = ⟨T₆⟩ = {T₀, T₆}`.* `le_center_of_normal_of_card_eq_two`: in any group, a normal subgroup of order `2` is central.* `normal_card_two_iff`: `H` is normal of order `2` iff `H = Z(D₁₂)` (the tritone lemma).* `zpowers_sr_not_normal`: `⟨I⟩` has order `2` and is not normal, for every inversion `I`. The center computation is Mathlib's `DihedralGroup.center_eq_closure_of_even_ne_two`. ## References * C. Marín, *A tritone-centered self-duality: the set class 6-30 and its order-12  neo-Riemannian dual*, Zenodo (2026), doi:10.5281/zenodo.20820961, Lemma 1 (`lem:tritone`).-/ @[expose] public section namespace MusicTheory open DihedralGroup namespace TritoneNormal /-- `T₆` is the unique rotation of order `2` in `D₁₂`. -/theorem orderOf_r_eq_two_iff (k : ZMod 12) : orderOf (r k : DihedralGroup 12) = 2 ↔ k = 6 := by  rw [orderOf_r]  revert k  decide /-- The center of `D₁₂` is generated by the tritone `T₆`. -/theorem center_eq_zpowers_r_six :    Subgroup.center (DihedralGroup 12) = Subgroup.zpowers (r 6) :=  center_eq_closure_of_even_ne_two (n := 12) (by decide) (by decide) /-- The center of `D₁₂` is `{T₀, T₆}`. -/theorem mem_center_iff (g : DihedralGroup 12) :    g ∈ Subgroup.center (DihedralGroup 12) ↔ g = 1 ∨ g = r 6 := by  rw [Subgroup.mem_center_iff]  revert g  decide /-- The center of `D₁₂` has order `2`. -/theorem card_center : Nat.card (Subgroup.center (DihedralGroup 12)) = 2 := by  rw [center_eq_zpowers_r_six, Nat.card_zpowers, orderOf_r_eq_two_iff] /-- In any group, a normal subgroup of order `2` is contained in the center. -/theorem le_center_of_normal_of_card_eq_two {G : Type*} [Group G] (H : Subgroup G) [hN : H.Normal]    (h2 : Nat.card H = 2) : H ≤ Subgroup.center G := by  intro x hx  rw [Subgroup.mem_center_iff]  intro g  obtain ⟨a, b, hab, huniv⟩ := Nat.card_eq_two_iff.mp h2  have hab' : ∀ z : H, z = a ∨ z = b := fun z => by    have hz : z ∈ ({a, b} : Set H) := huniv ▸ Set.mem_univ z    simpa using hz  have hy : g * x * g⁻¹ ∈ H := hN.conj_mem x hx g  by_contra hne  have hxy : g * x * g⁻¹ ≠ x := fun h => hne (mul_inv_eq_iff_eq_mul.mp h)  have hx1 : x ≠ 1 := by rintro rfl; exact hxy (by simp)  have hy1 : g * x * g⁻¹ ≠ 1 := fun h =>    hx1 (mul_left_cancel ((mul_inv_eq_one.mp h).trans (mul_one g).symm))  rcases hab' 1 with h1 | h1 <;> rcases hab' ⟨x, hx⟩ with h2 | h2 <;>    rcases hab' ⟨_, hy⟩ with h3 | h3 <;> subst h1 <;>    first    | exact hx1 (congrArg Subtype.val h2)    | exact hy1 (congrArg Subtype.val h3)    | exact hxy (congrArg Subtype.val (h3.trans h2.symm)) /-- **The tritone lemma.** A subgroup of `D₁₂` is normal of order `2` iff it is the center`{T₀, T₆}`. -/theorem normal_card_two_iff (H : Subgroup (DihedralGroup 12)) :    (H.Normal ∧ Nat.card H = 2) ↔ H = Subgroup.center (DihedralGroup 12) := by  constructor  · rintro ⟨hN, h2⟩    exact Subgroup.eq_of_le_of_card_ge (le_center_of_normal_of_card_eq_two H h2)      (by rw [card_center, h2])  · rintro rfl    exact ⟨inferInstance, card_center⟩ /-- The subgroup generated by a single inversion has order `2` … -/theorem card_zpowers_sr (j : ZMod 12) : Nat.card (Subgroup.zpowers (sr j)) = 2 := by  rw [Nat.card_zpowers, orderOf_sr] /-- … but it is not normal. -/theorem zpowers_sr_not_normal (j : ZMod 12) : ¬ (Subgroup.zpowers (sr j)).Normal := by  intro hN  have h := (normal_card_two_iff _).mp ⟨hN, card_zpowers_sr j⟩  have hmem : sr j ∈ Subgroup.center (DihedralGroup 12) := h ▸ Subgroup.mem_zpowers (sr j)  rcases (mem_center_iff _).mp hmem with h1 | h1 <;> cases h1 end TritoneNormal end MusicTheory