mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
f4bbf748dfb45a5f9a693f228bd7ce0faf4ab272
deriving noncomputable instance syntax (#12756)
This PR adds `deriving noncomputable instance Foo for Bar` syntax so that delta-derived instances can be marked noncomputable. Previously, when the underlying instance was noncomputable, `deriving instance` would fail with an opaque async compilation error. Now: - `deriving noncomputable instance Foo for Bar` marks the generated instance as noncomputable (using `addDecl` + `addNoncomputable` instead of `addAndCompile`) - `deriving instance Foo for Bar` pre-checks for noncomputable dependencies and gives an actionable error with a "Try this:" suggestion pointing to the noncomputable variant - For handler-based deriving (inductives/structures), `noncomputable` sets `isNoncomputable` on the scope The `optDefDeriving` and `optDeriving` trailing parsers are updated with `notSymbol "noncomputable"` to prevent them from stealing the parse of `deriving noncomputable instance ...`. 🤖 Prepared with Claude Code --------- 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%