Degree of extension is equal to linear combination of prime factor multiplicities with prime factor index coefficients in Dedekind domains I'm working on the following problem...

Suppose that $A$ is a Dedekind domain with fraction field $K$.  $L/K$ is a finite separable extension of $A$ of degree $n$, and $B$ is the integral closure of $A$ in $L$ (so that $B$ is also a Dedekind domain).  Suppose that $\mathfrak{p}$ is a nonzero prime ideal of $A$, and $B\mathfrak{p}=\mathfrak{q}^{e_1}\cdots \mathfrak{q}_r^{e_r}$ is the prime factorization of $B\mathfrak{p}$.  Show that $$e_1f_1+\cdots +e_rf_r=n$$ where $f_i=[B/\mathfrak{q}_i:A/\mathfrak{p}]$.



*

*My first question is, why does integrality over $A$ imply that $B$ is also a Dedekind domain?

*My second question is, well, how to do the problem.  I need an outline so that I know what I'm looking for. What results will be needed here?
 A: *

*This just follows from the definition of a Dedekind domain. Since it is the integral closure in its own field of fractions, you know that $B$ is normal. It is dimension $1$ since it is an integral extension of $A$ which is dimension $1$. But, since $L/K$ is separable finite, it follows (essentially by bounding $B$ between $A$ and $\frac{1}{d_{B/A}}A$) that $B$ is a actually a finite $B$-module, and so Noetherian. So, $B$ is dimension $1$, normal, and Noetherian, and so a Dedekind domain.

*Here's a rough idea. On one hand, you have that $B/\mathfrak{p}B$ is an $n$-dimensional $A/\mathfrak{p}$-space (why?). But, you can factor $\mathfrak{p}B$ as $\mathfrak{q}_1^{e_1}\cdots\mathfrak{q}_n^{e_n}$. So, 
$$B/\mathfrak{p}B\cong \prod_i B/\mathfrak{q}_i^{e_i}B$$
by CRT. Then check that $|B/\mathfrak{q}_i^{e_i}B|=|B/\mathfrak{q}_i B|^{e_i}$. You can find an outline of this here (be prepared for a rabbit hole). Finally, use this to check that $\dim_{A/\mathfrak{p}}B/\mathfrak{q}_i^{e_i}B=e_i f_i$. Then, conclude.

