← All papers
First page of A Machine-Checked Itô Calculus for Brownian Motion

A Machine-Checked Itô Calculus for Brownian Motion

Raphael Coelho

q-fin.MF Jun 13, 2026 · v2 math.PR
Formalizes the Itô integral, Itô's formula, and the continuous local martingale property in Lean 4, building on Mathlib and the BrownianMotion package.
We develop the Itô calculus of Brownian motion, machine-checked in Lean 4 over Mathlib and the \lean{BrownianMotion} package. On a bounded interval $[0,T]$ the Itô integral is built as a Hilbert-space isometry, from a predictable-rectangle $π$-system through the density of simple adapted processes. Realized as a process, it is a continuous $L^2$ martingale. One structural identity drives this: the integral at time $t$ is the conditional-expectation projection of its terminal value onto $\F_t$, and from it adaptedness, the martingale property, the contraction bound, and both the terminal and time-indexed Itô isometries follow as corollaries. On this integral we prove Itô's formula for $C^3$ functions with bounded derivatives, including the time-dependent form $df = f_x\,dB + (f_t + \tfrac12 f_{xx})\,dt$, by a discrete-to-continuous argument through weighted quadratic variation with explicit $L^2$ remainder bounds. We then pass from the $L^2$ theory to the pathwise. The integral process has an almost-surely continuous modification, and its everywhere-continuous representative is a local martingale for the null-augmented Brownian filtration; gluing the bounded-horizon representatives along the half-line yields the Itô integral as a continuous local martingale on all of $\R_{\ge 0}$, the form it takes in the classical theory. To our knowledge these are the first machine-checked constructions of the Itô integral and of Itô's formula in any proof assistant, and the first to reach a pathwise-continuous local martingale. The boundary is explicit. The $L^2$ integral and Itô's formula are developed on $[0,T]$ with bounded-derivative integrands; the unrestricted $C^2$ formula, integrators beyond brownian motion, and right-continuity of the filtration lie outside the development.

Stochastic calculus had not been machine-checked in any proof assistant. Neither the Itô integral nor Itô's formula had a formal construction, although Brownian motion itself had recently been constructed in Lean 4.

The Itô integral on [0,T] is built as a continuous linear isometry. Its domain is the L^2 space of a product measure trimmed to the predictable sigma-algebra, using a predictable-rectangle pi-system and density of simple adapted processes. A conditional-expectation projection identity yields adaptedness, the martingale property and the time-indexed isometries. Itô's formula is proved by a discrete-to-continuous argument: a discrete Taylor identity, weighted quadratic variation in L^2, O(1/n) remainder bounds, and Riemann bridge lemmas.

The Lean development proves Itô's formula, including its time-dependent form, for C^3 functions with bounded derivatives. It obtains a continuous modification of the integral process and glues bounded-horizon representatives into a continuous local martingale on the half-line. The authors state these are the first machine-checked Itô integral and Itô formula; the unrestricted C^2 case and general integrators remain out of scope.