Documentation

Provenance.Util.ListSort

Insertion sort with exposed bodies #

Mathlib does not expose the bodies of List.orderedInsert and List.insertionSort to other modules, so the kernel cannot reduce a computation that sorts through them, and a decide-checked equation about a computed relation gets stuck there. The two functions below are the same ones, written out again with their bodies exposed. The evaluators sort through these; each comes with a simp lemma rewriting it to Mathlib's, so that proofs reason with Mathlib's lemmas.

def List.orderedIns {α : Type u_1} (r : α → α → Prop) [DecidableRel r] (a : α) :
List α → List α

List.orderedInsert, with an exposed body.

Equations
Instances For
    Dependency graph
    def List.insSort {α : Type u_1} (r : α → α → Prop) [DecidableRel r] :
    List α → List α

    List.insertionSort, with an exposed body.

    Equations
    Instances For
      Dependency graph
      @[simp]
      theorem List.orderedIns_eq {α : Type u_1} (r : α → α → Prop) [DecidableRel r] (a : α) (l : List α) :
      Dependency graph