Reasoning about the Genetic Code in Lean
Colin T. Jones, Tyler R. Josephson
Key points
From the paper's conclusion- Finally, we demonstrate how Lean 4 helps prevent semantic errors in our code, showing its effectiveness as a tool for advancing reliable, bug-free scientific computing, particularly within the life sciences.
Abstract
The genetic code exhibits redundancy, meaning that multiple distinct nucleotide sequences can encode the same amino acid sequence, a property mathematically characterized as non-injectivity. While this phenomenon is well studied in molecular biology, its rigorous verification within a computational framework remains limited. In this work, we present a machine-verified model of the central dogma of molecular biology using the Lean 4 interactive theorem prover. We formalize nucleic acid bases and amino acids as inductive types and define transcription and translation as functions mapping DNA sequences to RNA and subsequently to polypeptides. Within this framework, we prove key properties of these biological processes, including the redundancy of the genetic code, injectivity of transcription, and the non-injectivity of translation. Additionally, we formalize auxiliary processes such as DNA replication and mutation, and verify properties such as length conservation under transcription and point mutations. Finally, we demonstrate how Lean 4 helps prevent semantic errors in our code, showing its effectiveness as a tool for advancing reliable, bug-free scientific computing, particularly within the life sciences.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- SemantEq: Faithful Bidirectional Equivalence of Formal StatementsarXiv · 2026
- Typed Knowledge over Constructive Institutions: A Proof-Relevant Type Theory for Verified SciencearXiv · 2026
- Hashing Theorems Modulo Rewrites and Binder Permutation Enables Equivalence Search over 200k Mathlib TheoremsarXiv · 2026
- Agentic Verified Optimization of Real-World SoftwarearXiv · 2026
- Improving semantic equivalence in research-level math formalizationarXiv · 2026
- Hereditary permutations for simple types revisited: A baby case for University AlgebraarXiv · 2026