# Representable functor

In mathematics, particularly category theory, a representable functor is a certain functor from an arbitrary category into the category of sets. Such functors give representations of an abstract category in terms of known structures (i.e. sets and functions) allowing one to utilize, as much as possible, knowledge about the category of sets in other settings.
From another point of view, representable functors for a category C are the functors given with C. Their theory is a vast generalisation of upper sets in posets, and Yoneda's representability theorem generalizes Cayley's theorem in group theory.

## Definition

Let C be a locally small category and let Set be the category of sets. For each object A of C let Hom(A,–) be the hom functor that maps object X to the set Hom(A,X).
A functor F : C → Set is said to be representable if it is naturally isomorphic to Hom(A,–) for some object A of C. A representation of F is a pair (A, Φ) where
    Φ : Hom(A,–) → F
is a natural isomorphism.
A contravariant functor G from C to Set is the same thing as a functor G : C$^{op}$ → Set and is commonly called a presheaf. A presheaf is representable when it is naturally isomorphic to the contravariant hom-functor Hom(–,A) for some object A of C.

## Universal elements

According to Yoneda's lemma, natural transformations from Hom(A,–) to F are in one-to-one correspondence with the elements of F(A). Given a natural transformation Φ : Hom(A,–) → F the corresponding element u ∈ F(A) is given by
    $u=\Phi _{A}(\mathrm {id} _{A}).\,$
Conversely, given any element u ∈ F(A) we may define a natural transformation Φ : Hom(A,–) → F via
    $\Phi _{X}(f)=(Ff)(u)\,$
where f is an element of Hom(A,X). In order to get a representation of F we want to know when the natural transformation induced by u is an isomorphism. This leads to the following definition:
    A universal element of a functor F : C → Set is a pair (A,u) consisting of an object A of C and an element u ∈ F(A) such that for every pair (X,v) consisting of an object X of C and an element v ∈ F(X) there exists a unique morphism f : A → X such that (Ff)(u) = v.
A universal element may be viewed as a universal morphism from the one-point set {•} to the functor F or as an initial object in the category of elements of F.
The natural transformation induced by an element u ∈ F(A) is an isomorphism if and only if (A,u) is a universal element of F. We therefore conclude that representations of F are in one-to-one correspondence with universal elements of F. For this reason, it is common to refer to universal elements (A,u) as representations.

## Examples

* The functor represented by a scheme A can sometimes describe families of geometric objects. For example, vector bundles of rank k over a given algebraic variety or scheme X correspond to algebraic morphisms $X\to A$ where A is the Grassmannian of k-planes in a high-dimensional space. Also certain types of subschemes are represented by Hilbert schemes.
* Let C be the category of CW-complexes with morphisms given by homotopy classes of continuous functions. For each natural number n there is a contravariant functor H$^n$ : C → Ab which assigns each CW-complex its nth cohomology group (with integer coefficients). Composing this with the forgetful functor we have a contravariant functor from C to Set. Brown's representability theorem in algebraic topology says that this functor is represented by a CW-complex K(Z,n) called an Eilenberg–MacLane space.
* Consider the contravariant functor P : Set → Set which maps each set to its power set and each function to its inverse image map. To represent this functor we need a pair (A,u) where A is a set and u is a subset of A, i.e. an element of P(A), such that for all sets X, the hom-set Hom(X,A) is isomorphic to P(X) via Φ$_X$(f) = (Pf)u = f$^{−1}$(u). Take A = {0,1} and u = {1}. Given a subset S ⊆ X the corresponding function from X to A is the characteristic function of S.
* Forgetful functors to Set are very often representable. In particular, a forgetful functor is represented by (A, u) whenever A is a free object over a singleton set with generator u.
** The forgetful functor Grp → Set on the category of groups is represented by (Z, 1).
** The forgetful functor Ring → Set on the category of rings is represented by (Z[x], x), the polynomial ring in one variable with integer coefficients.
** The forgetful functor Vect → Set on the category of real vector spaces is represented by (R, 1).
** The forgetful functor Top → Set on the category of topological spaces is represented by any singleton topological space with its unique element.
* A group G can be considered a category (even a groupoid) with one object which we denote by •. A functor from G to Set then corresponds to a G-set. The unique hom-functor Hom(•,–) from G to Set corresponds to the canonical G-set G with the action of left multiplication. Standard arguments from group theory show that a functor from G to Set is representable if and only if the corresponding G-set is simply transitive (i.e. a G-torsor or heap). Choosing a representation amounts to choosing an identity for the heap.
* Let R be a commutative ring with identity, and let R-Mod be the category of R-modules. If M and N are unitary modules over R, there is a covariant functor B: R-Mod → Set which assigns to each R-module P the set of R-bilinear maps M × N → P and to each R-module homomorphism f : P → Q the function B(f) : B(P) → B(Q) which sends each bilinear map g : M × N → P to the bilinear map f∘g : M × N→Q. The functor B is represented by the R-module M ⊗$_R$ N.

