4 comments

  • frotaur20 minutes ago
    I don&#x27;t know much about Lean, but I attended an introductory talk at some point and I was particularly bothered by these partial function definitions. The example was sqrt, which would give 0 on the negatives.<p>Now, of course, if you&#x27;re careful with the definitions you use, there is no problem. But in the (increasingly relevant) context of automatic theorem proving with LLMs, this seems to defeat the &#x27;groundtruthness&#x27; of Lean!<p>How do you make sure that the LLM doesn&#x27;t reward hack a proof using these workarounds?
    • akoboldfrying9 minutes ago
      I don&#x27;t understand why they would make such footgun functions either, especially because (IIUC, and I probably don&#x27;t) in a way the whole point of Lean&#x27;s dependent type system is to be able to express arbitrary constraints on the inputs of these functions <i>so that they can be total</i> -- e.g., to be able to define a subtraction function on the nonnegative integers that takes one integer and one {integer that is less than or equal to the first integer}. And to even call this function, you (or perhaps Lean itself) would need to first prove that its second argument is less than or equal to its first.
  • andyjohnson01 hour ago
    TIL that &quot;junk theorems&quot; are a thing in mathematics. Not being a mathematician myself, I found this [1] article a useful primer.<p>[1] <a href="https:&#x2F;&#x2F;www.cantorsparadise.com&#x2F;what-are-junk-theorems-298687b577bf" rel="nofollow">https:&#x2F;&#x2F;www.cantorsparadise.com&#x2F;what-are-junk-theorems-29868...</a>
  • 414owen1 hour ago
    Wow, okay. I would imagine this makes mathematicians quite angry? I guess you&#x27;re responsible for all the operations you use in your proof being well-behaved.<p>It sounds like subtraction over Nats needs to be split into `sub?`, and `sub!`, the former returning an option, and the latter crashing, on underflow, as is the Lean convention?<p>To use the default `sub`, you should need to provide a witness that the minuend is &gt;= the subtrahend...<p>The version with silent underflow is still useful, it should just be called `saturatingSub`, or something, so that mathematicians using it know what they&#x27;re getting themselves into...
  • emil-lp1 hour ago
    I don&#x27;t understand. What does this mean?<p><pre><code> Theorem 6. The following are equivalent: The binary expansion of 7.</code></pre>
    • tux322 minutes ago
      This is a junk theorem, it&#x27;s trying to prove something that will sound strange or meaningless but is technically allowed by the details of the foundations.<p>Here it&#x27;s building a list with one element and saying all elements of this list are equivalent. So the following elements of the list are all equivalent to each other (there is a single element in the list)
    • bzax25 minutes ago
      It doesn&#x27;t mean anything. The point is that the language of lean, and its proof derivation system, are able to express (and prove) statements that do not correspond to any meaningful mathematics.
    • silasdavis1 hour ago
      The following are equivalent: