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, 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.
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.
Built to sit beside Mathlib and Physlib
Mathematics has Mathlib. Physics has 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 throughproposed → candidate → accepted → contested → retired. A flawed law is retired with a record, never erased.
What is inside right now
lean/Delphi/Across the registry, 48 laws are biological and 32 are physical. Every entry is also labelled by what kind of statement it is, so a proved theorem is never confused with a field observation or a known gap:
| 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.
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.
Empty slots stay visible
Because a math proof never checks whether real organisms satisfy its assumptions, delphibio.org/laws/ joins LeanBio's registry to the Delphi claim graph, pre-registered data tests, species datasets, images, and Uberon anatomy IDs. Here is how much of that bridge exists today:
| 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 our anatomy grounding file (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.
Try it, contribute, and what comes next
git clone https://github.com/fractastical/leanbio.git
cd leanbio
lake build
Read CONTRIBUTING.md and 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.
- Make LeanBio the single upstream source for Delphi. Today this repo's loader (
lib/lean-source.mjs) still reads an in-tree mirror; switching it to a pinnedleanbiocommit and syncing the README badge from1.6.0to the next law set (1.9.0) is next.lib/lean-source.mjs·lean/registry/lawsets/ - Review and merge the five open LeanBio pull requests: bioelectric bistable elimination constraints (
BM1–BM3, #14), passive gap-junction cell networks (RC1–RC3, #15), leaky integrate-and-fire neuron bounds (NE1–NE3, #16), and the 3D PhysiCell spheroid replay checker (#17).fractastical/leanbio - Connect community Lean biology libraries like Ptyche (protein folding) and
lean4-phylogeneticsas Lake dependencies, and harden registry witnesses. leanbio#4 · leanbio#3 - Fill the empty slots: link the 48 unlinked laws to literature claims and pre-register data tests for the 62 untested laws. delphibio.org/laws/
Built automatically from repository files by node scripts/site/build-blog-leanbio.mjs (law set 1.8.1; 80 laws). Also in Markdown. LeanBio repository: github.com/fractastical/leanbio (Apache 2.0).