A Modular Lean 4 Framework for Confluence and Strong Normalization of Lambda Calculi with Products and Sums
Arthur Ramos, Anjolina Oliveira, Ruy de Queiroz, Tiago de Veras

TL;DR
This paper introduces Metatheory, a modular Lean 4 library that mechanizes proofs of confluence and strong normalization for various lambda calculi and rewriting systems, ensuring rigorous formal verification.
Contribution
It provides the first comprehensive Lean 4 framework for confluence and normalization proofs across multiple lambda calculus variants and rewriting systems.
Findings
Successfully mechanized confluence proofs for six case studies.
Established strong normalization via logical relations.
Demonstrated the framework's applicability to diverse calculi.
Abstract
We present Metatheory, a comprehensive library for programming language foundations in Lean 4. The library features a modular framework for proving confluence of abstract rewriting systems using three classical proof techniques: the diamond property, Newmans lemma, and the Hindley-Rosen lemma. These are instantiated across six case studies including untyped lambda calculus, combinatory logic, term rewriting, simply typed lambda calculus, and STLC with products and sums. All theorems are fully mechanized with zero axioms or sorry statements. We provide complete proofs of de Bruijn substitution infrastructure and demonstrate strong normalization via logical relations. To our knowledge, this is the first comprehensive confluence and normalization framework for Lean 4.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Logic, Reasoning, and Knowledge · Formal Methods in Verification
