A Formally Verified Library of Mathematical Finance in Lean 4
Raphael Coelho
q-fin.MF
May 31, 2026 · v3
q-fin.CP
TL;DR
Builds a Lean 4 library of mathematical finance on Mathlib and BrownianMotion, with a build-enforced axiom audit for faithfulness.
Abstract
We describe a library of mathematical finance built in the Lean 4 proof assistant, on top of Mathlib and the BrownianMotion package. It is broad: more than three hundred sorry-free theorems across eleven areas, from the measure-theoretic foundations of continuous-time stochastic calculus through derivative pricing to applied risk, portfolio, and fixed-income theory. To our knowledge it is the most comprehensive machine-checked development of mathematical finance to date. Two things make it more than a catalogue. It reaches into the continuous theory far enough to construct the $L^2$ Itô integral as a bounded linear isometry and to derive, rather than assume, the risk-neutral pricing measure. And it audits its own faithfulness: every result is classified by how its Lean statement relates to the mathematics it claims, and a build-enforced gate pins the axioms each proof actually uses, so a reader can see precisely what has been proved and what has only been proved under added hypotheses. We close with a finding: a formal base over classical financial mathematics yields certified unification of known results rather than new financial theory. The contribution is therefore methodological and infrastructural (reusable verified foundations for mathematical finance, together with the faithfulness audit above), not a new financial result.
Problem
Mathematical finance has barely been formalized. Prior work covers single models or single derivations, and none offers a way to state how faithful a formal statement is to the mathematics it claims.
Approach
A Lean 4 library on top of Mathlib and the BrownianMotion package spans eleven areas, from stochastic calculus foundations to derivative pricing, portfolio theory, fixed income and risk. Results are derived from a few shared principles, such as a non-negative linear no-arbitrage pricing functional. The library constructs the continuous L^2 Itô integral as a bounded linear isometry. It also derives the risk-neutral measure via a static Girsanov/Esscher change of measure rather than assuming it. Each theorem is classified into one of four faithfulness tiers (full, library_wrapper, reduced_core, placeholder), and an AxiomAudit file pins the #print axioms output for load-bearing theorems.
Results
Of 251 benchmark theorems, 223 are delivery-claim-ready (204 full, 19 library wrappers) and 28 are reduced_core; there are no placeholders. Verified results include the identity ∫B dB = ½(B_T² − B_0² − T), the Black–Scholes formula under the physical measure, and the binomial-to-Black–Scholes scaling limit.
| tier | count |
|---|
| full | 204 |
| library_wrapper | 19 |
| reduced_core | 28 |
| placeholder | 0 |
Faithfulness classification of the 251 benchmark theorems