Some Aspects of Categories in Computer Science

Total Page:16

File Type:pdf, Size:1020Kb

Some Aspects of Categories in Computer Science This is a technical rep ort A mo died version of this rep ort will b e published in Handbook of Algebra Vol edited by M Hazewinkel Some Asp ects of Categories in Computer Science P J Scott Dept of Mathematics University of Ottawa Ottawa Ontario CANADA Sept Contents Intro duction Categories Lamb da Calculi and FormulasasTyp es Cartesian Closed Categories Simply Typ ed Lamb da Calculi FormulasasTyp es the fundamental equivalence Some Datatyp es Polymorphism Polymorphic lamb da calculi What is a Mo del of System F The Untyp ed World Mo dels and Denotational Semantics CMonoids and Categorical Combinators Church vs Curry Typing Logical Relations and Logical Permutations Logical Relations and Syntax Example ReductionFree Normalization Categorical Normal Forms P category theory and normalization algorithms Example PCF PCF Adequacy Parametricity Dinaturality Reynolds Parametricity Linear Logic Monoidal Categories Gentzens pro of theory Gentzen sequents Research partially supp orted by NSERC Canada Girards Analysis of the Structural Rules Fragments and Exotic Extensions Top ology of Pro ofs What is a categorical mo del of LL General Mo dels Concrete Mo dels Full Completeness Representation Theorems Full Completeness Theorems Linear Lauchli Semantics Feedback and Trace Traced Monoidal Categories Partially Additive Categories GoI Categories Literature Notes Intro duction Over the past years category theory has b ecome an increasingly signicant conceptual and practical to ol in many areas of computer science There are ma jor conferences and journals de voted wholly or partially to applying categorical metho ds to computing At the same time the close connections of computer science to logic have seen categorical logic develop ed in the s fruitfully applied in signicant ways in b oth theory and practice Given the rapid and enormous development of the sub ject and the availability of suitable gradu ate texts and sp ecialized survey articles we shall only examine a few of the areas that app ear to the author to have conceptual and mathematical interest to the readers of this Handb o ok Along with the many references in the text the reader is urged to examine the nal section Literature Notes where we reference omitted imp ortant areas as well as the Bibliography We shall b egin by discussing the close connections of certain closed categories with typ ed lamb da calculi on the one hand and with the pro of theory of various logics on the other It cannot b e overemphasized that mo dern computer science heavily uses formal syntax but we shall try to tread lightly The socalled CurryHoward isomorphism which identies formal pro ofs with lamb da terms hence with arrows in certain free categories is the cornerstone of mo dern programming language semantics and simply cannot b e overlo oked o Notation We often elide comp osition symb ols writing g f A C for g f A C whenever f A B and g B C To save some space we have omitted large numb ers of routine diagrams which the reader can nd in the sources referenced Categories Lamb da Calculi and FormulasasTyp es Cartesian Closed Categories Cartesian closed categories cccs were develop ed in the s by F W Lawvere Law Law Both Lawvere and Lamb ek L stressed their connections to Churchs lamb da calculus as well as to intuitionistic pro of theory In the s work of Dana Scott and Gordon Plotkin established their fundamental role in the semantics of programming languages A precise equivalence b etween these three notions cccs typ ed lamb da calculi and intuitionistic pro of theory was published in Lamb ek and Scott LS We recall the appropriate denitions from LS Ob jects Distinguished Arrows Equations ! A Terminal A f A f A AB o A B A hf g i f 1 1 AB o Pro ducts A B A B B hf g i g 2 2 f g C A C B o o h h hi h 1 2 hf g i C A B h C A B A A o o i f Exp onentials B ev B A B ev hf 1 2 AB f C A B o o ev hg i g 1 2 f A A C B g C B Figure CCCs Equationally Denition i A cartesian category C is a category with distinguished nite pro ducts equivalently binary pro ducts and a terminal ob ject This says there are isomorphisms natural in A B C H om A fg C H om C A B H om C A H om C B C C C ii A cartesian closed category C is a cartesian category C such that for each ob ject A C A the functor A C C has a sp ecied right adjoint denoted That is there is an isomorphism natural in B and C A H om C A B H om C B C C For many purp oses in computer science it is often useful to have categories with explicitly given strict structure along with strict functors that preserve everything on the nose We may present such cccs equationally in the spirit of multisorted universal algebra The arrows and equations are summarized in Figure These equations determine the isomorphisms and In this presentation we say the structure is strict meaning there is only one ob ject representing each of A A the ab ove constructs A B B The exp onential ob ject B is often called the function space of A and B In the computer science literature the function space is often denoted A B while the f A arrow C B is often called currying of f Remark Following most categorical logic and computer science literature we do not assume cccs have nite limits Law LS AC Mit in order to keep the corresp ondence with simply typ ed lamb da calculi cf Theorem b elow Earlier b o oks cf Mac do not always follow this convention Let us list some useful examples of cartesian closed categories for details see LS Mit Mac Example The category Set of sets and functions Here A B is a chosen cartesian pro duct ev A A and B is the set of functions from A to B The map B A B is the usual evaluation map f A B is the map c a f c a while currying C An imp ortant subfamily of examples are Henkin models which are cccs in which the terminal ob ject is a generator Mit Theorem More concretely for a lamb da calculus signature with freely generated typ es cf Section b elow a Henkin model A is a typ eindexed family of A sets A fA j a typ e g where A fg A A A A A which forms a ccc with 1 resp ect to restriction of the usual ccc structure of Set In the case of atomic base sorts b A is b some xed but arbitrary set A ful l type hierarchy is a Henkin mo del with full function spaces ie A A A op C Example More generally the functor category Set of presheaves on C is cartesian closed Its ob jects are contravariant functors from C to Set and its arrows are natural transformations op C b etween them We sketch the ccc structure given F G Set dene F G p ointwise on F A ob jects and arrows Motivated by Yonedas Lemma dene G A N ath F G where A F h H omA This easily extends to a functor Finally if H F G dene H G by a h c H ha c C C A Functor categories have b een used in studying problematic semantical issues in Algollike lan guages Rey Ol OHT Ten as well as recently in concurrency theory and mo dels of calculus CSW CaWi Sp ecial cases of presheaves have b een studied extensively Mit LS op C Let C b e a p oset qua trivial category Then Set the category of Kripke mo dels over C may b e identied with sets indexed or graded by the p oset C Such mo dels are fundamental in intuitionistic logic LS TrvD and also arise in Kripke Logical Relations an imp ortant to ol in semantics of programming languages Mit OHT OHRi Let C O X the p oset of op ens of the top ological space X The sub category S hX of sheaves on X is cartesian closed op C is the category of M Let C b e a monoid M qua category with one ob ject Then Set sets ie sets X equipp ed with a left action equivalently a monoid homomorphism M E ndX where E ndX is the monoid of endomaps of X Morphisms of M sets X and Y are equivariant maps ie functions commuting with the action A sp ecial case of this is when M is actually a group G qua category with one ob ject where all maps are isos In op C that case Set is the category of Gsets the category of p ermutational representations of G Its ob jects are sets X equipp ed with left actions G S y mX and whose morphisms are equivariant maps We shall return to these examples when we sp eak of Lauc hli semantics and Full Completeness Section Example CPO Ob jects are p osets P such that countable ascending chains a a a 0 1 2 have suprema Morphisms are maps which
Recommended publications
  • A Category-Theoretic Approach to Representation and Analysis of Inconsistency in Graph-Based Viewpoints
    A Category-Theoretic Approach to Representation and Analysis of Inconsistency in Graph-Based Viewpoints by Mehrdad Sabetzadeh A thesis submitted in conformity with the requirements for the degree of Master of Science Graduate Department of Computer Science University of Toronto Copyright c 2003 by Mehrdad Sabetzadeh Abstract A Category-Theoretic Approach to Representation and Analysis of Inconsistency in Graph-Based Viewpoints Mehrdad Sabetzadeh Master of Science Graduate Department of Computer Science University of Toronto 2003 Eliciting the requirements for a proposed system typically involves different stakeholders with different expertise, responsibilities, and perspectives. This may result in inconsis- tencies between the descriptions provided by stakeholders. Viewpoints-based approaches have been proposed as a way to manage incomplete and inconsistent models gathered from multiple sources. In this thesis, we propose a category-theoretic framework for the analysis of fuzzy viewpoints. Informally, a fuzzy viewpoint is a graph in which the elements of a lattice are used to specify the amount of knowledge available about the details of nodes and edges. By defining an appropriate notion of morphism between fuzzy viewpoints, we construct categories of fuzzy viewpoints and prove that these categories are (finitely) cocomplete. We then show how colimits can be employed to merge the viewpoints and detect the inconsistencies that arise independent of any particular choice of viewpoint semantics. Taking advantage of the same category-theoretic techniques used in defining fuzzy viewpoints, we will also introduce a more general graph-based formalism that may find applications in other contexts. ii To my mother and father with love and gratitude. Acknowledgements First of all, I wish to thank my supervisor Steve Easterbrook for his guidance, support, and patience.
    [Show full text]
  • ÉCLAT MATHEMATICS JOURNAL Lady Shri Ram College for Women
    ECLAT´ MATHEMATICS JOURNAL Lady Shri Ram College For Women Volume X 2018-2019 HYPATIA This journal is dedicated to Hypatia who was a Greek mathematician, astronomer, philosopher and the last great thinker of ancient Alexandria. The Alexandrian scholar authored numerous mathematical treatises, and has been credited with writing commentaries on Diophantuss Arithmetica, on Apolloniuss Conics and on Ptolemys astronomical work. Hypatia is an inspiration, not only as the first famous female mathematician but most importantly as a symbol of learning and science. PREFACE Derived from the French language, Eclat´ means brilliance. Since it’s inception, this journal has aimed at providing a platform for undergraduate students to showcase their understand- ing of diverse mathematical concepts that interest them. As the journal completes a decade this year, it continues to be instrumental in providing an opportunity for students to make valuable contributions to academic inquiry. The work contained in this journal is not original but contains the review research of students. Each of the nine papers included in this year’s edition have been carefully written and compiled to stimulate the thought process of its readers. The four categories discussed in the journal - History of Mathematics, Rigour in Mathematics, Interdisciplinary Aspects of Mathematics and Extension of Course Content - give a comprehensive idea about the evolution of the subject over the years. We would like to express our sincere thanks to the Faculty Advisors of the department, who have guided us at every step leading to the publication of this volume, and to all the authors who have contributed their articles for this volume.
    [Show full text]
  • Knowledge Representation in Bicategories of Relations
    Knowledge Representation in Bicategories of Relations Evan Patterson Department of Statistics, Stanford University Abstract We introduce the relational ontology log, or relational olog, a knowledge representation system based on the category of sets and relations. It is inspired by Spivak and Kent’s olog, a recent categorical framework for knowledge representation. Relational ologs interpolate between ologs and description logic, the dominant formalism for knowledge representation today. In this paper, we investigate relational ologs both for their own sake and to gain insight into the relationship between the algebraic and logical approaches to knowledge representation. On a practical level, we show by example that relational ologs have a friendly and intuitive—yet fully precise—graphical syntax, derived from the string diagrams of monoidal categories. We explain several other useful features of relational ologs not possessed by most description logics, such as a type system and a rich, flexible notion of instance data. In a more theoretical vein, we draw on categorical logic to show how relational ologs can be translated to and from logical theories in a fragment of first-order logic. Although we make extensive use of categorical language, this paper is designed to be self-contained and has considerable expository content. The only prerequisites are knowledge of first-order logic and the rudiments of category theory. 1. Introduction arXiv:1706.00526v2 [cs.AI] 1 Nov 2017 The representation of human knowledge in computable form is among the oldest and most fundamental problems of artificial intelligence. Several recent trends are stimulating continued research in the field of knowledge representation (KR).
    [Show full text]
  • The Power of Principles: Physics Revealed
    The Passions of Logic: Appreciating Analytic Philosophy A CONVERSATION WITH Scott Soames This eBook is based on a conversation between Scott Soames of University of Southern California (USC) and Howard Burton that took place on September 18, 2014. Chapters 4a, 5a, and 7a are not included in the video version. Edited by Howard Burton Open Agenda Publishing © 2015. All rights reserved. Table of Contents Biography 4 Introductory Essay The Utility of Philosophy 6 The Conversation 1. Analytic Sociology 9 2. Mathematical Underpinnings 15 3. What is Logic? 20 4. Creating Modernity 23 4a. Understanding Language 27 5. Stumbling Blocks 30 5a. Re-examining Information 33 6. Legal Applications 38 7. Changing the Culture 44 7a. Gödelian Challenges 47 Questions for Discussion 52 Topics for Further Investigation 55 Ideas Roadshow • Scott Soames • The Passions of Logic Biography Scott Soames is Distinguished Professor of Philosophy and Director of the School of Philosophy at the University of Southern California (USC). Following his BA from Stanford University (1968) and Ph.D. from M.I.T. (1976), Scott held professorships at Yale (1976-1980) and Princeton (1980-204), before moving to USC in 2004. Scott’s numerous awards and fellowships include USC’s Albert S. Raubenheimer Award, a John Simon Guggenheim Memorial Foun- dation Fellowship, Princeton University’s Class of 1936 Bicentennial Preceptorship and a National Endowment for the Humanities Research Fellowship. His visiting positions include University of Washington, City University of New York and the Catholic Pontifical University of Peru. He was elected to the American Academy of Arts and Sciences in 2010. In addition to a wide array of peer-reviewed articles, Scott has authored or co-authored numerous books, including Rethinking Language, Mind and Meaning (Carl G.
    [Show full text]
  • Bialgebras in Rel
    CORE Metadata, citation and similar papers at core.ac.uk Provided by Elsevier - Publisher Connector Electronic Notes in Theoretical Computer Science 265 (2010) 337–350 www.elsevier.com/locate/entcs Bialgebras in Rel Masahito Hasegawa1,2 Research Institute for Mathematical Sciences Kyoto University Kyoto, Japan Abstract We study bialgebras in the compact closed category Rel of sets and binary relations. We show that various monoidal categories with extra structure arise as the categories of (co)modules of bialgebras in Rel.In particular, for any group G we derive a ribbon category of crossed G-sets as the category of modules of a Hopf algebra in Rel which is obtained by the quantum double construction. This category of crossed G-sets serves as a model of the braided variant of propositional linear logic. Keywords: monoidal categories, bialgebras and Hopf algebras, linear logic 1 Introduction For last two decades it has been shown that there are plenty of important exam- ples of traced monoidal categories [21] and ribbon categories (tortile monoidal cat- egories) [32,33] in mathematics and theoretical computer science. In mathematics, most interesting ribbon categories are those of representations of quantum groups (quasi-triangular Hopf algebras)[9,23] in the category of finite-dimensional vector spaces. In many of them, we have non-symmetric braidings [20]: in terms of the graphical presentation [19,31], the braid c = is distinguished from its inverse c−1 = , and this is the key property for providing non-trivial invariants (or de- notational semantics) of knots, tangles and so on [12,23,33,35] as well as solutions of the quantum Yang-Baxter equation [9,23].
    [Show full text]
  • Stephen Cole Kleene
    STEPHEN COLE KLEENE American mathematician and logician Stephen Cole Kleene (January 5, 1909 – January 25, 1994) helped lay the foundations for modern computer science. In the 1930s, he and Alonzo Church, developed the lambda calculus, considered to be the mathematical basis for programming language. It was an effort to express all computable functions in a language with a simple syntax and few grammatical restrictions. Kleene was born in Hartford, Connecticut, but his real home was at his paternal grandfather’s farm in Maine. After graduating summa cum laude from Amherst (1930), Kleene went to Princeton University where he received his PhD in 1934. His thesis, A Theory of Positive Integers in Formal Logic, was supervised by Church. Kleene joined the faculty of the University of Wisconsin in 1935. During the next several years he spent time at the Institute for Advanced Study, taught at Amherst College and served in the U.S. Navy, attaining the rank of Lieutenant Commander. In 1946, he returned to Wisconsin, where he stayed until his retirement in 1979. In 1964 he was named the Cyrus C. MacDuffee professor of mathematics. Kleene was one of the pioneers of 20th century mathematics. His research was devoted to the theory of algorithms and recursive functions (that is, functions defined in a finite sequence of combinatorial steps). Together with Church, Kurt Gödel, Alan Turing, and others, Kleene developed the branch of mathematical logic known as recursion theory, which helped provide the foundations of theoretical computer science. The Kleene Star, Kleene recursion theorem and the Ascending Kleene Chain are named for him.
    [Show full text]
  • Part II Topological Dualities
    Part II Top ological dualities Chapter Top ology and armative predicates In the rst part of this monograph we considered predicates to be subsets of an abstract set of states If we think of the states as the denotations of results of computations of programs then predicates b ecome computationally mean ingful in the sense that we can use partial information ab out a computation to tell whether or not a predicate holds for that computation A predicate for which only nite information ab out a computation is needed to arm whether it holds is called an armative predicate The set of armative predicates is closed under nite intersections and ar bitrary unions Hence armative predicates can be identied with the op en sets of a top ological space The idea that op en sets are observable predi cates was prop osed by Smyth in although it is also brie y mentioned in Smyth interprets op en sets as semidecidable prop erties in some eectively given top ological space More generally op en sets can be inter preted as nitely observable predicates Alp ern and Schneider and Kwiatkowska use op en sets as nite liveness predicates and closed sets as safety predicates to formalize the informal characterization of liveness and safety prop erties of Lamp ort The name armative predicates has b een intro duced by Vickers for denoting the abstract op en sets of a frame Armative predicates are also called veriable predicates by Rewitzky who uses the term observable for predicates which are b oth armative and refutative Bonsangue In this chapter we intro
    [Show full text]
  • Spatio-Temporal Domains: an Overview David Janin
    Spatio-temporal domains: an overview David Janin To cite this version: David Janin. Spatio-temporal domains: an overview. 2018. hal-01634897v2 HAL Id: hal-01634897 https://hal.archives-ouvertes.fr/hal-01634897v2 Preprint submitted on 17 Jul 2018 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Spatio-temporal domains: an overview David Janin? UMR LaBRI, Bordeaux INP Université de Bordeaux [email protected] Abstract. We consider the possibility of defining a general mathemat- ical framework for the homogeneous modeling and analysis of hetero- geneous spatio-temporal computations as they occur more and more in modern computerized systems of systems. It appears that certain fibra- tions of posets into posets, called here spatio-temporal domains, eventu- ally provide a fully featured category that extends to space and time the category of cpos and continuous functions, aka Scott Domains, used in classical denotational semantics. 1 Introduction Research context. Program semantics is classically divided between two com- plementary approaches : denotational semantics and operational semantics. De- notational semantics generally refers to what the partial functions encoded by programs are : what is the relationship between (models of) their input val- ues (or input memory state) and their output values (or output memory state).
    [Show full text]
  • Russell's Paradox in Appendix B of the Principles of Mathematics
    HISTORY AND PHILOSOPHY OF LOGIC, 22 (2001), 13± 28 Russell’s Paradox in Appendix B of the Principles of Mathematics: Was Frege’s response adequate? Ke v i n C. Kl e m e n t Department of Philosophy, University of Massachusetts, Amherst, MA 01003, USA Received March 2000 In their correspondence in 1902 and 1903, after discussing the Russell paradox, Russell and Frege discussed the paradox of propositions considered informally in Appendix B of Russell’s Principles of Mathematics. It seems that the proposition, p, stating the logical product of the class w, namely, the class of all propositions stating the logical product of a class they are not in, is in w if and only if it is not. Frege believed that this paradox was avoided within his philosophy due to his distinction between sense (Sinn) and reference (Bedeutung). However, I show that while the paradox as Russell formulates it is ill-formed with Frege’s extant logical system, if Frege’s system is expanded to contain the commitments of his philosophy of language, an analogue of this paradox is formulable. This and other concerns in Fregean intensional logic are discussed, and it is discovered that Frege’s logical system, even without its naive class theory embodied in its infamous Basic Law V, leads to inconsistencies when the theory of sense and reference is axiomatized therein. 1. Introduction Russell’s letter to Frege from June of 1902 in which he related his discovery of the Russell paradox was a monumental event in the history of logic. However, in the ensuing correspondence between Russell and Frege, the Russell paradox was not the only antinomy discussed.
    [Show full text]
  • On the Completeness of the Traced Monoidal Category Axioms in (Rel,+)∗
    Acta Cybernetica 23 (2017) 327–347. On the Completeness of the Traced Monoidal Category Axioms in (Rel,+)∗ Mikl´os Barthaa To the memory of my friend and former colleague Zolt´an Esik´ Abstract It is shown that the traced monoidal category of finite sets and relations with coproduct as tensor is complete for the extension of the traced sym- metric monoidal axioms by two simple axioms, which capture the additive nature of trace in this category. The result is derived from a theorem saying that already the structure of finite partial injections as a traced monoidal category is complete for the given axioms. In practical terms this means that if two biaccessible flowchart schemes are not isomorphic, then there exists an interpretation of the schemes by partial injections which distinguishes them. Keywords: monoidal categories, trace, iteration, feedback, identities in cat- egories, equational completeness 1 Introduction It was in March, 2012 that Zolt´an visited me at the Memorial University in St. John’s, Newfoundland. I thought we would find out a research topic together, but he arrived with a specific problem in mind. He knew about the result found by Hasegawa, Hofmann, and Plotkin [12] a few years earlier on the completeness of the category of finite dimensional vector spaces for the traced monoidal category axioms, and wanted to see if there is a similar completeness statement true for the matrix iteration theory of finite sets and relations as a traced monoidal category. Unfortunately, during the short time we spent together, we could not find the solu- tion, and after he had left I started to work on some other problems.
    [Show full text]
  • Logic and Categories As Tools for Building Theories
    Logic and Categories As Tools For Building Theories Samson Abramsky Oxford University Computing Laboratory 1 Introduction My aim in this short article is to provide an impression of some of the ideas emerging at the interface of logic and computer science, in a form which I hope will be accessible to philosophers. Why is this even a good idea? Because there has been a huge interaction of logic and computer science over the past half-century which has not only played an important r^olein shaping Computer Science, but has also greatly broadened the scope and enriched the content of logic itself.1 This huge effect of Computer Science on Logic over the past five decades has several aspects: new ways of using logic, new attitudes to logic, new questions and methods. These lead to new perspectives on the question: What logic is | and should be! Our main concern is with method and attitude rather than matter; nevertheless, we shall base the general points we wish to make on a case study: Category theory. Many other examples could have been used to illustrate our theme, but this will serve to illustrate some of the points we wish to make. 2 Category Theory Category theory is a vast subject. It has enormous potential for any serious version of `formal philosophy' | and yet this has hardly been realized. We shall begin with introduction to some basic elements of category theory, focussing on the fascinating conceptual issues which arise even at the most elementary level of the subject, and then discuss some its consequences and philosophical ramifications.
    [Show full text]
  • Categorical Databases
    Categorical databases David I. Spivak [email protected] Mathematics Department Massachusetts Institute of Technology Presented on 2014/02/28 at Oracle David I. Spivak (MIT) Categorical databases Presented on 2014/02/28 1 / 1 Introduction Purpose of the talk Purpose of the talk There is an fundamental connection between databases and categories. Category theory can simplify how we think about and use databases. We can clearly see all the working parts and how they fit together. Powerful theorems can be brought to bear on classical DB problems. David I. Spivak (MIT) Categorical databases Presented on 2014/02/28 2 / 1 Introduction The pros and cons of relational databases The pros and cons of relational databases Relational databases are reliable, scalable, and popular. They are provably reliable to the extent that they strictly adhere to the underlying mathematics. Make a distinction between the system you know and love, vs. the relational model, as a mathematical foundation for this system. David I. Spivak (MIT) Categorical databases Presented on 2014/02/28 3 / 1 Introduction The pros and cons of relational databases You're not really using the relational model. Current implementations have departed from the strict relational formalism: Tables may not be relational (duplicates, e.g from a query). Nulls (and labeled nulls) are commonly used. The theory of relations (150 years old) is not adequate to mathematically describe modern DBMS. The relational model does not offer guidance for schema mappings and data migration. Databases have been intuitively moving toward what's best described with a more modern mathematical foundation. David I.
    [Show full text]