Harmonic’s Aristotle is an AI tool for formal mathematics. It is exciting because it works out-of-the-box with Lean 4 and mathlib4, the standard tools for machine-verified mathematics. Claude and GPT have some ability with mathlib, but not as much, and it is not easily integrated.
Originally, Aristotle was gated behind a waitlist. Yesterday, they opened up access to everyone, and I received my API invitation shortly before that. This blog post records my first impressions.
Installation
Harmonic has clearly put effort into the user experience, because the installation and UI are mostly smooth and easy. I only ran into two minor speedbumps.
Pinning the version of Lean and mathlib
Aristotle works best with these versions of Lean and mathlib:
Lean Toolchain version: leanprover/lean4:v4.24.0
Mathlib version: v4.24.0 - Oct 14, 2025 (f897ebcf72cd16f89ab4577d0c826cd14afaafc7)
However, the installation instructions don’t explain how to pin these versions in your project.
In seems that the following works:
In lean-toolchain:
In lakefile.toml:
[[require]]
name = "mathlib"
scope = "leanprover-community"
rev = "v4.24.0"
At one point, the Lean VSCode extension overwrote my lean-toolchain file, so I needed to put the version back in. Thus I don’t know the best time to insert these directives.
Command to run Aristotle
The Aristotle docs say to run with
uvx aristotlelib@latest aristotle
But this gave an error on my machine. Instead I needed to use
uvx --from aristotlelib@latest aristotle
Tasks for Aristotle
Aristotle offers four different modes, but so far I have tried only mode 1, “Fill sorries in a lean file (.lean)”. Since I’m figuring out basic usage and derusting on Lean (which I last used about a year ago), I stuck to simple tasks. Here are some I tried.
Some lemmas I’d like to investigate using AI involve Shannon entropy, and mathlib does not seem to have an easy-to-work-with definition of the Shannon entropy of a probability vector, so that inspired some simple not-in-mathlib material to try.
Proving continuity
As a human, it’s easy enough to define the entropy function in terms of mathlib’s negMulLog and prove its continuity. (But I did use LLMs, including Aristotle’s own output, to help me!)
import Mathlib
noncomputable def entropy {n : ℕ} (p : Fin n → ℝ) : ℝ :=
∑ i, (p i).negMulLog
lemma continuous_entropy (n : ℕ) : Continuous (entropy (n := n)) := by
unfold entropy
fun_prop
I gave the task of proving continuity to Aristotle. It came back with this proof script:
lemma continuous_entropy (n : ℕ) : Continuous (entropy (n := n)) := by
-- The entropy function is continuous because it is a sum of continuous functions (each term in the sum is continuous).
have h_cont : Continuous (fun p : Fin n → ℝ => ∑ i, (p i).negMulLog) := by
have h_term_cont : ∀ i, Continuous (fun p : Fin n → ℝ => (p i).negMulLog) := by
fun_prop (disch := norm_num)
exact continuous_finset_sum _ fun i _ => h_term_cont i;
-- Since the entropy function is defined as the sum of the negMulLog terms, and we've already shown that this sum is continuous, we can conclude that the entropy function is continuous.
convert h_cont using 1
The proof script is messier and longer than my manual proof, but it verifies.
Proving strict concavity on [0,inf)^n
Another property of entropy is that it is strictly concave on [0,inf)^n. This is surprisingly tricky to prove, though only because of the strictness. Concavity is easy, because it’s a sum of concave functions, and their concavity is already proved by mathlib for negMulLog.
I still haven’t settled on how I’d like to write the proof script by hand, and in the meantime, Aristotle came back with:
lemma strictConcaveOn_entropy (n : ℕ) :
StrictConcaveOn ℝ (Set.Ici 0) (entropy (n := n)) := by
-- By definition of entropy, we know that it is strictly concave.
have h_strict_concave : ∀ x y : Fin n → ℝ, 0 ≤ x → 0 ≤ y → x ≠ y → ∀ a b : ℝ, 0 < a → 0 < b → a + b = 1 → a • (∑ i, (x i).negMulLog) + b • (∑ i, (y i).negMulLog) < ∑ i, ((a • x + b • y) i).negMulLog := by
-- Apply the strict concavity of the entropy function to each term in the sum.
have h_strict_concave : ∀ x y : ℝ, 0 ≤ x → 0 ≤ y → x ≠ y → ∀ a b : ℝ, 0 < a → 0 < b → a + b = 1 → a • (x.negMulLog) + b • (y.negMulLog) < (a • x + b • y).negMulLog := by
-- Apply Jensen's inequality for the strictly concave function $f(x) = -x \log x$.
have h_jensen : StrictConcaveOn ℝ (Set.Ici 0) (fun x : ℝ => -x * Real.log x) := by
apply_rules [ strictConcaveOn_of_deriv2_neg ] <;> norm_num [ Real.log_div ];
· exact convex_Ici _;
· exact ContinuousOn.neg ( Real.continuous_mul_log.continuousOn );
· intro x hx; rw [ show deriv ( deriv fun y => y * Real.log y ) x = deriv ( fun y => Real.log y + 1 ) x from Filter.EventuallyEq.deriv_eq <| Filter.eventuallyEq_of_mem ( Ioi_mem_nhds hx ) fun y hy => by simp +decide [ hy.out.ne' ] ] ; norm_num [ hx.ne' ] ; positivity;
simp_all +decide [ StrictConcaveOn ];
unfold Real.negMulLog; aesop;
intros x y hx hy hxy a b ha hb hab
have h_sum_strict_concave : ∑ i, (a • (x i).negMulLog + b • (y i).negMulLog) < ∑ i, ((a • x + b • y) i).negMulLog := by
apply Finset.sum_lt_sum
intro i _;
· by_cases hi : x i = y i;
· simp +decide [ ← add_mul, ← hi, hab ];
· exact le_of_lt ( h_strict_concave _ _ ( hx i ) ( hy i ) hi a b ha hb hab );
· exact ⟨ Classical.choose ( Function.ne_iff.mp hxy ), Finset.mem_univ _, by simpa using h_strict_concave ( x ( Classical.choose ( Function.ne_iff.mp hxy ) ) ) ( y ( Classical.choose ( Function.ne_iff.mp hxy ) ) ) ( hx _ ) ( hy _ ) ( Classical.choose_spec ( Function.ne_iff.mp hxy ) ) a b ha hb hab ⟩
generalize_proofs at *; (
simpa only [ Finset.smul_sum, Finset.sum_add_distrib ] using h_sum_strict_concave);
exact ⟨ convex_Ici _, fun x hx y hy hxy a b ha hb hab => h_strict_concave x y hx hy hxy a b ha hb hab ⟩
The continuity and strict concavity together took 12 minutes for Aristotle, definitely much faster than I’m able to formally prove this lemma. On the other hand, the proof script it created is rather bizarre. For example, it seems to be invoking the axiom of choice, which is not something I’d expect to see for this problem. So, the output seems mainly useful for confirming “this is provable” but not so much for providing a proof script I’d want to read or commit.
Disproving strict concavity on R^n
Informally, a natural way to define the entropy function would be to make its domain [0,inf)^n (not R^n), so that we can simply say “entropy is strictly concave” rather than needing to say “entropy is strictly concave on [0,inf)^n“.
But it’s an unfortunate technical oddity of Lean that it tends to be less awkward to be unrestrictive about function inputs and instead put the conditions as assumptions in lemmas. That’s how mathlib handles log and negMulLog, so that’s what I do with entropy too.
As a result, the informal fact “entropy is strictly concave” is actually not formally true in Lean. (Moreover, it’s not even concave.) But it would be easy to forget the needed assumption when stating the lemma, so I was curious how Aristotle would handle it. In 10 minutes, Aristotle came back with a disproof. The way the output encodes the disproof is in a comment, so I reorganized a bit so I could check it locally with Lean, to get:
lemma strictConcaveOnUniv_entropy :
∃ n, ¬StrictConcaveOn ℝ Set.univ (entropy (n := n)) := by
-- Proof starts here:
norm_num [ StrictConcaveOn ] at *;
use 2;
rintro -;
unfold entropy;
refine' ⟨ fun _ => -1, fun _ => 1, _, 1 / 2, _, 1 / 2, _, _, _ ⟩ <;> norm_num;
· exact fun h => by have := congr_fun h 0; norm_num at this;
· norm_num [ Real.negMulLog ]
This is a reasonable choice of counterexample, despite the oddity of choosing n=2. It only disproves strictness, though, not concavity. Of course, that’s good enough to refute the sorry I asked it to fill. But it’s not much harder to pick a counterexample that disproves concavity, so a human would probably give you one to begin with, instead of needing to be asked again.
Conclusion
I’m impressed with what I’ve seen in my use of Aristotle so far. It works, and the UI is smooth. The proof scripts produced are clunky, but that’s something I think we can expect to improve with future versions.