Abstract
Sorting algorithms are fundamental to computer science, and their correctness criteria are well understood as rearranging elements of a list according to a specified total order on the underlying set of elements. As mathematical functions, they are functions on lists that perform combinatorial operations on the representation of the input list. In this paper, we study sorting algorithms conceptually as abstract sorting functions. There is a canonical surjection from the free monoid on a set (lists of elements) to the free commutative monoid on the same set (multisets of elements). We show that sorting functions determine a section (right inverse) to this surjection satisfying two axioms, that do not presuppose a total order on the underlying set. Then, we establish an equivalence between (decidable) total orders on the underlying set and correct sorting functions. The first part of the paper develops concepts from universal algebra from the point of view of functorial signatures, and gives constructions of free monoids and free commutative monoids in (univalent) type theory. Using these constructions, the second part of the paper develops the axiomatisation of sorting functions. The paper uses informal mathematical language, and comes with an accompanying formalisation in Cubical Agda.
| Original language | English |
|---|---|
| Title of host publication | International Conference on Types for Proofs and Programs (TYPES) |
| Editors | Fredrik Nordvall Forsberg, McKinna James |
| Publisher | Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing |
| Pages | 1-23 |
| Number of pages | 23 |
| ISBN (Electronic) | 9783959774413 |
| DOIs | |
| Publication status | Published - 2026 |
| Event | 31st International Conference on Types for Proofs and Programs, TYPES 2025 - Glasgow, United Kingdom Duration: 9 Jun 2025 → 13 Jun 2025 |
Publication series
| Name | Leibniz International Proceedings in Informatics, LIPIcs |
|---|---|
| Publisher | Dagstuhl Publishing |
| Volume | 384 |
| ISSN (Print) | 1868-8969 |
Conference
| Conference | 31st International Conference on Types for Proofs and Programs, TYPES 2025 |
|---|---|
| Country/Territory | United Kingdom |
| City | Glasgow |
| Period | 9/06/25 → 13/06/25 |
Bibliographical note
Publisher Copyright:© Vikraman Choudhury and Wind Wong.
Keywords
- combinatorics
- constructive mathematics
- cubical Agda
- formalisation
- homotopy type theory
- sorting
- type theory
- univalent mathematics
- universal algebra
Fingerprint
Dive into the research topics of 'Symmetries in Sorting'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver