I'm interested in implementing equality checking mod 10 in an arithmetic circuit. Is this possible? Preliminary evidence points towards "no", but I thought it best to ask before completely writing it off.
First, note that if $\mathbb{Z}_{10}$ were a field, this would be trivial due to Lagrange interpolation (allowing us to construct a polynomial with roots in $\mathbb{Z}_{10}^\times$, and taking value $1$ at $x = 0$). I'm interested in this unfortunately more difficult case.
Traditionally, appealing to some variant of Fermat's little theorem would make sense. Again, over a field $\mathbb{Z}_p$ we would have that $a^{p-1}\equiv 1$ if $a\neq 0$, and we'd be done. Euler's theorem is an obvious thing to try: $$ a^{\varphi(n)}\equiv 1\mod n,\quad (a,n) = 1 $$ This will map $\mathbb{Z}_{10}$ to $\{0,1,5,6\}$. We then might want to try to map $1,5,6\to 1$ while keeping $0\to 0$, but I don't believe this will be possible via some polynomial function.
If some polynomial $p(x)$ existed that did do this, we could consider $p(0)$ and $p(6)$. We have that $p(0)\not\equiv p(6)\mod 10$ (by assumption), and furthermore $p(0) = 0\not\equiv 1 =p(6)\mod 2$. This seems like a contradiction, as $p(x)\mod q\equiv p(x\mod q)$, due to "mod commuting with finite products/sums", which are precisely what polynomials are.
This makes me doubt that equality checking mod 10 is possible to implement with an arithmetic circuit over $\mathbb{Z}_{10}$, but the problem was phrased to me in a way that it seems like it should be possible to do some way with arithmetic circuits. How would you do it?