Skip to content

Create a store with a narrower axiom policy

Initialize a store with an explicit axiom whitelist (such as constructive propext,Quot.sound or zero axioms), enforce it during kernel replay, and inspect each declaration's transitive axiom footprint.

In theorem proving, an axiom is a logical proposition assumed to be true without a proof. Lean 4’s standard library relies on three foundational mathematical axioms:

  • propext (propositional extensionality: two logically equivalent propositions P ↔ Q are equal P = Q),
  • Quot.sound (quotient soundness: elements related by an equivalence relation map to equal quotient values), and
  • Classical.choice (the law of the excluded middle and non-constructive choice).

By default, lema new and lema init configure a store to allow those three mathematical axioms and nothing else (Decision 0028). At the same time, every Lema store permanently enforces a fixed floor of forbidden escape hatches (sorryAx, Lean.ofReduceBool, Lean.ofReduceNat, Lean.trustCompiler, any _native axiom emitted by native_decide, and unsafe constants) that no policy can ever enable.

If your codebase requires strictly constructive proofs (excluding Classical.choice) or completely axiom-free proofs (--axioms ''), you can initialize a store with a narrower axiom policy or restrict allowed axioms on a project reference via require.axioms in lema.policy/v1.

Before you start

  • lema on your PATH, with the pinned Lean 4.34.1 checker configured in ~/.lema/runtime.json (Set up a machine for Lema).
  • A target store directory that does not exist yet (a store’s allowed_axioms policy is written to store.json at initialization and never mutated in place).

1. Initialize the store with --axioms

Pass a comma-separated list of axiom names (with no spaces) to lema init --axioms:

Shell
# Constructive store (allows propext and Quot.sound, forbids Classical.choice):
lema init --store ./constructive-store --axioms propext,Quot.sound

# Zero-axiom store (forbids all axioms):
lema init --store ./zero-axiom-store --axioms ''
Output
created store /home/you/constructive-store (namespace 4305157d7b8a…)

If anyone tries to pass a forbidden escape hatch below the fixed floor, lema init refuses immediately without creating the store:

Refusal on a banned axiom
lema: sorryAx is below the fixed floor; no policy allows it

2. Start the server and verify allowed_axioms

Start the background server for your new store and run lema info to confirm its active policy:

Shell
lema start --store ./constructive-store --socket ./constructive.sock
lema --socket ./constructive.sock info
Output
{
  "accepted": 0,
  "aliases": 0,
  "allowed_axioms": [
    "Quot.sound",
    "propext"
  ],
  "modules": 1,
  "namespace": "4305157d7b8a…",
  "native_call_budget": null,
  "native_calls_used": 1,
  "objects": 1,
  "tooling_sha256": "..."
}

3. Publish declarations and see how transitive footprints are checked

Whenever you publish .lema or .lean modules (or import a .lema.bundle checkpoint), the pinned Lean 4.34.1 kernel replays each declaration and computes its transitive axiom footprint across its entire dependency graph.

If a theorem you write uses no axioms directly, yet calls a standard library helper whose own proof used Classical.choice, the transitive footprint of your theorem includes Classical.choice. In ./constructive-store, the submission is refused before any object or receipt is written:

Output when a dependency uses a disallowed axiom
#9f21a408c3b2... depends on Classical.choice, outside the store's axiom policy

Keep in mind that several lemmas in Lean’s Init library (such as certain Decidable instances or classical byCases proofs) pull in Classical.choice transitively. When authoring for a constructive or zero-axiom store, stick to structural recursion and explicit boolean reflection (== true).

4. Inspect an accepted declaration’s axiom receipt (show)

Every accepted declaration, record, family, and external object carries a kernel receipt listing the exact axioms in its transitive closure.

When you run lema add in a terminal, the summary line shows the count (0 axioms). To see the exact receipt.axioms list for any object ID, run lema add --json or call show:

Shell
lema --socket ./constructive.sock call show --params '{"id": "<declaration_id>"}'
Output (excerpt)
{
  "receipt": {
    "axioms": [
      "propext"
    ]
  },
  "names": [
    "MyModule.my_theorem"
  ]
}

(Supporting objects such as standalone statement, template, proof, and satisfaction objects are checked through the declarations that reference them, so their own receipt field in show is null; inspect the enclosing declaration ID instead.)

5. Narrowing axiom rules on a project reference (require.axioms)

If you are working inside a lema.json project whose store allows the default three axioms (propext, Quot.sound, Classical.choice), you can still enforce a stricter axiom policy on a specific project reference (such as main or release) by setting require.axioms in its lema.policy/v1 record (Work with a Lema project):

policy.json (restricting main to constructive proofs)
{
  "version": 2,
  "previous": "<current_policy_id>",
  "publish": ["dev"],
  "adopt": ["dev"],
  "require": {
    "no_obligations": true,
    "axioms": ["propext", "Quot.sound"]
  }
}

Under that policy, lema commit refuses to advance main to any revision whose exported declarations or attached evidence depend on Classical.choice.

Lema v0.3.2 · Updated 29 October 2026 · Version and compatibility