How to construct the smallest set of all algebraic expressions?

59 Views Asked by At

I am a high school math teacher and I have a little side project that has been going on since some time: build a taxonomy of mathematical expressions.

Specifically, let's define a set of symbols $S$ and a set of $n$-ary operators $O$. A formula is defined as a tree with elements of $S$ at the leaves and elements of $O$ at the internal nodes.

For sake of concreteness, let's take a (not necessary commutative!) field $(F,+,\cdot)$ and consider the field $F(x,y,z)$ of rational expressions in three variables.

So $S=\{x,y,z\}\cup F$ and $O=\{+,\cdot,\text{opp},\text{inv}\}$, where $\forall \alpha \in S, \alpha+\text{opp}(\alpha) = \text{opp}(\alpha) + \alpha = 0_F$ and $\alpha\cdot\text{inv}(\alpha)= \text{inv}(\alpha)\cdot \alpha = 1_F$.

(I don't know if the requisite of $F$ being a field simplifies the task or not)

I now would like to enumerate all expressions of length $n$, where the length of the expression is defined as the number of nodes of its tree representation. When I try to count all possible expressions, I want to count the really different ones, because there is the problem of counting duplicates.

I would like to say that the two expressions \begin{equation} x\cdot y\quad\quad x\cdot z \end{equation}

are essentially the same because they are of the form "a variable times a possibily different variable". Still, I would like to keep the two expressions

\begin{equation} x\cdot y\quad\quad y\cdot x \end{equation}

separate, because "$\cdot$" may not be commutative.

What I am trying to do is construct an equivalence relation on the space of all the possible algebraic expressions which captures the sense of the expression disregarding the actual variable symbols that it uses. As another example, the expression \begin{equation} y+z \end{equation} should be a duplicate of $x+y$, the rationale behind this idea being that what I want to express is the concept of "a sum of two possibly different variables". So if I choose to count $x+y$ as the representation of this idea I could discard $y+z$. Note that I have still to keep $y+x$ and count it as different from $x+y$.

As another example, here are all the length $3$ expressions with only the variables $x,y,z$ and the "$+$" operator that I would count as valid:

\begin{equation} x+x \qquad x+y \qquad y+x \end{equation}

the following are not valid, because they express the same concept as the previous expressions: \begin{equation} x+z \qquad z+x \qquad y+y \qquad y+z \qquad z+y \qquad z+z \end{equation}

So in this case to express every possible use of a single operator "+", it's obvious that we need at most $2$ variables, for instance $x$ and $y$; that is why every other expression with $z$ is essentially a duplicate.

My question is: could someone help me define the exact equivalence relation that I'm trying to express here? How to count every expression of length $n$ up to this equivalence relation?

EDIT: one could argue that also the expression $x+x$ is superfluous because the expression $x+y$ already has the possibility of expressing $x+x$. But $x+x$ is equivalent to $2\cdot x$ which is essentially different from $x+y$!

EDIT 2: I'll try to better explain myself since from the comments I understand that my thoughts are not really clear. Suppose I have only the product operation, "$\cdot$", and only one variable. I can express the idea of "multiplication" by writing $x\cdot x$. Of course, having only one variable, I can express only the idea of "multiplication of something by itself". Now, if we allow for a second variable, $y$, we can express the product of two things together, and if the product is non commutative, the order counts, so $x\cdot y$ should be considered different from $y\cdot x$. There are two essentially different ways to combine two things. We have now three possible expressions in total, each expressing a different concept in the context of how many variables we are considering. I argue that the expression "$y\cdot y$" is redundant, we don't need it because we already have an expression that means "a product of a thing by itself", which is $x\cdot x$.