Papers
Topics
Authors
Recent
Search
2000 character limit reached

Using Aristotle API for AI-Assisted Theorem Proving in Lean 4: A Formalisation Case Study of the Grasshopper Problem

Published 19 May 2026 in cs.AI and cs.LO | (2605.20120v1)

Abstract: AI-assisted theorem proving can now generate substantial Lean developments for olympiad-level mathematics, but the evidential status of such developments depends on which declarations are actually verified. This paper reports a Lean 4 formalization case study of an Aristotle API proof attempt for the Grasshopper problem, originally posed as IMO 2009 Problem 6. The generated artifact states a generalized Lean version of the theorem, contains four verified helper lemmas for local components of a maximality and adjacent-swap exchange strategy, and leaves the main theorem grasshopper closed directly by one unresolved sorry. The verified components establish that the final partial sum equals the total sum, that an adjacent transposition can affect only the relevant intermediate partial sum, that the changed partial sum has the expected form, and that maximality at a position admitting an adjacent successor swap forces a corresponding forbidden-set membership fact. The Aristotle output summary identifies the intended remaining mathematical step as the global counting step needed to show that these membership facts produce at least n distinct forbidden values, contradicting the cardinality assumption |M| < n; the Lean source itself does not reduce the main theorem to a separately encoded counting lemma. This case study gives an inspectable example of a central limitation in AI-assisted formalization, namely that local proof search can succeed while the global combinatorial bookkeeping required for a theorem remains unresolved. The paper contributes a reproducible Lean artifact and a precise analysis of its verified and unverified proof content.

Authors (1)

Summary

  • The paper demonstrates that using the Aristotle API in Lean 4 enables automated local proof search while exposing a gap in global combinatorial reasoning.
  • The methodology employs constructive proofs via local lemmas on swaps, partial sums, and maximality to formalize the canonical Grasshopper problem.
  • Findings reveal that although automated tools verify local arguments, users must manually resolve counting-based global gaps to achieve full formalization.

AI-Assisted Theorem Proving in Lean 4: Formalising the Grasshopper Problem with Aristotle

Introduction

This paper analyzes the capabilities and limitations of AI-assisted formal mathematical reasoning in the context of Lean 4 theorem proving. It presents a case study using the Aristotle API for formalising the Grasshopper problem (IMO 2009 Problem 6), a canonical hard combinatorial exercise in olympiad mathematics. The selected target crystallizes a central open issue in current AI-proof pipelines: the bifurcation between locally automatable reasoning and the global combinatorial structures often needed to close difficult results.

Problem Formalisation and Encoding Choices

The formalisation centers on the Grasshopper problem, requiring a constructive proof that, for nn distinct positive jumps and a forbidden set MM of cardinality <n< n, there exists a permutation such that all partial sums after kk jumps avoid MM. The Lean translation instantiates this with:

  • Jumps a:Fin n→Na : \mathrm{Fin}\ n \to \mathbb{N} (enforcing positivity and injectivity),
  • Forbidden set M:Finset NM : \mathrm{Finset}\ \mathbb{N} with card(M)<n\mathrm{card}(M) < n,
  • Existence of permutation σ:Equiv.Perm(Fin n)\sigma : \mathrm{Equiv.Perm}(\mathrm{Fin}\ n) such that all partial sums PS a σ k\mathrm{PS}\ a\ \sigma\ k avoid MM0.

Notable is the generality: MM1 encompasses the original IMO statement MM2, and MM3 is not restricted to positive integers. The encoding exploits Lean's standard combinatorial infrastructure (e.g., finite types, sum over initial segments), supporting robust local reasoning but requiring precise exchange and counting arguments for global steps.

Proof Strategy and Formal Lemmas

The formal artifact employs an exchange/maximality strategy, standard in combinatorics, and formalises key local operations:

  • Definition of partial sums MM4,
  • Local reasoning about adjacent swaps, characterising how only the MM5-th partial sum is affected,
  • Introduction of an objective function MM6 (sum over non-forbidden partials), whose maximality properties drive exchange arguments.

These aspects are encapsulated in four verified Lean lemmas:

  1. PS_last: Establishes that the terminal partial sum equals the total sum.
  2. PS_swap and PS_swap_eq: Precisely analyze the impact of adjacent swaps on (partial) sums.
  3. maximizer_swap_in_M: Shows that, under maximality, adjacent swaps enforce additional forbidden-set membership among modified partial sums.

The formal archive contains machine-verified proofs for these lemmas; their constructive content is sound and mechanically validated.

Outcome of Automation: Main Theorem Status

A critical finding is that the main formal theorem, grasshopper, remains open—closed by a single unresolved sorry in Lean. No attempt is made, even as a subgoal, to encode and attack the (global) counting contradiction necessary to preclude MM7 in the maximality context. Aristotle successfully achieves local proof search and local deduction, but entirely delegates the global combinatorial contradiction to the user.

This outcome is explicitly surfaced in the Aristotle output log, pinpointing the missing argument as a counting step coordinating the forbidden values tracked via the verified local lemmas. The artefact thus exemplifies the distinction between "located formal errors" (explicit, inspectable sorry's) and truly completed mechanical proofs. Figure 1

Figure 1: Aristotle run log for the reported partial formalisation attempt, capturing the full roundtrip and demarcating completion of local lemmas and the point of final global failure.

Methodological Implications

This study reveals that while AI-guided Lean development can automate and check local combinatorial arguments—encompassing index manipulations, permutations, and finite maximality—it is not currently equipped to assemble the global reasoning required in high-combinatorial density proofs. This presents both a technical limitation and an interpretative hazard: compilation or the presence of many verified components does not entail formal completeness.

For practitioners, this enforces the discipline of explicit artefact inspection:

  • Scrutinizing which declarations close with verified proofs and which by sorry,
  • Mapping dependencies to identify the frontier between automated and delegated proof work,
  • Using API run logs and file provenance to establish reproducibility and to demarcate interpretative boundaries for formal certification.

These practices are directly relevant for trustworthy AI, where interpreting the output of increasingly advanced automated systems demands surface-level transparency and the ability to distinguish cosmetic from substantive formal success.

Implications for Future AI in Mathematics

The artefact represents a constraint in current end-to-end AI mathematical reasoning: local proof search and lemma synthesis have outpaced the ability to resolve "bookkeeping-driven" combinatorial contradictions. This accentuates a research frontier for AI/LLM-guided theorem proving, calling for:

  • New approaches to encoding and automating global counting, injectivity, and contradiction arguments in Lean and related systems,
  • Diagnostic and verification tools that expose the true closure status of formal declarations,
  • Further integration between informal/heuristic reasoning modules and formal certificate checkers.

On the practical side, the reproducibility infrastructure (auto-generated project directories, authoritative proof logs, and Lean scripts) provides a baseline for extending or building upon the partial formalisation.

Conclusion

This case study precisely separates the strengths and current boundaries of AI-assisted theorem proving in combinatorial settings. The Aristotle API, as orchestrated in Lean 4, succeeds in producing mechanically certified local combinatorial arguments, but leaves the high-level combinatorial contradiction argument unresolved. The resulting artefact stands as a reproducible demonstration of the necessity for fine-grained verification of automated proofs—critical for both mathematical correctness and trust in AI produced formal mathematics.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 6 likes about this paper.