Category Theory : Introduction

A category consists of objects and arrows (also known as morphisms or can be called as functions) that go between them.

Composition process of hierarchical decomposition and re-composition is not meant to suite computer programming alone. It also reflects limitations of our human mind. Our brain can only deal with a small number of concepts at a time. One of the most cited papers in psychology, The Magical Number Seven, Plus or Minus Two, postulated that we can only keep 7 ± 2 “chunks” of information in our minds.

Properties of Categories

If a set posses following properties (associativity and identity), it is called as Category.

-- Associativity
h∘(g∘f) = (h∘g)∘f = h∘g∘f
-- Identity
f . id == f
id . f == f

General Notes:

  • In Haskell because distinguishing between terminating and non-terminating functions is undecidable — the famous halting problem. That’s why computer scientists came up with a brilliant idea, or a major hack, depending on your point of view, to extend every type by one more special value called the bottom and denoted by _|_, or Unicode ⊥. This “value” corresponds to a non-terminating computation.
  • Functions that may return bottom are called partial, as opposed to total functions, which return valid results for every possible argument.

Surjective
In mathematics, a function f from a set X to a set Y is surjective (or onto), or a surjection, if every element y in Y has a corresponding element x in X such that f(x) = y. The function f may map more than one element of X to the same element of Y.

Injective function
In mathematics, an injective function or injection or one-to-one function is a function that preserves distinctness: it never maps distinct elements of its domain to the same element of its codomain. In other words, every element of the function’s codomain is the image of at most one element of its domain.

A function f that is not injective is sometimes called many-to-one. However, the injective terminology is also sometimes used to mean “single-valued”, i.e., each argument is mapped to at most one value.

Injective term one-to-one function must not be confused with one-to-one correspondence (aka bijective function), which uniquely maps all elements in both domain and codomain to each other.

Homomorphism
A homomorphism is a map that preserves selected structure between two algebraic structures, with the structure to be preserved being given by the naming of the homomorphism.

Note that not all structure that an object possesses need be preserved by a homomorphism. For example, one may have a semigroup homomorphism between two monoids, and this will not be a monoid homomorphism if it does not map the identity of the domain to that of the codomain.

Particular definitions of homomorphism include the following:

  • A semigroup homomorphism is a map that preserves an associative binary operation.
  • A monoid homomorphism is a semigroup homomorphism that maps the identity element to the identity of the codomain.
  • A group homomorphism is a homomorphism that preserves the group structure. It may equivalently be defined as a semigroup homomorphism between groups.
  • A ring homomorphism is a homomorphism that preserves the ring structure. Whether the multiplicative identity is to be preserved depends upon the definition of ring in use.
  • A linear map is a homomorphism that preserves the vector space structure, namely the abelian group structure and scalar multiplication. The scalar type must further be specified to specify the homomorphism, e.g. every R-linear map is a Z-linear map, but not vice versa.
  • A module homomorphism is a map that preserves module structures.
  • An algebra homomorphism is a homomorphism that preserves the algebra structure.
  • A functor is a homomorphism between two categories.

A monomorphism is a generalization of an injective function in category theory.

Leave a comment