Is there any condition on a commutative ring $R$ so that the global dimension of $R$ coincides with the supremum of the global dimensions of the localizations $R_{\mathfrak{m}}$ at all maximal ideals $\mathfrak{m}\subset R$? I'm looking (if possible) for conditions which are easy to verify.

$\begingroup$ I don't know if this is what you're looking for, but being noetherian guarantees the result you ask for. $\endgroup$ – Lennart Galinat Mar 29 '11 at 15:59

1$\begingroup$ @Lennart: Can you sketch a proof? $\endgroup$ – Martin Brandenburg Mar 29 '11 at 16:33

3$\begingroup$ @Martin: Global dimension can be measured by only considering cyclic Rmodules in the first variable of Ext and simple Rmodules in the second. But then we can swap localisations and Ext and the result is clear. $\endgroup$ – Lennart Galinat Mar 29 '11 at 16:41

$\begingroup$ Thanks Lennart! Such a simple argument is exactly what I was looking for. $\endgroup$ – Fernando Muro Mar 29 '11 at 16:48

$\begingroup$ I just posted an answer but realized I hadn't seen these comments beforehand. Still, my answer shows that you can get a bit more than just that the global dimension of $R$ is the supremum of global dimensions of the $R_m$. You can also get that it's the supremum of projective dimensions of simple $R$modules. Also, the proof avoids the machinery of Ext $\endgroup$ – David White Jun 21 '11 at 14:54
This problem is discussed at length in T.Y. Lam's Lectures on Modules and Rings. The hyperlink should take you to the Theorem in question (5.92 in section 5G). The point is that for a commutative noetherian ring $R$ you get the result you wanted and also more:
For a commutative noetherian ring $R$ gl.dim$(R_m)=$pd$_R(R/m)$ for all maximal ideals $m$. This implies gl.dim$(R)=\sup($gl.dim$(R_m)) = \sup($pd$_R(S))$ where the last supremum runs over all simple $R$modules.
The proof Lam gives avoids the machinery of Ext, using instead the fact that the global dimension of a commutative noetherian local ring is the injective dimension (also the projective dimension) of its residue field.
Note that the noetherian assumption really is necessary. On page 197, Lam points out that B. Osofsky has constructed some interesting examples (he gives details) which I suspect would show this theorem fails without the noetherian hypothesis.

$\begingroup$ Just a comment that when I answered this it led me to the following MO question, which goes into the work of Osofsky much more: mathoverflow.net/questions/68436/… $\endgroup$ – David White Sep 1 '12 at 16:15
If one of the localizations isn't regular, then both $R$ and that localization have infinite global dimension, so it's trivially true in that case.
So we can reduce to the case that $R$ is regular. Then Spec($R$) can't have irreducible components intersecting. Since the global dimension of a regular local ring is just its dimension, we need to require that all connected components of Spec($R$) have the same dimension.
So let's focus on the case when $R$ is a regular domain. We need to know that all maximal ideals have the same height. If we assume that $R$ is a quotient of a polynomial ring over a field, then this true. There are probably counterexamples otherwise.

$\begingroup$ Whoops, I was answering the question of when the global dimension of $R$ is always the same as the global dimension of $R_m$! $\endgroup$ – Steven Sam Mar 29 '11 at 16:38

$\begingroup$ Counterexample to maximal ideals having the same height: let $k$ be a field, let $S = k[x,y,z]$, let $U = S \setminus ((x,y) \cup (z))$, and take $R = S[U^{1}]$. Then the images of $(x,y)$ and $(z)$ are both maximal ideals of heights 2 and 1, respectively. $\endgroup$ – Steven Sam Mar 29 '11 at 16:47

$\begingroup$ I'm confused about a few points. In the first line, don't you already need $R$ to be commutative and noetherian in order to get that $R$ is regular iff gl.dim$(R)<\infty$? Also, in the last paragraph why do you need all maximal ideals to have the same height? This perhaps would force dim$(R_m)$ to equal dim$(R_{m'})$ but I don't see why they would then equal dim$(R)$. This is all related to another question which I'll probably post soon about the relationship between gl.dim$(R)$ and gl.dim$(R[1/v])$, so I thought I'd try to understand your answer here before proceeding. $\endgroup$ – David White Jun 21 '11 at 15:01

1$\begingroup$ @David White: The question assumes that $R$ is commutative. I don't think that Noetherian is necessary for the statement "$R$ is regular if and only if it has finite global dimension", but I don't think about nonNoetherian rings, so I won't say for sure. The Krull dimension of a ring is the supremum over all heights of maximal ideals, so I don't understand your objection. $\endgroup$ – Steven Sam Jun 24 '11 at 15:16