Categories and Computer Science

Slides:



Advertisements
Similar presentations
T YPE I SOMORPHISM O LA M AHMOUD S UPERVISED BY : D R. M ARCELO F IORE UNIVERSITY OF CAMBRIDGE Computer Laboratory Theory & Semantics Group I NTRODUCTION.
Advertisements

Introduction The concept of transform appears often in the literature of image processing and data compression. Indeed a suitable discrete representation.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Context-Free Grammars Sipser 2.1 (pages 99 – 109).
Context-Free Grammars Sipser 2.1 (pages 99 – 109).
RFC Walters (with R. Rosebrugh, N. Sabadini) Università dell’ Insubria, Como, Italy CT2007, Faro, Portugal Calculating limits and colimits compositionally.
Proofs are Programs: 19th Century Logic and 21st Century Computing CS 510: Programming Languages (a talk adapted from Philip Wadler)
Groups. Physics and Mathematics  Classical theoretical physicists were often the preeminent mathematicians of their time. Descartes – optics; analytic.
Modeling a Service and Session Calculus with Hierarchical Graph Transformation Roberto Bruni, Andrea Corradini, Ugo Montanari (based on joint work with.
Normal forms for Context-Free Grammars
C241 PLTL SESSION – 3/1/2015 Functions & Relations.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
Basic Concepts and Approaches
The Relationship between Topology and Logic Dr Christopher Townsend (Open University)
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
Category Theory By: Ashley Reynolds. HISTORY OF CATEGORY THEORY  In 1942–45, Samuel Eilenberg and Saunders Mac Lane introduced categories, functors,
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Math 3121 Abstract Algebra I Section 0: Sets. The axiomatic approach to Mathematics The notion of definition - from the text: "It is impossible to define.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
CSC312 Automata Theory Lecture # 2 Languages.
Winter 2007SEG2101 Chapter 71 Chapter 7 Introduction to Languages and Compiler.
Distributive Categories
Languages, Grammars, and Regular Expressions Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth.
Grammars CPSC 5135.
Copyright © Curt Hill Mathematical Logic An Introduction.
Products and Sums
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
Week 7 - Monday.  What did we talk about last time?  Sets.
Lecture 2: Introduction to Category Theory Nick Rossiter, Computing Science, Newcastle University, England
Language: Set of Strings
2.1 Sets ‒Sets ‒Common Universal Sets ‒Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 1.
MATH 224 – Discrete Mathematics
CompSci 102 Discrete Math for Computer Science
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Mathematical Preliminaries
The theory behind Functional Programming Functional: based on lambda calculus / combinators, recursion theory, category theory. By contrast with other.
Chapter 2 With Question/Answer Animations. Section 2.1.
Data Types 2 Arithmetic funtions ans laws.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
Lecture 1 Overview Topics 1. Proof techniques: induction, contradiction Proof techniques June 1, 2015 CSCE 355 Foundations of Computation.
DISCRETE COMPUTATIONAL STRUCTURES CS Fall 2005.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
CSCI 115 Course Review.
C Sc 132 Computing Theory Professor Meiliu Lu Computer Science Department.
Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Describing Syntax and Semantics
CSCE 355 Foundations of Computation
Formal Methods in software development
CS 2210:0001 Discrete Structures Sets and Functions
Axioms for a category of spaces
MATH 224 – Discrete Mathematics
Relation and function.
Principles of GIS Fundamental spatial concepts – Part II Shaowen Wang
Paper Code : BCA-27 Paper Title : Discrete Mathematics.
CSCE 355 Foundations of Computation
Automata and Formal Languages (CS 350/550)
Formal Methods in software development
Category theory and structuralism
Ordered Pair – (11 - 2) CS-708.
CSC312 Automata Theory Lecture # 2 Languages.
Presentation transcript:

Categories and Computer Science

2 What is category theory? Algebra of functions –Composition is the principal operation on functions Abstract structure –Collection of objects –Collection of arrows between them Invented by S. Eilenberg and S. Mac Lane in 1945 –originated from algebraic topology –influence on Algebraic geometry  A. Grothendieck Logic  F.W. Lawvere Computer science

3 How does category theory appear in Computer Science? Construction of functions out of a given set of simple functions –using various operations on functions such as: composition and repeated composition –An important aspect of CS Dynamical systems –having states which vary over time –Computing is concerned with machines An algebra of functions which really does not consist of functions –Programs and languages are formal things that specify actual functions –Syntactical side of CS

4 Topics we choose Grammars and Languages Data types Boolean algebra Circuit theory Flow charts Imperative programming Specification Lambda calculus

5 Categories The Algebra of Functions

6 Note. The notion of category is axiomatically defined and formal. The objects of a category need not be actual sets and the arrows need not be actual functions. As is usual with axiomatic definitions this allows great flexibility. CS note. An object of a category does not necessarily have methods such as union, intersection, Cartesian producs, etc.

7 AB f 1A1A 1B1B

8 Ex 1. Sets: The category of sets Note. If you are unfamiliar with the notions of sets and functions, you should consult with some elementary textbooks on set theory. Can you clearly tell the differences between surjection, injection, and bijection?

9 Small examples We should check if all the axioms are satisfied in these examples.

10 Ex.5. Two objects and three arrows

11 Ex. 6 One object with four arrows

12 Is Ex.6 really a category?

13 Ex. 7 The category of power set 2 X The subsets of X = {0,1,2} is the set of objects. The arrows are inclusions. In the figure, identities are omitted. { 0,1,2 } { 0,1 }{ 1,2 }{ 0,2 } {0}{0}{1}{1}{2}{2}

14 Ex. 8 Identities are only arrows.

15 Monoids and Groups

16 Examples of monoids

17 Order

18 Presenting a category by its generators and relations Generators –All of the objects –Some of the arrows Relations –Some equations between composites of given arrows

19 Ex. 15. Modulo 4 addition

20 Ex. 16. A category of words ** * * * * * * ・・・・ a

21 Def. Free monoid A category with one object and several arrows with no relations is called a monoid. The set of arrows is call the alphabet of the monoid. Languages are subsets of a free monoid. We usually think of a language as a set of well-formed sentences with respect to some grammar.

22 Ex. 17.

23 Def. Directed graphs A (directed) graph is a set of objects and a set of arrows, each with a prescribed domain object and codomain object. There’s no composition. This is the difference between graphs and categories.

24 Def. The free category on a graph G

25 Ex. 18. A Regular Language + _ ・・ 0 1 9

26 Ex. 19. Function f(n)=2n

27 The dual of a category

28 Ex. 23. Sets finite and BoolAlg finite Highly advanced topic

29 Isomorphic categories

30 { 0,1,2 } { 0,1 }{ 1,2 }{ 0,2 } {0}{0}{1}{1}{2}{2} { 0,1,2 } { 0,1 }{ 1,2 }{ 0,2 } {0}{0}{1}{1}{2}{2}

31 Def. Product of categories

32

33 Remark In any category, given any two objects in the diagram, say P and Q, any composite of arrows from P to Q yields the same result. We then say that the diagram commutes.