Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR adds per-result `contextDependent` tracking to `Sym.Simp.Result` and splits the simplifier cache into persistent (context-independent) and transient (context-dependent, cleared on binder entry). This replaces the coarse `wellBehavedMethods` flag. Key changes: - Add `contextDependent : Bool := false` to `Result.rfl` and `Result.step` - Split `State.cache` into `persistentCache` and `transientCache` - Remove `wellBehavedMethods` from `Methods` - Replace `withoutModifyingCacheIfNotWellBehaved` with `withFreshTransientCache` - Change `DischargeResult` to an inductive (`.failed`/`.solved`) - Add `dischargeAssumption` (context-dependent discharger for testing) - Add `sym.simp.debug.cache` trace class - Propagate `contextDependent` through all combinators (congruence, transitivity, control flow, arrows, rewriting) - Add `mkRflResult`/`mkRflResultCD` to avoid dynamic allocation of rfl results - Fix `isRfl` to ignore `contextDependent` (was silently broken by the extra field) Propagation invariant: when combining sub-results, `cd` is the disjunction of ALL sub-results' flags — including `.rfl` results. If `simp` returned `.rfl (contextDependent := true)`, it means `simp` might take a completely different code path in another local context, so all downstream results must be marked context-dependent. --------- Co-authored-by: Claude Opus 4.6 (1M context) <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.