Skip to content

CTFP Ch05

WinChua edited this page May 3, 2020 · 23 revisions

概要

摘录

  • We are defined by our relationship.

  • We can only single out a object in a category by describing the relationship between it and others.

  • universial construction: defined object by describing its pattern of relationships with other objects. two step

    • define a pattern
    • define the order of the objs which match the pattern, pick the smallest or the biggest one.
  • Several Kind of Objects

    • Initial Ojbect:
      • single object in the category, every obj in the category should must have and only have one arrow from the object. notice that the single is not in the definition of initial object, we describe it from the relationship outside the object, while single is the describtion inside the object.
      • it may not exists.
      • the initial object is the object that has one and only one morphism going to any object in the category
      • there maybe not only one initial objects.
      • e.g:
        • in the category of sets and functions: initial object is the empty set.
        • Void in Haskell, the morphism is absurc :: Void -> a
    • Terminal Object:
      • Single object in the category with one and only one morphism coming to it from the other object in the category.
      • e.g
        • unit in Haskell; void in C++
  • Duality:

    • with a category on hand, you can construct another category by keeping all the objs and reversing the arrow bewteen objs. Suppose that the original category is C, and we can define the opposite category $C^{op}$ by just reversing the arrow. That is for the original morphism $ f :: a \to b , g :: b \to c $ and their composition $ h :: a \to c $ with $ h = g \cdot f $, by reversing the arrow we have $ f^{op} :: b \to a, g^{op} :: c \to b, h^{op} :: c \to a $ with $ h^{op} :: f^{op} \cdot g^{op} $

Clone this wiki locally