Explores how the Lean programming language handles 2 + 2 = 4, which other programming languages collapse into a bool, but Lean considers a Proposition, and requires Proof.

How does provably correct programming look? This article seems to give a good introduction and example.

  • coherent_domain@infosec.pub
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    5 days ago

    The name “bool expression” is rather unfortunate, since it is usually reserved for “an expression of type Bool”. What is discribed here is really propositions, i.e. “Prop”.

    Prop is fundamentally different from Bool in Lean and all the language I know. For lean in particular, Prop is defined as a complete lattice, yet Bool is only inhabited by True and False (ignoring incomputable etc). More intuitively, Bool require all the true (or false) statements to be collapsed into a single value true (or false); yet for Prop, provable statements are not necessarily equal to each other.

    But I really enjoyed the analogy between expressions that returns bool in other languages and leans prop, seem like a great starting point for people.