TITLE: Classification of rings satisfying $a^4=a$
QUESTION [19 upvotes]: We have the famous classification of rings satisfying $a^2=a$ (for each element $a$) in terms of Stone spaces, via $X \mapsto C(X,\mathbb{F}_2)$. Similarly, rings satisfying $a^3=a$ are classified by pairs of Stone spaces via $(X,Y) \mapsto C(X,\mathbb{F}_2) \times C(Y,\mathbb{F}_3)$. (This kind of classification works for all rings with $a^n=a$ where $n$ is such that every prime power $q$ with $q-1|n-1$ is a prime number. Do these $n$ have a concise description or a name?)
Question. How to classify the rings satisfying $a^4=a$ for each element $a$?
They are commutative and embed into some product of copies of $\mathbb{F}_2$ or $\mathbb{F}_4$. A typical example would be $\{f \in C(X,\mathbb{F}_4) : f(E) \subseteq \mathbb{F}_2\}$ for some Stone space $X$ and a closed subset $E$. But because of $\mathrm{Aut}(\mathbb{F}_4)=\mathbb{Z}/2$ there cannot be a purely topological classification.
I suspect that the sheaf cohomology group $H^1(X \setminus E,\mathbb{Z}/2)$ might enter here. In fact, if $A$ is a ring satisfying $a^4=a$, then $E:=\{\mathfrak{p} : A/\mathfrak{p} \cong \mathbb{F}_2\}=V(a^2-a : a \in A)$ is a closed subset of the Stone space $X:=\mathrm{Spec}(A)$ and for every compact open subset $V$ of $X \setminus E$ we have an isomorphism of sheaves $\mathcal{O}_X |_{V} \cong \underline{\mathbb{F}_4}|_V$, because the sheaf of isomorphisms between them is a $\mathbb{Z}/2$-torsor and $H^1(V,\mathbb{Z}/2)=0$. But the potential failure of $\mathcal{O}_X |_{X \setminus E} \cong \underline{\mathbb{F}_4}|_{X \setminus E}$ should be encoded in $H^1(X \setminus E,\mathbb{Z}/2)$.

REPLY [3 votes]: Here is a proof for one part of Neil Strickland's answer.

If $R$ is a $4$-ring, then $R \to \hom_{C_2}(\hom_{\mathsf{Ring}}(R,\mathbb{F}_4),\mathbb{F}_4)$, $r \mapsto (f \mapsto f(r))$ is an isomorphism.

