### Abstract

This article contains a formal proof of the well-known fact that number of comparisons that a comparison-based sorting algorithm needs to perform to sort a list of length n is at least log2 (n!) in the worst case, i. e. Ω(n log n).

For this purpose, a shallow embedding for comparison-based sorting algorithms is defined: a sorting algorithm is a recursive datatype containing either a HOL function or a query of a comparison oracle with a continuation containing the remaining computation. This makes it possible to force the algorithm to use only comparisons and to track the number of comparisons made.

### License

BSD License

### Topics

- Computer science/Algorithms

### Session Comparison_Sort_Lower_Bound

- Linorder_Relations
- Comparison_Sort_Lower_Bound

### Depends on

- Landau Symbols
- List Index
- Stirling’s formula

### Used by

- Treaps
- The number of comparisons in QuickSort

### Auto-related entries

- A Verified Efficient Implementation of the Weighted Path Order
- pGCL for Isabelle
- A shallow embedding of HyperCTL*

## Cite

×

Comparison_Sort_Lower_Bound-AFP

    @article{Comparison_Sort_Lower_Bound-AFP,
      author  = {Manuel Eberl},
      title   = {Lower bound on comparison-based sorting algorithms},
      journal = {Archive of Formal Proofs},
      month   = {March},
      year    = {2017},
      note    = {\url{https://isa-afp.org/entries/Comparison_Sort_Lower_Bound.html},
                 Formal proof development},
      ISSN    = {2150-914x},
    }

Download

## Download

× Download latest

Older releases:

- Sep 13, 2023 : Isabelle2023
- Oct 27, 2022 : Isabelle2022
- Dec 14, 2021 : Isabelle2021-1
- Feb 23, 2021 : Isabelle2021
- Apr 18, 2020 : Isabelle2020
- Jun 11, 2019 : Isabelle2019
- Aug 16, 2018 : Isabelle2018
- Oct 10, 2017 : Isabelle2017
- Mar 16, 2017 : Isabelle2016-1