# Introduction to Category Theory/Products are Limits
## Cone over 2 objects

Let $C_{1},C_{2}$ be any two objects in category ${\mathcal {C}}$. We define the cone category, ${\mathcal {C}}one(C_{1},C_{2})$, as follows
* Objects are 3-tuples $(X,m_{1},m_{2})\;$, where X is an object in ${\mathcal {C}}$, and $m_{1}\;$ is a morphism $X\to C_{1}$, and $m_{2}\;$ is a morphism $X\to C_{2}$.
* Arrows are morphisms $f:(X_{p},p_{1},p_{2})\to (X_{q},q_{1},q_{2})$ such that both triangles commute, in other word $f:X_{p}\to X_{q}$ is a morphism in ${\mathcal {C}}$ such that
    ${\begin{cases}p_{1}=q_{1}\circ f\\p_{2}=q_{2}\circ f\end{cases}}$
We must check that this is really a category:
* Identity morphism of object $(X_{p},p_{1},p_{2})$ in ${\mathcal {C}}one(C_{1},C_{2})$ is the identity morphism $1_{X_{p}}$ in ${\mathcal {C}}$.
* Composition of $f:(X_{p},p_{1},p_{2})\to (X_{q},q_{1},q_{2})$ and $g:(X_{q},q_{1},q_{2})\to (X_{r},r_{1},r_{2})$ in ${\mathcal {C}}one(C_{1},C_{2})$ is the composition $g\circ f$ in ${\mathcal {C}}$. Commutativity of bigger triangles follows trivially from commutativity of smaller triangles. (Write equations if you want.)
* Composition is associative ${\mathcal {C}}one(C_{1},C_{2})$ since it's associative in ${\mathcal {C}}$.

### Terminal object in Cone

What is the terminal object in the category ${\mathcal {C}}one(C_{1},C_{2})$?
By the definition of terminal object it must be an object $(X_{t},t_{1},t_{2})\;$ such that
* for every object $(X_{p},p_{1},p_{2})\;$ in ${\mathcal {C}}one(C_{1},C_{2})$ there is exactly one morphism $f:(X_{p},p_{1},p_{2})\to (X_{t},t_{1},t_{2})$.
In other words
* for every 3-tuple $(X_{p},p_{1},p_{2})\;$ there is exactly one morphism $f:X_{p}\to X_{t}$ in ${\mathcal {C}}$ such that $p_{1}=t_{1}\circ f$ and $p_{2}=t_{2}\circ f$.
But this is exactly the universal property of the product $C_{1}\times C_{2}$. We conclude
* The terminal object in category ${\mathcal {C}}one(C_{1},C_{2})$, if it exists, is the object $(C_{1}\times C_{2},\pi _{1},\pi _{1})$.
By duality argument we also have
* The initial object in category ${\mathcal {C}}ocone(C_{1},C_{2})$, if it exists, is the object $(C_{1}\coprod C_{2},\iota _{1},\iota _{1})$.

## Functors

A category is, among other things, a kind of algebraic system, but so far we've left out one of the most important ingredients in algebra, homomorphisms, which are, essentially, mappings that 'preserve structure'. Functors are the structure-preserving mappings of category theory, although functors are more immediately complicated than homomorphisms. To begin with, they come in two flavors, covariant and contravariant, the former defined as follows:

### Definition of Covariant Functors

A (covariant) functor F from category ${\mathcal {C}}$ to category ${\mathcal {D}}$ satisfies
* F sends objects of ${\mathcal {C}}$ to objects of ${\mathcal {D}}$.
* F sends arrows of ${\mathcal {C}}$ to arrows of ${\mathcal {D}}$.
* If m is an arrow from A to B in ${\mathcal {C}}$, then $F(m)\,$ is an arrow from $F(A)\,$ to $F(B)\,$ in ${\mathcal {D}}$.
* F sends identity arrows to identity arrows: $F(1_{A})=1_{F(A)}\;$.
* F preserves compositions: $F(g\circ f)=F(g)\circ F(f)$.
Contravariant functors are similar, but the direction of the arrows gets reversed, we'll discuss them later.

