A morphism is a mathematical function that maps elements of one set, structure or category to another. In category theory, morphisms are also called arrows. For example, in the category of sets, a morphism is a function that maps elements of one set to another. In the category of groups, a morphism is a homomorphism that maps one group to another.

A functor is a structure-preserving mapping between categories. A functor maps objects and morphisms from one category to another in such a way that it preserves the properties of the categories. In other words, a functor maps objects in a way that respects the structure of the categories, and it maps morphisms in a way that preserves the composition and identity laws.

Category A:          Category B:
 
     a1                     b1
   /    \                 /   \
  a2    a3               b2   b1
  
  Morphisms in A:      Morphisms in B:
  
  f1: a1 -> a2          g1: b1 -> b2
  f2: a1 -> a3          g2: b2 -> b1
  f3: a2 -> a3
  
Functor F:
 
    F(a1) = b1
    F(a2) = b2
    F(a3) = b1
    F(f1) = g1
    F(f2) = g2
    F(f3) = g1

🌱 Back to Garden