TITLE: Non isomorphic finite rings with isomorphic additive and multiplicative structure
QUESTION [45 upvotes]: About a year ago, a colleague asked me the following question:

Suppose $(R,+,\cdot)$ and $(S,\oplus,\odot)$ are two rings such that $(R,+)$ is isomorphic, as an abelian group, to $(S,\oplus)$, and $(R,\cdot)$ is isomorphic (as a semigroup/monoid) to $(S,\odot)$. Does it follow that $R$ and $S$ are isomorphic as rings?

I gave him the following counterexample: take your favorite field $F$, and let $R=F[x]$ and $S=F[x,y]$, the rings of polynomials in one and two (commuting) variables. They are not isomorphic as rings, yet $(R,+)$ and $(S,+)$ are both isomorphic to the direct sum of countably many copies of $F$, and $(R-\{0\},\cdot)$ and $(S-\{0\},\cdot)$ are both isomorphic to the direct product of $F-\{0\}$ and a direct sum of $\aleph_0|F|$ copies of the free monoid in one letter (and we can add a zero to both and maintain the isomorphism).
He mentioned this example in a colloquium yesterday, which got me to thinking: 

Question. Is there a counterexample with $R$ and $S$ finite?

REPLY [28 votes]: There do exist pairs of finite unital rings whose additive structures
are isomorphic and whose multiplicative structures are isomorphic,
yet the rings themselves are not isomorphic. 
To see this, let $\mathbb F$ be a field and let $X = \{x_1,\ldots, x_n\}$
be a set of variables. The polynomial ring $\mathbb F[X]$
is graded by degree
$$
\mathbb F[X] = H_0\oplus H_1\oplus H_2\oplus\cdots.
$$
Let $Q(x_1,\ldots,x_n)$ be a quadratic form over $\mathbb F$.
Let
$$I = \mathbb F\cdot Q(X)\oplus H_3\oplus H_4\oplus\cdots$$
be the 
ideal generated by $Q(X)$ and the homogeneous components
of degree at least $3$.
Let $S_{\mathbb F,Q}$ denote the $\mathbb F$-algebra
$\mathbb F[X]/I$. It is a commutative, local ring, which encodes
properties of the quadratic form $Q$.
Two quadratic forms $Q_1$ and $Q_2$ are equivalent
if they differ by an invertible linear change of variables.
Claim.
  Let $\mathbb F$ be a finite field of odd characteristic $p$.
Let $Q_1(x_1,\ldots,x_n)$ and $Q_2(x_1,\ldots,x_n)$ be 
nonzero quadratic forms over $\mathbb F$.

$S_{\mathbb F,Q_1}$ and $S_{\mathbb F,Q_2}$ have isomorphic
$\mathbb F$-space structures.
If $n>4$ and $Q_1$ and $Q_2$ are nondegenerate, then
$S_{\mathbb F,Q_1}$ and $S_{\mathbb F,Q_2}$ have
isomorphic multiplicative monoids.
$S_{\mathbb F,Q_1}\not\cong S_{\mathbb F,Q_2}$ as $\mathbb F$-algebras,
unless $Q_1$ is equivalent to a nonzero scalar multiple of $Q_2$.

Proof. Exercise! \\
So let $\mathbb F = \mathbb F_3$ be the $3$-element field.
It is known that over a finite field of odd characteristic
the quadratic forms are classified by the dimension
and by the determinant of the form modulo squares.
The determinant of 
$$
Q(x_1,\ldots,x_n)=a_1x_1^2+a_2x_2^2+\cdots+a_nx_n^2
$$
is $a_1\cdots a_n$. If
$\alpha\in \mathbb F_3^{\times}=\{\pm 1\}$,
then $\alpha\cdot Q$ has determinant
$\alpha^n a_1\cdots a_n=(\pm 1)^n a_1\cdots a_n$.
If $n$ is even, then the determinants of $Q$ and $\alpha\cdot Q$ will be equal,
so $Q$ will be equivalent 
to $\alpha\cdot Q$ for every $\alpha\in \mathbb F_3^{\times}$.
This implies that, when working over $\mathbb F_3$ in an even dimension,
if $Q_1$ is not equivalent to $Q_2$, $Q_1$ will also
not be equivalent to any nonzero scalar
multiple of $Q_2$.
In particular, no scalar multiple of
$$
Q_1 = x_1^2 + x_2^2 + x_3^2 + x_4^2 + x_5^2 + x_6^2,
$$
is equivalent to 
$$
Q_2 = x_1^2 + x_2^2 + x_3^2 + x_4^2 + x_5^2 - x_6^2
$$
over $\mathbb F_3$. For these forms we have
that $S_{\mathbb F,Q_1}$ and $S_{\mathbb F,Q_2}$ are nonisomorphic
finite unital rings with isomorphic additive and multiplicative structures.
(These rings have size $3^{27}$.)
Minor side comment 1: If you allow nonunital rings, there is a pair of nonisomorphic $8$-element rings whose additive and multiplicative structures are isomorphic.
Minor side comment 2:
The solution to the exercise above (that is, the proof of the Claim)
can be found here.