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

Chapter 18Conditional entropy

The cost of the optimal root-finger tree has a classical closed form. Up to constant factors it is the entropy bound m+∑xqxlog⁡2(m/qx)m + \sum_x q_x \log_2(m/q_x), where qxq_x counts the requests for xx (Chapter 14). A lazy finger profits from a different kind of regularity: a request is cheap when it is close, in the tree, to the previous request. So the natural candidate for a closed form of the optimal lazy-finger cost is the conditional entropy of each request given its predecessor, the information content of the transitions.

Bose, Douïeb, Iacono and Langerman (2016) show that this candidate fails (Lemma 7 of their paper). Some sequences have conditional entropy zero, since each key is always followed by the same key, and still cost Ω(log⁡n)\Omega(\log n) per request with a lazy finger in any tree. The library proves a stronger form: the sequence costs that much in every dynamic BST. The proof is Wilber’s interleave bound (Chapter 17) applied to a repeated bit-reversal sequence. The paper therefore characterizes the optimal lazy finger differently, by the weighted benchmark of Chapter 15.

Key result · Bose et al. 2016
No BST, and in particular no lazy-finger tree, is bounded by the conditional entropy

For a sequence X=x1,…,xmX = x_1, \dots, x_m on nn keys and a predecessor x0=px_0 = p, let HH be the empirical conditional entropy of xjx_j given xj−1x_{j-1}, in bits, and let the conditional benchmark be m(1+H)m(1 + H), one unit per request plus the information of the transitions.

Lemma 7, for dynamic BSTs. For every constant CC and every startup allowance a:N→Na : \mathbb N \to \mathbb N there are n≥1n \ge 1, a key p<np < n and a sequence XX of m≥nm \ge n valid requests such that H=0H = 0, also when only the transitions inside XX are counted, so that m(1+H)=mm(1 + H) = m, and such that every legal pointer-machine execution serving XX, from any initial tree on nn keys, costs more than

C⋅m(1+H)+a(n).C \cdot m(1 + H) + a(n).

For lazy finger. Theorem 6 (Chapter 16) gives an execution of cost at most 16n+464 LFn∗(X)16n + 464\,\mathrm{LF}^*_n(X). Applying the lemma with 464 C464\,C and 464 a(n)+16n464\,a(n) + 16n then gives LFn∗(X)>C⋅m(1+H)+a(n)\mathrm{LF}^*_n(X) > C \cdot m(1+H) + a(n). So no bound of the form LF∗≤C m(1+H)+a(n)\mathrm{LF}^* \le C\,m(1 + H) + a(n) holds. This two-line combination is arithmetic on the two listed theorems; the library does not state it as a separate theorem.

The Lean statements
theoremConditionalEntropy.Results.obstructionpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:47
/-- Lemma 7 of arXiv:1304.6897, strengthened to normalized request cost andarbitrary universe-dependent startup allowances. Every initial shape and everylegal dynamic execution are quantified, including offline executions. -/theorem obstruction (C : Nat) (allowance : Nat → Nat) :    ∃ n p xs, 0 < n ∧ p < n ∧ n ≤ xs.length ∧ (∀ x ∈ xs, x < n) ∧      entropy n p xs = 0 ∧ adjacentInformation n xs = 0 ∧ cost n p xs = (xs.length : ℝ) ∧      ∀ s t k, s.size = n → Pointer.Execution s xs t k →        (C : ℝ) * cost n p xs + allowance n < k := … normalized_unbounded C allowance
theoremLazyFinger.Dynamic.Results.optimalpropext · Classical.choice · Quot.soundBounds/LazyFinger/Dynamic/Abstract.lean:55
/-- The dynamic/lazy inequality of Theorem 6 of arXiv:1304.6897, stated as alegal offline execution witness from any prescribed initial tree. This doesnot assert an online choice of the optimal reference tree. -/theorem optimal (s : Tree) (xs : List Nat) (valid : ∀ x ∈ xs, x < s.size) :    ∃ u k, Pointer.Execution s xs u k ∧ k ≤ 16 * s.size + 464 * optimalCost s.size xs := …  dynamic_optimal s xs valid
24 definitions in 4 chapters · reading list

