Chapter 31All the finger bounds at once
Part IV has produced two online BSTs whose guarantees do not compare. GreedyASS (Section 25.3) is within a constant factor of the best weighted dynamic finger bound, with a linear startup term, but no competitive ratio better than is known for it. Tango (Section 26.2) is -competitive with the offline optimum, but its bound is relative to the optimum only, and it is not known to have the finger bounds. Neither guarantee implies the other. Iacono and Langerman (2016) end their paper with Theorem 4.3, which takes the best of both. They combine the two algorithms with the ComboBST construction of Demaine, Iacono, Langerman and Özkan (Section 29.1), so that one BST costs at most a constant times the minimum of the two bounds, plus . They then apply the deamortization of Bose, Collette, Fagerberg and Langerman (Chapter 30), so that every search also costs in the worst case.
The paper gives this theorem in two lines, citing the other two papers. The library proves it. This chapter assembles the proof from the pieces built in the preceding chapters, and states the result with its explicit constants.
This is the abstract BST-operation counterpart of Theorem 4.3 of the paper, in a normalized form. Let saved be any nonempty initial tree on keys. There is one program, fixed before the requests, the start finger, the weights and the offline comparator are chosen, with the following properties.
- Setup. Before the first request, a legal pointer trace of cost turns
savedinto the program’s prepared tree. - Serving. For every sequence of keys less than , the empty sequence included, the program’s instructions form a legal single-finger pointer execution from the prepared tree. They split into one contiguous segment per request, and the segment of visits . The response cost is plus the length of that segment, so (number of instructions).
- Online. The instructions and response costs for do not depend on the later requests.
- Worst case. Every response costs .
- Total. For every start key , every initial tree on keys and every offline rotation-model execution that serves from it with rotations,
where . So the total cost is
Here is WeightedFinger.optimalCostFrom, the infimum over all weightings positive on the keys of the weighted dynamic finger cost with and one unit per request (Section 25.3). It is not assumed to be attained. The comparator is any Execution, so the bound holds in particular for the optimal one. The program is a Combination.Deamortized structure: its fields give the setup trace and the causality, and the theorem gives the rest.
The Lean statement
theorem combined (saved : Tree) (nonempty : saved ≠ .nil) (fields : Nat → IntervalMetadata.Bounds) (oldData : Nat → Nat) : ∃ p : Policy saved fields oldData, ∃ d : Deamortized p, ∀ xs : List Nat, (∀ x ∈ xs, x < saved.size) → ∃ out, d.program xs = some out ∧ Deamortization.Scheduler.ServedStream ⟨d.initial, []⟩ xs out.state.cursor out.instructions out.costs ∧ out.costs.length = xs.length ∧ out.costs.sum = xs.length + out.instructions.length ∧ (∀ cost ∈ out.costs, (cost : ℝ) < 251 + 195 * Real.logb 2 saved.size) ∧ ∀ (start : Nat), start < saved.size → ∀ (s t : Tree) (k : Nat), s.size = saved.size → RotationBST.Execution s xs t k → (d.startup + out.costs.sum : ℝ) ≤ 16 * saved.size + 2480 * (1307904 * min (184903680 * WeightedFinger.optimalCostFrom saved.size start xs) ((8 * ⌈64 * (14 * Real.logb 2 (Nat.log2 saved.size + 1) + 6)⌉₊ : Nat) * (xs.length + k : Nat)) + 3839872 * (46225920 * saved.size : Nat)) := … RotationBST.Geometric.GreedyASS.Combination.combined saved nonempty fields oldDataBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsThe form of Theorem 4.3 for a single weighting. For every nonempty tree on keys there is a combined policy p and a deamortized program d for it. For every weighting positive on the keys, every , and every rotation-model execution with rotations that serves from a tree on keys, if the program serves then its setup plus response costs is at most
The weights are chosen after the program, which never sees them.
The Lean statements
theorem policy_exists (saved : Tree) (nonempty : saved ≠ .nil) (fields : Nat → IntervalMetadata.Bounds) (oldData : Nat → Nat) : Nonempty (Policy saved fields oldData) := … RotationBST.Geometric.GreedyASS.Combination.policy_exists saved nonempty fields oldDataBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitionstheorem policy_exists {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (nonempty : saved ≠ .nil) : Nonempty (Deamortized p) := … RotationBST.Geometric.GreedyASS.Combination.deamortized_exists p nonemptyBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.Definitionstheorem weights_competitive {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} {p : Policy saved fields oldData} (d : Deamortized p) (start : Nat) (key : start < saved.size) (w : Nat → ℝ) (positive : ∀ x < saved.size, 0 < w x) {s t : Tree} {xs : List Nat} {k : Nat} (size : s.size = saved.size) (execution : RotationBST.Execution s xs t k) {out : Deamortization.Scheduler.Output} (completed : d.program xs = some out) : (d.startup + out.costs.sum : ℝ) ≤ 16 * saved.size + 2480 * (1307904 * min (184903680 * WeightedFinger.costFrom w start xs) ((4 * Tango.Combination.linearChargeFactor (Tango.balanced saved.size) : Nat) * (xs.length + k : Nat)) + 3839872 * overhead saved) := … RotationBST.Geometric.GreedyASS.Combination.Deamortized.weights_competitive d start key w positive size execution completedBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsThe first box is all that a reader who wants to confirm the result needs; the second restates its weighted form for a single weighting. The rest of the chapter has two parts. Section 31.1 explains the conventions of the statement, and compares it line by line with the paper’s Theorem 4.3. Section 31.2 gives a map of the proof. The later sections state every theorem of the four interface files Algorithms/Tango/Combination/Abstract.lean, Algorithms/GreedyASS/Combination/Abstract.lean, Algorithms/GreedyASS/Combination/Deamortized/Abstract.lean and their definitions, in the order of the proof: the two source workers (Section 31.3 and Section 31.4), the combined policy (Section 31.5), and its deamortization (Section 31.6).
This chapter needs almost nothing from the construction behind ComboBST and the deamortization. It uses their main theorems, as black boxes with explicit constants, and their interfaces. The reader who wants to know how a combined BST can switch between two algorithms without losing their bounds should read Section 29.1 to Section 29.4, and the reader who wants to know how amortized costs become worst-case costs should read Chapter 30.
31.1 Reading the statement
31.1.1 One program, chosen first
The quantifiers of Results.combined come in this order:
The program is fixed before the requests, before the start key of the finger benchmark, and before the offline execution it is compared with. Like GreedyASS with respect to its weights, it never sees , the weights or the offline execution: they appear only in the bound. It is fixed after the initial tree saved, as an online algorithm knows its own tree, and after fields and oldData, the arbitrary initial contents of the per-node fields that the ComboBST snapshots use. The combined policy’s startup initializes those fields, and the proof builds the same two source workers whatever their initial contents.
The program is a function from whole request sequences to outputs (a Scheduler.Output: final state, instruction list, and one response cost per request). What makes it online is its causal field: the output on a prefix of a sequence is a prefix of the output on the whole sequence, both for the instruction list and for the cost list. Since every request has its own contiguous segment of instructions (Scheduler.ServedStream), the response to is fixed once are known.
31.1.2 Conventions
- What is counted. The program runs on the single-finger pointer machine of Chapter 7 and Chapter 10: every finger move and every rotation is one instruction. The response cost of a request is plus the number of instructions in its segment, so every request costs at least , and the costs sum to plus the number of instructions. The computation that decides the instructions is not counted (see What is not claimed below).
- Setup. The setup trace is paid once, before the first request, and belongs to no response. It is included in the total. The startup of ComboBST (initializing the node fields and saving the first snapshot) is not part of : it is paid inside the response costs, so it is subject to the worst-case bound, and it is included in the additive term .
- A unit per request. The weighted charge is , as in Section 25.3, and the competitive term charges , not . Without the unit, a sequence that repeats one key would have benchmark and no BST could meet it.
- The finger benchmark. starts from an explicit predecessor , and the bound holds for every valid . It is an infimum of real numbers over the weightings positive on . A bound by the infimum implies the bound for every weighting;
Results.weights_competitivestates that form. - The competitive benchmark. is the number of rotations of any
Executionserving : the rotate-to-root model of Chapter 3, where each access rotates the requested key to the root. Its initial tree is any tree on keys, not necessarilysaved. - The doubly logarithmic factor. The paper’s appears as with , coming from Tango on the balanced reference tree
Tree.balancedof height at most . Since , the factor is , and it is positive even when , where . - Constants. They are explicit witnesses, products of the constants of the ingredients, and nowhere near optimal: the coefficient of in the total is about , and that of is about . Section 31.2 shows where each comes from.
- Valid inputs. Requests and the start key must be less than , and
savedmust be nonempty. The empty sequence is allowed: its total is the setup alone.
31.1.3 Compared with Theorem 4.3
| Theorem 4.3 of the paper | combined |
|---|---|
| “There is a BST algorithm” | For each nonempty initial tree, one combined policy and one causal deamortized program, on the single-finger pointer machine |
| ranges over positive weights, minimum over | Infimum over weightings positive on the keys, not assumed attained |
| , with unspecified | , with for every |
| for every rotation-model execution from every tree on keys | |
| , | |
| Explicit constants, setup included | |
| Each search worst-case | Each response ; setup before the first request |
| Exactly one response per request, each visiting its key; the empty sequence included |
The paper’s proof is the sentence before the theorem: deamortize and combine GreedyASS with Tango. Two remarks about how the library carries it out.
- The source contracts are proved. ComboBST does not combine arbitrary algorithms. Its Theorem 3 assumes that each source has well-behaved amortized charges: bounded single accesses, an upper bound that holds on every contiguous piece of the sequence, and a linear restart allowance (
Analysis.WellBehaved, Section 29.1). In the library’s ComboBST theorems these are hypotheses. Here they are theorems:Results.greedy_workerfor GreedyASS andResults.linear_balanced_workerfor Tango. Socombinedhas no hypothesis beyond a nonempty initial tree. - Tango needed a new proof. The Tango analysis of Section 26.2 has a startup term , of order , because it charges each first setting of a preference like a preference change. Combined directly, it would give , which is weaker than Theorem 4.3. The bottom-up preference updates of Section 26.3 bring Tango’s startup term down to . The paper’s one-sentence proof does not address this point.
The sentence before Theorem 4.3 also mentions the working-set bound. Theorem 4.3 does not state it, and neither does the library.
31.1.4 What is not claimed
- Private computation and storage. All bounds count BST instructions. The program decides its instructions by simulating the two sources, replaying their logs, and scheduling their work, and none of this computation is charged or bounded. Planning, instruction logs and snapshots are abstract resources of the model. The library does not claim the clauses of the source papers about auxiliary storage and execution on a finite-word machine: Theorem 7 of the deamortization paper, and the storage parts of Theorems 3 and 5 of the ComboBST paper.
- Dynamic optimality. The competitive factor is , as for Tango. Nothing here says that the program, GreedyASS or Tango is dynamically optimal.
- Optimal constants. The constants witness the asymptotic statement; no effort was made to reduce them.
31.2 How the pieces fit
The proof has five steps, each a theorem of an earlier chapter, or a short theorem of this chapter.
GreedyASS as a BST (Ch. 24) bottom-up Tango on balanced n (Ch. 30)
Performance.Results.bst BottomUp.policy, linear_run_bound
│ replay adapter (x 64) │ replay adapter (x 64)
▼ ▼
greedy_worker linear_balanced_worker
allowance 46225920 n allowance 2816 n
charges: lazy finger on any tree t charges: interleave on balanced n
└───────────────┬─────────────────────────┘
│ Worker.Pair, common allowance F = 46225920 n
▼ ComboBST: Online.Replay.Results.combine (Ch. 33–36)
Policy (Combination.Results.policy_exists)
cost ≤ 1307904 · min(...) + 2531968 F
│ lazy finger → weights (Ch. 15), interleave → OPT (Ch. 14)
▼
weighted_competitive: 184903680 WF*, 4 c (m + R), 3839872 F
│ deamortization: Deamortization.Replay.Results.deamortize (Ch. 37)
▼
Deamortized (Deamortized.Results.policy_exists)
S ≤ 16 n, Σ c ≤ 2480 · cost, each c < 251 + 195 log₂ n
│
▼
combined
- Two workers. ComboBST runs its sources as interruptible workers (Section 29.2): it executes them a bounded number of instructions at a time, and restores their trees from snapshots when it switches. Any online rotation-model algorithm becomes such a worker by the replay adapter
Results.algorithms_well_behaved, which costs at most times the algorithm’s total cost. GreedyASS as a BST (Results.bst) costs at most , and . This givesResults.greedy_worker, with allowance . The bottom-up Tango policy on the balanced reference (Results.balanced_policy) givesResults.linear_balanced_worker, with allowance . - One policy. The two workers are paired (
Results.well_behaved), with the larger allowance for both (Combination.overhead). ComboBST’s replay theoremResults.combineturns the pair into one prepared online policy, whichResults.policy_existspackages as aCombination.Policy. Its cost bound comes fromResults.minimum_boundwith , and restore factor : the factor is , and the additive term is . - From fixed trees to the benchmarks. The GreedyASS charges are those of a lazy finger on a fixed reference tree, and hold for every tree; at the best tree they give , and the characterization of Chapter 15, (
Results.characterization_root), gives the coefficient . The Tango charges are Wilber’s interleave bound on the balanced reference, and byResults.rotation_lower_bound(Chapter 17). The additive term becomes . - Deamortization. The combined policy is again a replay planner. The deamortization theorem for planners
Results.deamortizeturns it into a program with setup at most , worst-case responses below , and total response cost at most times the planner’s run, which is at most twice the policy’s cost (Results.run_bound); hence . - Closed form. The Tango coefficient is (
Results.balanced_linear_factor), which givescombined.
Only step 1 for Tango contains new mathematics: the linear startup of Section 26.3. The rest is arithmetic on the theorems of other chapters.
31.3 The GreedyASS worker
A worker for ComboBST is a Replay.Planner: a causal function that, from its current state and the current request, produces the pointer instructions that serve the request, certified legal and visiting the request (Section 29.2). Its state type here is List Nat × Pointer.Lazy.Online.State: the past requests and the state of the lazy pointer simulation Online.run of an online algorithm. A worker is well-behaved with allowance , constants and charges if, for every valid sequence (Analysis.WellBehaved):
- every single access, from any reachable state, costs at most ;
- the whole sequence costs at most its total charge plus ;
- for every contiguous piece , the total charge of the piece as a sequence of its own, plus , is at most times the charges of the same positions in the original sequence, plus .
The last condition is what lets ComboBST restart a source in the middle of a sequence. For the lazy-finger charges it holds because restarting a lazy finger at the root, instead of at the previous request, costs at most more, which the allowance pays (Results.lazyFinger_stable, Section 29.1).
Theorem (the GreedyASS worker). For every tree saved on keys there is one replay planner starting from saved that is well-behaved, with allowance , and , for the lazy-finger charges of every tree on keys.
/-- One fixed GreedyASS replay worker has the full combination contract forevery same-size lazy-finger reference tree. This is the GreedyASS input toTheorem 4.3; the Tango input and final deamortized combination are separate.Planning and instruction-log storage are abstract BST resources. -/theorem greedy_worker (saved : Tree) : ∃ planner : Worker.Replay.Planner (List Nat × Pointer.Lazy.Online.State) saved, ∀ t : Tree, t.size = saved.size → Analysis.WellBehaved (Worker.Replay.worker planner) saved.size (46225920 * saved.size) 1 20 (fun _ => Charges.lazyFinger 46225920 t) := RotationBST.Geometric.GreedyASS.Combination.greedy_worker savedBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.DefinitionsThe planner is chosen before the reference tree : one GreedyASS worker satisfies the contract for all trees at once. This is what lets the combined policy be chosen before the benchmark. The charges are Charges.lazyFinger, the increments of the root-start lazy-finger cost LazyFinger.cost, scaled by the constant of the GreedyASS simulation; they sum to . The planner is the replay adapter applied to the GreedyASS algorithm of Results.bst, whose bound multiplied by the adapter’s is below .
31.4 The Tango worker
31.4.1 The charge factors
Tango’s charges are Wilber’s interleave bound on a fixed reference tree, one unit per request plus one per preference change (Charges.interleave), scaled by a factor that pays for the work per change. The factor depends on the height of the reference.
/-- Uniform simulation coefficient for the existing Tango upper bound.For a balanced reference it grows doubly logarithmically in its size.The corresponding initialization allowance is `chargeFactor reference * n`;the sharper bottom-up adapter below instead has a separate linear allowance. -/noncomputable def chargeFactor (reference : Tree) : Nat := ⌈64 * (14 * Real.logb 2 (height reference) + 6)⌉₊/-- Simulation coefficient for the bottom-up policy. Startup is accountedseparately by a constant times n, rather than by this coefficient times n. -/noncomputable def linearChargeFactor (reference : Tree) : Nat := 2 * chargeFactor referencechargeFactor reference is : the replay adapter’s factor , times a coefficient that covers the cost of Tango per preference change, per first setting of a preference and per request in the analysis of Section 26.2. linearChargeFactor is twice that, for the bottom-up policy of Section 26.3, whose per-request coefficient is larger and whose startup is accounted separately.
The following five lemmas are the arithmetic facts about these factors that the proofs need: lower bounds by the real expressions, positivity, and the bounds for the balanced reference on keys, whose height is at most .
theorem factor_lower (reference : Tree) : 64 * (14 * Real.logb 2 (height reference) + 6) ≤ (chargeFactor reference : ℝ) := RotationBST.Tango.Combination.factor_lower referenceModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitionstheorem factor_pos (reference : Tree) : 0 < chargeFactor reference := RotationBST.Tango.Combination.factor_pos referenceModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitionstheorem balanced_factor (n : Nat) : chargeFactor (balanced n) ≤ ⌈64 * (14 * Real.logb 2 (Nat.log2 n + 1) + 6)⌉₊ := RotationBST.Tango.Combination.balanced_factor nModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitionstheorem linear_factor_lower (reference : Tree) : 64 * (17 * Real.logb 2 (height reference) + 6) ≤ (linearChargeFactor reference : ℝ) := RotationBST.Tango.Combination.linear_factor_lower referenceModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitionstheorem balanced_linear_factor (n : Nat) : linearChargeFactor (balanced n) ≤ 2 * ⌈64 * (14 * Real.logb 2 (Nat.log2 n + 1) + 6)⌉₊ := RotationBST.Tango.Combination.balanced_linear_factor nModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitions31.4.2 Workers with an startup
The first adapter takes the top-down Tango policy of Section 26.2 as it is.
Theorem (Tango workers). For every Tango policy on a reference tree, and every tree saved of the same size , there is a replay planner starting from saved that is well-behaved, with allowance , , , and the interleave charges of the reference scaled by chargeFactor. The second version adds that the worker, restarted on any sequence , costs at most for every offline execution with rotations. The third is the case of the balanced reference.
theorem worker {reference : Tree} (p : Policy reference) (saved : Tree) (same : saved.size = reference.size) : ∃ planner : Worker.Replay.Planner (List Nat × Pointer.Lazy.Online.State) saved, Analysis.WellBehaved (Worker.Replay.worker planner) saved.size (chargeFactor reference * saved.size) 1 20 (fun _ => Charges.interleave (chargeFactor reference) reference) := RotationBST.Tango.Combination.worker p saved sameModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitionstheorem competitive_worker {reference : Tree} (p : Policy reference) (saved : Tree) (same : saved.size = reference.size) : ∃ planner : Worker.Replay.Planner (List Nat × Pointer.Lazy.Online.State) saved, Analysis.WellBehaved (Worker.Replay.worker planner) saved.size (chargeFactor reference * saved.size) 1 20 (fun _ => Charges.interleave (chargeFactor reference) reference) ∧ ∀ (s t : Tree) (xs : List Nat) (k : Nat), s.size = reference.size → RotationBST.Execution s xs t k → ∀ side, ∃ final cost, Worker.Requests (Worker.Replay.worker planner) side ((Worker.Replay.worker planner).restart side) xs final cost ∧ (cost : ℝ) ≤ (4 * chargeFactor reference : Nat) * (xs.length + k : Nat) + (chargeFactor reference * saved.size : Nat) := RotationBST.Tango.Combination.competitive_worker p saved sameModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.Definitionstheorem balanced_worker (saved : Tree) : ∃ planner : Worker.Replay.Planner (List Nat × Pointer.Lazy.Online.State) saved, Analysis.WellBehaved (Worker.Replay.worker planner) saved.size (chargeFactor (balanced saved.size) * saved.size) 1 20 (fun _ => Charges.interleave (chargeFactor (balanced saved.size)) (balanced saved.size)) := RotationBST.Tango.Combination.balanced_worker savedModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.DefinitionsThese workers are not used for Theorem 4.3. Their allowance, , is for a balanced reference. The combination charges the common allowance a constant number of times (the term ), so a superlinear would leave a superlinear additive term in the final bound.
31.4.3 The linear-startup worker
Theorem (the Tango worker with linear startup). For every tree saved on keys there is a replay planner starting from saved that is well-behaved, with allowance , , , and the interleave charges of Tree.balanced n scaled by linearChargeFactor.
theorem linear_balanced_worker (saved : Tree) : ∃ planner : Worker.Replay.Planner (List Nat × Pointer.Lazy.Online.State) saved, Analysis.WellBehaved (Worker.Replay.worker planner) saved.size (2816 * saved.size) 1 20 (fun _ => Charges.interleave (linearChargeFactor (balanced saved.size)) (balanced saved.size)) := RotationBST.Tango.Combination.linear_balanced_worker savedModels.Rotation, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Lazy.Skeleton, Models.Pointer.Traces, Models.Pointer.Machine, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Algorithms.Tango.Combination.DefinitionsThe planner is the replay adapter applied to the bottom-up Tango policy Tango.BottomUp.policy on the balanced reference. Its run costs at most the reference’s local initialization credit, plus per preference change, plus per request (Results.linear_run_bound). For the balanced reference the local credit is at most (Results.balanced_localAllowance), and the conversion to an online algorithm adds ; the adapter’s factor turns into . Segment stability holds for interleave charges because a contiguous piece keeps every preference change internal to it (Results.interleave_stable).
31.5 The combined policy
31.5.1 The definitions
Both sources use the same state type, and one common allowance:
abbrev SourceState := List Nat × Pointer.Lazy.Online.State/-- One linear restart allowance covers both the GreedyASS and bottom-upTango sources, independently of the doubly logarithmic competitive factor. -/noncomputable def overhead (saved : Tree) : Nat := 46225920 * saved.sizeis the larger of the two allowances. A well-behaved worker stays well-behaved when its allowance grows, so both sources can use .
/-- The reference tree is an analysis parameter, not an algorithm input. -/noncomputable def charges (saved reference : Tree) : Analysis.Charges := fun side => if side then Charges.interleave (Tango.Combination.linearChargeFactor (Tango.balanced saved.size)) (Tango.balanced saved.size) else Charges.lazyFinger 46225920 referenceabbrev pairModel {saved : Tree} (left right : Worker.Replay.Planner SourceState saved) := Worker.Pair.model (Worker.Replay.model left) (Worker.Replay.model right) false falsecharges saved reference assigns the GreedyASS lazy-finger charges on reference to side false and the Tango interleave charges on the balanced tree to side true. The reference tree is a parameter of the analysis only: the algorithm never sees it. pairModel is the pointer model of the paired worker Pair.worker: GreedyASS on side false, Tango on side true, each running its own side false.
Definition (the combined policy). A Policy saved fields oldData consists of the two source planners, the proof that their pair is well-behaved for every reference tree of size , a prepared ComboBST execution (Online.Prepared, Section 29.4) with round budget and restore allowance , and a replay implementation of it (Replay.Implementation).
/-- One certified combined policy. Both sources, their shared snapshot, andits interruptible replay implementation are fixed before choosing a benchmarkor request sequence. The source contract holds for every reference shape. -/structure Policy (saved : Tree) (fields : Nat → IntervalMetadata.Bounds) (oldData : Nat → Nat) where left : Worker.Replay.Planner SourceState saved right : Worker.Replay.Planner SourceState saved supported : ∀ reference : Tree, reference.size = saved.size → Analysis.WellBehaved (Worker.Pair.worker (Worker.Replay.worker left) (Worker.Replay.worker right) false false) saved.size (overhead saved) 1 20 (charges saved reference) prepared : Online.Prepared (pairModel left right) (Analysis.budget (overhead saved) 20) (57 * overhead saved) fields oldData implementation : Online.Replay.Implementation preparedThe field supported quantifies over the reference inside the structure, after the planners: once a policy is chosen, all the reference trees are compared with the same execution. fields and oldData are the initial contents of the node fields, which the prepared startup initializes (Section 39.1 and Section 39.2).
/-- The actual physical execution of the prepared policy, including startup. -/noncomputable def Policy.cost {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (xs : List Nat) : Nat := (Online.execute p.prepared none xs).2noncomputable def Policy.finalTree {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (xs : List Nat) : Tree := p.prepared.current (Online.execute p.prepared none xs).1p.cost xs is the cost of the actual pointer execution Online.execute of the prepared policy on xs, started in its unprepared state none. It includes the preparation, which the first request triggers, and is on the empty sequence. p.finalTree xs is the tree it ends in.
Theorem (one combined policy). For every nonempty tree saved and all initial node contents, a combined policy exists.
theorem policy_exists (saved : Tree) (nonempty : saved ≠ .nil) (fields : Nat → IntervalMetadata.Bounds) (oldData : Nat → Nat) : Nonempty (Policy saved fields oldData) := RotationBST.Geometric.GreedyASS.Combination.policy_exists saved nonempty fields oldDataBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions31.5.2 Bounds for the policy
All the bounds below hold for one policy p, fixed before the reference tree, the start key, the weights and the offline execution.
Theorem (every fixed reference). For every tree on keys and every valid , the policy’s execution is a legal Pointer.Execution that serves from saved and ends in p.finalTree X, and its cost is at most
where is the root-start lazy-finger cost on and is Wilber.interleave on the balanced reference. The second version replaces by its minimum over all trees on keys.
theorem tree_bound {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (reference : Tree) (same : reference.size = saved.size) (xs : List Nat) (valid : ∀ x ∈ xs, x < saved.size) : Pointer.Execution saved xs (p.finalTree xs) (p.cost xs) ∧ (p.cost xs : ℝ) ≤ 1307904 * min (46225920 * (LazyFinger.cost reference xs : ℝ)) (Tango.Combination.linearChargeFactor (Tango.balanced saved.size) * (xs.length + Wilber.interleave (Tango.balanced saved.size) xs : Nat)) + 2531968 * overhead saved := RotationBST.Geometric.GreedyASS.Combination.Policy.tree_bound p reference same xs validBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitionstheorem optimal_bound {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (xs : List Nat) (valid : ∀ x ∈ xs, x < saved.size) : Pointer.Execution saved xs (p.finalTree xs) (p.cost xs) ∧ (p.cost xs : ℝ) ≤ 1307904 * min (46225920 * (LazyFinger.optimalCost saved.size xs : ℝ)) (Tango.Combination.linearChargeFactor (Tango.balanced saved.size) * (xs.length + Wilber.interleave (Tango.balanced saved.size) xs : Nat)) + 2531968 * overhead saved := RotationBST.Geometric.GreedyASS.Combination.Policy.optimal_bound p xs validBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.DefinitionsThe minimum is attained (Results.optimal_attained), so optimal_bound is tree_bound at a minimizing tree.
Theorem (weighted and competitive). For every , and every rotation-model execution with rotations that serves from a tree on keys, the policy’s cost is at most
The second version has , for every weighting positive on the keys, in place of the infimum.
theorem weighted_competitive {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (start : Nat) (key : start < saved.size) {s t : Tree} {xs : List Nat} {k : Nat} (size : s.size = saved.size) (execution : RotationBST.Execution s xs t k) : (p.cost xs : ℝ) ≤ 1307904 * min (184903680 * WeightedFinger.optimalCostFrom saved.size start xs) ((4 * Tango.Combination.linearChargeFactor (Tango.balanced saved.size) : Nat) * (xs.length + k : Nat)) + 3839872 * overhead saved := RotationBST.Geometric.GreedyASS.Combination.Policy.weighted_competitive p start key size executionBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitionstheorem weights_competitive {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (start : Nat) (key : start < saved.size) (w : Nat → ℝ) (positive : ∀ x < saved.size, 0 < w x) {s t : Tree} {xs : List Nat} {k : Nat} (size : s.size = saved.size) (execution : RotationBST.Execution s xs t k) : (p.cost xs : ℝ) ≤ 1307904 * min (184903680 * WeightedFinger.costFrom w start xs) ((4 * Tango.Combination.linearChargeFactor (Tango.balanced saved.size) : Nat) * (xs.length + k : Nat)) + 3839872 * overhead saved := RotationBST.Geometric.GreedyASS.Combination.Policy.weights_competitive p start key w positive size executionBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.DefinitionsThe validity of is not a hypothesis here: it follows from the offline execution. This is the combined bound of Theorem 4.3, with linear startup but with amortized costs.
Theorem (the policy is again a worker). For every reference tree and every choice select of which source’s charges to put on each side, the replay worker of the combined policy is well-behaved with , , allowance overheadFactor 1 20 57 , and the selected charges scaled by chargeFactor 1 20 57 (Replay.overheadFactor, Replay.chargeFactor).
theorem worker_bound {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (reference : Tree) (same : reference.size = saved.size) (select : Bool → Bool) : Analysis.WellBehaved (Worker.Replay.worker p.implementation.planner) saved.size (Online.Replay.overheadFactor 1 20 57 * overhead saved) 1 21 (Online.Replay.scaledCharges (Online.Replay.chargeFactor 1 20 57) (fun side => charges saved reference (select side))) := RotationBST.Geometric.GreedyASS.Combination.Policy.worker_bound p reference same selectBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.DefinitionsSo the combined policy can itself enter a further combination, with either source’s guarantee. Theorem 4.3 does not need this.
31.6 Deamortizing the policy
31.6.1 The deamortized program
Definition (the deamortized program). For a combined policy p, a Deamortized p consists of a prepared tree initial, a setup cost startup and a program from request sequences to scheduler outputs, with:
setup, a legalPointer.Traceof coststartupfromsavedtoinitial, both with the finger at the root, andsetup_bound, ;correct: on every valid sequence the program returns an output whose instructions replay legally frominitial(Multifinger.replay); they form aScheduler.ServedStream, one contiguous segment per request visiting it, with response cost segment length; they form a single-fingerMultifinger.Executionserving the sequence at cost (number of instructions); there is one cost per request, summing to (number of instructions) and to at most timesp.cost; and each cost is below ;causal: the output on a prefix has a prefix of the instructions and a prefix of the costs.
/-- A fixed physical program with exact per-request costs. Setup is paid once,before the sequence. Its choices precede all weights and offline comparators.The simulation bounds abstract BST instructions, not private computation. -/structure Deamortized {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) where initial : Tree startup : Nat program : List Nat → Option Deamortization.Scheduler.Output setup : Pointer.Trace ⟨saved, []⟩ ⟨initial, []⟩ startup setup_bound : startup ≤ 16 * saved.size correct : ∀ keys, (∀ x ∈ keys, x < saved.size) → ∃ out, program keys = some out ∧ Multifinger.replay out.instructions ⟨initial, []⟩ = some out.state.cursor ∧ Deamortization.Scheduler.ServedStream ⟨initial, []⟩ keys out.state.cursor out.instructions out.costs ∧ Multifinger.Execution (Deamortization.Scheduler.cursorState ⟨initial, []⟩) keys (Deamortization.Scheduler.cursorState out.state.cursor) (keys.length + out.instructions.length) ∧ out.costs.length = keys.length ∧ out.costs.sum = keys.length + out.instructions.length ∧ out.costs.sum ≤ 2480 * p.cost keys ∧ ∀ cost ∈ out.costs, (cost : ℝ) < 251 + 195 * Real.logb 2 saved.size causal : ∀ xs ys out, program (xs ++ ys) = some out → ∃ first, program xs = some first ∧ first.instructions <+: out.instructions ∧ first.costs <+: out.costsThe structure records the guarantees of the deamortization theorem of Chapter 30 for this one source. The comparison with p.cost is the only field that mentions the policy. The worst-case bound depends only on , not on the policy.
Theorem (the deamortized program exists). Every combined policy on a nonempty tree has a deamortized program.
theorem policy_exists {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} (p : Policy saved fields oldData) (nonempty : saved ≠ .nil) : Nonempty (Deamortized p) := RotationBST.Geometric.GreedyASS.Combination.deamortized_exists p nonemptyBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsThe proof applies Results.deamortize to the policy’s replay planner. Its total is at most times the planner’s run, and the planner’s run costs at most twice the policy’s execution (Results.run_bound).
31.6.2 Bounds for the program
Theorem (setup included). On every valid sequence, the setup plus all response costs is at most .
theorem total_bound {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} {p : Policy saved fields oldData} (d : Deamortized p) {keys : List Nat} (valid : ∀ x ∈ keys, x < saved.size) {out : Deamortization.Scheduler.Output} (completed : d.program keys = some out) : d.startup + out.costs.sum ≤ 16 * saved.size + 2480 * p.cost keys := RotationBST.Geometric.GreedyASS.Combination.Deamortized.total_bound d valid completedBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsTheorem (weighted and competitive, deamortized). For every and every rotation-model execution with rotations that serves from a tree on keys, the setup plus all response costs is at most
The second version has , for every weighting positive on the keys, in place of the infimum.
theorem weighted_competitive {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} {p : Policy saved fields oldData} (d : Deamortized p) (start : Nat) (key : start < saved.size) {s t : Tree} {xs : List Nat} {k : Nat} (size : s.size = saved.size) (execution : RotationBST.Execution s xs t k) {out : Deamortization.Scheduler.Output} (completed : d.program xs = some out) : (d.startup + out.costs.sum : ℝ) ≤ 16 * saved.size + 2480 * (1307904 * min (184903680 * WeightedFinger.optimalCostFrom saved.size start xs) ((4 * Tango.Combination.linearChargeFactor (Tango.balanced saved.size) : Nat) * (xs.length + k : Nat)) + 3839872 * overhead saved) := RotationBST.Geometric.GreedyASS.Combination.Deamortized.weighted_competitive d start key size execution completedBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.Definitionstheorem weights_competitive {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} {p : Policy saved fields oldData} (d : Deamortized p) (start : Nat) (key : start < saved.size) (w : Nat → ℝ) (positive : ∀ x < saved.size, 0 < w x) {s t : Tree} {xs : List Nat} {k : Nat} (size : s.size = saved.size) (execution : RotationBST.Execution s xs t k) {out : Deamortization.Scheduler.Output} (completed : d.program xs = some out) : (d.startup + out.costs.sum : ℝ) ≤ 16 * saved.size + 2480 * (1307904 * min (184903680 * WeightedFinger.costFrom w start xs) ((4 * Tango.Combination.linearChargeFactor (Tango.balanced saved.size) : Nat) * (xs.length + k : Nat)) + 3839872 * overhead saved) := RotationBST.Geometric.GreedyASS.Combination.Deamortized.weights_competitive d start key w positive size execution completedBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsTheorem (closed form). The same, with replaced by , , and by .
theorem linear_weighted_competitive {saved : Tree} {fields : Nat → IntervalMetadata.Bounds} {oldData : Nat → Nat} {p : Policy saved fields oldData} (d : Deamortized p) (start : Nat) (key : start < saved.size) {s t : Tree} {xs : List Nat} {k : Nat} (size : s.size = saved.size) (execution : RotationBST.Execution s xs t k) {out : Deamortization.Scheduler.Output} (completed : d.program xs = some out) : (d.startup + out.costs.sum : ℝ) ≤ 16 * saved.size + 2480 * (1307904 * min (184903680 * WeightedFinger.optimalCostFrom saved.size start xs) ((8 * ⌈64 * (14 * Real.logb 2 (Nat.log2 saved.size + 1) + 6)⌉₊ : Nat) * (xs.length + k : Nat)) + 3839872 * (46225920 * saved.size : Nat)) := RotationBST.Geometric.GreedyASS.Combination.Deamortized.linear_weighted_competitive d start key size execution completedBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsFinally, the theorem of the headline puts the pieces together: a policy and a program exist, and for every valid sequence the program’s output serves it with one response per request, each below , and the closed-form bound holds for every start key and every offline execution.
theorem combined (saved : Tree) (nonempty : saved ≠ .nil) (fields : Nat → IntervalMetadata.Bounds) (oldData : Nat → Nat) : ∃ p : Policy saved fields oldData, ∃ d : Deamortized p, ∀ xs : List Nat, (∀ x ∈ xs, x < saved.size) → ∃ out, d.program xs = some out ∧ Deamortization.Scheduler.ServedStream ⟨d.initial, []⟩ xs out.state.cursor out.instructions out.costs ∧ out.costs.length = xs.length ∧ out.costs.sum = xs.length + out.instructions.length ∧ (∀ cost ∈ out.costs, (cost : ℝ) < 251 + 195 * Real.logb 2 saved.size) ∧ ∀ (start : Nat), start < saved.size → ∀ (s t : Tree) (k : Nat), s.size = saved.size → RotationBST.Execution s xs t k → (d.startup + out.costs.sum : ℝ) ≤ 16 * saved.size + 2480 * (1307904 * min (184903680 * WeightedFinger.optimalCostFrom saved.size start xs) ((8 * ⌈64 * (14 * Real.logb 2 (Nat.log2 saved.size + 1) + 6)⌉₊ : Nat) * (xs.length + k : Nat)) + 3839872 * (46225920 * saved.size : Nat)) := RotationBST.Geometric.GreedyASS.Combination.combined saved nonempty fields oldDataBounds.StaticTree.Definitions, Bounds.LazyFinger.Definitions, Models.Rotation, Models.Online, Models.Pointer.Lazy.Online.Definitions, Algorithms.Combination.Analysis.Definitions, Models.Pointer.Machine, Models.Multifinger.Program.Definitions, Models.Multifinger.Program.Replay.Definitions, Models.Labelled.Cursor.Definitions, Models.Labelled.Cursor.Map.Definitions, Models.Labelled.Metadata.Definitions, Models.Labelled.Intervals.Definitions, Structures.TreeBuffer.Nodes.Definitions, Structures.TreeBuffer.Shared.Definitions, Algorithms.Combination.Controller.Definitions, Algorithms.Combination.Worker.Definitions, Algorithms.Combination.Refinement.Definitions, Algorithms.Combination.Refinement.Visits.Definitions, Algorithms.Combination.Worker.Replay.Definitions, Algorithms.Combination.Worker.Replay.Model, Algorithms.Combination.Charges.Definitions, Models.Labelled.Intervals.Initialization.Definitions, Structures.TreeBuffer.Nodes.Initialization.Definitions, Structures.TreeBuffer.Cells.Definitions, Structures.TreeBuffer.Snapshot.Definitions, Structures.TreeBuffer.Snapshot.Controller.Definitions, Structures.TreeBuffer.Scan.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Definitions, Structures.TreeBuffer.Snapshot.CellIO.Definitions, Structures.TreeBuffer.Snapshot.Streaming.Refinement.Definitions, Structures.TreeBuffer.Snapshot.Startup.Definitions, Models.Pointer.Walk.Definitions, Models.Pointer.Routing.Definitions, Models.Labelled.Intervals.Access.Definitions, Models.Labelled.Intervals.Maintenance.Definitions, Algorithms.Combination.Rounds.Definitions, Models.Multifinger.Definitions, Structures.TreeBuffer.Shared.Requests.Definitions, Structures.TreeBuffer.Shared.Erasure.Definitions, Models.Pointer.Lazy.Skeleton, Structures.BSTDeque.Definitions, Structures.BSTDeque.Boundary.Definitions, Structures.Tendon.Definitions, Structures.FingerHand.Definitions, Structures.FingerHand.Packed.Definitions, Algorithms.Combination.Online.Definitions, Algorithms.Combination.Online.Startup.Definitions, Algorithms.Combination.Online.Algorithm, Algorithms.Combination.Online.Replay.Definitions, Algorithms.Tango.Algorithm.Definitions, Algorithms.Tango.Reference, Algorithms.Tango.State.Defs, Algorithms.Tango.State.Nesting.Defs, Algorithms.Tango.State, Algorithms.Tango.Preferences.Updates, Bounds.Interleave.Definitions, Algorithms.Tango.Definitions, Algorithms.Tango.Paths, Bounds.Interleave.Wilber, Bounds.Interleave.Transition.Defs, Models.Region, Algorithms.Tango.Auxiliary.Definitions, Models.Pointer.Traces, Algorithms.Splay.Algorithm, Algorithms.Splay.Potential, Algorithms.Tango.Combination.Definitions, Algorithms.GreedyASS.Combination.Definitions, Algorithms.Combination.Worker.Pair.Definitions, Bounds.WeightedFinger.Definitions, Models.Pointer.Mirror.Definitions, Models.Labelled.Ordering.Definitions, Structures.PopTart.Definitions, Structures.PopTart.Mirror.Definitions, Structures.PopTart.Chocolate.Definitions, Structures.PopTart.Located.Definitions, Structures.HeavyPath.Definitions, Structures.HeavyPath.Paired.Definitions, Structures.HeavyPath.Paired.Substitution.Definitions, Structures.HeavyPath.Recursive.Definitions, Structures.HeavyPath.Finger.Definitions, Structures.PopTart.Chocolate.Top.Definitions, Structures.HeavyPath.Paired.Exposure.Definitions, Structures.HeavyPath.Recursive.History.Definitions, Structures.HeavyPath.Finger.Transfer.Definitions, Structures.HeavyPath.Finger.History.Definitions, Structures.HeavyPath.Finger.History.Simulation.Definitions, Structures.HeavyPath.Finger.History.Simulation.Requests.Definitions, Algorithms.Deamortization.Scheduler.Definitions, Algorithms.Deamortization.Finger.Definitions, Structures.HeavyPath.Finger.History.Simulation.Minimum.Definitions, Algorithms.GreedyASS.Combination.Deamortized.DefinitionsThe statement omits the replay and single-finger execution clauses of correct, and the causality, which are fields of the program d. Since d is the existential witness, those fields hold for the same program.