‹ BackHN Continuity

Thread

Anatomy of a Lean proof for software engineers

128 points · 76 comments · abiro

  1. thom · · focus · HN ↗
    So this is all great, but given that we’re being asked to accept 500k+ line Lean proofs that check but could easily have major semantic errors hidden in them, what’s the plan? These seem like uniquely fragile software artifacts, despite the excellent and robust promises made by the runtime.
    1. thaumasiotes · · focus · HN ↗
      > but given that we’re being asked to accept 500k+ line Lean proofs that check but could easily have major semantic errors hidden in them, what’s the plan?

      What does it mean for a semantic error to be "hidden in" a proof? The proof has premises and a conclusion, and if you trust the lean kernel it isn't possible for the innards of a proof to contain an error of any kind.

      There could be a semantic mismatch between the statement you claim to have proved and the statement that the proof proves, but that has nothing to do with what's inside the proof - it's all right there on the surface.

      1. dnautics · · focus · HN ↗
        There are things you can do in lean which are footguns. For example, 1/0 = 0 in lean. For much of math that's not a problem. Still though, you have to remember that this is the case for whatever number system you're doing a proof in. For things which map to real world scenarios it's potentially a big problem.
        1. fooker · · focus · HN ↗
          No, 1/0 is not 0 in lean.
          1. howling · · focus · HN ↗
            > No, 1/0 is not 0 in lean.

            1&#x2F;0 is 0 in lean, though it may not be a problem. <a href="https:&#x2F;&#x2F;xenaproject.wordpress.com&#x2F;2020&#x2F;07&#x2F;05&#x2F;division-by-zero-in-type-theory-a-faq&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xenaproject.wordpress.com&#x2F;2020&#x2F;07&#x2F;05&#x2F;division-by-zer...

          2. thaumasiotes · · focus · HN ↗
            So, you think it&#x27;s important for other people to learn Lean&#x27;s model of type theory before using it to do entirely unrelated proofs, but you see no reason you should know anything about how basic arithmetic works?
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.