The definitions are in Bounds/ConditionalEntropy/Definitions/Abstract.lean and Bounds/Interleave/BitReversal/Definitions/Abstract.lean, and the theorems in the Abstract.lean files next to them. Section 18.1 defines the conditional information and explains the normalization m(1+H)m(1 + H). Section 18.2 shows that deterministic and periodic sequences have zero information. Section 18.3 builds the bit-reversal sequence and bounds its cost with Wilber’s theorem. Section 18.4 assembles the obstruction. Section 18.5 explains why the conditional-entropy bound is still achievable outside the BST model, with more space.

18.1 Empirical conditional information

Everything is empirical: computed from the counts of the sequence itself, with no probabilistic source. The counts are the directed transition frequencies LazyFinger.frequency of Chapter 15: frequency p xs a b is the number of jj with (xj−1,xj)=(a,b)(x_{j-1}, x_j) = (a, b), where x0=px_0 = p. There are exactly mm transitions, one into each request.

defConditionalEntropy.rowTotalpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:9
/-- Total outgoing transition frequency on the finite key universe. -/def rowTotal (n : Nat) (f : Nat → Nat → Nat) (a : Nat) : Nat :=  ∑ b ∈ Finset.range n, f a b
defConditionalEntropy.informationpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:13
/-- Empirical conditional information, multiplied by the sequence length.Zero-frequency terms contribute zero. Outgoing row totals are used so that thefinite sequence's endpoint convention is explicit. -/noncomputable def information (n : Nat) (f : Nat → Nat → Nat) : ℝ :=  ∑ a ∈ Finset.range n, ∑ b ∈ Finset.range n,    (f a b : ℝ) * Real.logb 2 ((rowTotal n f a : ℝ) / (f a b : ℝ))

rowTotal n f a is ra=∑b<nfabr_a = \sum_{b < n} f_{ab}, the number of transitions leaving aa. The information of a frequency matrix is

I(f)  =  ∑a<n∑b<nfablog⁡2rafab.I(f) \;=\; \sum_{a < n} \sum_{b < n} f_{ab} \log_2 \frac{r_a}{f_{ab}}.

A zero entry contributes 00, since Lean’s 0 * _ is 00, whatever the totalized value of the logarithm. Row by row, ∑bfablog⁡2(ra/fab)\sum_b f_{ab} \log_2(r_a/f_{ab}) is rar_a times the entropy of the empirical distribution of successors of aa. So I(f)/mI(f)/m is the conditional entropy H(next∣current)H(\text{next} \mid \text{current}) of the empirical transition distribution. The row totals are the outgoing counts. Among x0,…,xm−1x_0, \dots, x_{m-1} every key appears as a predecessor exactly rar_a times, so the last request xmx_m, which has no successor, is not counted. The docstring calls this the endpoint convention.

defConditionalEntropy.sequenceInformationpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:20
/-- Conditional information of the directed transitions, including the suppliedpredecessor of the first request. It is not implicitly taken to be a tree root. -/noncomputable def sequenceInformation (n p : Nat) (xs : List Nat) : ℝ :=  information n (LazyFinger.frequency p xs)
defConditionalEntropy.adjacentInformationpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:25
/-- Conditional information using only adjacent requests, without an externalpredecessor. Empty and singleton request sequences have no transitions. -/noncomputable def adjacentInformation (n : Nat) : List Nat → ℝ  | [] => 0  | p :: xs => sequenceInformation n p xs

There are two ways to treat the first request.

  • sequenceInformation n p xs uses an explicit predecessor pp for x1x_1. It is not the root of any tree, just a key. This matches the lazy-finger benchmarks with a specified starting finger, and the multiple-tree structure of Section 18.5.
  • adjacentInformation n xs uses only the m−1m - 1 transitions inside the sequence. Empty and one-element sequences have no transitions, hence zero information.

The obstruction holds with both conventions.

defConditionalEntropy.entropypropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:31
/-- The average empirical conditional entropy; empty sequences are totalized. -/noncomputable def entropy (n p : Nat) (xs : List Nat) : ℝ :=  sequenceInformation n p xs / xs.length
defConditionalEntropy.costpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:35
/-- Request-normalized conditional benchmark, so deterministic transitions donot imply a zero service cost. -/noncomputable def cost (n p : Nat) (xs : List Nat) : ℝ :=  xs.length + sequenceInformation n p xs

