Category
https://en.wikipedia.org/wiki/Category_(mathematics) https://ncatlab.org/nlab/show/category https://ncatlab.org/nlab/show/category+theory
A category consists of
a collection of objects
a collection of morphisms between those objects
each object
A
must have an identity arrow1α΄
Some authors define/enhance the identity arrow by stating that:
...such that for all morphisms f : A β B
it holds that f β¦ 1α΄ = f
.
...such that for each object A
there exists an identity morphism 1α΄
such that for all morphisms f : A β B
we have f β¦ 1α΄ = f = 1Κ β¦ f
But what about a category that has no arrows between its objects [?] Perhaps then A = B
and f = 1α΄
? Do we need the condition at all?
We write
f : A β B
for a morphismf
going from objectA
toB
.Morphisms are closed under composition: if there is a morphism
f : A β B
and a morphismg : B β C
, then there must be a morphism obtained by the composition,g β¦ f : A β C
.As always, composition (of arrows) is associative:
f β¦ (g β¦ h) = (f β¦ g) β¦ h
Definition
A category is a collection of objects together with morphisms connecting these objects.
A category C
is given by a collection Cβ
of objects and a collection Cβ
of arrows, which have the following structure:
each arrow has an object as source and target,
f: A -> B
identity: each object has identity arrow,
1β
orIβ
transitivity axiom: if there is an arrow
a -> b
and an arrowb -> c
then there must be an arrowa -> c
Examples of categories
Ordered categories: sets and relations
Category of sets and functions
Hask
quasi-category of Haskell types and functions
A category C is an algebraic structure consisting of a class of objects (denoted by A, B, C, etc.), and a class of arrows (denoted by f, g, h, etc.), together with three total and one partial operation.
The first two total operations are called target and source; both assign an object to an arrow. We write f : A <- B
(pronounced "f has type A from B") to indicate that the target of the arrow f
is A
and the source is B
.
The third total operation takes an object A
to an arrow idα΄ : A <- A
, called the identity arrow on A
.
The partial operation is called composition and takes two arrows to another one. The composition f β g
(read "f after g") is defined iff f : A <- B
and g : B <- C
for some objects A, B, C, in which case f β g : A <- C
. In other words, if the source of f
is the target of g
, then f β g
is an arrow whose target is the target of f
and whose source is the source of g
.
Composition is required to be associative and to have identity arrows as units:
βfgh. (f: A <- B) β§ (g: B <- C) β§ (h: C <- D) . f β (g β h) = (f β g) β h = f β g β h
βf. f: A <- B . idα΄ β f = f = f β idΚ
Last updated
Was this helpful?