lean-axiom-provenance

lean-axiom-provenance is a skill for Claude Code from vince-gonzalez/gonzalgo. It costs 203 tokens per session (2,579 once invoked), scanned A, original, Apache-2.0.

A checker for Lean 4, a programming language used to write machine-checked mathematical proofs, that traces where the project's assumptions come from.

In plain words
What is it for?
Use it to inspect a whole Lean project's theorem dependencies, distinguish statement assumptions from proof assumptions, and find the shortest route from a declaration to an axiom.
Why use it?
It shows whether theorems depend on inherited gaps, special computation shortcuts, or particular assumptions, instead of giving only a final list.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the lean-axiom-provenance plugin — 2 skills, 2 commands, 1 MCP server shipped together

Good fit Use it to inspect a whole Lean project's theorem dependencies, distinguish statement assumptions from proof assumptions, and find the shortest route from a declaration to an axiom.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vince-gonzalez/gonzalgo/lean-axiom-provenance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add vince-gonzalez/gonzalgo --skill lean-axiom-provenance
Clone the repo
git clone --depth 1 https://github.com/vince-gonzalez/gonzalgo

Made for: Claude Code.

Or install lean-axiom-provenance, the plugin that ships this one along with the rest of its 2 skills, 2 commands, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lean-axiom-provenance

README.md
[![agentmods](https://agentmods.dev/badge/skills/vince-gonzalez/gonzalgo/lean-axiom-provenance/github.svg)](https://agentmods.dev/skills/vince-gonzalez/gonzalgo/lean-axiom-provenance)
Your own site
<a href="https://agentmods.dev/skills/vince-gonzalez/gonzalgo/lean-axiom-provenance"><img src="https://agentmods.dev/badge/skills/vince-gonzalez/gonzalgo/lean-axiom-provenance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lean-axiom-provenance

Your own site · 80×15
<a href="https://agentmods.dev/skills/vince-gonzalez/gonzalgo/lean-axiom-provenance"><img src="https://agentmods.dev/badge/skills/vince-gonzalez/gonzalgo/lean-axiom-provenance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 203 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,579 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00203 $0.02579
Opus 5 $0.00102 $0.01290
Sonnet 5 $0.00041 $0.00516
Haiku 4.5 $0.00020 $0.00258

Measured 12d ago against content hash a2a4492e035d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

lean-axiom-provenance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/lean-axiom-provenance/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lean axiom provenance

#print axioms tells you a theorem depends on Classical.choice. It does not tell you which step introduced it, whether the theorem's own statement required it, or whether a constructive route exists. This skill answers those, over a whole environment rather than one declaration at a time.

The tool produces facts. Reading them without overclaiming is the hard part and most of this file is about that.

Setup

pip install gonzalgo

Analysis runs against a dump: a declaration graph written out of a built Lean environment. Generate it once, then ask it many questions.

gonzalgo lean-files ./scripts      # writes the Lean extractors
cd my-lean-project
lake build                         # the environment must already be built
lake env lean scripts/Split.lean   # -> mathlib_split.tsv
gonzalgo check mathlib_split.tsv   # verify it contains proof terms

Run check and do not skip it. ConstantInfo.value? returns none for theorems unless it is passed allowOpaque := true. An extractor written the obvious way silently reads every theorem's proof as empty, and then every statement-versus-proof figure is not imprecise, it is measuring statements and labelling them proofs. check is what catches that.

A dump of Mathlib takes about three minutes and roughly 600 MB. For a small project it is seconds.

If the environment is large, lake env lean needs -D maxErrors=4000 on the command line. set_option maxErrors inside a file is ignored, and without the flag Lean stops at 100 errors long before the last declaration.

The questions

What does this project rest on?

gonzalgo trust mathlib_split.tsv
gonzalgo trust mathlib_split.tsv --fail-on-trust   # non-zero exit, for CI

Every theorem reaching sorryAx anywhere upstream, and everything carrying Lean.ofReduceBool / Lean.ofReduceNat, which is what native_decide emits — those results were obtained by compiling and running code and believing the answer, so the compiler and runtime are trusted rather than the kernel. Lean warns once, on the line where the sorry was typed; it says nothing about a theorem three files later that uses that lemma and is therefore also not proved.

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 227 lines · 203 tokens per session scan A a2a4492e035d

Subscribe to this mod's changes

lean-axiom-provenance is a skill published in the GitHub repository vince-gonzalez/gonzalgo (2 stars, last pushed yesterday), licensed Apache-2.0. It adds 203 tokens to every session and 2,579 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.