Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR fixes `@[implicit_reducible]` on well-founded recursive definitions. `addPreDefAttributes` sets WF-recursive definitions as `@[irreducible]` by default, skipping this only when the user explicitly wrote `@[reducible]` or `@[semireducible]`. It was missing `@[instance_reducible]` and `@[implicit_reducible]`, causing those attributes to be silently overridden. Add `instance_reducible` and `implicit_reducible` to the check in `src/Lean/Elab/PreDefinition/Mutual.lean` that guards against overriding user-specified reducibility attributes, and add regression tests in `tests/elab/wfirred.lean`. ## Example ```lean -- Before fix: printed @[irreducible] def f : List Nat → Nat -- After fix: printed @[implicit_reducible] def f : List Nat → Nat @[instance_reducible] def f : ∀ _l : List Nat, Nat | [] => 0 | [_x] => 1 | x :: y :: l => if h : x = y then f (x :: l) else f l + 2 termination_by l => sizeOf l #print sig f ``` Fixes #12775 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nomeata <148037+nomeata@users.noreply.github.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.