entropy n p xs is the average H=I/mH = I/m. For m=0m = 0, Lean’s real division by zero returns 00, so the empty sequence has entropy 00. cost n p xs is the conditional benchmark m+Im + I.

Theorem (basic properties). The information of every frequency matrix is nonnegative. The benchmark is at least mm, and it equals m(1+H)m(1 + H), also when m=0m = 0.

18.1.1 The normalization m(1+H)m(1 + H)

The paper writes the conditional bound as O(m(1+H))O(m(1 + H)), and the library defines it as m+Im + I, which is the same thing. The normalization is chosen for three reasons.

  • Empty sequences. The average HH is undefined for m=0m = 0. The total m+Im + I needs no division, and normalization shows that it agrees with m(1+H)m(1 + H) under Lean’s convention I/0=0I/0 = 0, so nothing is lost by stating results with either form.
  • Deterministic transitions. If every key is always followed by the same key, then H=0H = 0, as Section 18.2 shows. A bound C⋅mHC \cdot mH would then claim that serving the sequence is free. Every model in this book charges at least one per request, so such a bound is false for trivial reasons, and its failure says nothing. With the unit per request, the benchmark is mm, and the obstruction says something real: no constant per request suffices.
  • Capacity one. The positive result of Section 18.5 trades space for time with a factor log⁡n/log⁡c\log n / \log c, where cc is the capacity of each local tree. For c=1c = 1 this divides by log⁡21=0\log_2 1 = 0. The library uses (1+log⁡2n)/(1+log⁡2c)(1 + \log_2 n)/(1 + \log_2 c) instead, together with m(1+H)m(1 + H), so every case is a finite and meaningful bound.

The information is also a sum over the actual transitions of the sequence. Each transition a→ba \to b is charged log⁡2(ra/fab)\log_2(r_a / f_{ab}), minus the logarithm of the empirical probability that aa is followed by bb:

defConditionalEntropy.transitionSumpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Definitions/Abstract.lean:50
/-- Sum any fixed charge over the actual directed transitions of a sequence. -/noncomputable def transitionSum (charge : Nat → Nat → ℝ) : Nat → List Nat → ℝ  | _, [] => 0  | p, x :: xs => charge p x + transitionSum charge x xs

Theorem (information as a transition sum). For a valid predecessor pp and valid requests, charging every transition xj−1→xjx_{j-1} \to x_j the amount log⁡2(rxj−1/fxj−1xj)\log_2(r_{x_{j-1}} / f_{x_{j-1} x_j}) and summing over jj gives exactly the information II.

theoremConditionalEntropy.Results.transitionspropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:56
/-- The sequence's empirical information is the sum of the actual transitioncharges; no independent or stationary source assumption is required. -/theorem transitions (n p : Nat) (xs : List Nat)    (initial : p < n) (valid : ∀ x ∈ xs, x < n) :    transitionSum (fun a b => Real.logb 2      ((rowTotal n (LazyFinger.frequency p xs) a : ℝ) / LazyFinger.frequency p xs a b)) p xs =      sequenceInformation n p xs := sequenceInformation_transitions n p xs initial valid

This is the form a data structure can aim for: if request xjx_j costs O(1+log⁡2(ra/fab))O(1 + \log_2(r_a / f_{ab})) given its predecessor, the total is O(m(1+H))O(m(1 + H)). Nothing about independence or stationarity is assumed.

18.2 Deterministic sequences

A sequence is deterministic if one successor function explains all its transitions:

defConditionalEntropy.Followsno axiomsBounds/ConditionalEntropy/Definitions/Abstract.lean:40
/-- Every next request is determined by the previous key. -/def Follows (next : Nat → Nat) : Nat → List Nat → Prop  | _, [] => True  | p, x :: xs => next p = x ∧ Follows next x xs

Follows next p xs says that x1=next(p)x_1 = \mathit{next}(p) and xj+1=next(xj)x_{j+1} = \mathit{next}(x_j). The theorem below is stated directly on frequency matrices instead, which is more general: each row has at most one nonzero entry.

Theorem (deterministic rows carry no information). If fab=0f_{ab} = 0 whenever b≠next(a)b \ne \mathit{next}(a), then I(f)=0I(f) = 0.

