Exercise with Birkhoff's theorem in universal algebra Consider the class $\mathcal C$ of the algebras in the language $\tau$, and call $\mathcal C_{fg}$ the subclass of the finitely generated algebras. Using Birkhoff's theorem, I must show that these two conditions are equivalent:

*

*$\mathbb{HSP}(\mathcal C)=\mathcal C$;

*$\mathbb{HSP}(\mathcal C_{fg})=\mathcal C$.

I really can't see how to link the fact that an algebra is equationally axiomatizable to the fact that is finitely generated, do you have any suggestions?
($\mathbb {H,S,P}$ are the closures respect to homomorphic image, substructure and product)
 A: As explained in Arturo Magidin's answer, the non-trivial part of the problem is to show that, if $\mathcal C$ is a variety, then it is included in the variety $\mathbb{HSP}(\mathcal C_{fg})$.  Here's an alternative way to do that part, without knowing anything about direct limits. Suppose the desired inclusion were false. Since we're talking about two varieties, there would be an equational identity $E$ valid in all the finitely generated algebras in $\mathcal C$ but violated in some other algebra $A\in\mathcal C$. That is, we can find values in $A$ for the variables occurring in $E$ such that $E$ is false in $A$ for those values of the variables. But there are only finitely many variables in $E$ (here I use that all operations in $\tau$ are finitary), so only finitely many elements of $A$ are used as the values of these variables. But then $E$ is violated (by the same values of the variables) in the subalgebra $A'$ of $A$ generated by those values. As $A'$ is a finitely generated algebra in $\mathcal C$, this contradicts the assumption that $E$ is valid in all the finitely generated algebras in $\mathcal C$.
A: One implication (that the second statement implies the first) is clear: if $\mathcal{C}=\mathbb{HSP}(\mathcal{C}_{fg})$, then $$\mathbb{HSP}(\mathcal{C}) = \mathbb{HSP}(\mathbb{HSP}(\mathcal{C}_{fg})) = \mathbb{HSP}(\mathcal{C}_{fg}) = \mathcal{C}.$$
This follows because the composite operator $\mathbb{HSP}$ is idempotent, by Birkhoff's Theorem.
In the other direction, since $\mathcal{C}_{fg}\subseteq \mathcal{C}$, we certainly have that $\mathbb{HSP}(\mathcal{C}_{fg})\subseteq \mathbb{HSP}(\mathcal{C})=\mathcal{C}$.
If all operations in $\tau$ are finitary, the converse inclusion follows because in that case every algebra is the direct limit of its finitely generated algebras, and varieties of algebras are cocomplete (they have all small colimits, which includes direct limits). That means that $\mathbb{HSP}(\mathcal{C}_{fg})$ contains all direct limits of elements of $\mathcal{C}_{fg}$, and that includes all of $\mathcal{C}$, showing that $\mathcal{C}\subseteq \mathbb{HSP}(\mathcal{C}_{fg})\subseteq \mathbb{HSP}(\mathcal{C})=\mathcal{C}$, giving equality throughout.
I am not sure if the result holds when your signature includes operations of infinite arity, but these are uncommon and may be explicitly excluded in your setting. For instance, in some situations, "free algebras" cannot be constructed in the infinitary setting; e.g., here and here.
