Core Concepts
GFLean is an autoformalisation framework that translates simple mathematical statements expressed in a controlled natural language called Simplified ForTheL to corresponding expressions in the Lean theorem prover.
Abstract
GFLean is an ongoing project that aims to automate the process of formalising mathematical statements. It uses a high-level grammar writing tool called Grammatical Framework (GF) for parsing the input and linearizing the output.
The key steps in the GFLean pipeline are:
Parsing the input statement written in Simplified ForTheL, a simplified version of the controlled natural language ForTheL, using a GF grammar to produce an abstract syntax tree (AST).
Simplifying the AST through a series of tree transformations implemented in Haskell.
Translating the simplified AST to an AST for the corresponding Lean expression.
Linearizing the Lean AST to the final Lean expression using another GF grammar.
GFLean can currently formalise 42 out of 62 statements from Chapter 3 of the textbook "Mathematical Proofs" by G. Chartrand, A. D. Polimeni, and P. Zhang. The limitations include a small lexicon, lack of support for certain linguistic constructs like conjunction of predicates, and the inability to dynamically extend the lexicon during runtime.
Stats
example (x : R) (h39 : x < 0) : ((x ^ 2) + 1) > 0 := sorry
example (x : R) (h57 : (((x ^ 2) - (2 * x)) + 2) ≤0) : (x ^ 3) ≥8 := sorry
example (x : R) (h64 : x > 0) (h51 : x < 1) : (((x ^ 2) - (2 * x)) + 2) ≠ 0 := sorry
example (r : Q) (h76 : pos r) (h63 : (((r ^ 2) + 1) / r) ≤1) : (((r ^ 2) + 2) / r) ≤2 := sorry
example (x : R) (h70 : (((x ^ 3) - (5 * x)) - 1) ≥0) : ((x - 1) * (x - 3)) ≥-2 := sorry