TITLE: Examples of finite local rings of length 2 or 3
QUESTION [9 upvotes]: What is an example of a finite local rings, that has length 2 or 3? 
I want something different from $F_{q}[x] / x^{i}$ for $i=2, 3$; I'm looking for something more interesting. If you can give me examples of higher length, yet have "simple structure" (e.g. $F_{q}[x]/x^{i}$), that would be nice too. 
I know this is related to Classification of finite commutative rings, but I didn't completely understand the answer there.

REPLY [5 votes]: Any local rings of length 2 are of the form $R/n^2$ with $(R,n)$ a regular local ring of dimension 1.
Any local rings of length 3 are of the form $R/n^2$ with $(R,n)$ a regular local ring of dimension 2 or $R/n^3$ with $(R,n)$ a regular local ring of dimension 1.
Proof for the length 3 case: Let $A,m,k$ be our ring. Then the exact sequence:
$$ 0 \to m \to A \to k  \to 0 $$
shows that $length(m)=2$. So the number of generators of $m$ is at most 2. If it is 2, then 
$length(m/m^2)=2$, thus $m^2=0$. So $A=R/n^2$ with $(R,n)$ a regular local ring of dimension 2.
If it is 1, then $A$ is a quotient of a regular local ring of dimension 1, and counting length shows that we need to kill the cube of the (principal) maximal ideal. 
Of course, $R$ may or may not contains a field, so one may have things like $k[[x,y]]/(x^2,xy,y^2)$ or $Z_p[[x]]/(p^2,xp,x^2)$.
MORE: We can assume our regular $R$ is complete, since $A$, being Artinian, is complete. Then the  Cohen Structure Theorem completely described $R$. If $R$ contains a field, then 
$R \cong k[[x,y]]$. If $R$ is mixed charateristic and unramified, then $R\cong V[[x]]$, with 
$(V,pV)$ a discrete valuation ring. If $R$ is ramified, then $R=V[[x,y]]/(f)$, with $f=p+g$ such that $g \in (x,y)^2$. From those you can get $A$ accordingly by killing the square of the maximal ideal.

REPLY [3 votes]: I'm just going to consider the local rings with residue field $\mathbf{F}_p$.
Suppose A' is an extension of $\mathbf{Z}/p$ with ideal $\mathbf{Z}/p$.  If we take the fiber product with $\mathbf{Z}$, we get an extension of $\mathbf{Z}$ with ideal $\mathbf{Z}/p$.  Up to isomorphism, there is only one such extension: $B' = \mathbf{Z}[t] / (t^2, pt)$.  The kernel of the map from B' to A' is isomorphic to $\mathbf{Z}$ and reduces modulo t to the ideal generated by p.  Therefore, the square-zero extensions of $\mathbf{Z}/p$ are all isomorphic to $\mathbf{Z}[t] / (t^2, pt, p + \lambda t)$ for some $\lambda \not= 0$.  If $\lambda$ is not a multiple of p, we get $\mathbf{Z} / p^2$; if $\lambda$ is a multiple of $p$, we get $\mathbf{Z}[t] / (p, tp, t^2) = \mathbf{F}_p[t] / t^2$.  So these are all the length 2 finite local rings with residue field $\mathbf{F}_p$.
For length 3, we'll look for extensions of $\mathbf{Z} / p^2$ by $\mathbf{Z} / p$.  The same analysis shows that these are all of the form $\mathbf{Z}[t] / (t^2, pt, p^2 + \lambda t)$.  If $\lambda$ is not divisible by $p$, we get $\mathbf{Z} / p^3$ and if $\lambda$ is divisible by $p$ we get $\mathbf{Z}[t] / (p^2, pt, t^2)$.
We also have to look for extensions of $\mathbf{F}_p[t] / t^2$.  By base change, any such extension A' gives an extension B' of $\mathbf{Z}[t]$ with ideal $\mathbf{Z} / p$.  Once again, there is only one of these up to isomorphism (since $\mathbf{Z}[t]$ is projective, for example) and it is given by $\mathbf{Z}[t,u] / (u^2, pu, tu)$.  The ideal of the map from B' to A' generates the ideal of the map from $\mathbf{Z}[t]$ to $\mathbf{F}_p[t] / t^2$.  Since this is generated by p and t^2 the ideal of A' in B' is generated by $(p + \lambda u, t^2 + \mu u)$ and A' is of the form
$\mathbf{Z}[t,u] / (u^2, pu, tu, p + \lambda u, t^2 + \mu u)$
for some polynomials $\lambda, \mu \in \mathbf{Z}[t]$.  

Edit: If $\lambda$ is not in $(p, t)$ then it is invertible in the quotient, so we get 
$\mathbf{Z}[t,u] / (p^2, tp, t^2 + \mu \lambda^{-1} p)$.
There are two possibilities up to isomorphism here, depending on whether $- \mu \lambda^{-1}$ is a quadratic residue modulo p.
If $\lambda$ is in $(p,t)$ we get
$\mathbf{Z}[t,u] / (u^2, pu, tu, p, t^2 + \mu u) = \mathbf{F}_p[t,u] / (u^2, tu, t^2 + \mu u)$.
The $\mu$ is also not in $(p, t)$ then we get $\mathbf{F}[t] / t^3$.  If $\mu$ is in $(p,t)$ we get $\mathbf{F}_p[t,u] / (u^2, tu, t^2)$.
Modulo any mistake I made above, I think a complete list is of length 3 finite local rings with residue field $\mathbf{F}_p$ is

$\mathbf{Z} / p^3$,
$\mathbf{Z}[t] / (p^2, pt, t^2)$,
$\mathbf{Z}[t] / (t^2 - p, t^3)$,
$\mathbf{Z}[t] / (t^2 - \alpha p, t^3)$ where $\alpha$ is a non-quadratic residue modulo $p$,
$\mathbf{F}_p[t] / t^3$, and
$\mathbf{F}_p[t,u] / (t,u)^2$.