30 comments

  • kccqzy21 hours ago
    For the HN crowd who are generally programmers but not necessarily mathematicians, it’s more relevant to consider the programming side of things. There is a very good book (one I haven’t finished unfortunately) that covers Lean from a functional programming perspective rather than proving mathematics perspective: <a href="https:&#x2F;&#x2F;leanprover.github.io&#x2F;functional_programming_in_lean&#x2F;" rel="nofollow">https:&#x2F;&#x2F;leanprover.github.io&#x2F;functional_programming_in_lean&#x2F;</a><p>I am learning Lean myself so forgive me as I have an overly rosy picture of it as a beginner. My current goal is to write and prove the kind of code normal programmers would write, such as real-world compression&#x2F;decompression algorithms as in the recent lean-zip example: <a href="https:&#x2F;&#x2F;github.com&#x2F;kiranandcode&#x2F;lean-zip&#x2F;blob&#x2F;master&#x2F;Zip&#x2F;Native&#x2F;Deflate.lean" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kiranandcode&#x2F;lean-zip&#x2F;blob&#x2F;master&#x2F;Zip&#x2F;Nat...</a>
    • dharmatech19 hours ago
      While reading though this book, I messed around with a basic computer algebra simplifier in Lean:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dharmatech&#x2F;symbolism.lean" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dharmatech&#x2F;symbolism.lean</a><p>It&#x27;s a port of code from C#.<p>Lean is astonishingly expressive.
    • grogers15 hours ago
      Have you tried dafny, which seems roughly comparable for your purposes? I heard some buzz about it a little while ago but I haven&#x27;t been following this space closely.
      • nextos13 hours ago
        Dafny and F*, which competes directly with Lean but is more guided towards SWE, are definitely worthy of consideration.
        • v9v5 hours ago
          Ada&#x2F;SPARK may also be worth a look.
    • readthenotes121 hours ago
      I recall an experiment in proving software correct from the 1990s that found more errors in the final proof annotations than in the software it had proved correct.<p>Then, I foresee 2 other obstacles, 1 of which may disappear:<p>1. Actually knowing what the software is supposed to do is hard. Understanding what the users actually want to do and what the customers are paying to do --which aren&#x27;t necessarily the same thing--is complex<p>2. The quality of the work of many software developers is abysmal and I don&#x27;t know why they would be better at a truth language than they are at Java or some other language.<p>Objection 2 may disappear to be replaced with AI systems with the attention to do what needs to be done. So perhaps things will change in that to make it worthwhile...
      • Groxx19 hours ago
        I think the hope for 2 is that those programmers would be forced into inaction by the language safety, rather than being allowed to cause problems.<p>I don&#x27;t really think that works either, because there&#x27;s endless ways to add complication even if you can&#x27;t worsen behavior (assuming that&#x27;s even possible). At best they might be caught eventually... but anyone who has worked in a large tech company knows at least a few people who are somehow still employed years later, despite constant ineptitude. Play The Game well enough and it&#x27;s probably always possible.
        • teiferer15 hours ago
          It&#x27;s even conceivable that 2 gets worse with AI: The AI does the proof for them, very convolutedly so, and as long as the proof checker eats it, it goes through. Comes the day when the complexity goes beyond what the AI assistant can handle and it gives up. At that point, the proof codes complexity will for a long time have passed the threshold of being comprehensible for any human and there is no progress possible. Hard stop.
          • codebje15 hours ago
            Using a proof language with an SMT solver is basically that: an inexplicable tick that it’s fine, until a small change is needed, the tick is gone, and nothing can say why.
            • zozbot23415 hours ago
              That&#x27;s basically what sledgehammer (mentioned in the article) boils down to. The Lean folks use some safeguards to avoid issues with that, such as only using their &quot;grind&quot; at the end of a proof, where all the &quot;building blocks&quot; have been added to context.
      • jsmorph21 hours ago
        Re 1: Discussing and guiding the desirable theorems for general-purpose programs has been a major challenge for us. Proofs for their own sake (bad?) vs glorious general results (good but hard?). Actual human guidance there can be critical there at least for now.
      • cayley_graph21 hours ago
        Mind linking the experiment? Sounds interesting.
      • deterministic8 hours ago
        Check out SeL4 (a proven correct micro kernel used by billions of devices worldwide) and CompCert (a proven correct C compiler used by Airbus).
    • NooneAtAll318 hours ago
      what about non-functional programming?<p>FP is just as irrelevant for most programmers as the math you already shoved aside
      • DauntingPear718 hours ago
        Hmm like the “new” JS Fetch api with `then` chaining? What about map, filter, reduce? Anonymous functions? List comprehensions? FP is everywhere. Pure FP code isn’t seen very often, as side effects are necessary for most classes of programs, but neither is pure OOP code, as not everything is dynamically dispatched, nor imperative code, as Objects or functions may more cleanly describe&#x2F;convey something in code.
      • kccqzy17 hours ago
        I shoved math aside because I think for most of the HN crowd it wouldn’t be a good use of their time to do what mainstream mathematics is about, like the “things such as Grothendieck schemes and perfectoid spaces” the article also references. FP is much more relevant because for any program for which a proof of correctness is worthwhile, you can always extract a functional core of that program (functional core, imperative shell). And that functional core will be easier to prove than if it were written in an imperative style.
      • icosahedron15 hours ago
        You might like looking at Dafny. It is more imperative focus, but has many of the same software proving functionality that Lean has.<p>It is different in that it uses SMT instead of dependent types and tactics to prove the software, but I found it more approachable.<p>Also, it compiles to several target languages, whereas Lean 4 only compiles to C and therefore only supports the C ABI.
      • threethirtytwo18 hours ago
        FP and math are the same concept.<p>The semantics of math are equation based.<p>Everything in the math universal language is defined as an expression or formula.<p>All proofs are based on this concept.<p>To translate this into programming think about what programming is? Programming rather being a single line formula is a series of procedures.<p><pre><code> 1. add 1 2. add 3 3. repeat. </code></pre> in functional programming you get rid of that and you think from the perspective of how much of a program can you fit into a single one liner? An expression? Think map, reduce, list comprehensions, etc.<p>That is essentially what functional programming is. Fitting your entire program onto one line OR fitting it into a math expression.<p>The reason why you see multiple lines in FP languages is because of aliasing.<p><pre><code> m = b + c y = x + m </code></pre> is really:<p><pre><code> y = x + (b + c) </code></pre> This is also isomorphic to the concept of immutability. By making things immutable your just aliasing part of the one liner...<p>So functional programming, one line programs, formulas and equations in math, and immutability are essentially ALL the same concept.<p>That is why lean is functional. Because it&#x27;s math.
  • nrds19 hours ago
    The author appears to have a serious misconception about Lean, which is surprising since he seems to be quite knowledgeable in the area.<p>Specifically, the author seems to be under the impression that Lean retains proof objects and the final proof to be checked is one massive proof object, with all definitions unfolded: &quot;these massive terms are unnecessary, but are kept anyway&quot; (TFA). This couldn&#x27;t be further from the truth. Lean implements exactly the same optimization as the author cherishes in LCF; metaphorically, that &quot;The steps of a proof would be performed but not recorded, like a mathematics lecturer using a small blackboard who rubs out earlier parts of proofs to make space for later ones&quot; (quoted by blog post linked from TFA). Once a `theorem` (as opposed to a `def`) is written in Lean4, then the proof object is no longer used. This is not merely an optimization but a critical part of the language: theorems are opaque. If the proof term is not discarded (and I&#x27;m not sure it isn&#x27;t), then this is only for the sake of user observability in the interactive mode; the kernel does not and cannot care what the proof object was.
    • auggierose2 hours ago
      It is more a conceptual thing. In LCF, proofs and terms are different things, and that is how it should be in my opinion. This Curry-Howard confusion is unnecessary, but many people don&#x27;t realise that, they think it is the only way to do math on a computer. You can still store proofs in LCF if you want, and use them; just as in Lean, you might be able to optimise them away.
    • vilhelm_s15 hours ago
      Yeah. I guess the abstract type approach saves <i>some</i> memory, but it&#x27;s a constant factor thing, not an asymptotic improvement. The comment that Lean wastes &quot;tens of megabytes&quot; seems telling: it seems like something that would be a critical advantage in the 1980s and 1990s, when Paulson first fought these battles, but maybe less important today...
      • nrds15 hours ago
        To be fair, lean wastes and leaks memory like a sieve, but this is almost all in the frontend. It has nothing to do with the kernel or the theorem proving approach chosen.
    • burakemir19 hours ago
      A proof object in dependent type theory is just the term that inhabits a type. So are you saying the Lean implementation can construct proofs without constructing such a term?
      • nrds18 hours ago
        No, I&#x27;m saying it is checked and then discarded. (Or at least, discarded by the kernel. Presumably it ends up somewhere in the frontend&#x27;s tactic cache.) That matches perfectly the metaphor, &quot;rubs out earlier parts of proofs to make space for later ones&quot;.<p>The shared misconception seems to be in believing that because _conceptually_ the theory implemented by Lean builds up a massive proof term, that _operationally_ the Lean kernel must also be doing that. This does not follow. (Even the concept is not quite right since Lean4 is not perfectly referentially transparent in the presence of quotients.)
  • danilafe18 hours ago
    People tell me Lean is really good for functional programming. However, coming from Agda, it feels like a pretty clunky downgrade. They also tell me it&#x27;s good for tactics, but I&#x27;ve found Coq&#x27;s tactics more powerful and ergonomic. Maybe these are all baby-duck perceptions. So far, it feels like Lean&#x27;s main strength isn&#x27;t being the best at anything, but being decent at everything and having a huge community. I see the point and appeal, but it&#x27;s saddens me that a bit of the beauty and power are lost in exchange.
    • btilly17 hours ago
      In other words, it is a network effect.<p>My perspective is that network effects are far less long-lasting than they feel in the moment. For example if being decent at everything and having a huge community was the only thing that mattered, Perl would still be a big deal. Many similar examples exist.<p>In the case of Lean, being the first with a huge library really makes a difference. Just as Perl got a big boost from having CPAN. (Which was an imitation of CTAN, except for a programming language instead of TeX.)<p>But, based on scaling laws, we should expect the value of a large library for most users to grow around the log of the size of the library. (See <a href="https:&#x2F;&#x2F;pdodds.w3.uvm.edu&#x2F;teaching&#x2F;courses&#x2F;2009-08UVM-300&#x2F;docs&#x2F;others&#x2F;2005&#x2F;odlyzko2005a.pdf" rel="nofollow">https:&#x2F;&#x2F;pdodds.w3.uvm.edu&#x2F;teaching&#x2F;courses&#x2F;2009-08UVM-300&#x2F;do...</a> for the relevant scaling laws.)<p>When your library is small, this looks like an insurmountable barrier. But you don&#x27;t have to match the scale for factors of usability to become more important. And porting mathematical libraries is a good target for LLMs. The source is verified, the target is verifiable, and the reasoning path generally ports.<p>The flip side of this is that, thanks to LLMs, working on a minority platform isn&#x27;t the barrier that you might expect. Because if their library can be ported to your platform, then your proof can probably be ported to their platform as well!
      • danilafe16 hours ago
        &gt; The flip side of this is that, thanks to LLMs, working on a minority platform isn&#x27;t the barrier that you might expect<p>This is a nice thought, but with Agda in particular it&#x27;s just not true. It&#x27;s one of the few languages I&#x27;ve seen that&#x27;s sufficiently unrepresented in training data. Frontier LLMs (Codex, Claude Code) reliably say &quot;I realized I can&#x27;t do this.&quot; after wasting lots of tokens going back and forth.<p>In fact, I think this positions Agda uniquely poorly.
        • krupan16 hours ago
          This. LLMs are no good at stuff they haven&#x27;t seen a lot of training data for (saying this as a SystemVerilog programmer who also does some C-coding for interfacing with SystemVerilog, neither of which has a lot of open source code to show LLMs)
        • btilly12 hours ago
          Huh.<p>I wonder how compiler technology would do. Possibly as a component of an attempted solution.
      • gucci-on-fleek6 hours ago
        &gt; except for a programming language instead of TeX<p>TeX <i>is</i> a programming language. It&#x27;s not a very good programming language, but people have implemented floating-point math [0], regular expressions [1], an Arduino emulator [2], and terminal input&#x2F;output [3] in pure TeX. The last two examples are obscure, but the first two examples are used (internally) by the vast majority of modern LaTeX documents.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;latex3&#x2F;latex3&#x2F;blob&#x2F;develop&#x2F;l3kernel&#x2F;l3fp.dtx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;latex3&#x2F;latex3&#x2F;blob&#x2F;develop&#x2F;l3kernel&#x2F;l3fp....</a><p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;latex3&#x2F;latex3&#x2F;blob&#x2F;develop&#x2F;l3kernel&#x2F;l3regex.dtx" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;latex3&#x2F;latex3&#x2F;blob&#x2F;develop&#x2F;l3kernel&#x2F;l3reg...</a><p>[2]: <a href="https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;avremu" rel="nofollow">https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;avremu</a><p>[3]: <a href="https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;reverxii" rel="nofollow">https:&#x2F;&#x2F;www.ctan.org&#x2F;pkg&#x2F;reverxii</a>
    • lmm12 hours ago
      &gt; So far, it feels like Lean&#x27;s main strength isn&#x27;t being the best at anything, but being decent at everything and having a huge community. I see the point and appeal, but it&#x27;s saddens me that a bit of the beauty and power are lost in exchange.<p>To me that feels like a community that&#x27;s finally matured enough to start getting on with things. Perfect tools aren&#x27;t the point; get tools that are good enough and do actual work with them.
      • antonvs8 hours ago
        Sounds like an excuse for mediocrity.<p>You can apply that same argument for the of Python in the ML world. It results in all sorts of pain points that everyone has to deal with all the time.
        • lmm5 hours ago
          All large-scale projects are made of mediocre parts. At some point you run out of brilliance and have to structure it so that mediocre can still be a positive contribution.
    • solomonb15 hours ago
      I prefer agda as proof checker but its not a practical choice for building software. Lean feels like it could legitimately become a successor to Haskell as the go to functional programming language for software development.
      • danilafe14 hours ago
        I think what holds Agda back from being &quot;practical&quot; is that it just doesn&#x27;t have good tactics. You can&#x27;t easily automate proofs and even simplification techniques require some language-level tricks[1]. There&#x27;s technically support for elaborator reflection (as in Idris) but it&#x27;s painful and impossible to debug. Certainly nowhere near where Coq and Lean are.<p>[1]: like this one I&#x27;ve used for several proofs so far: <a href="https:&#x2F;&#x2F;danilafe.com&#x2F;blog&#x2F;agda_expr_pattern&#x2F;" rel="nofollow">https:&#x2F;&#x2F;danilafe.com&#x2F;blog&#x2F;agda_expr_pattern&#x2F;</a>
        • solomonb14 hours ago
          Its also really slow and doesn&#x27;t have a huge library ecosystem. The latter is fixable but not so much for the former.
          • danilafe13 hours ago
            Also true. The slowness is relatively unpredictable, too: sometimes changing a &#x27;rewrite&#x27; to a &#x27;with&#x27; can increase memory usage tenfold.<p>While we&#x27;re at it, another major concern for me is the inscrutability of Agda&#x27;s error messages. I&#x27;ve had one error message single-handedly overflow my tmux scrollback buffer. There&#x27;s no way I&#x27;m going to be able to interpret that.
            • solomonb12 hours ago
              &gt; While we&#x27;re at it, another major concern for me is the inscrutability of Agda&#x27;s error messages. I&#x27;ve had one error message single-handedly overflow my tmux scrollback buffer. There&#x27;s no way I&#x27;m going to be able to interpret that.<p>lmao i&#x27;ve been there. Agda is my first choice for proof checker and for math-y explorations but its not gonna be a replacement for Haskell as a production programming language.
    • JuniperMesos16 hours ago
      I&#x27;ve used agda a tiny bit and Lean somewhat more, and I definitely found it much easier to write functional programs not focused on mathematical proofs in Lean than Agda. IIRC the difference was mostly tooling - Agda&#x27;s documentation is kind of bad and it&#x27;s a pain to get it working on your system (and it really wants you to be using Emacs specifically). Whereas Lean documents how to write the cat utility in its own docs and generally has a much better, more modern tooling experience.
      • danilafe16 hours ago
        I believe you, but this hasn&#x27;t been my experience. It took me hours to get Lean to work (something odd was happening with the package manager + version + tooling combination). Agda worked out of the box with macOS homebrew. Agda&#x27;s docs are petty bad, but I&#x27;ve found its cross-linked module documentation incredibly useful. The main issue is knowing something exists.
        • fooker15 hours ago
          This has also been my experience with lean4.<p>I don&#x27;t understand the forced vscode path, just let me get it as normal software in a convenient way and run it as a tool
          • danilafe14 hours ago
            To be fair, Coq has ProofGeneral and Agda has its emacs mode. Once you go outside these established channels, oftentimes using the tool becomes incredibly difficult. I guess for interactive theorem proving in general you may need some sort of editor at some point.
          • JuniperMesos12 hours ago
            Yeah, I&#x27;m not a fan of the encouragement to use vscode; that said it was pretty easy for me to get neovim set up with Lean tooling, and that&#x27;s what I use generally.
    • markusde17 hours ago
      I&#x27;m curious what you like about Agda functional programming? Many of the praises I hear about it have to do with it&#x27;s dependent pattern matching, and I think Lean suffers a lot more in that regard. I&#x27;m curious though if you still find Agda friendlier for &quot;normal&quot; fp (and if so, how?)
      • danilafe16 hours ago
        Its parameterized modules, extremely elegant yet flexible mixfix notation mechanism, the various niceties around pattern matching (though this one might be a bit of Stockholm syndrome; Agda doesn&#x27;t nicely allow pattern matching anywhere except at function clauses), the fact that records, GADTS, and modules all feel like aspects of the same thing, and the fact that typeclasses are &#x27;just&#x27; records that are automatically filled in. The typeclass and module features IMO already give it some edge over Haskell. I don&#x27;t know if it&#x27;s friendlier, but it is more ergonomic.
        • markusde15 hours ago
          Thanks! Typeclasses are also something I really like about Lean.
    • moomin18 hours ago
      Thing is, it comes after both. Maybe it is just being a jack of all trades, but something made it success when the others remain fairly niche.
      • capitalhilbilly17 hours ago
        I think its pretty clear that being too early has been as bad as being too late for most technologies. There are a few that have gradually gained community after decades but it is easier to make a poor copy of one of them and have better momentum and less skepticism.
      • portly17 hours ago
        When I woke up this morning I could not have predicted someone calling a proof assistant a &quot;Jack of all trades&quot;
    • ModernMech17 hours ago
      fyi it&#x27;s Rocq now: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rocq" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rocq</a>
    • floxy16 hours ago
      Thoughts on Idris?
      • wk_end15 hours ago
        Idris feels mostly dead to me at this point. Which breaks my heart, because for a split second it had real momentum around it.<p>Not OP, but as Haskell-derived dependently-typed languages Idris and Agda are quite similar, so I suspect if they like one they’d like the other.
  • c0balt20 hours ago
    Isabelle&#x2F;HOL as a language is nice, but the tooling has deep flaws even outside the pure desktop-first app approach.<p>The language is different (not necessarily better) in comparison to Lean, but I do agree with some of the points on dependent types. It seems both languages mostly just made different tradeoffs, which imo, were fair and have shaped them into quite efficient tools for their domains. The domain of &quot;proofs&quot; is large and different paradigms just have different strengths&#x2F;weaknesses, Lean just specialized for a different part of this space.<p>Sledgehammer is nice but probably just a question of time until an equivalent can be ported&#x2F;created for Lean. It might also be nice to use for explorative phases but is a resource hog, it also makes proofs concise but I would usually rather see the full chain of steps directly for a proof in the published code instead of a semi-magic &quot;by sledgehammer&quot;.<p>Working on Isabelle itself however is painful (especially communicating with developers) in comparison to Lean. Things like &quot;we don&#x27;t have bugs just unexpected behaviour&quot; on the mailing list just seems childish&#x2F;unprofessional. The callout to RAM consumption of Lean and related systems is also a bit of joke when looking at Isabelle&#x27;s gluttony for RAM.
    • zozbot23420 hours ago
      &gt; but I would usually rather see the full chain of steps directly for a proof in the published code instead of a semi-magic &quot;by sledgehammer&quot;.<p>One issue with this is that coming up with a quickly-checkable certificate for UNSAT is not exactly a trivial problem. It&#x27;s effectively the same as writing a formal proof.
    • vintermann20 hours ago
      Last I checked, Isabelle&#x2F;HOL used a custom Emacs mode as their interface. (I could be mixing it up with one of the other HOLs).
      • c0balt16 hours ago
        The current GUI interface is Isabelle&#x2F;jedit. Afaik, no Emacs interface is officially provided atm.
    • thaumasiotes19 hours ago
      &gt; Sledgehammer is nice but probably just a question of time until an equivalent can be ported&#x2F;created for Lean.<p>I have no knowledge of what sledgehammer is. However...<p>&gt; it also makes proofs concise but I would usually rather see the full chain of steps directly for a proof in the published code instead of a semi-magic &quot;by sledgehammer&quot;<p>This description makes sledgehammer sound identical to Mathlib&#x27;s `grind`. <a href="https:&#x2F;&#x2F;leanprover-community.github.io&#x2F;mathlib4_docs&#x2F;Init&#x2F;Grind&#x2F;Tactics.html" rel="nofollow">https:&#x2F;&#x2F;leanprover-community.github.io&#x2F;mathlib4_docs&#x2F;Init&#x2F;Gr...</a>
      • c0balt16 hours ago
        The goal (ATP) is similar but the idea is a bit different, sledgehammer is not directly learning&#x2F;applying rules but instead effectively a driver for invoking a bunch of ATPs + SMT solvers at once on a goal in Isabelle&#x2F;HOL.<p>You can read more about it here: <a href="https:&#x2F;&#x2F;isabelle.in.tum.de&#x2F;dist&#x2F;doc&#x2F;sledgehammer.pdf" rel="nofollow">https:&#x2F;&#x2F;isabelle.in.tum.de&#x2F;dist&#x2F;doc&#x2F;sledgehammer.pdf</a>
        • nextaccountic13 minutes ago
          The authors of Lean also wrote a smt solver (Z3). Other proof languages like F* use Z3 to prove its things<p>Why isn&#x27;t there a tactic in Lean to prove things by SMT using Z3? This could be integrated to grind
  • smj-edison21 hours ago
    I think what&#x27;s interesting about Lean is that Lean is a language, and what most people are talking about is a library called Mathlib. From what I&#x27;ve read about Mathlib, the creators are very pragmatic, which is why they encode classical logic in Lean types, with only a bit of intuitionistic logic[1].<p>[1] for those unfamiliar with math lingo, classical logic has a lot of powerful features. One of those is the law of the excluded middle, which says something can&#x27;t be true and false at the same time. That means not not true is true, which you can&#x27;t say in intuitionistic logic. Another feature is proof by contradiction, where you can prove something by showing that the alternative is unsound. There&#x27;s quite a few results that depend on these techniques, so trying to do everything in intuitionistic logic has run into a lot of roadblocks.
    • hackandthink19 hours ago
      &gt;the law of the excluded middle, which says something can&#x27;t be true and false at the same time<p>This is the not excluded middle, it is the &quot;Law of noncontradiction&quot;<p>Excluded middle means: either p is true or the negation of p is true<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Law_of_noncontradiction" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Law_of_noncontradiction</a>
    • zozbot23420 hours ago
      &gt; I think what&#x27;s interesting about Lean is that Lean is a language, and what most people are talking about is a library called Mathlib. From what I&#x27;ve read about Mathlib, the creators are very pragmatic, which is why they encode classical logic in Lean types, with only a bit of intuitionistic logic<p>The computer science folks are now working on their own CSLib. <a href="https:&#x2F;&#x2F;www.cslib.io" rel="nofollow">https:&#x2F;&#x2F;www.cslib.io</a> <a href="https:&#x2F;&#x2F;www.github.com&#x2F;leanprover&#x2F;cslib" rel="nofollow">https:&#x2F;&#x2F;www.github.com&#x2F;leanprover&#x2F;cslib</a> Given that intuitionistic logic is really only relevant to computational content (the whole point of it is to be able to turn a mathematical argument into a construction that could in some sense be computed with), it will be interesting to see how they deal with the issue. Note that if you write algorithms in Lean, you are already limited to some kind of construction, and perhaps that&#x27;s all the logic you need for that purpose.
    • leonidasrup18 hours ago
      Five stages of accepting constructive mathematics:<p>Denial<p>Anger<p>Bargaining<p>Depression<p>Acceptance<p>A talk about constructive mathematics by Andrej Bauer at the Institute for Advanced Study.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=21qPOReu4FI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=21qPOReu4FI</a><p><a href="http:&#x2F;&#x2F;dx.doi.org&#x2F;10.1090&#x2F;bull&#x2F;1556" rel="nofollow">http:&#x2F;&#x2F;dx.doi.org&#x2F;10.1090&#x2F;bull&#x2F;1556</a>
    • Chinjut21 hours ago
      You mean intuitionistic logic, not &quot;intuitive logic&quot;.
      • smj-edison21 hours ago
        Oops, just edited. I&#x27;m still fairly new to this area, so I keep mixing up my terms :)
    • vscode-rest21 hours ago
      When&#x2F;why would one prefer to use intuitive logic, given the limitations&#x2F;roadblocks?
      • ux26647821 hours ago
        Classical logic has plenty of limitations&#x2F;roadblocks, all logics do. Logic isn&#x27;t a unified domain, but an infinite beach of structural shards, each providing a unique lens of study.<p>Classical logic was rejected in computer science because the non-constructive nature made it inappropriate for an ostensibly constructive domain. Theoretical mathematics has plenty of uses to prove existences and then do nothing with the relevant object. A computer, generally, is more interested in performing operations over objects, which requires more than proving the object exists. Additionally, while you can implement evaluation of classical logic with a machine, it&#x27;s extremely unwieldy and inefficient, and allows for a level of non-rigor that proves to be a massive footgun.
        • layer820 hours ago
          Classical logic isn’t rejected in computer science. Computer science papers don’t generally care if their proofs are non-constructive, just like in mathematics.
          • Revanche136719 hours ago
            This entire thread is making clear that constructivists want to speak on behalf of everyone while in the real word the vast majority of mathematicians or logicians don’t belong to their niche school of mathematics&#x2F;philosophy.
            • ux26647818 hours ago
              Do you understand the irony in posting this on a comment chain ostensibly rejecting foundational objectivism?
          • zozbot23420 hours ago
            They care quite a bit actually, they just call their constructive proofs &quot;algorithms&quot; or &quot;decision procedures&quot;.
          • seanhunter19 hours ago
            Intuitionism is just disallowing the law of the excluded middle (that propositions are either true or they are not true). Disallowing non-constructive proofs is a related system to intuitionism called “constructivism”. There are rigorous formulations of mathematics that are constructive, intuitionist or even strict finitist.
            • groundzeros201518 hours ago
              What point are you responding to?
              • seanhunter17 hours ago
                THe parent of my post referred to disallowing non-constructive proofs, which is not a feature of intuitionist logic but of constructivism.
        • zozbot23420 hours ago
          But proving the object exists is still useful, of course: it effectively means you can assume an oracle that constructs this object without hitting any contradiction. Talking about oracles is useful in turn since it&#x27;s a very general way of talking about side-conditions that might make something easier to construct.
          • ux26647820 hours ago
            Of course. Though it&#x27;s also important to note: whether or not an object exists is dependent on the logic being utilized itself, which is to say nothing of how even if the object holds some structural equivalent in the given logic of attention, it might not have all provable structure shared between the two, and that&#x27;s before we get into how the chosen axioms on top of the logical system also mutate all of this.<p>It&#x27;s not that classical logic is useless, it&#x27;s just that it&#x27;s not particularly appropriate to choose as the basis for a system built on algorithms. This goes both ways. Set theory was taken as the foundation of arithmetic, et al. because type theory was simply too unwieldy for human beings scrawling algebras on blackboards.
            • gf00017 hours ago
              I am absolutely not even close to being an expert on the topic, but type theory wasn&#x27;t all that well understood even relatively recently - Voevodsky coined the Univalence axiom in 2009 or so, while sets have been used for centuries.<p>So not sure it would be &quot;unwieldy&quot;, it&#x27;s a remarkably simple addition and it may avoid some of the pain points with sets? But again, not even a mathematician.
            • zozbot23419 hours ago
              Set theory was chosen because it was a compatively simple proof of concept. You don&#x27;t really refer to the foundation when scrawling algebra on a blackboard the way you would with a proof assistant, and this actually causes all sorts of issues down the line (it&#x27;s a key motivation for things like HoTT).
          • Someone16 hours ago
            &gt; But proving the object exists is still useful, of course: it effectively means you can assume an oracle that constructs this object without hitting any contradiction.<p>I don’t think that logic holds in mainstream mathematics (it will hold in constructive mathematics by definition, and may hold in slightly more powerful philosophies op mathematics) because there, we can prove the existence of many functions and numbers that aren’t computable.
            • zozbot23416 hours ago
              The whole point of oracles is to posit the ability to compute things that aren&#x27;t (in the general case) computable.
      • Twey17 hours ago
        Intuitionistic logic is a refinement of classical logic, not a limitation: for every proposition you can prove in classical logic there is at least one equivalent proposition in intuitionistic logic. But when your use of LEM is tracked by the logic (in intuitionistic logic a proof by LEM can only prove ¬¬A, not A, which are not equivalent) it&#x27;s a constant temptation to try to produce a constructive proof that lets you erase the sin marker.<p>In compsci that&#x27;s actually sometimes relevant, because the programs you can extract from a ¬¬A are not the same programs you can extract from an A.
      • ngruhn18 hours ago
        You&#x27;re walking down a corridor. After hours and hours you ask &quot;is it possible to figure how far it is to the nearest exit?&quot;. Your classical logic friend answers: &quot;Yes, either there is no exit then the answer is infinity. Or there is an exit then we just have to keep walking until we find it. QED&quot;<p>This kind of wElL AcTUaLly argument is not allowed in constructive logic.
      • smj-edison21 hours ago
        As far as I understand it, classical mathematics is non-constructive. This means there are quite a few proofs that show that some value exists, but not what that value is. And in mathematics, a proof often depends on the existence of some value (you can&#x27;t do an operation on nothing).<p>The thing is it can be quite useful to always know what a value is, and there&#x27;s some cool things you can do when you know how to get a value (such as create an algorithm to get said value). I&#x27;m still learning this stuff myself, but inuitionistic logic gets you a lot of interesting properties.
        • zozbot23420 hours ago
          &gt; As far as I understand it, classical mathematics is non-constructive.<p>It&#x27;s not as simple as that. Classical mathematics can talk about whether some property is computationally decidable (possibly with further tweaks, e.g. modulo some oracle, or with complexity constraints) or whether some object is computable (see above), express decision&#x2F;construction procedures etc.; it&#x27;s just incredibly clunky to do so, and it may be worthwhile to introduce foundations that make it natural to talk about these things.
          • smj-edison20 hours ago
            Would it be fair to say then that classical mathematics does not require computability, so it requires a lot more bookkeeping, while intuitionistic logic requires constructivism, so it&#x27;s the air you live and breathe in, which is much more natural?
            • zozbot23420 hours ago
              Intuitionistic logic is not really constrained to talking about constructive things: you just stuff everything else in the negative fragment. Does that ultimately make sense? Maybe, maybe not. Perhaps that goes too far in obscuring the inherent duality of classical logic, which is still very useful.
      • zodiac14 hours ago
        We still care about computation and algorithms even when proving theorems in a classical setting!<p>For e.g., imagine I&#x27;m trying to prove the theorem &quot;x divides 6 =&gt; x != 5&quot;. Of course, one way would be to develop some general lemma about non-divisibility, but a different hacky way might be to say &quot;if x divides 6 then x ∈ {1, 2, 3, 6}, split into 4 cases, check that x != 5 holds in all cases&quot;. That first step requires an algorithm to go from a given number to its list of divisors, not just an existence proof that such a finite list exists.
      • seanhunter19 hours ago
        It’s not intuitive, it’s intuitionist. I’m not saying that to nitpick it’s just important to make the distinction in this case because it really isn’t intuitive at all in the usual sense.<p>Why you would use it is it’s an alternative axiomatic framework so you get different results. The analogy is in geometry if you exclude the parallel postulate but use all of the other axioms from Euclid you get hyperbolic geometry. It’s a different geometry and is a worthy subject of study. One isn’t right and the other wrong, although people get very het up about intuitionism and other alternative axiomatic frameworks in mathematics like constructivism and finitism.
        • BigTTYGothGF18 hours ago
          &gt; if you exclude the parallel postulate but use all of the other axioms from Euclid you get hyperbolic geometry<p>No, you don&#x27;t.<p>(You need to replace the parallel postulate with a different one)
          • seanhunter17 hours ago
            Thank you for the correction I actually didn&#x27;t realise that so have learned something.<p>Specifically for people who are interested it seems you have to replace the parallel postulate with a postulate that says every point is a saddle point (which is like the centre point of a pringle if you know what that looks like).<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Pringles" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Pringles</a>
            • lmm11 hours ago
              You can also replace it with a different postulate and get projective geometry, IIRC.
        • seanhunter6 hours ago
          I thought of a concrete example of why you might use intuitionist logic. Take for example the “Liar’s paradox”, which centres around a proposition such as<p>A: this statement (A) is false<p>In classical logic, statements are either true or false. So suppose A is true. If A is true, then it therefore must be false. But suppose A is false. Well if it is false then when it says it is false it is correct and therefore must be true.<p>Now there are various ways in classical logic [1] to resolve this paradox but in general there is a category of things for which the law of the excluded middle seems unsatisfactory. So intuitionist logic would allow you to say that A is neither true nor false, and working in that framework would allow you to derive different results from what you would get in classical logic.<p>It’s important to realise that when you use a different axiomatic framework the results you derive may only be valid in the alternative axiomatic system though, and not in general. Lean (to bring this back to the topic of TFA) allows you to check what axioms you are using for a given proof by doing `#print axioms`. <a href="https:&#x2F;&#x2F;lean-lang.org&#x2F;doc&#x2F;reference&#x2F;latest&#x2F;ValidatingProofs&#x2F;#validating-printing-axioms" rel="nofollow">https:&#x2F;&#x2F;lean-lang.org&#x2F;doc&#x2F;reference&#x2F;latest&#x2F;ValidatingProofs&#x2F;...</a><p>[1] eg you can say that all statements include an implicit assertion of their own truth. So if I say “2 + 2 = 4” I am really saying “it is true that 2+2=4”. So the statement A resolves to “This statement is true and this statement is false”, which is therefore just false in classical logic and not any kind of paradox.
        • smj-edison19 hours ago
          I think they called it intuitive, because I called it intuitive in my original post, so that&#x27;s on me :)
      • amavect20 hours ago
        In constructive logic, a proof of &quot;A or B&quot; consists of a pair (T,P). If T equals 0, then P proves A. If T equals 1, then P proves B. This directly corresponds to tagged union data types in programming. A &quot;Float or Int&quot; consists of a pair (Tag, Union). If Tag equals 0, then Union stores a Float. If Tag equals 1, then Union stores an Int.<p>In classical logic, a proof of &quot;A or not A&quot; requires nothing, a proof out of thin air.<p>Obviously, we want to stick with useful data structures, so we use constructive logic for programming.
        • pron19 hours ago
          &gt; Obviously, we want to stick with useful data structures, so we use constructive logic for programming.<p>I don&#x27;t know who &quot;we&quot; are, but most proofs of algorithm correctness use classical logic.<p>Also, there&#x27;s nothing &quot;obvious&quot; about what you said unless you want proof objects, and why you&#x27;d want that is far from obvious in itself.
          • amavect17 hours ago
            Well, to translate my words to your liking: &quot;In my opinion, everyone already uses a sort of constructive logic for programming.&quot;<p>I challenge you on &quot;most proofs of algorithm correctness use classical logic&quot;. That means double negation elimination, or excluded middle. I bet most proofs don&#x27;t use those. Give examples.
            • pron16 hours ago
              Oh, if you mean that most algorithm correctness proofs are finitary and therefore don&#x27;t need to explicitly rely on the excluded middle, that may well be the case, but they certainly don&#x27;t try to avoid it either. Look at any algorithm paper with a proof of correctness and see how many of them <i>explicitly</i> limit themselves to constructive logic. My point isn&#x27;t that most algorithm&#x2F;program proofs <i>need</i> the excluded middle, it&#x27;s that they don&#x27;t benefit from not having it, either.
              • zozbot23416 hours ago
                &gt; My point isn&#x27;t that most algorithm&#x2F;program proofs need the excluded middle, it&#x27;s that they don&#x27;t benefit from not having it, either.<p>Because if they benefited from it (in surfacing computational content, which is the whole point of constructive proof) they&#x27;d be comprised within the algorithm, not the proof.
                • pron16 hours ago
                  &gt; in surfacing computational content, which is the whole point of constructive proof<p>The point of a constructive proof is that the <i>proof itself</i> is in some way computational [1], not that the algorithm is. When I wrote formal proofs, I used either TLA+ or Isabelle&#x2F;HOL, neither of which are constructive. It&#x27;s easy to describe the notion of &quot;constructive computation&quot; in a non-constructive logic without any additional effort (that&#x27;s because non-constructive logics are a superset of constructive logics; i.e. they strictly admit more theorems).<p>[1]: Disregarding computational complexity
                  • zozbot23416 hours ago
                    &gt; When I wrote formal proofs, I used either TLA+ or Isabelle&#x2F;HOL, neither of which are constructive.<p>True, but this requires using different formal systems for the algorithm and the proof. Isabelle&#x2F;HOL being non-constructive means you can&#x27;t fully express proof-carrying code in that <i>single</i> system, without tacking on something else for the &quot;purely computational&quot; added content.
                    • pron12 hours ago
                      That&#x27;s not true. Non-constructive logics are <i>extensions</i> of constructive logics. You can express any algorithm in TLA+, and much more than algorithms.<p>You are right that when using non constructive logics, it&#x27;s not guaranteed that the proof is executable as a program, but that&#x27;s not a downside. Having the proof <i>be</i> a program in some sense is interesting, but it&#x27;s not particularly useful.
                      • zozbot23411 hours ago
                        How do you express computational content in non-constructive logic while both making it usable from proofs (e.g. if I have some algorithm that turns A&#x27;s into B&#x27;s, I want that to be directly referenceable in a proof - if A&#x27;s have been posited, I must be able to turn them into B&#x27;s) and keeping its character as specifically computational? Expressing algorithms in a totally separate way from proofs is arguably not much of a solution.
                        • pron10 hours ago
                          Not only is it easy, the ability to extend the computable into the non-computable is quite convenient. For example, computable numbers can be directly treated as a subset of the reals.<p>This is exactly how TLA+ works: <a href="https:&#x2F;&#x2F;pron.github.io&#x2F;posts&#x2F;tlaplus_part3" rel="nofollow">https:&#x2F;&#x2F;pron.github.io&#x2F;posts&#x2F;tlaplus_part3</a>
                        • nickpsecurity10 hours ago
                          You create a subset or model of what&#x27;s computable. Then, work in it. You might also prove refinements from high- to low-level forms.<p>Interestingly, we handle static analysis the same way by using language subsets. The larger chunk is unprovable. So, we just work with what&#x27;s easy to analyze. Then, wrap it in types or contracts to use it properly.<p>And plenty of testing for when the specs are wrong.
            • zozbot23417 hours ago
              Proofs of safety are proving a negative: they&#x27;re all about what an algorithm <i>won&#x27;t</i> do. So constructivism is irrelevant to those, because the algorithm has provided all the constructive content already! Proofs of liveness&#x2F;termination are the interesting case.<p>You might also add designing an algorithm to begin with, or porting it from a less restrictive to a more restrictive model of computation, as kinds of proofs in CS that are closely aligned to what we&#x27;d call constructive.
          • zozbot23419 hours ago
            The difference only becomes evident when proving liveness&#x2F;termination (since if your algorithm terminates successfully it has to construct <i>something</i>, and it only has to be proven that it&#x27;s <i>not</i> incorrect) and then it turns out that these proofs do use something quite aligned to constructive logic.
            • pron18 hours ago
              ... and also to classical logic. Liveness proofs typically require finding a variant that converges to some terminal value, and that&#x27;s just as easy to do in classical logic as in constructive logic.<p>I&#x27;ve been using formal methods for years now and have yet to see where constructive logic makes things easier (I&#x27;m not saying it necessarily makes things harder, either).
        • layer820 hours ago
          You aren’t giving any justification why proofs should necessarily map to data structures.
          • amavect20 hours ago
            Not necessarily, I only argue for utility. You can find better justification in the Curry-Howard correspondence.
            • pron19 hours ago
              How have you used the Curry Howard correspondence to make proving the correctness of non-trivial algorithms easier (than, say, Isabelle&#x2F;HOL or TLA+ proofs)?
              • amavect17 hours ago
                I hardly use automated formal methods. Disappointing, I know. I use it for thinking through C and Labview programs. It helps with recognizing patterns in data structures and reasoning through code.<p>For example, malloc returns either null or a pointer. That is an &quot;or&quot; type, but C can&#x27;t represent that. I use an if statement to decide which (or-elimination), and then call exit() in case of a null. exit() returns an empty type, but C can&#x27;t represent that properly (maybe a Noreturn function attribute). I wrap all of this in my own malloc_or_error function, and I conclude that it will only return a valid pointer.<p>Instead of automating a correctness proof in a different language, I run it in my own head. I can make mistakes, but it still helps me write better code.
                • pron16 hours ago
                  Oh, so I have used formal methods for many years (and have written about them [1]), including proof assistants, and have never found that constructive logic in general and type theory in particular makes proofs of program correctness any easier. The Curry-Howard correspondence is a cute observation (and it is at the core of Agda), but it&#x27;s not really practically useful as far as proving algorithm correctness is concerned.<p>[1]: <a href="https:&#x2F;&#x2F;pron.github.io" rel="nofollow">https:&#x2F;&#x2F;pron.github.io</a>
                  • amavect15 hours ago
                    I think for a cute observation, the metaphor helps me grasp where I can apply logic. I&#x27;ll read your blog in my free time, thanks for sharing.
      • ogogmad20 hours ago
        There are non-computational interpretations of intuitionistic logic too, like every single thing mentioned on this page: <a href="https:&#x2F;&#x2F;ncatlab.org&#x2F;nlab&#x2F;show&#x2F;synthetic+mathematics" rel="nofollow">https:&#x2F;&#x2F;ncatlab.org&#x2F;nlab&#x2F;show&#x2F;synthetic+mathematics</a><p>I think stuff like &quot;synthetic topology&quot;, &quot;synthetic differential geometry&quot;, &quot;synthetic computability theory&quot;, &quot;synthetic algebraic geometry&quot; are the most promising applications at the moment.<p>It can also find commonalities between different abstract areas of maths, since there are a lot of exotic interpretations of intuitionistic logic, and doing mathematics within intuitionistic logic allows one to prove results which are true in all these interpretations simultaneously.<p>I&#x27;m not sure if intuitionism has a &quot;killer app&quot; yet, but you could say the same about every piece of theory ever, at least over its initial period of development. I think the broad lesson is that the rules of logic are a &quot;coordinate system&quot; for doing mathematics, and changing the rules of logic is like changing to a different coordinate system, which might make certain things easier. In some areas of maths, like modern Algebraic Geometry, the standard rules of logic might be why the area is borderline impenetrable.
        • zozbot23419 hours ago
          These are more like computational-ish interpretations of sheaves, topological spaces, synthetic geometry etc. The link of intuitionistic logic to computation is close enough that these things don&#x27;t really make it &quot;non-computational&quot;. One can definitely argue though that many mathematicians are finding out that things like &quot;expressing X in a topos&quot; are effectively roundabout ways of discussing constructive logic and constructivity concerns.
      • gowld20 hours ago
        Excluded-middle `true` means &quot;[provable] OR [impossible to disprove]&quot;.<p>Intuitionist&#x2F;Constructivist `true` means, &quot;provable&quot;.<p>The question you are asking determines what answers are acceptable.<p>Why build an airplane, if you already know it must be possible?
        • drdeca19 hours ago
          This isn’t quite right. Classical logic doesn’t permit going from “it is impossible to disprove” to “true”. For example, the continuum hypothesis cannot be disproven in ZFC (which is formulated in classical logic (the axiom of choice implies the law of the excluded middle)), but that doesn’t let us conclude that the continuum hypothesis is true.<p>Rather, in classical logic, if you can show that a statement being false would imply a contradiction, you can conclude that the statement is true.<p>In intuitionistic logic, you would only conclude that the statement is not false.<p>And, I’m not sure identifying “true” with “provable” in intuitionistic logic is entirely right either?<p>In intuitionistic logic, you only have a proof if you have a constructive proof.<p>But, like, that doesn’t mean that if you don’t have a constructive proof, that the statement is therefore not true?<p>If a statement is independent of your axioms when using classical logic, it is also independent of your axioms when using intuitionistic logic, as intuitionistic logic has a subset of the allowed inference rules.<p>If a statement is independent, then there is no proof of it, and there is no proof of its negation. If a proposition being true was the same thing as there being a proof of it, then a proposition that is independent would be not true, and its negation would also be not true. So, it would be both not true and not false, and these together yield a contradiction.<p>Intuitionistic logic only lets you <i>conclude</i> that a proposition is true if you have a constructive&#x2F;intuitionistic proof of it. It doesn’t say that a proposition for which there is no proof, is therefore not true.<p>As a core example of this, in intuitionistic logic, one doesn’t have the LEM, but, one certainly doesn’t have that the LEM is false. In fact, one has that the LEM <i>isn’t</i> false.
        • smj-edison20 hours ago
          Ah, so if you had ¬p, and you negated it, you could technically construct ¬¬p in intuitionist logic, but only in classical logic could you reduce that to p? Since truth in classical logic means what you said here, where you didn&#x27;t actually construct what p is, so you can&#x27;t reduce it in intuitionistic logic.
        • thaumasiotes19 hours ago
          &gt; Excluded-middle `true` means &quot;[provable] OR [impossible to disprove]&quot;.<p>&gt; Intuitionist&#x2F;Constructivist `true` means, &quot;provable&quot;.<p>This is completely wrong. Excluded-middle `true` means &quot;provable&quot; and only &quot;provable&quot;. &quot;Impossible to disprove&quot; is `independent`, not `true`.
      • thaumasiotes21 hours ago
        For ideological reasons.
    • cubefox21 hours ago
      &gt; One of those is the law of the excluded middle, which says something can&#x27;t be true and false at the same time.<p>That would be the law of non-contradiction (LNC). The law of the excluded middle (LEM) says that for every proposition it is true or its negation is true.<p>LEM: For all p, p or not p.<p>LNC: For all p, not (p and not p).<p>Classical logic satisfies both, intuitionistic logic only satisfies LNC.
    • thaumasiotes21 hours ago
      &gt; Another feature is proof by contradiction, where you can prove something by showing that the alternative is unsound.<p>As far as lean is concerned, this isn&#x27;t an example of classical logic. It&#x27;s just the definition of &quot;not&quot; - to say that some proposition implies a contradiction, and to say that that proposition is untrue, are the same statement.<p>Most &quot;something&quot;s that you&#x27;d want to prove this way will require a step from classical logic, but not all of them. (¬p ⟶ F) ⟶ p is classical; (p ⟶ F) ⟶ ¬p is constructive.
      • zozbot23420 hours ago
        More generally, any <i>negative</i> statements can be proven classically, even in intuitionistic logic. Intuitionistic logic does not have the De Morgan duality found in classical logic, you have to go to linear logic if you want to recover that while keeping constructivity. (The &quot;negative&quot; in linear logic actually models <i>requesting</i> some object, which is dual to <i>constructing</i> it. The connection with the usual meaning of &quot;negative&quot; in logic involves a similar duality between &quot;proposing&quot; a proof and &quot;challenging&quot; it.)
      • smj-edison21 hours ago
        So proof by contradiction proves ¬p, but it requires the law of excluded middle to prove p (in the case of ¬p -&gt; F)? I didn&#x27;t realize that was constructive in the first case.
        • thaumasiotes19 hours ago
          Well, at some point you have to define what you mean by &quot;proof by contradiction&quot;. I was responding to your statement, &quot;prove something by showing that the alternative is unsound&quot;. You can prove that something is false that way without needing classical logic.<p>Mathlib defines `by_contradiction` as a theorem proving `(¬p → False) → p` for any proposition p. ( <a href="https:&#x2F;&#x2F;leanprover-community.github.io&#x2F;mathlib4_docs&#x2F;Mathlib&#x2F;Logic&#x2F;Basic.html#by_contradiction" rel="nofollow">https:&#x2F;&#x2F;leanprover-community.github.io&#x2F;mathlib4_docs&#x2F;Mathlib...</a> ) This does require classical logic.<p>For what&#x27;s happening with `¬p -&gt; F`, recall that this is by definition the statement `¬¬p`; classical logic will let you conclude `p` from `¬¬p`, or it will let you apply the law of the excluded middle to conclude that either `p` or `¬p` must be the case, and then show that since it isn&#x27;t `¬p`, it must be `p`. (Again, not really different approaches, but perhaps different in someone&#x27;s mental model.)<p>On the other hand, if you have `p -&gt; F`, that is by definition the statement `¬p`, and if you&#x27;ve established `¬p`, you&#x27;ve already finished proving that p is false.<p>Something that I find particularly absurd about the hypothetical distinction between intuitionistic and classical logic is that intuitionistic logic <i>is</i> sufficient to prove `¬p` from `¬¬¬p`. (This is quite similar to how &#x27;proof by contradiction&#x27; is constructive if you&#x27;re proving a negative but not if you&#x27;re proving a positive; it might be the same result.) So for any proposition that can be restated in a &quot;negative&quot; way, the law of the excluded middle remains true in intuitionistic logic. The difference lies only in &quot;fundamentally positive&quot; propositions. (You can do that proof yourself at <a href="https:&#x2F;&#x2F;incredible.pm&#x2F;" rel="nofollow">https:&#x2F;&#x2F;incredible.pm&#x2F;</a> ; it&#x27;s in section 4, `((A→⊥)→⊥)→⊥` -&gt; `A→⊥`.)<p>There&#x27;s a fun article on this very blog telling a similar story: <a href="https:&#x2F;&#x2F;lawrencecpaulson.github.io&#x2F;2021&#x2F;11&#x2F;24&#x2F;Intuitionism.html" rel="nofollow">https:&#x2F;&#x2F;lawrencecpaulson.github.io&#x2F;2021&#x2F;11&#x2F;24&#x2F;Intuitionism.h...</a><p>&gt; Martin-Löf designed his type theory with the aim that AC should be provable and in his landmark Constructive mathematics and computer programming presented a detailed derivation of it as his only example. Briefly, if (∀x : A)(∃y :B) C(x,y) then (∃f : A → B)(∀x : A) C(x, f(x)).<p>&gt; Spoiling the party was Diaconescu’s proof in 1975 that in a certain category-theoretic setting, the axiom of choice implied LEM and therefore classical logic. His proof is reproducible in the setting of intuitionistic set theory and seems to have driven today’s intuitionists to oppose AC.<p>&gt; It’s striking that AC was seen not merely as acceptable but clear by the likes of Bishop, Bridges and Dummett. Now it is being rejected and the various arguments against it have the look of post-hoc rationalisations. Of course, the alternative would be to reject intuitionism altogether. This is certainly what mathematicians have done: in my experience, the overwhelming majority of constructive mathematicians are not mathematicians at all. They are computer scientists.
          • smj-edison19 hours ago
            Yeah, I suppose I was playing fast and loose with the terminology to make it more approachable. iirc, the definition of proof by contradiction is you assume the negation, show that the negation has something that is both true and not true, and hence the negation is logically unsound. Since you can technically derive anything from an unsound system, you derive that the negation is false, and then by the laws of excluded middle and non-contradiction, you know that p must be true.<p>But now I see from what you mentioned that this means that if you don&#x27;t do the negation elimination, then you can still show `¬¬p` in an intuitionistic logic system.<p>Is proof by contradiction of a false statement just a counterexample? Because a counterexample shows that the statement is incoherent, so the negation must be true. And you have to construct a counterexample.
            • zozbot23418 hours ago
              A counterexample as generally understood would be a constructive refutation. Proof by contradiction is much more general than that. Of course the problem of extracting the residual constructive content from a proof by contradiction (explaining how it is in some sense constructing some vastly generalized counterexample) is non-trivial.
          • zozbot23419 hours ago
            Constructivists don&#x27;t call a proof of ¬p a &quot;proof by contradiction&quot;, they just call it a proof of ¬p. To them, a &quot;proof by contradiction&quot; of some p that isn&#x27;t in the negative fragment is just nonsense, because constructive logic doesn&#x27;t have the kind of duality that even makes it necessary to talk about contradiction as a kind of <i>proof</i> to begin with. They&#x27;d see the classical use of &quot;proof by contradiction&quot; as a clunky way of saying &quot;I&#x27;ve actually only proven a negative statement, and now I can use De Morgan duality to pretend that I proved a positive.&quot;
            • thaumasiotes15 hours ago
              &gt; Constructivists don&#x27;t call a proof of ¬p a &quot;proof by contradiction&quot;, they just call it a proof of ¬p.<p>I tend to agree with the opposition on this one. Concluding that p is false because its truth leads to a contradiction is fundamentally identical to concluding that p is true because its falsity leads to a contradiction... and in particular, it is reasonable to describe &#x27;concluding that p is false because its truth leads to a contradiction&#x27; as a &#x27;proof by contradiction&#x27;.<p>The reason that the first type is &quot;constructive&quot; while the second one isn&#x27;t is due to a strange definition of falsity on the part of the constructivists.
              • zozbot23415 hours ago
                &gt; Concluding that p is false because its truth leads to a contradiction is fundamentally identical to concluding that p is true because its falsity leads to a contradiction... The reason that the first type is &quot;constructive&quot; while the second one isn&#x27;t is due to a strange definition of falsity on the part of the constructivists.<p>You can actually make that a rigorous statement in linear logic, which reintroduces the duality that&#x27;s lost in intuitionistic logic while still making it possible to assess whether some claim is constructive. But linear logic is significantly more complex than either classical or intuitionistic logic.
    • bowsamic21 hours ago
      This makes it good for formal maths, but bad for philosophy, since it means it can’t encode the speculative movement
      • drdeca19 hours ago
        Which logic are you saying “can’t encode the speculative moment”?<p>I think the two logics can emulate one another? Or, at the very least, can describe what the other concludes. I know intuitionistic logic can have classical logic embedded in it through some sort of “put double negation on everything”. I think if you add some sort of modal operator to classical logic you could probably emulate intuitionistic logic in a similar way?
        • zozbot23419 hours ago
          You don&#x27;t even need to <i>add</i> a modal operator since modal logic itself can be embedded in classical logic via possible-world semantics. Of course the whole thing becomes a bit clunky - but that&#x27;s the argument for starting with intuitionistic logic, where you wouldn&#x27;t need to do that.
        • bowsamic19 hours ago
          Any logic with LEM
  • MarkusQ21 hours ago
    We need more of this.<p>For every &quot;well of course, just...X, that&#x27;s what everybody does&quot; group-think argument there&#x27;s a cogent case to be made for at least considering the alternatives. Even if you ultimately reject the alternatives and go with the crowd, you will be better off knowing the landscape.
    • lmm11 hours ago
      Completely disagree; IMO we build far too many frameworks and alternatives (probably because it&#x27;s fun) instead of a) enhancing the things that already exists to have the thing we want or b) just getting on with the actual work. The whole field would be much better off if we had half as many languages, half as many libraries, half as many build tools...
    • sdenton421 hours ago
      It depends!<p>Every time you go off the beaten path, you&#x27;re locking yourself into less documentation, more bugs (since there&#x27;s less exploration of the dark corners), and fewer people you can go to for help. If you&#x27;ve got 20+ choices to make, picking the standard option is the right choice on average, so you can just do it and move on. You have finite attention, so doing a research report on every dependency means you&#x27;re never actually working on the core problem.<p>The exceptions to this are when a) it becomes apparent that the standard tool doesn&#x27;t actually fit your use case, or b) the standard tool significantly overlaps the core problem you&#x27;re trying to solve.
      • MarkusQ18 hours ago
        &gt; You have finite attention, so doing a research report on every dependency means you&#x27;re never actually working on the core problem.<p>Reading that took five minutes and gave a good intro to the counter argument to Curry-Howard-all-the-things monomania. If having invested those five minutes, Lean still seems like the way to go (for whatever reason) fine. You are making a (closer to) informed choice, and likely better off than if you&#x27;d spent those five minutes doubling down on the conventional solution.<p>Most deviations from the group consensus are mistakes, but all progress comes from seeing past the group consensus. So making frequent small bets on peeking around your blinders is a good strategy.
      • c-linkage18 hours ago
        Which shows the lie of the common engineering trope &quot;use the right tool for the job.&quot;<p>It really should be &quot;use the same tool that everyone else is using so you don&#x27;t have decide which tool is the right one -- the herd made that decision for you!&quot;
  • pstoll18 hours ago
    Feels like all the write ups that point out the short comings of eg Python for scientific computing.<p>Sure, except that once you have a community at critical mass around a reasonably good tool, that trumps most other things. Momentum builds. People write tutorials, explainers, better documentation, etc. it hits escape velocity.<p>Feels like Lean, with Terrance Tao as a strong proponent &#x2F; cheerleader, is in that space.<p>Everyone who argues “but language X is better” … may not be wrong, but they are not making the argument that matters. Is it better than the thing everyone else knows and can use and has more people hours going into it to improve it?<p>Feels like a “worse is better” situation; or maybe “good and popular is good enough”.
    • pfdietz14 hours ago
      I think the point that LLMs should enable effective translation between different formalisms is a good one. So I don&#x27;t see the choice as being a big issue. This is especially the case here because to a large extent the translations can be checked automatically.
    • ModernMech17 hours ago
      &gt; once you have a community at critical mass around a reasonably good tool, that trumps most other things<p>This matters a lot less in the age of AI. AI doesn&#x27;t need a massive number of community-built libraries, it can just write its own. It doesn&#x27;t need a million tutorials floating out there on the interwebs because unlike most programmers, it will actually read the spec and documentation (tutorials are just projections of the docs&#x2F;spec anyway). AI doesn&#x27;t have to avoid languages with no job market because it just needs to do the job at hand, not build a career. This makes it easier for small languages and DSLs to gain usage where they never would have before.<p>I think AI might spell the end of the language monoculture (top 20 are mostly slight variations on languages circling the same design) that has persisted in programming.
      • tehjoker16 hours ago
        It&#x27;s the opposite and has been recognized for years. AI depends on training data and this nearly freezes the use of languages that were popular at the time of inception. Hopefully that is not true.<p>AI needs community libraries if there is to be interoperability and baseline quality between systems. At least at this level of quality and development.
        • ModernMech13 hours ago
          &gt; Hopefully that is not true.<p>I&#x27;m here saying this &quot;PL ossification theory&quot; is probably wrong, that it&#x27;s not going to be the case at all. Yes, AI depends on training data, but that doesn&#x27;t imply that AI can only use those programming languages or only reason in languages that existed at the time of their training. In fact the AI is able to reason able new languages the same way humans can -- by drawing inferences to the next closest language that it knows, pattern matching to things that are different from other languages, and also figuring out the semantics and reasoning through execution itself where it doesn&#x27;t have training examples.<p>&gt; AI needs community libraries if there is to be interoperability and baseline quality between systems.<p>Not everyone is looking to do the kind of work you&#x27;re doing, and that&#x27;s my point. Up until now, programming languages have been written by and for people who want to do businey&#x2F;mathy&#x2F;sciencey things with computers. But there&#x27;s a huge world out there of other stuff to do with programming languages that have never been considered because the proposition of making languages for those domains is daunting and outside of the wheelhouse of normal people.<p>Now, DSLs are sprouting up where they have no business existing because of AI, just proliferating all over the place. Some of them are going to find communities (of people, AI, or both) and they will flourish completely apart from the systems we are building now in the tech world. It&#x27;s not going to be the case that AI writes in Python for the rest of time because it writes in and was trained on Python today.
  • loglog18 hours ago
    &quot;I believe that almost anything that has been formalised today in any system could have been formalised in AUTOMATH. Its main drawbacks were its notation, which really was horrible, and its complete lack of automation. Proofs were long and unreadable.&quot; That&#x27;s like saying that anything that could be programmed today in your modern language of choice could have been programmed 50 years ago in assembly. Technically yes, economically no.
    • strbean18 hours ago
      Well, assembly languages are generally Turing complete. Not sure what the parallel would be in proof engines.
  • ianhorn9 hours ago
    I remember trying to play around with Coq&#x2F;Rocq and a few others about 15 years ago, and I couldn’t make heads or tails of them. Not the concepts, but the software. What’s weird about proof assistants&#x2F;interactive provers is that the “interactive” part makes it a combo of IDE and language and they seem to get pretty tightly coupled in practice. You can’t talk about the language without talking about the environment you use it in.<p>I’m not the biggest VS code fan, but a battle honed extensible IDE used by zillions and maintained by $$$ has proved itself miles ahead of the environments for alternatives. As far as i can tell, the excellent onboarding path that is the Natural Numbers Game is possible because of VS code’s hackability and ecosystem.<p>My main concern as I’m learning lean is that the syntax extensibility seems to be a double edged sword. Once i’ve learned a language, i want to be able to read code written in it. If everything is in a project’s own DSL, that can get out of hand, but that comes down to community&#x2F;ecosystem so i’m crossing my fingers.
  • still_grokking9 hours ago
    Can someone ELI5 that for me?<p>Is this the mathematician&#x27;s variant of &quot;my language is better than your language&quot;, or what does this post actually discus? Something fundamental in the philosophy underpinning things or just the way to express them?
    • BlanketLogic8 hours ago
      Paulson is a lead developer of Isabelle , a proof assistant that is not based on dependent types.<p>&gt; Is this the mathematician&#x27;s variant of &quot;my language is better than your language&quot;,<p>Almost. A closer analogy is comparing paradigms, say OOP vs functional programming.<p>Isabelle is different from the big three - rocq. lean and agda. The latter three have propositions as types. The type of your function is the theorem statement. The function body is the proof. Isabelle works differently. Author makes a convoluted argument that (a) one doesn&#x27;t have to stick to the currently popular paradigm and (b) in conjunction with AI, Isabelle offers distinct benefits.
  • c7b15 hours ago
    Lean isn&#x27;t the most loved proof assistant by mathematicians, it&#x27;s not the most suited to formal verification of software, it just sort of works for both. Yet it&#x27;s got the thing that&#x27;s arguably the hardest to achieve, momentum. Compounded by the fact that in the AI age, the amount of publicly available human-written code directly affects how well agents can produce new code.
  • rzerowan19 hours ago
    One of those names that forces a double take when seen disconnected from context:<p>&#x27;Lean or purple drank is a polysubstance drink used as a recreational drug. It is prepared by mixing prescription-grade cough or cold syrup containing an opioid drug &#x27;<p>proving that one of the hardest problem in CS - &#x27;naming things&#x27; still keeps on keeping on.
    • InkCanon28 minutes ago
      Wait till you hear what Rocq was originally called!
    • bradleyy13 hours ago
      The two hardest problems in CS: * naming * cache invalidation * off by one errors
  • bawolff8 hours ago
    &gt; I have been told that when proposing to formalise mathematics these days, you have to explain why you are not using Lean....Amidst the hype around today’s progress, we must remember how we got here. It was not by people following the crowd.<p>Im not a mathmatician, but in my experience if you are trying to do something novel, you should follow the crowd except for things that impact what you are trying to achieve. Otherwise you spend a lot of extra time sorting through issues on the part that doesn&#x27;t matter which could be better spent on the novel part.
  • raphlinus15 hours ago
    People interested in alternatives to Lean should also look at Metamath. It has nowhere near the adoption that Lean is getting, but is holding its own in [100] theorems results.<p>It has some advantages and compelling properties, not least of which is that it&#x27;s very simple, so much so that there are many implementations of checkers; most other proof systems are ultimately defined by a single implementation. It&#x27;s also astonishingly efficient — the entire database can be checked in less than a second. Set theory is also a familiar foundation for mathematicians, though the question of which is a <i>better</i> foundation compared with type theory is very controversial. Mario Carneiro pushed forward the development of Metamath in his thesis [0].<p>There are downsides also, including junk theorems, and automation is weaker. It&#x27;s possible that types really help with the latter. Even so, I think it&#x27;s worthy of study and understanding.<p>[0]: <a href="https:&#x2F;&#x2F;digama0.github.io&#x2F;mm0&#x2F;thesis.pdf" rel="nofollow">https:&#x2F;&#x2F;digama0.github.io&#x2F;mm0&#x2F;thesis.pdf</a><p>[100]: <a href="https:&#x2F;&#x2F;www.cs.ru.nl&#x2F;~freek&#x2F;100&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.cs.ru.nl&#x2F;~freek&#x2F;100&#x2F;</a>
  • asdfman12316 hours ago
    I am going to build an alternative to Lean called Purple Drank
    • asparagui12 minutes ago
      I was going to call my project that but Claude said that wasn&#x27;t professional. rip &quot;a delightful mixture of lean&quot;
    • bradleyy13 hours ago
      Do not be surprised when I fork and call it Sizzurp.
  • gorgoiler19 hours ago
    It’s been decades since I could claim to know anything about this field so I’m probably completely wrong in how I read this, but the idea that one might build a theorem prover (“ML!”) for one’s non-ML programming language and have the prover itself accidentally be a really good general purpose programming language … is very funny.
    • hutao7 hours ago
      To clarify: ML started out as a scripting language for Robin Milner&#x27;s proof assistant, LCF. The formal system, or &quot;logic,&quot; is implemented in a minimal, trusted kernel, and the proof data structure is protected as an abstract data type that can only be constructed through the trusted kernel. On top of the kernel, tactic scripts may be defined to manipulate proof objects and facilitate proof search&#x2F;automation.<p>Then, ML grew into a general-purpose programming language (both OCaml and Standard ML are dialects).
  • jojomodding13 hours ago
    I do not get why not needing proof objects is desirable. It seems good to have a defined way to store proofs that has a very tight spec and can thus have competing implementations, like in <a href="https:&#x2F;&#x2F;arena.lean-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;arena.lean-lang.org&#x2F;</a>. The LCF approach couples the proof format to the module system of a programming language.<p>Occasionally, inspecting that proof term is useful to see what happened in a proof.<p>Then again, I also like dependent types.
    • zozbot23413 hours ago
      You can use reflection in dependently-typed proof systems to avoid storing proof objects for expensive computations and replace them with a proof of a general algorithm instead (much like in the LCF approach: the general algorithm proof is the equivalent of a compiler checking that the module system use in a LCF tactic is sound).
  • WhitneyLand17 hours ago
    The most important thing is keeping up the momentum to formalize more proofs and continue to strengthen the libraries and foundational work.<p>If that momentum is strongest with Lean so be it. At the same time things become more machine verifiable, converting to a new system will also become easier. It can already be strongly assisted using a general agent like Claude Code.
  • jsmorph21 hours ago
    Slightly off topic: This project <a href="https:&#x2F;&#x2F;agentcourt.ai&#x2F;arb&#x2F;analysis&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;agentcourt.ai&#x2F;arb&#x2F;analysis&#x2F;index.html</a> uses a Go&#x2F;Lean hybrid design. The Go code is mostly glue, and the Lean code is the logic <a href="https:&#x2F;&#x2F;github.com&#x2F;agentcourt&#x2F;adjudication&#x2F;tree&#x2F;main&#x2F;arb&#x2F;engine" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;agentcourt&#x2F;adjudication&#x2F;tree&#x2F;main&#x2F;arb&#x2F;eng...</a>. It&#x27;s not math-intensive. Really just functional programming with some interesting proofs (including soundness ideally). Go code can migrate to Lean code when that makes sense.
  • red-iron-pine16 hours ago
    ngl assumed this was about supply management or purple drank<p>&gt; Propositions as types is a duality linking the logical signs ∀ , ∃ , → , ∧ , ∨ with the type constructors Π , Σ , → , × , + . It is beautiful, fascinating and theoretically fruitful, but it is not the only game out there. I have seen “proof assistant”
  • BlanketLogic9 hours ago
    I think the author is confkating two different things. There are technical problems with sticking to constructive purity when it comes to mathematics (setoid hell, avoiding excluded middle, real number formalization etc). Then there are social aspects. The community&#x27;s &#x27;cultist&#x27; ( his words) adherence to constructive logic. Saying this is the reason rocq lost out to lean seems wrong.<p>Firstly, there is value of the attempt. By staying true to constructive logic, there was a lot of progress (compcert verified c compiler, cubical agda etc).<p>Secondly, there were other confounding variables (tooling, network effects). Claiming rocq lost out to lean due to community&#x27;s obsession is a bit of reductive argument.<p>But author is an expert. I will defer to him. His point about sledgehammer approach working well in the new AI world is very interesting though.
  • ifh-hn16 hours ago
    I keep seeing articles about Lean recently on HN. Never heard of it before. I&#x27;m not a mathematician and not a professional developer so my opinion might not mean shit, but I can&#x27;t make head nor tail of it. I can&#x27;t understand what half of what the website is talking about.
    • jojomodding13 hours ago
      Its a software where you type your maths proofs in and a &quot;yes&quot; comes out. Except if your proof is broken, then a &quot;no&quot; comes out. Of course, sometimes the computer is just a bit dumb at intuiting the intermediate steps, so you need to explain like a 10-year-old child (or else you get a &quot;no&quot; as you failed to convince the computer). And storing all these explanations takes memory. And you have to speak the somewhat idiosyncratic language of the computer, which you can imagine a bit like LaTeX but more easily parseable and less ambiguous.<p>The blog article author is saying that Lean is like a younger child (that needs more intermediate steps explained), stores proofs more inefficiently (taking more memory) and that its computer proof language is harder to read for humans. Additionally there is a technical point about dependent types, which are the principle around which the computer proof language is organized (the same way a programming language might be organized around object-orientism).
      • ifh-hn6 hours ago
        Thanks for taking the time to explain, rather than drive by downvote. It doesn&#x27;t seem like this would be useful to me, or certainly I have no use for it that I can think of.
    • icosahedron15 hours ago
      It&#x27;s a paradigm shift, that&#x27;s for sure.<p>I&#x27;m still in the throes of learning it myself, and it&#x27;s quite the journey. I love the promises behind it, but I&#x27;m not yet far enough along to know if they are kept or if it&#x27;s just kool aid (or perhaps purple drank?)
      • ifh-hn6 hours ago
        I&#x27;ve never heard of purple drank before, not American. Which came first? The language or drug?
  • ibobev17 hours ago
    What about the performance characteristics of the Lean programs? I know it is a natively compiled language, but is the code it produces comparable to that of modern system programming languages in terms of performance?
    • ted_dunning12 hours ago
      Oddly enough, most uses of Lean never actually run the program. The fact that it type checks is enough to prove the theorem in question.<p>That said, if execution is seriously required for your problem along with strong logic on the side, you may prefer Dafny which transpiles the computation part of your proof to C++ or Go.
  • heliumtera19 hours ago
    &gt;The recommended way to install Lean is through VS Code<p>Is that enough reason?
    • EFreethought5 hours ago
      Yes.<p>I am tired of my time in tech being just using MS products that all depend on each other.
  • arjunthazhath4 hours ago
    [dead]
  • waffletower21 hours ago
    [flagged]
  • shaguoer19 hours ago
    [flagged]
  • j2kun14 hours ago
    If you write an article shitting on a popular thing because it eclipses the popularity of your favorite thing (and essentially calling the people who use it ignorant sheep), chances are good you are part of a self-fulfilling prophecy, pushing people away from your community.
  • zermelo4421 hours ago
    Good post! +1
  • groundzeros201521 hours ago
    Type theory and lean is more interesting to people who like computers than to people who like math.
    • ux26647821 hours ago
      The set theorists decided that mathematics is the overarching superdomain over all study of structure. You don&#x27;t get to pick and choose. Either mathematics is a suburb of logic and these two things are separate, or they&#x27;re not and ZFC dogmatics need to accept they don&#x27;t have a monopoly on math.<p>I of course fully support reinstating logicism, but the same dogmatics love putting up a fight over that as well.
      • smj-edison20 hours ago
        I think the most surprising thing I&#x27;ve learned taking formal math in college is just how much mathematicians are pragmatists (at least for my teacher with sample size n=1). They&#x27;re much more interested in new ways to think about ideas, with a side effect of proofs for correctness. The proof is more about explaining why something works, not that it does.<p>I&#x27;m going to take a formal logic class in the fall, and my professor said something akin to &quot;definitely take it if you&#x27;re interested, just be aware that it probably won&#x27;t come in use in most of the mathematics done today.&quot; The thing is the foundations are mostly laid, and people are interested in using said foundations for interesting things, not for constantly revisiting the foundations.<p>I think this is one reason most mathematicians don&#x27;t see a need for formal proof assistants, since from their perspective it&#x27;s one very small part of math, and not the interesting one.<p>This is not to say that proof assistants are a dead end—I find them fascinating and hope they continue to grow—but there&#x27;s a reason that they haven&#x27;t had a ton of traction.
        • ux26647818 hours ago
          I think that&#x27;s a good way of putting it. I would addend that most people working in mathematics aren&#x27;t generalists, their primary interest isn&#x27;t in a broad picture. Rather, most are hyperfocused into a single domain with a strong backbone of reflexive intuition built up. By virtue of sheer human limitation, there&#x27;s only so much someone can care about what&#x27;s happening outside of their world while still making serious contributions within it. This doesn&#x27;t even just extend all the way to shifting foundations, but number theorists can hardly be expected to keep up with the forefront of graph theory, for example.<p>For the pragmatists Logic as a field commits the immortal sin: it blasphemes the intuition that mathematicians spend years honing by obliterating it. Not just for a singular domain, but <i>for all domains</i>. Of course, that doesn&#x27;t really explain the whole picture. Formalism built a holy walled city. Logicians, by nature of their work, leave the safety of the walled city to survey, exploit and die in the tangled jungle outside. Some don&#x27;t even speak the holy language of the glorious walled city, they talk in absolutely gibberish modalities and hyperstructures. There is a political tension held against logic and logicians as a result.
      • groundzeros201521 hours ago
        Mathematicians use logic to talk about the mathematical world. But logic is not the world.
        • ux26647820 hours ago
          Not even the most dogmatic of the set theorists ever argued mathematics was possible without reason, however. For mathematics, logic is the world, as the copula makes no distinction between substance and existence. In the same sense that the earth is not matter itself, but it is a material thing.<p>Putting that aside, to make things more clear: computer science <i>is</i> mathematics. Computer scientists are mathematicians. That was a categorization decided long before you and I ever lived. In the sense that you mean, you&#x27;re only referring to a very small fraction of what &quot;mathematics&quot; refers to In the true sense of the word. It is just as irreconcilably disjointed as Logic is, not unified and fundamentally non-unifiable.<p>I too think it would be better if &quot;mathematics&quot; was reserved for the gated suburb of ZFC. But that&#x27;s not the world we live in, courtesy of the same people who pushed ZFC as a foundation to begin with.
          • groundzeros201520 hours ago
            &gt; For mathematics, logic is the world, as the copula makes no distinction between substance and existence.<p>No. There are truths about the subject not captured in any single formal system. Which is why objects are studied form many perspectives.<p>&gt; Computer scientists are mathematicians.<p>Some are and some aren’t.
    • kccqzy17 hours ago
      I would’ve expected that people who like computers will converge around something like Idris. It’s marketed as a development tool, not a tool for formalizing mathematics even though it could be used as a proof assistant.
    • soulofmischief21 hours ago
      Terence Tao, one of the most important living mathematicians, specifically embraces Lean and has been helping the community embrace it.<p>What you&#x27;ve done here is an overgeneralization. &quot;People who like math&quot; and &quot;people who like computers&quot; are massive demographics with considerable overlap.
      • vitriol8317 hours ago
        Formalised proofs and Lean in particular are still too cumbersome for the ``working&#x27;&#x27; mathematician to use it day-to-day for research-level math. But clearly there is some interest on where it may take us in future.
      • groundzeros201520 hours ago
        &gt; one of the most important living<p>Maybe. But more clearly one of the most popular online.
        • lanstin17 hours ago
          He&#x27;s a Field&#x27;s Medalist so that&#x27;s automatically one of the most important living. He is good at explaining things; I leaned on his Analysis textbooks when I was taking analysis and functional analysis to great effect; in a research class I was trying to calculate Fourier transforms of algebraic sets and found various almost throw away comments on his blog that were extremely enlightening (alas only to the extent I could follow them). He&#x27;s a legit great mind of modern mathematics - and also able to communicate well; a historical rarity indeed.<p>The topic being discussed here has been addressed specifically in his mastodon posts - the pre-LLM math process was understood to be &quot;state a proof, validate a proof&quot; - but the real aim was the not explicit &quot;digest the proof so we can extend to other results&quot; - with LLM&#x2F;lean making the first two a lot easier and possible to do without accomplishing the digestion into the mathematical community; so we need to add &quot;digesting proofs (from where ever)&quot; into the job description. Thread starts here: <a href="https:&#x2F;&#x2F;mathstodon.xyz&#x2F;@tao&#x2F;116477351524980995" rel="nofollow">https:&#x2F;&#x2F;mathstodon.xyz&#x2F;@tao&#x2F;116477351524980995</a>
    • baq21 hours ago
      citation needed, Tao certainly is on record using Lean and that carries some weight.<p>also, <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Curry%E2%80%93Howard_correspondence" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Curry%E2%80%93Howard_correspon...</a> i.e. there&#x27;s no reason it should be as you say.
      • groundzeros201521 hours ago
        The link is exactly what I’m saying. I only hear cs people talk about it.<p>For mathematicians a proof is a means to an end, or a medium of expression - they care about what they say and why.<p>The correspondence isn’t about C programs corresponding to proofs in math papers. It’s a very a specific claim about kinds of formal systems which don’t resemble how math or programming is done.
        • gowld20 hours ago
          Mathematicians care about interesting ideas, not whether their theorems are true :-)
          • groundzeros201520 hours ago
            They care about if it’s true. But the role of the formal proof is a kind of spell checker or static analysis after they have the idea.
            • j16sdiz20 hours ago
              &gt; They care about if it’s true.<p>Not always.<p>If it is NOT true, they sometimes simply play &quot;what if&quot; and construct a new system where it could be true.
              • BigTTYGothGF18 hours ago
                &gt; If it is NOT true, they sometimes simply play &quot;what if&quot; and construct a new system where it could be true.<p>I trust you have some examples of this?
                • ianhorn9 hours ago
                  Complex numbers and Schwartz distributions (the thing the dirac delta is) come immediately to mind. “Not all numbers have square roots, but what if they did?” It seems like a common pattern.
                • sincerely18 hours ago
                  I think they&#x27;re talking about conjectures that are unproven but seem &quot;likely true&quot; and people build further math off the assumption. E.G Reimann hypothesis