The Agda Universal Algebra Library¶
A constructive formalization of universal algebra in dependent type theory β from signatures, algebras, and homomorphisms to a machine-checked proof of Birkhoff's variety theorem β written in literate Agda and type-checked on every commit.
Featured results¶
Landmark theorems of universal algebra, each formalized and type-checked here β follow a face to the proof.
What's formalized¶
The classical-structures layer builds the algebraic hierarchy on the universal-algebra core. Each row is a structure (follow it to its module); each column an equational axiom it satisfies.
| Structure | Assoc. | Comm. | Identity | Inverse | Idemp. | Absorp. | Distrib. |
|---|---|---|---|---|---|---|---|
| Magma | |||||||
| Semigroup | β | ||||||
| Comm. semigroup | β | β | |||||
| Monoid | β | β | |||||
| Comm. monoid | β | β | β | ||||
| Group | β | β | β | ||||
| Abelian group | β | β | β | β | |||
| Semilattice | β | β | β | ||||
| Lattice | β | β | β | ||||
| Distrib. lattice | β | β | β | β | |||
| Ring | β | β | β | β | β | ||
| Comm. ring | β | β | β | β | β |
Rings carry two operations; coral β marks an axiom of the additive group, plain β the shared/multiplicative axioms.
Explore¶
-
Quickstart
Clean checkout to green build in three commands with the pinned Nix toolchain.
-
The canonical library
Setoid/β algebras as setoids, every definition stated up to the carrier's equivalence. -
Classic Agda HTML
Prefer the bare agda-html view? The clickable, fully-highlighted source with
Everythingas index. -
Where it's going
The 3.0 reconstruction in milestones M1βM10 β classical structures, the Cubical track, corpus artifacts.
What is this?¶
agda-algebras is a library of universal algebra developed in
Agda, a dependently typed programming language and proof assistant. It
defines the core objects of the subject β signatures,
algebras, homomorphisms,
terms, subalgebras, and
varieties β together with the equational logic that
underlies them, and carries each construction all the way to a fully
constructive, machine-checked proof of Birkhoff's HSP theorem.
It is developed with two audiences in mind: as a working substrate for research
in universal algebra, and as a high-quality, vetted training corpus of Agda
proofs for machine learning on formal mathematics. Every page is rendered
directly from a literate .lagda.md source the type-checker reads β
the proof you read is the proof that compiles.
Reading the code
In code blocks, every Agda token is coloured by its role and links to its
definition β click a function, a Record, a
constructor to jump to where it is defined.
Press / to search any module; use the edit pencil to view a
page's source on GitHub.





