I'm currently studying intersection numbers (which I don't really understand) as described in Fulton's Algebraic Curves. He proves that the intersection number (which he denotes $I(P, F \cap G)$), defined for all plane curves $F$ and $G$, and all points $P \in \mathbb A^2$, is uniquely given by
$$ I(P, F \cap G) = \dim_k(\mathscr{O}_P(\mathbb A ^2)/(F,G)),$$
where $\mathscr{O}_P(\mathbb A ^2)$ denotes the local ring of $\mathbb A^2$ at the points $P$. However, I'm not really sure if my depiction of $\mathscr{O}_P(\mathbb A ^2)$ is correct. My thought is as follows:
We have that $\mathscr{O}_P(\mathbb A ^2)$ is given by all rational functions in the function field $k(\mathbb A ^2)$ defined at $P$. $k(V)$ is in turn given by the field of fractions of $\Gamma(\mathbb A ^2)=k[X,Y]/I(\mathbb A ^2)$, where $I(\mathbb A ^2)$ is the ideal generated by the variety $\mathbb A ^2$. If we go calculate this, we see that $I(\mathbb A ^2)=\{0\}$, so $\Gamma(\mathbb A ^2)\cong k[X,Y]$. We therefore get that $k(\mathbb A ^2) = k(X,Y)$, and that $\mathscr{O}_P(\mathbb A ^2)$ is simply given by
$$ \mathscr{O}_P(\mathbb A ^2) = \left\{ \frac{f(X,Y)}{g(X,Y)} \; : \; f(X,Y), \; g(X,Y) \in k[X,Y], \; g(P) \neq 0 \right\}. $$
Is this correct?
Thanks!