## Analogy: Representable functionals

Consider a linear functional on a complex Hilbert space H, i.e. a linear function $F:H\to \mathbb {C}$. The Riesz representation theorem states that if F is continuous, then there exists a unique element $a\in H$ which represents F in the sense that F is equal to the inner product functional $\langle a,-\rangle$, that is $F(v)=\langle a,v\rangle$ for $v\in H$.
For example, the continuous linear functionals on the square-integrable function space $H=L^{2}(\mathbb {R} )$ are all representable in the form $\textstyle F(v)=\langle a,v\rangle =\int _{\mathbb {R} }a(x)v(x)\,dx$ for a unique function $a(x)\in H$. The theory of distributions considers more general continuous functionals on the space of test functions $C=C_{c}^{\infty }(\mathbb {R} )$. Such a distribution functional is not necessarily representable by a function, but it may be considered intuitively as a generalized function. For instance, the Dirac delta function is the distribution defined by $F(v)=v(0)$ for each test function $v(x)\in C$, and may be thought of as "represented" by an infinitely tall and thin bump function near $x=0$.
Thus, a function $a(x)$ may be determined not by its values, but by its effect on other functions via the inner product. Analogously, an object A in a category may be characterized not by its internal features, but by its functor of points, i.e. its relation to other objects via morphisms. Just as non-representable functionals are described by distributions, non-representable functors may be described by more complicated structures such as stacks.

## Properties
### Uniqueness

Representations of functors are unique up to a unique isomorphism. That is, if (A$_1$,Φ$_1$) and (A$_2$,Φ$_2$) represent the same functor, then there exists a unique isomorphism φ : A$_1$ → A$_2$ such that
    $\Phi _{1}^{-1}\circ \Phi _{2}=\mathrm {Hom} (\varphi ,-)$
as natural isomorphisms from Hom(A$_2$,–) to Hom(A$_1$,–). This fact follows easily from Yoneda's lemma.
Stated in terms of universal elements: if (A$_1$,u$_1$) and (A$_2$,u$_2$) represent the same functor, then there exists a unique isomorphism φ : A$_1$ → A$_2$ such that
    $(F\varphi )u_{1}=u_{2}.$

### Preservation of limits

Representable functors are naturally isomorphic to Hom functors and therefore share their properties. In particular, (covariant) representable functors preserve all limits. It follows that any functor which fails to preserve some limit is not representable.
Contravariant representable functors take colimits to limits.

### Left adjoint

Any functor K : C → Set with a left adjoint F : Set → C is represented by (FX, η$_X$(•)) where X = {•} is a singleton set and η is the unit of the adjunction.
Conversely, if K is represented by a pair (A, u) and all small copowers of A exist in C then K has a left adjoint F which sends each set I to the Ith copower of A.
Therefore, if C is a category with all small copowers, a functor K : C → Set is representable if and only if it has a left adjoint.

## Relation to universal morphisms and adjoints

The categorical notions of universal morphisms and adjoint functors can both be expressed using representable functors.
Let G : D → C be a functor and let X be an object of C. Then (A,φ) is a universal morphism from X to G if and only if (A,φ) is a representation of the functor Hom$_C$(X,G–) from D to Set. It follows that G has a left-adjoint F if and only if Hom$_C$(X,G–) is representable for all X in C. The natural isomorphism Φ$_X$ : Hom$_D$(FX,–) → Hom$_C$(X,G–) yields the adjointness; that is
    $\Phi _{X,Y}\colon \mathrm {Hom} _{\mathcal {D}}(FX,Y)\to \mathrm {Hom} _{\mathcal {C}}(X,GY)$
is a bijection for all X and Y.
The dual statements are also true. Let F : C → D be a functor and let Y be an object of D. Then (A,φ) is a universal morphism from F to Y if and only if (A,φ) is a representation of the functor Hom$_D$(F–,Y) from C to Set. It follows that F has a right-adjoint G if and only if Hom$_D$(F–,Y) is representable for all Y in D.