Skip to main content
QUICK REVIEW

[Paper Review] Learning to Prove Theorems via Interacting with Proof Assistants

Kaiyu Yang, Jia Deng|arXiv (Cornell University)|May 21, 2019
Software Engineering ResearchComputer Science24 citations
TL;DR

This paper introduces CoqGym, a large-scale dataset of 71,000 human-written Coq proofs, and ASTactic, a deep learning model that generates proof tactics as abstract syntax trees (ASTs) to automate interaction with proof assistants. ASTactic achieves 12.2% success rate on novel theorems not previously provable by automated tools, demonstrating improved generalization and flexibility over prior methods.

ABSTRACT

Humans prove theorems by relying on substantial high-level reasoning and problem-specific insights. Proof assistants offer a formalism that resembles human mathematical reasoning, representing theorems in higher-order logic and proofs as high-level tactics. However, human experts have to construct proofs manually by entering tactics into the proof assistant. In this paper, we study the problem of using machine learning to automate the interaction with proof assistants. We construct CoqGym, a large-scale dataset and learning environment containing 71K human-written proofs from 123 projects developed with the Coq proof assistant. We develop ASTactic, a deep learning-based model that generates tactics as programs in the form of abstract syntax trees (ASTs). Experiments show that ASTactic trained on CoqGym can generate effective tactics and can be used to prove new theorems not previously provable by automated methods. Code is available at https://github.com/princeton-vl/CoqGym.

Motivation & Objective

  • To address the lack of large-scale, diverse datasets for training machine learning models in interactive theorem proving (ITP).
  • To overcome the limited flexibility of prior models that rely on fixed vocabularies for tactic generation.
  • To develop a method that enables deep learning models to generate novel, out-of-vocabulary tactics by modeling them as abstract syntax trees (ASTs).
  • To evaluate the model's ability to generalize across diverse mathematical and programming language domains.

Proposed method

  • Construct CoqGym, a dataset of 71,000 human-written proofs from 123 open-source Coq projects, covering diverse domains including mathematics, hardware, and programming languages.
  • Augment the dataset with synthetic proofs derived from intermediate goals in original proofs, enabling controllable proof length and additional training data.
  • Design ASTactic, a deep learning model that generates tactics as ASTs using a context-free grammar and runtime token availability.
  • Train ASTactic to predict tactic ASTs from input goals and premises, using a sequence-to-sequence framework with AST structure modeling.
  • Use a predefined grammar to ensure syntactic correctness and enable generation of complex, compound tactics beyond fixed vocabulary sets.
  • Evaluate ASTactic on its ability to prove new theorems not seen during training, measuring success via proof completion in the Coq environment.

Experimental results

Research questions

  • RQ1Can a deep learning model trained on a large-scale, diverse dataset of human-written proofs generalize to prove new, previously unprovable theorems?
  • RQ2Can AST-based tactic generation produce flexible, out-of-vocabulary tactics that are not limited to a fixed set of predefined commands?
  • RQ3How effective is ASTactic in learning high-level proof strategies such as induction, rewriting, and simplification from natural proof assistant interactions?
  • RQ4To what extent does the model generalize across different domains, such as arithmetic, algebra, and type theory, when trained on a broad dataset?
  • RQ5Can synthetic proofs derived from intermediate goals improve the sample efficiency and generalization of the learned proof agent?

Key findings

  • ASTactic achieves a 12.2% success rate in proving new theorems not previously provable by automated methods, demonstrating effective generalization beyond training data.
  • The model generates tactics as structured ASTs, enabling the creation of complex, compound tactics not constrained to a fixed vocabulary, thus improving flexibility.
  • CoqGym, with 71,000 proofs from 123 diverse projects, provides a significantly larger and more varied benchmark than prior datasets, supporting robust model training.
  • Synthetic proofs derived from intermediate goals improve data efficiency and help the model learn shorter, more efficient proof paths.
  • The approach enables the model to learn high-level proof strategies such as induction, rewriting, and simplification from natural proof assistant interactions.
  • The model outperforms prior methods in cross-domain generalization due to the scale and diversity of the CoqGym dataset.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.