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?