This question is inspired by [this previous one](https://mathoverflow.net/questions/286150/multiplication-on-cubic-hypersurfaces-and-partially-defined-groups).  Generally speaking, I ask what algebraic identities are universally valid for the composition law on cubic surfaces (or hypersurfaces); since the law in question is not always defined, I have to state this a little more carefully.

Let $\Sigma := \{u_1,\ldots,u_r\}$ be a finite set which we view as a set of indeterminates.  The **free magma** $F(\Sigma)$ on $\Sigma$ is the set of all expressions formed by combining the elements of $\Sigma$ with a binary operation $\circ$ with no relations at all (equivalently, the set of ordered binary trees whose nodes are labeled by the elements of $\Sigma$); for example, $u_1\circ(u_2\circ u_3)$ and $(u_1\circ u_2)\circ u_3$ are elements of $F(\Sigma)$.  The notion of substituting a variable by an element of $F(\Sigma)$ inside another element of $F(\Sigma)$ is unproblematic.

Given a cubic hypersurface (over a field which we might as well assume algebraically closed) $X$ and points $x_1,\ldots,x_r$ on $X$, and given an element $w$ of $F(\Sigma)$, we can define $w(x_1,\ldots,x_r)$ by substituting $x_i$ for $u_i$ and interpreting $\circ$ as the (partial) composition law on $X$ (which takes two points $x,y$ on $X$ to the third intersection point of $X$ with the line through $x$ and $y$, provided both the line and point in question are uniquely defined).  This is either a point on $X$ or undefined.

Say that $w\in F(\Sigma)$ is **universally undefined (for cubic hypersurfaces)** if $w(x_1,\ldots,x_r)$ is always undefined, whatever the hypersurface $X$ and whatever the points $x_1,\ldots,x_r$.  For example, $u\circ u$ is universally undefined for cubic surfaces; as is any element of $F(\Sigma)$ containing a subexpression obtained by substituting anything for $u$ in $u\circ u$.  (Generally speaking, if $w$ is universally undefined for cubic hypersurfaces, so is anything containing $w$ as a subexpression, or anything obtained by substituting subexpressions for the variables of $w$.)

If $w$ is not universally undefined for cubic hypersurfaces, then I believe $w(x_1,\ldots,x_r)$ is meaningful for general points $x_1,\ldots,x_r$ on a general hypersurface.  (I hope I'm not missing a subtle point about irreducibility here.)  It might even be true that it is then meaningful for general points $x_1,\ldots,x_r$ on *any* smooth (irreducible?) hypersurface $X$, I don't know.

If $w,w'$ are generally defined (i.e., not universally undefined), say that $w$ and $w'$ are **universally equal** (for cubic hypersurfaces) when $w(x_1,\ldots,x_r) = w'(x_1,\ldots,x_r)$, whatever the hypersurfaces $X$ and $X'$ and whatever the points $x_1,\ldots,x_r$, provided that both terms are defined (the previous paragraph implies that, if $w$ and $w'$ are *separately* generally defined, then they are *jointly* generally defined).

For example, $u\circ v$ and $v\circ u$ are universally equal.  More interestingly, $u\circ (u\circ v)$ and $v$ are universally equal; and so are $(u\circ v)\circ(u\circ v')$ and $u\circ (v\circ v')$.

I might define the “universal cubic hypersurface partial magma” $K(\Sigma)$ (on $r$ variables $u_1,\ldots,u_r$) to be the set of elements $w \in F(\Sigma)$ which are not universally undefined on cubic hypersurfaces, modulo the equivalence relation of being universally equal on cubic hypersurfaces; this comes with a partial binary operation taking $w$ and $w'$ to the class of $w\circ w'$ provided the latter is defined.  This operation $\circ$ is commutative, and $v \mapsto u\circ v$ is a partial idempotent automorphism of $K(\Sigma)$ (this is a reformulation of the previous paragraph).

**Question:** How can we decide, given an element $w\in F(\Sigma)$, whether it is universally undefined on cubic hypersurfaces, and given two elements $w,w'$, whether they are universally equal?

(The two questions are inextricably linked, since $w$ and $w'$ universally equal imply that $w\circ w'$ is universally undefined.)

Note: Rather than dealing with partially defined functions, it might be better to introduce a symbol $\bot$ for “undefined” and write, e.g., $u\circ u = \bot$ universally on cubic hypersurfaces.  In this way, both $u\circ u = \bot$ and $u\circ v = v\circ u$ are universal identities on cubic hypersurfaces (=equalities in $K(\Sigma)$).

In particular, the question asks, can we deduce all universal identities from the ones I already listed above?  (That is, is $K(\Sigma)$ “free” subject to the relations in question?)

**Bonus question:** Suppose we do the same for cubic surfaces instead of cubic hypersurfaces (evidently this can only produce more undefinedness and equality identities): is there, in fact, any identities which are universally valid on cubic surfaces and not on cubic hypersurfaces in general?