lean4-axiom-eliminator

lean4-axiom-eliminator is an agent for Claude Code from frenzymath/Archon. It costs 44 tokens per session (993 once invoked), scanned A, original, Apache-2.0.

A Lean 4 proof-maintenance agent that replaces custom nonconstructive assumptions with structured proofs. An axiom is an assumption accepted without being proved inside the system.

In plain words
What is it for?
It audits custom axioms, searches for replacement lemmas, refactors proofs, and checks the project after each change.
Why use it?
It helps reduce reliance on extra assumptions and shows where those assumptions are used before changing the code.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the lean4 plugin — 1 skill, 11 commands, 4 agents, 3 hooks shipped together

Good fit It audits custom axioms, searches for replacement lemmas, refactors proofs, and checks the project after each change.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/frenzymath/archon/lean4-axiom-eliminator
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.

Clone the repo
git clone --depth 1 https://github.com/frenzymath/Archon

Made for: Claude Code.

Or install lean4, the plugin that ships this one along with the rest of its 1 skill, 11 commands, 4 agents, 3 hooks.

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 lean4-axiom-eliminator

README.md
[![agentmods](https://agentmods.dev/badge/agents/frenzymath/archon/lean4-axiom-eliminator/github.svg)](https://agentmods.dev/agents/frenzymath/archon/lean4-axiom-eliminator)
Your own site
<a href="https://agentmods.dev/agents/frenzymath/archon/lean4-axiom-eliminator"><img src="https://agentmods.dev/badge/agents/frenzymath/archon/lean4-axiom-eliminator/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 lean4-axiom-eliminator

Your own site · 80×15
<a href="https://agentmods.dev/agents/frenzymath/archon/lean4-axiom-eliminator"><img src="https://agentmods.dev/badge/agents/frenzymath/archon/lean4-axiom-eliminator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 993 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.00044 $0.00993
Opus 5.5 $0.00018 $0.00397
Sonnet 5.5 $0.00009 $0.00199
Haiku 4.5 $0.00004 $0.00099

Measured 3mo ago against content hash 0f6a66eb1952, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lean4-axiom-eliminator 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 3mo 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.

src/archon/.archon-src/skills/lean4/agents/lean4-axiom-eliminator.md · 115 lines

How it starts

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

Inputs

  • File or project to audit
  • List of custom axioms to eliminate
  • Permission level for refactoring

Actions

  1. Audit current state:

    • Start with lean_diagnostic_messages(file) on the target file(s) before broader verification
    • Use bash $LEAN4_SCRIPTS/check_axioms_inline.sh FILE.lean (or . for project-wide audit) to measure current axiom state
    • Use bash $LEAN4_SCRIPTS/find_usages.sh axiom_name for dependency inventory
  2. Propose migration plan (~500-800 tokens):

    ## Axiom Elimination Plan
    **Total custom axioms:** N
    **Target:** 0
    
    ### Inventory
    1. **axiom_1** - Type: [mathlib_search|compositional|structural]
       Used by: M theorems, Priority: high/medium/low
    
    ### Elimination Order
    Phase 1: Low-hanging fruit (mathlib_search)
    Phase 2: Medium difficulty (compositional)
    Phase 3: Hard cases (structural/convert to sorry)
    
  3. Execute batch by batch - For each axiom:

    • Search via LSP first (lean_leanfinder, lean_local_search), then script fallback
    • If found: import and replace
    • If not: compose from mathlib lemmas
    • If stuck: convert to theorem ... := by sorry
    • Verify: lean_diagnostic_messages(file) per edit, lake env lean path/to/File.lean for file gate (run from the project root), axiom count decreased; reserve lake build for final/project gate
  4. Report progress after each elimination and final summary

Output

Per-axiom report (~200-400 tokens):

## Axiom Eliminated: axiom_name
**Strategy:** mathlib_import/compositional/converted_to_sorry
**Changes:** [imports, helpers]
**Verification:** Compile ✓, Count N→N-1 ✓

Final summary (~300-500 tokens):

## Axiom Elimination Complete
**Starting:** N, **Ending:** M
**By strategy:** X mathlib, Y compositional, Z sorry
**Files changed:** K

Total: ~2000-3000 tokens per batch

Constraints

  • Lemma search required before proving (LSP-first, script fallback)
  • Compile and verify after EACH elimination
  • May NOT add new axioms while eliminating
  • May NOT skip lemma search
  • May NOT break dependent theorems
  • Must track axiom count (trending down)
  • Prefer live-file MCP for target-context verification; use lean_run_code for isolated scratch experiments, and temporary .lean files only if lean_run_code is unavailable or insufficient

Read the full file on GitHub · 115 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. 3mo ago First seen · 115 lines · 44 tokens per session scan A 0f6a66eb1952

Subscribe to this mod's changes

lean4-axiom-eliminator is an agent published in the GitHub repository frenzymath/Archon (235 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 44 tokens to every session and 993 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

lean4-axiom-eliminator compared with agents from other repositories

lean4-axiom-eliminator next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lean4-axiom-eliminatorfrenzymath/ArchonAgent2353mo agoApache-2.0A44Claude Code
bnlearn-researchererdogant/bnlearnAgent6498d agononeA47Claude Code
bnlearn-specialisterdogant/bnlearnAgent6498d agononeA24Claude Code
editorpedrohcgs/claude-code-my-workflowAgent1.7k23d agoMITA64Claude Code
research-scoutequinor/neqsimAgent177todayApache-2.0A61Claude Code
Geoprocessing SpecialistSHAdd0WTAka/Zen-Ai-PentestAgent53527d agoMITA45Claude Code, OpenCode
mathodology-problem-analystsweetcornna/mathodologyAgent3528d agoMITA20Claude Code