# free algebras over noncommutative rings

For a commutative ring $R$ and a set $X$, we can regard the polynomial algebra $R[X]$ as the free commutative $R$-algebra on $X$. For a unital associative ring $R$ which is not necessarily commutative, one way to define an analogous category of "algebras over $R$" is the coslice category $R / \operatorname{Ring}$, where objects are ring homomorphisms $R \to A$ and morphisms are commuting triangles. (This is explored further in Defining algebras over noncommutative rings.) I'd like to describe free objects $F(X)$ in this category.

For example, if $X$ is a one-element set $\{x\}$, $F(X)$ should be the universal ring which contains $R$ and an element $x$. An element of $F(X)$ should be a finite sum of terms of the form $r_0 x^{n_0} r_1 x^{n_1} \ldots$, where each $r_i \in R$. But to make sure that the obvious map $R \to F(X)$ is a ring homomorphism (and specifically an additive homomorphism), we also want to specify that $r_0 x^0 + r_1 x^0$ is the same as $(r_0 + r_1)x^0$.

This suggests that we define $F(X)$ as a quotient ring of a monoid ring: $F(X) = \mathbb{Z}[R * X^*] / J$, where $X^*$ is the free monoid on $X$, $R * X^*$ is the free product of monoids, and $J$ is the two-sided ideal generated by $\{1_{\mathbb{Z}}(r_0 + r_1) - 1_{\mathbb{Z}}r_0 - 1_{\mathbb{Z}}r_1 : r_0, r_1 \in R \}$.

Is this $F(X)$ a free object in $R / \operatorname{Ring}$? And, is there a nicer way to describe such a free object?