Exercse 4.1.1 of Hartshorne: find a rational function on a curve with a pole at one point.

472 Views Asked by At

I am struggling with exercise 4.1.1 of Hartshorne. The precise question is as follows:

Let $X$ be a curve (i.e. an integral scheme of dimension 1 that is proper over some algebraically closed field $k$ such that all its local rings are regular), and let $P \in X$ be a (closed) point. Then there exists a nonconstant rational function $f\in K(X)$ (the function field of $X$), which is regular everywhere except at the point $P$.

I wanted to prove this first for an affine scheme $X=Spec(A)$. Here, $A$ has to be an integral domain of Krull dimension 1 such that all its localizations are regular local rings and $P$ some non-zero prime ideal of $A$. I think I should find some $f\in P$ such that $f\not\in Q$ for all other prime ideals $Q$. In that case the rational function $\frac{1}{f}\in Quot(A)$ is a function satisfying the conditions above. (Mimicking the case $A=k[X]$, $P=(x-a)$, $f=x-a$.)

I believe that it would suffice to show that $P$ is principal to show that such $f$ exists. However, I am not sure that this is true.

Does anyone know how to proceed?