# Equivalence of two definitions of ramification index

Let $\phi:Y\to X$ be a morphism of $\Bbbk$-varieties. In Görtz and Wedhorn's Algebraic Geometry 1, the ramification index is defined by

$$e_Q(Y) := \mathrm{length}_{\mathcal{O}_{Y,Q}}\left(\mathcal{O}_{Y,Q}\right)$$

and then $e_{Q/P} := e_Q(Y_P)$ where $Y_P$ is the scheme-theoretic fiber of $P\in X$ under $\phi$, i.e. $Y_P=Y\times_X\mathrm{Spec}(\Bbbk(P))$. For points of codimension one and assuming that $X$ and $Y$ are smooth, I know a different definition: Namely, let $f$ be a uniformizing parameter at $P$, i.e. $\mathfrak{m}_P=(f)$ is the unique maximal ideal of $\mathcal{O}_{X,P}$. Let $v_Q:\Bbbk(Y)\to\mathbb{Z}$ be the valuation corresponding to $\mathcal{O}_{Y,Q}$. Then,

$$e_{Q/P} = v_Q(\phi^\sharp_Q(f))$$

where $\phi^\sharp_Q: \mathcal{O}_{X,P} \to \mathcal{O}_{Y,Q}$ is the induced map. I would like to know why these two definitions coincide (in codimension one). I frankly don't even have an idea where to start.

-

In fact, I thought for a while and it became rather clear to me. Let's reduce to the affine case $Y=\mathrm{Spec}(B)$ and $X=\mathrm{Spec}(A)$. We can assume $f\in A$ and $P$ is a prime ideal of $A$. Then, we consider
$$\mathcal{O}_{Y_P,Q}=(B\otimes_A\Bbbk(P))_Q = (B\otimes_A(A_P/\mathfrak{m}_P))_Q = B_Q/(\mathfrak{m}_P\cdot B_Q) = B_Q/(f)$$
Now, if $g$ is a uniformizer at $Q$, then $f=u\cdot g^e$ where $u$ is a unit and $e=e_{Q/P}$ in the sense of the second definition. But by the above, $\mathcal{O}_{Y_P,Q}=B_Q/(g^e)$, which has length $e$ over itself.