- 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.
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.
The formalisation centers on the Grasshopper problem, requiring a constructive proof that, for n distinct positive jumps and a forbidden set M of cardinality <n, there exists a permutation such that all partial sums after k jumps avoid M. The Lean translation instantiates this with:
- Jumps a:Fin n→N (enforcing positivity and injectivity),
- Forbidden set M:Finset N with card(M)<n,
- Existence of permutation σ:Equiv.Perm(Fin n) such that all partial sums PS a σ k avoid M0.
Notable is the generality: M1 encompasses the original IMO statement M2, and M3 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.
The formal artifact employs an exchange/maximality strategy, standard in combinatorics, and formalises key local operations:
- Definition of partial sums M4,
- Local reasoning about adjacent swaps, characterising how only the M5-th partial sum is affected,
- Introduction of an objective function M6 (sum over non-forbidden partials), whose maximality properties drive exchange arguments.
These aspects are encapsulated in four verified Lean lemmas:
- PS_last: Establishes that the terminal partial sum equals the total sum.
- PS_swap and PS_swap_eq: Precisely analyze the impact of adjacent swaps on (partial) sums.
- 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 M7 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: 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.