Repository navigation
feat(Probability,WordRAM): trinomial binary fields, k-wise hashing, and multiply-shift - #1642
Conversation
…nd multiply-shift
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Review by What I checked
Blocking
Non-blocking
Limits
|
|
Fixed in
|
|
Delta review by Merge
|
Part of #1634.
Introduces explicit trinomial binary fields and zero-bias$k$ -wise independent polynomial hashing, a bounded-capacity lookup-and-insert dictionary specification, and a self-contained Word-RAM multiply-shift universal hash primitive:
irreducible_trinomial) [Lidl and Niederreiter, Theorem 2.47][LidlNiederreiter1997]. UnlikeBinaryField w, whose modulusleastIrreducible wis found by exhaustive search,TrinomialField t := AdjoinRoot (trinomial t)has a closed-form sparse modulus satisfyingreduceTrinomialCode,mk_polyOfCode_reduceTrinomialCode) alongside carryless multiplication (clmul,polyOfCode_clmul).BitString.zeroExtend(forBitString.restrictBitsAddHom : BitString q →+ BitString Min a focused topic module (Foundations/Data/BitString/Prefix.lean) and adds composition combinators (comp_seedEquiv,comp,map_equiv,comp_surjective_addMonoidHom) forIsKWiseIndependentHash. Evaluating degree-$< k$ polynomials overTrinomialField tand projecting to the lowtrinomialPolyHashfromFin UontoFin (2 ^ M)forisKWiseIndependentHash_trinomialPolyHash), with degree selectortrinomialStepsatisfyingtrinomialDeg_le_three_mul) [Vadhan, Section 3.5.5][Vadhan2012]; [Wegman and Carter][WegmanCarter1981].Dictionary.spec U V n_maxsupportinggetandinsertwith capacity invariant(dom s).card ≤ n_maxand in-place key overwrites [CLRS, Chapter 11][CLRS2009]. Also implements Word-RAMMultiplyShift.initCode(2 instructions, 1randcall) andMultiplyShift.evalCode(9 instructions) computingmultiplyShift w₀ MwhenisUniversalHash_evalData) [Dietzfelbinger et al., Lemma 2.4][DietzfelbingerHagerupKatajainenPenttonen1997].Validated with
scripts/check.sh(build,mk_all, test, lint, style, and init-import gates) and non-vacuity checks inComplexityTests/TrinomialKWiseHash.lean.AI assistance: Gemini agents (under Renfei Zhou's direction) wrote the Lean definitions, proofs, tests, and PR description, and ran independent AI code and text review passes; no human has reviewed this PR yet.