Repository navigation
refactor(probabilistic): share the sequential two-branch success rule - #1825
Conversation
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.
|
Coordinator Compared all six files. The new shared-only regression instantiates first success probability 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. |
|
|
|
Landed as bdd5f2b3, 23:20:11 UTC, with exact preflight tree Coordinator 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 |
Preserve the reviewed Lean and regression payloads. Resolve only the ROADMAP integration conflict using the reviewed weighted-cuts remainder, retaining all unrelated main progress.
The sequential two-branch success rule applied to arbitrary
ProbCompprograms but lived in Karger–Stein's arithmetic module. Move its unchanged statement and proof toCslib.ProbCompin the smallLanguages/Probabilistic/Eventmodule, import it only for the Karger–Stein proof, and keep its single-use arithmetic recurrence private. The arithmetic proof reuses Mathlib'sENNReal.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 thes = 1case 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.