Quotient Hashing, DictStateInv, and Feistel-Dispatched Memory.Prog Operations #
This module couples the bucket-level Memory.Prog operations of the fixed-capacity succinct
dictionary with the two-stage universe-reduced 3-wise independent hash family
(Cslib.DataStructure.HashFamily.WordRAM.ReducedKWise) and proves the full dictionary-level state
transition, space, initialization, and expected probe-excess bounds.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.qBits,Cslib.DataStructure.Dictionary.WordRAM.Succinct.hashB,Cslib.DataStructure.Dictionary.WordRAM.Succinct.hashSpace,Cslib.DataStructure.Dictionary.WordRAM.Succinct.space,Cslib.DataStructure.Dictionary.WordRAM.Succinct.initSteps: hash parameter instantiation, total Word-RAM footprint, and initialization instruction budget.Cslib.DataStructure.Dictionary.WordRAM.Succinct.bucketMapOfState,Cslib.DataStructure.Dictionary.WordRAM.Succinct.DictStateInv: coupling betweenDictionary.State UandBucketStateInvvia one-round Feistel reconstructionfeistelReconstruct.Cslib.DataStructure.Dictionary.WordRAM.Succinct.extractQuotProg,Cslib.DataStructure.Dictionary.WordRAM.Succinct.queryWithHashProg,Cslib.DataStructure.Dictionary.WordRAM.Succinct.insertWithHashProg,Cslib.DataStructure.Dictionary.WordRAM.Succinct.deletePrepWithHashProg,Cslib.DataStructure.Dictionary.WordRAM.Succinct.deleteFinishWithHashProg:Memory.Progoperations performing Feistel bit extraction and bucket dispatch, realized to native Word-RAM code viarealize.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.initSteps_le,Cslib.DataStructure.Dictionary.WordRAM.Succinct.space_le_succinctWords: linear initialization instruction bound and succinct word-space bound.tsum_uniform_probeExcess_reducedPolyHash_le_five: expected combined probe excess≤ 5under a uniformly sampledReducedPolySeed.Cslib.DataStructure.Dictionary.WordRAM.Succinct.queryWithHashProg_dict_spec,Cslib.DataStructure.Dictionary.WordRAM.Succinct.insertWithHashProg_dict_spec,Cslib.DataStructure.Dictionary.WordRAM.Succinct.deleteWithHashProg_dict_spec: dictionary-level functional correctness and amortizedmemoryCostbounds forquery,insert, and two-phasedelete.
Section 1: Hash parameters, space_le_succinctWords, and initSteps_le #
Effective quotient bit-width max (quotientBits U n_max) 1 ≥ 1 passed to ReducedKWise.
Reduction target bit-width parameter totalMicroBits n_max + 1 = ⌊log₂ n_max⌋ + 1 passed to
ReducedKWise, ensuring n_max + 1 ≤ 2 ^ hashB n_max.
Word-RAM footprint of the 3-wise independent quotient hash family (ReducedKWise.space).
Total Word-RAM footprint totalSpace U V w n_max (hashSpace U w n_max) of the succinct
dictionary in w-bit words.
Initialization instruction budget (2 plus ReducedKWise.initTableSteps and
ReducedKWise.resampleSteps; with 3 allocation instructions in allocSpan, the total
initialization time is initTime = initSteps U n_max + 1).
Multiplicative form of initSteps_le: initSteps U n_max ≤ 1091 * (n_max + 1).
Succinct word-space bound (space_le_succinctWords):
for every 0 < w, n_max ≤ U, and U ≤ 2 ^ w (including Fits w U), the total space
space U V w n_max is at most Dynamic.succinctWords 81 213 U V w n_max.
Section 2: Expected probeExcess bound (≤ 5) under ReducedPolySeed #
Seed space ReducedPolySeed (qBits U n_max) (hashB n_max) (totalMicroBits n_max) 3 of the
two-stage quotient hash family.
Stage 1 multiply-shift reduction mapping u : Fin U via quotientFin U n_max u into
Fin (2 ^ min (qBits U n_max) (3 * hashB n_max)).
Stage 2 degree-< 3 trinomial polynomial hash mapping reduced quotients into
Fin (2 ^ totalMicroBits n_max).
Two-stage expected probeExcess bound (≤ 5):
for any S : Finset (Fin U) and u : Fin U with #(S.erase u) ≤ n_max ≤ U, the expected
probeExcess under a uniformly chosen θ : QuotHashSeed U n_max is at most 5.
Section 3: bucketMapOfState, DictStateInv, and probe-excess cardinality bounds #
Evaluate the two-stage quotient hash on an arbitrary natural-number quotient q.
Integer value (evalQuotHash U n_max θ q).val < 2 ^ totalMicroBits n_max.
Local micro-bucket index hValOfSeed U n_max θ q >>> bucketBits n_max < numMicroPerBucket n_max
associated with quotient q.
Full dictionary state invariant coupling s_abs : Dictionary.State U with BucketStateInv at
base under quotient hash seed θ.
- hbucket : ∃ (L : ℕ → ℕ → List ℕ), BucketStateInv U V w₀ n_max (hashSpace U w₀ n_max) base (mOfSeed U n_max θ) L (bucketMapOfState U n_max (hValOfSeed U n_max θ) s_abs) s
An all-zero dictionary memory region satisfies DictStateInv for Dictionary.empty U with
zero slotPotential.
Under BucketStateInv ... (bucketMapOfState U n_max (hValOfSeed U n_max θ) s_abs), the length
of the micro-chain L b m for key u is at most 1 + microCollCount and the bucket overflow
bCount b - effBucketCap n_max is at most 1 + bucketOvfCount.
Section 4: Feistel-dispatched Memory.Prog operations realized via realize #
Well-formedness condition 0 < w₀ ∧ n_max ≤ U ∧ U < 2 ^ w₀ ∧ V ≤ 2 ^ w₀ on the dictionary
parameters (U, V, w₀, n_max).
Parameter-free pure Memory.Prog extracting the key quotient keyQuotient (bucketBits n_max) u
via right shift d.2 >>> dpBucketBits d.1.
Pure Memory.Prog extracting the key quotient keyQuotient (bucketBits n_max) u via right
shift u >>> bucketBits n_max.
Precondition for extractQuotProg.
Parameter-free precondition for extractQuotGenProg.
Helper lemma: Fits w (bucketBits n_max) and Fits w (2 ^ bucketBits n_max - 1) from
DictEnvGen.
Parameter-free Feistel-dispatched query in Memory.Prog (d = (dp, ((base, u), h_q))).
Feistel-dispatched query in Memory.Prog (d = ((base, u), h_q)): computes
b = (h_q &&& (2 ^ b_bits - 1)) ^^^ (u &&& (2 ^ b_bits - 1)), q = u >>> b_bits, and
m = h_q >>> b_bits, then runs queryBodyProg.
Precondition for queryWithHashProg in Realizes.
Parameter-free precondition for queryWithHashGenProg in Realizes.
Parameter-free Realizes .exact certificate for queryWithHashGenProg.
Parameter-free Feistel-dispatched insert in Memory.Prog
(d = (dp, (((base, u), v_new), h_q))).
Precondition for insertWithHashProg in Realizes.
Parameter-free precondition for insertWithHashGenProg in Realizes.
Parameter-free Realizes .exact certificate for insertWithHashGenProg.
Parameter-free Realizes .exact certificate for deletePrepWithHashGenProg.
Phase 2 of Feistel-dispatched delete in Memory.Prog
(d = ((((base, u), h_q), ((found, j_del), phys_del)), h_q_last)):
computes (b, m) from (u, h_q) and m_last = h_q_last >>> bucketBits n_max, then runs
deleteFinishProg.
Parameter-free Realizes .exact certificate for deleteFinishWithHashGenProg.
Section 5: Dictionary-level DictStateInv + probeExcess transition specifications #
Dictionary-level specification of queryWithHashProg: establishes QueryWithHashPre, leaves
s unchanged, returns s_abs u, and uses at most 26 + 8 * probeExcess memory cost.
Dictionary-level specification of insertWithHashProg: establishes InsertWithHashPre,
preserves DictStateInv for Function.update s_abs u (some v), preserves memory outside the
dictionary table arrays, and satisfies the amortized memoryCost + 66 * slotPotential bound.
Dictionary-level specification of the two-phase delete (deletePrepWithHashProg followed by
deleteFinishWithHashProg): establishes both preconditions, preserves DictStateInv for
Function.update s_abs u none, preserves memory outside the dictionary table arrays, and bounds the
combined amortized memoryCost by 270 + 8 * probeExcess.