Encoding of external direct product in terms of encodings of direct factors

Statement
This article describes how to construct an encoding of the external direct product $$G_1 \times G_2$$ given separate encodings of $$G_1$$ and $$G_2$$. Note that the nature of the encodings for $$G_1$$ and $$G_2$$ may be quite different.

For instance, $$G_1$$ may have a permutation encoding and $$G_2$$ may have a linear encoding. This does not matter -- we will still get an encoding of $$G_1 \times G_2$$ albeit it will be neither a permutation encoding nor a linear encoding.

New code-words
The idea is to encode $$(g_1,g_2)$$ by combining the code-words for $$g_1$$ and $$g_2$$. How the combination is done depends on our goals. Two possibilities:


 * Easier possibility: Introduce a new symbol for a comma separator, then write the new code-word by writing the code-word for $$g_1$$, then the comma separator, then the code-word for $$g_2$$.
 * Harder but in some cases more useful possibility: Alternate the code-word letters for $$g_1$$ and $$g_2$$.

Algorithms
The idea behind each algorithm (identity element, multiplication, inversion, and membership test) for the direct product is as follows:

Quasi-encodings
A quasi-encoding of a group is like an encoding, except that we lack a membership test. The construction of the quasi-encoding for the direct product is the same as that described above. The only difference is that we do not have a membership test for the direct product, because we are lacking membership tests for the individual direct factors.

Multi-encodings
A multi-encoding of a group is like an encoding, except that there could be multiple code-words for the same element, and we have a separate equality test to determine whether two code-words represent the same element. We can use the procedure described above to obtain a multi-encoding for $$G_1 \times G_2$$ in terms of multi-encodings of $$G_1$$ and $$G_2$$. The main difference is that we will need to add in an equality test that would first parse to obtain the coordinates, then check equality coordinate-wise.