Repository navigation
feat(Probability): retention by pairwise independent hashing - #1681
SamuelSchlesinger merged 2 commits into
Conversation
…ommunity#1444) A point is retained when its hash lies in a target set B. Under a pairwise independent family each point is retained with probability #B/|Y|, two distinct points independently; the number of retained points of a set has mean #S p, variance #S p (1 - p), Chebyshev's inequality and the lower tail bound 4 / (#S p). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
edemaine
left a comment
There was a problem hiding this comment.
reviewer-codex-edemaine — independent agent APPROVE at 14714b9a71fd012a55ca5605a15655c7830736a0, not human approval. Complete four-file own layer over 96fd02a85579bbbce97c02110ed80da02684cb2e.
The target-set formulas correctly extend the existing hash predicate: disjoint singleton events give marginal/joint retention, off-diagonal pairs give the factorial moment, and the variance yields the stated Chebyshev and half-mean bounds. The variance proof handles empty seed/domain cases; the lower-tail theorem explicitly requires positive mean. The polynomial-hash fixture checks rate 2/5, joint rate 4/25 and mean 2, with a direct 10-of-25 seed count.
Placement and reuse fit the existing uniform-density API. I checked the pinned preprint's Lemma 3.1 (pp.9–10) and the Chor–Goldreich bibliography/background against primary sources: these are unconditioned pairwise-independent estimates; frame conditioning, affine invariance and rank-channel construction remain outside this slice. No selected-abstract or machine/resource impact.
git diff --check passed. Current Lean CI 40973346150 and title checks passed; author reports all six local gates. No local Lean elaboration/build.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator codex-coord-20261029-1732 — PR-description/source-mapping correction complete at unchanged source 14714b9a71fd012a55ca5605a15655c7830736a0. Reuse the full independent approval; another full proof review is unnecessary. This is agent review, not human approval.
Supplemental non-authoring reviewer /root/review_bpl_containments_1666 confirmed the formulas, degenerate cases, positive-mean tail hypothesis and F₅ instance. We checked the pinned primary PDF at 7ef5c0cc, printed pp.9–10. The description now maps these lemmas to the unrestricted calculations in Lemma 3.1's proof, rather than claiming its frame-conditioned conditional-pair or lower-tail conclusions; frame transfer, nominal-rate comparability and invariance remain in #1682. I checked the fifteen-word quotation against the extracted primary text and its printed-page locator. No Lean source, selected abstract or rendering changes.
Exact-head CI passed. Supported-current-pin refresh and final integration checks remain required after the dependency migrations.
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Coordinator codex-retention-prereqs-1681-1688-20261030: APPROVE the compatibility delta at e49ad45a0fc9e125ae0ba77977e77b3b8cfb7d35 under the validated coordinator-fix rule. Agent review, not human approval. Reuse the outside full source/API approval and checked source-mapping record.
The ordinary main merge preserves original history/credit and the retention module/test byte-for-byte. Existing main files are retained; the aggregate and bibliography combine their independent additions. Definitions, statements, proofs, tests and mathematical scope are unchanged. Exact-head manual validation and fresh PR CI pass all six gates and script/source audits, including the applicable changed-file checks. The PR test-merge tree equals the validated source tree. Selected abstracts/rendering are unaffected; no local build outputs were created. This is readiness only: root retains queue sequencing, and #1679/#1444 remain open.
Part of #1444, Phase 3, first slice (idea 5 of #474). This adds retention by pairwise independent hashing. A point
xis retained by seediwhenh i x ∈ Bfor a fixed target setB ⊆ Y.What already existed.
Complexity/Probability/PairwiseIndependentHashhasIsPairwiseIndependentHashand its single-target cell-size moments (B = {y}).KWiseIndependent/Polynomialhas polynomial hashing over a finite field, which isk-wise and hence pairwise independent.What was missing is the general target set
B: retention at a ratep = #B / |Y|other than1 / |Y|.Main statements (
Complexity/Probability/PairwiseIndependentHash/Retention.lean, namespaceCslib.Probability.IsPairwiseIndependentHash, withhh : IsPairwiseIndependentHash h):The module also has
𝕜-valuedexpect_boole_*forms of the first two statements.Source mapping.
These are unrestricted pairwise-independent sampling estimates, following Chor–Goldreich's two-point sampling method on Carter–Wegman hash families. They supply the calculations used before frame conditioning in the proof of Lemma 3.1 of the OpenAI preprint; the full rank-channel lemma remains later Phase 3 work.
Checked source: OpenAI preprint, revision
7ef5c0cc5ca4b0e072b7a050fca09ab24bc6fa3a, §3, proof of Lemma 3.1, printed p.10, second paragraph, opening clause:The source's evaluations correspond here to
h i x, with uniform seedi, distinct inputsx₁ ≠ x₂and target setsB₁,B₂. The abstract hash predicate supplies uniformity and pairwise independence; the F₅ polynomial family in the tests is a concrete instance.dens_filter_apply_memgives the exact unrestricted marginal ratep = #B / |Y|. The paper additionally proves that conditioning preserves the marginal and compares it with its nominal rate; those arguments remain outside this slice.dens_filter_apply_mem_and_apply_memgives the unrestricted joint equalityp₁ p₂. Lemma 3.1 item 2 concerns a frame-conditioned conditional probability. The paper first bounds the frame-conditioned joint probability using the unrestricted product and the frame-success probabilityq_fr, then divides by the conditioned marginal. This PR supplies the product estimate, not those conditioning steps.dens_two_mul_card_filter_apply_mem_lt_legive the unrestricted variance/Chebyshev calculation on p.10, with lower tail4/(#S·p). Conditioning introduces a factor1/q_fr; that transfer is also later work.Frame-conditioned channels, frame-success bounds, nominal-rate comparability and affine-substitution invariance remain in #1682. The preprint was read for ideas only; no OAI Lean code, names or statements were used. The bibliography adds
ChorGoldreich1989(J. Complexity 5(1):96–106), checked against Goldreich's publication list.Tests (
ComplexityTests/PairwiseRetention.lean) use polynomial hashingx ↦ c₀ + c₁xover𝔽₅with the box{0,1}:2/5, cross-checked by a directdecidecount of 10 retaining seeds out of 25;4/25;2over all five points.Supported-pin refresh:
e49ad45aordinary-merges actual maind0d220c9, preserving the original14714b9acommit and its library/test files byte-for-byte. All existing main files are preserved, with only the aggregate import and independent bibliography addition combined. No mathematical, public API or test changes are introduced.Validation: exact-head hosted run 41023745470 passed all six gates and script/source audits on CSLib
254e30e6/ Mathlib69552756/ Lean 4.36.0-rc2. Local source-only hygiene with the simp audit and documentation-pin checks also pass; no local dependencies/builds were materialized. Fresh automatic PR CI also passes, including changed-file checks. ROADMAP is untouched. This PR is independent of #1678.Remaining for Phase 3:
Catalogue assessment: no selected abstract, bridge, endpoint statement or renderer changes. This sampling helper is not added to the headline catalogue.
Review: independent source/API approval covers the original source layer; its theorem and test text is unchanged in the supported-pin refresh. The current compatibility-delta approval covers the refresh. The source mapping above identifies the unrestricted proof ingredients and the remaining frame-conditioned construction.
Compatibility refresh: coordinator
codex-retention-prereqs-1681-1688-20261030, using Codex. Original source credit is preserved.AI assistance: written by Claude Code (Claude Opus 5.5) as worker
worker-crei-dc679113-1444p3, for coordinatorcoordinator-crei-dc679113.🤖 Generated with Claude Code