Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
In the new frontend, ```lean @[macroInline] def or : Bool → Bool → Bool | true, _ => true | false, b => b ``` is compiled as ```lean def or (x y : Bool) : Bool := or.match_1 _ x y (fun _ => true) (fun b => b) ``` Thus, the `[macroInline]` attribute does not guarantee that `y` is evalutated only when `x` is `false`. The new definition does. This issue was not exposed before because the compiler has an optimization that float let-decls when they are used in a single branch. @Kha We have talked about removing `macroInline`, and defining functions such as `or` as ```lean @[inline] def or (x : Bool) (y : Unit -> Bool) : Bool := match x with | true => true | false => y () ``` and define `x || y` as notation for `or x (fun _ => y)`. I think this is the way to go for polymorphic operators such as `<|>`, but I am not sure about `or`. New users will probably be puzzled by it. In particular when they are writing proofs. |
||
|---|---|---|
| .github | ||
| doc | ||
| images | ||
| lean4-mode | ||
| nix | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| tmp | ||
| .gitattributes | ||
| .gitignore | ||
| CMakeLists.txt | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| shell.nix | ||
We are currently developing Lean 4. The Lean 4 manual (work in progress) will give you an overview of the language.
Lean 3 is still the latest official release. This repository contains work in progress.
Important. Unless you are one of our collaborators
- We strongly suggest you use Lean 3.
- Pull requests are not welcome.
- New issues are not welcome, and will be closed without any feedback.