Formal verification in Lean

 

tl;dr: A bunch of resources I hope to get to.

$ $

Cryptography

Software engineering in Lean

Rust (Non-Lean)

Logic

  • Propositional logic, $p \wedge \neg p$ type of thing; no quantifiers; no predicates
  • First-order logic, $\exists y, \forall x, P(x, y)$; quantifiers and predicates
  • Second-order logic, $\exists P, \forall x. P(x)$; more expressive than first-order logic (quantifies over predicates too)
  • Intuitionistic logic (constructive logic)
    • Does not assume the law of excluded middle (LEM): i.e., $p \lor \lnot p$ (a.k.a., $p$ or not $p$) is not an axiom; you must actually prove either “$p$” or “not $p$”
    • …nor double negation elimination (DNE): i.e., $\lnot\lnot p \to p$ is not an axiom
      • The converse, introduction, does hold: $p \to \lnot\lnot p$ is constructively provable
    • But… but! If you assume one, you can prove the other one is implied. e.g., assuming LEM, can prove constructively that DNE holds
      • In Lean, it so happens you tend to assume a particular flavor of the axiom of choice, which implies LEM, which implies DNE
  • Curry-Howard correspondence

Docs

Misc

Tutorials

Questions

Probability

How good is Lean at modeling probabilistic games in cryptography?

High-performance code

Need two things that are in tension:

  • high performance code
  • code that is provable against the spec

e.g., if the code is in (some subset of) Rust, we can translate it to Lean using Aeneas (see above). But not sure how well this works in practice. Also, not sure how much TCB this involves.

References

For cited works, see below 👇👇