Documentation

CslibFrontier.DataStructure.FusionTree.WordRAM.Preprocessing

Static preprocessing of a whole fusion tree #

Every eligible large-width internal node stores the words of its actual classically chosen NodeParameters. All other parameter words are zero. Child minima inherit strict ordering and full-key bounds from the leaves. Consequently the concrete contiguous encoding needs no assumed preprocessing header or node-search oracle.

This is a classical static construction. It asserts no RAM preprocessing time, and does not compose the node query with whole-tree traversal or the small-width binary fallback.

Main definitions #

Main results #

References #

A nonempty valid tree's cached minimum is one of its actual leaf keys.

Full cached child minima, in the same order as the interleaved child table.

theorem Cslib.DataStructure.FusionTree.WordRAM.childMinima_strictMono {B m : ℕ} {cs : List Tree} (ht : Tree.Valid B (Tree.node m cs)) (hs : List.Pairwise (fun (x1 x2 : ℕ) => x1 < x2) (Tree.node m cs).keys) :

Sorted distinct leaves imply strictly increasing full child minima.

theorem Cslib.DataStructure.FusionTree.WordRAM.childMinima_fit {B w m : ℕ} {cs : List Tree} (ht : Tree.Valid B (Tree.node m cs)) (hb : ∀ x ∈ (Tree.node m cs).keys, WordRAM.Fits w x) (i : Fin cs.length) :

Every child minimum obeys the full-key bound on the leaves.

Eligibility checks real width, occupancy, ordering and full-key bounds. Small-width binary nodes need no fusion parameters.

One uniform static assignment for all trees. Leaves and ineligible nodes have fifteen zero parameter words. The remaining three header words are supplied by encode.

Exact agreement with the chosen node witness, with no header-correctness hypothesis.

Leaves use no fusion parameters, including empty and singleton leaves.

theorem Cslib.DataStructure.FusionTree.WordRAM.parameterWords_small {w : ℕ} (hw : ¬9 ≤ Nat.log 2 w) (m : ℕ) (cs : List Tree) :
parameterWords w (Tree.node m cs) = fun (x : Fin 15) => 0

Small-width internal nodes use no fusion parameters.

All parameter words fit for every tree and width, independently of validity.

theorem Cslib.DataStructure.FusionTree.WordRAM.parameterEligible_of_valid {w m : ℕ} {cs : List Tree} (hw : 9 ≤ Nat.log 2 w) (ht : Tree.Valid (branching w) (Tree.node m cs)) (hs : List.Pairwise (fun (x1 x2 : ℕ) => x1 < x2) (Tree.node m cs).keys) (hb : ∀ x ∈ (Tree.node m cs).keys, WordRAM.Fits w x) :

Every large-width valid ordered bounded node is eligible for actual preprocessing.

Valid trees with bounded leaves have fitting cached minima and actual parameters. Ordering is unnecessary for this fit statement because eligibility checks it itself.

The built tree has fitting actual preprocessing contents from full-key bounds alone.

theorem Cslib.DataStructure.FusionTree.WordRAM.preprocessed_encoding_exists {w base : ℕ} (xs : List ℕ) (hb : ∀ x ∈ xs, WordRAM.Fits w x) (ha : ArenaFits w base (Tree.build (branching w) xs)) :
∃ (mem : ℕ → ℕ), Rep (parameterWords w) (Tree.build (branching w) xs) base mem ∧ (∀ (a : ℕ), WordRAM.Fits w (mem a)) ∧ decode ((Tree.build (branching w) xs).height + 1) mem base = Tree.build (branching w) xs ∧ (encode (parameterWords w) base (Tree.build (branching w) xs)).length ≤ 126 * xs.length + 18

A concrete whole-tree memory with actual chosen preprocessing, exact decoding and linear allocated words. The arena frontier is explicit; fitting keys alone do not bound it. For unsorted inputs ineligible nodes receive zeros; ordered inputs additionally satisfy parameterEligible_of_valid at every large-width internal node. No query or RAM preprocessing-time certificate is asserted.