I came across the following answer that proofs that every $n$-ary operation on a finite set is a finite composition of binary operations:
A proof is especially simple for operations on a finite set $\rm\:A\:.\:$ Namely, if $\rm\:|A| = n\:$ then we may encode $\rm\:A\:$ by $\rm\:\mathbb Z/n\:,\:$ the ring of integers $\rm\:mod\ n\:,\:$ allowing us to employ Lagrange interpolation to represent any finitary operation as a finite composition of the binary operations $\rm\: +,\ *\:,\:$ and $\rm\: \delta(a,b) = 1\ if\ a=b\ else\ 0\:,\:$ namely $$\rm f(x_1,\ldots,x_n)\ = \sum_{(a_1,\ldots,a_n)\ \in\ A^n}\ f(a_1,\ldots,a_n)\ \prod_{i\ =\ 1}^n\ \delta(x_i,a_i) $$
For me, it is unclear how $\delta(a,b)$ is decomposed into the binary operations $\rm\: +,\ *\:$ in the case of $n$ not being a prime. If $n$ is a prime, the ring $\rm\:\mathbb Z/n\:$ is a field and we can write $$\delta(x_i,a_i) = \prod_{a_j\ \in\ A\\a_j \neq a_i} \frac{x_i - a_j}{a_i - a_j} ,$$ as the inverse of $a_i - a_j$ exists. Am I missing a decomposition of $\delta(a, b)$ like the above that also holds true for rings? Or does Sierpinski's proof rely on the existence of the Kronecker Delta as a third "binary operation" $\delta: A \to \{0, 1\}$ that cannot be decomposed further for the cases where $n$ is not prime.
If I were to miss such a decomposition of $\delta(a, b)$, this proof actually states that every $n$-ary operation on a finite set can be re-interpreted as a polynomial over the ring $\rm\:\mathbb Z/n\:$. Is that reasoning correct?
If Sierpinski's proof relies on the existence of the Kronecker Delta as a third "binary operation", is there a proof that, for $n$ not prime, $n$-ary operations exist that cannot be re-interpreted as a polynomial over a ring?
The same proof is also stated here.