theoremConditionalEntropy.Results.deterministicpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:20
/-- A deterministic successor gives zero information, even with unequal counts. -/theorem deterministic (n : Nat) (f : Nat → Nat → Nat) (next : Nat → Nat)    (unique : ∀ a b, b ≠ next a → f a b = 0) : information n f = 0 :=  information_deterministic n f next unique

The row totals may differ arbitrarily: a key that occurs often and a key that occurs once both contribute 00, since in each row the only nonzero term is ralog⁡2(ra/ra)r_a \log_2(r_a / r_a). Unlike the entropy bound of Chapter 14, conditional information ignores how often keys occur. It only measures how predictable each step is.

The sequences used below repeat a fixed period:

defConditionalEntropy.repeatPeriodno axiomsBounds/ConditionalEntropy/Definitions/Abstract.lean:45
/-- Repeat a finite period, preserving all transitions at period boundaries. -/def repeatPeriod (period : List Nat) : Nat → List Nat  | 0 => []  | rounds + 1 => period ++ repeatPeriod period rounds

repeatPeriod period rounds is rounds copies of period, concatenated. The transitions at the period boundaries are kept: the last key of one copy is followed by the first key of the next.

Theorem (repeated periods). Let the period consist of distinct keys. Then every repetition has zero adjacent-request information. With the last key of the period as the explicit predecessor, which is one choice of pp in the period for all repetition counts, the information is zero as well.

theoremConditionalEntropy.Results.adjacent_cyclepropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:25
/-- Every repeated distinct-key period has zero adjacent-request information.No external predecessor is part of this convention. -/theorem adjacent_cycle (n : Nat) (period : List Nat) (distinct : period.Nodup) (rounds : Nat) :    adjacentInformation n (repeatPeriod period rounds) = 0 :=  distinct_period_adjacent_zero n period distinct rounds
theoremConditionalEntropy.Results.cyclepropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:31
/-- With an explicit predecessor, one choice works for every repetition count. -/theorem cycle (n : Nat) (period : List Nat) (distinct : period.Nodup) (nonempty : period ≠ []) :    ∃ p ∈ period, ∀ rounds, sequenceInformation n p (repeatPeriod period rounds) = 0 :=  distinct_period_zero n period distinct nonempty

Distinctness makes the successor of each key unique: in the cyclic order of the period, each key is followed by the same key every time, including across the boundary. The period need not contain every key of the universe; keys that never occur have empty rows.

18.3 The bit-reversal sequence

Chapter 17 introduced the bit-reversal permutation as Wilber’s standard hard example: on a perfect reference tree, nearly every node alternates sides on nearly every request it sees, so the interleave bound is about log⁡2n\log_2 n per request. The obstruction needs a version of this example with an exact recursive structure, so the library builds it on the leaves of a perfect tree.

defWilber.BitReversal.referenceno axiomsBounds/Interleave/BitReversal/Definitions/Abstract.lean:8
/-- A perfect reference BST with `2^height` leaves. Internal keys separate theleaves; requests below visit only leaves. -/def reference : Nat → Tree  | 0 => .node .nil .nil  | height + 1 => .node (reference height) (reference height)
defWilber.BitReversal.requestsno axiomsBounds/Interleave/BitReversal/Definitions/Abstract.lean:14
/-- Bit-reversal order on the leaves: alternate the two child copies of eachsmaller request. Values are full-tree inorder ranks, not leaf indices. -/def requests : Nat → List Nat  | 0 => [0]  | height + 1 => (requests height).flatMap fun x => [x, x + (reference height).size + 1]
  • reference h is the perfect tree of height hh: one node for h=0h = 0, and two copies of reference h below a root for h+1h + 1. It has 2h+1−12^{h+1} - 1 keys, 2h2^h of them leaves.
  • requests h lists the 2h2^h leaves in bit-reversal order, as inorder ranks of the whole tree. For h+1h + 1, every request xx of requests h is replaced by xx, a leaf of the left copy, followed by x+∣reference h∣+1x + |\mathtt{reference}\ h| + 1, the same leaf in the right copy.

For h=2h = 2 the tree has keys 0,…,60, \dots, 6 and the requests are 0,4,2,60, 4, 2, 6: the leaves in the order of their reversed binary indices 00,10,01,1100, 10, 01, 11. The internal keys separate the leaves and are never requested. Consecutive requests always lie in different halves of the root, and inside each half the requests again alternate between its two halves, and so on down.

