Monoids w.r.t. Category Theory

Monoid is just a single object category with a set of morphisms (functions) that follow rules of compositions (associativity and identity).

Monoid

class Monoid m where
    mempty  :: m        -- can be viewed as single object category    
    mappend :: m -> m -> m  -- or m -> (m -> m)

On a general note, commutativity is NOT a property of monoid. That is (a + b) need not be same as that of (b + a)

Example : String as Monoid

instance Monoid String where
    mempty = ""
    mappend = (++)

Monoid as a Single Object Category
The second interpretation of the type signature of mappend as m->(m->m). It tells us that mappend maps an element of a monoid set to a function acting on that set.

Monoid is a semi-group with an identity element. (a semi-group is an algebraic structure consisting of a set together with an associative binary operation. )

monoid

Given a monoid (M,*), one can construct a small category with only one object and whose morphisms are the elements of M. The composition of morphisms is given by the monoid operation *.

Hom-Category
If C is a category containing objects A and B then Hom Category(A,B) is the collection of all morphisms from A to B:
Hom(A,B) = {f∈C | f: A -> B }
where: A = Dom(f) and B = Cod(f)

Set Theory Category Theory
Set theory tends to look inside a set, at subsets and so on, to give us structure. Category Theory theory tends to look outside the category, at the arrows, so the structure comes from the way that it interacts with other categories.

Approximate analogs of set theory concepts:

Set Theory Category Theory
element of a set terminal object
empty set final object
injective functions,
subobject
monomorphism(monic),
if: m: M->X
then X is a subobject of M
surjective functions epimorphism(epic)
inverse function isomorphism
intersection pullback
function space exponential
indexed family (special case of function) cone (limit)

 

General 4 important properties of a group

Closure :
A set has closure under an operation if performance of that operation on members of the set always produces a member of the same set; in this case we also say that the set is closed under the operation.

Associativity :
A binary operation ∗ on a set S is called associative if it satisfies the associative law: (xy) ∗ z = x ∗ (yz) for all x, y, z in S.

Identity element or neutral element
Identity is a special type of element of a set with respect to a binary operation on that set. It leaves other elements unchanged when combined with them.

Inverse
In abstract algebra, the idea of an inverse element generalizes concepts of a negation (sign reversal) in relation to addition, and a reciprocal in relation to multiplication. The intuition is of an element that can ‘undo’ the effect of combination with another given element.

Category theory is the study of mathematical abstraction in general. It is a set of concepts aiming to provide a common language for disparate parts of mathematics.

Leave a comment