Repolode
AxiomMath

AxiomMath/Stacks

A Lean 4 formalization of the Stacks Project, the open-source algebraic geometry reference, built on Mathlib with machine-checked proofs.

Stars
123
Forks
26
Open issues
7
Last commit
yesterday

What is it?

Stacks is a Lean 4 formalization of the Stacks Project, the open-source reference work on algebraic geometry. It is built on Mathlib and aims to formalize every tag of the Stacks Project that has formalizable content. Lean's kernel checks every proof, and the library contains no sorry or native_decide.

The library is split into two tiers: StacksCore holds human-reviewed formalizations brought to Mathlib naming and style standards, while StacksFrontier holds formalizations written by AI agents that are awaiting review before they move into the core. Each declaration carries a @[stacks TAG] attribute, and the #stacks_tags command lists every tagged declaration. Declarations are also linked to numbered items from Grothendieck's EGA and SGA.

Contributors can claim unformalized examples, exercises and remarks through a task board and a blueprint-based issue process. Building the full library requires a large amount of time and memory because it contains about 63,000 modules.

Key features

  • 01Formalizes Stacks Project tags in Lean 4 on top of Mathlib.
  • 02Every proof is kernel-checked, with no sorry or native_decide.
  • 03Each declaration is tagged with its Stacks tag and can be listed with #stacks_tags.
  • 04Links declarations to numbered EGA and SGA items.
  • 05Separates human-reviewed code (StacksCore) from AI-written code under review (StacksFrontier).

Use cases

  • Looking up the Lean formalization of a specific Stacks Project tag.
  • Studying algebraic geometry proofs with machine-checked dependencies.
  • Contributing formalizations of remaining examples or exercises.
  • Reusing verified algebraic geometry results in other Lean projects built on Mathlib.

Quick start

  1. 1

    Fetch Mathlib's precompiled files

    lake exe cache get
  2. 2

    Build the library (takes a long time and a lot of memory)

    lake build

Things to know

  • Full build is very slow and memory-intensive, since the library has about 63,000 modules.
  • Requires Lean 4 with Mathlib; a precompiled cache for Stacks modules is only planned.
  • StacksFrontier code is AI-written and still under review, so it may not yet meet Mathlib standards.
  • The Stacks Project it formalizes is licensed under GFDL, separate from the Apache 2.0 code license.

Topics

#lean#formal-verification#algebraic-geometry#mathlib#theorem-proving#mathematics

FAQ

What is Stacks?
A Lean 4 formalization of the Stacks Project, the open-source algebraic geometry reference, built on Mathlib with machine-checked proofs. Stacks is a Lean 4 formalization of the Stacks Project, the open-source reference work on algebraic geometry. It is built on Mathlib and aims to formalize every tag of the Stacks Project that has formalizable content. Lean's kernel checks every proof, and the library contains no sorry or native_decide.
Is Stacks free to use? What license does it have?
Stacks is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is Stacks still maintained?
Actively maintained. The last commit to Stacks was on Nov 6, 2026.
What can I use Stacks for?
Looking up the Lean formalization of a specific Stacks Project tag. Studying algebraic geometry proofs with machine-checked dependencies. Contributing formalizations of remaining examples or exercises. Reusing verified algebraic geometry results in other Lean projects built on Mathlib.
How do I install Stacks?
Fetch Mathlib's precompiled files: lake exe cache get Build the library (takes a long time and a lot of memory): lake build
Where can I get Stacks?
The source code and installation instructions are on GitHub: https://github.com/AxiomMath/Stacks

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects