Computing a local parameter: don't understand a step In trying to compute a local parameter of some projective curve, this paper I am reading uses the fact that if ${C_Z}$ is an affine variety, then the inclusion (which is a morphism) ${i : C_Z\hookrightarrow \mathbb{A}^2(k)}$ induces a surjection of local rings ${\mathcal{O}_{\mathbb{A}^2(k),i(P)}\twoheadrightarrow \mathcal{O}_{C_Z,P}}$. I can't see why this is true. Given a rational function ${r}$ that's regular at $P$ in ${C_Z}$, I've tried producing a rational function ${r'}$ that's regular at ${i(P)}$ in ${\mathbb{A}^2(k)}$ such that ${r'\circ i = r}$, but I can't seem to do this. Any help?
 A: Okay so I think I managed to figure it out based on the comment left by @danneks. So let ${i : X\to \mathbb{A}^2(k)}$ be the inclusion of the variety $X$ into ${\mathbb{A}^2(k)}$. An element $r$ of the local ring ${\mathcal{O}_{X,P}}$ is a regular function on a neighborhood of $P$; call this neighborhood ${\mathcal{U}}$. Then $r$ is really just an open cover of ${\mathcal{U} = \bigcup_{i \in I}\mathcal{U}_i}$ together with rational polynomial functions ${r_i}$ such that ${r_i = r_j}$ on ${\mathcal{U}_i\cap \mathcal{U}_j}$ for any ${i,j}$.
$P$ must belong to at least one of these open sets in the cover, so let ${\mathcal{U}_t}$ be as such. By definition of the subspace topology, ${\mathcal{U}_t = \mathcal{U}_t'\cap X}$ for some open ${\mathcal{U}_t'\subseteq \mathbb{A}^2(k)}$. Also, ${r_t}$ must be regular on some open set ${\mathcal{U}_* \subseteq \mathbb{A}^2(k)}$, and it must be the case that ${\mathcal{U}_t = \mathcal{U}_t'\cap X \subseteq \mathcal{U}_*\cap X}$ (since ${\mathcal{U}_*}$ is the largest open set of ${\mathbb{A}^2(k)}$ for which ${r_t}$ is regular). So let ${f = [(\mathcal{U}_*,r_t)] \in \mathcal{O}_{\mathbb{A}^2(k),i(P)}}$. Then
$$
f\circ i = [(\mathcal{U}_*\cap X,r_t)] = [(\mathcal{U}_t'\cap X,r_t)] = [(\mathcal{U}_t,r_t)] = r
$$
The last equality comes from the fact that ${r_t}$ ends up agreeing on the intersections.
