Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR introduces a new annotation that allows definitions to describe plausible-but-wrong name variants for the purpose of improving error messages. This PR just adds the notation and extra functionality; a stage0 update will allow standard Lean functions to have suggestion annotations. (Hence the changelog-no tag: this should go in the changelog when some preliminary annotations are actually added.) ## Example ```lean4 inductive MyBool where | tt | ff attribute [suggest_for MyBool.true] MyBool.tt attribute [suggest_for MyBool.false] MyBool.ff @[suggest_for MyBool.not] def MyBool.swap : MyBool → MyBool | tt => ff | ff => tt /-- error: Unknown constant `MyBool.true` Hint: Perhaps you meant `MyBool.tt` in place of `MyBool.true`: M̵y̵B̵o̵o̵l̵.̵t̵r̵u̵e̵M̲y̲B̲o̲o̲l̲.̲t̲t̲ -/ #guard_msgs in example := MyBool.true /-- error: Invalid field `not`: The environment does not contain `MyBool.not`, so it is not possible to project the field `not` from an expression MyBool.tt of type `MyBool` Hint: Perhaps you meant one of these in place of `MyBool.not`: [apply] `MyBool.swap`: MyBool.tt.swap -/ #guard_msgs in example := MyBool.tt.not ``` |
||
|---|---|---|
| .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.