Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes the interaction between `backward.whnf.reducibleClassField` and `isDefEqDelta`'s argument-comparison heuristic. When `backward.whnf.reducibleClassField` is enabled, `unfoldDefault` reduces class field projections past the `.proj` form at `.instances` transparency. This causes `isDefEqDelta` to lose the instance structure that `isDefEqProj` needs to bump transparency for instance-implicit parameters. The fix adds an `.abbrev` branch in `isNonTrivialRegular` that classifies class field projections as nontrivial when the option is enabled, so `tryHeuristic` applies the argument-comparison heuristic (with the correct transparency bump) instead of unfolding. Key insight: all projection functions receive `.abbrev` kernel hints (not `.regular`), regardless of their reducibility status. Structure projections default to `.reducible` status, while class projections default to `.semireducible` status. The old code only handled the `.regular` case and treated everything else (including `.abbrev`) as trivial. Also fixes two minor comment issues in `tryHeuristic`: "non-trivial regular definition" → "non-trivial definition" (since `.abbrev` definitions can now be nontrivial too), and "when `f` is not simple" → "when `f` is simple" (logic inversion in the original comment). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| doc | ||
| images | ||
| releases_drafts | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| .gitattributes | ||
| .gitignore | ||
| .gitpod.Dockerfile | ||
| .gitpod.yml | ||
| .ignore | ||
| CMakeLists.txt | ||
| CMakePresets.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| lean-toolchain | ||
| lean.code-workspace | ||
| LICENSE | ||
| LICENSES | ||
| README.md | ||
| RELEASES.md | ||
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.