cs.LGSep 16, 2025

Discovering New Theorems via LLMs with In-Context Proof Learning in Lean

Authors: Kazumi KasauraNaoto OndaYuta OriikeMasaya TaniguchiAkiyoshi SannaiSho Sonoda

Organizations: OMRON SINIC X Corporation · RIKEN AIP · AutoRes · NexaScience · CyberAgent · Kyoto University · RIKEN AGIS · Shiga University · NII · NISTEP

Abstract

Large Language Models (LLMs) have demonstrated significant promise in formal theorem proving. In this study, we investigate the ability of LLMs to discover novel theorems and produce verified proofs. We propose a pipeline called Conjecturing-Proving Loop (CPL), which iteratively generates mathematical conjectures and attempts to prove them in Lean 4. A key feature of CPL is that each iteration conditions the LLM on previously generated theorems and their formal proofs, enabling parameter-free improvement of proof strategies via in-context learning. We provide both theoretical and experimental evidence that CPL increases the discovery rate of hard-to-prove theorems compared to frameworks that generate statements and proofs simultaneously. Moreover, our experiments show that reusing the LLM's own formally verified outputs as context consistently improves subsequent proof success, demonstrating the effectiveness of self-generated in-context learning for neural theorem proving. The source code is available at https://github.com/auto-res/ConjecturingProvingLoop.

Explore similar work

CardsList
  1. Evaluation of LLMs for Mathematical Formalization in Lean

    Jun 4, 2026Tyson Klingner, Drew Bladek, Escher Crawford +6TheoremFormalization