Isomorphism of two-dimensional algebra I'm reading the proof of isomorphism of two-dimensional algebra from my teacher but don't understand in some place. 
Let $p$ is a prime number and $A$ is two-dimensional algebra over $\mathbb{Z}_{p}$. Then either $A \cong \mathbb{Z}_{p}\times \mathbb{Z}_{p}$ or $A \cong F_{p^{2}}$ or $A \cong \left(\begin{array}{cc} \alpha & \beta \\ 0 & \alpha  \end{array}\right)$.
Proof. For $p \ne 2$.
Let $a \in A \setminus \{1_{A}\cdot\alpha ~|~ \alpha \in \mathbb{Z}_{p}\}$. Then $A = \langle 1,a \rangle 
 _{\mathbb{Z}_{p}}$. Since $a^{2} \in \langle 1,a \rangle _{\mathbb{Z}_{p}}$, hence $a^{2} = \alpha a+\beta 1_{A}$. Consider 3 cases:
Case 1: $\alpha^{2} + 4\beta = 0$. Then $\left( a-\frac{\alpha}{2}\cdot 1_{A}\right)^{2} = 0$. Then $1_{A}, a'=\alpha a+\beta 1_{A}$ - basis of algebra A and $a'^{2}$ = 0$. 
Therefore $A \cong \left(\begin{array}{cc} \alpha & \beta \\ 0 & \alpha  \end{array}\right)$ (why?).
Case 2: $\alpha^{2} + 4\beta \ne 0, \left(\frac{\alpha^{2} + 4\beta}{p}\right) =1$. Then $a'^{2} =1_{A}$ for some $a' \in A$ (why?). Let $ e_{1} = \frac{1_{A} -a'}{2}, e_{2} = \frac{1_{A} +a'}{2}$. We have $e_{1} + e_{2} = 1, e_{1}e_{2}=e_{2}e_{1}=0, e_{1}^{2}=e_{1},e_{2}^2=e_{2}$. Therefore $A \cong \mathbb{Z}_{p}\times \mathbb{Z}_{p}$ (why?)
Case 3: $\left(\frac{\alpha^{2} + 4\beta}{p}\right) = -1$. Then $x^{2} -\alpha x-\beta$ indecomposable polunomial over $\mathbb{Z}_{p}$ (why?). Let $\alpha 'a +1_{A}\beta '$ is arbitrary nonzero element. Since $(\alpha ' + \beta 'x,x^{2} -\alpha x-\beta)=1$, then $ 1 =(\alpha ' + \beta 'x)q_{1}(x) +(x^{2} -\alpha x-\beta)q_{2}(x)$ for some $q_{1}(x),q_{2}(x) \in \mathbb{Z}_{p}[x]$. Then $1_{A} = (a\beta ' + \alpha '1_{A}q_{1}(a)$. Thus $A_{\mathbb{Z}_{p}}$ is a field. Hence $A \cong F_{p^{2}}$.
 A: Case I. I think you meant to write $a'=a-\frac{1}{2}\alpha$. The matrix algebra also has a basis:
$$ \begin{bmatrix} \alpha & \beta \\ 0 & \alpha \end{bmatrix} = \alpha\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + \beta \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} $$
(That is, a $\mathbb{Z}_p$-basis.) These basis elements behave just as $1$ and $a'$ do in $A$. Thus, show
$$ \alpha 1+\beta a'\leftrightarrow \begin{bmatrix} \alpha & \beta \\ 0 & \alpha \end{bmatrix} $$
is an algebra isomorphism.
Case II. Do you know where $\alpha^2+4\beta$ comes from? It's the discriminant $\Delta$ of $a^2-\alpha a-\beta$. If this is a perfect square, then $a$ is "like" the scalar $(\alpha+\sqrt{\Delta})/2$ by the quadratic formula, except $a\not\in\mathbb{Z}_p$, so instead write $(2a-\alpha)^2=\Delta$ (which follows from the original equation for $a^2$ by completing the square) or in other words $(2a-\alpha)/\sqrt{\Delta}$ squares to $1$ but is not a scalar.
Once you know $e_1,e_2$ are orthogonal idempotents, find what the corresponding orthogonal idempotents of $\mathbb{Z}_p\times\mathbb{Z}_p$ ought to be, use that to define a candidate algebra isomorphism, then prove it is in fact an isomorphism.
Case III*. Why irreducible? If it were reducible then the quadratic formula / completing the square would say the discriminant is a perfect square, contradicting its Legendre symbol being $-1$.
