TITLE: Localization commutes with quotient
QUESTION [9 upvotes]: Suppose $R$ is a commutative ring and $D$ a multiplicatively closed subset. I'd like to show via universal properties that if $\mathfrak{a} \triangleleft R$ is an ideal, then $D^{-1}R/D^{-1}\mathfrak{a} \cong \bar{D}^{-1}(R/\mathfrak{a})$, where $\bar{D}$ is the image of $D$ in $R/\mathfrak{a}$. This is pretty close to using exactness on the sequence $0 \to \mathfrak{a} \to R \to R/\mathfrak{a} \to 0$, except now we're localizing $R/\mathfrak{a}$ with respect to $\bar{D}$, not just tensoring it with $D^{-1}R$. Essentially I'm trying to show that localization commutes with passing to the quotient by $\mathfrak{a}$.
I could probably brute force this proof, but I'd like to see it in a way that is easy to understand and to remember. I get the feeling it's an easy property in disguise.

REPLY [6 votes]: I brute-forced this just for the fun of it, in a slightly different flavour than the above answer. First, the composition $R\to R/\mathfrak{a} \to \overline{D}^{-1}(R/\mathfrak{a})$ sends $D$ to invertible elements and so we get a map $\varphi: D^{-1}R\to \overline{D}^{-1}(R/\mathfrak{a})$ via $\frac{r}{d}\mapsto \frac{[r]}{[d]}$, where the brackets denote mod $\mathfrak{a}$. This map sends $D^{-1}\mathfrak{a}$ to $0$ and so we get a map 
$$ \psi: \frac{D^{-1}R}{D^{-1}\mathfrak{a}} \rightarrow \overline{D}^{-1}\left(\frac{R}{\mathfrak{a}}\right) \hspace{.5cm} \text{via} \hspace{.5cm} \left[\frac{r}{d}\right] \mapsto \frac{[r]}{[d]}.$$
Similarly, the composition $R\to D^{-1}R\to \frac{D^{-1}R}{D^{-1}\mathfrak{a}}$ sends $\mathfrak{a}$ to $0$, and so we get a map $\theta: R/\mathfrak{a} \to \frac{D^{-1}R}{D^{-1}\mathfrak{a}}$ via $[r]\mapsto [r/1]$. This map sends $\overline{D}$ to units because $[d/1]\cdot [1/d]=[1/1]$, and so we get a map 
$$ \eta: \overline{D}^{-1}\left(\frac{R}{\mathfrak{a}}\right) \rightarrow \frac{D^{-1}R}{D^{-1}\mathfrak{a}} \hspace{.5cm} \text{via} \hspace{.5cm}  \frac{[r]}{[d]} \mapsto \left[\frac{r}{d}\right].$$
Thus $\psi$ and $\eta$ are inverses, QED.