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++
    • Products

      • pre knowledge: all we can say about product is just two projection function which extract different components of it
      • product pattern c is defined by the projection: $$ p :: c \to a \\ q :: c \to b $$ and we have many cs who satify such pattern. so, we should give them a way to ranking.
      • ranking: if c' and c satify the pattern defined above, we say c is prioritized than c', if there is a morphism m, satify that $$ p' :: c' \to a, q' :: c' \to b \\ p :: c \to a, q :: c \to b \\ m :: c' \to c \\ p' = p . m, q' = q . m $$
      • definition: A product of a and b is the object c equipped with two projection such that for any object c' equipped with two projection there must be a unique morphism from c' to c that factorizes the projection of c'.
      • factorization: $$ factorization :: (c \to a) -> (c \to b) -> (c \to (a, b)) \\ factorization p q = \ x -> (p x, q x) $$ a object with the factorization function will get the Cardesian product of a and b, so the object c is the product of a and b;
    • Coproducts: which is the reverse version of product

      • pattern: object c equipped with two injection $$ i :: a \to c \\ j :: b \to c $$
      • ranking: for two object c and c' who satify the pattern above, if there is a morphism from c to c' which satify $$ i :: a \to c, j :: b \to c \\ i' :: a \to c', j' :: b \to c' \\ m :: c \to c' \\ i' :: m . i, j' :: m . j $$ then c is precedence than 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} $, put them all together. $$ f :: a \to b, g :: b \to c, h :: a \to c = g \cdot f \\ f^{op} :: b \to a, g^{op} :: c \to b, h^{op} :: c \to a = f^{op} \cdot g^{op} $$
  • Isomorphisms

    • isomorphic objects look the same, it means that every part of one object coresponds to ssome part of another object in a one-to-one mapping.
    • isomorphic from morphism view: an isomorphism is an ivertible morphism, we can understand it in terms of composition and identity. if f is the invertion of g, then: $$ f . g = id_A \\ g . f = id_B $$
  • Asymmetry:

    • initial object vs terminal object:
    • product vs coproduct
    • product with terminal object ==> multiply
    • coproduct with initial object ==> sum

Clone this wiki locally