Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Find a file
Leonardo de Moura f2339268b1 fix: adjust code to new match-compiler
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.
2020-12-08 13:46:00 -08:00
.github fix: Nix: don't try to push PRs 2020-11-24 19:16:27 +01:00
doc doc: array 2020-12-08 10:36:47 -08:00
images chore(CMakeLists.txt): move Lean logo to make sure we can test leanemacs without installing Lean 2015-01-31 17:38:49 -08:00
lean4-mode chore: add keyword "scoped" 2020-12-04 11:28:40 -08:00
nix fix: Nix: better stage 0 detection 2020-12-08 17:13:32 +01:00
script fix: gen_constants_cpp.py: mark constants as persistent 2020-11-29 18:59:39 +01:00
src fix: adjust code to new match-compiler 2020-12-08 13:46:00 -08:00
stage0 chore: update stage0 2020-12-08 12:42:25 -08:00
tests fix: adjust code to new match-compiler 2020-12-08 13:46:00 -08:00
tmp chore: remove tactic framework dependency 2020-11-10 14:32:58 -08:00
.gitattributes chore: restore marking stage0/ as binary files, which we lost at some point 2020-08-14 11:12:13 +02:00
.gitignore chore: ignore result files from nix build 2020-11-24 19:16:27 +01:00
CMakeLists.txt chore: use standard release build for stage 0 2020-10-12 10:34:48 +02:00
default.nix feat: Nix: compatibility default.nix 2020-11-24 19:16:27 +01:00
flake.lock chore: go back to LLVM 10 2020-11-30 12:32:53 +01:00
flake.nix feat: Nix: thread-sanitized build 2020-11-29 18:59:39 +01:00
LICENSE Add LICENSE file 2013-07-15 18:55:48 -07:00
README.md chore: add link to manual 2020-11-23 10:21:52 -08:00
shell.nix fix: CI: Linux release job 2020-11-24 19:16:27 +01:00

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.