arXiv · 2606.19936
Prismriver: Formalization of Music Theory and Algorithmic Composition in Lean 4
Abstract
Music theory obeys a rich set of mathematical rules and symmetries. These symmetries follow mathematical structures which can be verified and expressed in the precise language of a proof assistant. In this paper, we present Prismriver, a formalization library of music theory in Lean 4. We use Prismriver to generalize beyond existing work that assumes equal temperament tuning. We also discuss modelling counterpoint music theory with Prismriver. By formalizing music theory in Lean 4, we open the door to verifiable algorithmic composition and accompaniment generation. Prismriver also has a custom DSL integrated with MusicXML exports to interoperate with other music software. Prismriver can be used to compose music with Lean, using monadic composition primitives.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Leni Aniva, Claire Wang. 2026-06-18. Prismriver: Formalization of Music Theory and Algorithmic Composition in Lean 4. https://doi.org/10.1145/3830435.3830954
Cite the original work for its findings. Save a collection to share your selection of sources.