Functor
Contents
[hide]Definition
Functors come in two flavours:
Typically "functor" refers to a covariant functor when used by itself[1].
Covariant functor
A covariant functor, T:C⇝D (for categories C and D) is a pair of mappings[1]:
- T:{Obj(C)⟶Obj(D)X⟼TX
- T:{Mor(C)⟶Mor(D)f⟼Tf
Which preserve composition of morphisms and the identity morphism of each object, that is to say:
- ∀f,g∈Mor(C)[Tfg=T(f∘g)=Tf∘Tg=TfTg] (I've added the ∘s in to make it more obvious to the reader what is going on)
- Where such composition makes sense. That is target(g)=source(f).
- and ∀A∈Obj(C)[T1A=1TA]
Thus if f:X→Y and g:Y→Z are morphisms of C, then the following diagram commutes:
Thus the diagram just depicts the requirement that:
|
Note that the diagram is basically just the "image" of
|
Contravariant functor
A covariant functor, S:C⇝D (for categories C and D) is a pair of mappings[1]:
- S:{Obj(C)⟶Obj(D)X⟼SX
- S:{Mor(C)⟶Mor(D)f⟼Sf
- Note that if f:A→B then Sf:B→A
Which preserves only the identity morphism of each object - it reverses composition of morphisms, that is to say:
- ∀f,g∈Mor(C)[Sgf=S(g∘f)=Sf∘Sg=SfSg] (I've added the ∘s in to make it more obvious to the reader what is going on)
- Where such composition makes sense. That is target(f)=source(g).
- and ∀A∈Obj(C)[S1A=1SA]
Thus if f:X→Y and g:Y→Z are morphisms of C, then the following diagram commutes:
Thus the diagram just depicts the requirement that:
|
Note that the diagram is similar to
|
Discussion
TODO: Flesh this out