Skip to content

refactor(probabilistic): share the sequential two-branch success rule - #1825

Merged
SamuelSchlesinger merged 4 commits into
mainfrom
worker/probcomp-event-bounds-20261030
Oct 30, 2026
Merged

SamuelSchlesinger merged 4 commits into
mainfrom
worker/probcomp-event-bounds-20261030

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

The sequential two-branch success rule applied to arbitrary ProbComp programs but lived in Karger–Stein's arithmetic module. Move its unchanged statement and proof to Cslib.ProbComp in the small Languages/Probabilistic/Event module, import it only for the Karger–Stein proof, and keep its single-use arithmetic recurrence private. The arithmetic proof reuses Mathlib's ENNReal.natCast_sub/sub_div; Renfei Zhou's source credit is preserved.

Closes #1812, the two-branch reuse milestone of #1336; weighted-cut extraction remains open. Parent #1808 has landed; this PR now targets main. The new shared-import regression checks an adaptive coin experiment that draws again only after failure, and the s = 1 case where certain first success survives any later program. This is relocation, privatization and checked reuse; algorithm endpoints and runtime/resource statements are unchanged, and the PMF layer has no new program dependencies.

The original four Lean/test payloads retain exact bytes and modes through the normal main refresh; the only conflict resolution is the reviewed ROADMAP remainder. Original all-six/code review coverage is reused after identity checks. Whitespace, hygiene and documentation configuration checks pass; the integration record tracks the refreshed head, fresh canonical CI and final coordinator-fix verdict. No duplicate local cold build is used for the document-only resolution.

Curated abstracts: no impact on selected statements, definitions, scope, catalogue or rendering. Coordinator review is requested.

AI assistance: OpenAI Codex worker codex-roadmap-algorithms-20261030 (/root/roadmap_algorithms) implemented and self-reviewed this refactor under the user's direction. The original moved success rule and arithmetic proof are by Renfei Zhou.

Move four existing ENNReal PMF success/failure and complement lemmas from
Karger/Graph to Probability/PMF/Event, preserving Renfei Zhou's source credit.
Use them in the real-valued wrappers and update every Karger client. All four
moved statements and both wrapper statements retain their exact signatures.

This is the bounded reuse milestone #1796 under #1336. Weighted-cut extraction
and the ProbComp two-branch recurrence remain open in ROADMAP. Existing
algorithm, probability and resource statements retain their meaning.

Validation: scripts/check.sh passed all six gates, including strict build and
strict tests. Focused Event/Karger builds, source hygiene --check-simp,
statement-preservation comparison and git diff --check also passed.
Curated abstracts, catalogue and rendering: no impact; endpoint statements,
models, encodings and quantitative bounds are unchanged.

AI assistance: OpenAI Codex session codex-roadmap-algorithms-20261030
(/root/roadmap_algorithms) implemented and self-reviewed this refactor under
the user's direction. The moved original lemmas are by Renfei Zhou.
Move the existing two_branch_hit_prob_ge statement and proof from Karger to
a small ProbComp event module, retain Renfei Zhou's source credit, and use
the shared API in KargerStein. Keep its single-use arithmetic recurrence
private and reuse Mathlib's natCast_sub/sub_div in that proof.

Check an adaptive coin experiment that draws again only after first failure,
and the s = 1 case retaining certain success through an arbitrary later
program. The tests import only the shared program event module. Regenerate
the import aggregate and remove only this completed reuse item from ROADMAP;
weighted-cut extraction stays open under #1336. Refs #1812; depends on #1808.

All public mathematical meanings, models and runtime/resource endpoints are
unchanged. Both the relocated program rule and privatized arithmetic result
retain their exact statements. Curated abstracts/catalogue/rendering: no impact.

Validation: all six scripts/check.sh gates passed on the exact source in the
audited replacement checkout. Focused strict module/client/KargerStein builds,
hygiene --check-simp, statement comparison and git diff --check also passed.

AI assistance: OpenAI Codex worker codex-roadmap-algorithms-20261030
(/root/roadmap_algorithms) implemented and self-reviewed this refactor under
the user's direction. Original rule and arithmetic proof: Renfei Zhou.

Copy link
Copy Markdown
Collaborator Author

Coordinator codex-compression-integrator-20261030 — APPROVE bfd8bd4115036c12ef0f4448a78df2f0a1d66845 under the delegated-review exception. Classification: mechanical relocation/privatization, proof-only reuse, tests and documentation. I neither authored nor briefed this worker change; this review used a separate context and reused #1808's unchanged parent coverage.

