1 / 33

Categories and Computer Science

Categories and Computer Science. http://cis.k.hosei.ac.jp/~yukita/. What is category theory?. Algebra of functions Composition is the principal operation on functions Abstract structure Collection of objects Collection of arrows between them

Télécharger la présentation

Categories and Computer Science

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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. CategoriesThe 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. f 1A A B 1B

  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 2X {0,1,2} • The subsets of X = {0,1,2} is the set of objects. • The arrows are inclusions. • In the figure, identities are omitted. {0,1} {0,2} {1,2} {0} {1} {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 9 9 ・・ ・・ 1 1 0 0 + _

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

  27. The dual of a category

  28. Ex. 23.Setsfinite and BoolAlgfinite Highly advanced topic

  29. Isomorphic categories

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

  31. Def. Product of categories

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

More Related