# Cartier divisor on an open subscheme whose complement is of codim 2

1- If a Cartier divisor is defined away from a codim 2 closed subset, when can we say that this must be a restriction of a Cartier divisor on the whole scheme?

2- If two Cartier divisor agree away from a codim 2 closed subset, when can we say that they must be the same?

-

1 - This is true for locally factorial schemes; in this case all Weil divisors are Cartier, and extending Weil divisors is not a problem.

2 - This is not true in general (for example, if you glue together two points of the affine plane over a field k, the Picard group of the resulting scheme is $k^*$, while the Picard group of the complement is trivial). It is true for schemes satisfying Serre's S2 condition.

-