Sometimes, in the study of the singularity of integral models of some moduli spaces, one encounter some schemes defined by matrix equations over $\mathbb Z_p$. I wonder whether there are some general methods to study them.
For instance, $\mathbb Z_p[x,y]/(xy-p)$ is a regular domain. For every positive integer $n$, let's consider the ring $R_n=\mathbb Z_p[A,B]/(AB-p)$, where $A,B$ means $n \times n$ matrices so $Z_p[A,B]$ is the $2n^2$ variables polynomial ring, and we quotient the ideal $(AB-p)$ ($AB$ means matrix multiplication) to get $R_n$. Some natural questions are: is $R_n$ flat over $\mathbb Z_p$? Is $R_n$ a domain ? Is $R_n$ Cohen-macaulay? Is $R_n$ Gorenstein?
Of course, one can also consider rings like $\mathbb Z_p[A,B]/(AB-p, BA-p)$, $Z_p[A,B,C]/(AB-C^2)$, $\mathbb Z_p[A,B]/(AB-BA)$...
A naive expectation is that the singularity will become worse if we enlarge $n$, but will finally "stabilize".