These are the facts the obstruction needs: the size 2h+1−12^{h+1} - 1, the length 2h2^h, validity, and distinctness, which makes the repeated sequence deterministic.

Theorem (interleave of bit reversal). On its own reference tree, the bit-reversal sequence has interleave quantity at least 12h⋅2h\tfrac12 h \cdot 2^h, that is, at least half an alternation per request at each of hh levels.

theoremWilber.BitReversal.Results.lowerpropext · Classical.choice · Quot.soundBounds/Interleave/BitReversal/Abstract.lean:17
/-- Bit reversal forces a logarithmic interleave count per requested leaf. -/theorem lower (h : Nat) : h * 2 ^ h ≤ 2 * interleave (reference h) (requests h) := interleave_lower h

Here interleave is Wilber’s quantity Wilber.interleave of Chapter 17. The node at the root of each subtree of height g≥1g \ge 1 sees 2g2^g requests that alternate on every step, so 2g−1≥2g−12^g - 1 \ge 2^{g-1} alternations. Summing over the 2h−g2^{h-g} subtrees of each height gives the bound.

The repeated sequence is then served by a single execution, which never resets its tree between periods. Wilber’s bounds of Chapter 17, IB≤12 c\mathrm{IB} \le 12\,c for a pointer-machine execution of cost cc (Results.pointer_lower_bound) and IB≤4r+2m\mathrm{IB} \le 4r + 2m for a rotation execution with rr rotations (Results.rotation_lower_bound), give lower bounds that are linear in the length.

Theorem (every BST pays log⁡n\log n per request). Let XX be rounds repetitions of requests h, of length m=rounds⋅2hm = \mathit{rounds} \cdot 2^h. Every pointer-machine execution serving XX from any tree with 2h+1−12^{h+1} - 1 keys has cost kk with h m≤24 kh\,m \le 24\,k. Every rotation execution with rr rotations has h m≤8r+4mh\,m \le 8r + 4m.

theoremWilber.BitReversal.Results.pointerpropext · Classical.choice · Quot.soundBounds/Interleave/BitReversal/Abstract.lean:20
/-- Every conventional dynamic BST pays for these interleaves, across repeatedperiods without resetting its physical state. -/theorem pointer (h rounds : Nat) {s t : Tree} {k : Nat}    (same : s.size = (reference h).size)    (run : Pointer.Execution s (ConditionalEntropy.repeatPeriod (requests h) rounds) t k) :    h * (ConditionalEntropy.repeatPeriod (requests h) rounds).length ≤ 24 * k :=  repeated_pointer_lower h rounds same run
theoremWilber.BitReversal.Results.rotationspropext · Classical.choice · Quot.soundBounds/Interleave/BitReversal/Abstract.lean:28
/-- Lower bound in the simplified arbitrary-rotation model, with request costskept explicit. -/theorem rotations (h rounds : Nat) {s t : Tree} {k : Nat}    (same : s.size = (reference h).size)    (run : RotationBST.Execution s (ConditionalEntropy.repeatPeriod (requests h) rounds) t k) :    h * (ConditionalEntropy.repeatPeriod (requests h) rounds).length ≤      8 * k + 4 * (ConditionalEntropy.repeatPeriod (requests h) rounds).length :=  repeated_rotation_lower h rounds same run

Since h=log⁡2(n+1)−1h = \log_2(n + 1) - 1, this is Ω(log⁡n)\Omega(\log n) per request. The initial tree is arbitrary; only its size is fixed. The factor 24=2⋅1224 = 2 \cdot 12 combines the factor 2 of the interleave count with the factor 12 of Wilber’s pointer bound.

18.4 The obstruction

The repeated bit-reversal sequence is the witness. It has a distinct period, so its conditional information is zero, and every BST pays Ω(log⁡n)\Omega(\log n) per request on it.

Theorem (bit-reversal obstruction). For every height hh there is a predecessor pp in the universe of reference h such that, for every number of rounds, the repeated bit-reversal sequence has zero conditional information from pp, and every pointer-machine execution of it costs k≥h m/24k \ge h\,m/24.

