In Hartshorne IV.2, notions related to ramification and branching are introduced, but only for curves. The main result is the Hurwitz formula. 


Now if you have a finite surjective morphism between nonsingular, quasi-projective varieties, then the notion of ramification (divisor) would still make sense and we can also still talk about the degree of a canonical divisor. It also seemed to me like no result in IV.2 really uses the fact that $X$ and $Y$ are of dimension $1$. So I ask, can I replace $f$ by a finite, dominant, separable morphism $X\to Y$ of nonsingular, quasi-projective varieties of arbitrary dimension? That is, of course, up to and including Proposition 2.3. 


If this is so, can we say anything about the degree of a canonical divisor in dimension greater than one? Maybe in special cases?



Higher dimensional version of the Hurwitz formula?
degree of the canonical divisor doesn't make any sense as already pointed out by Mohammed. 


On the other hand, by "purity of the branch locus", the branch locus, as well as the ramification locus of $f$ is a sum of irreducible divisors. Denote by $R\_i$ the irreducible components of the ramification locus. Then, the local rings of the generic points of the $R\_i$ are DVR's, and one can associate ramification indices $e\_i$ to them (as explained in Hartshorne's book). Local computations show that
$$
\omega\_X \cong f^\*\omega\_Y\otimes{\cal O}\_Y(\sum\_i (e\_i-1)R\_i)
$$
In fact, one checks this outside the intersections of the $R\_i$, where these local computations are easy. This gives the desired isomorphism outside codimension $2$, and by reflexivity, the desired isomorphism holds everywhere.


