How to construct polynomial ring $K[x]$ over commutative ring $K$ by making use of universal arrows.

The universal property of the polynomial ring $K[x]$ is that

$$\hom_K(K[x], R) \simeq |R|,$$

where $\hom$ is taken in the category of $K$-algebras, and $|R|$ is the underlying set of $R$. The bijection is determined by looking at the image of the free variable $x$. In other words, a free variable is free to go where it wants.

Another way to say this is that $K[x]$ represents the forgetful functor from $K$-algebras to sets.

In MacLane's language, the element $x \in |K[x]|$ is the "universal element" for the forgetful functor.


Strictly speaking, the question in the title differs from the quote in Mac Lane's book. It is stronger. So let me explain how to construct $K[x]$ using category theory.

Consider the forgetful functor $U : K\mathsf{Alg} \to \mathsf{Set}$. I claim that $U$ has a left adjoint, i.e. that for every set $X$ the free $K$-algebra $K[X]$ on $X$ exists. We use the general adjoint functor theorem. Clearly $K\mathsf{Alg}$ is complete and $U$ is continuous, this just comes from the usual construction of limits of $K$-algebras. For the solution set condition, let $X \to U(A)$ be a map. Let $B$ be the subalgebra of $A$ generated by the image of $X$. Then every element of $B$ is a $K$-linear combination of elements of the form $x_1^{\alpha_1} \cdot \dotsc \cdot x_n^{\alpha_n}$. Cardinal arithmetic tells us that $B$ has at most $\aleph_0 \cdot |K| \cdot |X|$ elements. This does not depend on $A$, and there is only set of such algebras up to isomorphism. QED

This argument carries over from $K\mathsf{Alg}$ to any variety. For example it produces free modules, free Lie algebras, and so on.

When you go through the details of the proof above, you also get a construction of $K[X]$: Take the solution set of all $B$ discussed above, and take their product. Then $K[X]$ is the equalizer of all endomorphisms of this product. Of course this construction is not useful at all. One needs the explicit structure of the elements of $K[X]$. Actually this can be derived from the universal property:

Let $B$ be the subalgebra of $K[X]$ generated by the image of $X$. Then $X \to U(B)$ extends to $K[X] \to B$, and $K[X] \to B \to K[X]$ is the identity, since this is the case on $X$. Thus, $B \to K[X]$ is surjective, i.e. $K[X]$ is generated by the image of $X$. Thus, every element can be written as $\sum_\alpha \lambda_\alpha x^{\alpha}$; here $\alpha$ is a multiindex, and $x^{\alpha}$ is the product of all $x^{\alpha_x}$. I claim that this representation is unique. For simplicitly let us assume $X=\{x\}$, i.e. that we have just one variable, and $\sum_n \lambda_n x^n = 0$. By the universal property there is a homomorphism $K[x] \to K$ mapping $x \mapsto 0$. Applying this to the equation, we get $\lambda_0=0$. It follows $x \cdot \sum_{n \geq 1} \lambda_n x^{n-1} = 0$. So we only have to prove that $x$ is regular. I don't have a proof for this, yet (which doesn't just use the explicit construction of $K[x]$).


This might be a bit abstract, but I thought it might be useful to see how the polynomial algebra functor is related to various other constructions you come across in algebra, such as the tensor algebra and symmetric algebra.

The polynomial algebra of a commutative ring $K$ is a special case of the "free commutative $K$-algebra functor" $K[-]: \mathsf{Sets} \to K\mathsf{ComAlg}$ whose right adjoint is the obvious forgetful functor. In particular, the polynomial algebra on one indeterminate, $K[x]$, is just the free commutative $K$-algebra on the set $\{x\}$ with one element.

There are several equivalent ways of constructing the free commutative algebra, as shown in the diagram below, where every square and triangle is commutative when you compose adjoints with the correct handedness (left with left; right with right). As long as you start in the bottom right corner and compose left adjoints until you get to the top left, no matter which way you go you will get the free commutative algebra functor.

enter image description here

Since the free $K$-module functor $K(-): \mathsf{Sets} \to K\mathsf{Mod}$ is strong monoidal, (i.e. $K(X \times Y) \cong K(X) \otimes_K K(Y)$) it sends monoids in $\mathsf{Sets}$ to monoids ($K$-algebras!) in $K\mathsf{Mod}$. The induced functor $$K(-): \mathsf{Mon} \to \mathsf{Mon}(K\mathsf{Mod})=K\mathsf{Alg}$$ is the monoid algebra functor. It obviously sends commutative monoids to commutative monoids in $K\mathsf{Mod}$ (commutative $K$-algebras), and hence also restricts to a functor $$K(-): \mathsf{ComMon} \to \mathsf{ComMon}(K\mathsf{Mod})=K\mathsf{ComAlg}.$$ The functors denoted $\mathrm{ab}$ are abelianization functors, which take a monoid object and make the free commutative monoid object.

The functor $\mathcal{T}: K\mathsf{Mod} \to K\mathsf{Alg}$ is the tensor algebra functor, and the functor $\mathrm{Sym}: K\mathsf{Mod} \to K\mathsf{ComAlg}$ is the symmetric algebra functor.

The functor $\mathrm{Lib}: \mathsf{Sets} \to \mathsf{Mon}$ is the free monoid functor on a set. The word "libre" is the French word for "free".