theoremConditionalEntropy.Results.bit_reversalpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:36
/-- Quantitative bit-reversal obstruction: logarithmic cost per request remainsnecessary despite zero empirical conditional information. -/theorem bit_reversal (h : Nat) :    ∃ p < (Wilber.BitReversal.reference h).size, ∀ rounds,      sequenceInformation (Wilber.BitReversal.reference h).size p        (repeatPeriod (Wilber.BitReversal.requests h) rounds) = 0 ∧      ∀ s t k, s.size = (Wilber.BitReversal.reference h).size →        Pointer.Execution s (repeatPeriod (Wilber.BitReversal.requests h) rounds) t k →        h * (repeatPeriod (Wilber.BitReversal.requests h) rounds).length ≤ 24 * k :=  bit_reversal_obstruction h

To defeat a given constant CC and allowance aa, take h=24C+24h = 24C + 24, so that k≥(C+1) mk \ge (C + 1)\,m, and enough rounds that m>a(n)m > a(n). Concretely, the proof takes 24 a(n)+224\,a(n) + 2 rounds, which also gives m≥nm \ge n.

Theorem (Lemma 7, normalized). For every CC and every allowance aa there are n≥1n \ge 1, p<np < n and a sequence XX of m≥nm \ge n valid requests whose conditional entropy from pp is 00, whose adjacent-request information is 00, and whose conditional benchmark is exactly mm, such that every legal pointer-machine execution of XX from every initial tree on nn keys costs more than C m(1+H)+a(n)C\,m(1 + H) + a(n).

theoremConditionalEntropy.Results.obstructionpropext · Classical.choice · Quot.soundBounds/ConditionalEntropy/Abstract.lean:47
/-- Lemma 7 of arXiv:1304.6897, strengthened to normalized request cost andarbitrary universe-dependent startup allowances. Every initial shape and everylegal dynamic execution are quantified, including offline executions. -/theorem obstruction (C : Nat) (allowance : Nat → Nat) :    ∃ n p xs, 0 < n ∧ p < n ∧ n ≤ xs.length ∧ (∀ x ∈ xs, x < n) ∧      entropy n p xs = 0 ∧ adjacentInformation n xs = 0 ∧ cost n p xs = (xs.length : ℝ) ∧      ∀ s t k, s.size = n → Pointer.Execution s xs t k →        (C : ℝ) * cost n p xs + allowance n < k := normalized_unbounded C allowance
Reading the Lean
  • All executions. The lower bound quantifies over every Pointer.Execution, including offline ones that know the whole sequence, and over every initial tree of the right size. So it bounds the offline optimum, not just one algorithm.
  • Both conventions. The witness has zero information with the explicit predecessor p and with adjacent requests only, so the result does not depend on how the first request is treated.
  • No escape through startup. The allowance a may be any function of nn, chosen before the sequence. The condition n≤mn \le m rules out the degenerate escape of sequences shorter than the universe.
  • Lazy finger. The statement is about dynamic BSTs. The lazy-finger form follows from Results.optimal, as explained in the headline box, but it is not a separate Lean theorem.

18.5 More space beats the obstruction

The obstruction is a statement about binary search trees. It does not say that O(m(1+H))O(m(1 + H)) is out of reach for every pointer structure. Theorem 9 of the same paper achieves it with a structure of multiple trees. For each key aa there is a small local search tree on the cc most frequent successors of aa, shaped according to their transition frequencies, together with one shared balanced fallback tree on all keys. A search starts from the local tree of the previous request. Chapter 28 formalizes this in the linked-search model of Chapter 11.

With local trees of capacity 1≤c≤n1 \le c \le n, the structure uses at most 10 n c10\,n\,c words and serves XX from the predecessor pp at cost at most

6 m(1+H)⋅1+log⁡2n1+log⁡2c6\, m(1 + H) \cdot \frac{1 + \log_2 n}{1 + \log_2 c}

(Results.sequence). With cc about nεn^{\varepsilon}, this is O(m(1+H)/ε)O(m(1 + H)/\varepsilon) with O(n1+ε)O(n^{1 + \varepsilon}) words (Results.polynomial_space). The two results fit together.

  • The multiple-tree structure is not a BST. It follows stored links between different trees, so neither Wilber’s bound nor the obstruction applies to it.
  • It is built from the transition matrix of the sequence it serves, so it is an offline, static structure. Preprocessing time is not part of the bound.
  • Its cost uses the same benchmark ConditionalEntropy.cost as the obstruction, including the unit per request and the explicit predecessor pp.