A Lean library for verified programming and complexity analysis, built on mathlib.
Our goal is to write a program once and prove both its correctness and complexity using ordinary mathematical reasoning. Verified compilation connects these proofs to execution, while reusable interfaces handle machine details.
The library provides an independently interpreted source language, a verified word-RAM backend, and tools for asymptotic, recurrence and amortized analysis. Source programs have mathematical proof views and contracts for shared arrays, linked lists and scoped storage. Correctness and termination are separate from resource bounds, which concern the same compiled implementation.
The high-level interface is still under development. It does not compile arbitrary Lean programs or infer algorithmic invariants. The roadmap distinguishes checked capabilities from open work.
Complexity/Language/: source semantics, data contracts and frontend.Complexity/Program/: mathematical input/output and resource interfaces.Complexity/Computability/Ram/: machine model and verified compiler.Complexity/Analysis/andComplexity/Computability/Recurrence/: reusable mathematics.Examples/anddocs/ComplexityDocs/: checked consumers and the doc-gen4 manual.
Use focused imports when developing library code. The module guide explains the frontend passes and dependency boundaries.
This repository was generated by GPT-6 Astra.