How to compute a free algebra for a given algebra over a set?

The question is asking for the free algebra over $X=\{x,y\}$ in the variety $\sf V = {\sf H}{\sf S}{\sf P}(\mathcal A)$. This free algebra has 130 elements, so I doubt you are expected to actually construct it. Rather, it seems likely that they only want you to explain the procedure for constructing it.

One standard construction for ${\mathcal F}_{\sf V}(\{x,y\})$ is as a subalgebra of the algebra ${\mathcal A}^{{\mathcal A}^2}$. The $\underline{\textrm{set}}$ $A^{A^2}$ consists of all functions $f\colon A^2\to A$. We may regard $x$ and $y$ as elements of this set of functions by identifying $x$ with binary first-coordinate projection ($x(u,v) = u$) and $y$ with binary second-coordinate projection ($y(u,v)=v$). The $\underline{\textrm{algebra}}$ ${\mathcal A}^{{\mathcal A}^2}$ is this set of functions under pointwise operations from $\mathcal A$. One construction of ${\mathcal F}_{\sf V}(\{x,y\})$ is as the subalgebra of ${\mathcal A}^{{\mathcal A}^2}$ generated by the subset $\{x,y\}$.

More concretely, order the elements of $A^2$ lexicographically as $$\langle (0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2)\rangle.$$ These 9 elements can be taken as indices of coordinates of tuples for elements of $A^{A^2}$. With this representation, the function table for first projection $x$ may be represented as $[x]:=\langle 0,0,0,1,1,1,2,2,2\rangle\in A^9$, and the function table for the second projection $y$ may be represented as $[y]:=\langle 0,1,2,0,1,2,0,1,2\rangle\in A^9$. To get ${\mathcal F}_{\sf V}(\{x,y\})$, generate a subalgebra of ${\mathcal A}^{9}$ with $[x], [y]$. This means, start with $[x]=\langle 0,0,0,1,1,1,2,2,2\rangle, [y]=\langle 0,1,2,0,1,2,0,1,2\rangle\in A^9$ and close under coordinatewise multiplication.

EDIT 1/8/22.

In response to a comment, I will explain why the $2$-generated free algebra in the variety generated by ${\mathcal A}$ has size $130$. Moreover I will explain how to $*$-multiply any two elements of this $130$-element set.

In order to avoid writing too many bracketed variables, I will use the letter $a$ to denote $[x]$ from above, and the letter $b$ to denote $[y]$ from above.

Observe that

  • any product of elements of $A$ lies in the subset $B = \{0,1\}$, and
  • the product operation of $A$ restricted to $B=\{0,1\}$ is addition modulo $2$.

In particular, $B=\{0,1\}$ is the underlying set of a subalgebra of $\mathcal A$ and the algebra structure on $B$ is equivalent to that of a $2$-element group, or equivalent to that of a $1$-dimensional vector space over $\mathbb F_2$.

These facts mean that the subalgebra $\mathcal F$ of ${\mathcal A}^9$ that is generated by $a = \langle 0,0,0,1,1,1,2,2,2\rangle$ and $b=\langle 0,1,2,0,1,2,0,1,2\rangle$ has the property that the product of any two elements lies in $B^9 = \{0,1\}^9$, which is a $9$-dimensional vector space over $\mathbb F_2$ under the $*$-operation. Hence the underlying set of $\mathcal F$ must have the form $\{a,b\}\cup V$ for some $\mathbb F_2$-subspace $V\leq B^9$. I claim that this $V$ is a $7$-dimensional subspace, and I will tell you which one it is.

Write a typical element of $A^9$ as $z = \langle z_1,z_2,z_3,z_4,z_5,z_6,z_7,z_8,z_9\rangle$. Observe that if $z$ is one of the generators of $\mathcal F$, $a = \langle 0,0,0,1,1,1,2,2,2\rangle$ or $b=\langle 0,1,2,0,1,2,0,1,2\rangle$, the following hold:

  • $z_1, z_2, z_4, z_5\in B$, and the following linear relations hold among these coordinates:
  • $z_1 = 0$, and
  • $z_2+z_4+z_5 = 0$.

