The Vermilion Experiment: Implementing a Lean Backend for Verus

In this post, we discuss Vermilion, an experimental Lean backend for the Verus verifier for Rust, bringing interactive proofs and Lean’s mathematical libraries to programs with ordinary Verus specifications.

The Rust examples and Lean proofs in this post, together with instructions for checking them, are collected in the open source repository.

What a Program Verifier Does

A program verifier connects two descriptions of the same computation: a program, which tells the machine how to calculate the result, and a specification, which says what the result should satisfy. For example, a sorting function’s specification might require that the output is ordered and contains exactly the elements of the input. The specification leaves open the choice of the exact algorithm to do so.