Skip to content

lenianiva/PyPantograph

Repository files navigation

PyPantograph

A Machine-to-Machine Interaction System for Lean 4.

Installation

  1. Install poetry
  2. Clone this repository with submodules:
git clone --recursive-submodules <repo-path>
  1. Install elan and lake: See Lean Manual
  2. Execute
poetry build
poetry install

Examples

For API interaction examples, see examples/README.md

An agent based on the sglang library is provided in pantograph/search_llm.py. To use this agent, set the environment variable OPENAI_API_KEY, and run

python3 -m pantograph.search_llm

Experiments

In experiments/, there are some experiments:

  1. minif2f/ is an example of executing a SGLANG based prover on the miniF2F dataset
  2. dsp is an Lean implementation of Draft-Sketch-Prove

If the experiments don't work, run them in poetry shell. The environment variable OPENAI_API_KEY must be set when running experiments calling the OpenAI API.

Referencing

@misc{pantograph,
	title = "Pantograph, A Machine-to-Machine Interface for Lean 4",
	author = {Aniva, Leni and Miranda, Brando and Sun, Chuyue},
	year = 2024,
	howpublished = {\url{https://github.com/lenianiva/PyPantograph}}
}