A Functor F:C→D, where C and D are categories,
assigns (1) to any object A∈C an object F(A)∈D, (2) to any arrow f:A→B∈C an
arrow F(f):F(A)→F(B)∈D, such that (3) F preserves composition and identies.
def
Let F:C→C be a functor. An F−algebra is a pair (A,α) consisting of an obhect A and an arrow α:F(A)→A. F is the type, A is the carrier, α is the structure map of the algebra.
example
(N,[zero,succ]) is an N-algebra, defined via functor N:Set→Set for everty set X by N(X)=1+X
def
Let F:C→C be a functor.
An homomorphism of F-algebras (A,α), (B,β) is an arrow f:A→B such that f∘α=β∘F(f):
F(A)F(f)F(B)
F(A)αA
F(B)βB
AfB
For this definition to make sense F must be a functor and act not only on objects, but also on arrows.
coalgebras
def
Let F:C→C be a functor. An F−coalgebra is a pair (A,α) consisting of an obhect A and an arrow
α:A→F(A). F is the type, A is the carrier, α is the structure map of the coalgebra.
Coalgebras are like algebras, but the structure map is reversed.
def
Let F:C→C be a functor.
An homomorphism of F-algebras (A,α), (B,β) is an arrow f:A→B such that β∘f=F(f)∘α:
F(A)F(f)F(B)
AαF(A)
BβF(B)
AfB
For this definition to make sense F must be a functor and act not only on objects, but also on arrows.
Coalgebras are the dual form of algebra and are derived via the categorical principle of duality.
inductive and coinductive definitions
def
An initial F-algebra is an F-algebra that is an \textit{initial object} in the category of all F-algebras and F(A,α), (B,β) is an arrow f:A→B such that β∘f=F(f)∘α:
- F(A)F(f)F(B)
- AαF(A)
- BβF(B)
- AfB
For this definition to make sense F must be a functor and act not only on objects, but also on arrows.