Question about proof of “nonsingularity of a point iff the local ring at that point is regular”

In Hartshorne, page 32 Theorem 5.1, the theorem says "Let $Y\subset\mathbb{A}^n$" be an affine variety. Let $P\in Y$ be a point. Then $Y$ is nonsingular at $P$ if and only if the local ring $\mathscr{O}_{P,Y}$ is a regular local ring.

Now in the proof, Hartshorne puts $P=(a_1,\ldots,a_n)$, $a_P=(x_1-a_1,\ldots,x_n-a_n)$ the maximal ideal corresponding to $P$ in $k[x_1,\ldots,x_n]$, and $b$ the ideal of $Y$ in $k[x_1,\ldots,x_n]$. Also, $m$ is the maximal ideal in the local ring $\mathscr{O}_{P,Y}$ corresponding to the point $P$.

Now, he says that $\mathscr{O}_{P,Y}$ is obtained by dividing $k[x_1,\ldots,x_n]$ by $b$ and then localizing at the maximal ideal $a_P$. This is ok (even though it really should be the localization at $(a_P+b)/b$, not at $a_P$, but I guess we can identify $a_P$ with its maximal ideal in $k[x_1,\ldots,x_n]/b$).

Now comes my question, he says that because of this, $m/m^2\cong a_P/(a_P^2+b)$, and thus their dimensions are the same. However, I see that since $m$ is the localization of $(a_p+b)/b$, then this would really be $m/m^2\cong S^{-1}((a_P+b)/b)/S^{-1}((a_P^2+b)/b)$ (where $S$ is the multiplicative set with which one localizes), and I don't see how $S^{-1}((a_P+b)/b)/S^{-1}((a_P^2+b)/b)\cong a_P/(a_P^2+b)$.

Am I not seeing something? Is there some abuse of notation maybe?

-

With regard to the point in your third para., $k[x_1,\ldots,x_n]/b$ is a $k[x_1,\ldots,x_n]$-module, and so it makes perfect sense to localize it at $a_P$. (Of course this gives the same answer as localizing at $a_P/b$.)
With regard to your main question: since $a_P$ is maximal (or, alternatively, and perhaps more to the point: since $a_P$ contains $b$), $a_P + b = a_P$; this simplifies some points. In particular, your description of $m/m^2$ in your 2nd last paragraph simplifies to $S^{-1}(a_P/b)/S^{-1}\bigl((a_P^2+b)/b\bigr)$. Since localization is exact, this is the same as $S^{-1}\Bigl((a_P/b)/\bigl((a_P^2 + b)/b\bigr)\Bigr),$ which in turn equals $S^{-1}\bigl(a_P/(a_P^2+b)\bigr).$ Now the quotient $a_P/(a_P^2+b)$ is a $k[x_1,\ldots,x_n]$-module on which the $k[x_1,\ldots,x_n]$-action factors through the quotient $k[x_1,\ldots,x_n]/a_P$. Since this quotient is a field, the elements of $S$ automatically act invertibly on $a_P/(a_P^2+b)$, and hence localization at $S$ doesn't change anything. The conclusion is that $m/m^2 = a_P/(a_P^2+b)$, as claimed.
@Robert: Dear Robert, $S$ is not invertible on $Y$ (unless it happens that $Y = P$); it is rather that it is invertible on $k[x_1,\ldots,x_n]/a_p^n$ for any $n \geq 0$, and so also on $a_P/a_P^2 + b$. Regards, – Matt E Aug 27 '11 at 19:09
Sorry that's what I meant; modulo $a_P$ all elements not zero at $P$ are invertible. Thanks!! – rfauffar Sep 26 '11 at 21:20