← All papers
First page of Record Types Everywhere

Record Types Everywhere

Matthew Toohey, Ara Jamalzadeh, Ningning Xie

cs.PL Oct 20, 2026 · v1
The record calculus, its reference extension, all metatheorems, and a verified interpreter equivalent to the operational semantics are mechanized in Lean 4.
This paper introduces a novel calculus that models first-class environments and function application paradigms using standard record types. By proposing new extensions to general record types, we achieve a design that is remarkably simple and principled. We formalise this design in a core calculus and prove several desirable properties, including type soundness, normalization, and a simulation of the simply typed lambda calculus. Additionally, we extend the design with mutable references. The calculus, its semantics, along with the extension, and all stated properties are fully mechanized in the Lean 4 proof assistant, alongside an interpreter formally verified to be equivalent to the operational semantics.

Lambda calculi based on substitution make variable binding hard to reason about and to mechanize. They also fail to capture common argument-passing paradigms such as named, positional, and optional arguments.

The authors define a core calculus that uses standard record types to model first-class environments and function arguments, with extensions supporting named, optional, and positional arguments and partial application. The calculus is then extended with mutable references, with stores also modelled as records. Everything is mechanized in Lean 4, using locally nameless representation for type variables. Derivation-depth-indexed relations serve as well-founded measures, and Lean's partial_fixpoint defines the interpreter.

Type soundness, normalization, a simulation of STLC, big-step equivalence, and syntax-directed typing are proved in about 29.6k lines of Lean across 1000 declarations. The development also includes an interpreter verified equivalent to the operational semantics.

ComponentLOCDecls
Type Soundness16260773
Normalization593293
Syntax-Directed Typing469511
STLC Correspondence136665
Total296191000
Code stats of mechanization and implementation