Skip to content

About

Verified programs, certified complexity

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Complexity

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.

Documentation

Library organization

  • 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/ and Complexity/Computability/Recurrence/: reusable mathematics.
  • Examples/ and docs/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.

AIGC

This repository was generated by GPT-6 Astra.

License

Apache 2.0.

About

Verified programs, certified complexity

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages