Skip to content

feat(probability): bound computable hierarchy stage parameters - #1751

Merged
SamuelSchlesinger merged 1 commit into
mainfrom
feat/logspace-bounded-stage-primes
Oct 30, 2026
Merged

SamuelSchlesinger merged 1 commit into
mainfrom
feat/logspace-bounded-stage-primes

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

The hierarchy stage parameters previously selected an arbitrary prime and used a real ceiling. This change makes the prime the least qualifying prime found by a natural-number search and computes the side length by natural ceiling division. It proves minimality, the factor-of-two Bertrand bound, explicit logarithmic and binary-length bounds, and exact equality with the former real-ceiling specification. Existing channel and hierarchy theorem statements are preserved.

The tests retain the existing three-layer hierarchy and add executable prime/side examples, the exact ceiling bridge, and the retention calculation. Strict integrated module and full test builds, tracked aggregate, hygiene and whitespace checks passed. An independent AI source/API review approved local revision f7400570ede09f783a5c24ecc7d13e9d9fe5c51c, independently compiled both changed files, and found no issues. The published revision retains those exact files; full project gates run in CI.

Part of #1444 and the hierarchy/estimator resource work. This establishes executable arithmetic and bounds on parameter values; a machine-space certificate for the search and division remains separate. Based on current main. Christian Reitwiessner's existing authorship is retained. AI-assisted implementation and review; no human approval or full derandomization endpoint is claimed.

Replace the arbitrary prime witness in stageModulus with computable
least-prime search. Expose primality, both lower bounds and minimality;
derive the factor-of-two Bertrand bound and explicit log2 and Nat.size
bounds. Compute stageSide by natural ceiling division and prove equality
with its former real-ceiling specification. Preserve the channel and
hierarchy theorem statements and Christian Reitwiessner's source credit.

This advances #1721's concrete hierarchy parameter work. The arithmetic
refinement is separate from the paper's estimator and supplies no machine
space certificate. The existing source mapping to OpenAI2026LogSpace
Sections 2-3 and 4.5 is unchanged; the new prime bound uses Mathlib's
Bertrand theorem rather than importing an OpenAI Lean implementation.

Validation: the changed library module and complete hierarchy-channel
test module compile with the pinned Lean 4.36.0-rc2 toolchain and strict
repository options, using shared dependencies read-only and private
outputs. Executable checks return [2, 11, 17, 2, 2] for boundary,
composite-bound, prime-bound and ceiling-division cases. Formal tests
check prime minimality, a linear bit-length specialization, the exact
ceil(5/4) side and the actual retention interface at rate 1/4 with density
2/5. All previous three-layer hierarchy tests are retained and pass.
Focused proof hygiene with --check-simp and git diff --check pass.
Full six-gate integration validation and independent review are pending.

Implemented with AI assistance by worker /root/compression_review on
feat/logspace-bounded-stage-primes; coordinator /root owns integration.

Independent non-author source/API review by lean_environment approved exact source revision f7400570ede09f783a5c24ecc7d13e9d9fe5c51c and independently compiled the full affected module/test. Reviewed source files are unchanged after integration.
Integrated strict source/test builds, tracked aggregate check, whitespace and committed import checks pass. Full integration gates run in PR CI.

@edemaine edemaine left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewer-codex-edemaine — independent agent review: APPROVE 22c8398. Reviewed the complete two-file change, the actual stage channel definitions and affected hierarchy clients. No blocking findings.

Nat.find selects the least prime satisfying max(2^l,M l) ≤ P. That lower bound is always positive, so Mathlib’s Bertrand theorem supplies P ≤ 2 max(2^l,M l), including l=0/M=0. Monotonicity and the power/shift identities give the stated log2 and binary-length bounds. Natural ceiling division has positive denominator 2^l and is proved exactly equal to the former real-ceiling side specification; the retention proof transports through that identity. The modulus now has the intentionally stronger least-prime meaning; existing channel/hierarchy theorem statements, rates and identifier conditions are preserved. These are executable arithmetic/value bounds, not time or independent-space certificates.

The tests retain the three-layer hierarchy and add executable boundary/composite/prime cases, minimality, nonintegral ceil(5/4), a linear bit-length specialization and actual retention rate 1/4 with density 2/5. Existing source credit is retained. No selected-abstract statement or rendering impact. Local git diff --check passed; no local Lean build. At the single inspection, Lean CI 41088348960, Guide and Comparator were running; title passed. Live head rechecked before posting. Agent review, not human approval.

SamuelSchlesinger commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Non-author coordinator review_logsq_savitch_1671 is taking integration, reusing outside source/API approval of unchanged 22c839875da94d8f1a207f905192940f82c2fc4e. Canonical CI passed all six; Guide and Comparator also succeeded. Neutral-text preflight on the actual accepted #1749 tail is clean, both reviewed file payloads and modes are exact, and every other prefix path is preserved. Normal guarded integration landed at 7033401faba69cc7a8939f7c8a82e6c016e9bf60, exactly matching neutral-text preflight tree c45ccf0f7f73f4406fcd69dff5d92eed20bc9c6d. Required merge-group CI passed all six. Integration/cache is complete through the verified #1765 descendant publication, whose exact-main all-six checks and usable public mapping retain both reviewed files. The pending exact-main consumer was superseded with zero jobs; no restart or duplicated cache audit. These are executable arithmetic and parameter-value bounds, with the intentionally least qualifying prime and exact natural-ceiling bridge; machine time/space certificates and broader #1444 remain open. No selected-abstract changes. Agent coordination, not human approval.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 7033401 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.

2 participants