Parameters, Threshold Inequalities, and Succinct Space Accounting for the WHP Dictionary #
This module defines the dimension, hashing, buffer, SWAR B+-tree, and memory-layout parameters for
the with-high-probability fixed-capacity succinct dynamic dictionary (insert, delete, query),
and proves the threshold and succinct word-space inequalities across all word widths w and all
n_max ≤ U, adapting the partition hash table architecture of Bender, Farach-Colton, J. Kuszmaul,
and W. Kuszmaul, SOSA 2024, Sections 2.2 and 3–5, pp. 363–373; author copy
pp. 3–7.
Parameter regimes, adaptations vs. SOSA 2024, and theoretical O_c(1) constants #
Where SOSA 2024 assumes zero-space oracle access to fully random hash functions on w-bit keys
with w = Θ(log n) and no associated values, this formalization instantiates explicit seeded
hashing, arbitrary key universes n_max ≤ U, value payloads Fin V, and arbitrary word widths
w:
- Below the
c-only capacity thresholdwhpThreshold c = 2 ^ bMinWhp c(bMinWhp c = Θ(c^6)), the dictionary uses a deterministic bit-packed array ofn_maxentries (Present,Keys,Values), and byNat.mul_clog_le_add_clog_choose,n_max * keyBits U ≤ optBits + (bMinWhp c + 2) * n_max * logLogFactor n_max. - At or above
whpThreshold c ≤ n_max(bMinWhp c ≤ ⌊log₂ n_max⌋),Nat.mul_log_le_add_sqgivescodeExpWhp c * logLogFactor n_max ≤ bCharWhp n_max = ⌊log₂ n_max⌋ / 4, simultaneously discharging Thorup's salted bit-packed double-tabulation threshold [Tho13]2 * doubleTabCodeBound (cTabWhp c + 1) (dTabWhp c) (qTabWhp c) (kIndepWhp c n_max) ≤ 2 ^ bCharWhp n_max, the polylogarithmic scale separation(slabScale n_max) ^ 24 ≤ 2 ^ bCharWhp n_max, front-yard/backyard quotient conservation (sum_sub_capFront_le_poolSize), sublinear2 ^ bCharWhp n_max-ary buffer-trie bit budgets (qEpochWhp n_max = (slabScale n_max) ^ 18), and the SWAR B+-tree branching bound8 ≤ tMinWhp n_max. - Note that
whpThreshold candwhpSpaceFactor care explicit theoreticalO_c(1)constants (large due tobMinWhp c = Θ(c^6)), andwhpSpacedefines thew-bit word budget (whpSpace_le_succinctWords) coupled to live Word-RAM execution inCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp(impl,implStandard,seq_whp,poly_seq_whp,reachable_step_whp).
Main definitions #
Cslib.DataStructure.Dictionary.SuccinctWhp.cEff,cTabWhp,qTabWhp,dTabWhp,codeExpWhp,bMinWhp,whpThreshold:c-only exponent, tabulation, and capacity-threshold parameters.Cslib.DataStructure.Dictionary.SuccinctWhp.bWhp,numBucketsWhp,quotBitsWhp,fpBitsWhp,bCharWhp,sMaxWhp,kIndepWhp,qEpochWhp: bucket, quotient, fingerprint, salt, and epoch parameters forwhpThreshold c ≤ n_max.Cslib.DataStructure.Dictionary.SuccinctWhp.deltaWhp,capFrontWhp,capBackWhp,capMaxWhp,poolSizeWhp,tMinWhp,nSliceWhp: front-yard/backyard conservation and SWAR B+-tree slice parameters.Cslib.DataStructure.Dictionary.SuccinctWhp.whpSpace,whpSpaceFactor,whpSpaceConst: totalw-bit word footprint andc-only succinct space constants.
Main results #
Cslib.DataStructure.Dictionary.SuccinctWhp.codeExpWhp_mul_ell_le_bCharWhp:codeExpWhp c * Dynamic.logLogFactor n_max ≤ bCharWhp n_maxwheneverwhpThreshold c ≤ n_max.Cslib.DataStructure.Dictionary.SuccinctWhp.keysWordBitsWhp_lt_log,Cslib.DataStructure.Dictionary.SuccinctWhp.valsWordBitsWhp_lt_log: packed SWAR B+-tree key and value/child words fit strictly below⌊log₂ n_max⌋bits wheneverwhpThreshold c ≤ n_max.Cslib.DataStructure.Dictionary.SuccinctWhp.slabScale_le_tMinWhp_cubed: branching cube boundslabScale n_max ≤ (tMinWhp n_max) ^ 3wheneverwhpThreshold c ≤ n_max.Cslib.DataStructure.Dictionary.SuccinctWhp.two_mul_doubleTabCodeBound_le_pow_bCharWhp: Thorup'sk-uniqueness threshold holds for allwhpThreshold c ≤ n_max.Cslib.DataStructure.Dictionary.SuccinctWhp.sum_sub_capFront_le_poolSize: 3-case front-yard/backyard conservation bound across all0 ≤ n ≤ n_max.Cslib.DataStructure.Dictionary.SuccinctWhp.whpSpace_le_succinctWords:whpSpace c U V w n_max ≤ Dynamic.succinctWords (whpSpaceFactor c) whpSpaceConst U V w n_maxfor everywand everyn_max ≤ U.
References #
Section 1: c-only exponent, tabulation, and capacity-threshold parameters #
Normalized failure exponent max c 1 ≥ 1.
Number of base-2 ^ bCharWhp key characters 8 * (cEff c + 5) (≥ 48), serving as both the
Stage-1 reduced-key character count and the constant height of the G/S buffer tries.
Double-tabulation expansion parameter q = 4 * (cEff c + 6) + 2 (≥ 30).
Double-tabulation intermediate tuple length d = 2 * qTabWhp c * (cTabWhp c + 1).
Combined logarithmic exponent multiplier 320 + 16 * (cTabWhp c + 1) ^ 2 * qTabWhp c (Θ(c^3))
chosen so codeExpWhp c * Dynamic.logLogFactor n_max ≤ bCharWhp n_max discharges both Thorup's code
bound and all polylogarithmic scale inequalities. Kept non-exposed so whnf never unrolls
whpThreshold c = 2 ^ bMinWhp c.
Logarithmic exponent multiplier codeExpWhp c is at least 320.
Minimum ⌊log₂ n_max⌋ threshold 64 * (codeExpWhp c) ^ 2 + 16 * codeExpWhp c (Θ(c^6)).
Kept non-exposed so whnf never unrolls whpThreshold c = 2 ^ bMinWhp c.
Capacity threshold 2 ^ bMinWhp c separating the deterministic bit-packed regime
(n_max < whpThreshold c) from the succinct two-stage double-tabulation regime
(whpThreshold c ≤ n_max). Kept non-exposed so whnf never reduces 2 ^ bMinWhp c.
Explicit unfolding equation whpThreshold c = 2 ^ bMinWhp c.
Capacity threshold whpThreshold c is strictly positive.
Section 2: Bucket, quotient, fingerprint, salt, B+-tree, and buffer parameters #
Tabulation character width ⌊log₂ n_max⌋ / 4.
Feistel bucket index bit-width ⌊log₂ n_max⌋ - 12 * Dynamic.logLogFactor n_max.
Number of Feistel buckets M = 2 ^ bWhp n_max.
Stored quotient bit-width keyBits U - bWhp n_max.
Salted fingerprint bit-width 36 * Dynamic.logLogFactor n_max
(2 ^ fpBitsWhp n_max = (slabScale n_max) ^ 36).
Per-bucket salt search bound (cEff c + 4) * slabScale n_max.
Required k-wise independence degree 2 * sMaxWhp c n_max.
Deamortization epoch length Q = (slabScale n_max) ^ 18.
Per-bucket load concentration margin
δ = n_max / (numBucketsWhp n_max * (8 * slabScale n_max)).
Dedicated front-yard slot capacity per bucket ⌊n_max / M⌋ - 4 * deltaWhp n_max.
Per-bucket backyard pointer directory capacity 2 * (slabScale n_max) ^ 11.
Maximum good-event bucket occupancy 4 * (slabScale n_max) ^ 12.
Global shared backyard pool capacity n_max - numBucketsWhp n_max * capFrontWhp n_max.
Minimum degree t ≥ 2 of internal SWAR B+-tree nodes:
max 2 (⌊log₂ n_max⌋ / (160 * Dynamic.logLogFactor n_max)).
SWAR key lane bit-width fpBitsWhp n_max + 2 = 36 * Dynamic.logLogFactor n_max + 2.
SWAR child/local-coord lane bit-width 12 * Dynamic.logLogFactor n_max + 8.
Packed SWAR keys-word bit-width 2 * tMinWhp n_max * keyLaneBitsWhp n_max.
Packed SWAR values/children-word bit-width 2 * tMinWhp n_max * valLaneBitsWhp n_max.
Packed SWAR B+-tree node metadata bit-width Dynamic.logLogFactor n_max + 4
(isLeaf + keyCount).
Nodes per SWAR B+-tree slice 32 * (slabScale n_max) ^ 12 / (tMinWhp n_max - 1) + 64.
Total SWAR B+-tree nodes across all 3 * M slices (3 independent roles per bucket).
Maximum BufTrie nodes per buffer ((cTabWhp c + 1) * qEpochWhp n_max + 2).
Section 3: Threshold inequalities for whpThreshold c ≤ n_max #
When whpThreshold c ≤ n_max, bMinWhp c ≤ ⌊log₂ n_max⌋.
Every capacity n_max ≥ whpThreshold c is at least 4.
For every n_max, tMinWhp n_max ≤ slabScale n_max.
Exact power-of-two expansion 2 ^ valLaneBitsWhp n_max = 256 * (slabScale n_max) ^ 12.
Core threshold separation: for all whpThreshold c ≤ n_max,
codeExpWhp c * Dynamic.logLogFactor n_max ≤ bCharWhp n_max.
When whpThreshold c ≤ n_max, 320 * Dynamic.logLogFactor n_max ≤ bCharWhp n_max.
When whpThreshold c ≤ n_max, 1280 * Dynamic.logLogFactor n_max ≤ Nat.log 2 n_max.
When n_max ≤ U, bucket bit-width bWhp n_max is at most keyBits U.
Quotient bit-width plus bucket bit-width equals keyBits U whenever n_max ≤ U.
When whpThreshold c ≤ n_max, numBucketsWhp n_max * (slabScale n_max) ^ 12 ≤ n_max.
Capacity n_max is bounded by 2 * numBucketsWhp n_max * (slabScale n_max) ^ 12.
When whpThreshold c ≤ n_max, sMaxWhp c n_max ≤ 2 ^ bCharWhp n_max.
When whpThreshold c ≤ n_max, 8 ≤ tMinWhp n_max.
When whpThreshold c ≤ n_max,
keysWordBitsWhp n_max + keyLaneBitsWhp n_max < Nat.log 2 n_max.
When whpThreshold c ≤ n_max,
valsWordBitsWhp n_max + valLaneBitsWhp n_max < Nat.log 2 n_max.
Thorup's k-uniqueness threshold inequality for (cTabWhp c + 1, dTabWhp c, qTabWhp c):
whenever whpThreshold c ≤ n_max,
2 * doubleTabCodeBound (cTabWhp c + 1) (dTabWhp c) (qTabWhp c) (kIndepWhp c n_max) ≤ 2 ^ bCharWhp n_max.
Section 4: Three-case Front-Yard / Backyard conservation bound #
Three-case Front-Yard / Backyard conservation theorem:
Suppose M = numBucketsWhp n_max buckets hold counts X : Fin M → ℕ summing to n ≤ n_max, and
every bucket satisfies both M * X b ≤ n + M * deltaWhp n_max and
n ≤ M * X b + M * deltaWhp n_max (|X b - n / M| ≤ deltaWhp n_max). Then:
- Every bucket uses fewer than
capBackWhp n_maxbackyard slots (X b - capFrontWhp n_max < capBackWhp n_max), - Every bucket has total load at most
capMaxWhp n_max, and - Total backyard usage across all
Mbuckets satisfies∑ b, (X b - capFrontWhp n_max) ≤ poolSizeWhp n_max.
Section 5: Memory layout and master succinct space theorem (whpSpace_le_succinctWords) #
Word footprint in the small-n_max deterministic regime (n_max < whpThreshold c):
32 header words plus bit-packed Present (1 bit), Keys (keyBits U bits), and Values
(valBits V bits).
Word footprint in the large-n_max regime (whpThreshold c ≤ n_max), summing 32 header words,
Stage-2 salted bucket and fingerprint double-tabulation tables, bit-packed quotients and values,
per-slot and per-bucket metadata, shared backyard slab pools, SWAR B+-tree slices, and both epoch
BufTrie arrays.
The large-regime layout reserves its first 32 words for the header.
Total w-bit word footprint of the WHP succinct dictionary across all n_max.
c-only redundancy multiplier on n_max * logLogFactor n_max (Θ(c^6) due to bMinWhp c).
Universal additive w-bit word slack (160 words, independent of c, U, V, w, n_max).
When whpThreshold c ≤ n_max, 2 ^ (3 * bCharWhp n_max) ≤ n_max.
When whpThreshold c ≤ n_max, all 2 ^ bCharWhp n_max-scaled hash and BufTrie bit counts
are individually bounded by n_max.
Master succinct word-space bound valid across all c, U, V, w, n_max with n_max ≤ U:
whpSpace c U V w n_max ≤ Dynamic.succinctWords (whpSpaceFactor c) whpSpaceConst U V w n_max.
Branching cube bound for SWAR B+-tree height: when whpThreshold c ≤ n_max,
slabScale n_max ≤ (tMinWhp n_max) ^ 3.
Section 5: Stage-1 hash bit-widths and auxiliary large-regime logarithmic bounds #
Stage-1 input bit-width max 1 (keyBits U) ≥ 1, satisfying U ≤ 2 ^ w0Whp U for all U.
When whpThreshold c ≤ n_max, (slabScale n_max) ^ 96 ≤ n_max.