Documentation

CslibFrontier.DataStructure.VanEmdeBoas.Elements

Finite-set abstraction of recursive van Emde Boas trees #

The finite set below is a mathematical observation of the recursive representation. The operations do not enumerate this finite set. No execution-time bound is attached to constructing the observation.

Main definitions #

Main results #

References #

The representation and its source credit are described in CslibFrontier.DataStructure.VanEmdeBoas.Basic.

Mathematical finite-set abstraction; this enumeration is not used by the operations.

The finite observation includes exactly the recursively represented keys.

@[simp]

The empty van Emde Boas tree represents the empty finite set of keys.

The finite-set observation commutes with bounded insertion.

theorem Cslib.DataStructure.VanEmdeBoas.Tree.successor_elements_some_iff {d : ℕ} {t : Tree d} (ht : t.Valid) (x y : ℕ) :
t.successor x = some y ↔ y ∈ t.elements ∧ x < y ∧ ∀ z ∈ t.elements, x < z → y ≤ z

A successful successor is the least finite-set element strictly above the query.

An absent successor means that every finite-set element is at most the query.

The finite-set observation commutes with deletion of any key x : ℕ.

theorem Cslib.DataStructure.VanEmdeBoas.Tree.predecessor_elements_some_iff {d : ℕ} {t : Tree d} (ht : t.Valid) (x y : ℕ) :
t.predecessor x = some y ↔ y ∈ t.elements ∧ y < x ∧ ∀ z ∈ t.elements, z < x → z ≤ y

A successful predecessor is the greatest finite-set element strictly below the query.

An absent predecessor means that every finite-set element is at least the query.

On a valid tree, strict predecessor lookup computes OrderedSet.predecessor of the stored finite set.