🤖 AI Summary
This work addresses the challenge faced by Rocq users in retrieving existing theorems across projects when proving new results, compounded by the lack of efficient tools to extract theorems, definitions, and their dependencies. To overcome this, the authors propose TheoremExtr, the first approach that combines static parsing with runtime analysis to comprehensively extract structured information about theorems and definitions from Rocq projects. The method constructs a system enabling cross-project semantic similarity search, thereby transcending the modular limitations of conventional search commands. Evaluated on 32 open-source projects, TheoremExtr successfully extracts 71,795 theorems—including their dependencies—and 27,481 definitions and types. The resulting infrastructure is deployed as a public platform at lemmasearch.com, significantly enhancing the discoverability and reusability of formalized mathematical libraries.
📝 Abstract
Rocq (Coq) are now widely used in various fields, including software verification and mathematical proofs. When proving a new theorem, users often need to search and apply proven theorems to assist the current proof process. However, the current search command is limited to the environment of imported modules and cannot search for theorems outside of this scope. Furthermore, tool developers and researchers may want to obtain detailed information about theorems, such as theorem's names, statements, and dependencies. But there are currently no user-friendly and efficient tools available for extracting comprehensive information from Rocq projects. We introduce a Rocq theorem extraction and analysis tool, TheoremExtr, which is capable of analyzing theorem composition and extracting theorems, dependencies, and definitions from both parsing phase and runtime. We extracted 71,795 theorems and their dependencies from 32 open-source projects from the Rocq community. In addition, we extracted 27,481 definitions and their types among these projects. We also developed a website that supports cross-project similarity search for theorems and definitions. The tool is available at https://github.com/Rw1nd/TheoremExtr, and the search website is available at https://lemmasearch.com.