Documentation

Complexity.Algorithms.Lean.FusionTree.Capacity

Word-size-dependent fusion-tree capacity #

A power-of-two branching factor leaves explicit slack for checked arithmetic. Above width 512, 16B⁵ ≤ w; below that threshold the branching factor is two. In both regimes the constructed tree has height at most 14 (1 + log_w n), with one constant for all widths. These are arithmetic and tree-height bounds, not an instruction-count certificate.

Main definitions #

Main results #

References #

Below width 512, binary branching suffices up to a uniform constant. At larger widths, the exponent leaves four bits of slack for the fifth-power capacity bound.

Instances For

    Large-width nodes have slack for compression and both rank multiplications.

    One comparison of bases works uniformly in the small- and large-width regimes.

    A single constant bounds the constructed tree's word-logarithmic height, including empty and singleton inputs. Predecessor runtime still requires a constant-time node implementation.

    theorem Cslib.Algorithms.Lean.FusionTree.packed_width_le {w n r : ℕ} (hw : 9 ≤ Nat.log 2 w) (hn : n ≤ branching w) (hr : r ≤ branching w) :
    2 * ((2 * r ^ 4 + 1) * n) ≤ w

    At large widths, a node with at most B keys and at most B relevant bits has enough room for fields of width 2r⁴+1 and the complete count product.

    theorem Cslib.Algorithms.Lean.FusionTree.compression_window_le {w n r : ℕ} (hw : 9 ≤ Nat.log 2 w) (hn0 : 0 < n) (hn : n ≤ branching w) (hr : r ≤ branching w) :
    2 * r ^ 4 + (w - 2 * (w / 2)) ≤ w / 2

    The same packed-width slack puts the entire compressed window in a single product limb.