(Projective and affine spaces)
Let \(k\) be a field and let \(n\ge1\). Then \(\Cl(\PP_k^n)\cong\ZZ\), generated by the hyperplane \(H=V(x_0)\), with the isomorphism given by degree. For a prime divisor \(D=V(f)\) defined by an irreducible homogeneous polynomial of degree \(d\), the rational function \(g=f/x_0^d\) satisfies \(D-dH=\operatorname{div}(g)\). Every divisor is therefore equivalent to a multiple of \(H\), and the degree of a principal divisor is zero, so that multiple is unique [@Har10a, Proposition II.6.4]. For \(n=0\), projective space is \(\Spec k\) and its class group is zero. For every \(n\ge0\), \(\Cl(\AA_k^n)=0\), because \(k[x_1,\ldots,x_n]\) is a unique factorization domain [@Har10a, Proposition II.6.2].
(A hypersurface complement)
Let \(k\) be a field, let \(Y\subseteq\PP_k^2\) be an integral curve of degree \(d\ge1\), and put \(X=\PP_k^2\setminus Y\). The divisor restriction sequence is \[ \ZZ\xrightarrow{1\mapsto[Y]}\Cl(\PP_k^2)\longrightarrow\Cl(X)\longrightarrow0. \] Under the degree isomorphism \(\Cl(\PP_k^2)\cong\ZZ\), its first map is multiplication by \(d\). Hence \(\Cl(X)\cong\ZZ/d\ZZ\) [@Har10a, Example II.6.5.1]. In particular, the complement of an integral conic has class group \(\ZZ/2\ZZ\).
Let \(Z\) be a noetherian integral separated scheme regular in codimension one, and let \(W\subsetneq Z\) be closed. Restriction \(\Cl(Z)\to\Cl(Z\setminus W)\) is surjective, with kernel generated by the prime divisors contained in \(W\). It is an isomorphism if \(W\) has codimension at least two [@Har10a, Proposition II.6.5]. For a noetherian normal domain \(A\), the criterion \(\Cl(\Spec A)=0\) is equivalent to \(A\) being a unique factorization domain [@Har10a, Proposition II.6.2].
Dependencies
D-5PQ5WWeil and Cartier divisors, and when they agreeuses