A Claude Code plugin for theorem proving and code verification using Aristotle AI from Harmonic.
# Step 1: Add the marketplace
claude plugin marketplace add afhverjuekki/claude-code-aristotle-plugin
# Step 2: Install the plugin
claude plugin install aristotle@aristotle-pluginAlternative methods:
# Direct from GitHub
claude --plugin-dir https://github.com/afhverjuekki/claude-code-aristotle-plugin
# Local development
git clone https://github.com/afhverjuekki/claude-code-aristotle-plugin.git
claude --plugin-dir ./claude-code-aristotle-pluginAristotle has achieved:
- Gold-medal IMO 2025 performance (5/6 problems)
- 96.8% accuracy on VERINA benchmark for code verification
- Solved open Erdos problems that were unsolved for decades
- Contributed to Mathlib, Polynomial Freiman-Ruzsa, and Quantum Stein's Lemma
This plugin provides:
- Two workflows: Theorem proving and code verification
- Skill knowledge about Aristotle's architecture and best practices
- Specialized agents for proof and code verification
- Helper scripts for common tasks
Formalize mathematical proofs to Lean 4.
/aristotle Prove that √2 is irrational
Verify algorithm correctness with formal specifications.
/verify-code my-sorting-algorithm.lean
/aristotle my-theorem.lean
- Write informal proof first
- Add hints with
PROVIDED SOLUTIONin docstrings - Create standalone file (if using custom libraries)
- Submit to Aristotle
- Verify proofs with
#print axioms
/--
PROVIDED SOLUTION
Use induction on n. Apply Nat.add_comm for the base case.
-/
theorem sum_formula (n : Nat) : 2 * sum n = n * (n + 1) := by
sorry/verify-code selection-sort.lean
- Define precondition - Input constraints
- Implement algorithm - The code to verify
- Define postcondition - Required output properties
- State specification theorem
- Submit to Aristotle
-- Precondition: no special requirements
def sort_precond (arr : Array Int) : Prop := True
-- Algorithm implementation
def selectionSort (arr : Array Int) (h : sort_precond arr) : Array Int := ...
-- Postcondition: sorted + permutation
def sort_postcond (arr result : Array Int) (h : sort_precond arr) : Prop :=
List.Pairwise (· ≤ ·) result.toList ∧ result.toList.Perm arr.toList
-- Specification theorem
theorem selectionSort_correct (arr : Array Int) (h : sort_precond arr) :
sort_postcond arr (selectionSort arr h) h := by
sorry- Proof found: Algorithm is correct
- Counterexample: Bug detected (e.g.,
use [4, 1, 2, 1, 4], 2) - False detected: Specification or implementation is wrong
| Command | Description |
|---|---|
/aristotle |
Theorem proving workflow |
/verify-code |
Code verification workflow |
| Agent | Purpose | Color |
|---|---|---|
proof-verifier |
Validates Aristotle proofs, checks sorryAx | Green |
code-verifier |
Sets up VERINA-style specifications | Cyan |
Comprehensive knowledge covering:
- Erdos-style theorem proving pipeline
- VERINA-style code verification structure
- Writing effective hints
- Creating standalone files
- Troubleshooting common issues
Triggers on: "prove theorem", "verify algorithm", "use Aristotle", "check correctness"
| Script | Purpose |
|---|---|
verify-proof.sh |
Check for sorryAx contamination |
create-standalone.sh |
Generate theorem file template |
Aristotle runs in Harmonic's cloud:
- Lean 4.24.0 + Mathlib 4.24.0
- Custom library imports will fail
Solution: Create standalone files with inlined definitions.
If your codebase has sorries, Aristotle may exploit them.
Always verify:
#print axioms my_theorem
-- Should NOT show: sorryAxExpect 3-6 minutes for job completion.
Add PROVIDED SOLUTION in docstrings:
/--
PROVIDED SOLUTION
Use induction on array size. Each iteration:
1. Finds minimum in unsorted suffix
2. Swaps to correct position
3. Maintains sorted prefix invariant
Apply swap_preserves_perm and sorted_prefix_extends.
-/
theorem algorithm_correct ... := by sorryBest practices:
- Reference specific lemmas
- Describe strategy (induction, contradiction, etc.)
- Break into small steps
- Mention key insights
# Standalone file (custom libraries)
uvx --from aristotlelib aristotle prove-from-file FILE.lean \
--no-validate-lean-project --no-auto-add-imports
# Mathlib project
uvx --from aristotlelib aristotle prove-from-file lib/File.lean
# With context folder
uvx --from aristotlelib aristotle prove-from-file FILE.lean \
--context-folder lib/
# Fire and forget
uvx --from aristotlelib aristotle prove-from-file FILE.lean --no-waitAristotle has successfully verified:
- Selection sort (in-place sorting correctness)
- Run-length encoding (string compression)
- Longest increasing subsequence (dynamic programming)
- 160+ more algorithm implementations
And detected bugs like the top-k frequent elements error in the VERINA benchmark.
Aristotle has three subsystems:
- Lean proof search - MCGS with 200B+ parameter transformer
- Lemma-based reasoning - Decomposes and formalizes incrementally
- Geometry solver - Yuclid (500x faster than AlphaGeometry-1)
See skills/aristotle-workflow/references/architecture.md for details.
| Issue | Solution |
|---|---|
| "Import not found" | Create standalone file with inlined definitions |
| Proof depends on sorryAx | Fix upstream sorries or isolate in standalone file |
| "Block is false" | Theorem/specification is genuinely false |
| Long queue time | Normal is 3-6 min; use --no-wait for batch |
| Counterexample found | Check implementation, postcondition, or precondition |
1.1.0 (Added code verification support)