Category Theory Notes
Category Theory is all about composition. It describes category of objects and arrows between them. An object is something abstract. We can’t look at its structure and in fact we should not care about its structure. An arrow is called morphism too. It is abstract transition f from object a to object b: f(a)=b
.
The most important rule of category is composition of morphisms. If there is a morphism f
from a
to b
and there is another morphism g
from b
to c
, then there has to be a morphism h
from a
to c
. We read g . f
as g
after f
.
Morphisms are assosiative, so h.(g.f)==(h.g).f=h.g.f
. For every object a
there is an arrow which is a unit of composition. It is called id
or identity. So f.id(a)=f
.
Functor is a transition from one category to the other one that preservers the structure.
Functor within the same category is called endofunctor.
Programming language could be a category. Types of it are objects, while morphisms are functions from type A
to type B
. Then functor (endofunctor) maps type A
to F(A)
.
In category we describe objects in therms of other objects and arrows (morphisms).
Category theory is valuable because it is very close to how human brain works. We are able to solve problems that are decomposable and composable.
Lambda calculus is equivalent to category theory.