Categories and Types for Axiomatic Domain Theory Adam Eppendahl
Total Page:16
File Type:pdf, Size:1020Kb
Department of Computer Science Research Report No. RR-03-05 ISSN 1470-5559 December 2003 Categories and Types for Axiomatic Domain Theory Adam Eppendahl 1 Categories and Types for Axiomatic Domain Theory Adam Eppendahl Submitted for the degree of Doctor of Philosophy University of London 2003 2 3 Categories and Types for Axiomatic Domain Theory Adam Eppendahl Abstract Domain Theory provides a denotational semantics for programming languages and calculi con- taining fixed point combinators and other so-called paradoxical combinators. This dissertation presents results in the category theory and type theory of Axiomatic Domain Theory. Prompted by the adjunctions of Domain Theory, we extend Benton’s linear/nonlinear dual- sequent calculus to include recursive linear types and define a class of models by adding Freyd’s notion of algebraic compactness to the monoidal adjunctions that model Benton’s calculus. We observe that algebraic compactness is better behaved in the context of categories with structural actions than in the usual context of enriched categories. We establish a theory of structural algebraic compactness that allows us to describe our models without reference to en- richment. We develop a 2-categorical perspective on structural actions, including a presentation of monoidal categories that leads directly to Kelly’s reduced coherence conditions. We observe that Benton’s adjoint type constructors can be treated individually, semantically as well as syntactically, using free representations of distributors. We type various of fixed point combinators using recursive types and function types, which we consider the core types of such calculi, together with the adjoint types. We use the idioms of these typings, which include oblique function spaces, to give a translation of the core of Levy’s Call-By-Push-Value. The translation induces call-by-value and call-by-name translations of the core of Plotkin’s Fixed Point Calculus. Following Freyd, we construct a canonical fixed point operation from the algebras provided by the algebraic compactness of our models. Our analysis of Freyd’s construction exposes a remarkable property of morphisms from coalgebras to algebras: morphisms from Gp to s corre- spond one-for-one to morphisms from p to Hs, where p is a coalgebra for HG and s an algebra for GH. We give an application of this property to the transposition of recursive coalgebras in Taylor’s categorical theory of recursion where G is not left adjoint to H. We develop a theory of parametric transformations corresponding to the uniformity property characterizing canonical fixed points and use this to derive abstract conditions on categories of domains which ensure that the interpretation of fixed point combinators coincides with the canonical fixed point operation. Submitted for the degree of Doctor of Philosophy University of London 2003 4 Contents 1 Introduction 6 1.1 Background . 6 1.1.1 Axiomatic Domain Theory . 6 1.1.2 Fixed Points . 8 1.1.3 Categorical Semantics of Linear and Computation Types . 8 1.2 Main Results . 9 1.2.1 Recursive Morphisms . 9 1.2.2 Structural Algebraic Compactness . 9 1.2.3 Adjoint Types and Free Distributor Representations . 10 1.2.4 Quotient Relations . 11 1.3 Additional Contributions . 11 1.3.1 Minimal Coherence . 11 1.3.2 Fixed Point Algebras . 12 1.3.3 Exponential Structure . 12 1.3.4 Oblique Types . 13 1.3.5 Directors . 13 1.4 Overview . 13 1.4.1 Category Theory . 13 1.4.2 Type Theory . 14 2 Recursive Morphisms 16 2.1 Oblique Adjunctions for Free . 17 2.1.1 The Distributor of Recursive Morphisms . 17 2.1.2 Two Oblique Adjunctions . 18 2.2 Recursive Coalgebras and Corecursive Algebras . 20 2.2.3 Preservation of Recursive Coalgebras . 21 2.2.5 Freyd’s Square for Recursive Coalgebras . 21 2.2.9 Transposition of Corecursive Algebras and Recursive Coalgebras . 22 3 Monoidal Categories and Structural Actions 25 3.1 Lax Monoids and Comonoids . 25 3.1.1 Lax Monoid 0-Cells . 25 3.1.3 Lax Monoid 1-Cells . 26 3.1.8 Lax Comonoids . 32 3.1.10 Preservation of Internal Comonoids . 35 3.2 Monoidal Categories . 35 3.2.1 The Monoidal Category of Endofunctors . 35 3.2.2 The Transpose of Lax Monoid Structure . 36 3.2.3 Coherent Lax Monoids and Monoidal Categories . 36 3.3 Structural Actions . 37 3.3.3 Diagonal Structure . 38 3.3.6 The Indexed Category Construction . 38 5 4 Structural Algebraic Compactness 41 4.1 Algebraic Compactness in the Structural Setting . 42 4.1.3 The structurality of delivery functors. 42 4.1.12 The structural compactness of opposites and doubles. 44 4.2 Compactness in Various Settings . 45 4.2.1 Indexed Compactness . 45 4.2.4 Structural Compactness and Indexed Compactness . 46 4.2.8 Enriched Compactness and Indexed Compactness . 46 4.2.12 Structural Compactness Meets Enriched Compactness . 48 4.3 Structurally Algebraically Compact Categories of Domains . 48 4.3.1 Categories of Pointed Objects . 48 4.3.5 Categories of Partial Maps . 49 5 Structural Adjunctions 50 5.1 Monoidal Adjunctions as Structural Adjunctions . 50 5.1.3 Closed Structure . 51 5.1.8 Cartesian Structure . 51 5.1.13 Symmetric Structure . 52 5.2 Structural Adjunctions Proper . 52 5.2.2 Structurality and Balance . 53 5.2.6 Exponential Structure . 53 5.3 Structural Adjunctions on Categories of Domains . 55 5.3.1 Categories of Eilenberg-Moore Algebras . 55 5.3.4 Categories of Kleisli Maps . 55 6 Canonical Fixed Points 57 6.1 Corecursive Algebras and Unique Fixed Points . 57 6.1.2 Very Unique Fixed Points and Unique Fixed Generalized Points . 58 6.1.7 Comonoids and Parameterized Unique Fixed Points . 60 6.1.10 Comonads and Parameterized Unique Fixed Points . 61 6.2 Fixed Point Algebras . 62 6.2.3 Uniform Families of Recursive Morphisms . 62 6.2.8 Transposition of Fixed Point Algebras . 63 6.2.11 Fixed Point Objects as Fixed Point Algebras . 65 6.2.17 Freyd Algebras as Fixed Point Algebras . 66 6.3 Canonical Fixed Points in Compact Structural Adjunctions . 67 6.3.1 Ordinary Fixed Points . 67 6.3.2 Parameterized Fixed Points . 67 6.3.3 Internal Fixed Points . 68 6.3.4 Uniform Fixed Points . 68 7 Recursive Linear Types 70 7.1 A Recursive Linear/NonLinear Calculus . 70 7.1.1 Linear and Nonlinear Lambda Calculi . 71 7.1.2 Admissible Weakenings and Contractions . 72 7.1.3 Pairing and Units . 73 7.1.4 Recursive Linear Types . 73 7.2 Oblique Terms and Types . 78 7.2.1 The Term Distributor . 78 7.2.2 The Adjoint Fragments of LNL . 78 7.2.5 The Oblique Function Types . 80 6 Contents 8 Recursive Types for Fixed Point Combinators 83 8.1 Recursive Combinators in Recursive Types . 83 8.1.1 Recursive Combinators in FPC . 85 8.1.2 Recursive Combinators in RLNL . 89 8.2 A Linear Fixed Point Calculus . 98 8.2.1 Fixed Point Idioms . 98 8.2.2 Translating FPC into RLNL . 100 8.2.3 Parameterized Adjoint Types . 101 9 Quotient Relations and Parametric Models 106 9.1 Quotient Diparametricity . 106 9.1.1 Quotient Relations . 106 9.1.5 Push-me-pull-you’s . 108 9.1.10 Componentwise Liftings . 110 9.1.12 Uniformity as Quotient Diparametricity . 113 9.2 Domain Theoretic Models of Recursive Linear Types . 116 9.2.1 RLNL Models . 116 9.2.5 Recursive Types in Term Models . 117 9.2.7 Uniformity in RLNL Models . 119 9.2.9 Fixed Point Combinators in Domain Theoretic Models . 120 10 Directions for Future Work 121 10.1 Fox’s Construction and Lemma ?? . 121 10.2 The Free Adjunction on the Distributor Classifier . 121 10.3 Logical Relations . 121 10.4 Other Fixed Point Transformations . 122 10.5 Other Recursive Types . 122 10.6 Parametricity and Compactness . 123 10.7 Models of closed LNL. 123 10.8 2-Categories for Types . 123 Bibliography 125 A Distributors and Directors 128 A.1 Distributors.