Presentation is loading. Please wait.

Presentation is loading. Please wait.

Categories and Computer Science

Similar presentations


Presentation on theme: "Categories and Computer Science"— Presentation transcript:

1 Categories and Computer Science http://cis.k.hosei.ac.jp/~yukita/

2 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 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 4 Topics we choose Grammars and Languages Data types Boolean algebra Circuit theory Flow charts Imperative programming Specification Lambda calculus

5 5 Categories The Algebra of Functions

6 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 7 AB f 1A1A 1B1B

8 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 9 Small examples We should check if all the axioms are satisfied in these examples.

10 10 Ex.5. Two objects and three arrows

11 11 Ex. 6 One object with four arrows

12 12 Is Ex.6 really a category?

13 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 14 Ex. 8 Identities are only arrows.

15 15 Monoids and Groups

16 16 Examples of monoids

17 17 Order

18 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 19 Ex. 15. Modulo 4 addition

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

21 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 22 Ex. 17.

23 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 24 Def. The free category on a graph G

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

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

27 27 The dual of a category

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

29 29 Isomorphic categories

30 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 31 Def. Product of categories

32 32

33 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.


Download ppt "Categories and Computer Science"

Similar presentations


Ads by Google