---
tag: 3F2W916W64
kind: statement
role: theorem
name: Universal property of free algebras
msc: [08B20]
uses: [GTS4DRRMZR, AJNZJD8442, 3YYKGWJJND, N5KE7FH6CX, PKD440G2XW, 5083DHSK82]
about: [GTS4DRRMZR]
sources:
  - url: https://en.wikipedia.org/wiki/Free_object
---

## Statement

Let $\mathcal{V}$ be a [[variety|AJNZJD8442]] of signature $\sigma$, and let $X$ be a nonempty set of variables.
Let $T(X)$ be the [[term algebra|3YYKGWJJND]] of $\sigma$ over $X$.
Let $\theta$ be the set of pairs $(s, t)$ of terms such that the [[identity|PKD440G2XW]] $s \approx t$ holds in every algebra of $\mathcal{V}$.
Then:

1. $\theta$ is a congruence of $T(X)$, and the [[quotient algebra|N5KE7FH6CX]] $F = T(X) / \theta$ belongs to $\mathcal{V}$.
2. With $\eta(x) = x / \theta$, the algebra $F$ is a [[free algebra|GTS4DRRMZR]] of $\mathcal{V}$ on $X$. So for every $A \in \mathcal{V}$ and every map $f \colon X \to A$, there is exactly one homomorphism $h \colon F \to A$ with $h \circ \eta = f$.
3. For terms $s, t$ over $X$, the elements $s / \theta$ and $t / \theta$ are equal if and only if $\mathcal{V}$ satisfies $s \approx t$.

## Remarks

The map $f$ extends to a homomorphism $T(X) \to A$ by evaluating terms, and its kernel contains $\theta$ because $A$ satisfies every identity of $\mathcal{V}$; this gives $h$.
To see $F \in \mathcal{V}$, choose, for each pair $(s, t) \notin \theta$, an algebra of $\mathcal{V}$ and an assignment that separate $s$ and $t$.
The induced maps embed $F$ in the product of these algebras, and $\mathcal{V}$ is [[closed under subalgebras and products|5083DHSK82]].
Example: for $\mathcal{V}$ the variety of commutative rings with identity, $F$ is the polynomial ring $\Z[X]$, and the unique homomorphism is evaluation of polynomials.
The variable set must be nonempty only when $\sigma$ has no constants and empty algebras are not allowed; otherwise $X = \emptyset$ is fine and gives the initial algebra of $\mathcal{V}$.

## Explanations

### L1 human

Every variety has free algebras on every set of generators.
They are built from formal expressions in the generators, where two expressions are identified exactly when the laws of the variety prove them equal.
Any assignment of the generators to an algebra of the variety extends in one and only one way to a structure-preserving map.

### L2 human

The theorem gives free groups, free modules, polynomial rings and free lattices by one construction.
Part 3 says that the free algebra on countably many generators encodes all identities of $\mathcal{V}$, which links free algebras with equational logic.
Every algebra $A \in \mathcal{V}$ is a quotient of $F_{\mathcal{V}}(A)$, by extending the identity map of $A$; presentations by generators and relations come from this.
In categorical terms, the construction is a left adjoint to the forgetful functor from $\mathcal{V}$ to sets.
