chore: bump Lean toolchain to v4.33.0-rc2 - #34
Merged
Conversation
digama0
force-pushed
the
agent/bump-v4.33.0-rc2
branch
2 times, most recently
from
August 4, 2026 06:06
8292bef to
4ea5644
Compare
The kernel hardening in the v4.32.2..v4.33.0-rc2 range splits into fixes for reachable bugs and checks that defend against mistakes elsewhere in the kernel. Lean4lean keeps the former and declines the latter: a check that establishes no precondition of a later step adds proof obligations without contributing an invariant, and the correctness proof is what discharges "we might have a bug". Removed, each with a `divergences.md` entry: * The projection structure-name comparison in `isEquiv`, `isDefEqCore'` and `reduceProj` (lean4#14631). `inferProj` already rejects `.proj S i e` unless the type of `e` whnfs to an application of `S`, so comparison and reduction only ever see projections that have been through inference. Upstream's own test has to plant the declaration under `debug.skipKernelTC` to reach the difference. * The kernel exceptions in `restoreNested` and `restoreCtorName` (lean4#14632), back to `unreachable!` and `assert!`. Upstream states that nothing in that PR is reachable from ordinary Lean code, and the motivation given there -- out of bounds reads once the assertions vanish in a release build -- does not apply to total `Array`/`Option` accesses. * The `_nested` scan on inductive types (lean4#14616). The rewrite touches constructor types only, and an auxiliary is neither in scope while the block's own types are checked nor present afterwards. The constructor scan is kept: it guards a hole that is reachable. * The recheck of the restored constructor and recursor declarations (lean4#14621), which upstream describes as redundant sanity checking. `Lean4Lean.Tests.KernelHardening` now runs the counterexamples upstream shipped with the fixes -- #14577, #14607, #14608, #14613 and the duplicate mutual name -- and replaces the ported `_nested` case with one naming an auxiliary the kernel really generates, so it fails when the check is removed instead of passing either way. Also simplifies the v4.33.0-rc2 compatibility workarounds in `ShapeLogRel`, `Verify/Axioms`, `Verify/Expr`, `Verify/Level` and `Level`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
digama0
force-pushed
the
agent/bump-v4.33.0-rc2
branch
from
August 4, 2026 06:16
4ea5644 to
b6d29e4
Compare
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.
Summary
v4.32.2tov4.33.0-rc2This is directly stacked on the merge commit of #30. We are intentionally tracking the release candidate rather than
master; the original plan to trackmasterbecame unnecessary oncev4.33.0-rc2was available.Kernel audit
Audit command:
It identifies 14 commits. The two first landed on both release branches under different cherry-pick hashes, so they appear in this range even though #30 already audited them.
d8b1897832/ #14633, check binder types before extending the local contextinferLambdaandinferLetcallensureSortbeforewithLocalDecl. The now-stale binder-order entry was removed fromdivergences.md.be0966703b/ #14632, harden kernel invariantsQuotname checks; duplicate-name validation for mutual blocks; structure-name validation in projection reduction; exception-producing nested restoration in place of assertions. Projection indices are LeanNats throughout lean4lean, so there is no narrowing boundary to guard; regressions exercise2^32as both stuck during reduction and rejected during inference.1bb3bcfdad/ #14631, compare projection structure namesEquivManager.isEquivandTypeChecker.isDefEqCore'now compare structure name and index; the corresponding verification proofs were updated. Tests cover valid reduction, wrong-name non-reduction/non-equivalence, and oversized indices.792b3a6d69/ #14621, recheck nested-inductive outputaux2nestedchecks remain under the elimination local context.39f44348a1/ #14616, reserve_nestednamesExpr.constnames andExpr.projstructure names below_nestedare rejected. Both forms have regressions.303a57ceb5/ #14615, normalize inductive-predicate decisionscheckConstructors,isLargeEliminator, andisKTarget; all now useisAlwaysZero. TheSort (imax 1 0)regression confirms no large-elimination universe is introduced.c8f4a42ded/ #14613, normalizeProprecognitionisPropalready used normalized level reasoning. The divergence documentation now describes only lean4lean's deliberately more conservative uncertain-level behavior. The sameimaxregression covers this classification.189dc27892/ #14608, mutual universe parametersaddMutualrequires every member to have the first member's exact level-parameter list. A mismatched block and a valid control are tested.b4e8db15bb/ #14607, reject fvars/mvars before nested eliminationElimNestedInductive.run, preventing elimination from hiding either kind. Both paths have regressions.f839b65ba4/ #14577, missing nested-inductive declaration checkLean4Lean.Tests.NestedInductive. The broader #14621 rechecks now add another defensive layer.472f5c03e9/ #14498, opaque values containing fvarsLean4Lean.Tests.DeclFVarcontinues to cover definition, theorem, and opaque value paths, including valid controls.85e209a57b/ #13956, deterministicmaxRecDepthFuelConfiganddivergences.mdnow explain the mapping; a regression checks low-fuel failure and high-fuel success.9ebb35b4af/ #14203, delete unused C++ codefa69f38200/ #14094, usestd::optionalOption, so no source change.I also inspected the Lean-level
Level,Expr, andDeclarationchanges. The universe algorithm itself is unchanged in this range; the relevant non-kernel compatibility changes are theLean.Nat.imaxnamespace move and rc2's splitimplicit_reducibletransparency behavior. The latter required marking erased/index-only aliases so implicit argument checking can unfold them without changing typeclass synthesis behavior.Validation
lake build— 148 jobslake build Lean4Lean.Experimental— 68 jobslake build Lean4Lean.Tests.KernelHardeninglake exe lean4lean Init.Core— checked 1,035 declarationslake exe lean4lean --fresh Init.System.IO— checked 43,609 declarationsgit diff --checksorrydeclarations