Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
This PR implements the option `mvcgen +jp` to employ a slightly lossy VC encoding for join points that prevents exponential VC blowup incurred by naïve splitting on control flow. ```lean def ifs_pure (n : Nat) : Id Nat := do let mut x := 0 if n > 0 then x := x + 1 else x := x + 2 if n > 1 then x := x + 3 else x := x + 4 if n > 2 then x := x + 1 else x := x + 2 if n > 3 then x := x + 1 else x := x + 2 if n > 4 then x := x + 1 else x := x + 2 if n > 5 then x := x + 1 else x := x + 2 return x theorem ifs_pure_triple : ⦃⌜True⌝⦄ ifs_pure n ⦃⇓ r => ⌜r > 0⌝⦄ := by unfold ifs_pure mvcgen +jp /- ... h✝⁵ : if n > 0 then x✝⁵ = 0 + 1 else x✝⁵ = 0 + 2 h✝⁴ : if n > 1 then x✝⁴ = x✝⁵ + 3 else x✝⁴ = x✝⁵ + 4 h✝³ : if n > 2 then x✝³ = x✝⁴ + 1 else x✝³ = x✝⁴ + 2 h✝² : if n > 3 then x✝² = x✝³ + 1 else x✝² = x✝³ + 2 h✝¹ : if n > 4 then x✝¹ = x✝² + 1 else x✝¹ = x✝² + 2 h✝ : if n > 5 then x✝ = x✝¹ + 1 else x✝ = x✝¹ + 2 ⊢ x✝ > 0 -/ grind ``` |
||
|---|---|---|
| .github | ||
| doc | ||
| images | ||
| nix | ||
| 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 Setting Up Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.