Announcement · 5 December 2026

# Introducing *LeanBio:* machine-checked math for biology.

[LeanBio](https://github.com/fractastical/leanbio) is an open Apache 2.0 library of biology laws checked line by line in Lean 4. It follows [Physlib](https://github.com/leanprover-community/physlib)'s layout and shares its exact Lean and Mathlib version, so results can move between physics and biology without a rewrite. Right now the registry holds 80 laws across 33 modules — every one pinned to a hash, and every missing data test shown out in the open.

Project Delphi · Counts computed from `docs/laws/graph.json` and `lean/registry/` (law set 1.8.1) by `scripts/site/build-blog-leanbio.mjs` · [HTML](introducing-leanbio.html) · [GitHub](https://github.com/fractastical/leanbio) · [Laws explorer](https://delphibio.org/laws/)

![LeanBio overview card](introducing-leanbio-card.png)

## 01 — Why put biology in a proof assistant?

Biology is full of math rules — how shells spiral, how wings glide, how pine cones curl, how genes spread, and how cell voltages hold a pattern. Most of those rules live in PDFs, where hidden assumptions are easy to miss.

In [Lean 4](https://lean-lang.org/), every step of a proof is checked by a small software kernel. If a theorem compiles with no `sorry` and only Lean's standard axioms (`propext`, `Classical.choice`, `Quot.sound`), the math really does follow from the stated assumptions — no skipped algebra, no silent sign error.

> **What a proof does — and does not — prove:** a proof in LeanBio shows that a conclusion follows from a named model. It never proves that living cells or animals obey that model. That is an empirical question, checked separately by real data tests.

That split is why every module header in `lean/Delphi/` lists which assumptions sit inside the proof and which are left outside, and why `lean/Delphi/Audit.lean` prints the axioms of every headline theorem.

## 02 — Built to sit beside Mathlib and Physlib

Mathematics has [Mathlib](https://github.com/leanprover-community/mathlib4). Physics has [Physlib](https://github.com/leanprover-community/physlib). Biology did not have a shared, Apache-licensed home built to the same standard.

We designed LeanBio so it can plug directly into that ecosystem instead of starting an island:

- **Same toolchain and Mathlib pin (`v4.35.0`):** a physics result in Physlib and a biomechanics or bioelectricity result in LeanBio compile on the same version and can share code without porting.
- **Apache 2.0 license:** permissive enough for academic labs, open-source projects, and Mathlib/Physlib upstreaming without relicensing friction.
- **Clear AI rules (`AI-POLICY.md`):** AI tools are welcome to help draft proofs, because Lean's kernel checks the logic — but human review still decides whether the formal statement actually matches the biology.
- **Versioned lifecycle, never silent deletion:** every law has its own JSON file in `lean/registry/` pinned to a module path and a statement hash. Laws move through `proposed → candidate → accepted → contested → retired`. A flawed law is retired with a record, never erased.

## 03 — What is inside right now

- **80** registered laws (law set 1.8.1: 48 biological, 32 physical)
- **33** Lean 4 modules in `lean/Delphi/`
- **69** engineering constraints across 43 laws
- **36** human-accepted laws (32 candidates)

| Registry class | Count | What it means |
|---|---:|---|
| `theorem` | **38** | Proved directly in Lean 4 from stated definitions |
| `theorem-from-hypothesis` | **21** | Proved in Lean 4 given an explicit named biological model |
| `empirical-observation` | **11** | Measured pattern recorded in the registry (not a proof) |
| `gap` | **6** | Known open area with no Lean proof yet |
| `named-hypothesis` | **2** | Named scientific hypothesis tracked for formalization |
| `convention` | **2** | Unit or modeling convention shared across laws |

A few concrete examples already checked in Lean 4:

- **Cell packing & crystals:** any closed 3-way mesh of pentagons and hexagons has `S.pentagons = 12` (D'Arcy Thompson); a periodic crystal lattice can only have 1-, 2-, 3-, 4-, or 6-fold rotational symmetry.
- **Evolution & genetics:** Maynard Smith's twofold cost of sex (`odds (asexualNext q f) = 2 * odds q`), Fisher's fundamental theorem, Kimura's neutral substitution rate, and Wright-Fisher fixation probability.
- **Morphogenesis & biomechanics:** Turing diffusion-driven instability, plant phyllotaxis Fibonacci pairs (`34/89`), gliding range bounds, elastic scaling, and Timoshenko's bending-strip limits.
- **Bioelectricity:** bistable membrane-voltage memory (`BioelectricMemory`) and, in open PRs, passive gap-junction cell networks and leaky integrate-and-fire neuron bounds.

## 04 — Elimination certificates: catching impossible designs fast

Proving a biology equation is useful on its own. Proving an **elimination certificate** — a theorem named `*_rules_out` whose conclusion is `False` — lets a computer reject an impossible engineered design before running a single expensive simulation.

Last month we tested our bending plant-strip law (`bilayer-curvature`) against 25 finite-element simulations in CalculiX. Thin strips matched the formula within **0.0015%**, and when given an impossible bending target (`0.002` vs ceiling `0.0015`), the Lean checker refused it in **0.112 ms** with **0 simulator runs**. Even better, when CalculiX widened the strip, it curled **1.300×** higher — catching an unstated thin-strip assumption. We bumped `bilayer-curvature` to `1.1.0` with an explicit thin-strip scope and proved a second law, `bilayer-curvature-wide-strip`, for wide sheets.

That loop — *proof catches bad design; simulator catches missing assumption; both get sharper* — is what LeanBio is built for.

## 05 — Empty slots stay visible

Because a math proof never checks whether real organisms satisfy its assumptions, [delphibio.org/laws/](https://delphibio.org/laws/) joins LeanBio's registry to the Delphi claim graph, pre-registered data tests, species datasets, images, and Uberon anatomy IDs:

| Connected to | Laws | Still empty |
|---|---:|---:|
| Literature claims | **32** | 48 |
| Pre-registered data tests | **18** | 62 |
| Resolved animal taxa | **14** | 66 |
| Attached images / plates | **13** | 67 |
| Uberon anatomy parts | **9** | 71 |

In `lean/morphology-grounding.json`, theorems reach 106 of 110 blueprint parts (4 untouched). On the laws page, every missing claim, data test, or image shows up as an empty slot — because an honest gap is a clear place for the next contributor to start.

## 06 — Try it, contribute, and what comes next

```bash
git clone https://github.com/fractastical/leanbio.git
cd leanbio
lake build
```

Read [`CONTRIBUTING.md`](https://github.com/fractastical/leanbio/blob/main/CONTRIBUTING.md) and [`AI-POLICY.md`](https://github.com/fractastical/leanbio/blob/main/AI-POLICY.md) before opening a pull request. Every new law needs a clean Lean 4 proof (zero `sorry`, standard axioms), a deliberately broken variant that fails to compile, and a registry entry.

*In progress · not done yet:*

1. **Make LeanBio the single upstream source for Delphi:** switch `lib/lean-source.mjs` from the in-tree mirror to a pinned `leanbio` commit and update the README badge to the next law set (`1.9.0`).
2. **Review and merge the open LeanBio pull requests:** bioelectric bistable elimination constraints (`BM1–BM3`, [#14](https://github.com/fractastical/leanbio/pull/14)), passive gap-junction cell networks (`RC1–RC3`, [#15](https://github.com/fractastical/leanbio/pull/15)), leaky integrate-and-fire neuron bounds (`NE1–NE3`, [#16](https://github.com/fractastical/leanbio/pull/16)), and the 3D PhysiCell spheroid replay checker ([#17](https://github.com/fractastical/leanbio/pull/17)).
3. **Connect community Lean biology libraries** like Ptyche and `lean4-phylogenetics` as Lake dependencies ([leanbio#4](https://github.com/fractastical/leanbio/issues/4)) and harden registry witnesses ([leanbio#3](https://github.com/fractastical/leanbio/issues/3)).
4. **Fill the empty slots:** link the 48 unlinked laws to literature claims and pre-register data tests for the 62 untested laws on [delphibio.org/laws/](https://delphibio.org/laws/).

---

Built automatically from repository files by `node scripts/site/build-blog-leanbio.mjs` (law set 1.8.1; 80 laws). LeanBio repository: [github.com/fractastical/leanbio](https://github.com/fractastical/leanbio) (Apache 2.0).
