Solution (source code)

= Solution

For $Q=\varphi(P)$, the <local ring> of a nonsingular curve at $Q$ is a <discrete valuation ring>. Choose a <uniformizer> $t$ there. The <ramification index of a morphism of curves> is
$$
\boxed{e_P=\operatorname{ord}_P(\varphi^*t).}
$$
Equivalently, $\varphi^*t=u z^{e_P}$ for a local <uniformizer> $z$ at $P$ and a <unit in a ring> $u$. A different choice $t'=vt$ changes its pullback by a <unit in a ring>, so the index is well-defined. This local definition applies also to inseparable morphisms; conclusions involving separability or <tame ramification> require those extra hypotheses.