Skip to content

[Lean] Link an end-to-end proof of multiplication below n log n - #2411

Open
platypii wants to merge 11 commits into
CrocSwap:mainfrom
platypii:codex/link-end-to-end-lean-proof
Open

platypii wants to merge 11 commits into
CrocSwap:mainfrom
platypii:codex/link-end-to-end-lean-proof

Conversation

@platypii

@platypii platypii commented Oct 15, 2026 •

Copy link
Copy Markdown

Change and mathematical scope

Add a pointer under “Research notes and verification contributions” to Dan Brown and Kenny Daniel's end-to-end Lean proof of integer multiplication below n log n on Mathlib's finite Turing machines.

The fixed finite Mathlib machine multiplies every pair of binary-encoded natural numbers in worst-case time O(n (log n)^(1−κ)) with κ = 3299646951 / 2^46 ≈ 2^-14.3803. The theorem includes the complete compact runtime, all-input correctness, and the actual machine-step bound. This is an asymptotic exponent bound, not a measured execution speedup.

Correctness and runtime are proved without remaining algorithmic or analytic assumptions. The theorem's transitive axiom dependencies remain exactly propext, Classical.choice, and Quot.sound.

Task and overlap

Documentation pointer to an external completed proof, based on upstream 0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2. This does not establish the selected conditional saving κ = 0.001672660197076918 or change the selected construction.

Validation

The proof is pinned at f9f88141: statement and machine model, explicit and existential theorems, and completed-proof axiom audit.

The pinned PLAN.md records passing CompletedProofCheck, AxiomAudit (90354 declarations), and CompactControlCheck (521 contracts) at the exact saving 3299646951 / 2^46. The CI run for this exact source passed.

Checked the README-only diff, whitespace, and agreement with the pinned theorem and audit entry point, and the rounded base-two exponent. No new Lean build or historical certificate replay was run for this documentation update.

Credit

Dan Brown and Kenny Daniel are credited as the proof's coauthors. The external proof remains in its MIT-licensed repository; this PR contributes only the README pointer.

Open next questions

Independent review of the linked theorem statement and machine/time model. The binding margin is §5 compact-layer cost. Continue the structural improvements toward the selected conditional saving κ = 0.001672660197076918 while retaining the unconditional end-to-end machine proof and the same standard axiom dependencies.

@carlostoledo1891

Copy link
Copy Markdown

@platypii, this pull request asks for an independent review of the linked theorem statement and machine/time model. I did one, working with Claude (Anthropic's AI model), on platypii/integer-mult-bounds-lean at its current head aaf10926 (κ = 4222422970/2^46, later than the commit pinned above). The questions were written down before anything ran. What is not established comes first.

Not established

  • No second checker finished on the proof. Rebuilt from source it compiles (14,288 build steps), so Lean's kernel accepted every module, and mulInTime rests on propext, Classical.choice and Quot.sound. But when the whole proof is re-checked from nothing, three independently written checkers each ran quietly for a long stretch, then grew past 100 GiB within minutes on a 128 GB machine, and were stopped: nanoda on the lean4export export (twice, 76 and 81 minutes in), Lean's own leanchecker --fresh (after 6 h 42 min), and con-leche (after 63 min). Nothing rejected the proof. I have not found the cause. A second machine is running now to name the declaration where it happens; I will post what it finds here.
  • The statement was read, not decided. MulInTime is about Mathlib's multi-stack machine (FinTM2), on least-significant-bit-first words, with time in the total encoded length. The step to a multitape machine is the classical simulation, which neither this proof nor the Google/CMU one formalizes. That the statement says what its source says is a reading, made twice by readers who did not see each other's notes.
  • Finite alphabets. Mathlib asks finiteness of the input stack's alphabet only, and MulInTime adds no clause. ywz65's note in this repository (research/fintm2-reachable-alphabet) already shows why that cannot matter; I add nothing to it in general.

What I checked

  • mulInTime proves the proposition of Statement.lean as I typed it out: MulInTime (4222422970 / 2 ^ 46 : ℝ). The two types differ only in how a numeral's instance is written and are definitionally equal.
  • Thirteen variants of the statement, planted before the run. The four rewordings are accepted. The nine changes are refused, among them the numerator raised by one, κ = 2^-14, plain n log n, little-o, base-2 logarithm, and the sum in place of the product. Twelve of the thirteen carried a prediction and all twelve were met.
  • Three planted wrong proofs (a sorry, an added axiom, native_decide) are each caught by the list of axioms.
  • Comparator, on a challenge module I wrote (the repository ships none), refuses the statement with the numerator raised by one. On the true statement it gave no verdict: it was still running after five hours when my memory guard stopped it.
  • A Lean theorem joining this proof to the Google/CMU statement. IntMulBridge.community_proves_challenge : SubNLogN.Challenge.IntMulSubNLogN, compiled inside your release with a byte-identical copy of lockqueue/intmul's 80-line statement file: your proof gives their statement as they word it (their separator encoding, their inequality in ℕ at κ = 2^-46, their finite-alphabets clause). For that last clause I rebuilt your machine along your own lemmas, carrying finiteness through; it is not proved equal to the witness inside mulInTime. One direction, Lean's kernel only.

The page, with what stays open first: https://carlostoledo.co/reports/intmul.html
The record and every log: https://github.com/carlostoledo1891/cert-machine/blob/main/certs/intmul-audit.json and https://github.com/carlostoledo1891/cert-machine/tree/main/corpus/intmul
The five Lean files of the joining theorem: https://github.com/carlostoledo1891/cert-machine/tree/main/corpus/intmul/bridge/assembly

If anything here misreads your work, tell me and I will correct the page.

Carlos Toledo

@carlostoledo1891

Copy link
Copy Markdown

As promised above: the place where the checkers run out of memory has a name.

On a second machine I built aaf10926 again and exported it. The export is the first one byte for byte (sha256 114e7e51…). I then ran con-leche with its progress heartbeat, which names the oldest check in flight.

  • con-leche's memory read 2.9 GiB at 15:29:10 UTC. At 15:29:18 it began IntegerMultBounds.MathlibTM2.M8.Global.DesignB.stage_source_trace (IntegerMultBounds/MathlibTM2/M8/Global/DataTraceB.lean). From then it grew about 10 GiB a minute. I stopped it at 100.4 GiB with that theorem still unfinished after 589 seconds; the other workers completed 7,762 checks meanwhile.
  • An earlier theorem of the same design, centreBlock_gate_good, took 114 seconds and about 10 GiB, and finished.
  • The short way to see it, with Lean's own checker: after lake build, lake env leanchecker IntegerMultBounds.MathlibTM2.M8.Global.DataTraceB ended with INTERNAL PANIC: out of memory after 9 min 10 s at 84.9 GiB, under a 90 GiB limit I set. The ordinary build compiles that module in 98 seconds.

Not shown: that nanoda and the full fresh replay were on this same theorem (neither says where it is), and why a replay costs what the build does not. The proof of stage_source_trace ends in one simp only [stage, blocks, preBlocks, postBlocks, …]; I did not test whether another proof of it replays cheaply.

Nothing here says the theorem is wrong: Lean accepted it when the module was built.

The logs: https://github.com/carlostoledo1891/cert-machine/tree/main/corpus/intmul/pod2/locate (progress.log is the heartbeat, memory2.txt the memory, module.* the leanchecker run). The page is updated: https://carlostoledo.co/reports/intmul.html

I did this with Claude (Anthropic's AI model).

Carlos Toledo

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