Let $X$ and $Y$ be two integral separated Noetherian Gorenstein schemes over a base field $k$ of arbitrary characteristic whose local rings are unique factorization domains and $f: X\to Y$ an étale map between them. Since we assumed these to be Gorenstein, their canonical bundles $\omega\_X$, resp. $\omega\_Y$ exist and are line bundles / invertible sheaves.


The map $f$ induces via pullback the map $f^\*: \text{Pic}(Y) \to \text{Pic}(X)$ between Picard groups and the rather natural question which arrises at this point is how $\omega\_X$ and $f^\*\omega\_Y$ are related to each other?


Since $X$ and $Y$ where moreover assumed to be integral separated and locally factorial and therefore the Cartier divisors coincide with Weil-divisors, this question question can be equivalently stated in terms of Weil divisors and canonical classes: how $K\_X$ and $f^\*K\_Y$ are related to each other? Is there any explicitly formula known?


If we think of étale maps as algebro geometric pendants to topological coverings, then in case $X$ and $Y$ smooth ($\simeq$ manifolds in topological sense) one could expect/hope that it might hold $\omega\_X= f^\*\omega\_Y$, because in topological setting the the canonical bundles are given locally as determinant bundles of holomorphic $n$-forms and coverings are local isomorphisms.


If that's not the case in full generality for the assumptions of $X,Y$ and $f$ as above, is there at least an explicit formula à la Hurwitz for smooth curves/Riemann surfaces known relating $\omega\_X$ and $ f^\*\omega\_Y$ to each other?


If yes, how general this formula is? Does it only hold for smooth $Y,X$? Depend it on characteristic of base field $k$?


I'm pretty sure that if we drop the étaleness assumption and so allow some even rather tame ramifications then it is nearly hopeless to expect the existence of such formula relating $\omega\_X$ and $ f^\*\omega\_Y$ in such generality, so I hoped that maybe the étaleness assumption might provide the right amount of price which we are ready to pay to have such formula.



Relation between canonical bundles under étale maps
The usual definition of $\omega\_X^\bullet$ is $\pi\_X^!(k[0])$, where $\pi\_X \colon X \to \operatorname{Spec} k$ is the structure morphism. If $f \colon X \to Y$ is a map of $k$-schemes, we therefore get an isomorphism $f^! \omega\_Y^\bullet \stackrel\sim\to \omega\_X^\bullet$; see for instance [Tag [0ATX](https://stacks.math.columbia.edu/tag/0ATX)]. If $f$ is étale, then $f^! \cong f^\*$ [Tag [0FWI](https://stacks.math.columbia.edu/tag/0FWI)], so we get
$$f^\* \omega\_Y^\bullet \stackrel\sim\to \omega\_X^\bullet.$$
The next best thing is when $f$ is a perfect morphism (e.g. flat, or l.c.i., or when $Y$ is regular). In this case, we get an isomorphism $Lf^\*(-) \otimes^{\mathbf L}\_{\mathcal O\_X} \omega\_{X/Y}^\bullet \stackrel\sim\to f^!(-)$ [Tag [0B6U](https://stacks.math.columbia.edu/tag/0B6U)], giving
$$Lf^\*\omega\_Y^\bullet \overset{\mathbf L}{\underset{\mathcal O\_X}\otimes} \omega\_{X/Y}^\bullet \stackrel\sim\to \omega\_X^\bullet.$$
If $Y$ is Gorenstein, then $\omega\_Y^\bullet$ is invertible (in particular flat), so this simplifies to
$$f^\*\omega\_Y^\bullet \underset{\mathcal O\_X} \otimes \omega\_{X/Y}^\bullet \stackrel\sim\to \omega\_X^\bullet.$$
So it remains to compute $\omega\_{X/Y}^\bullet = f^! \mathcal O\_Y$. For a finite morphism, this is characterised by
$$f\_\*f^! \mathcal O\_Y = R\mathscr Hom\_{\mathcal O\_Y}(f\_\*\mathcal O\_X,\mathcal O\_Y),$$
viewed naturally as $f\_\*\mathcal O\_X$-module [Tag [0AX2](https://stacks.math.columbia.edu/tag/0AX2)]. I'm not sure if there is a simpler description of this, but the subtleties of the Riemann–Hurwitz formula for wild ramification show that this computation can become a bit involved.


(Also, while quasi-finite maps of smooth curves are always flat, I'm not sure if a quasi-finite map of Gorenstein schemes is always perfect, so it is possible that the second half of this answer doesn't apply in complete generality. Maybe there are better ways to compute $f^!\omega\_Y^\bullet$.)


