Skip to content

[Lean] Prove reserved-scratch echo bounds and equality family (no new kappa) - #887

Merged
Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
bitplane:research/pass07-verification-seed83
Oct 13, 2026
Merged

Mister-Meeseeks merged 2 commits into
CrocSwap:mainfrom
bitplane:research/pass07-verification-seed83

Conversation

@bitplane

Copy link
Copy Markdown
Contributor

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 N grammar, parents reserve k-1 arrays throughout their children, endpoints run twice, and interior children four times. The new proof establishes:

feasible(n,s) iff 1 <= n <= 2^s
N + 4^s >= 2^(s+1) n
min N = 2^(s+1) n - 4^s for s>=2 and 3*2^(s-2) <= n <= 2^s

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, and Quot.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:

python3 -B -I research/lean-dirty-echo-budget/verify.py --lean /path/to/lean-4.21.0/bin/lean

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.

@Mister-Meeseeks
Mister-Meeseeks merged commit 7346333 into CrocSwap:main Oct 13, 2026
@bitplane
bitplane deleted the research/pass07-verification-seed83 branch October 13, 2026 16:27
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