Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR adds support for simp/equational spec theorems in the SymM-based `mvcgen'` tactic, catching up with a feature that the original `mvcgen` has supported for a long time. Users can write `@[spec] theorem : get (m := StateT σ m) = fun s => pure (s, s) := rfl` instead of manually specifying equivalent Hoare triples. The equational form is more concise and natural for specs that simply unfold definitions. The universe level normalization (`normalizeLevelsExpr`) applied in `work` and the backward rule constructors is a workaround; ideally this should be integrated into `preprocessMVar`/`preprocessExpr` in the SymM framework so all users benefit. Changes: - Add `SpecTheoremKind` to distinguish triple vs simp specs in `SpecTheoremNew` - Add `mkSpecTheoremNewFromSimpDecl?` to create spec entries from equational lemmas, filtering no-op equations - Add `mkBackwardRuleFromSimpSpec` to build backward rules via `Eq.mpr`/`congrArg`, with instance synthesis, projection reduction, and `unfoldReducible` on the RHS - Migrate simp theorems from `SimpTheorems` database during `migrateSpecTheoremsDatabase` - Normalize universe levels so structural matching in `BackwardRule.apply` succeeds when `max u v` vs `max v u` arise from different code paths - Simplify `mkSpecContext` by removing the mock `simp` context construction - Use `mkBackwardRuleFromExpr` instead of `mkAuxLemma` for triple specs, since the proof may contain free variables from the goal context - Add `AddSubCancelSimp` benchmark case and test exercising the simp spec code path - Change `AddSubCancel` spec proofs from `mvcgen` to `mvcgen'` (dogfooding) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| .vscode | ||
| 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 | ||
| 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.