‹ BackHN Continuity

Thread

Anatomy of a Lean proof for software engineers

128 points · 76 comments · abiro

  1. fooker · · focus · HN ↗
    Please do not try to understand Lean or proof assistants without first getting a rudimentary understanding of the logic involved. This article sort of skips over it, which is reasonable because it is pretty involved.

    Even if you have written a large number of math proofs, you'd usually not have learnt the language or logic of proofs themselves. And even if you are an accomplished computer scientist, logic is not just AND, OR, NOT.

    Here is some necessary reading, feel free to find better sources but wikipedia is good too.

    * Proof trees - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Method_of_analytic_tableaux" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Method_of_analytic_tableaux

    * Constructive&#x2F;Intuitionistic logic - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Intuitionistic_logic" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Intuitionistic_logic

    * Proofs and Types - <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...

    * (In)completeness - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;G%C3%B6del%27s_incompleteness_theorems" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;G%C3%B6del%27s_incompleteness_...

    * Compactness - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Compactness_theorem" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Compactness_theorem

    1. rramadass · · focus · HN ↗
      What you actually need is knowledge of an overview of the Mathematics of Formal Methods in all their aspects viz. Predicate Logic, Set Theory, Temporal Logic, Type Systems etc.

      Towards that end I highly recommend the following books;

      1) Introductory Logic and Sets for Computer Scientists by Nimal Nissanke - An easy-to-read book needed for background mathematical fundamentals.

      2) Understanding Formal Methods by Jean-Francois Monin - This gives an excellent overview of the core topics and a must-read. From here you can branch off into studying any specific approach and its tool (eg. Lean4&#x2F;TLA+&#x2F;etc.). Once you have studied this there is nothing &quot;Formal&quot; (specification&#x2F;verification&#x2F;etc.) which is impenetrable.

      3) The Correctness-by-Construction Approach to Programming by Derrick Kourie and Bruce Watson - Walks you through the entire process of deriving a program using successive refinements from specifications using Hoare&#x2F;Dijkstra approach.

      1. whattheheckheck · · focus · HN ↗
        Oh yeah let me just take another 4 years of undergrad to get a math degree too.

        I thought this AI or SI was supposed to make shit easier for everyone.

        1. rramadass · · focus · HN ↗
          That is just glib nonsense.

          The above books do not need a math degree; You just need to become &quot;familiar&quot; with the mathematical form and its jargon. Most programmers can read and understand them.

          You can easily finish the books in a couple of months using AI for clarifying&#x2F;simplifying difficult concepts to gain quicker understanding.

          AI can produce all the How but the What&#x2F;Why still needs to happen in your head and hence the need to understand the mathematics.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.