Let $f:X\to Y$ be a finite dominant morphism of nonsingular varieties over some algebraically closed field. Let $P\in X$ be a point of codimension one, then $f(P)$ is also of codimension one. We can define the ramification index $e_P$ of $P$ in the same way one would do it if $X$ and $Y$ were curves, my main reference here is Hartshorne IV.2. My question is somewhat about the correct generalization of Proposition II.6.9 in Hartshorne.

From Liu's Book (Algebraic Geometry and Arithmetic Curves; in particular Thm. 7.2.18 and Exc. 7.2.3) I conclude that for any $Q\in Y$ of codimension one, we should obtain the equality

$\deg(f)=\displaystyle\sum_{P\in f^{-1}(Q)} e_P\cdot [k(P):k(Q)]$.

while

$\deg(f^\ast Q) = \displaystyle\sum_{P\in f^{-1}(Q)} e_P$

Now, I really want $\deg(f^\ast Q)$ to be constant for all $Q$ of codimension one - is this always the case? If not, can you name additional assumptions to make this work? Clearly, the condition $[k(P):k(Q)]=1$ for all $f(P)=Q$ comes to mind - in other words, the restriction of $f$ to any prime divisor of $X$ is an isomorphism. Does this hold under certain assumptions about $f$?

NOTmean that the restriction of $f$ to any prime divisor of $X$ is an isomorphism. It means that the restriction of $f$ to any prime divisor induces a birational map to its image (of course, for curves, these are the same things). $\endgroup$