Pătrașcu Power-of-Two Spillover Representation #
This file formalizes the power-of-two spillover encoding of Mihai Pătrașcu, Succincter ([Patrascu2008, Lemma 3]), as specialized in Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, Dynamic Dictionary with Subconstant Wasted Bits per Key ([LiLiangYuZhou2024, Section 3.4, Lemma 3.8 and Footnote 4]; arXiv:2310.20536v1, PDF p. 11 / printed p. 10).
Given a finite payload universe Fin X (1 ≤ X) and spillover parameter r_sp ≥ 1, we set
M := memBits X r_sp (0 when X ≤ r_sp, and ⌊log₂(X / r_sp)⌋ otherwise) and
K := spillUniv X r_sp := ⌈X / 2 ^ M⌉. Because the memory-bit modulus 2 ^ M is an exact power of
two, encode splits x < X into (x / 2 ^ M, x % 2 ^ M) ∈ Fin K × Fin (2 ^ M), decodeVal
reconstructs k * 2 ^ M + m with exact round-trip identity, K ≤ 2 * r_sp, and the bit-redundancy
M + log₂ K - log₂ X is at most 2 / r_sp bits (with multiplicative ℕ, ℚ, and Nat.clog 2
batch forms for n independent payloads at r_sp = n).
Scope note #
This module supplies the pure mathematical spillover primitive for the large-parameter-regime
dynamic dictionary of [LiLiangYuZhou2024, Section 5]. Word-RAM O(1) bit-shift and bit-mask
evaluation, variable-length adapter trees, strong history independence, dynamic resizing, and
super-polynomial key universes are not formalized here.
Main definitions #
Cslib.DataStructure.Dictionary.Spillover.memBits: memory bit widthM.Cslib.DataStructure.Dictionary.Spillover.spillUniv: spillover universe sizeK = ⌈X / 2 ^ M⌉.Cslib.DataStructure.Dictionary.Spillover.encode,decodeVal,decode?,equiv: spillover encoding, integer reconstruction, checked partial inverse, and exact subtype bijection.
Main results #
spillUniv_le_two_mul,le_spillUniv_of_le,lt_spillUniv_of_mul_two_pow_lt: spillover universe boundsr_sp ≤ K ≤ 2 * r_sp(and strictr_sp < Kwhenr_sp * 2 ^ M < X).decodeVal_encode,encode_decodeVal,encode_injective,decode?_encode,decode?_eq_some_iff: exact round-trip and injectivity laws.mul_spillUniv_mul_two_pow_le,spillUniv_mul_two_pow_div_le_rat,memBits_add_logb_spillUniv_le,pow_spillUniv_mul_two_pow_le_three_mul,clog_mul_spillUniv_pow_add_le: bit-redundancy bounds inℕ,ℚ,ℝ, andNat.clog 2.
References #
Number of raw memory bits M = ⌊log₂(X / r_sp)⌋ in the power-of-two spillover split of
Fin X with parameter r_sp (equals 0 when X ≤ r_sp, [LiLiangYuZhou2024, Footnote 4]).
Spillover universe size K = ⌈X / 2 ^ M⌉ for universe X and parameter r_sp.
Spillover universe and bit-redundancy bounds (Lemma 3.8) #
Logarithmic bit-redundancy bound (Lemma 3.8 of Li–Liang–Yu–Zhou 2024; Lemma 3 of
Pătrașcu 2008): M + log₂ K ≤ log₂ X + 2 / r_sp.
Ceiling-logarithm batch bound: combining a header factor A ≥ 1 (such as C(U', n)) with n
spillovers of universe K = spillUniv X n and n * M memory bits adds at most 2 bits over the
exact information-theoretic ceiling ⌈log₂ (A * X ^ n)⌉.