A Mechanized Proof of the Bar-Hillel–Gaifman–Shamir Theorem in Lean 4: Weak Equivalence of AB Categorial Grammars and Context-Free Grammars

The theorem of Bar-Hillel, Gaifman, and Shamir (1960) establishes the foundational equivalence between Chomsky's phrase-structure Context-Free Grammars (CFGs) and Ajdukiewicz–Bar-Hillel Basic Categorial Grammars (ABGs). We present both a complete, self-contained mathematical exposition and its machine-checked formalization in Lean 4 (v4.36.0), spanning 2,147 lines across 9 modules with zero external libraries (no Mathlib), zero sorrys, and zero custom axioms. Both formalisms are specified via their textbook string-rewriting and directional slash-cancellation semantics and bridged to structural derivation trees. For ABG → CFG, the classical subcategory argument gives a finite translation whose proof uses neither decidable equality nor the axiom of choice. For CFG → ABG, we develop a finite-universe monotone fixpoint engine supporting a binarize-first Chomsky Normal Form pipeline followed by a left-corner construction to 2-standard Greibach Normal Form, yielding the main equivalence together with its unidirectional refinement: every ε-free context-free language is generated by a right-slash-only AB grammar of slash-nesting depth at most 2. Source code repository: https://github.com/bocchitherock888-ux/lean-grammar-equivalences (archived at DOI: 10.5281/zenodo.24622877). Keywords: Lean 4, formal linguistics, categorial grammar, context-free grammar, Chomsky normal form, Greibach normal form, interactive theorem proving

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-28
DOI
https://doi.org/10.5281/zenodo.24623323
Primary Topic
semigroups and automata theory
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

A Mechanized Proof of the Bar-Hillel–Gaifman–Shamir Theorem in Lean 4: Weak Equivalence of AB Categorial Grammars and Context-Free Grammars

bocchitherock888-ux
Zenodo (CERN European Organization for Nuclear Research)
semigroups and automata theory
preprint

A Mechanized Proof of the Bar-Hillel–Gaifman–Shamir Theorem in Lean 4: Weak Equivalence of AB Categorial Grammars and Context-Free Grammars

bocchitherock888-ux
preprint en

Abstract

The theorem of Bar-Hillel, Gaifman, and Shamir (1960) establishes the foundational equivalence between Chomsky's phrase-structure Context-Free Grammars (CFGs) and Ajdukiewicz–Bar-Hillel Basic Categorial Grammars (ABGs). We present both a complete, self-contained mathematical exposition and its machine-checked formalization in Lean 4 (v4.36.0), spanning 2,147 lines across 9 modules with zero external libraries (no Mathlib), zero sorrys, and zero custom axioms. Both formalisms are specified via their textbook string-rewriting and directional slash-cancellation semantics and bridged to structural derivation trees. For ABG → CFG, the classical subcategory argument gives a finite translation whose proof uses neither decidable equality nor the axiom of choice. For CFG → ABG, we develop a finite-universe monotone fixpoint engine supporting a binarize-first Chomsky Normal Form pipeline followed by a left-corner construction to 2-standard Greibach Normal Form, yielding the main equivalence together with its unidirectional refinement: every ε-free context-free language is generated by a right-slash-only AB grammar of slash-nesting depth at most 2. Source code repository: https://github.com/bocchitherock888-ux/lean-grammar-equivalences (archived at DOI: 10.5281/zenodo.24622877). Keywords: Lean 4, formal linguistics, categorial grammar, context-free grammar, Chomsky normal form, Greibach normal form, interactive theorem proving

Zenodo (CERN European Organization for Nuclear Research)
semigroups and automata theory
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
A Mechanized Proof of the Bar-Hillel–Gaifman–Shamir Theorem in Lean 4: Weak Equivalence of AB Categorial Grammars and Context-Free Grammars — bocchitherock888-ux · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS