Skip to content

[Lean] Verify counted signed addition and marked zero padding - #1869

Draft
jamesyc wants to merge 1 commit into
CrocSwap:mainfrom
jamesyc:lean-counted-bit-addition-padding
Draft

jamesyc wants to merge 1 commit into
CrocSwap:mainfrom
jamesyc:lean-counted-bit-addition-padding

Conversation

@jamesyc

@jamesyc jamesyc commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Result and coverage

Explicit author-checked context: upstream main 0b1cccf; kappa = 836330098538459/500000000000000000 = 0.001672660197076918. These generic modules change no selected numerical bound.

This completed chunk contains two independently checked finite-word components:

  • SequentialBitAddition: signed ripple arithmetic, two executed sign columns, exactly 11n+10 transitions in the stated boundary-observing three-track model, returned head, unchanged inputs and cleared scratch.
  • MarkedZeroPadding: an explicit symbol-marked three-tape padding/copy machine, exactly 6(d+n)+14 transitions, at most 2(d+n)+6 represented tape cells at every prefix, plus one Boolean register and finite control. It writes output markers and handles empty inputs.

Finite coverage: parameterized finite words and supplied unary padding lengths, rather than a selected literal census.
Conditional-interface coverage: supplied input/marker/unary-control formats and the adder's boundary-observing entrance model remain explicit. Their layouts differ; a paid zip/sign-column builder is still required before physical sequential composition. These machines clear prescribed scratch/output; they do not restore arbitrary prior output.
Full-theorem coverage: no complete selected allocator, encoding, all-size integer multiplication, or final multiplication/runtime bound is proved.

Evidence and reproduction

Accepted sources are unchanged: SequentialBitAddition SHA256 7729e218143ac20dac17ca3c5ecd68b784d1d1c0b70fd2f0e4d13b8961e26c92 and MarkedZeroPadding SHA256 bd289c3ec5857e8dfd74a6e1138e8493c49f37bdbb83c4d6912ac902a879f302. Existing native checks took 3.243308743 and 4.286828551 seconds. All 24 probes and four full printed types received independent review; the adder retains one accepted unnecessarySimpa style warning, padding has none.

REPRODUCE.md gives source-hash-checked commands for Lean 4.21.0 and Mathlib 308445d7985027f538e281e18df29ca16ede2ba3. It reuses the two public XOR modules at PR1840 exact head 3f1b064 in caller scratch, without copying their source into this package. Existing receipts are provenance, not a relocated replay. No additional local CI preflight was run for publication. CI will be inspected after submission; generic repository checks alone do not establish a fresh Lean replay.

Attribution and duplicate comparison

James Chang with OpenAI assistance, Apache-2.0; Lean/Mathlib and the public XOR prerequisites retain their attribution. PR64/511/519/565 provide earlier counting, allocation, trimming and copying interfaces; the bounded exact-source comparison found no equivalent pair of these signed addition and marked-padding implementations. PR1840 is an explicit reused dependency. This claims the scoped implementation and checked bounds, not first-ever arithmetic or optimality. The later marked-adder refinement and layout builder are intentionally separate chunks.

Exact accepted source bodies and evidence retained. Public XOR dependencies pinned without duplication.

Tree-identical export of local candidate 63fac47cbdde63176758de8648ea361a1124606f; shared owner branches and original commit preserved.
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.

1 participant