Skip to main navigation Skip to search Skip to main content

Symmetries in Sorting

  • Vikraman Choudhury*
  • , Wind Wong*
  • *Corresponding author for this work

Research output: Chapter in Book / Report / Conference proceeding › Conference contribution › Academic › peer-review

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 languageEnglish
Title of host publicationInternational Conference on Types for Proofs and Programs (TYPES)
EditorsFredrik Nordvall Forsberg, McKinna James
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
Pages1-23
Number of pages23
ISBN (Electronic)9783959774413
DOIs
Publication statusPublished - 2026
Event31st International Conference on Types for Proofs and Programs, TYPES 2025 - Glasgow, United Kingdom
Duration: 9 Jun 2025 → 13 Jun 2025

Publication series

NameLeibniz International Proceedings in Informatics, LIPIcs
PublisherDagstuhl Publishing
Volume384
ISSN (Print)1868-8969

Conference

Conference31st International Conference on Types for Proofs and Programs, TYPES 2025
Country/TerritoryUnited Kingdom
CityGlasgow
Period9/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