TLDR: PROOFFLOW is a novel pipeline that translates natural language mathematical theorems and proofs into machine-verifiable code, prioritizing the preservation of the original proof’s logical structure. It achieves this through a three-stage process: Graph Builder, Formalizer, and Tactic Completer. The research introduces a new benchmark, PROOFFLOWBENCH, and a comprehensive scoring metric, PROOFSCORE, which evaluates syntactic correctness, semantic faithfulness, and structural fidelity. Experimental results show PROOFFLOW significantly outperforms existing autoformalization methods, demonstrating the importance of structural fidelity in this task.
Integrating the nuanced world of human mathematical reasoning with the rigid precision of machine-verifiable code has long been a significant challenge. This process, known as proof autoformalization, is crucial for leveraging the power of large language models (LLMs) in rigorous mathematical workflows. However, existing methods often fall short, failing to accurately capture the semantic meaning and logical structure of human-written arguments.
A new research paper introduces PROOFFLOW, a groundbreaking pipeline designed to address these limitations by making structural fidelity a primary objective. Developed by researchers from Huawei Celia Team and Huawei Noah’s Ark Lab, PROOFFLOW offers a novel approach to translating natural language theorems and proofs into formal, machine-verifiable code, specifically using Lean 4.
The PROOFFLOW Approach: Preserving Logical Structure
At its core, PROOFFLOW operates through a three-stage pipeline, each leveraging LLMs to bridge the gap between natural language and formal proof code:
1. Graph Builder: This initial stage constructs a directed acyclic graph (DAG) from the natural language proof. This DAG maps the logical dependencies between each proof step, ensuring that the system understands how different parts of the proof relate to each other. The nodes in this graph represent theorem conditions, definitions, lemmas, and the final theorem solutions.
2. Formalizer: For each node in the meticulously built dependency graph, an LLM translates its self-contained natural language statement into Lean 4 code. This process is iterative, with errors being fed back to the LLM for correction, ensuring high syntactic correctness. At this stage, lemmas are formalized with a placeholder for tactics.
3. Tactic Completer: The final stage replaces these placeholders with the appropriate Lean 4 tactics, completing the formal proof for each lemma.
This lemma-based approach stands in stark contrast to conventional tactic-based methods, which often generate low-level tactics that do not mirror the original human proof structure. By deconstructing the proof into high-level lemmas and explicitly tracking their dependencies, PROOFFLOW ensures that the formal proof truly captures the human’s intended logic, preventing logical shortcuts or the use of unintended premises.
A New Benchmark and Comprehensive Evaluation
To facilitate robust evaluation of autoformalization systems, the researchers also introduce PROOFFLOWBENCH, a new benchmark dataset comprising 184 undergraduate-level mathematics problems with manually annotated step-by-step solutions and logical dependency graphs. This dataset covers six key areas, including number theory, real analysis, and probability.
Alongside the benchmark, a new composite metric called PROOFSCORE is presented. This metric offers a more complete assessment of autoformalized proofs by evaluating three critical properties:
1. Structural Fidelity: Ensures the proof’s dependency graph is preserved.
2. Syntactic Correctness: Verifies that the output code is free of compilation errors.
3. Semantic Faithfulness: Assesses whether each formalized statement accurately preserves the mathematical meaning of its original natural language counterpart.
Also Read:
- PROOFBRIDGE: Automating Formal Proof Translation from Natural Language
- ProofOptimizer: An AI System for Concise Formal Mathematics
Outperforming Existing Methods
Experimental results demonstrate that PROOFFLOW sets a new state-of-the-art in autoformalization. It achieved a PROOFSCORE of 0.545, significantly outperforming baselines like full-proof formalization (0.123), which processes the entire proof at once, and step-proof formalization (0.072), which handles each step independently. The study highlights the critical importance of maintaining structural fidelity, with the DAG-enforcing version of PROOFFLOW showing superior performance.
Furthermore, PROOFFLOW includes an error detection system that can pinpoint the source of failures, whether in the formalization, tactic completion, or even the original natural language statement. This capability allows the system to identify flaws in human-written proofs, ranging from algebraic errors to subtle ambiguities, providing valuable feedback to mathematicians.
The PROOFFLOW pipeline, benchmark, and score metric are open-sourced, encouraging further progress in this vital area of AI and mathematics. For more details, you can read the full research paper here.


