
data/dataset/constructivebench.json{
"name": "IMO2011SLC4",
"category": "Combinatorics",
"source": "IMO/2011",
"problem": "...",
"answer": "The greatest such number k is 3",
"formalization": "...",
"...": "..."
}
Below, we show the problem sources and problem domains in ConstructiveBench.

data/dataset/putnam.jsonWe show the end-to-end answer-construction ("Conjecturer Model") and theorem proving ("Prover Model") accuracy with Pass@32 metric on 3,431 ConstructiveBench problems, comparing the CoT baseline vs. ECP for answer-construction.

Initialize Git LFS
(Skip if already set up.)
git lfs install
Install Lean
(Skip if already set up.)
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
source ~/.bashrc
Verify installation:
lean --version
Clone the Repository
git clone --recursive https://github.com/JackSun200312/ECP
cd ECP
Create a Python Virtual Environment
We recommend using venv:
python -m venv imosolver
source imosolver/bin/activate
pip install -r requirements.txt
Build Lean Environment
Build for both the newest version and v4.9.0-rc1 (for prover models). This may take around 30 minutes.
cd Formalization
lake update
lake build Main
cd ..
cd prover/mathlib4
lake build
cd ../..
Set Up LLM API Keys
Either add them to your shell file or edit appl.yaml directly:
echo 'export OPENAI_API_KEY="your_openai_key_here"' >> ~/.bashrc
echo 'export DEEPSEEK_API_KEY="your_deepseek_key_here"' >> ~/.bashrc
source ~/.bashrc
ECP/
├── prover/ # Adapted from Goedel-Prover, contains utilities for running prover models
├── src/
│ └── ecp/
│ ├── agent.py # Multi-agent framework for Enumerate → Conjecture → Prove (ECP)
│ ├── main.py # Main entry point for experiments
│ └── utils.py # Utility functions
│ └── scripts/
│ ├── dataset/
│ ├── deploy/
│ ├── finetune/
│ ├── lean/
│ └── trace/
└── data/
└── dataset/
├── constructivebench.json # ConstructiveBench dataset
└── putnam.json # PutnamBench answer-construction subset
The file src/ecp/main.py provides a unified interface for three pipelines:
answer_gen: Full ECP pipeline (Enumerate → Conjecture → Verify)autoformalize: Generate Lean formalizations from informal problems/answersproof_gen: Use a formal prover to generate complete Lean proofs--problem_path to specify the dataset.
constructivebench (recommended)test (runs a single case)--mode to one of:
answer_genautoformalizeproof_gen--enable_enumerator:
True: Run full ECP (enumerator + conjurer)False: Skip enumeration (Chain-of-Thought baseline)--problem_name:
"all" (default) to process all entriespython src/ecp/main.py --mode autoformalize --problem_path constructivebench
python src/ecp/main.py --mode answer_gen --problem_path constructivebench --enable_enumerator true
Output Location:
output/data/dataset/constructivebench.json/deepseek-chat-code/
(To run the CoT baseline, set--enable_enumerator false.)
After generating formalizations and conjectures (via answer_gen), run:
python src/ecp/main.py --mode proof_gen --problem_path constructivebench
Note: Proof generation uses Goedel-Prover by default. You can override with models like
deepseek-ai/DeepSeek-Prover-V2-7BorAI-MO/Kimina-Prover-Preview-Distill-7B.
--enumerator_model: deepseek-chat--conjecturer_model: deepseek-chat--prover_model: Goedel-LM/Goedel-Prover-SFT--max_tokens: 500--timeout: 60 (seconds)--pass_at_n: 32 (Pass@n metric for proof generation)--gpu: 1 (number of GPUs for proof generation)--use_embedding_search: FalseTrue only if you have GPU resources for embedding-based Lean retrieval.)You can override any of these options. Check src/ecp/main.py for the full list of arguments.
After experiments, summarize answer/proving accuracies for a dataset (constructivebench, putnam, or test):
python summarize_result.py --base <dataset>
If you find this work useful, please cite:
@misc{sun2025enumerateconjectureproveformallysolvinganswerconstruction,
title = {Enumerate-Conjecture-Prove: Formally Solving Answer-Construction Problems in Math Competitions},
author = {Jialiang Sun and Yuzhi Tang and Ao Li and Chris J. Maddison and Kuldeep S. Meel},
year = {2025},
eprint = {2505.18492},
archivePrefix= {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2505.18492},
}
The prover part of this repository use code from Goedel-Prover. Some of raw problems from the following datasets were included in ConstructiveBench, as mentioned in the paper:

