Category Theory is used to understand mathematical objects via relations with each other from an external view.
A category consists of
The morphisms are subject to these properties:
For any object , there exists a morphism, called the identity morphism , such that for any ,
We say two morphisms are composible if their composition exists.
When working with only one category, we write . We also use to mean " is a morphism in ".
In category theory, we argue via diagrams instead of equations. The most common argument is to assert that a certain diagram commutes.
For instance, Equation 1 and Equation 2 can be expressed by the assertion that the diagrams
commute.
We often refer a category by its objects.
is the category of sets. Each morphism is a (total) function .
Every ordinal is a category.
is the category of groups (where morphisms are group homomorphisms) and is the category of topological spaces (with continuous maps).
Studying the connection between these two categories leads to the notion of fundamental groups and marks the beginning of algebraic topology.
In general, it is more useful to think of a category in terms of its morphisms. Indeed, one can define a category solely in terms of morphisms, since each object corresponds to a identity morphism.
A category is said to be
A morphism is an isomorphism (denoted ) if there exists a morphism , called an inverse isomorphism, such that
If such exists, we say and are isomorphic and denote it as .
In Proposition H, we show that such , if exists, is unique. Therefore, we denote is as .
Whenever and are morphisms so that is the identity, we say is a retraction (i.e. left inverse) of , and is a section (i.e. right inverse) of .
If is an isomorphism, then its left and right inverses are unique.
Let be left and right inverses of . Then we have that
as wanted.
todoin a concrete cat, when exactly are isomorphisms bijective? see Lemma 5.5.3
The following are equivalent
For all objects , the postcomposition with defines an isomorphism
For all objects , the precomposition with defines an isomorphism
We prove the equivalence between 1 and 2. The equivalence between 1 and 3 follows from duality.
Let be an isomorphism with inverse . Define by
and by
We have that by associativity of composition.
Conversely, there must be a morphism whose image under is . In particular, . Furthermore, by associativity of composition, and have the same image under . Thus .
Given a category , the opposite category, denoted , consists of
If is an isomorphsim in , then is an isomorphism in .
2.1 Initial and Terminal Objects
An initial object is an object such that for every object , there exists a unique morphism from to .
The dual notion of an initial object is a terminal object.
A terminal object in an object that is an initial object in . In other words, for every object , there exists a unique morphism from to .
Category | Initial object | Terminal object |
The empty set | Singleton sets | |
The empty type | The unit type | |
In general, we rarely consider objects up to equality, but rather consider them up to isomorphism. In this sense, a category only has one initial and one terminal object.
Initial objects are unique up to (unique) isomorphism.
Let be initial objects and be the unique morphisms. Thus and . Furthermore, such isomorphism is unique since is a terminal object.
Terminal objects are unique up to (unique) isomorphism.
By duality.
A zero object, denoted , is an object that is both initial and terminal. A category with a zero object is said to be pointed.
Let be a pointed category. For any object in , is a zero object iff the only endomorphism of is .
follows from definition. We will prove .
Let be a zero object in , we show that its isomorphic to . Let and unique morphisms. First, we have that is the identity because . Then, is the identity because by assumption.
The product of objects and consists of
such that for any object and morphisms and , there exists a unique morphism for which the diagram
commutes.
Again, the dual of products are coproducts.
The coproduct of objects and consists of
such that for any object , there exists a unique morphism for which the diagram
commutes.
As seen from the definition of initial/terminal objects and (co)products, constructions in category theory usually involves (1) the data, and (2) a universal property. In general, a univeral property characterises the result of an construction up to isomorphism.
Products (and coproducts) are unique up to (unique) isomorphism.
Given products and of objects and . By the universal property, there exists unique and such that
commutes; and by composing and , so does the diagram
Since the diagram above would still commute if we replace with , we have that by uniqueness. A similar argument shows that .
In , the product is a cartesian product defined as
where can be defined as . The coproduct of and is the disjoint union
The following proposition gives a construction for using morphisms and .
Given morphisms and , there exists a unique morphism such that
commutes.
Similarly, given and , we can construct .
Given morphisms and , there exists a unique morphism such that
commutes.
In Haskell, corresponds to ; and corresponds to in .
A final remark on products (and coproducts) is that products can be viewed as terminal objects.
For objects and in category , consider the category where
the objects are where
the morphisms are such that
commute. We then have the following lemma:
Given objects and , the following are equivalent:
natural in .
Given categories and , a functor from to , denoted , consists of the following data:
A functor must perserve identity and composition: for any object with composible morphisms and
If is an isomophism, then so is .
For any category , there is an identity functor. For any functors and , we can construct a composite functor . This alludes to the following category:
The category of small categories, denoted , is the category where
The empty category is the initial object of . The category is its termal object.