- What is lean-countermodel?
- An open-source tool that shows a claim does not follow from a set of axioms, with a proof Lean 4 checks. Vampire, an automated prover, searches for a finite counter-model; lean-countermodel turns it into a Lean 4 certificate; Lean's kernel checks it.
- What is a counter-model?
- A small structure, or world, in which every assumption is true and the claim is false. Exhibiting one proves the claim does not follow from those assumptions. Failing to find a proof does not: the search may simply be too weak.
- Does Spinoza's Proposition 5 follow from his axioms?
- In Yuki Nakamura's Lean 4 formalization of Ethics Part I, a weak version follows (substances with exactly the same attributes are the same), but the strong one does not: A12, an attribute belongs to one substance, does not follow from the stated axioms plus a principle of sufficient reason. Nakamura showed this with a 4-element counter-model built by hand; lean-countermodel found a 2-element one automatically in about 0.1 seconds and certified it against Nakamura's own library. The result is about that formalization, not a verdict on Spinoza's text.
- Why not just trust Vampire's answer?
- Vampire is treated as untrusted. Only Lean's kernel decides whether a model becomes a certificate, so a wrong model never yields one. The translation from TPTP into Lean is trusted code, tested against an independent evaluator of the original formulas.
- How well does it work beyond Spinoza?
- On three samples of 100 problems from the TPTP library, Lean's kernel alone certified 71 of 78, 55 of 62 and 59 of 67 of the models Vampire found: 185 certificates. It also certified a problem with over a million facts in a median of 5.2 minutes on an 8 GB laptop.
- How is this different from Isabelle's Nitpick?
- Nitpick has found counterexamples in Isabelle/HOL since 2010. Lean 4 can import proofs from automated provers, but had no general automated front end for finding and certifying finite counter-models of abstract first-order theories. lean-countermodel provides one for untyped first-order logic in TPTP.
- Was it peer reviewed?
- It received an iterative, AI-generated technical review by Manus AI, requested by the authors, covering both the paper and the code. The final review recommends acceptance as a scoped formal-methods tool-and-engineering contribution. It is not an anonymous human review or a journal decision.
- How do I run it?
- Install Lean 4.35 (via elan), Python 3.12 and Vampire 5.1.0, clone github.com/exponentlabshq/lean-countermodel, run lake build, then python3 cm.py problem.p > P.lean && lake env lean P.lean. The README's quick start lists every step and what each should print.