Reference. Formal P-Category Theory and Normalization by Evaluation in Rocq

Traditional category theory is typically based on set-theoretic principles and ideas, which are often non-constructive. An alternative approach to formalizing category theory is to use E-category theory, where hom sets become setoids. Our work reconsiders a third approach - P-category theory - from Čubrić et al. (1998) emphasizing a computational standpoint. We formalize in Rocq a modest library of P-category theory - where homs become subsetoids - and apply it to formalizing algorithms for normalization by evaluation which are purely categorical but, surprisingly, do not use neutral and normal terms. Čubrić et al. (1998) establish only a soundness correctness property by categorical means; here, we extend their work by providing a categorical proof also for a strong completeness property. For this we formalize the full universal property of the free Cartesian-closed category, which is not known to have been performed before. We further formalize a novel universal property of unquotiented simply typed lambda-calculus syntax and apply this to a proof of correctness of a categorical normalization by evaluation algorithm. We pair the overall mathematical development with a formalization in the Rocq proof assistant, following the principle that the formalization exists for practical computation. Indeed, it permits extraction of synthesized normalization programs that compute (long) beta-eta-normal forms of simply typed lambda-terms together with a derivation of beta-eta-conversion.

Cite

Cite as @berry_fiore_2025 (helia, typst) · \cite{berry_fiore_2025} (LaTeX)
BibTeX
bibtex · 10 lines
@misc{berry_fiore_2025,
  doi = {10.48550/ARXIV.2505.07780},
  url = {https://arxiv.org/abs/2505.07780},
  author = {Berry, David G. and Fiore, Marcelo P.},
  keywords = {Logic in Computer Science (cs.LO), Category Theory (math.CT), FOS: Computer and information sciences, FOS: Computer and information sciences, FOS: Mathematics, FOS: Mathematics, F.3.2; F.4.1, 03B40, 03B38, 68N18},
  title = {Formal P-Category Theory and Normalization by Evaluation in Rocq},
  publisher = {arXiv},
  year = {2025},
  copyright = {Creative Commons Attribution Non Commercial No Derivatives 4.0 International}
}
hayagriva YAML (typst)
yaml · 11 lines
berry_fiore_2025:
  type: misc
  title: Formal P-Category Theory and Normalization by Evaluation in Rocq
  author:
  - Berry, David G.
  - Fiore, Marcelo P.
  date: 2025
  publisher: arXiv
  url: https://arxiv.org/abs/2505.07780
  serial-number:
    doi: 10.48550/ARXIV.2505.07780
Cited by (1)

Mechanizing Synthetic Tait Computability in Istari li_etal_2025

Categorical gluing is a powerful technique for proving meta-theorems of type theories such as canonicity and normalization. Synthetic Tait Computability (STC) provides an abstract treatment of the complex gluing models by internalizing the gluing category into a modal dependent type theory with a phase distinction. This work presents a mechanization of STC in the Istari proof assistant. Istari is a Martin-Löf-style extensional type theory with equality reflection, which avoids much of the explicit transport reasoning typically found in intensional proof assistants. This work develops a reusable library for synthetic phase distinction, including modalities, extension types, and strict glue types, and applies it to two case studies: (1) a canonicity model for dependent type theory with dependent products and booleans with large elimination, and (2) a Kripke canonicity model for the cost-aware logical framework. Our results demonstrate that the core STC constructions can be formalized essentially verbatim in Istari, preserving the elegance of the on-paper arguments while ensuring machine-checked correctness.
PDF · DOI · arXiv · pldb
Cites 18 works (3 here)
With notes (3)

Semantic analysis of normalisation by evaluation for typed lambda calculus fiore-2022-semantic

This paper studies normalisation by evaluation for typed lambda calculus from a categorical and algebraic viewpoint. The first part of the paper analyses the lambda definability result of Jung and Tiuryn via Kripke logical relations and shows how it can be adapted to unify definability and normalisation, yielding an extensional normalisation result. In the second part of the paper, the analysis is refined further by considering intensional Kripke relations (in the form of Artin–Wraith glueing) and shown to provide a function for normalising terms, casting normalisation by evaluation in the context of categorical glueing. The technical development includes an algebraic treatment of the syntax and semantics of the typed lambda calculus that allows the definition of the normalisation function to be given within a simply typed metatheory. A normalisation-by-evaluation program in a dependently typed functional programming language is synthesised.
DOI · arXiv

Formalizing category theory in Agda hu-2021-formalizing

PDF · DOI · arXiv · pldb

Normalization and the Yoneda embedding NormalizationAndTheYonedaEmbedding

We show how to solve the word problem for simply typed λβη-calculus by using a few well-known facts about categories of presheaves and the Yoneda embedding. The formal setting for these results is 𝒫-category theory, a version of ordinary category theory where each hom-set is equipped with a partial equivalence relation. The part of 𝒫-category theory we develop here is constructive and thus permits extraction of programs from proofs. It is important to stress that in our method we make no use of traditional proof-theoretic or rewriting techniques. To show the robustness of our method, we give an extended treatment for more general λ-theories in the Appendix.
DOI
External (15)
  • The Lean Mathematical Library (2020)
  • Definitional proof-irrelevance without K (2019)
  • The HoTT library: a formalization of homotopy type theory in Coq (2017)
  • A Machine-Checked Correctness Proof of Normalization by Evaluation for Simply Typed Lambda Calculus (2017)
  • The Forgotten Turing (2016)
  • Experience Implementing a Performant Category-Theory Library in Coq (2014)
  • Strongly Typed Term Representations in Coq (2012)
  • Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums (2004)
  • Semantic Analysis of Normalisation by Evaluation for Typed Lambda Calculus (2002)
  • Normalization by evaluation for typed lambda calculus with coproducts (2001)
  • Constructive Category Theory (2000)
  • Categorical Reconstruction of a Reduction Free Normalization Proof (1995)
  • An inverse of the evaluation functional for typed λ-calculus (1991)
  • The strength of the subset type in Martin-Löf's type theory (1988)
  • On the axiom of extensionality - Part I (1956)
berry_fiore_2025 reference entries/refs/berry_fiore_2025/berry_fiore_2025.hel