Documentation

Verification.MergeSortCost

← Mathematical handbook
@[irreducible]
def Verification.mergeComparisons {α : Type u_1} (le : α → α → Bool) :
List α → List α → ℕ

Comparison count of the standard stable merge procedure.

Equations
Instances For
    theorem Verification.mergeComparisons_le {α : Type u_1} (le : α → α → Bool) (xs ys : List α) :
    @[irreducible]
    def Verification.mergeSortWork {α : Type u_1} (le : α → α → Bool) :
    List α → ℕ

    Work in merge-sort recursion: merge comparisons plus two linear traversals per split/merge level. Input comparisons have unit cost, as in the paper.

    Equations
    Instances For
      theorem Verification.mergeSortWork_le_depth {α : Type u_1} (le : α → α → Bool) (d : ℕ) (xs : List α) (h : xs.length ≤ 2 ^ d) :
      mergeSortWork le xs ≤ 3 * xs.length * d

      Each balanced level costs at most three times the input length.

      theorem Verification.mergeSortWork_le {α : Type u_1} (le : α → α → Bool) (xs : List α) :