Zulip Chat Archive

Stream: general

Topic: use hott3 library on windows


Thomas Eckl (Aug 25 2020 at 14:45):

I tried to use the hott3 library of Gabriel Ebner and Floris van Doorn for a project of my own. So I cloned the library, executed leanpkg build, created my own project with leanpkg, added the path to the hott3 library to leanpkg.path

Thomas Eckl (Aug 25 2020 at 14:51):

builtin_path
path ./src
path ../../hott3/src

and as a local dependency to leanpkg.toml

[package]
name = "HoTT-Case-Study"
version = "0.1"
path = "src"
lean_version = "leanprover-community/lean:3.7.0"

[dependencies]
# local dependency
hott3 = { path = "../../hott3" }

Still I can't import any files from the hott3 library: import hott.init just triggers file 'hott\init' not found in the search path . However the path is present when executing lean --path.

What am I doing wrong?

Patrick Massot (Aug 25 2020 at 14:53):

Do you really insist on doing this by hand?

Patrick Massot (Aug 25 2020 at 14:53):

Do you intend to modify the hott lib along the way?

Patrick Massot (Aug 25 2020 at 14:56):

You answered in the wrong thread.

Patrick Massot (Aug 25 2020 at 14:56):

Anyway, even if you want to do a lot by hand, modifying both those files is meaningless.

Patrick Massot (Aug 25 2020 at 14:57):

The toml file is meant to write the path file for you.

Thomas Eckl (Aug 25 2020 at 14:57):

Sorry. Well, the manual only tells me how to produce a leanpkg using mathlib - I don't want to do that. It might be that I have to extend the hott library; I want to port some Lean2 hott files and don't know yet what I need on the way.

Reid Barton (Aug 25 2020 at 14:58):

You shouldn't ever need to edit leanpkg.path: that's between leanpkg and lean.

Thomas Eckl (Aug 25 2020 at 14:58):

And how do you bring the toml file to include the path to the hott3 library?

Reid Barton (Aug 25 2020 at 15:00):

I would just use a git dependency probably.

Patrick Massot (Aug 25 2020 at 15:00):

Your toml looks fine

Patrick Massot (Aug 25 2020 at 15:00):

just use leanpkg configure after writing this toml

Thomas Eckl (Aug 25 2020 at 15:02):

Did it, no extra path included in leanpkg.path.

Patrick Massot (Aug 25 2020 at 15:02):

No, you didn't.

Reid Barton (Aug 25 2020 at 15:02):

what do you mean "extra"?

Patrick Massot (Aug 25 2020 at 15:03):

I'll list steps for you, hold on

Patrick Massot (Aug 25 2020 at 15:06):

  • cd /tmp
  • git clone git@github.com:gebner/hott3.git
  • mkdir my_proj
  • Inside my_proj/leanpkg.toml, write
[package]
name = "eckl"
version = "0.1"
lean_version = "leanprover-community/lean:3.7.0"
path = "src"

[dependencies]

hott3 = { path = "../hott3" }
  • cd my_proj
  • leanpkg configure
  • mkdir src

Patrick Massot (Aug 25 2020 at 15:07):

  • enjoy your leanpkg.path

Reid Barton (Aug 25 2020 at 15:10):

Just to check, you did open the project/folder/whatever it's called in VSCode, right?

Thomas Eckl (Aug 25 2020 at 15:42):

Worked! Thanks a lot! Now I am wondering: There are no .olean files in the hott3 folders. Do I need to leanpkg build them?

Patrick Massot (Aug 25 2020 at 15:55):

Yes, I don't think the hott3 team provides precompiled oleans.

Patrick Massot (Aug 25 2020 at 15:56):

I'm curious: where did you get the idea to edit leanpkg.path by hand?

Patrick Massot (Aug 25 2020 at 15:56):

I'm asking because we are always hunting down ancient obsolete instructions.

Thomas Eckl (Aug 25 2020 at 15:58):

Don't worry about ancient instructions: Because I didn't find any instructions at all for packages not depending on mathlib, I just thought that this might work.

Thomas Eckl (Aug 25 2020 at 15:58):

Should have read more about the workings of leanpkg I guess.

Patrick Massot (Aug 25 2020 at 15:59):

TBH, I don't think we have much doc about such an unusual situation.

Patrick Massot (Aug 25 2020 at 15:59):

99.99% of Lean project are either mathlib or depend on mathlib and nothing else.

Thomas Eckl (Aug 25 2020 at 16:00):

Zulip seems to be a good replacement for documentation :grinning:

Patrick Massot (Aug 25 2020 at 16:01):

I don't even remember whether I created a leanproject command to add a dependency which is not mathlib.

Patrick Massot (Aug 25 2020 at 16:01):

I think no.

Patrick Massot (Aug 25 2020 at 16:02):

Feel free to open a doc PR (or even a leanproject PR).

Thomas Eckl (Aug 25 2020 at 16:04):

I completely understand that the focus is on mathlib(-dependent projects). But I want to find out whether the nice ecosystem of Lean 3 makes experimenting with HoTT easier. Let's see ...

Reid Barton (Aug 25 2020 at 16:05):

leanpkg already has an option to do this. The instructions after git clone can be equivalently leanpkg new my_proj; cd my_proj; leanpkg install ../hott3; leanpkg configure (untested).

Reid Barton (Aug 25 2020 at 16:05):

It's documented insofar as leanpkg --help exists.

Thomas Eckl (Aug 25 2020 at 16:12):

Since I don't know what a doc PR is, Reid's remark seems a good final point. If my project runs to some fat I might get back to a leanproject PR.


Last updated: Dec 20 2023 at 11:08 UTC