I'm following the lecture notes from MIT's 18.785, and I'm having trouble understanding the proof of the Dedekind-Kummer theorem. (Theorem 6.14 here)
Theorem 6.14 Assume $AKLB$ with $L = K(\alpha)$ and $\alpha \in B$. Let $f \in A[x]$ be the minimal polynomial of $\alpha$, let $\mathfrak{p}$ be a prime of $A$, and let $$ \overline{f} = \overline{g}_1^{e_1} \cdots \overline{g}_r^{e_r} $$ be its factorization into monic irreducibles in $(A/\mathfrak{p})[x]$. Let $\mathfrak{q}_i := (\mathfrak{p}, g_i(\alpha))$, where $g_i \in A[x]$ is any lift of $\overline{g}_i$ in $(A/\mathfrak{p})[x]$ under the reduction map $A[x] \to (A/\mathfrak{p})[x]$. If $B = A[\alpha]$ then $$ \mathfrak{p}B = \mathfrak{q}_1^{e_1}\cdots\mathfrak{q}_r^{e_r},$$ is the prime factorization of $\mathfrak{p}B$ in $B$ and the residue field degree of $\mathfrak{q}_i$ is $\deg \overline{g}_i$.
In the proof, the author first shows that $\frak{q}_i$ are prime ideals by quotienting, and then shows that $\prod_i \mathfrak{q}_i^{e_i}$ is divisible by $\mathfrak{p}B$. I am okay with these. The part I don't understand is the one following these arguments, where he writes
The $\overline{g}_i(x)$ are distinct as elements of $(A/\mathfrak{p})[x]/(f(x)) \cong A[x]/(\mathfrak{p}, f(x)) \cong A[\alpha]/\mathfrak{p}A[\alpha]$, and it follows that the $g_i(\alpha)$ are distinct modulo $\mathfrak{p}B$. Therefore, the prime ideals $\mathfrak{q}_i$ are distinct ...
I think I understand the first sentence, because if $\overline{g}_i(x)$ and $\overline{g}_j(x)$ have the same image in $(A/\mathfrak{p})[x]/(f(x))$ for some $i \ne j$, then $\overline{f}$ must divide $\overline{g}_i(x) - \overline{g}_j(x)$ inside $(A/\mathfrak{p})[x]$. Since $\overline{g}_i(x)$ and $\overline{g}_j(x)$ are distinct elements of $(A/\mathfrak{p})[x]$, it follows that one of them must have degree greater than or equal to $\overline{f}$. This contradicts that fact that they are both divisors of $\overline{f}$.
However, I don't understand why the fact that $g_i(\alpha)$ are distinct modulo $\mathfrak{p}B$ implies that the prime ideals $\mathfrak{q}_i = (\mathfrak{p}, g_i(\alpha))$ are distinct. Can someone explain the deduction here? It'll be great if you can check the validity of my argument above as well. Thank you so much.