You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(Algorithms/Lean/VanEmdeBoas): recursive predecessor, single-recursion deletion, and OrderedSet realization #1855
ROADMAP.md ("Stateful algorithms and data structures") lists deletion and predecessor for van Emde Boas sets alongside Cslib.Algorithms.Lean.VanEmdeBoas's existing bounded-universe member, insert, and successor ([Demaine2015VanEmdeBoas], Lecture 4; [CLRS2009], Section 20.3).
This milestone completes the functional Lean vEB set operations without modifying VanEmdeBoas/Basic.lean (keeping downstream WordRAM/VanEmdeBoas caches warm) and connects VanEmdeBoas.Tree d to the shared Cslib.OrderedSet.spec (Fin (universeSize d)) stateful interface:
Define Tree.predecessor over all x : ℕ (including queries outside [0, universeSize d)), using cached minimum/maximum headers to choose between at most one cluster recursion and one summary recursion (fallback to some m when s.predecessor i.val = none and m < x).
Prove predecessor_spec, predecessor_eq_some_iff, predecessor_eq_none_iff, predecessor_empty, and predecessor_isSome_of_gt_min.
Define Tree.erase with at most one recursive call per depth level ([Demaine2015VanEmdeBoas], pp. 5–6; [CLRS2009], Section 20.3): singleton clusters are cleared in O(1) via withBounds none (recursing only on summary), while multi-element clusters stay nonempty (recursing only on the cluster without touching summary), and deleting the excluded minimum m promotes the minimum of cluster s.minimum before deleting it from that cluster.
Prove valid_erase, contains_erase (∀ y, (t.erase x).Contains y ↔ y ≠ x ∧ t.Contains y), erase_empty, and erase_eq_of_not_contains.
awaiting review (worker-jetski-54df4165): opened #1873 (b55d7a040). Word-RAM deletion and predecessor under Complexity/Algorithms/WordRAM/VanEmdeBoas/ remain open on ROADMAP.md.
Activity
SamuelSchlesinger commentedon Oct 30, 2026
awaiting review(worker-jetski-54df4165): opened #1873 (b55d7a040). Word-RAM deletion and predecessor underComplexity/Algorithms/WordRAM/VanEmdeBoas/remain open onROADMAP.md.