Documentation

Complexity.Algorithms.Lean.VanEmdeBoas.Layout

Universe sizes and a contiguous van Emde Boas layout #

At depth d the universe has size 2 ^ (2 ^ d). A node has a five-word header, with presence, minimum, maximum, split size and child span at offsets 0 through 4. At positive depth, the header is followed by one recursive summary and then one recursive cluster for each element of the smaller universe. All recursive records are allocated, including empty ones.

This is address arithmetic for the modern minimum-excluded variant described in [Dem15], pp. 4–5. The five-word header and contiguous allocation are choices of this formalization. The original priority-queue construction is due to van Emde Boas, Kaas and Zijlstra [vEBKZ77]; we do not identify these layout choices with that paper's construction. No memory representation or RAM running-time theorem is established here.

Main definitions #

Main results #

References #

Size of the depth-d universe; each step squares the previous size.

Instances For

    Depth counts repeated square roots of the universe size, down to the two-element base.

    Number of words in a fully allocated record, including the five-word header.

    Instances For

      A strengthened linear bound that leaves enough slack for the recursive header.

      The fully allocated record occupies at most ten words per universe element.

      Relative start of the summary, immediately after the five-word header.

      Instances For

        Relative start of cluster i in a depth-d + 1 record. The summary occupies slot zero.

        Instances For

          The entire header precedes every summary word.

          Every word of the summary is inside the parent record.

          theorem Cslib.Algorithms.Lean.VanEmdeBoas.cluster_word_lt_span (d : ℕ) {i a : ℕ} (hi : i < universeSize d) (ha : a < span d) :
          clusterOffset d i + a < span (d + 1)

          Every word of each valid cluster is inside the parent record.

          The summary ends before every cluster starts.

          Every summary word precedes every cluster word.

          Ordered clusters occupy nonoverlapping half-open intervals.

          theorem Cslib.Algorithms.Lean.VanEmdeBoas.cluster_word_lt_cluster_word (d : ℕ) {i j a : ℕ} (hij : i < j) (ha : a < span d) (b : ℕ) :

          Every word of an earlier cluster precedes every word of a later cluster.

          Monotonicity of universeSize in the recursion depth.

          Monotonicity of span in the recursion depth.