### Examples
#### Monoid Functors

We've already seen that a monoid is a category with a single object. So suppose $H\,$ is a functor from the monoid ${\mathcal {M}}$ to the monoid ${\mathcal {N}}$. These monoids have a single object, which we can just call $*\,$, so $H\,$ will have to map $\,*$ in ${\mathcal {M}}$ onto $*\,$ in ${\mathcal {N}}$.
$H\,$ will also take arrows of ${\mathcal {M}}$ onto arrows of $N$, and the third condition (on sources and targets of arrows) will hold automatically.
So what about the last two? Well the first says that the identity arrows are preserved, the second that composition is. But these are exactly the conditions characterizing a monoid homomorphism! So for monoids (viewed as categories), functors are homomorphisms (as conventionally defined in abstract algebra books). This applies automatically to groups as well, which are just monoids where every arrow has an inverse.

#### Hom Functors

Let ${\mathcal {C}}$ be a locally small category, and pick some object $A\,$ of ${\mathcal {C}}$. Now, for any object $B\,$ of ${\mathcal {C}}\,$, we have the set $\operatorname {Hom} (A,B)$ of arrows with domain $A\,$ and codomain $B\,$ (a set, because ${\mathcal {C}}$ is locally small). So the mapping
    $B\mapsto \operatorname {Hom} (A,B)$
looks like it might be the object part of a functor from ${\mathcal {C}}$ to ${\mathcal {S}}et$.
To get a functor, we need to do something with the arrows, specifically, an arrow $f:B\to C$ needs to become a function from $\operatorname {Hom} (A,B)$ to $\operatorname {Hom} (A,C)$. An evident way to produce such a function is to tack $f\,$ onto the end of the arrows in $\operatorname {Hom} (A,B)$:
    $g\in \operatorname {Hom} (A,B)\mapsto f\circ g\in \operatorname {Hom} (A,C)$
It is then a straightforward exercise to show that the result, standardly notated $\operatorname {Hom} (A,-)$, is a functor. A useful notation is that $\operatorname {Hom} (A,-)(f)$ is often written $\operatorname {Hom} (A,f)$.
The fact that any locally small category produces Hom-functors means that any such category has substantial manifestations in ${\mathcal {S}}et$, some of the important ones expressed by the famous Yoneda lemma.

## The Free Monoid Functor

