# Subalgebras of free algebras

I am trying to prove the following statement:

Problem: There is no free groups in the universal class $\mathcal{A}$ of all abelian groups satisfying $\forall x (x + x = 0) \vee \forall x (x + x + x = 0)$. Hence $\mathcal{A}$ is the union of two varieties: abelian groups of exponent 2 and 3 respectively.

Attempted solution: First, prove that there is no $\mathcal{A}$-free algebra $\mathfrak{F}(x)$ of rank $1$. Since $\mathfrak{F}(x) \in \mathcal{A}$ we have: $2x = 0 \vee 3x = 0$. Hence (because $x$ is a generator) $\mathfrak{F}(x)$ is either $\mathbb{Z}_2$ or $\mathbb{Z_3}$. There is no non-trivial homomorphisms between $\mathbb{Z}_2$ and $\mathbb{Z}_3$, so assuming $\mathfrak{F}(x) = \mathbb{Z_2}$ the universal property does not hold on $\mathbb{Z}_3$. Similarly for $\mathfrak{F}(x) = \mathbb{Z_3}$ and $\mathbb{Z_2}$. Further, my idea was to use the following proposition:

Let $\mathcal{K}$ be a class of algebras. If there exists $\mathcal{K}$-free algebra $\mathfrak{F}(x_1, \dots, x_n, \dots)$ of countable rank, then its subalgebra $\mathfrak{F}_k$ generated by $x_1, \dots, x_k$ is $\mathcal{K}$-free algebra of rank $k$, for all $k \in \mathbb{N}$.

If this is true (for arbitrary cardinals), then assuming the existence of $\mathcal{A}$-free algebra of arbitrary rank there is a contradiction with non-existence of $\mathcal{A}$-free algebra of rank $1$, and we are done.

But I am not sure about this statement. Malcev (in his book "Algebraic systems") uses this fact without proof when $\mathcal{K}$ is the variety in order to prove that any variety is generated by the family of all $\mathcal{K}$-free algebras of finite rank.

I've tried to prove it for arbitrary class $\mathcal{K}$ as follows. Assume that there exists $\mathcal{K}$-free algebra $\mathfrak{F}(x_1, \dots, x_n)$ of rank $n$. Denote by $\mathfrak{F}_k$ its subalgebra generated by $x_1, \dots, x_k.$ Choose arbitrary algebra $\mathfrak{A} \in \mathcal{K}$ and a map $f \colon \{x_1, \dots, x_k\} \to A$. We need to show that there exists the homomorphism $\varphi$ from $\mathfrak{F}_k$ to $\mathfrak{A}$ extending $f$. In order to do that we arbitrarily extend $f$ to $g \colon \{x_1, \dots, x_n\} \to A$, use the freeness of $\mathfrak{F}(x_1, \dots, x_n)$ obtaining a homomorphism $\psi$ from $\mathfrak{F}(x_1, \dots, x_n)$ to $\mathfrak{A}$ which extends $g$. Let $\varphi = \psi\restriction \mathfrak{F}_k$. It is the homomorphism extending $f$, hence $\mathfrak{F}_k$ is $\mathcal{K}$-free algebra of rank $k$. It can be generalized for algebras of arbitrary rank.

Question: Is this proposition really holds for arbitrary class of algebras? Moreover, it seems that this proof can be reformulated purely in the language of category theory. If not, where is my mistake?

I am asking because this proof (and problem solution too) seems very easy and natural. I don't know much (but I am trying to learn) about free algebras in arbitrary classes of algebras, so before it seemed to me that free algebra and its subalgebras structure is a complicated thing, especially when $\mathcal{K}$ is not a variety (but even so there are interesting examples, for instance, in Cantor variety $\mathcal{C}_2$ all free algebras of finite rank are isomorphic). After all that I didn't expect that such a proposition may hold. If it holds then there is no class of algebras which has free algebras only of a given rank, which seems a little bit strange to me. Thanks in advance!

Yes, the proposition is true in great generality: If $K$ is any class of algebras and $F$ is the free $K$-algebra on generators $X\subseteq F$, then for any $Y\subseteq X$, the subalgebra of $F$ generated by $Y$ is the free $K$-algebra on $Y$.
What you've stumbled upon is the fact that free algebras are very easy to describe and work with in terms of the universal property they satisfy. On the other hand, proving that a free algebra exists or describing its elements explicitly can be trickier, especially, as you say, if $K$ is not a variety.