Repository navigation
feat: remove deprecated in-kernel native reduction - #14953
Merged
Merged
Conversation
This PR removes `Lean.reduceBool`, `Lean.reduceNat`, `Lean.ofReduceBool`, `Lean.ofReduceNat` and `Lean.trustCompiler`, along with the kernel's support for reducing applications of the first two by running the compiler. They have been deprecated since 2026-02-01 in favour of asserting native evaluations with axioms, which is what `native_decide` and `bv_decide` already do through `Lean.Meta.nativeEqTrue`. Nothing in the toolchain used them any more. `Lean.Meta.reduceNative?`, `Lean.Meta.reduceBoolNative`, `Lean.Meta.reduceNatNative` and `Lean.Meta.isDefEqNative` go with them, since they exist only to reduce those two constants. Downstream callers of `reduceNative?` should drop the call: with the constants gone it could only ever return `none`. `test_extern` wrapped its comparison in `Lean.reduceBool` before handing it to `evalExpr`, where the wrapper was the identity; it now evaluates the decision directly. Removing the axioms also makes `#print axioms` mean what it says for the whole environment. `Lean.trustCompiler` was referenced unconditionally from the bodies of `reduceBool` and `reduceNat` so that it would be reported for anything reducing through them, which left it looking used in every environment that merely imported them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This PR removes `run_boxed_kernel` and `elab_environment_of_kernel_env`, which existed only so the kernel could run a compiled declaration while reducing `Lean.reduceBool` and `Lean.reduceNat`. With in-kernel native reduction gone, they have no callers, and `src/kernel/` no longer refers to the interpreter or to `ir` at all. `Environment.ofKernelEnv` loses its `@[export]` with them; the function itself stays, since `Lean.Message` and `Lean.Replay` use it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Collaborator
|
Reference manual CI status:
|
|
Mathlib CI status (docs):
|
nomeata
approved these changes
Aug 28, 2026
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Aug 28, 2026
|
The adaptation PR for this PR is leanprover/downstream-lean4#27. |
mathlib-nightly-testing Bot
pushed a commit
to leanprover-community/mathlib4-nightly-testing
that referenced
this pull request
Aug 28, 2026
leanprover-bot
added a commit
to leanprover/reference-manual
that referenced
this pull request
Aug 28, 2026
nomeata
pushed a commit
to leanprover/lean-kernel-arena
that referenced
this pull request
Nov 22, 2026
Bumps the `lean4lean` checker from `bce3448` (Lean v4.33.0-rc2) to `932afa1` (Lean v4.36.0), the tip of lean4lean's `arena` branch. This takes in lean4lean's ports of the kernel changes from v4.33.0 through v4.36.0, including: - a fix to the inductive adder, which now reads every constructor field from a single normalization (the issue fixed upstream in leanprover/lean4#14806). At `bce3448`, lean4lean could be made to accept a recursor missing an inductive hypothesis, and from that a proof of `False`. - bounds on the size of `Nat` literals and on the results of `Nat` operations (leanprover/lean4#14849). - removal of native reduction (leanprover/lean4#14953) and of `etaExpand` (leanprover/lean4#15268). The old rev stays reachable on lean4lean's `arena-v4.33.0-rc2` branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
github-actions Bot
pushed a commit
to argumentcomputer/lean4lean
that referenced
this pull request
Nov 23, 2026
Port of leanprover/lean4#14953, which removes `Lean.reduceBool`, `Lean.reduceNat`, `Lean.ofReduceBool`, `Lean.ofReduceNat` and `Lean.trustCompiler`, together with the kernel's support for reducing applications of the first two by running the compiler. They had been deprecated since 2026-02-01; `native_decide` and `bv_decide` assert native evaluations with axioms instead. Lean4lean never ran native code: `reduceNative` only recognized the two applications and threw, which was the first entry in `divergences.md`. It is removed, with its calls in `whnf` and `lazyDeltaReduction` and its proof obligations in `whnf.WF` and `lazyDeltaReduction.WF`. On an environment that still has them, `reduceBool c` and `reduceNat c` are applications of opaque constants, stuck like any other, so a proof relying on them is rejected as before, by a failed definitional equality instead of the dedicated error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
This PR removes
Lean.reduceBool,Lean.reduceNat,Lean.ofReduceBool,Lean.ofReduceNatandLean.trustCompiler, along with the kernel's support for reducing applications of the first two by running the compiler. They have been deprecated since 2026-02-01 in favour of asserting native evaluations with axioms, which is whatnative_decideandbv_decidealready do throughLean.Meta.nativeEqTrue. Nothing in the toolchain used them any more.Removing the axioms makes
#print axioms, and the upcominglake check, mean what it says for the whole environment.Lean.trustCompilerwas referenced unconditionally from the bodies ofreduceBoolandreduceNatso that it would be reported for anything reducing through them, which left it looking used in every environment that merely imported them.