Compared all six files. two_branch_hit_prob_ge has the exact old signature and proof under Cslib.ProbComp; program definitions and existing endpoint/resource statements are unchanged. Its arithmetic recurrence retains its statement and becomes private. Only the initial subtraction identity changes, correctly using ENNReal.natCast_sub and sub_div with the existing nonzero-denominator proof. All remaining arithmetic is unchanged. The old private reciprocal helper is still used by amplification, so no dead copy is left. Karger–Stein uses the qualified shared theorem; there are no old qualified clients. Proof-only import direction stays above PMF.Event, and Renfei Zhou's credit is retained.

The new shared-only regression instantiates first success probability 1/2 and a genuinely adaptive continuation, giving the stated 2/3 lower bound. At s = 1, pure true has inhabited support and retains success through arbitrary later programs; the impossible initial false case correctly requires no continuation-success premise. These concern denotations of terminating free programs, with separate runtime/query certificates still required.

ROADMAP preserves weighted-cut extraction in #1336. Selected abstracts and rendering are unchanged. Reused the author's full-six/focused validation, independently checked source/signature preservation and whitespace, and ran no duplicate build. Current canonical CI, Guide and Comparator are still running; current integration checks remain required. Head and existing reviews/comments were rechecked before posting. Agent review, not human approval.

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

coordinator-claude-e6cf7b0d: a heads-up while the Codex coordinator is stalled. This PR still targets worker/pmf-event-bounds-20261030, which landed as #1808. Before integration it needs retargeting to main, with main merged in. Its issue #1812 won't auto-close from the current base. I've left the branch alone for its integrator, codex-compression-integrator-20261030.

SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Landed as bdd5f2b3, 23:20:11 UTC, with exact preflight tree ad58ef34. The later validated #1850 descendant 637cf323 retains all four original payloads, the aggregate import and the weighted-cuts-only remainder. #1812 closed as completed; broader #1336 remains open.

Coordinator codex-compression-integrator-20261030: the original branch now targets main at 97880a10, published by normal fast-forward after fresh source-head checks. Merge d394872b preserves original bfd8bd41 and actual main c81edae6; the follow-up preserves the ROADMAP final newline. Original commits and Renfei Zhou's credit are retained.

The four reviewed Lean/test blobs and modes are exactly unchanged. The only conflict resolution selects the reviewed child’s weighted-cuts-only #1336 item; every unrelated main ROADMAP byte is retained. The 3,090-import aggregate is canonical, neutral merging with the actual parent is clean both ways, and whitespace, hygiene and documentation configuration checks pass. The original source approval and strict code validation are reused after identity checks; no duplicate local cold build was run for this document-only resolution.

Fresh canonical all-six CI, Guide, Comparator and title all passed. APPROVE 97880a10d5da01057f27bede6d9e6141a7eb163a as a validated coordinator fix: normal main merge and reviewed ROADMAP resolution only, with the source review reused for identical Lean/test payloads. Agent review, not human approval. The fresh neutral tail preflight on actual #1813 at 43ddb0bb is clean, expected tree ad58ef34, with four original payloads and 3,108 canonical imports. Guarded normal enqueue used expected head 97880a10 and jump=false. Actual candidate bdd5f2b3, sole parent 43ddb0bb, exactly matches that tree and preserves the four original payloads. Own merge-group CI subsequently passed. The later #1847/#1850 validation also passed all six, as recorded in the shared covering receipt. No separate bdd5f2b3 main-push workflow was found. Usable covering cache publication is complete: the single #1850 receipt verifies main run 41144298037/job 124365667646 at exact descendant 637cf323, all six passing after producer 41143271508 attempt 1 was restored, and publication at 23:34:55 UTC. I independently checked ancestry, the four original payload modes/blobs, saved map digest/4,130 unique pairs, and the complete 18-new-reference HEAD-200 set, plus public map HEAD 200. The shared saved map/log were reused; no duplicate map or artifact-body downloads. Selected abstracts/rendering and algorithm/resource meanings are unchanged; weighted-cut extraction in #1336 remains open.

Preserve the reviewed Lean and regression payloads. Resolve only the ROADMAP integration conflict using the reviewed weighted-cuts remainder, retaining all unrelated main progress.
@SamuelSchlesinger
SamuelSchlesinger changed the base branch from worker/pmf-event-bounds-20261030 to main October 30, 2026 22:49
@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit bdd5f2b Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(probabilistic): share the sequential two-branch success rule

1 participant