cs.AINov 24, 2026

Verified Proof Refactoring with Codex and Qwen

Authors: Lazar Milikic, Gordan Đurić, Viktor Kunčak

Organizations: EPFL, Lausanne, Switzerland

Abstract

We refactor existing Lean 4 proofs to reduce source length and checking cost while preserving theorem statements and compatibility across Lean versions. A locally served Qwen model uses the open-source Codex CLI to inspect source, retrieve declarations, and test proof replacements. The host keeps a replacement only if it improves the objective and Lean accepts it on every required version. A deterministic CPU pass then refines the verified proofs. On the 60 problems in Lean Refactor Arena, model search achieves a local mean combined score of 82.07, and cleanup raises it to 82.18. The final proofs pass all 127 required proof--version checks. Our system placed first in the open-source LLM track of Lean Refactor Arena at VeriCodeGen.

Figures & tables

Explore similar work

CardsList
  1. Lean Refactor: Multi-Objective Controllable Proof Optimization via Agentic Strategy Search

    May 18, 2026Jialin Lu, Soonho Kong, Rodrigo Stehling +4Large Language Model-Guided OptimizationLean Theorem Proving

  2. Proof-Refactor: Refactoring Generated Formal Proofs into Modular Artifacts

    Jun 2, 2026Yiming Fu, Peixuan Liu, Zichen Wang +1Interactive Theorem ProvingLean Theorem Proving