The relations are preserved under the $*$-operation acting coordinatewise. (Reason: the generators have coordinates $z_1, z_2, z_4, z_5\in B$, so the projection of $\mathcal F$ onto these coordinates is a vector subspace of $B^4$ with respect to $*$ and this vector space is generated by vectors $\langle a_1,a_2,a_4,a_5\rangle = \langle 0, 0, 1, 1\rangle$ and $\langle b_1,b_2,b_4,b_5\rangle = \langle 0, 1, 0, 1\rangle$, which satisfy these linear relations.) This implies that the underlying set of $\mathcal F$ is $\{a, b\}\cup V$ where in every $z\in V$ we have $z_1=0$ and $z_2+z_4+z_5=0$. The two linear relations guarantee that $V$ has codimension at least $2$ in the $9$-dimensional space $B^9$, so $V$ is at most $7$-dimensional. But $V$ is exactly $7$-dimensional, since I can exhibit $7$ independent vectors in $V$, namely:

  • $a((ba)b) = \langle 0,0,1,0,0,0,0,0,0\rangle$
  • $a(b(ab)) = \langle 0,0,0,0,0,1,0,0,0\rangle$
  • $b((ab)a) = \langle 0,0,0,0,0,0,1,0,0\rangle$
  • $b(a(ab)) = \langle 0,0,0,0,0,0,0,1,0\rangle$
  • $(aa)(b(b(aa))) = \langle 0,0,0,0,0,0,0,0,1\rangle$
  • $a(a(ba)) = \langle 0,1,0,1,0,0,0,0,0\rangle$
  • $a((ab)(bb)) = \langle 0,1,0,0,1,0,0,0,0\rangle$

(In the products on the left of the equal signs I am abbreviating $*$-products $p*q$ by $pq$.) Altogether, this shows that the underlying set of $\mathcal F$ is $\{a, b\}\cup V$ where $V\leq B^9$ is the $7$-dimensional subspace of all $z = \langle z_1,z_2,z_3,z_4,z_5,z_6,z_7,z_8,z_9\rangle$ satisfying $z_1=0$ and $z_2+z_4+z_5=0$. This allows us to determine the size of $\mathcal F$: it is $2+|V|=2+2^7 = 130$.

We can do more than determine the size of this algebra, we can even determine how the $*$-operation interprets on the set $\{a,b\}\cup V$. One may verify that:

  • $aa = \langle 0,0,0,0,0,0,1,1,1\rangle\in V$
  • $ab = \langle 0,1,1,1,0,0,0,0,1\rangle\in V$
  • $ba = \langle 0,1,0,1,0,0,1,0,1\rangle\in V$
  • $bb = \langle 0,0,1,0,0,1,0,0,1\rangle\in V$

This explains how to $*$-multiply one element of $\{a,b\}$ times another. One may also verify that if $z\in B^9$ then

  • $az = \langle z_1,z_2,z_3,z_4',z_5',z_6',0,0,0\rangle\in V$
  • $za = \langle z_1,z_2,z_3,z_4',z_5',z_6',z_7'z_8'z_9'\rangle\in V$
  • $bz = \langle z_1,z_2',0,z_4,z_5',0,z_7,z_8',0\rangle\in V$
  • $zb = \langle z_1,z_2',z_3'z_4,z_5',z_6',z_7,z_8',z_9'\rangle\in V$

Here I am writing primes on variables to mean: swap $0$ and $1$ (that is, $0'=1, 1'=0$). These four rules explain how to $*$-multiply an element of $\{a,b\}$ times an element $z\in V$. Finally, we already know how to $*$-multiply two elements $z, w\in V$ since $*$ is addition modulo $2$ coordinatewise on $V$.

Altogether this identifies the $130$ tuples comprised by the subalgebra of ${\mathcal A}^9$ generated by $\{a,b\}$, and how the $*$-algebra acts on these $130$ tuples. Usually it is hard to give this much detail without the use of a computer, but we were lucky here that ${\mathcal A}$ is close to being a $1$-dimensional $\mathbb F_2$-vector space.


The free $\mathcal A$-algebra over $X$ is an $\mathcal A$-algebra $A$ along with an injective map $i:X\to A$ satisfying the following universal property:

For any $\mathcal A$-algebra $B$ and any map between sets $f:X\to B$ there is a unique map between $\mathcal A$-algebras $g:A\to B$ such that $f=g\circ i$.

This is effectively given by the algebra $$A=\bigoplus_{w\in X^*}\mathcal A w\,,$$ where the $A$-bilinear multiplication is concatenation of words ($X^*$ denotes the set of words on the alphabet $X$).

Edit: Upon a closer read of your post, it's not entirely clear to me what structure $\mathcal A$ has. I believe an algebra has to be defined over (at least) a ring so the operations make sense, which doesn't seem to be the case here.