Given a nonassociative algebra or ring $R$, the commutator and anticommutator are defined as: \begin{align} [a,b]=ab-ba, \{a,b\} = ab+ba\end{align} and the associator is defined as: \begin{align} (a,b,c) = (ab)c-a(bc)\end{align}
for all $a,b,c \in R$. Both of these can be easily generalised using the machinery of polynomial identity ring such as for some polynomial $P$ and all $x,y,z \in R$: \begin{align} P(x,y,z) = (xy-yz)^2z-z(xy-yz)^2\end{align}
Or putting more nested brackets similar to Moufang identities or Jordan identity: \begin{align} Q(a,b,c,d) = ((ab)c)d - a(b(cd))\\ S(x,y,z) = [x,[y,z]]+[y,[x,z]]+[z,[x,y]]\end{align}
Observing the above, there seemed to be the following features:
- Noncommutativity, which need at least a pair $ab$ to be defined
- Nonassociativity, which needs at least a triple $abc$ to be defined
What I am interesting in is to find an algebraic property $X$ such that it has the following features
- non-$X$, need at least a quadruple to be defined
- non-$X$ cannot be obtained by nested brackets nor polynomial identities involving bracketed terms
- Similar to the commutator and associator (and their nested or n-ary generlaisations), if the operator that corresponds to non-$X$ evaluates to the identity then it means the structure is $X$-ative.
Ternary examples that satisfy the above include the operator $\langle x,y,z\rangle$ in median algebras but throwing away the ternary associativity identity, as well ternary cancellation in ternary quasigroups (§1B)
But in order to find a quaternary example, it means we need something that has a higher operator precedence than the parenthesis () on a string in order to do this. However I am not sure what that could be
I can't think of any ''naturally occurring'' examples of algebras with quaternary operations (that aren't built up from binary or ternary operations). However, that doesn't mean that ''unnatural'' examples aren't important. For example:
An $\mathsf{NU}(4)$-algebra is an algebraic structure $\mathbf{A}=\langle A;\{n\}\rangle$ that satisfies $ n(a,a,a,b)=n(a,a,b,a)=n(a,b,a,a)=n(b,a,a,a)=a $ for all $a,b\in A$. These algebras are interesting to universal algebraists because they always have distributive congruence lattices and their collections of all term operations are completely determined by their subalgebras of $\mathbf{A}^3$. They can be generalized to $\mathsf{NU}(k)$-algebras where $k\geq 3$ in the obvious way. The operation $n$ is called a near-unanimity operation.
$\mathsf{NU}(k)$-algebras are also important to other classes of algebraic structures as well. If $\mathbf{A}=\langle A;F\rangle$ is an algebraic structure with a term operation $n$ that is a $k$-ary near-unanimity operation, then $\mathbf{A}$ also has a distributive congruence lattice and its collection of term operations is determined by the subalgebras of $\mathbf{A}^{k-1}$. In other words, if the $\mathsf{NU}(k)$-algebra $\langle A,\{n\}\rangle$ can be interpreted in the algebra $\mathbf{A}$, then $\mathbf{A}$ inherits some of the properties of $\langle A;\{n\}\rangle$.
As an example, if $\mathbf{R}=\langle R;\{+,\cdot\}\rangle$ is a ring that satisfies $x^m=x$, then the term operation $ n(x,y,z)=\big(x-(x-y)(x-z)^{m-1}+z\big)\big(x-z\big)^{m-1}+z $ is a $3$-ary near-unanimity operation. So rings that satisfy $x^m=x$ have distributive ideal lattices and an operation on the ring $\mathbf{R}$ is a term operation if and only if it preserves every subring of $\mathbf{R}^2$.
Operations like these that help determine the structure of the algebra are very important in universal algebra. Many of them allow arities higher than 3 as well. Some other examples in addition to near-unanimity terms include: Mal'cev terms, Jónsson terms, Day terms, edge terms, weak near-unanimity terms, cyclic terms, and so on.