Skip to main content

The CLI

The package provides the theformalera command and the Python annotation SDK (import theformalera as tfe). It needs Python 3.10 or newer and runs on Linux and macOS. A CI runner that sends work to the cloud solver needs only theformalera[triton]. A runner that solves locally needs theformalera[triton,engine].
Annotations are no-ops at runtime. Your inference code can import theformalera in production without pulling in Triton, Lean or the engine.

Lean 4

theformalera pull builds each spec package as a Lean 4 (Lake) workspace, and local verification checks every proof with the Lean kernel. Install Lean with elan:
The CLI looks for lake on your PATH and then in ~/.elan/bin. The toolchain version comes from each spec package (leanprover/lean4:v4.35.0 today), and elan installs it on first use.
The first pull downloads Mathlib’s prebuilt cache (several GB). Set THEFORMALERA_MATHLIB to an existing Lake workspace that already has Mathlib built, and every spec workspace reuses it instead.
You can skip Lean when you use --runner cloud: proofs are checked in the cloud, and theformalera pull --no-build skips the local build. You still need Lean to re-check proofs yourself.

Log in to Spec Hub

The token is stored in ~/.config/theformalera/credentials.json (mode 0600). In CI, set THEFORMALERA_TOKEN instead. Public specs and the public lemma library can be read without a token; cloud verification and the org lemma library need one.

Check the install

Without the engine extra, the second part reads theformalera engine (remote).

Developing The Formal Era itself

The source repository is a uv workspace with four packages, the Lean library and the AWS app: