An analogous question regarding free groups can be found [here](https://math.stackexchange.com/questions/35229/free-groups-f-x-cong-f-y-rightarrowx-y).

**INTUITION:** A free $R$-algebra on indeterminates $X\_1,\ldots,X\_n$ is the noncommutative analogue of the polynomial ring $R[X\_1,\ldots,X\_n]$, which is a free commutative $R$-algebra on $X\_1,\ldots,X\_n$.

**DEFINITIONS:** For a commutative ring $R$ with $1\_R$ and any set $X\!=\!\{X\_i;\:i\!\in\!I\}$, the *free (associative) unital $R$-algebra on $X$*, denoted $R\langle X\rangle\!=\!R\langle X\,|\,\emptyset\rangle$, is the free $R$-module with basis the free monoid on $X$ of all (noncommutative) words (possibly empty) over $X$. Thus every element of $R\langle X\rangle$ has the form $$\sum r\_iX\_{j\_1}\ldots X\_{j\_i}$$ and is called a *noncommutative polynomial*, where $r\_i\!\in\!R$ (only finitely many non-zero) and $X\_{j\_1},\ldots,X\_{j\_i}\!\in\!X$ and $j\_i\!\in\!\mathbb{N}\_0$ (when $j\_i\!=\!0$, the word $X\_{j\_1}\ldots X\_{j\_i}$ is empty, denoted with $1$); furthermore, $X$ is called the *alphabet*, $X\_i$ are called *indeterminates* or *variables* or *letters* or *generators*, $X\_{j\_1}\ldots X\_{j\_i}$ are called *monomials* or *words*, and $r\_i$ are *coefficients*. Multiplication is defined as follows: the product of two basis elements (monomials) is their concatenation, i.e.
 $$(X\_{i\_1}\!\ldots X\_{i\_m}) \cdot (X\_{j\_1}\!\ldots X\_{j\_n}) := X\_{i\_1}\!\ldots X\_{i\_m}X\_{j\_1}\!\ldots X\_{j\_n};$$
 the product of any two elements (polynomials) just takes into account that $\cdot$ must be $R$-bilinear. For example, for $\alpha,\beta,\gamma,\delta\!\in\!R$ we have $(\alpha X\_1X\_2^2\!+\!\beta X\_2X\_3)\cdot(\gamma X\_3\!+\!\delta X\_2^3X\_3X\_1)$ $=$ $\alpha\gamma X\_1X\_2^2X\_3+\alpha\delta X\_1X\_2^5X\_3X\_1+\beta\gamma X\_2X\_3^2+\beta\delta X\_2X\_3X\_2^3X\_3X\_1$. When $|X|\!=\!n\!<\!\infty$, this algebra is denoted $R\langle X\_1,\ldots,X\_n\rangle$.

In short, for any set $X$, the free unital $R$-algebra on $X$ is $$R\langle X\rangle:=\bigoplus\_{w\in X^\ast}Rw$$ with the $R$-bilinear multiplication that is concatenation on monomials/words, where $X^\ast$ is the free monoid on $X$ and $Rw\!=\!\{rw;\:r\!\in\!R\}$ is the formal free module on $w$, i.e. $rw\!=\!r'w\Leftrightarrow r\!=\!r'$. The empty word/monomial of $X^\ast$ is the identity $1$ of $R\langle X\rangle$. The map $i\!:X\!\rightarrow\!R\langle X\rangle$, $X\_i\!\mapsto\!X\_i$ is called the *canonical injection*. If we replace $X^\ast$ with $X^+$ (the free semigroup on $X$, i.e. $X^\ast$ without the empty word) in the above construction, we create the *free nonunital $R$-algebra on $X$*: $R\langle X\rangle^+\!=\!R\langle X\,|\,\emptyset\rangle^+$.

**DEFINITIONS:** For $S\!\subseteq\!R\langle X\rangle$, an *algebra presentation*, denoted $R\langle X|S\rangle$, is the $R$-algebra $R\langle X\rangle/\langle\!\langle S\rangle\!\rangle$, where $\langle\!\langle S\rangle\!\rangle$ denotes the algebra ideal, generated by $S$. The notation $\langle X\,|\,p\_i\!=\!p'\_i;\, i\!\in\!I\rangle$ simply means $\langle X|p\_i-p'\_i; i\!\in\!I\rangle$. Any $R\langle X|S\rangle$ is *finitely generated* / *finitely related* / a *finite presentation* if $X$ is finite / $S$ is finite / $X$ and $S$ are finite. An arbitrary (unital) $R$-algebra $A$ is *finitely generated* / *finitely related* / *finitely presented* if it has a presentation $R\langle X|S\rangle\!\cong\!A$ that is finitely generated / finitely related / finite. Elements of $S$ are *relations* or *relators*. These notions are analogously defined for the free nonunital $R$-algebra on $X$; the presentation is then denoted $R\langle X|S\rangle^+$.

**COMMENT:** Rings are $\mathbb{Z}$-algebras, so the above construction gives us the *free ring on $X$*, namely $\mathbb{Z}\langle X\rangle^+$, and *free unital ring on $X$*, namely $\mathbb{Z}\langle X\rangle$.

**PROPOSITION (universal property):** Let $i\!:X\!\rightarrow\!R\langle X\rangle$ be the canonical injection. For any unital $R$-algebra $A$ and any map $f\!:X\!\rightarrow\!A$, there exists a unique unital algebra homomorphism $\overline{f}\!:R\langle X\rangle\!\rightarrow\!A$ such that $f\!=\!\overline{f}\!\circ\!i$, namely $\overline{f}(\sum r\_iX\_{j\_1}\ldots X\_{j\_i})=\sum r\_if(X\_{j\_1})\cdot\ldots\cdot f(X\_{j\_i})$.

![enter image description here](https://i.stack.imgur.com/1t5tb.jpg)

*Proof:* $\overline{f}$ must be a homomorphism and $f\!=\!\overline{f}\!\circ\!i$, so $\overline{f}(\sum r\_iX\_{j\_1}\!\ldots\!X\_{j\_i}\!)\!=\!\sum r\_if(X\_{j\_1}\!)\!\cdot\ldots\!\cdot\!f(X\_{j\_i}\!)$ must be satisfied, hence uniqueness of $\overline{f}$. It is also evident that such $\overline{f}$ is a unital algebra homomorphism. To prove it is well defined, assume $\sum r\_iX\_{j\_1}\ldots X\_{j\_i}\!=\!0$. By definition, $R\langle X\rangle$ is a free module on $X^\ast$, thus $r\_i\!=\!0$. Therefore $\overline{f}(0)\!=\!0$, and $\overline{f}$ is well defined. $\blacksquare$

**COMMENT:** by the universal property, $R\langle X\rangle$ is the [free object](http://en.wikipedia.org/wiki/Free_object) on $X$ in the category of unital $R$-algebras.

**PROPOSITION:** Every unital $R$-algebra $A$ has a presentation, i.e. $\forall A\:\exists X,S\!:\: A\!\cong\!R\langle X|S\rangle$.

*Proof:* Let $A$ be generated by $X\!\subseteq\!A$ ($X:=A$ suffices) and let $f\!:X\!\hookrightarrow\!A$ be the inclusion. By the universal property, $\exists!$ algebra homomorphism $\overline{f}\!:R\langle X\rangle\!\rightarrow\!A$ that extends $f$. We have $X\!\subseteq\!\mathrm{Im}\,\overline{f}$, so $\overline{f}$ is surjective. Therefore $A\!\cong\!R\langle X\rangle/\mathrm{Ker}\,\overline{f}\!=\!R\langle X| \mathrm{Ker}\,\overline{f}\rangle$. $\blacksquare$

**QUESTION:** how can I prove the statement $R\langle X\rangle\!\cong\!R\langle Y\rangle\:\Rightarrow\:|X|\!=\!|Y|$ ?

I've thought of using the following theorem from Grillet's *Abstract algebra* (page 333):
![enter image description here](https://i.stack.imgur.com/awwxc.jpg)
However, this just gives us $|X^\ast|\!=\!|Y^\ast|$. I've also thought of abelianising both algebras, so we get $R[X]\!\cong\!R[Y]$. But I'm not sure how to continue from here.