GFLean: An Autoformalisation Framework for Lean via GF
Shashank Pathak
TL;DR
GFLean tackles the challenge of autoformalising mathematical text into Lean input by combining Grammatical Framework with a Haskell-based processing pipeline to translate Simplified ForTheL statements into Lean expressions. The four-stage pipeline—parsing, AST simplification, AST transformation, and Lean linearization—provides a modular, grammar-driven path from informal mathematical statements to formal Lean code. Empirical results show that 42 of 62 statements from a standard textbook can be formalised with minor rephrasing, while remaining gaps highlight lexicon limitations and linguistic coverage. The work discusses limitations and future directions, including expanding the grammar and integrating with Lean to enable dynamic interaction, and argues for a hybrid approach that combines rule-based and neural translation for robustness.
Abstract
We present an autoformalisation framework for the Lean theorem prover, called GFLean. GFLean uses a high-level grammar writing tool called Grammatical Framework (GF) for parsing and linearisation. GFLean is implemented in Haskell. We explain the functionalities of GFLean, its inner working and discuss its limitations. We also discuss how we can use neural network based translation programs and rule based translation programs together complimenting each other to build robust autoformalisation frameworks.
