Skip to content

feat(search-tree): verified deletion for unbalanced binary search trees #359

Closed

Description

@chris-ai1

Scope

ROADMAP.md (stateful algorithms prototype) lists deletion for the
unbalanced binary search tree as open.
Add the textbook deletion algorithm [CLRS2009, Chapter 12] to the pure search-tree layer:

  • popMin: detach the leftmost key of a nonempty tree; erase: delete a key, replacing a
    two-child (or right-child) node by its successor from the right subtree.
  • Semantics: elements_erase (elements (erase x t) = (elements t).erase x for ordered t),
    ordered_erase, and erase_eq_self (absent keys leave the tree unchanged).
  • Costs in the existing node-visit model: eraseVisits with eraseVisits_le_height, and
    height_erase_le (deletion never increases height).
  • Checked examples in ComplexityTests/SearchTree.lean; ROADMAP/paper update.

Out of scope

Extending the shared Cslib.OrderedSet stateful interface with deletion (this would also affect
other realizations), balancing, RAM representations. These stay recorded in the roadmap.

Completion criteria

scripts/check.sh passes; independent review; PR linked here.

Activity

  1. chris-ai1 commented on Oct 22, 2026

    @chris-ai1
    CollaboratorAuthor

    Agent/session: worker-crei-dc679113 (Claude Code, acting for Christian Reitwiessner)
    Role: worker
    State: active
    Branch: feat/search-tree-erase on fork chris-ai1/complexitylib
    Scope: as in the issue description (pure erase/popMin, set semantics, invariant preservation, node-visit and height bounds, tests, docs).
    Next step: implement in Complexity/Algorithms/Lean/SearchTree/{Basic,Cost}.lean.

  2. chris-ai1 commented on Oct 22, 2026

    @chris-ai1
    CollaboratorAuthor

    Status: active — agent/session worker-crei-dc679113

    • Note: assigning the issue failed (account chris-ai1 has read-only access); this comment and the claim above record ownership.
    • Completed: Complexity/Algorithms/Lean/SearchTree/Erase.lean (splitMin, glue, erase, elements_erase, ordered_erase, erase_eq_self, eraseVisits_le_height, height_erase_le), ComplexityTests/SearchTreeErase.lean, ROADMAP/UPSTREAM updates. Commit f4b5694a on chris-ai1:feat/search-tree-erase.
    • Validation: scripts/check.sh — all six gates ok.
    • Next: independent pre-PR review (running), then open PR.
  3. chris-ai1 commented on Oct 22, 2026

    @chris-ai1
    CollaboratorAuthor

    Status: awaiting review — agent/session worker-crei-dc679113

    • PR: feat(search-tree): verified deletion for unbalanced binary search trees #360 (head 820d9446, branch chris-ai1:feat/search-tree-erase)
    • Completed: deletion module, tests, ROADMAP/UPSTREAM, theorem-index entry + review record. Two independent AI reviews (findings addressed; second approved).
    • Validation: full scripts/check.sh ok at f4b5694a; targeted builds after; CI pending.
    • Requesting coordinator review.
  4. SamuelSchlesinger commented on Oct 30, 2026

    @SamuelSchlesinger
    Collaborator

    The previously out-of-scope shared-interface follow-up has landed in #1756: total erase and adaptive minimum extraction now reuse the representation-independent semantics and node-visit certificates. Integration and validation record.

    This preserves the pure-deletion milestone completed here. Balancing and heap/RAM representations remain open in ROADMAP; allocation, comparison implementation and pure client computation are still excluded from these node-visit bounds. Agent coordination by codex-ordered-set-integrate-20261030.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions