Repository navigation
Proofs: give omega the facts it needs at each call - #5048
Merged
Merged
Conversation
A plain `omega` collects every arithmetic fact in the context, and its proof (one auxiliary theorem per call) is what the kernel then checks. This names, at each call, the facts the goal needs: `omega_using [h₁, h₂]`, or `omega_arith` where every needed fact has no name to write. The edits are mechanical. Each module was compiled with an instrumented `omega` that, per call, found a smallest set of context facts that still proves the goal, then compiled again with the rewritten calls; a call whose rewrite failed (or left a hypothesis unused) keeps `omega`. 167,699 calls in 12,407 modules change (161,941 to `omega_using`, 5,758 to `omega_arith`); 498 modules gain the import of `Proof/Framework/Omega.lean`. No statement changes, and nothing outside `Proof/`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHJ8H2BZWf42YgvgLoJ
alex
enabled auto-merge
November 14, 2026 02:29
alex
pushed a commit
that referenced
this pull request
Nov 14, 2026
- Registration: since #4794 an algorithm's registrations on a target are one file, and since #4806 a registration states no features, so the search joins Artifacts/Dsa/RISCV64.lean as PPC64LE's does, mapping over Proof.Variants.MillerRabin.RISCV64.variants. - #5059 folded Blinded/CTBase.lean, then imported only by RsaKeyGen/RISCV64/Cand/CTMr.lean, into CTMr. This PR restores CTBase.lean (8781344^), which the restored modules and the DSA prime test import too, so CTMr.lean is its version before #5059 again, importing CTBase instead of declaring its theorems a second time. - Blinded/Witness.lean and Search/MontPrep.lean stay byte-identical to 8781344^, without the text merge of #5048's omega rewrites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TKUFHGhkN8REQLPW8yxN5A
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.
What
A plain
omegacollects every arithmetic fact in the context, and its proof (one auxiliary theorem per call) is what the kernel then checks. This names, at each call, the facts the goal needs:or
omega_arithwhere a needed fact has no name to write.omega_using, 5,758 toomega_arith.Proof/Framework/Omega.lean(core imports only).omegacalls stay as they are (see below).lean/VerifiedGarbage/Proof/: no TCB, Spec, Impl, registration, generated code or CI change.How the edits were made
Mechanically, one module at a time, against the CI build of
main:omegathat, at each call in the source, searches for a smallest set of context facts that still proves the goal, and records whether each has a name that can be written there (accessible, not shadowed).omegamentions every fact it collects, so a hypothesis only it "used" becomes unused once the call names what it needs. Those calls keepomega.So every rewritten module has been compiled as it is here, against unchanged imports, and since only proofs change, the modules that import it are unaffected. I have not run a full local
lake buildof the result (it is most of the library); CI's build is that check. Three modules are left out on purpose:Proof/Blake2/X86_64/Compress.lean, whichmainchanged after the pass ran;Proof/Framework/Slots.lean, a module ofNativeHintSearch, whichci/check_lean_imports.pydoes not let importOmega;Proof/Dsa/X86/WorkspaceCall.lean, where a hypothesis nameddepthinomega_using [depth, …]reads toci/check_lean_speed.pyas unfolding a stack depth.The
Static checkssteps pass locally.ci/check_lean_public_imports.pywas not run (it needs the edited modules built); the only import change is the private import above, in modules that now useomega_using.What it buys
Measured on 29 rewritten modules chosen at random, each compiled before and after against the same imports, under the build's options (one thread, idle machine, the faster of two runs; 124.6 s of CPU before):
(An earlier run of the same sample on a busy machine gave −2.8% CPU; the table is the idle rerun.)
This is a modest step, not the whole answer: with the facts named, what remains at these calls is mostly the kernel checking
omega's certificate. A cheaper closer behindomega_using, inProof/Framework/Omega.leanalone, is the follow-up this makes possible by routing the calls throughomega_using; on the same sample it measures a further −2.9% CPU.🤖 Generated with Claude Code
https://claude.ai/code/session_01TKUFHJ8H2BZWf42YgvgLoJ