Universal property
From Academic Kids

In various branches of mathematics, certain constructions are frequently defined or characterised by an abstract property which requires the existence of a unique morphism under certain conditions. These properties are called universal properties. Universal properties are studied abstractly using the language of category theory.
In the sequel, we will give a general treatment of universal properties. It is advisable to study several examples first: product of groups and direct sum, free group, product topology, StoneČech compactification, tensor product, inverse limit and direct limit, kernel and cokernel, pullback, pushout and equalizer.
Contents 
Formal definition
Let U : D → C be a functor from a category D to a category C, and let X be an object of C. A universal morphism from X to U consists of a pair (A, φ) where A is an object of D and φ : X → U(A) is a morphism in C, such that the following universal property is satisfied:
 Whenever Y is an object of D and f : X → U(Y) is a morphism in C, then there exists a unique morphism g : A → Y such that the following diagram commutes:
UniversalProperty03.png
A universal morphism from X to U
The existence of the morphism g intuitively expresses the fact that A is "general enough", while the uniqueness of the morphism ensures that A is "not too general".
One can also consider the categorical dual of the above definition by reversing all the arrows. A universal morphism from U to X consists of a pair (A, φ) where A is an object of D and φ : U(A) → X is a morphism in C, such that the following universal property is satisfied:
 Whenever Y is an object of D and f : U(Y) → X is a morphism in C, then there exists a unique morphism g : Y → A such that the following diagram commutes:
UniversalProperty04.png
A universal morphism from U to X
Note that some authors may call one of these constructions a universal morphism and the other one a couniversal morphism. Which is which depends on the author.
Properties
Existence and uniqueness
Defining a quantity does not guarantee its existence. Given a functor U and an object X as above, there may or may not exist a universal morphism from X to U (or from U to X). If, however, a universal morphism (A, φ) does exists then it is unique up to a unique isomorphism. That is, if (A′, φ′) is another such pair then there exists a unique isomorphism g : A → A′ such that φ′ = U(g)φ. This is easily seen by substituting (A′, φ′) for (Y, f) in the definition of the universal property.
Equivalent formulations
The definition of a universal morphism can be rephrased in a variety of ways. Let U be a functor from D to C, and let X be an object of C. Then the following are statements are equivalent:
 (A, φ) is a universal morphism from X to U
 (A, φ) is an initial object of the comma category (X ↓ U)
 (A, φ) is a representation of Hom_{C}(X, U—)
The dual statements are also equivalent:
 (A, φ) is a universal morphism from U to X
 (A, φ) is a terminal object of the comma category (U ↓ X)
 (A, φ) is a representation of Hom_{C}(U—, X)
Relation to adjoint functors
Suppose (A_{1}, φ_{1}) is a universal morphism form X_{1} to U and (A_{2}, φ_{2}) is a universal morphism form X_{2} to U. By the universal property, given any morphism h : X_{1} → X_{2} there exists a unique morphism g : A_{1} → A_{2} such that the following diagram commutes:
UniversalProperty05.png
If every object X_{i} of C admits a universal morphism to U, then the assignment X_{i} <math>\mapsto<math> A_{i} and h <math>\mapsto<math> g defines a functor V from C to D. The maps φ_{i} then define a natural transformation from 1_{C} (the identity functor on C) to U V. The functors (V, U) are then a pair of adjoint functors, with V leftadjoint to U and U rightadjoint to V.
Similiar statements apply to the dual situation of morphisms from U. If such morphisms exist for every X in C one obtains a functor V : C → D which is rightadjoint to U (so U is leftadjoint to V).
Indeed, all pairs of adjoint functors arise from universal constructions in this manner. Let F and G be a pair of adjoint functors with unit η and counit ε (see the article on adjoint functors for the definitions). Then we have a universal morphism for each object in C and D:
 For each object X in C, (F(X), η_{X}) is a universal morphism from X to G. That is, for all f : X → G(Y) there exists a unique g : F(X) → Y for which the following diagrams commute.
 For each object Y in D, (G(Y), ε_{Y}) is a universal morphism from F to Y. That is, for all g : F(X) → Y there exists a unique f : X → G(Y) for which the following diagrams commute.
