The main reference: Methods of Homological Algebra.
Suppose C is a category, C∘ is its dual category. Thus any contravariant functor φ:C→D is a (covariant) functor φ:C∘→D .
Suppose C and D are categories. We can construct a category of functors form C to D by the follow steps. Firstly, the objects in Funct(C,D) are functors form C to D . Then, a morphism f of functors from F to G (notation f:F→G ) is a family of morphisms in D that f(X):F(X)→G(X), one for each X∈C , satisfying the following condition: for all morphism φ in C the following diagram \[\require{AMScd}
\begin{CD}
F(X) @>f(X)>> G(X)\\
@V{F(\varphi)}VV @VV{G(\varphi)}V \\
F(Y) @>f(Y)>> G(Y)
\end{CD}
\] is commutative.
If F is isomorphic to G (notation F≅G ), we should have morphisms f and g such that f(X)∘g(X)=idG(X) and g(X)∘f(X)=idF(X) for all X∈C .
Suppose C^=Funct(C∘,Set) , ∀X∈C , we can associate a X^∈C^ by X^(Y)=HomC(Y,X) and Z^(φ)f=f∘φ for φ∈HomC(Y,X) and f∈HomC(X,Z) . Then Z^(φ):Z^(X)→Z^(Y) .
Proposition 1: Suppose X is a set in the category Set, it can be identified with the set X^(e)=HomSet(e,X) , where e is a one-point set.
Proof. Obviously.
Indeed, in an arbitrary category C an analogue of one-point set does not necessarily exist. However, by considering HomC(Y,X) for all Y∈C simultaneously, we can recover complete information about an object X∈C . This is the idea of representation theory.
Definition 1: A functor F∈C^ is said to be representable if F≅X^ for some X∈C . One says also that the object X represents the functor F .
Then
Theorem 1: HomC(X,Y)≅HomC^(X^,Y^) .
Proof.
Let φ:X→Y be a morphism in C . We associate with φ the morphism of functors φ^:X^→Y^ by φ^(Z):θ↦φ∘θ∈Y^(Z), where θ∈X^(Z) and X , Y , Z∈C . It is clear that φ^∘ϕ^=φ∘ϕ .
Conversely, suppose f∈HomC^(X^,Y^) , define map i:HomC^(X^,Y^)→HomC(X,Y) by i:f↦f(X)(idX), where idX∈HomC(X,X)=X^(X) and f(idX)∈Y^(X) . Then i(φ^)=φ^(X)(idX)=φ∘idX=φ.
On the other hand, we should show i(f)=f when f∈HomC^(X^,Y^) , and it's equivalent to show i(f)(Z)=f(Z) for all Z∈C .
Now suppose a morphism φ:Z→X , i(f)∘φ=i(f)(Z)(φ)=f(Z)(φ). Using the commutativity of the diagram, \[\require{AMScd}
\begin{CD}
\hat{X}(X) @>f(X)>> \hat{Y}(X)\\
@V{\hat{X}(\varphi)}VV @VV{\hat{Y}(\varphi)}V \\
\hat{X}(Z) @>f(Z)>> \hat{Y}(Z)
\end{CD}
\]
then f(Z)∘X^(φ)(idX)=Y^(φ)∘f(X)(idX)=Y^(φ)(i(f))=i(f)∘φ and f(Z)∘X^(φ)(idX)=f(Z)(idX∘φ)=f(Z)(φ). Thus i is an isomorphism that i:HomC^(X^,Y^)≅HomC(X,Y) .
If X represents the functor F , HomC^(Y^,F)≅HomC^(Y^,X^)≅HomC(Y,X) . If Y also represents F , then there exists an isomorphism φ:Y^≅F , then i(φ) is the according isomorphism between X and Y . Thus, the representing object of a representable functor is defined uniquely up to a isomorphism.
Definition 2: Suppose X , Y∈C , the direct product X×Y is (upto an isomorphism) the object Z representing the functor (if such functor is representable, or if such Z exists) W↦X^(W)×Y^(W), where X^(W)×Y^(W) is the direct product of Set which has been constructed directly.
Definition 3: Suppose X , Y , S∈Set , f:X→S and g:Y→S , the pullback of f and g or the fibre product of X and Y is X×SY={(x,y)∈X×Y:f(x)=g(y)}. In a general category C , X×SY is defined as the object Z representing the functor W↦X^(W)×S^(W)Y^(W).
When f=g are constant morphisms, X×SY≅X×Y . When f and g are embedding, X×SY≅X∩Y .
The universal property can be directly vertified. Since Z represents the functor W↦X^(W)×Y^(W) , then Z^(W)=X^(W)×Y^(W) . Let W=Z , the image of idZ∈Z^(Z) is that idZ=(πX,πY) , where πX∈Y^(Z) and πY∈Y^(Z) . This can be writen as
XπXZπYY
Now suppose pX:W→X and pY:W→Y , then there exist η=(pX,pY)∈X^(W)×Y^(W)=Z^(W) . The last thing we should to show is that pX=πX∘η and pY=πY∘η . Indeed, for all z∈Z , (πX,πY)((pX,pY)(z))=idZ((pX,pY)(z))=(pX,pY)(z).
The uniqueness of X×Y up to an isomorphism can be drived from the above theorem or universal property directly.
Because of some psychological reasons, we usually use a commutative diagram to visualize the universal property described above: \[
\begin{xy}
\xymatrix{
&A\ar[dl]\ar[dr]\ar@{-->}[d]&\\
X&X\times Y\ar[l]\ar[r]&Y\\
}
\end{xy}
\] Similarly, the universal property of fibre product can be written as a commutative diagram: \[
\begin{xy}
\xymatrix{
U \ar@/_/[ddr]_y \ar@{.>}[dr]|{\langle x,y \rangle} \ar@/^/[drr]^x \\
& X \times_Z Y \ar[d]^q \ar[r]_p & X \ar[d]_f \\
& Y \ar[r]^g & Z
}
\end{xy}
\]
We fix a category J , and define the diagonal functor Δ:C→Funct(J,C) as follow:
On objects: ΔX is the set of constant functors with the value X . In other words, ΔX(j)=X for all j∈J , ΔX(φ)=idX for all morphism φ in J .
On morphisms: Suppose ψ:X→Y is a morphism in C , Δψ:ΔX→ΔY is defined as follows: Δψ(j):X=ΔX(j)→Y=ΔY(j) for all j∈J .
It is clear that Δ(φ∘ψ)=Δφ∘Δψ , so Δ is indeed a functor.
Definition 4: Suppose F:J→C is a functor, the (projective or inverse) limit of F in the category C according to J is an object X∈C representing the functor Y↦HomFunct(J,C)(ΔY,F):C∘→Set. The limit of F is denoted by X=limF .