mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 10:24:07 +00:00
nightly-with-manual
This PR fixes a bug where `max u v` and `max v u` fail to match in SymM's pattern matching. Both `processLevel` (Phase 1) and `isLevelDefEqS` (Phase 2) treated `max` positionally, so `max u v ≠ max v u` structurally even though they are semantically equal. The fix has three parts: - Eagerly normalize universe levels in patterns at creation time (`preprocessDeclPattern`, `preprocessExprPattern`, `mkSimprocPatternFromExpr`) - Normalize the target level in `processLevel` before matching, using a `where go` refactor - Add `tryApproxMaxMax` to `processLevel` and `isLevelDefEqS`: when positional `max/max` matching would fail, check if one argument from each side matches structurally and match the remaining pair Also moves `normalizeLevels` from `Grind.Util` to `Sym.Util` to avoid code duplication, since both Sym and Grind need it. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This is the repository for Lean 4.
About
- Quickstart
- Homepage
- Theorem Proving Tutorial
- Functional Programming in Lean
- Documentation Overview
- Language Reference
- Release notes starting at v4.0.0-m3
- Examples
- External Contribution Guidelines
Installation
See Install Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.
Languages
Lean
94.3%
C++
4.1%
Python
0.6%
Shell
0.4%
CMake
0.3%