Binary Search Trees in Lean Check a result Declarations Bibliography Lean source

Part V · Structures · NotesBibliographic notes

Most structures of this part were introduced inside proofs about dynamic BSTs, and the book follows those proofs. These notes give the origin of each, and some related structures that the book does not use.

Treaps and point sets

The treap (Seidel and Aragon 1996) and the Cartesian tree (Vuillemin 1980) are the same object, studied for different purposes. The use of treaps in Chapter 32 is that of Demaine et al. (2009): a treap whose priorities are the times of the next touches executes an arborally satisfied point set with one touched node per point. The converse direction, from executions to point sets, is also theirs. The random treaps with weighted priorities, which give the static half of the lazy finger characterization, are Theorem 1 of Bose et al. (2016), who attribute the construction to Seidel and Aragon.

Split trees

The split trees of Chapter 33 come from the online simulation of Demaine et al. (2009). They rest on an older idea: a search tree in which splitting off kk keys costs O(log⁡min⁡(k,n−k))O(\log \min(k, n - k)), so that any sequence of splits that separates nn keys costs O(n)O(n) in total. Level-linked 2-3 trees (Brown and Tarjan 1980) support this kind of finger operation, and Hoffmann et al. (1986) used it to sort Jordan sequences in linear time. The library builds its split trees on 2–3–4 trees, the B-trees of order 4 (Bayer and McCreight 1972), and stores them in binary form (Bayer 1972; Guibas and Sedgewick 1978).

Prefix sums and weighted trees

Two-dimensional prefix sums are folklore. The weighted search trees of Chapter 34, with every key xx at depth at most log⁡2(W/wx)\log_2(W/w_x), follow the weighted-median rule of Mehlhorn (1975). The biased search trees of Bent et al. (1985) reach the same depths in a dynamic setting.

Simulating fingers

BST deques, tendons and finger hands (Chapter 35) are the multi-finger simulation of Demaine et al. (2013). Their construction shows that a constant number of persistent fingers can be simulated by one root cursor at a constant factor. The library’s version is a reconstruction with explicit constants. Chalermsook et al. (2018) simulate kk fingers by one with an O(log⁡k)O(\log k) overhead, using techniques from the kk-server problem.

Replays, pop-tarts and heavy paths

The detours of Chapter 36 appear in the deamortization of Bose et al. (2012a), in the proof of their Theorem 6. Pop-tarts (Chapter 37) and the heavy-path representation (Chapter 38) are from the same paper: pop-tarts from its Section 2, heavy paths from its Section 3. Heavy paths themselves are older. The heavy-path decomposition appears in the dynamic trees of Sleator and Tarjan (1983) and in the nearest common ancestor algorithm of Harel and Tarjan (1984). Its key property, that a root-to-leaf path crosses O(log⁡n)O(\log n) light edges, is what keeps the stored depths logarithmic. Weighted versions such as those of the deamortization replace log⁡n\log n by log⁡(W/wx)\log(W/w_x).

Saving trees in their nodes

Tree buffers and snapshots (Chapter 39) are the tree-state buffer of Demaine et al. (2013), Section 3. ComboBST uses them to restore its initial tree at the end of every round without memory outside the tree.