Skip to content

[Lean] Add automatic-width binary counting - #519

Draft
jamesyc wants to merge 2 commits into
CrocSwap:mainfrom
jamesyc:lean/automatic-width-count-20261011
Draft

jamesyc wants to merge 2 commits into
CrocSwap:mainfrom
jamesyc:lean/automatic-width-count-20261011

Conversation

@jamesyc

@jamesyc jamesyc commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Completed chunk and coverage

Adds a concrete ten-state, two-tape, three-symbol machine that allocates counter width from the actual scanned input and then counts it. No input length or counter width parameter appears in its transition table. For every finite input word of length n, including empty input, it reaches the specified halted endpoint with an n-bit little-endian counter representing n. The checked execution bound is (CarryTape.pass n (List.replicate n false)).2.reads + 4*n + 4.

Finite coverage: marked-input representation transport, a four-state zero-counter allocator (2*n+3 transitions), and their exact controller composition. The input starts at its right blank; the second tape must be pristine blank.
Conditional-interface coverage: the CurrentMain.FixedTapeMachine and exact pinned dispatcher interfaces.
Full-theorem coverage: no complete multiplication or kappa theorem, linear amortized bound, first-completion claim, compact-counter normalization, one-string prelude, four-tape control composition, or Plan/Budget discharge. Actual selected-source obligations remain open.

Exact pins and author-checked kappa

Base: 12a4934.
Head: ffd3c48.
Explicit author-checked selected conditional project kappa = 90446448750933/125000000000000000 = 0.000723571590007464, matched to the selected-result record and certificate at that base. This is project context, not a kappa theorem proved by this helper. The all-size compiler, chart, restored-row, selector/routing, prime-supply, precision/recovery, complex-symbolic and analytic-transfer interfaces remain conditional.

Reuse and attribution

Three source files are included. Six exact external sources are reused: four from #511 at79f7c03c7f820ab89955b75ef239cbaccc627e6e and two from #488 atedd3102b415df5b9d6f633ac0a4dedcf69c58525. Neither dependency is assumed merged. The later CI-provenance repair on #511 does not change these pinned source blobs. DEPENDENCIES.json gives paths and hashes.

Compared with #511 supplied-width counting and #64 richer generic counter/stack, first-completion and amortized results. Generic binary counting is not claimed new. This chunk supplies actual width allocation and the composed current-model endpoint; a PR64 arithmetic bridge remains separately unverified and is not included. Apache-2.0, source attribution and OpenAI-assistance disclosure are preserved. Fresh automatic/width PR search found no matching open or closed PR.

Validation and reproduction

Offline Linux, Python3, Lean4.21; no Mathlib or downloads. README.md supplies the command using two separate exact foundation roots and a fresh build directory.

Fresh isolated nine-source package replay passed: 11.7677 compiler seconds, 0.00378 queue seconds, peak virtual memory3,074,072,576 bytes. All nine object hashes and49 normalized axiom outputs match accepted evidence. Only standard propext, Quot.sound and Classical.choice axioms occur. This local kernel evidence is distinct from CI.

One additive commit,16 files,1,834 additions,0 deletions. Fork CI is not yet passed; upstream jobs may require maintainer approval. The inherited joint-dual root-pin failure is being repaired and tested separately on #511; no scientific check is disabled here.

jamesyc and others added 2 commits October 11, 2026 16:50
Add 16 files under research/lean-automatic-width-count only. Three checked Lean sources compose marked-input transport, zero-counter allocation and a ten-state automatic-width counter. Six exact external sources remain pinned to PR511 at79f7c03 and PR488 atedd3102. Fresh nine-source offline Lean4.21 replay passed with49 matching axiom outputs. Explicit author-checked selected conditional project kappa90446448750933/125000000000000000 atbase12a4934; no full multiplication or kappa theorem. Runtime bound remains pass.reads+4n+4; no linear amortized or first-completion claim.
The joint-dual check froze these three files by hash, but nothing in its
computation reads them. Any edit to them, even a README typo, therefore broke
`verify_joint_dual.py` until the manifest, `joint-dual-kappa.json` and
`joint-dual-validation.json` were regenerated.

Remove the three names from the pin script and from the closure check, re-pin,
and regenerate the two derived certificates. The conditional kappa and every
mathematical field are unchanged; the diff to the certificates is hashes only.
Update the current reproduction guide's "Shared source bindings" section.
Earlier round notes that describe the old binding are left as historical.

(cherry picked from commit f8c4314)

(cherry picked from commit 1fa0915)
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