Repository navigation
[Lean] Prove reserved-scratch echo bounds and equality family (no new kappa) - #887
Merged
Mister-Meeseeks merged 2 commits intoOct 13, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR784's reserved-scratch echo theorem now has a standalone Lean 4.21.0 proof, including exact feasibility, the universal call lower bound, and the whole attaining family. In particular, Lean proves that 50 factors with six reserved dirty arrays need exactly 2,304 uniform leaf calls. This is a scoped formalization of Alexander Schwartzman's existing theorem, not a new call-count improvement or κ claim.
For the explicit
Fits s n Ngrammar, parents reservek-1arrays throughout their children, endpoints run twice, and interior children four times. The new proof establishes:The proof uses core/Std, with no Mathlib. Its arity-split induction differs from the predecessor's general polynomial calculation. All eight audited statements and generated proof aggregates use only standard
propext,Classical.choice, andQuot.sound; there are no placeholders, custom axioms, or native evaluation oracles.The bounded executable connection covers all 5,440 ordered trees through eight factors, plus 36 optimizer outputs throughout the equality band for budgets 2..6. The verifier emits and kernel-checks 5,474 constructor proofs using the actual source-derived profiles and tree children. It proves all 36 source-produced counts minimal within the grammar and separately checks 10,952 literal words / 1,429,954 instructions, including inverse order, multiplicities and scratch addresses.
Reproduce with Python 3.12+ and the official Lean 4.21.0 toolchain:
Expected:
PASS: 8 universal statements; 5474 constructor proofs; 5440 ordered trees; 36 equality cases; 9 negative controls; exact 50/6 minimum 2304.Local validation passed on Python 3.14.4 and in an isolated, read-only standalone copy under Python 3.12.3. Six compiler mutations and three disallowed-axiom controls are rejected. Additional checks reject source drift, a missing source, integer-to-boolean receipt corruption, and existing output destinations without altering them. Selected-record integrity and staged whitespace checks pass. Full regenerating/supplier suites and hosted CI success are not claimed.
Only
research/lean-dirty-echo-budget/is added. Base:f567884aeb8851b6e794af1184119a3bfbe1e631; subject PR784:548e42022b37a300f8bf745e848c38baccbce056. Six source/license files are vendored unchanged with SHA256/Git-blob pins. Assignment seed 83, independent-verification/formalization track; local claim because no coordination issue exists. The queue was refreshed through #886, including the distinct #878 XOR-boundary and #885 native-moment formalizations.The universal theorem is about the formal grammar. Python correspondence is the stated finite evidence; operator semantics, nonlinear restoration, rounding, weighted prices, preprocessing, physical interfaces and the full multiplication theorem remain separate. PR822's connector reuse and PR714's clean checkpoint use different contracts. The selected conditional κ remains
1661634653669567/10^18.Credit Alexander Schwartzman / #784, androolloyd / #673, Koroffstrogov / #758, and the related #730/#744 and earlier #628/#621 lineage. Prepared for Gareth Davidson (@bitplane) with substantial OpenAI Codex assistance; one AI agent, no independent human review claimed. Apache-2.0, original notices retained.