TITLE: Show that $\dim H^0(\mathbb{P}^n, \mathcal{O}_{\mathbb{P}^n}(m)) = {n + m \choose n}$ if $m \geq 0$, and $0$ otherwise.
QUESTION [6 upvotes]: Show that $\dim H^0(\mathbb{P}^n, \mathcal{O}_{\mathbb{P}^n}(m)) = {n + m \choose n}$ if $m \geq 0$, and $0$ if $m < 0$. This statement came up in an algebraic geometry text with no explanation provided, and I'm trying to understand why it's true. 
Thoughts so far: 
Since $H^0(\mathbb{P}^n, \mathcal{O}_{\mathbb{P}^n}(m))$ is the vector space of regular sections of $\mathcal{O}_{\mathbb{P}^n}(m)$ over $\mathbb{P}^n$, we can try to find a basis. Since the regular sections are the degree $m$ polynomials in $x_0, \dots, x_n$, it seems like the collection of degree $m$ monomials in $x_0, \dots, x_n$ should work. But I don't see how there are ${n + m \choose n}$ of these. Is it just a basic counting argument that I'm struggling with?
On a side note, I think I understand what global sections of $\mathcal{O}_{\mathbb{P}^n}(m)$ look like, but how can we describe the regular sections over a distinguished open set $D(f)$? Is it something like degree $m$ polynomials with denominator $f$?

REPLY [3 votes]: About your side note question:  
If  $f\in H^0(\mathbb{P}^n, \mathcal{O}_{\mathbb{P}^n}(m))$ is a homogeneous polynomial of degree $m$, then the open subset $D(f)\subset \mathbb{P}^n$ is an affine variety (this can be seen with the Veronese embedding of degree $m$).
The restriction of $ \mathcal{O}_{\mathbb{P}^n}(m))$  to $D(f)$ is the trivial line bundle.
The $k$-algebra $ H^0(D(f), \mathcal{O}_{\mathbb{P}^n}(m))=H^0(D(f), \mathcal{O}_{\mathbb{P}^n})$ is then infinite-dimensional, and so  also is the space of sections of any line bundle on $D(f)$.
Actually any line bundle on $D(f)$ is the restriction of some line bundle on $\mathbb{P}^n$ because of the exact sequence $$\mathbb Z\to \text {Cl}(\mathbb{P}^n)\to \text {Cl}(D(f))\to 0$$ (Hartshorne II, Prop. 6.5 (c)) 
The simplest example is to take $f=x_0^m\in H^0(\mathbb{P}^n, \mathcal{O}_{\mathbb{P}^n}(m))$, so that $D(f)=\mathbb A^n$ and since all line bundles $L$ on $\mathbb A^n$ are trivial, we have $$H^0(\mathbb{A}^n_k, L)=H^0(\mathbb{A}^n_k, \mathcal O)=k[x_0,\cdots ,x_n] $$