Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR completes the new pattern matching and unification procedures for the symbolic simulation framework using a two-phase approach. **Phase 1 (Syntactic Matching):** - Patterns use de Bruijn indices for expression variables and renamed level params for universe variables - Purely structural matching after reducible definitions are unfolded - Universe levels treat `max`/`imax` as uninterpreted functions - Proof arguments skipped via proof irrelevance - Instance and binder constraints deferred to Phase 2 **Phase 2 (Pending Constraints):** - Level constraints: structural equality with mvar assignment - Instance constraints: `isDefEqI` (full `isDefEq` for TC synthesis) - Expression constraints: `isDefEqS` with Miller pattern support - Unassigned instance pattern variables synthesized via `trySynthInstance` **`isDefEqS` (Structural DefEq):** - Miller pattern detection and assignment (`?m x y z := rhs` → `?m := fun x y z => rhs`) - Scope checking via `maxFVar` to prevent out-of-scope assignments - Optional zeta-delta reduction for let-declarations - Proof irrelevance and instance delegation to `isDefEqI` **Key optimizations:** - `abstractFVars` skips metavariables and uses `maxFVar` for early cutoff - Per-pattern `ProofInstInfo` cache for fast argument classification - Maximal sharing. |
||
|---|---|---|
| .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.