Universal key-quotienting bijection across arbitrary universes U ≥ n #
This module constructs an explicit, computable, zero-collision key-quotienting bijection
quotientPermEquiv : Fin (2 ^ a) ≃ Fin (2 ^ m) × Fin (2 ^ (a - m)) (for all m ≤ a) and a
universal full-quotient bit-width bound mul_fullQuotBits_le_clog_choose (for all U, n),
together with high-probability intra-shard κ-wise (κ = Θ(c log n)) distributional transfer
(for target bucket sets lying within a single shard σ via bucketShard _ b = σ) across every
universe U ≥ n once n ≥ quotientPermThreshold c, without assuming U ≥ n ^ (1 + Ω(1)) or
log U ≤ poly(log n).
Source attribution and formalization adaptations #
- Primary sources:
- [BFCK+22] (
arXiv:2111.00602v2): Section 1 (PDF pp. 2–3 / printed pp. 1–2), Section 2.4 (PDF p. 8 / printed p. 7, lines 376–386, fn. 12), Section 5.3 Theorem 21 (PDF pp. 34–36 / printed pp. 33–35, quotientedk-kick trees via a uniformly random permutation on[U], simulated for|U| ≤ poly(n)usingpoly(n)-independent permutations, andPr[∏_{x ∈ R} Q_x = 1] ≤ (|Q| / |U|) ^ |R|), and Section 6.1 Theorems 22–23 (PDF pp. 37–39 / printed pp. 36–38, large keys via indirection; formal theorem numbering starts at Theorem 2 on PDF p. 12 / printed p. 11). - [ANS10] (
arXiv:0912.5424v3): Section 5.2 (PDF pp. 21–23 / printed pp. 20–22, 1-round Feistel sharded permutation construction and intra-shard injectivity), Claim 5.4, Section 5.3 Theorem 5.6 (PDF p. 25 / printed p. 24,(1 / 2) * (2 * δ) ^ tcontraction quoted from [KNR09]), and Section 5.4 Claim 5.7 (PDF p. 26 / printed p. 25, bin load / capacity bounds). - [NR99] (J. Cryptology 12(1):29–66, 1999): Section 2.3 Definition 2.10 item 2 (p. 36 / PDF p. 8, uniform distribution on tuples of distinct elements), Section 3.2 Definition 3.1 & Theorems 3.1–3.2 (pp. 38–39 / PDF pp. 10–11), Section 5.2 Theorem 5.2 (pp. 48–50 / PDF pp. 20–22), Section 6 Definition 6.1 (p. 52 / PDF p. 24), and Section 8 Corollary 8.1 (pp. 60–61 / PDF pp. 32–33).
- [BFCK+22] (
- Original formalization adaptations:
- Rather than assuming an idealized uniformly random permutation on
[U]simulated viapoly(n)-independent permutations forU = poly(n)or large-key indirection,quotientPermEquivcombines Case A (m + caseAGap c n ≤ a, 2-round unbalanced FeistelcaseAEquiv) and Case B (a < m + caseAGap c n, Arbitman–Naor–Segev 1-round Feistel sharding +nrRounds cunbalanced 3-round Feistel Naor–Reingold blocks). - Case B routes keys into
2 ^ ⌊m / 2⌋shards that share one Naor–Reingold permutation instance; theκ-wise tail bounds are stated for target bucket sets inside a single shardσ. QuotientPermSeedinstantiates round functions viamultiplyShiftReduced/oddMulModWord(CslibFrontier.Probability.KWiseIndependent.ReducedLimbs) and a sharedDoubleTabTopSeed(CslibFrontier.Probability.KWiseIndependent.DoubleTabulation[Tho13]), requiring an explicit large asymptotic capacity thresholdquotientPermThreshold c ≤ n(e.g.quotientPermThreshold 0 = 2 ^ 50239744, which is an asymptotic theoretical threshold ensuring all failure probabilities are negligible, satisfying4 ≤ quotientPermThreshold c). Word-RAM circuit compilation belongs to the downstream Word-RAM hash layer.
- Rather than assuming an idealized uniformly random permutation on
Main definitions #
Cslib.DataStructure.Dictionary.KickTree.bucketIndexBits,Cslib.DataStructure.Dictionary.KickTree.fullQuotBits,Cslib.DataStructure.Dictionary.KickTree.embedKey: bucket bit-width⌊log₂ n⌋, full-quotient bit-width⌈log₂ U⌉ - ⌊log₂ n⌋, and canonical embeddingFin U → Fin (2 ^ keyBits U).Cslib.DataStructure.Dictionary.KickTree.QuotientPermRounds,Cslib.DataStructure.Dictionary.KickTree.quotientPermEquiv,Cslib.DataStructure.Dictionary.KickTree.quotientPermEncode,Cslib.DataStructure.Dictionary.KickTree.quotientPermDecode,Cslib.DataStructure.Dictionary.KickTree.fullQuotientPermEquiv: unified deterministic quotienting bijections across Case A (caseAEquivinRoundSeed) and Case B (caseBEquivinSmallUniversePerm).Cslib.DataStructure.Dictionary.KickTree.QuotientPermSeed,Cslib.DataStructure.Dictionary.KickTree.concreteRounds,Cslib.DataStructure.Dictionary.KickTree.concreteBucket,Cslib.DataStructure.Dictionary.KickTree.concreteQuot,Cslib.DataStructure.Dictionary.KickTree.concreteAux,Cslib.DataStructure.Dictionary.KickTree.fullBucket,Cslib.DataStructure.Dictionary.KickTree.fullQuot,Cslib.DataStructure.Dictionary.KickTree.fullDecode,Cslib.DataStructure.Dictionary.KickTree.fullAux: concrete computable seed bundle and instantiated quotienting bijection + auxiliary hash.
Main results #
Cslib.DataStructure.Dictionary.KickTree.mul_fullQuotBits_le_clog_choose,Cslib.DataStructure.Dictionary.KickTree.mul_fullQuotBits_add_valBits_le_optBits:n * fullQuotBits U n ≤ Nat.clog 2 (U.choose n) + 2 * nfor allU, n.Cslib.DataStructure.Dictionary.KickTree.dist_concreteCaseA_restrict_le,Cslib.DataStructure.Dictionary.KickTree.dist_concreteCaseB_shardTuple_le,Cslib.DataStructure.Dictionary.KickTree.prob_concreteCaseB_shardLoad_outside_le: concrete Case A and Case B statistical-distance transfer and shard-load concentration bounds.Cslib.DataStructure.Dictionary.KickTree.prob_concreteQuotientPerm_forall_mem_le,Cslib.DataStructure.Dictionary.KickTree.prob_concreteQuotientPerm_forall_mem_perKey_le,Cslib.DataStructure.Dictionary.KickTree.prob_fullQuotientPerm_forall_mem_le,Cslib.DataStructure.Dictionary.KickTree.prob_fullQuotientPerm_forall_mem_perKey_le: unified intra-shardκ-tuple multiplicative tail transfer (for target bucket setsB/B ulying in a common shardσ,bucketShard _ b = σ) across allU ≥ noncen ≥ quotientPermThreshold c(≤ 1 / n ^ (c + 1)).
References #
- M. A. Bender, M. Farach-Colton, J. Kuszmaul, W. Kuszmaul and M. Liu, On the Optimal Time/Space Tradeoff for Hash Tables
- Y. Arbitman, M. Naor and G. Segev, Backyard Cuckoo Hashing: Constant Worst-Case Operations with a Succinct Representation
- M. Naor and O. Reingold, On the Construction of Pseudorandom Permutations: Luby–Rackoff Revisited
- M. Thorup, Simple Tabulation, Fast Expanders, Double Tabulation, and High Independence
Section 1: Full-quotient bit-width and information-theoretic space bound #
Bucket-index bit-width ⌊log₂ n⌋ for full key quotienting at capacity n.
Stored quotient bit-width ⌈log₂ U⌉ - ⌊log₂ n⌋ per key at universe U and capacity n.
Whenever n ≤ U, bucketIndexBits n ≤ FeistelQuotient.keyBits U.
Whenever n ≤ U, bucketIndexBits n + fullQuotBits U n = FeistelQuotient.keyBits U.
If U ≤ 2 ^ w, then fullQuotBits U n ≤ w.
Canonical injective embedding Fin U → Fin (2 ^ keyBits U) preserving .val.
Universal information-theoretic full-quotient bit bound: for all U and n (including
n = 0, n = U, and U < n), n quotients of fullQuotBits U n bits occupy at most
⌈log₂ C(U, n)⌉ + 2 * n bits.
Full-quotient + value space against Dynamic.optBits U V n = ⌈log₂ C(U, n)⌉ + n * ⌈log₂ V⌉.
Section 2: Unified deterministic key-quotienting bijection (Case A + Case B) #
Unified round-function bundle across Case A and Case B.
- caseA : CaseARounds a m
Case A 2-round unbalanced Feistel functions (
m + caseAGap c n ≤ a). - caseB : CaseBRounds a m (nrRounds c)
Case B sharded
nrRounds c-block Naor–Reingold functions (a < m + caseAGap c n).
Universal deterministic key-quotienting bijection across all m ≤ a: dispatches to
caseAEquiv when m + caseAGap c n ≤ a and to caseBEquiv when a < m + caseAGap c n.
Full-quotient specialization (u : Fin (2 ^ keyBits U)) ≃ Fin (2 ^ bucketIndexBits n) × Fin (2 ^ fullQuotBits U n) for any n ≤ U.
Section 3: Concrete Double-Tabulation + oddMulModWord instantiation #
Concrete computable seed bundle for the universal key-quotienting bijection and auxiliary
hash across all m ≤ a.
- top : Probability.DoubleTabTopSeed (quotientPermChars c) (quotientPermInter c) (quotientPermCharBits n)
Shared top-level simple-tabulation table
T₁([Thorup2013]). Case A Round-1 odd-multiplier reduction seed on
Fin (2 ^ m).Case A Round-1 bottom table producing
(a - m)-bit quotient masks.Case A Round-2 odd-multiplier reduction seed on
Fin (2 ^ (a - m)).Case A Round-2 bottom table producing combined
(m + b_aux)-bit(bucket, aux)masks.- botShard : Probability.DoubleTabBotSeed (quotientPermInter c) (quotientPermCharBits n) (shardBits m)
Case B Arbitman–Naor–Segev 1-round Feistel shard bottom table.
- botNR : QuotientPermNRSeed c a m n
Case B
nrRounds cindependent Naor–Reingold block bottom tables. Case B auxiliary hash bottom table producing
b_aux-bit outputs.
Instances For
Product equivalence witnessing Fintype and uniform-marginal factorization of
QuotientPermSeed.
Concrete QuotientPermRounds instantiated from θ : QuotientPermSeed a m b_aux c n.
Concrete bucket index (quotientPermEquiv hma (concreteRounds θ) u).1 : Fin (2 ^ m).
Concrete b_aux-bit auxiliary hash accompanying concreteBucket.
Concrete Case A statistical-distance transfer: when m + caseAGap c n ≤ a,
quotientPermThreshold c ≤ n, #S ≤ n, and T ⊆ S (#T ≤ quotientPermInd c n), the joint
distribution of (concreteBucket hma θ u, concreteAux hma θ u)_{u ∈ T} under uniform
θ : QuotientPermSeed a m b_aux c n is within 1 / n ^ (c + 1) of uniform.
Concrete Case B shard-tuple statistical-distance transfer: when
bucketIndexBits n ≤ m ≤ a < m + caseAGap c n, m ≤ 8 * quotientPermCharBits n,
quotientPermThreshold c ≤ n, #T ≤ quotientPermInd c n, and
yEmb : T ↪ Fin (2 ^ suffixBits a m), the distribution of (shard, nrPerm ∘ yEmb, concreteAux)
under uniform θ : QuotientPermSeed a m b_aux c n is within 1 / (4 * n ^ (c + 2)) of
Uniform × UniformInj × Uniform.
Concrete Case B shard-load concentration: in Case B (a < m + caseAGap c n), the
probability that any shard σ : Fin (2 ^ shardBits m) deviates from mean load
#S / 2 ^ shardBits m by at least a_dev > 0 is bounded via
FeistelPerm.dens_exists_bucketLoad_sub_ge_le.
Unified Fin (2 ^ a) multiplicative tail bound across Case A and Case B (shared intra-shard
target bucket set B and auxiliary set A).
Per-key Fin (2 ^ a) multiplicative tail bound across Case A and Case B (per-key
intra-shard target bucket sets B u satisfying ∀ u ∈ T, ∀ b ∈ B u, bucketShard m b = σ,
factor 2).
Full-quotient bucket index Fin (2 ^ bucketIndexBits n) of u : Fin U (n ≤ U).
Full-quotient stored quotient Fin (2 ^ fullQuotBits U n) of u : Fin U (n ≤ U).
Inverse key-reconstruction map (bucket, quot) ↦ Fin (2 ^ keyBits U) for n ≤ U.
Auxiliary b_aux-bit hash accompanying fullBucket for u : Fin U (n ≤ U).
Universal Fin U multiplicative tail bound across every U ≥ n above
quotientPermThreshold c (shared intra-shard target bucket set B with
∀ b ∈ B, bucketShard (bucketIndexBits n) b = σ and auxiliary set A, factor 1, without
assuming U ≥ n ^ (1 + Ω(1)) or log U ≤ poly(log n)).
Universal per-key Fin U multiplicative tail bound across every U ≥ n above
quotientPermThreshold c (per-key intra-shard target bucket sets B u satisfying
∀ u ∈ T, ∀ b ∈ B u, bucketShard (bucketIndexBits n) b = σ and auxiliary sets A u, factor 2,
without assuming U ≥ n ^ (1 + Ω(1)) or log U ≤ poly(log n)).