A more complex example is the free monoid functor which takes any set onto the free monoid generated by that set. Suppose $S\,$ is an object of ${\mathcal {S}}et$. Then $F(S)\,$ is the monoid whose elements are strings of members of $S$, with concatenation as the binary operation, and the empty string serving as the identity (if you want to get very tedious, a string can be defined as a function whose domain is an initial segment of the natural numbers (e.g. $1,2,\ldots n$ for some $n\,$, the case where $n=0\,$ constituting the empty string), and whose codomain in $S$).
To make this a bit more concrete, if $S=\{o,d,g\}\,$, then the members of $F(S)\,$ are $d,o,g,do,dog,god,ogg,\ldots$ (infinitely many), plus an empty string often symbolized as $\emptyset \,$ or $\Lambda \,$. Intuitively, 'free' means that the only identities that hold in this monoid are the ones required by the associative and identity laws, so that for example $dog\,$ and $god\,$ are distinct (but in the free commutative monoid, they'd be the same, but different from $dogg\,$ and $ddog\,$). So that's the object part of this functor: it takes sets of elements (which may be finite in number) onto the sets of all strings on those elements (which will always be infinite in size, unless the set is empty). A superscripted Kleene star $^{*}$ is often used to represent the applying $F\,$ to a set, in fields such as mathematical linguistics, so that $S^{*}\,$ will be the set of strings made out of members of $S\,$.
Exercise: what does $F(\emptyset )$ look like?
Now to be a functor, $F\,$ also has to do something to arrows. An arrow $f\,$ of ${\mathcal {S}}et$ is just a function, say from $S\,$ to $T\,$, so what we do to compute the value $F(f)$ on $F(S)\,$ is replace each element of each string in $F(S)\,$ with its $f\,$-value. So if:
* $f=\{d\mapsto m,o\mapsto u,g\mapsto \emptyset \}$,
then
* $F(f)(dog)=mu\,$
For people who want to be very fussy, $F(f)\,$ can be defined by induction over the length of strings.
Exercise: proove that $F\,$ as defined above is really a functor.
This example will prove useful in defining the notion of 'adjunction', to come.
[SHOULD THE NEXT SECTION BE STUCK IN HERE AS ONE OF THE EXAMPLES? I'd rather keep multiple top levels, unless you add other top level sections.]

## Binary Product Functor

This next example takes a fair amount of space to explain, but is perhaps easier than the free monoid functor. The basic point is that if a category ${\mathcal {C}}$ has designated products, we can then construct a functor from the pair-category $({\mathcal {C}},{\mathcal {C}})$ to ${\mathcal {C}}$.

### Product of Objects

For an object $(A,B)\,$ of $({\mathcal {C}},{\mathcal {C}})$, define:
* $F(A,B)=A\times B$
(recall that 'has designated products means that there's some specific method for picking a particular product object for each pair $(A,B)\,$).
Well that wasn't too hard!

### Product of Morphisms

But to make a functor, we need to do something with the morphisms of $({\mathcal {C}},{\mathcal {C}})$, which are pairs of morphisms of ${\mathcal {C}}$. Specifically, if $f:C\rightarrow C'$ and $g:D\rightarrow D'$ are arrows of ${\mathcal {C}}$, then $(f,g)\,$ is an arrow from $(C,D)\,$ to $(C',D')\,$. Just thinking notationally, we'd expect to write the output of $F\,$ on this as $f\times g$, but then we need to construct something in ${\mathcal {C}}$ from $f\,$ and $g\,$ in such a way that $F\,$ so-defined is a functor. This takes a bit of work.
The first step is to observe that If $A,B,X\,$ are objects in category ${\mathcal {C}}$ where $A\times B$ exists, and $f_{1}:X\to A$ and $f_{2}:X\to B$ are any morphisms, then we have $<f_{1},f_{2}>\;$, the unique morphism $X\to A\times B$ satisfying the universal property for products. If g is any morphism $X\to A\times B$, then
    $<\pi _{A}\circ g,\pi _{B}\circ g>=g$
by the universal property. [LINK TO DEDUCTION EXAMPLE, ???]
So now we move on to the defition. If $A,B,X,Y\,$ are objects in category ${\mathcal {C}}$ with designated prooducts, and $f:X\to A$ and $g:Y\to B$ are any morphisms, then the product of $f\,$ and $g\,$, denoted $f\times g\;$, is the morphism
    $<f\circ \pi _{X},g\circ \pi _{Y}>:X\times Y\to A\times B$.
This can be hard to remember at first, but eventually you get to be able to see that it basically is just the obvious thing to do its job.
This morphism commutes with the projection morphisms
    $\pi _{A}\circ (f\times g)=f\circ \pi _{X}$
    $\pi _{B}\circ (f\times g)=g\circ \pi _{Y}$
If we also have morphisms $h:A\to C$ and $i:B\to D$, then
    $\pi _{C}\circ (h\times i)\circ (f\times g)=h\circ \pi _{A}\circ (f\times g)=h\circ f\circ \pi _{X}$
    $\pi _{D}\circ (h\times i)\circ (f\times g)=i\circ \pi _{B}\circ (f\times g)=i\circ g\circ \pi _{Y}$
and we get
    $(h\times i)\circ (f\times g)=<\pi _{C}\circ (h\times i)\circ (f\times g),\pi _{D}\circ (h\times i)\circ (f\times g)>$
    $=<h\circ f\circ \pi _{X},i\circ g\circ \pi _{Y}>=(h\circ f)\times (i\circ g)$.
(Lots of Exercises here!!)

### Functoriality

For all this to define a functor, domains, codomains, associativity and identity elements must be preserved. So recall the definition of composition in a pair category:
    $(f',g')\circ (f,g)=(f'\circ f,g'\circ g)$
And identities:
    $1_{(A,B)}=(1_{A},1_{B})\,$
So we have our Proposition. If category ${\mathcal {C}}$ has all products, then mapping
    $F:{\mathcal {C}}^{\mathbf {2} }\to {\mathcal {C}}$
defined by
    $(C_{1},C_{2})\mapsto (C_{1}\times C_{2})$
    $(f_{1},f_{2})\mapsto (f_{1}\times f_{2})$
is a functor.
Proof.
* If $f:X\to A,g:Y\to B$ are two morphisms, it is obvious that $F((f,g))=f\times g\;$ is a morphism from $F((X,Y))\;$ to $F((A,B))\;$.
* The identity morphism of $(A,B)$ is $(1_{A},1_{B})\;$ and it's image $1_{A}\times 1_{B}$ is easily seen to be the identity morphism of $A\times B$.
* $F((g_{1},g_{2})\circ (f_{1},f_{2}))=F(g_{1}\circ f_{1},g_{2}\circ f_{2})=(g_{1}\circ f_{1})\times (g_{2}\circ f_{2})=(g_{1}\times g_{2})\circ (f_{1}\times f_{2})=F(g_{1},g_{2})\circ F(f_{1},f_{2})$
$\Box$

## Unary Product Functor

Given what we've just done, this example should be easy, perhaps even too easy to be worth bothering with, but it's important in the development of later topics such as Exponentials.

### Unary Product on Object

Let ${\mathcal {C}}$ be a category with products and let A be any object in ${\mathcal {C}}$. We define a product functor
    $A\times -:{\mathcal {C}}\to {\mathcal {C}}$
by setting
    $(A\times -)(B)=A\times B$ for every object B in ${\mathcal {C}}$
    $(A\times -)(f)=1_{A}\times f$ for every morphism $f:B\to C$.
Let's verify this really is a functor.
* For every morphism $f:B\to C$, the morphism $1_{A}\times f$ is a morphism from $A\times B$ to $A\times C$.
* Image of the identity arrow $1_{B}$ is
    $1_{A}\times 1_{B}=<1_{A}\circ \pi _{1},1_{B}\circ \pi _{2}>=<\pi _{1},\pi _{2}>=<\pi _{1}\circ 1_{A\times B},\pi _{2}\circ 1_{A\times B}>=1_{A\times B}$.
* For every morphisms $f:B\to C$ and $g:C\to D$ we have
    $(1_{A}\times g)\circ (1_{A}\times f)=(1_{A}\circ 1_{A})\times (g\circ f)=1_{A}\times (g\circ f)$.

### Unary Product on Arrow

Just like we define functor $(A\times -)$ for every object A, we can define similar mapping $(f\times -)$ for every morphism f. For reasons to be explained later we define this mapping as follows
    $(f\times -):{\text{obj}}({\mathcal {C}})\to {\text{mor}}({\mathcal {C}})$
          $C\mapsto (f\times 1_{C})$
In other words the domain of this mapping is the objects of ${\mathcal {C}}$ and the codomain is the arrows of ${\mathcal {C}}$. The image of object C is a product of f and the identity morphism of C.
This mapping has the following commutativity property:
Proposition. Let $f:A\to B$ be a morphism in category ${\mathcal {C}}$. The mapping $(f\times -)$ commutes with respect to functors $(A\times -)$ and $(B\times -)$. To be more specific, for every morphisms $g:C\to C'$ the following equation holds
    $(f\times -)(C')\circ (A\times -)(g)=(B\times -)(g)\circ (f\times -)(C)$.
Proof.
    $(f\times 1_{C'})\circ (1_{A}\times g)=(f\circ 1_{A})\times (1_{C'}\circ g)=f\times g$
    $=(1_{B}\circ f)\times (g\circ 1_{C})=(1_{B}\times g)\circ (f\times 1_{C})$ $\Box$
We will later see that a mapping with this kind of commutativity property is a natural transformation from one functor to another.

## Category of 2-Functors

Category $\mathbf {2}$ is a category with 2 objects (1 and 2) and no arrows other that the two identity arrows. We wish to define a category ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$, whose objects are functors from the category $\mathbf {2}$ to category ${\mathcal {C}}$. In order to make this a category, we must answer the question: What is an arrow from one functor to another? Before we can answer this, we must have better understanding of functors in this category.

### Objects

What is a functor F from the category $\mathbf {2}$ to arbitrary category ${\mathcal {C}}$?
* Functor must map objects in $\mathbf {2}$ to objects in ${\mathcal {C}}$. So $F(1)=C_{1}$ and $F(2)=C_{2}$, for some objects $C_{1},C_{2}$ in ${\mathcal {C}}$.
* Functor must map arrows in $\mathbf {2}$ to arrows in ${\mathcal {C}}$. The only arrows in $\mathbf {2}$ are the identity arrows. So we must have $F(1_{1})=1_{C_{1}}$ and $F(1_{2})=1_{C_{2}}$.
* Only compositions of arrows in $\mathbf {2}$ are compositions of the identity arrow with itself. We easily verify $F(1_{1}\circ 1_{1})=1_{C_{1}}\circ 1_{C_{1}}$ and $F(1_{2}\circ 1_{2})=1_{C_{2}}\circ 1_{C_{2}}$.
Thus $F=(C_{1},C_{2})\;$ is a functor $\mathbf {2} \to {\mathcal {C}}$ that maps
* object 1 to object $C_{1}$ and
* object 2 to object $C_{2}$.

### Arrows

Arrows between functors are called natural transformations. What could natural transformations in this functor category look like?
Let $C_{1},C_{2},D_{1},D_{2}\;$ be objects in category ${\mathcal {C}}$. What could a natural transformation from functor $(C_{1},C_{2})\;$ to functor $(D_{1},D_{2})\;$ possibly be? Since all the functors consist of a pair of objects from ${\mathcal {C}}$, it seems reasonable to define natural transformations to be pairs of morphisms from ${\mathcal {C}}$. So for every morphisms $f_{1}:C_{1}\to D_{1}$ and $f_{2}:C_{2}\to D_{2}$ in ${\mathcal {C}}$, we define a natural transformation $(f_{1},f_{2})\;$ from functor $(C_{1},C_{2})\;$ to functor $(D_{1},D_{2})\;$ to be a mapping
    $(f_{1},f_{2}):{\text{obj}}(\mathbf {2} )\to {\text{mor}}({\mathcal {C}})$
    $1\mapsto f_{1},\;2\mapsto f_{2}$.
We define composion of natural transformations pointwise, that is
    $(g_{1},g_{2})\circ (f_{1},f_{2})=(g_{1}\circ f_{1},g_{2}\circ f_{2}).$

### Summary

Category ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$ consists of
* Functor $(C_{1},C_{2}):\mathbf {2} \to {\mathcal {C}}$ for every pair of objects $C_{1},C_{2}$ in ${\mathcal {C}}$.
* Natural transformation $(f_{1},f_{2}):(C_{1},C_{2})\to (D_{1},D_{2})$, for every pair of morphisms $f_{1}:C_{1}\to D_{1},f_{2}:C_{2}\to D_{2}$ in ${\mathcal {C}}$.
It is obvious that this category is isomorphic to the pair category $({\mathcal {C}},{\mathcal {C}})={\mathcal {C}}^{\mathbf {2} }$.

### Preview: Limit functor

We now introduce the limit notation but defer the actual definition to a later lesson.
Let ${\mathcal {C}}$ be a category with all products. The limit of functor $F=(C_{1},C_{2})\;$ in the category ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$, is the terminal object in the category ${\mathcal {C}}one(F)={\mathcal {C}}one(C_{1},C_{2})$.
    $\varprojlim _{\mathbf {2} }F=\varprojlim F=\varprojlim (C_{1},C_{2})=(C_{1}\times C_{2},\pi _{1},\pi _{2})$.
Projection morphisms are usually clear from the context, so we can drop them and simple write
    $\varprojlim _{\mathbf {2} }F=\varprojlim (C_{1},C_{2})=C_{1}\times C_{2}$.
Proposition. If category ${\mathcal {C}}$ has all products, then mapping
    $\varprojlim :{\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})\to {\mathcal {C}}$
defined by
    $(C_{1},C_{2})\mapsto (C_{1}\times C_{2})$
    $(f_{1},f_{2})\mapsto (f_{1}\times f_{2})$
is a functor.
Proof. Since ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$ is isomorphic to ${\mathcal {C}}^{\mathbf {2} }$, this follows from earlier result.

## OLD: Product is Limit

Category $\mathbf {2}$ is a category with 2 objects (1 and 2) and no arrows other that the two identity arrows.
What is a functor F from the category $\mathbf {2}$ to arbitrary category ${\mathcal {C}}$?
* Functor must map objects in $\mathbf {2}$ to objects in ${\mathcal {C}}$. So $F(1)=C_{1}$ and $F(2)=C_{2}$, for some objects $C_{1},C_{2}$ in ${\mathcal {C}}$.
* Functor must map arrows in $\mathbf {2}$ to arrows in ${\mathcal {C}}$. The only arrows in $\mathbf {2}$ are the identity arrows. So we must have $F(1_{1})=1_{C_{1}}$ and $F(1_{2})=1_{C_{2}}$.
* Only compositions of arrows in $\mathbf {2}$ are compositions of the identity arrow with itself. We easily verify $F(1_{1}\circ 1_{1})=1_{C_{1}}\circ 1_{C_{1}}$ and $F(1_{2}\circ 1_{2})=1_{C_{2}}\circ 1_{C_{2}}$.
Thus $F=(C_{1},C_{2})\;$ is a functor $\mathbf {2} \to {\mathcal {C}}$ that maps
* object 1 to object $C_{1}$ and
* object 2 to object $C_{2}$.
We now introduce the limit notation but defer the actual definition to a later lesson.
The limit of functor $F=(C_{1},C_{2})\;$, if it exists, is the terminal object in the category ${\mathcal {C}}one(F)={\mathcal {C}}one(C_{1},C_{2})$.
    $\varprojlim _{\mathbf {2} }F=\varprojlim F=\varprojlim (C_{1},C_{2})=(C_{1}\times C_{2},\pi _{1},\pi _{2})$.
Projection morphisms are usually trivial from the context, so we can drop them and simple write
    $\varprojlim _{\mathbf {2} }F=\varprojlim (C_{1},C_{2})=C_{1}\times C_{2}$.
The colimit of functor $F=(C_{1},C_{2})\;$, if it exists, is the initial object in the category ${\mathcal {C}}ocone(F)={\mathcal {C}}ocone(C_{1},C_{2})$.
    $\varinjlim _{\mathbf {2} }F=\varinjlim F=\varinjlim (C_{1},C_{2})=C_{1}\coprod C_{2}$.

## OLD: Product of Morphisms

If A, B, and X are objects in category ${\mathcal {C}}$ and $f_{1}:X\to A$ and $f_{2}:X\to B$ are any morphisms, we use notation $<f_{1},f_{2}>\;$ for the unique morphism $X\to A\times B$ given by the universal property. If g is any morphism $X\to A\times B$, then
    $<\pi _{A}\circ g,\pi _{B}\circ g>=g$
by the universal property.
If A, B, X and Y are objects in category ${\mathcal {C}}$ and $f:X\to A$ and $g:Y\to B$ are any morphisms, then the product of f and g, denoted $f\times g\;$, is the morphism
    $<f\circ \pi _{X},g\circ \pi _{Y}>:X\times Y\to A\times B$.
This morphism commutes with the projection morphisms
    $\pi _{A}\circ (f\times g)=f\circ \pi _{X}$
    $\pi _{B}\circ (f\times g)=g\circ \pi _{Y}$
If we also have morphisms $h:A\to C$ and $i:B\to D$, then
    $\pi _{C}\circ (h\times i)\circ (f\times g)=h\circ \pi _{A}\circ (f\times g)=h\circ f\circ \pi _{X}$
    $\pi _{D}\circ (h\times i)\circ (f\times g)=i\circ \pi _{B}\circ (f\times g)=i\circ g\circ \pi _{Y}$
and we get
    $(h\times i)\circ (f\times g)=<\pi _{C}\circ (h\times i)\circ (f\times g),\pi _{D}\circ (h\times i)\circ (f\times g)>$
    $=<h\circ f\circ \pi _{X},i\circ g\circ \pi _{Y}>=(h\circ f)\times (i\circ g)$.

## OLD: Product Functor

Let ${\mathcal {C}}$ be a category with products and let A be any object in ${\mathcal {C}}$. We define a product functor
    $A\times -:{\mathcal {C}}\to {\mathcal {C}}$
by setting
    $(A\times -)(B)=A\times B$ for every object B in ${\mathcal {C}}$
    $(A\times -)(f)=1_{A}\times f$ for every morphism $f:B\to C$.
Let's verify this really is a functor.
* For every morphism $f:B\to C$, the morphism $1_{A}\times f$ is a morphism from $A\times B$ to $A\times C$.
* Image of the identity arrow $1_{B}$ is
    $1_{A}\times 1_{B}=<1_{A}\circ \pi _{1},1_{B}\circ \pi _{2}>=<\pi _{1},\pi _{2}>=<\pi _{1}\circ 1_{A\times B},\pi _{2}\circ 1_{A\times B}>=1_{A\times B}$.
* For every morphisms $f:B\to C$ and $g:C\to D$ we have
    $(1_{A}\times g)\circ (1_{A}\times f)=(1_{A}\circ 1_{A})\times (g\circ f)=1_{A}\times (g\circ f)$.
Proposition. Functor $(A\times -)\;$ is natural in A. This means that if $f:A\to B$ is any morphism, then there is natural transformation from functor $(A\times -)\;$ to functor $(B\times -)\;$. This in turn simply means that the diagram on the right commutes for all morphisms $g:C\to C'$. Mapping $(f\times -)\;$ is a natural transformation from functor $(A\times -)\;$ to functor $(B\times -)\;$.
Proof.
    $(f\times 1_{C'})\circ (1_{A}\times g)=(f\circ 1_{A})\times (1_{C'}\circ g)=f\times g$
    $=(1_{B}\circ f)\times (g\circ 1_{C})=(1_{B}\times g)\circ (f\times 1_{C})$ $\Box$

## OLD: Natural Transformation

If F and G are covariant functors between the categories ${\mathcal {C}}$ and ${\mathcal {D}}$, then a natural transformation $\eta$ from F to G associates to every object X in ${\mathcal {C}}$ a morphism $\eta _{X}:F(X)\to G(X)$ in ${\mathcal {D}}$ called the component of $\eta$ at X, such that for every morphism $f:X\to Y$ in ${\mathcal {C}}$ we have $\eta _{Y}\circ F(f)=G(f)\circ \eta _{X}$. This equation can conveniently be expressed by the commutative diagram
Natural transformations are usually far more natural than the definition above.

## OLD: Category of Functors

We wish to define a category ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$, whose objects are functors from the category $\mathbf {2}$ to category ${\mathcal {C}}$. What could the arrows in this category be?
Let $C_{1},C_{2},D_{1},D_{2}$ be objects in category ${\mathcal {C}}$. What is a natural transformation from functor $(C_{1},C_{2})\;$ to functor $(D_{1},D_{2})\;$? To every object in category $\mathbf {2}$ we must associate a morphism in category ${\mathcal {C}}$ in such a way that for every morphism in $\mathbf {2}$ the corresponding diagram in ${\mathcal {C}}$ commutes. But there are no morphisms other than the identity morphisms in category $\mathbf {2}$, so the diagram commutes trivially. For every pair of morphisms $f_{1}:C_{1}\to D_{1}$ and $f_{2}:C_{2}\to D_{2}$ in ${\mathcal {C}}$, there is a natural transformation $(f_{1},f_{2})\;$ from functor $(C_{1},C_{2})\;$ to functor $(D_{1},D_{2})\;$.
Category ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$ consists of
* Functor $(C_{1},C_{2}):\mathbf {2} \to {\mathcal {C}}$ for every pair of objects $C_{1},C_{2}$ in ${\mathcal {C}}$.
* Natural transformation $(f_{1},f_{2}):(C_{1},C_{2})\to (D_{1},D_{2})$, for every pair of morphisms $f_{1}:C_{1}\to D_{1},f_{2}:C_{2}\to D_{2}$ in ${\mathcal {C}}$.
It's trivial to verify that it really is a category. (What is the identity morphism of functor $(C_{1},C_{2})$? Why is the composition of natural transformations a natural transformation? Why is composition associative?)

## OLD: Limit is Functor

We still won't give the general definition of limit, sorry. Instead we will prove that in the special case of category $\mathbf {2}$, the limit is a functor from category ${\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$ to category ${\mathcal {C}}$.
Proposition. If category ${\mathcal {C}}$ has all products, then mapping
    $\varprojlim :{\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})\to {\mathcal {C}}$
defined by
    $(C_{1},C_{2})\mapsto (C_{1}\times C_{2})$
    $(f_{1},f_{2})\mapsto (f_{1}\times f_{2})$
is a functor.
Proof.
$\Box$

## OLD: Hmmm

We end this lesson with two cryptic formulas...
    ${\text{hom}}_{Fun(\mathbf {2} ,{\mathcal {C}})}(\Delta (C),(A,B))$
    $\cong {\text{hom}}_{Fun(\mathbf {2} ,{\mathcal {C}})}((C,C),(A,B))$
    $\cong {\text{hom}}_{\mathcal {C}}(C,A)\times {\text{hom}}_{\mathcal {C}}(C,B)$
    $\cong {\text{hom}}_{\mathcal {C}}(C,A\times B)$
    $\cong {\text{hom}}_{\mathcal {C}}(C,\varprojlim _{\mathbf {2} }(A,B))$
and
    ${\text{hom}}_{Fun(\mathbf {2} ,{\mathcal {C}})}((A,B),\Delta (C))$
    $\cong {\text{hom}}_{Fun(\mathbf {2} ,{\mathcal {C}})}((A,B),(C,C))$
    $\cong {\text{hom}}_{\mathcal {C}}(A,C)\times {\text{hom}}_{\mathcal {C}}(B,C)$
    $\cong {\text{hom}}_{\mathcal {C}}(A\coprod B,C)$
    $\cong {\text{hom}}_{\mathcal {C}}(\varinjlim _{\mathbf {2} }(A,B),C)$
where
    $\Delta :{\mathcal {C}}\to {\mathcal {F}}un(\mathbf {2} ,{\mathcal {C}})$
is defined by
    $C\mapsto (C,C)$.
(This is an example of adjoints.)

## Related resources

* w:Functor
* w:Natural transformation
* w:Limit (category theory)
* w:Adjoint functors