data/dataset/constructivebench.json{
"name": "IMO2011SLC4",
"category": "Combinatorics",
"source": "IMO/2011",
"problem": "...",
"answer": "The greatest such number k is 3",
"formalization": "...",
"...": "..."
}
Below, we show the problem sources and problem domains in ConstructiveBench.

data/dataset/putnam.jsonWe show the end-to-end answer-construction ("Conjecturer Model") and theorem proving ("Prover Model") accuracy with Pass@32 metric on 3,431 ConstructiveBench problems, comparing the CoT baseline vs. ECP for answer-construction.

Initialize Git LFS
(Skip if already set up.)
git lfs install
Install Lean
(Skip if already set up.)
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
source ~/.bashrc
Verify installation:
lean --version
Clone the Repository
git clone --recursive https://github.com/JackSun200312/ECP
cd ECP
Create a Python Virtual Environment
We recommend using venv:
python -m venv imosolver
source imosolver/bin/activate
pip install -r requirements.txt
Build Lean Environment
Build for both the newest version and v4.9.0-rc1 (for prover models). This may take around 30 minutes.
cd Formalization
lake update
lake build Main
cd ..
cd prover/mathlib4
lake build
cd ../..
Set Up LLM API Keys
Either add them to your shell file or edit appl.yaml directly:
echo 'export OPENAI_API_KEY="your_openai_key_here"' >> ~/.bashrc
echo 'export DEEPSEEK_API_KEY="your_deepseek_key_here"' >> ~/.bashrc
source ~/.bashrc
ECP/
├── prover/ # Adapted from Goedel-Prover, contains utilities for running prover models
├── src/
│ └── ecp/
│ ├── agent.py # Multi-agent framework for Enumerate → Conjecture → Prove (ECP)
│ ├── main.py # Main entry point for experiments
│ └── utils.py # Utility functions
│ └── scripts/
│ ├── dataset/
│ ├── deploy/
│ ├── finetune/
│ ├── lean/
│ └── trace/
└── data/
└── dataset/
├── constructivebench.json # ConstructiveBench dataset
└── putnam.json # PutnamBench answer-construction subset
The file src/ecp/main.py provides a unified interface for three pipelines:
answer_gen: Full ECP pipeline (Enumerate → Conjecture → Verify)autoformalize: Generate Lean formalizations from informal problems/answersproof_gen: Use a formal prover to generate complete Lean proofs--problem_path to specify the dataset.
constructivebench (recommended)test (runs a single case)--mode to one of:
answer_genautoformalizeproof_gen--enable_enumerator:
True: Run full ECP (enumerator + conjurer)False: Skip enumeration (Chain-of-Thought baseline)--problem_name:
"all" (default) to process all entriespython src/ecp/main.py --mode autoformalize --problem_path constructivebench
python src/ecp/main.py --mode answer_gen --problem_path constructivebench --enable_enumerator true
Output Location:
output/data/dataset/constructivebench.json/deepseek-chat-code/
(To run the CoT baseline, set--enable_enumerator false.)
After generating formalizations and conjectures (via answer_gen), run:
python src/ecp/main.py --mode proof_gen --problem_path constructivebench
Note: Proof generation uses Goedel-Prover by default. You can override with models like
deepseek-ai/DeepSeek-Prover-V2-7BorAI-MO/Kimina-Prover-Preview-Distill-7B.
--enumerator_model: deepseek-chat--conjecturer_model: deepseek-chat--prover_model: Goedel-LM/Goedel-Prover-SFT--max_tokens: 500--timeout: 60 (seconds)--pass_at_n: 32 (Pass@n metric for proof generation)--gpu: 1 (number of GPUs for proof generation)--use_embedding_search: FalseTrue only if you have GPU resources for embedding-based Lean retrieval.)You can override any of these options. Check src/ecp/main.py for the full list of arguments.
After experiments, summarize answer/proving accuracies for a dataset (constructivebench, putnam, or test):
python summarize_result.py --base <dataset>
If you find this work useful, please cite:
@misc{sun2025enumerateconjectureproveformallysolvinganswerconstruction,
title = {Enumerate-Conjecture-Prove: Formally Solving Answer-Construction Problems in Math Competitions},
author = {Jialiang Sun and Yuzhi Tang and Ao Li and Chris J. Maddison and Kuldeep S. Meel},
year = {2025},
eprint = {2505.18492},
archivePrefix= {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2505.18492},
}
The prover part of this repository use code from Goedel-Prover. Some of raw problems from the following datasets were included in ConstructiveBench, as mentioned in the paper: