A Claude Code / Codex skill plus dependency-free scripts that audit a Lean
repository for vacuous proofs: formalizations that pass lake build and show a
green check, yet establish nothing of what their paper or README claims. The
motivating case is the steady stream of "P = NP machine-verified in Lean 4"
preprints — almost all of which collapse under inspection.
Why a green build is not enough
A Lean proof is only as meaningful as what it assumes and what it actually
states. A repository can compile and still be hollow:
- the conjecture is defined to be
True (def P_equals_NP : Prop := True);
- the two sides are aliased (
def NP := P, so P = NP holds by rfl);
- the hard theorems are assumed as
axioms and then "applied";
- the crux is parked in a hypothesis (a "bridge"/"connection"/"oracle" premise),
so the theorem is
(crux) → crux;
- a premise is unsatisfiable (
0 = 1), making the implication vacuously true;
- soundness is bypassed (
native_decide, unsafe, set_option debug.skipKernelTC);
- or the proof is simply unfinished (
sorry/admit) behind a "no sorries in the
main chain" hedge.
This tool catches all of these — and, crucially, asks the question a build never
answers: is the statement even the right one?
How it works — facts, then an agent
A fixed pattern set can't catch an open-ended space of cheats, so the deterministic layer only
gathers facts and the agent is the detector.
- Facts (
vacuity package + scripts/lean_facts.py, no deps, no build): token hazards
(sorry/admit/native_decide/unsafe/kernel-bypass set_options), declared custom
axiom/opaque, and the unfold chain of every identifier in the headline — so a hidden
def NP := P or def Conjecture := True is laid bare.
- Kernel axiom audit (
scripts/lean_axiom_probe.py): builds the repo and runs Lean's
#print axioms on the headline theorems — the one layer source-level obfuscation can't
survive (a hidden sorry surfaces as sorryAx; an assumed lemma as a named custom axiom).
- The agent judges (the skill):
scripts/make_brief.py assembles the facts, the kernel
closure, and the paper↔Lean pairing into a per-theorem brief; the agent reads it and the paper
and decides soundness, triviality, and — the highest-value check — whether the Lean is faithful
to the paper or quietly weakens it (an added hypothesis, a narrowed conclusion). Fixed
tooling can't judge that; a reasoning agent can.
The deterministic layer emits only a certain-facts floor verdict; the agent's verdict, from the
brief and the paper, is the real one. The result is a professional LaTeX report
(scripts/vacuity_report.py).
Install as an agent skill
Claude Code
/plugin marketplace add LionSR/is-my-lean-proof-vacuous
/plugin install lean-vacuity-check@lean-vacuity-check
Then: /check-vacuity path/to/lean-repo
Codex
Run these in your terminal (not inside Codex). Register the marketplace, then install:
codex plugin marketplace add LionSR/is-my-lean-proof-vacuous
codex plugin add lean-vacuity-check@lean-vacuity-check
(lean-vacuity-check@lean-vacuity-check is plugin-name@marketplace-name, not a typo;
codex plugin add may prompt you to authenticate on install.) Once enabled, run the
$lean-vacuity-check skill with the repo path — or $lean-vacuity-redteam to
adversarially stress-test a formalization.
Manual
Clone this repo and point your agent at skills/lean-vacuity-check/ (or symlink it
into ~/.claude/skills/). The scripts need only Python ≥ 3.10; the kernel audit needs
lake/lean on PATH.
Use the scripts directly (no agent)
# 1. kernel axiom audit (builds the repo; best-effort — the decisive soundness fact)
python3 scripts/lean_axiom_probe.py path/to/repo --auto --json-out results/axioms.json
# 2. assemble the facts brief the agent reads (statement + unfold chain + paper<->Lean)
python3 scripts/make_brief.py path/to/repo --axioms results/axioms.json --out-dir audits/repo
# scope a large codebase: --theorem NAME / --include SUBPATH / --exclude SUBPATH
# (raw facts + the deterministic floor verdict: python3 -m vacuity.cli scan path/to/repo)