TITLE: When do divisors pull back?
QUESTION [31 upvotes]: If we have a nonconstant map of nonsingular curves $\varphi:X\rightarrow Y$, then Hartshorne  defines a map $\varphi^* Div(Y)\rightarrow Div(X)$ using the fact that codimension one irreducibles are just points, and looking at $\mathcal{O}_{Y,f(p)} \rightarrow \mathcal{O}_{X,p}$. My question is if we don't have a nice map of curves, what conditions can we put on the morphism so that we may pull divisors back? Clearly it's not true in general, since we can take a constant map and then topologically the inverse image doesn't even have the right codim.
Thinking about this in terms of Cartier divisors (and assuming the schemes are integral), it seems like we just need a way to transport functions in $K(Y)$ to functions in $K(X)$. If $\varphi$ is dominant, then we'll get such a map. Is this sufficient? Also is there something we can say when $\varphi$ is not dominant? Something like we have a way to map divisors with support on $\overline{\varphi(X)}$ to divisors on $X$?

REPLY [20 votes]: It seems to me that you are approaching this in the wrong way.
First of all you have to decide whether you want to pull-back      

divisors

or

divisor classes

Pulling back divisors means pulling back cycles and you run into all sorts of problems. If your map is flat, then this is OK. See Fulton's Intersection theory book for more on this. (There is a section called "flat pull-back of cycles" somewhere early). This is actually why Hartshorne did not have to worry about pulling back divisors or divisor classes. Any non-constant morphism between non-singular curves is flat. Of course, I am not saying this is the most general condition under which you can pull-back divisors, just that this is the "natural" one. Then again, this is a little too much, because it works for any dimensional cycles, not just divisors.
Pulling back divisor classes is somewhat easier (and harder at the same time). It is easier, because then you don't have to worry about the support. As already pointed out by Frank, you just "convert" your divisor class to a line bundle, pull that back and "convert" it back to a Cartier divisor. Actually for this you need $X$ to be integral, but you seem to be OK with assuming that.
Anyway, another, perhaps more interesting question is how to pull-back Weil divisors. The main problem there is that they are not defined locally by a single equation, so their associated sheaf
 is not an line bundle, only a reflexive sheaf of rank $1$. Unfortunately pulling back those does not necessarily give you a reflexive sheaf. One solution is to still do that and then take the reflexive hull, but this will likely not give a group homomorphism. Another partial way to handle Weil divisors is to restrict to $\mathbb Q$-Cartier divisors, i.e., a divisor that itself may not be Cartier, but a multiple of which is Cartier. Then you just take that multiple, pull that back and then divide by the same number you multiplied with. Interestingly this can result in fractional coefficients, so it will only preserve linear equivalence mod $\mathbb Q$. The simplest example of a $\mathbb Q$-Cartier, but not Cartier divisor is a ruling of a quadratic cone (look at intersection numbers to prove this). A little more interesting example is included in this MO answer. For an example of a non-$\mathbb Q$-Cartier divisor consider the cone over a quadric surface in $\mathbb P^3$ and let the divisor be the cone over one line on the surface.