Effective divisors exactly those with global sections Let $X$ be a finite-type scheme over a field $k$. To an effective divisor $D$, there is a global section of the invertible sheaf $\mathcal{O}_X(D)$ (corresponding to the canonical morphism $\mathcal{O}_X \to \mathcal{O}_X(D)$). I've read somewhere that the opposite is true: if $H^0(X,\mathcal{O}_X(D)) \not= 0$, then there is an effective divisor $E$ with $\mathcal{O}_X(D) = \mathcal{O}_X(E)$ (i.e. $D$ and $E$ are linearly equivalent). 
If this is true, why?
And why wouldn't the following be a counterexample: let $X$ be an elliptic curve and $p,q,r \in X$ be distinct points, then $H^0(X,\mathcal{O}_X(p+q-r))$ is $1$-dimensional, but $p+q-r$ is not linearly equivalent to an effective divisor. 

If you happen to be in the situation where $X$ is a smooth projective variety over an algebraically closed field $k$, then we have the following bijection.
Let $|D|$ denote the set of effective divisors linearly equivalent to $D$. Then there is a bijection between $|D|$ and $\Gamma(X, \mathcal O(D)) -0$ mod $k^*$. If $E = D + (f)$, then $f \in \Gamma(X, \mathcal O(D)) -0$ (note any nonconstant multiple of $f$ will satisfy $E=D+(f)$ so we need to mod by $k^*$). Conversely if $f \in \Gamma(X, \mathcal O(D)) -0$, then $D+(f)$ is effective and clearly linearly equivalent to $D$. For the full details on when this is a bijection, see Hartshorne II.7.7.
In particular, $|D|$ is nonempty iff $\mathcal O(D)$ has a nonzero global section.
