Zulip Chat Archive

Stream: lean4

Topic: no leanpkg in lean4/stable?


Omri Schwarz (Nov 12 2023 at 17:43):

Hi, all. I'm moving to lean4 in time for AOC, and trying to run through some examples, and right now I"m with this gem:

def double (y : ℤ) :ℤ :=
y + y

Which complains of this:
16:4:
failed to synthesize instance
HAdd ℤ ℤ ?m.2742

Do we need to import preludes or something to get started?

Adam Topaz (Nov 12 2023 at 17:46):

I think the notation is introduced in Std or mathlib. What happens if you replace Z\Z with Int?

Adam Topaz (Nov 12 2023 at 17:46):

Also #backticks

Omri Schwarz (Nov 12 2023 at 17:48):

Yup, that was the issue. Thanks!

Damiano Testa (Nov 12 2023 at 17:48):

You may want to add set_option autoImplicit false at the beginning of the file as well.

Omri Schwarz (Nov 13 2023 at 16:46):

Also, to actually stay true to the topic question:

```omri.schwarz@ARL-DYCPQTJJHN Advent % ls ~/.elan/toolchains/*/bin
/Users/omri.schwarz/.elan/toolchains/leanprover--lean4---nightly/bin:
clang lake ld64.lld lean leanc leanmake llvm-ar

/Users/omri.schwarz/.elan/toolchains/leanprover--lean4---stable/bin:
clang lake ld64.lld lean leanc leanmake llvm-ar

/Users/omri.schwarz/.elan/toolchains/stable/bin:
clang lake ld64.lld lean leanc leanmake llvm-ar
omri.schwarz@ARL-DYCPQTJJHN Advent %

Is leanpkg not part of the tooling for Lean 4?

Kevin Buzzard (Nov 13 2023 at 16:46):

The tooling for Lean 4 is elan and lake.

Eric Wieser (Nov 13 2023 at 16:46):

If you read documentation that led you to believe leanpkg would be there, can you link us to it so that we can correct it?

Omri Schwarz (Nov 13 2023 at 17:08):

This was in a mess of crashed browser tabs, so finding won't be easy, but I'm rechecking all the live docs and will flag anything I find

Julian Berman (Nov 13 2023 at 17:14):

Perhaps archiving a few more repositories in the leanprover-community org would be a good idea at this point. (In particular lean and doc-gen? Maybe others.) Specifically it'd make searches like https://github.com/search?q=org%3Aleanprover-community+leanpkg+NOT+is%3Aarchived&type=code a bit more useful.

Eric Wieser (Nov 13 2023 at 17:16):

I never even thought of using NOT is:archived in a search, so I'm not convinced we gain anything by optimizing for that case

Eric Wieser (Nov 13 2023 at 17:18):

Given that this is the third or fourth time that someone has complained that leanpkg is missing, and no one can ever tell us why they expected it in the first place, maybe the toolchain should just come with a leanpkg that prints an error message and a link to the lake docs

Eric Wieser (Nov 13 2023 at 17:24):

I created lean4#2872


Last updated: Dec 20 2023 at 11:08 UTC