News for hackers. Stuff that matters.
Re:Lean 4.0.0, first official lean4 release by hackandthink on Friday September 08, 2023 @02:40AM (#37430252)
There is no excuse anymore. I have to try it out.
Re:Lean 4.0.0, first official lean4 release by fithisux on Friday September 08, 2023 @02:54AM (#37430365)
Me too, I want to follow

https://github.com/blanchette/logical_verification_2023

The hitchhiker's guide

Re:Lean 4.0.0, first official lean4 release by xigoi on Friday September 08, 2023 @03:40AM (#37430687)
I tried Lean twice and what caused me to stop both times was a severe lack of documentation. That's a shame, because it's an awesome language.
Re:Lean 4.0.0, first official lean4 release by bmitc on Friday September 08, 2023 @03:51AM (#37430770)
I also tried to get into it recently, and I feel theorem proving has been pretty substantially oversold. It seems that if you wanted to work through the proofs in even an advanced undergraduate or early graduate textbook, you would basically have publishable material at the end because of the lack of cohesive libraries. There is a lot that gets buried in and is still open to implementation details, and I don't see any clear way of simply proceeding. It started to feel like a major distraction from just doing the mathematics rather than an aid, like it's supposed to be. It feels a little like the Rust ecosystem, where there is a land grab rush to introduce various libraries.
Re:Lean 4.0.0, first official lean4 release by jhanschoo on Friday September 08, 2023 @04:09AM (#37430903)
I agree that there's generally too little results in mathlib and for that matter in any theorem prover, but I didn't think that work on formalizing such stuff (advanced undergrad results / early grad results) is publishable. Was I wrong in this?
Re:Lean 4.0.0, first official lean4 release by zozbot234 on Friday September 08, 2023 @06:00AM (#37431673)
There are plenty of published papers about newly formalized proofs, even in "undergrad" math. A formal proof development generally brings to light new information about the original proof, both by plugging all potential inaccuracies/missing steps and in being especially easy to refactor, abstracting out common patterns that might be reused elsewhere.
Re:Lean 4.0.0, first official lean4 release by 7373737373 on Friday September 08, 2023 @04:22AM (#37430983)
Same, I also found no good "for programmers" introduction.
Re:Lean 4.0.0, first official lean4 release by crvdgc on Friday September 08, 2023 @04:38AM (#37431106)
There is a short one[1] from Functional Programming in Lean, which is itself an introduction to Lean 4 from the programming's perspective. Highly recommended if you're interested in dependent types.

[1]: https://leanprover.github.io/functional_programming_in_lean/...

Re:Lean 4.0.0, first official lean4 release by uxp8u61q on Friday September 08, 2023 @09:07AM (#37432989)
Because the audience isn't "programmers".
Re:Lean 4.0.0, first official lean4 release by ykonstant on Friday September 08, 2023 @09:47AM (#37433436)
I think that is unnecessarily hostile; I believe Lean 4 can become a very capable programming language for mundane tasks!
Re:Lean 4.0.0, first official lean4 release by uxp8u61q on Friday September 08, 2023 @10:33AM (#37434006)
Hostile? I just stated that the audience isn't programmers.
Re:Lean 4.0.0, first official lean4 release by 7373737373 on Friday September 08, 2023 @11:50AM (#37435218)
The age of guilds has long passed

Are people like these not programmers? https://leandojo.org/

Re:Lean 4.0.0, first official lean4 release by siknad on Friday September 08, 2023 @12:12PM (#37435534)
How can the audience of a general-purpose programming language not be "programmers"?
Re:Lean 4.0.0, first official lean4 release by nequo on Friday September 08, 2023 @03:25PM (#37438221)
I don’t think that your post is hostile. But from what I’ve heard, it is untrue because Lean 4 is intended to be a general purpose programming language, not only a theorem prover. I can’t find a source that directly states this goal but at the least this paper by Leo de Moura and Sebastian Ullrich presents it as a programming language:

https://link.springer.com/chapter/10.1007/978-3-030-79876-5_...

Microsoft also sponsored David Thrane Christiansen’s book, Functional Programming in Lean[1] (which I’m sure you know about!). That is another indication that they intend to reach programmers.

[1] https://leanprover.github.io/functional_programming_in_lean/

Re:Lean 4.0.0, first official lean4 release by sixbrx on Saturday September 09, 2023 @01:24PM (#37447774)
It seems general programming is more in focus now, but for context, the "Programming in Lean" book was only completed recently as compared to the multiple theorem proving documents which have been around for a while. The Christiansen book looks worth waiting for though and I really hope Lean can gain popularity as a general purpose language.
Re:Lean 4.0.0, first official lean4 release by agentultra on Friday September 08, 2023 @09:28AM (#37433214)
Re:Lean 4.0.0, first official lean4 release by 7373737373 on Friday September 08, 2023 @11:55AM (#37435304)
I'm not looking to use it as a programming language, but I'd like to see an introduction to theorem proving using Lean that is more explicit in its explanation of semantics than the ones that assume an existing math background
Re:Lean 4.0.0, first official lean4 release by chabulhwi on Friday September 08, 2023 @07:32PM (#37440574)
Theorem Proving in Lean 4: https://leanprover.github.io/theorem_proving_in_lean4/

I only had a basic knowledge of first-order logic and set theory before reading TPiL4. It wasn't easy, but now I can prove theorems in Lean. By the way, I still can't write a program in any language.

Re:Lean 4.0.0, first official lean4 release by brohee on Friday September 08, 2023 @04:22AM (#37430988)
Kinda agree but Mathlib and its documentation makes for a big corpus to learn by example from. Not ideal but it helps.

https://github.com/leanprover-community/mathlib

Re:Lean 4.0.0, first official lean4 release by westurner on Friday September 08, 2023 @04:54AM (#37431206)
A https://learnxinyminutes.com/ for Lean and Lean Mathlib would be a helpful resource
Re:Lean 4.0.0, first official lean4 release by xigoi on Friday September 08, 2023 @05:04AM (#37431270)
On the contrary, I think the basics are covered pretty well by the official documentation, but it's lacking the more advanced stuff.
Re:Lean 4.0.0, first official lean4 release by ykonstant on Friday September 08, 2023 @07:41AM (#37432264)
I agree; for simple and "beginning intermediate" tasks, Functional Programming in Lean has it all; but the more advanced features are only documented in the source code and doc-strings. There is also a lack of general listings: for data structures, for file access API, for algorithms etc.
Re:Lean 4.0.0, first official lean4 release by westurner on Friday September 08, 2023 @11:03AM (#37434432)
Is there an eBNF+PEG or similar grammar for the language parser that a more complete language reference can be generated from?

Does Lean have docstrings with embedded markup like Python?

The Python Language Reference: https://docs.python.org/3/reference/

The Python Language Reference > 10. Full Grammar specification: https://docs.python.org/3/reference/grammar.html

LearnXinYminutes > Where X=Python: https://learnxinyminutes.com/docs/python/

In the language and then the docs, Python's collections.abc Abstract Base Classes did not initially exist. There's now a table of ABCs in the docs: https://docs.python.org/3/library/collections.abc.html#colle...

In Python, they're not interfaces, they're ABCs.

Re:Lean 4.0.0, first official lean4 release by hiker on Friday September 08, 2023 @06:45AM (#37431964)
Get on Zulip[1] and ask for help when stuck. The community is friendly and has gotten quite large although they are mostly mathematicians at the moment.

[1] https://leanprover.zulipchat.com/