cslib-frontier Operator's Manual
This is the substantial manual for humans or agents using, changing and reviewing the cslib-frontier codebase. It explains models, tactics, proof interfaces, design and development procedures. It assumes basic Lean literacy; a human should be able to follow the workflows with a text editor, Git, Python and Lake. AI tools are optional.
The separate Agent Operator's Manual is a short guide for the human driving agents: choosing roles, assigning work, requesting review, handing off and intervening. Use that manual to direct a session, and this manual for the codebase operations performed within it.
Start with getting a checkout and checking a complete client. The first contribution exercise leads from an isolated branch through a successful check, an expected failure, its repair, and a reviewable handoff. Choose a model before stating a resource bound: the encoding and cost convention are part of the theorem.
| Task | Route |
|---|---|
| Build, inspect and change a first client | Get started |
| Use the library in another Lean project | Add a pinned dependency |
| State a model and resource contract | Choose a model |
| Compose deterministic certificates or prove P/NP membership | Deterministic workflows |
| Write randomized or oracle programs and prove efficiency | Probabilistic workflows |
| Locate a theorem and check its assumptions | Find results |
| Understand a failed proof or build | Troubleshoot |
| Prepare, validate and review a change | Contribute and review |
| Look up a command or term | Commands and vocabulary |
| Coordinate implementation and review | Participant and reviewer procedures |
| Direct agents as their human operator | Agent Operator's Manual |
Library map#
The reference chapters and model map are frozen snapshots from November 2026. For current declarations, search the API reference or open the Lean source. The results inventory lists selected theorems and their sources. The guide walks through checked examples, and the codebase views show how the modules depend on each other and how the library has grown.
| Source directory | Chapters and examples |
|---|---|
Computability/ | Machines and complexity classes and circuits. Examples cover polynomial time, time classes, NP-completeness and uniform circuits. |
Algorithms/ | Algorithms, memory and data structures, including a worked Dijkstra example. |
DataStructure/ | Dictionaries and hashing, the Count-Min sketch and its accuracy bound. |
Crypto/ | Cryptography, with examples of probabilistic polynomial-time programs and oracle reductions. |
Languages/, Probability/ | Probabilistic programs and their semantics. The SQL semantics has join-size examples. |
Privacy/ | Differential privacy. |
Logics/ | Proof complexity and finite-model logic, with fixed-point and transitive-closure examples and Immerman–Vardi. |
MachineLearning/ | Learning and property testing. |
GameTheory/ | Strategic games and mechanism design. |
Tactic/ | Proof automation. |
Foundations/ | General mathematics used by the other areas, including combinatorics, Boolean analysis and number theory. |
The deterministic polynomial-time examples build on Christian Reitwiessner's tidy machine calculus. The Clique proof uses graph complementation to reduce Independent Set to Clique. The reduction index points to more NP-completeness proofs.
Maintain the procedure pages and registries#
Under the contribution policy, a change to a procedure or role updates the page that describes it, and a change to a fact recorded in a registry updates the registry. Nothing else in a PR requires a manual edit. Read the maintenance procedure for what to inspect and how to validate it.
python3 scripts/check_operator_manual.py
python3 scripts/test_operator_manual.py
Run these commands from the repository root. The first checks local links, visual markup, the book's chapter lists and the identity of contextual Lean excerpts against the current source (in frozen chapters, only their own markup and the links between them); the second exercises failure cases of that checker. Neither compiles Lean or establishes that the prose describes the right mathematics. Check affected complete clients through Lake as the workflows describe.
Read or build the manuals#
Markdown is canonical and readable directly in the checkout. To generate the editable LaTeX source and PDF for each manual:
python3 scripts/build_operator_manual.py
python3 scripts/build_operator_manual.py --agent-manual
The build instructions list optional publishing tools and output locations.
Book products live under ignored manual/_build/; optional research exports use
manual/_generated/. Neither is maintained by hand.
History#
The History part keeps the dated record from the complexitylib period: the 2 November 2026 source survey from which the reference chapters grew, and the study of the library's automated development. Its measurements stay fixed to their stated revision; they explain earlier decisions but do not describe the current library.