Category Theory for Programmers

Total Page:16

File Type:pdf, Size:1020Kb

Category Theory for Programmers Category Theory for Programmers Bartosz Milewski Category Theory for Programmers Bartosz Milewski Version 0.1, September 2017 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (cc by-sa 4.0). Converted to LaTeX from a series of blog posts by Bartosz Milewski. PDF compiled by Igal Tabachnik. Contents Preface xiii I Part One 1 1 Category: The Essence of Composition 2 1.1 Arrows as Functions ................... 2 1.2 Properties of Composition ................ 5 1.3 Composition is the Essence of Programming ...... 8 1.4 Challenges ......................... 10 2 Types and Functions 11 2.1 Who Needs Types? .................... 11 2.2 Types Are About Composability ............. 13 2.3 What Are Types? ..................... 14 2.4 Why Do We Need a Mathematical Model? ....... 17 2.5 Pure and Dirty Functions ................. 20 2.6 Examples of Types ..................... 21 2.7 Challenges ......................... 25 iii 3 Categories Great and Small 27 3.1 No Objects ......................... 27 3.2 Simple Graphs ....................... 28 3.3 Orders ........................... 28 3.4 Monoid as Set ....................... 29 3.5 Monoid as Category .................... 34 3.6 Challenges ......................... 37 4 Kleisli Categories 39 4.1 The Writer Category ................... 44 4.2 Writer in Haskell ..................... 48 4.3 Kleisli Categories ..................... 50 4.4 Challenge ......................... 51 5 Products and Coproducts 53 5.1 Initial Object ........................ 54 5.2 Terminal Object ...................... 56 5.3 Duality ........................... 57 5.4 Isomorphisms ....................... 58 5.5 Products .......................... 60 5.6 Coproduct ......................... 66 5.7 Asymmetry ........................ 70 5.8 Challenges ......................... 73 5.9 Bibliography ........................ 74 6 Simple Algebraic Data Types 75 6.1 Product Types ....................... 76 6.2 Records ........................... 80 6.3 Sum Types ......................... 81 6.4 Algebra of Types ..................... 86 iv 6.5 Challenges ......................... 90 7 Functors 92 7.1 Functors in Programming ................. 96 7.1.1 The Maybe Functor ................ 96 7.1.2 Equational Reasoning .............. 98 7.1.3 Optional ...................... 101 7.1.4 Typeclasses .................... 103 7.1.5 Functor in C++ .................. 105 7.1.6 The List Functor ................. 106 7.1.7 The Reader Functor ................ 108 7.2 Functors as Containers .................. 110 7.3 Functor Composition ................... 113 7.4 Challenges ......................... 116 8 Functoriality 117 8.1 Bifunctors ......................... 117 8.2 Product and Coproduct Bifunctors ............ 121 8.3 Functorial Algebraic Data Types ............. 122 8.4 Functors in C++ ...................... 126 8.5 The Writer Functor .................... 129 8.6 Covariant and Contravariant Functors ......... 131 8.7 Profunctors ......................... 134 8.8 Challenges ......................... 136 9 Function Types 138 9.1 Universal Construction .................. 139 9.2 Currying .......................... 144 9.3 Exponentials ........................ 148 9.4 Cartesian Closed Categories ............... 149 v 9.5 Exponentials and Algebraic Data Types ......... 150 9.5.1 Zeroth Power ................... 151 9.5.2 Powers of One .................. 152 9.5.3 First Power .................... 152 9.5.4 Exponentials of Sums .............. 152 9.5.5 Exponentials of Exponentials .......... 153 9.5.6 Exponentials over Products ........... 153 9.6 Curry-Howard Isomorphism ............... 154 9.7 Bibliography ........................ 157 10 Natural Transformations 158 10.1 Polymorphic Functions .................. 162 10.2 Beyond Naturality ..................... 168 10.3 Functor Category ..................... 170 10.4 2-Categories ........................ 175 10.5 Conclusion ......................... 180 10.6 Challenges ......................... 181 II Part Two 183 11 Declarative Programming 184 12 Limits and Colimits 192 12.1 Limit as a Natural Isomorphism ............. 198 12.2 Examples of Limits .................... 203 12.3 Colimits .......................... 211 12.4 Continuity ......................... 213 12.5 Challenges ......................... 215 vi 13 Free Monoids 216 13.1 Free Monoid in Haskell .................. 218 13.2 Free Monoid Universal Construction .......... 219 13.3 Challenges ......................... 224 14 Representable Functors 226 14.1 The Hom Functor ..................... 228 14.2 Representable Functors .................. 231 14.3 Challenges ......................... 236 14.4 Bibliography ........................ 237 15 The Yoneda Lemma 238 15.1 Yoneda in Haskell ..................... 246 15.2 Co-Yoneda ......................... 248 15.3 Challenges ......................... 249 15.4 Bibliography ........................ 249 16 Yoneda Embedding 250 16.1 The Embedding ...................... 253 16.2 Application to Haskell .................. 254 16.3 Preorder Example ..................... 255 16.4 Naturality ......................... 257 16.5 Challenges ......................... 259 III Part Three 260 17 It’s All About Morphisms 261 17.1 Functors .......................... 261 17.2 Commuting Diagrams ................... 262 vii 17.3 Natural Transformations ................. 263 17.4 Natural Isomorphisms ................... 265 17.5 Hom-Sets .......................... 265 17.6 Hom-Set Isomorphisms .................. 266 17.7 Asymmetry of Hom-Sets ................. 267 17.8 Challenges ......................... 268 18 Adjunctions 269 18.1 Adjunction and Unit/Counit Pair ............ 270 18.2 Adjunctions and Hom-Sets ................ 276 18.3 Product from Adjunction ................. 281 18.4 Exponential from Adjunction .............. 286 18.5 Challenges ......................... 287 19 Free/Forgetful Adjunctions 289 19.1 Some Intuitions ...................... 293 19.2 Challenges ......................... 296 20 Monads: Programmer’s Definition 298 20.1 The Kleisli Category .................... 300 20.2 Fish Anatomy ....................... 303 20.3 The do Notation ...................... 305 21 Monads and Effects 310 21.1 The Problem ........................ 310 21.2 The Solution ........................ 311 21.2.1 Partiality ..................... 312 21.2.2 Nondeterminism ................. 313 21.2.3 Read-Only State ................. 316 21.2.4 Write-Only State ................. 317 viii 21.2.5 State ........................ 318 21.2.6 Exceptions ..................... 319 21.2.7 Continuations ................... 320 21.2.8 Interactive Input ................. 322 21.2.9 Interactive Output ................ 325 21.3 Conclusion ......................... 326 22 Monads Categorically 327 22.1 Monoidal Categories ................... 333 22.2 Monoid in a Monoidal Category ............. 338 22.3 Monads as Monoids .................... 340 22.4 Monads from Adjunctions ................ 343 23 Comonads 347 23.1 Programming with Comonads .............. 348 23.2 The Product Comonad .................. 349 23.3 Dissecting the Composition ............... 350 23.4 The Stream Comonad ................... 353 23.5 Comonad Categorically .................. 355 23.6 The Store Comonad .................... 358 23.7 Challenges ......................... 361 24 F-Algebras 362 24.1 Recursion .......................... 366 24.2 Category of F-Algebras .................. 368 24.3 Natural Numbers ..................... 372 24.4 Catamorphisms ...................... 373 24.5 Folds ............................ 375 24.6 Coalgebras ......................... 377 24.7 Challenges ......................... 380 ix 25 Algebras for Monads 381 25.1 T-algebras ......................... 384 25.2 The Kleisli Category .................... 388 25.3 Coalgebras for Comonads ................ 391 25.4 Lenses ........................... 392 25.5 Challenges ......................... 394 26 Ends and Coends 395 26.1 Dinatural Transformations ................ 397 26.2 Ends ............................ 399 26.3 Ends as Equalizers ..................... 403 26.4 Natural Transformations as Ends ............ 404 26.5 Coends ........................... 406 26.6 Ninja Yoneda Lemma ................... 409 26.7 Profunctor Composition ................. 411 27 Kan Extensions 413 27.1 Right Kan Extension ................... 416 27.2 Kan Extension as Adjunction ............... 418 27.3 Left Kan Extension .................... 420 27.4 Kan Extensions as Ends .................. 424 27.5 Kan Extensions in Haskell ................ 427 27.6 Free Functor ........................ 430 28 Enriched Categories 432 28.1 Why Monoidal Category? ................ 433 28.2 Monoidal Category .................... 434 28.3 Enriched Category .................... 437 28.4 Preorders .......................... 439 28.5 Metric Spaces ....................... 440 x 28.6 Enriched Functors ..................... 441 28.7 Self Enrichment ...................... 443 28.8 Relation to 2-Categories ................. 445 29 Topoi 446 29.1 Subobject Classifier .................... 447 29.2 Topos ............................ 452 29.3 Topoi and Logic ...................... 453 29.4 Challenges ......................... 454 30 Lawvere Theories 455 30.1 Universal Algebra ..................... 455 30.2 Lavwere Theories ..................... 457 30.3 Models of Lawvere Theories ............... 461 30.4 The Theory of Monoids .................. 463 30.5 Lawvere Theories and Monads .............. 464
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]
  • Skew Monoidal Categories and Grothendieck's Six Operations
    Skew Monoidal Categories and Grothendieck's Six Operations by Benjamin James Fuller A thesis submitted for the degree of Doctor of Philosophy. Department of Pure Mathematics School of Mathematics and Statistics The University of Sheffield March 2017 ii Abstract In this thesis, we explore several topics in the theory of monoidal and skew monoidal categories. In Chapter 3, we give definitions of dual pairs in monoidal categories, skew monoidal categories, closed skew monoidal categories and closed mon- oidal categories. In the case of monoidal and closed monoidal categories, there are multiple well-known definitions of a dual pair. We generalise these definitions to skew monoidal and closed skew monoidal categories. In Chapter 4, we introduce semidirect products of skew monoidal cat- egories. Semidirect products of groups are a well-known and well-studied algebraic construction. Semidirect products of monoids can be defined anal- ogously. We provide a categorification of this construction, for semidirect products of skew monoidal categories. We then discuss semidirect products of monoidal, closed skew monoidal and closed monoidal categories, in each case providing sufficient conditions for the semidirect product of two skew monoidal categories with the given structure to inherit the structure itself. In Chapter 5, we prove a coherence theorem for monoidal adjunctions between closed monoidal categories, a fragment of Grothendieck's `six oper- ations' formalism. iii iv Acknowledgements First and foremost, I would like to thank my supervisor, Simon Willerton, without whose help and guidance this thesis would not have been possible. I would also like to thank the various members of J14b that have come and gone over my four years at Sheffield; the friendly office environment has helped keep me sane.
    [Show full text]
  • Notes and Solutions to Exercises for Mac Lane's Categories for The
    Stefan Dawydiak Version 0.3 July 2, 2020 Notes and Exercises from Categories for the Working Mathematician Contents 0 Preface 2 1 Categories, Functors, and Natural Transformations 2 1.1 Functors . .2 1.2 Natural Transformations . .4 1.3 Monics, Epis, and Zeros . .5 2 Constructions on Categories 6 2.1 Products of Categories . .6 2.2 Functor categories . .6 2.2.1 The Interchange Law . .8 2.3 The Category of All Categories . .8 2.4 Comma Categories . 11 2.5 Graphs and Free Categories . 12 2.6 Quotient Categories . 13 3 Universals and Limits 13 3.1 Universal Arrows . 13 3.2 The Yoneda Lemma . 14 3.2.1 Proof of the Yoneda Lemma . 14 3.3 Coproducts and Colimits . 16 3.4 Products and Limits . 18 3.4.1 The p-adic integers . 20 3.5 Categories with Finite Products . 21 3.6 Groups in Categories . 22 4 Adjoints 23 4.1 Adjunctions . 23 4.2 Examples of Adjoints . 24 4.3 Reflective Subcategories . 28 4.4 Equivalence of Categories . 30 4.5 Adjoints for Preorders . 32 4.5.1 Examples of Galois Connections . 32 4.6 Cartesian Closed Categories . 33 5 Limits 33 5.1 Creation of Limits . 33 5.2 Limits by Products and Equalizers . 34 5.3 Preservation of Limits . 35 5.4 Adjoints on Limits . 35 5.5 Freyd's adjoint functor theorem . 36 1 6 Chapter 6 38 7 Chapter 7 38 8 Abelian Categories 38 8.1 Additive Categories . 38 8.2 Abelian Categories . 38 8.3 Diagram Lemmas . 39 9 Special Limits 41 9.1 Interchange of Limits .
    [Show full text]
  • Arithmetical Foundations Recursion.Evaluation.Consistency Ωi 1
    ••• Arithmetical Foundations Recursion.Evaluation.Consistency Ωi 1 f¨ur AN GELA & FRAN CISCUS Michael Pfender version 3.1 December 2, 2018 2 Priv. - Doz. M. Pfender, Technische Universit¨atBerlin With the cooperation of Jan Sablatnig Preprint Institut f¨urMathematik TU Berlin submitted to W. DeGRUYTER Berlin book on demand [email protected] The following students have contributed seminar talks: Sandra An- drasek, Florian Blatt, Nick Bremer, Alistair Cloete, Joseph Helfer, Frank Herrmann, Julia Jonczyk, Sophia Lee, Dariusz Lesniowski, Mr. Matysiak, Gregor Myrach, Chi-Thanh Christopher Nguyen, Thomas Richter, Olivia R¨ohrig,Paul Vater, and J¨orgWleczyk. Keywords: primitive recursion, categorical free-variables Arith- metic, µ-recursion, complexity controlled iteration, map code evaluation, soundness, decidability of p. r. predicates, com- plexity controlled iterative self-consistency, Ackermann dou- ble recursion, inconsistency of quantified arithmetical theo- ries, history. Preface Johannes Zawacki, my high school teacher, told us about G¨odel'ssec- ond theorem, on non-provability of consistency of mathematics within mathematics. Bonmot of Andr´eWeil: Dieu existe parceque la Math´e- matique est consistente, et le diable existe parceque nous ne pouvons pas prouver cela { God exists since Mathematics is consistent, and the devil exists since we cannot prove that. The problem with 19th/20th century mathematical foundations, clearly stated in Skolem 1919, is unbound infinitistic (non-constructive) formal existential quantification. In his 1973
    [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]
  • An Introduction to Operad Theory
    AN INTRODUCTION TO OPERAD THEORY SAIMA SAMCHUCK-SCHNARCH Abstract. We give an introduction to category theory and operad theory aimed at the undergraduate level. We first explore operads in the category of sets, and then generalize to other familiar categories. Finally, we develop tools to construct operads via generators and relations, and provide several examples of operads in various categories. Throughout, we highlight the ways in which operads can be seen to encode the properties of algebraic structures across different categories. Contents 1. Introduction1 2. Preliminary Definitions2 2.1. Algebraic Structures2 2.2. Category Theory4 3. Operads in the Category of Sets 12 3.1. Basic Definitions 13 3.2. Tree Diagram Visualizations 14 3.3. Morphisms and Algebras over Operads of Sets 17 4. General Operads 22 4.1. Basic Definitions 22 4.2. Morphisms and Algebras over General Operads 27 5. Operads via Generators and Relations 33 5.1. Quotient Operads and Free Operads 33 5.2. More Examples of Operads 38 5.3. Coloured Operads 43 References 44 1. Introduction Sets equipped with operations are ubiquitous in mathematics, and many familiar operati- ons share key properties. For instance, the addition of real numbers, composition of functions, and concatenation of strings are all associative operations with an identity element. In other words, all three are examples of monoids. Rather than working with particular examples of sets and operations directly, it is often more convenient to abstract out their common pro- perties and work with algebraic structures instead. For instance, one can prove that in any monoid, arbitrarily long products x1x2 ··· xn have an unambiguous value, and thus brackets 2010 Mathematics Subject Classification.
    [Show full text]
  • NICOLAS WU Department of Computer Science, University of Bristol (E-Mail: [email protected], [email protected])
    Hinze, R., & Wu, N. (2016). Unifying Structured Recursion Schemes. Journal of Functional Programming, 26, [e1]. https://doi.org/10.1017/S0956796815000258 Peer reviewed version Link to published version (if available): 10.1017/S0956796815000258 Link to publication record in Explore Bristol Research PDF-document University of Bristol - Explore Bristol Research General rights This document is made available in accordance with publisher policies. Please cite only the published version using the reference above. Full terms of use are available: http://www.bristol.ac.uk/red/research-policy/pure/user-guides/ebr-terms/ ZU064-05-FPR URS 15 September 2015 9:20 Under consideration for publication in J. Functional Programming 1 Unifying Structured Recursion Schemes An Extended Study RALF HINZE Department of Computer Science, University of Oxford NICOLAS WU Department of Computer Science, University of Bristol (e-mail: [email protected], [email protected]) Abstract Folds and unfolds have been understood as fundamental building blocks for total programming, and have been extended to form an entire zoo of specialised structured recursion schemes. A great number of these schemes were unified by the introduction of adjoint folds, but more exotic beasts such as recursion schemes from comonads proved to be elusive. In this paper, we show how the two canonical derivations of adjunctions from (co)monads yield recursion schemes of significant computational importance: monadic catamorphisms come from the Kleisli construction, and more astonishingly, the elusive recursion schemes from comonads come from the Eilenberg-Moore construction. Thus we demonstrate that adjoint folds are more unifying than previously believed. 1 Introduction Functional programmers have long realised that the full expressive power of recursion is untamable, and so intensive research has been carried out into the identification of an entire zoo of structured recursion schemes that are well-behaved and more amenable to program comprehension and analysis (Meijer et al., 1991).
    [Show full text]
  • Free Globularily Generated Double Categories
    Free Globularily Generated Double Categories I Juan Orendain Abstract: This is the first part of a two paper series studying free globular- ily generated double categories. In this first installment we introduce the free globularily generated double category construction. The free globularily generated double category construction canonically associates to every bi- category together with a possible category of vertical morphisms, a double category fixing this set of initial data in a free and minimal way. We use the free globularily generated double category to study length, free prod- ucts, and problems of internalization. We use the free globularily generated double category construction to provide formal functorial extensions of the Haagerup standard form construction and the Connes fusion operation to inclusions of factors of not-necessarily finite Jones index. Contents 1 Introduction 1 2 The free globularily generated double category 11 3 Free globularily generated internalizations 29 4 Length 34 5 Group decorations 38 6 von Neumann algebras 42 1 Introduction arXiv:1610.05145v3 [math.CT] 21 Nov 2019 Double categories were introduced by Ehresmann in [5]. Bicategories were later introduced by Bénabou in [13]. Both double categories and bicategories express the notion of a higher categorical structure of second order, each with its advantages and disadvantages. Double categories and bicategories relate in different ways. Every double category admits an underlying bicategory, its horizontal bicategory. The horizontal bicategory HC of a double category C ’flattens’ C by discarding vertical morphisms and only considering globular squares. 1 There are several structures transferring vertical information on a double category to its horizontal bicategory, e.g.
    [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]
  • Binary Integer Programming and Its Use for Envelope Determination
    Binary Integer Programming and its Use for Envelope Determination By Vladimir Y. Lunin1,2, Alexandre Urzhumtsev3,† & Alexander Bockmayr2 1 Institute of Mathematical Problems of Biology, Russian Academy of Sciences, Pushchino, Moscow Region, 140292 Russia 2 LORIA, UMR 7503, Faculté des Sciences, Université Henri Poincaré, Nancy I, 54506 Vandoeuvre-les-Nancy, France; [email protected] 3 LCM3B, UMR 7036 CNRS, Faculté des Sciences, Université Henri Poincaré, Nancy I, 54506 Vandoeuvre-les-Nancy, France; [email protected] † to whom correspondence must be sent Abstract The density values are linked to the observed magnitudes and unknown phases by a system of non-linear equations. When the object of search is a binary envelope rather than a continuous function of the electron density distribution, these equations can be replaced by a system of linear inequalities with respect to binary unknowns and powerful tools of integer linear programming may be applied to solve the phase problem. This novel approach was tested with calculated and experimental data for a known protein structure. 1. Introduction Binary Integer Programming (BIP in what follows) is an approach to solve a system of linear inequalities in binary unknowns (0 or 1 in what follows). Integer programming has been studied in mathematics, computer science, and operations research for more than 40 years (see for example Johnson et al., 2000 and Bockmayr & Kasper, 1998, for a review). It has been successfully applied to solve a huge number of large-scale combinatorial problems. The general form of an integer linear programming problem is max { cTx | Ax ≤ b, x ∈ Zn } (1.1) with a real matrix A of a dimension m by n, and vectors c ∈ Rn, b ∈ Rm, cTx being the scalar product of the vectors c and x.
    [Show full text]
  • A Category Theory Explanation for the Systematicity of Recursive Cognitive
    Categorial compositionality continued (further): A category theory explanation for the systematicity of recursive cognitive capacities Steven Phillips ([email protected]) Mathematical Neuroinformatics Group, National Institute of Advanced Industrial Science and Technology (AIST), Tsukuba, Ibaraki 305-8568 JAPAN William H. Wilson ([email protected]) School of Computer Science and Engineering, The University of New South Wales, Sydney, New South Wales, 2052 AUSTRALIA Abstract together afford cognition) whereby cognitive capacity is or- ganized around groups of related abilities. A standard exam- Human cognitive capacity includes recursively definable con- cepts, which are prevalent in domains involving lists, numbers, ple since the original formulation of the problem (Fodor & and languages. Cognitive science currently lacks a satisfactory Pylyshyn, 1988) has been that you don’t find people with the explanation for the systematic nature of recursive cognitive ca- capacity to infer John as the lover from the statement John pacities. The category-theoretic constructs of initial F-algebra, catamorphism, and their duals, final coalgebra and anamor- loves Mary without having the capacity to infer Mary as the phism provide a formal, systematic treatment of recursion in lover from the related statement Mary loves John. An in- computer science. Here, we use this formalism to explain the stance of systematicity is when a cognizer has cognitive ca- systematicity of recursive cognitive capacities without ad hoc assumptions (i.e., why the capacity for some recursive cogni- pacity c1 if and only if the cognizer has cognitive capacity tive abilities implies the capacity for certain others, to the same c2 (see McLaughlin, 2009). So, e.g., systematicity is evident explanatory standard used in our account of systematicity for where one has the capacity to remove the jokers if and only if non-recursive capacities).
    [Show full text]
  • Groups and Categories
    \chap04" 2009/2/27 i i page 65 i i 4 GROUPS AND CATEGORIES This chapter is devoted to some of the various connections between groups and categories. If you already know the basic group theory covered here, then this will give you some insight into the categorical constructions we have learned so far; and if you do not know it yet, then you will learn it now as an application of category theory. We will focus on three different aspects of the relationship between categories and groups: 1. groups in a category, 2. the category of groups, 3. groups as categories. 4.1 Groups in a category As we have already seen, the notion of a group arises as an abstraction of the automorphisms of an object. In a specific, concrete case, a group G may thus consist of certain arrows g : X ! X for some object X in a category C, G ⊆ HomC(X; X) But the abstract group concept can also be described directly as an object in a category, equipped with a certain structure. This more subtle notion of a \group in a category" also proves to be quite useful. Let C be a category with finite products. The notion of a group in C essentially generalizes the usual notion of a group in Sets. Definition 4.1. A group in C consists of objects and arrows as so: m i G × G - G G 6 u 1 i i i i \chap04" 2009/2/27 i i page 66 66 GROUPSANDCATEGORIES i i satisfying the following conditions: 1.
    [Show full text]