TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Lean 4.0

130 点作者 quag超过 1 年前

13 条评论

Gys超过 1 年前
> Lean is a new open source theorem prover being developed at Microsoft Research. It is a research project that aims to bridge the gap between interactive and automated theorem proving. Lean can be also used as a programming language. Actually, some Lean features are implemented in Lean itself.
评论 #37432205 未加载
zone411超过 1 年前
LeanDojo shows promise in allowing interaction with the proof environment programmatically and through LLMs: <a href="https:&#x2F;&#x2F;leandojo.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;leandojo.org&#x2F;</a>.<p>This NY Times article is a nice overview of AI in math proofs: <a href="https:&#x2F;&#x2F;www.nytimes.com&#x2F;2023&#x2F;07&#x2F;02&#x2F;science&#x2F;ai-mathematics-machine-learning.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.nytimes.com&#x2F;2023&#x2F;07&#x2F;02&#x2F;science&#x2F;ai-mathematics-ma...</a> (<a href="https:&#x2F;&#x2F;archive.ph&#x2F;t0BhD" rel="nofollow noreferrer">https:&#x2F;&#x2F;archive.ph&#x2F;t0BhD</a>)<p>Here is a chart of Mathlib&#x27;s growth: <a href="https:&#x2F;&#x2F;leanprover-community.github.io&#x2F;mathlib_stats.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;leanprover-community.github.io&#x2F;mathlib_stats.html</a>
评论 #37436119 未加载
agentultra超过 1 年前
Exciting! I&#x27;ve been picking up some small side projects in Lean again to add more to <a href="https:&#x2F;&#x2F;agentultra.github.io&#x2F;lean-4-hackers&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;agentultra.github.io&#x2F;lean-4-hackers&#x2F;</a> -- a guide for programmers interested in using it as a programming language.<p>Congrats on the milestone!
评论 #37433729 未加载
koito17超过 1 年前
One of my major concerns with Lean 4 is when I asked about mathlib compatibility some 2-3 years ago and the only reply I got was from Kevin Buzzard, implying that the best we can do is essentially rewrite it all!<p>Correct me if I am wrong, but I think mathlib still uses a community-maintained fork of Lean 3. I love Lean and its relative ease-of-use compared to e.g. Coq, but man, having to rewrite all of mathlib is a real bummer if that is indeed what has to happen for Lean 4 compatibility.
评论 #37431279 未加载
ykonstant超过 1 年前
The Lean Zulip chat includes a &quot;Is there code for X&quot; section; you can go there and ask if a specific theorem or research problem has been formalized&#x2F;verified in Lean, and if not, whether someone is working or intends to work on it. This way you can form impromptu working groups if you find others interested in your problem.
garfieldnate超过 1 年前
I&#x27;m a programmer and I&#x27;m excited to learn Lean as a new tool for thought. I find that Haskell sells itself as a programming language but the reality is quite arcane, and its tools feel slow and bloated. Lean 4 is sort of the opposite, selling itself as a math toolkit but actually having very considerately (and practically) designed support tools (VSCode integration, build system) and core language features. I&#x27;m reading through Functional Programming in Lean now, supplementing with the Lean Manual and also Lean&#x27;s prelude file, which is well commented and pretty readable. I love that the output window&#x27;s contents are clickable (&quot;failed to synthesize type class X Y Z&quot; -&gt; click on X, Y or Z to go to the definitions). I&#x27;m excited to try out the widget interface, which lets you complete proofs through visuospatial reasoning (see the Rubix cube project). I&#x27;m really hoping that this serves as a new tool for programming-minded people to learn math and contribute easy-to-understand proofs in a way that was never possible before. Once I&#x27;ve gone through the beginner materials, I want to try the math problems at the beginning of <a href="https:&#x2F;&#x2F;brickisland.net&#x2F;DDGSpring2023&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;brickisland.net&#x2F;DDGSpring2023&#x2F;</a>, which has great tools for its programming projects but nothing for its proof assignments.<p>The documentation still has holes, but the Lean community is more helpful and welcoming than any other I&#x27;ve ever encountered, and I&#x27;m confident that I&#x27;ll get an answer for every question I have.<p>For the Lean folks: an entry on learnxinyminutes is an absolute must in my book. It would be a great place to demonstrate how familiar and practical Lean can be, with its for loops and arrays and hash maps and whatever else. Generally if a language is not there, I figure it must not be mature enough to try out (Lean has been an exception for me).
评论 #37498745 未加载
hackandthink超过 1 年前
There is no excuse anymore. I have to try it out.
评论 #37430365 未加载
评论 #37430687 未加载
kristopolous超过 1 年前
I really find how theoreticians approach things to be challenging. Given that I headed to rosetta code to find some examples. Here&#x27;s FizzBuzz in Lean 4:<p><a href="https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;FizzBuzz#Lean" rel="nofollow noreferrer">https:&#x2F;&#x2F;rosettacode.org&#x2F;wiki&#x2F;FizzBuzz#Lean</a><p><pre><code> def fizz : String := &quot;Fizz&quot; def buzz : String := &quot;Buzz&quot; def newLine : String := &quot;\n&quot; def isDivisibleBy (n : Nat) (m : Nat) : Bool := match m with | 0 =&gt; false | (k + 1) =&gt; (n % (k + 1)) = 0 def getTerm (n : Nat) : String := if (isDivisibleBy n 15) then (fizz ++ buzz) else if (isDivisibleBy n 3) then fizz else if (isDivisibleBy n 5) then buzz else toString (n) def range (a : Nat) (b : Nat) : List (Nat) := match b with | 0 =&gt; [] | m + 1 =&gt; a :: (range (a + 1) m) def getTerms (n : Nat) : List (String) := (range 1 n).map (getTerm) def addNewLine (accum : String) (elem : String) : String := accum ++ elem ++ newLine def fizzBuzz : String := (getTerms 100).foldl (addNewLine) (&quot;&quot;) def main : IO Unit := IO.println (fizzBuzz) #eval main </code></pre> Hopefully that&#x27;s helpful to others.
评论 #37431361 未加载
评论 #37432957 未加载
DataDaoDe超过 1 年前
I’ve been very excited by lean, but every time I try to set things up I get riddled with exceptions, errors, library incompatibilities, lean 3&#x2F;4 problems. Tuts or documentation that is outdated or just doesn’t work. It has made me wonder, is this just really really alpha software, are they working at a bleeding rate? Idk, but I’ve been enticed multiple times by the promise of lean, maybe I’m just missing some info or should stick it out or just wait until it gets more stable. Anyone have any insight here?
评论 #37433318 未加载
评论 #37434269 未加载
2pEXgD0fZ5cF超过 1 年前
Does Lean have something similar to Haskell&#x27;s List comprehension [1] or some kind of set builder notation for functional programming purposes?<p>[1]: Example: `[x*2 | x &lt;- [1..10]]`
评论 #37432606 未加载
评论 #37432181 未加载
评论 #37431997 未加载
hackandthink超过 1 年前
Is Lean a Category?<p>(like much debated: is Hask(ell) a Category)<p>&quot;In this section we set up the theory so that Lean&#x27;s types and functions between them can be viewed as a `LargeCategory` in our framework.&quot;<p>So it seems to be proven that there is a Category Lean!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;leanprover-community&#x2F;mathlib4&#x2F;blob&#x2F;master&#x2F;Mathlib&#x2F;CategoryTheory&#x2F;Types.lean">https:&#x2F;&#x2F;github.com&#x2F;leanprover-community&#x2F;mathlib4&#x2F;blob&#x2F;master...</a>
评论 #37431894 未加载
评论 #37431747 未加载
harel超过 1 年前
It took me about a minute and more than one click to reach a page which told me what lean IS. Hint: In the Readme, it&#x27;s the Home Page link, then About.
评论 #37432179 未加载
taliesinb超过 1 年前
Does anyone know if Lean 4 has encoded much category theory?
评论 #37431396 未加载