[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"9u7uczfALB":3},"# ECRuntime\n\n**Runtime analysis of evolutionary algorithms, machine-checked in Lean 4.**\n\nHow many evaluations does a `(1+1)` evolutionary algorithm need to optimize OneMax,\nLeadingOnes, or a linear function? The evolutionary-computation literature answers this\nwith delicate probabilistic arguments. ECRuntime rebuilds those arguments from first\nprinciples and has a proof assistant check every step.\n\n**547 Lean modules · Lean 4.32.1 / Mathlib v4.32.1 · Apache License 2.0**\n\n## Status\n\n- **Verified build.** The library passes the full verification gate (26 October 2026):\n  zero errors and warnings, and no declaration depends on `sorry` or a non-standard\n  axiom.\n- **Paper coverage.** Results from\n  [13 publications](docs/current/README.md#paper-by-paper-coverage) are audited against\n  their sources; no publication is claimed as completely formalized. The closest are\n  [Doerr and Doerr (2013)](docs/current/papers/doerr-doerr-2013.md), where both numbered\n  headline theorems have certified counterparts, and\n  [Böttcher, Doerr and Neumann (2010)](docs/current/papers/boettcher-doerr-neumann-2010.md),\n  with exact fixed-rate and adaptive LeadingOnes runtimes and the optimal rates. Each paper\n  has its own file in [`docs/current/papers/`](docs/current/papers/) listing what is\n  certified and what is missing.\n- **Open.** Not every merged statement has been reviewed against its paper, and the\n  merged theorems lack non-vacuity witnesses (see\n  [below](#how-the-claims-are-kept-honest)). What comes next is in\n  [`docs/roadmap/`](docs/roadmap/README.md).\n\n## Quick start\n\nInstall [elan](https://github.com/leanprover/elan), Lean's version manager. On the first\n`lake` command it reads `lean-toolchain` and installs the pinned Lean 4.32.1\nautomatically; you never install Lean by hand. Then:\n\n```bash\nlake exe cache get                               # pinned Mathlib build cache\nlake build                                       # the library and the regression suite\nlake env lean --run scripts/audit.lean strict    # axioms, doc comments, unused hypotheses, reachability\n```\n\nWith PowerShell 7, `pwsh -File scripts/verify.ps1 -Stage \u003Clabel>` runs the complete gate:\naudit, builds, zero diagnostics, dependency graphs and export.\n\n## Repository layout\n\n```text\nECRuntime/          the Lean library, one module per file\nECRuntimeTest/      regression suite: axiom audit, statement pins, non-vacuity witnesses\nscripts/            verification, audit and documentation tooling; scripts/hooks/ guards\n.claude/            Claude Code agents, skills and permission settings (see below)\ndocs/\n  current/          what holds today: checkpoint, coverage, one file per paper\n  history/          what was done: one file per research line\n  roadmap/          what comes next: priorities, target queue, one file per paper\n```\n\n## Architecture\n\nThe Lean sources live in [`ECRuntime/`](ECRuntime/), one module per file; the regression\nsuite is in [`ECRuntimeTest/`](ECRuntimeTest/). Theorems are layered from general to\nspecific:\n\n```text\nalgorithm-independent probability/runtime lemma\n        -> operator-specific transition/kernel facts\n        -> objective/potential-specific progress theorem\n        -> generic expectation/tail consequence\n        -> asymptotic/literature-facing corollary\n```\n\n[`docs/current/graphs/architecture.mmd`](docs/current/graphs/architecture.mmd) shows the\nmodule families and how many proof dependencies run between them;\n[`modules.mmd`](docs/current/graphs/modules.mmd) shows all modules. Both are generated\nfrom the compiled library, so an edge means a proof actually uses the target. For one\nmodule's neighbourhood:\n\n```bash\nlake env lean --run scripts/audit.lean graph --module \u003Cname>\n```\n\n## How the claims are kept honest\n\nCompilation is necessary but does not by itself establish absence of added axioms,\nnon-vacuity, or faithful paper-level coverage. The regression suite and the audit check\nwhat a passing build does not:\n\n| Check | What it catches |\n|---|---|\n| **Axiom / source-hygiene audit** | `scripts/audit.lean` checks every declaration for transitive admitted or non-standard-axiom dependencies, doc comments and unused signature hypotheses, and every module for reachability from the 153 public facades (6 original, 147 merged). |\n| **Statement pins** | The original theorem statements and every theorem cited in `docs/current/papers/` are frozen, together with their axiom sets; the remaining merged declarations are not yet pinned. |\n| **Non-vacuity witnesses** | Concrete instances discharge the hypotheses of the original facades and three merged results; this is not a universal automatic non-vacuity proof. The merged theorems cited in `docs/current/papers/` have no witnesses yet. |\n\nReachability is measured from an explicit, maintained set of 153 public facades rather\nthan from the umbrella root. The pre-existing `LevelChargeExactResidence`\ngrandfathered-orphan warning is retained; any newly disconnected module is an error.\nWarnings count as failures. The gate tables of every verification run are in\n[`docs/history/repository.md`](docs/history/repository.md).\n\n**Not every formulation has been reviewed.** A proof checks that a statement holds, not\nthat the statement says what the paper says; that takes a human reading it. The doc\ncomments of 52 merged modules record that their statement was unapproved or only\nproposed when written, and no later approval is recorded on `main`. 18 of them are\npublic facades, and two are cited in `docs/current/papers/` as paper evidence:\n`RLSAllDimensionPaperCenteredExact` (P02a) and `RLSStrictMonotoneFixedTargetExact`\n(P07). Treat those results as proved but not yet confirmed to match their source.\n\n## What this does *not* claim\n\nSee [Scope and limits](docs/current/README.md#scope-and-limits) in `docs/current/`.\n\n## Contributing, license and citation\n\nContributions are welcome through pull requests from forks, in exactly two modes:\n**proposing a paper** for the roadmap, or **implementing** results of a roadmap paper in\nLean, where every new theorem starts as a statement proposal that a maintainer approves\nbefore any proof is written. Problems are reported in issues. The maintainers curate the\nrepository and alone merge into `main`. See\n[`CONTRIBUTING.md`](CONTRIBUTING.md) and [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).\n\nECRuntime is licensed under the [Apache License 2.0](LICENSE). To cite it, use\n[`CITATION.cff`](CITATION.cff); contributors are listed in\n[`CONTRIBUTORS.md`](CONTRIBUTORS.md).\n\n## AI agents and skills\n\n> [!WARNING]\n> **Use the agents and skills at your own risk.** They drive an AI model through\n> [Claude Code](https://claude.com/claude-code). They can propose a statement that does not\n> match its paper, a proof that compiles for the wrong reason, or documentation that\n> claims more than is proved. Nothing is certified because an agent produced it: every\n> statement must pass a human statement gate, and every result a human promotion gate and\n> the full verification gate. The configuration is provided as is, without warranty\n> (Apache License 2.0, sections 7 and 8). You are responsible for every change you accept.\n\nThe repository versions the Claude Code setup the maintainers use. It needs Claude Code,\nand PowerShell 7 for the guard hooks.\n\n**Safeguards.** [`CLAUDE.md`](CLAUDE.md) and [`SOUL.md`](SOUL.md) hold the binding rules:\nnothing is published, sent, pushed or downloaded on an agent's initiative, and no statement\nis weakened to make a proof go through. [`.claude/settings.json`](.claude/settings.json)\ndenies network and publishing tools and makes you approve **every** file change and every\ncommand (`Edit`, `Write`, `NotebookEdit`, `Bash`, `PowerShell`). The hooks in\n[`scripts/hooks/`](scripts/hooks/) block outbound commands and refuse `sorry`, `axiom`,\n`native_decide`, `unsafe` and `maxHeartbeats` in `ECRuntime/`.\n\n**Agents** ([`.claude/agents/`](.claude/agents/)) change no files; they return text, which a\nskill applies after your approval.\n\n| Agent | Role | Tools |\n|---|---|---|\n| `lean-architect` | Lean statements (never proofs); feasibility of a roadmap paper | read-only |\n| `lean-prover` | proofs for approved statements, as exact edits | read-only + `Bash` for the toolchain |\n| `lean-auditor` | adversarial review: axioms, faithfulness, vacuity, approval, scope | read-only + `Bash`, read-only commands |\n| `lean-scribe` | documentation drafts: history, current state, roadmap, credits | read-only |\n\n**Skills** ([`.claude/skills/`](.claude/skills/)) follow the two\n[contribution modes](CONTRIBUTING.md#two-ways-to-contribute); ▲ marks a human decision:\n\n```text\nMode 1 — a paper for the roadmap\n  author:  /propose-paper   paper text from you -> paper file + feasibility\n                            -> frontier.toml target -> ▲ roadmap acceptance\n  review:  /review-paper-proposal   contributor's branch -> scope, quotes, duplicates\n                            -> ▲ accept / request changes / decline -> draft comment\n\nMode 2 — an implementation in Lean\n  author:  /stage           target -> statements -> ▲ statement gate (approval recorded)\n                            -> proofs -> audit -> pins -> docs -> verify.ps1\n                            -> ▲ promotion gate\n  review:  /review-statement        issue text -> elaboration, faithfulness, hypotheses\n                            -> ▲ statement gate -> draft reply\n           /review-implementation   contributor's branch -> exact statements, scope,\n                            audit, full gate -> ▲ promotion gate -> docs, stage, credit\n\nAny time:  /lean-validate \u003Cfile>    one module: elaboration, axioms, docs, reachability\n```\n\nThe skills never post, push, merge or fetch: review comments and issue replies are drafted\nas text, and publishing stays with the maintainers.\n\n## Documentation\n\n| File | What it holds |\n|---|---|\n| [`CONTRIBUTING.md`](CONTRIBUTING.md) | The two contribution modes, step by step, and what CI and review check. |\n| [`DEVELOPMENT.md`](DEVELOPMENT.md) | Invariant workflow rules: promotion criterion, proof architecture, verification runners, export discipline. |\n| [`CLAUDE.md`](CLAUDE.md), [`SOUL.md`](SOUL.md) | Working rules and standing principles for the AI agents. |\n| [`docs/README.md`](docs/README.md) | Map of the documentation. |\n| [`docs/current/`](docs/current/README.md) | What holds today: checkpoint, status vocabulary, coverage table, one file per paper, generated facade index and dependency graphs. |\n| [`docs/history/`](docs/history/README.md) | What was done: one file per research line, a generated chronological index, and the frozen Stage-79 documents in `archive/`. |\n| [`docs/roadmap/`](docs/roadmap/README.md) | What comes next: priorities, the `frontier.toml` queue, and one file per candidate paper. |\n",1793473263032]