Proof. 
If $r \in R$ lies in the kernel, this means that $f(r)=0$ for all $f \in \hom(R,\mathbb{F}_4)$. Hence, $f$ lies in every prime ideal, and therefore in the nilradical, which is zero. This proves that injectivity..
For surjectivity, let $X:=\hom(R,\mathbb{F}_4)$ and let $\alpha : X \to \mathbb{F}_4$ be a $C_2$-equivariant continuous map. Write $\mathbb{F}_4=\{0,1,u,u^2\}$. We may write $\alpha$ as
$\alpha = \chi_{Y} + u \chi_{Z} + u^2 \chi_{\sigma Z},$
where $Y = \alpha^{-1}(\{1\})$ and $Z = \alpha^{-1}(\{u\})$ and hence $\sigma Z = \alpha^{-1}(\{u^2\})$. Notice that $Y,Z,\sigma Z$ are disjoint clopen subsets of $X$ and that $\sigma Y = Y$.
In the decomposition of $\alpha$, we have to be a bit careful since $u \chi_Z$ does not lie in $\hom_{C_2}(X,\mathbb{F}_4)$, but $\chi_Y$ and $u \chi_{Z} + u^2 \chi_{\sigma Z}$ do. We show that both functions are in the image.
First, let us treat $\chi_Y$. It suffices to find some idempotent element $r \in R$ such that $Y = \{f \in X : f(r)=1\}$, because then $(f \mapsto f(r))$ equals $\chi_Y$. Consider the map $X \to \mathrm{Spec}(R)$, $f \mapsto \ker(f)$. It is easily seen to be continuous. Since $f$ and $\sigma f$ have the same kernel, we get a continuous map $X/C_2 \to \mathrm{Spec}(R)$, which is clearly bijective. Since $X/C_2$ is compact and $\mathrm{Spec}(R)$ is Hausdorff, the map is a homeomorphism. It follows that there is a 1:1 correspondence between clopen subsets of $X/C_2$ and the clopen subsets of $\mathrm{Spec}(R)$, which in turn correspond to idempotent elements. Since $\sigma Y = Y$ and $Y$ is clopen, the image of $Y$ in $X/C_2$ is clopen, and we are done.
Now let us treat $u \chi_{Z} + u^2 \chi_{\sigma Z}$. Since $Z$ is open, we may write $Z$ as a union of non-empty sets of the form
$\{f \in X : f(r_1)=i_1,\dotsc,f(r_n)=i_n\}$
for some $r_k \in R$ and $i_k \in \mathbb{F}_4$. Since $Z \cap \sigma Z = \emptyset$, not all $i_k$ can be contained in $\mathbb{F}_2$. Since $f(r)=u^2$ is equivalent to $f(r^2)=u$, we may therefore assume that $i_1=u$. If $i_k=0$, rewrite the relation $f(r_k)=0$ as $f(r_1-r_k)=u$. If $i_k=1$, replace $r_k$ by $r_k-1$ and reduce to $i_k=0$. If $i_k=u^2$, replace $r_k$ by $r_k^2$ and reduce to $i_k=u$. Hence, each set may be written as
$\{f \in X : f(r_1)=\dotsc=f(r_k)=u\}.$
We claim that this already equals $\{f \in X : f(r)=u\}$ for some $r \in \langle r_1,\dotsc,r_k \rangle$. By induction, it suffices to assume $k=2$. Then, it suffices to find a polynomial $p \in \mathbb{F}_2[x,y]$ such that for $a,b \in \mathbb{F}_4$ we have $p(a,b)=u$ if and only if $a=b=u$. A possible choice is
$p := x (1 - (x-y)^3).$
In fact, if $a \neq b$ in $\mathbb{F}_4$, then $p(a,b)=0$, and otherwise $p(a,b)=a$. This implies the desired property.
We have proven that $Z$ is a union of sets of the form $\{f \in X : f(r)=u\}$ for various $r \in R$. Since $Z$ is assumed to be closed and therefore compact, finitely many $r$ suffice. We claim that there is some $r \in R$ such that $Z = \{f \in X : f(r)=u\}$. By induction, we may assume that $Z = \{f \in X : f(r_1)=u\} \cup \{f \in X : f(r_2)=u\}$. Since $Z \cap \sigma Z = \emptyset$, we see that $f(r_1)=u \Rightarrow f(r_2)^2 \neq u$ for all $f \in X$, and likewise $f(r_2)=u \Rightarrow f(r_1)^2 \neq u$. Therefore, similar to the technique before, it suffices to find a polynomial $p \in \mathbb{F}_2[x,y]$ such that for $a,b \in \mathbb{F}_4$ with $(a,b) \notin \{(u,u^2),(u^2,u)\}$ we have $p(a,b)=u$ if and only if ($a=u$ or $b=u$). We define $p_1:=x^2+x$, $p_2:=(x^2+x+1)(y^2+y)$ and finally $p := x p_1 + y p_2$. As polynomial functions on $\mathbb{F}_4 \times \mathbb{F}_4$, we have $p_1 = \chi_{\{u,u^2\} \times \{0,1,u,u^2\}}$, $p_2 = \chi_{\{0,1\} \times \{u,u^2\}}$. It follows that
$p = x \chi_{\{u,u^2\} \times \{0,1,u,u^2\}} + y \chi_{\{0,1\} \times \{u,u^2\}}.$
Hence, $p(a,b)=u \Leftrightarrow a=u \vee b=u$ except for $p(u^2,u)=u^2$. Since we don't have to care for $(u^2,u)$, that's enough.
We have proven that $Z = \{f \in X : f(r)=u\}$ for some $r \in R$. It follows that $\sigma Z = \{f \in X : f(r)=u^2\}$. Thus, if we substract $(f \mapsto f(r))$ from $u \chi_{Z} + u^2 \chi_{\sigma Z}$, we obtain a function which has only values in $\{0,1\}$. We already know that such a function lies in the image of the counit, hence $u \chi_{Z} + u^2 \chi_{\sigma Z}$ lies in the image, too. $\square$
Thanks to Jyrki Lahtonen for pointing out the polynomials in the proof above. In some sense, we don't really have to write these polynomials down since their existence is guaranteed by the finite case of the claim which is easy to deal with since every finite $4$-ring is a direct product of copies of $\mathbb{F}_2$ or $\mathbb{F}_4$.