AdjointFunctors02.png
Universal property of a pair of adjoint functors
Universal constructions are more general than adjoint functor pairs: a universal construction is like an optimization problem; it gives rise to an adjoint pair if and only if this problem has a solution for every object of C (equivalently, every object of D).
Examples
We give a few worked examples to highlight the general idea. The reader can construct numerous other examples by consulting the articles mentioned in the introduction.
Tensor algebras
Let C be the category of vector spaces KVect over a field K and let D be the category of algberas KAlg over K (assumed be be unital and associative). Let U be the forgetful functor which assigns to each algebra its underlying vector space.
Given any vector space V over K we can construct the tensor algebra T(V) of V. The universal property of the tensor algebra expresses the fact that the pair (T(V), i), where i : V → T(V) is the inclusion map, is a universal morphism from V to U.
Since this construction works for any vector space V, we conclude that T is a functor from KVect to KAlg. This functor is leftadjoint to the forgetful functor U.
Kernels
Suppose D is a category with zero morphisms (such as the category of groups) and f : X → Y is a morphism in D. A kernel of f is any morphism k: K → X such that
 f k is the zero morphism from K to Y;
 Given any morphism k′: K′ → X such that f k′ is the zero morphism, there is a unique morphism u: K′ → K such that k u = k′.
To understand this in the framework of the general setting above, we define the category C of morphisms in D. The objects of C are morphisms f : X → Y in D, and a morphism from f : X → Y to g : S → T is given by a pair (α,β) of morphisms α : X → S and β : Y → T such that βf = gα.
Define a functor F : D → C that maps an object K of D to the zero morphism 0_{KK} : K → K and a morphism r : K → L to the pair (r,r).
Now, given a morphism f : X → Y in the category D (thought of as an object in the category C) and an object K of D, a morphism from F(K) to f is given by a pair (k,l) such that f k = l 0_{KK} = 0_{KY}, which is exactly what shows up in the universal property of kernels given above. The abstract “universal morphism from F to f ” is nothing but the universal property of a kernel.
Limits and colimits
Limits and colimits are important special cases of universal constructions. Let J and C be categories with J small (J is thought of as an index category) and let C^{J} be the corresponding functor category. The diagonal functor Δ : C → C^{J} is the functor that maps each object N in C to the constant functor Δ(N) : J → C to N (i.e. Δ(N)(X) = N for each X in J).
Given a functor F : J → C (thought of as an object in C^{J}), the limit of F, if it exists, is nothing but a universal morphism from Δ to F. Dually, the colimit of F is a universal morphism from F to Δ.
What is it good for?
Once one recognizes a certain construction as given by a universal property, one gains several benefits:
 Universal properties define objects up to a unique isomorphism; one strategy to prove that two objects are isomorphic is therefore to show that they satisfy the same universal property.
 The concrete details of a given construction may be messy, but if the construction satisfies a universal property, one can forget all those details: all there is to know about the construct is already contained in the universal property. Proofs often become short and elegant if the universal property is used rather than the concrete details.
 If the universal construction can be carried out for every X in C, then we know that we obtain a functor from C to D. (So for example, forming kernels is functorial: every morphism (α,β) from the morphism f to the morphism g induces a morphism from the kernel of f to the kernel of g.)
 Furthermore, this functor is a right or left adjoint to U. But right adjoints commute with limits and left adjoints commute with colimits! (So we can for example immediately conclude that the kernel of a product of maps is equal to the product of the kernels.)
History
Universal properties of various topological constructions were presented by Pierre Samuel in 1948. They were later used extensively by Bourbaki. The closely related concept of adjoint functors was introduced independently by Daniel Kan in 1958.
References
 Cohen, Paul M., Universal Algebra (1981), D.Reidel Publishing, Holland. ISBN 9027712131.
 Mac Lane, Saunders, Categories for the Working Mathematician 2nd ed. (1998), Graduate Texts in Mathematics 5. Springer. ISBN 0387984038.