# Is the functor $\text{Spec}:(\mathsf{CRing})^{\text{op}}\to\mathsf{Set}$ right exact?

Let $$(\mathsf{CRing})^{\text{op}}$$ be the category opposite to the category $$\mathsf{CRing}$$ of commutative rings with one, and $$\mathsf{Set}$$ the category of sets. Recall that $$\text{Spec}(A)$$ is the set of prime ideals of $$A$$, and that a morphism $$f:A\to B$$ in $$\mathsf{CRing}$$ induces, in a functorial way, a map $$\text{Spec}(B)\to\text{Spec}(A)$$ sending $$\mathfrak q$$ to $$f^{-1}(\mathfrak q)$$.

(1a) Is the functor $$\text{Spec}:(\mathsf{CRing})^{\text{op}}\to\mathsf{Set}$$ right exact?

Here are four other equivalent forms of Question (1a):

(1b) Does the functor $$\text{Spec}:(\mathsf{CRing})^{\text{op}}\to\mathsf{Set}$$ commute with finite colimits?

Let $$(A_i)_{i\in I}$$ be a projective system of commutative rings indexed by a finite category $$I$$.

(1c) Is the natural map $$\operatorname*{colim}_i\text{Spec}(A_i)\to\text{Spec}\left(\lim_i A_i\right)$$ bijective?

The fourth and fifth forms will use the fact that our functor commutes with finite coproducts. (Recall that coproducts in $$(\mathsf{CRing})^{\text{op}}$$ correspond to products in $$\mathsf{CRing}$$.)

(1d) Does the functor $$\text{Spec}:(\mathsf{CRing})^{\text{op}}\to\mathsf{Set}$$ commute with cokernels?

Let $$A\rightrightarrows B$$ be two parallel morphisms in $$\mathsf{CRing}$$.

(1e) Is the natural map $$\operatorname{Coker}\Big(\text{Spec}(B)\rightrightarrows\text{Spec}(A)\Big)\to\text{Spec}\Big(\operatorname{Ker}(A\rightrightarrows B)\Big)$$ bijective?

Here is a second question:

(2) In the above setting, is the natural map $$\text{Spec}(A)\to\text{Spec}\Big(\operatorname{Ker}(A\rightrightarrows B)\Big)$$ surjective?

Of course, if the answer to (2) is "not necessarily", then the answer to (1) will be "no".

Martin Brandenburg asked a somewhat related question.

No. For instance, let $$A=B=\mathbb{C}[x]$$ and let $$f:A\to B$$ be the identity map and $$g:A\to B$$ send $$x$$ to $$x+1$$. Then the equalizer of $$f$$ and $$g$$ is the set of polynomials $$p$$ such that $$p(x)=p(x+1)$$, which is just the constant polynomials $$\mathbb{C}$$ (since if such a $$p$$ were nonconstant, it would need to have infinitely many roots). But the coequalizer of spectra has more than one point, since it is just the quotient $$\mathbb{C}/\mathbb{Z}$$ (together with a generic point).
The answer to the second question is also no. For instance, let $$A=\mathbb{C}[x,y,r,s]/(rx+sy-1)$$ and $$B=\mathbb{C}[x,y,r,s,t,u]/(rx+sy-1,tx+uy-1)$$. There is an obvious inclusion map $$f:A\to B$$ but there is also a map $$g:A\to B$$ which sends $$r$$ and $$s$$ to $$t$$ and $$u$$. I claim that the equalizer of $$f$$ and $$g$$ is just $$C=\mathbb{C}[x,y]$$. Given this claim, we see that the prime ideal $$P=(x,y)\subset C$$ does not extend to any prime ideal of $$A$$, so the map $$\operatorname{Spec} A\to\operatorname{Spec} C$$ is not surjective.
To prove the claim, let $$a\in A$$ be such that $$f(a)=g(a)$$. We can write $$a$$ as a sum of monomials which do not contain $$rx$$ (since we can replace $$rx$$ with $$1-sy$$). First suppose that no monomial of $$a$$ contains $$r$$. Then $$a$$ is a polynomial in just $$s$$, $$x$$, and $$y$$; suppose $$s$$ does appear in $$a$$. We can pick values $$x_0,y_0\in\mathbb{C}$$ with $$x_0\neq 0$$ such that when we substitute $$x_0$$ for $$x$$ and $$y_0$$ for $$y$$, $$a$$ becomes a nonconstant polynomial $$p(s)$$ in $$s$$. For any $$\alpha,\beta\in\mathbb{C}$$, we can now consider the homomorphism $$e_{\alpha,\beta}:B\to\mathbb{C}$$ which sends $$y$$ to $$y_0$$, $$s$$ to $$\alpha$$, $$u$$ to $$\beta$$, $$x$$ to $$x_0$$, $$r$$ to $$\frac{1-\alpha y_0}{x_0}$$, and $$t$$ to $$\frac{1-\beta y_0}{x_0}$$. We then have $$e_{\alpha,\beta}(f(a))=p(\alpha)$$ and $$e_{\alpha,\beta}(g(a))=p(\beta)$$. Since $$p$$ is nonconstant, we can choose $$\alpha$$ and $$\beta$$ such that $$p(\alpha)\neq p(\beta)$$ and reach a contradiction.
So, we may assume that $$r$$ does appear in $$a$$; write $$a=\sum_{i=0}^n a_i x^i+\sum_{j=1}^m b_jr^j$$ where the $$a_i$$ and $$b_j$$ are in $$\mathbb{C}[y,s]$$. Replacing every appearance of $$r$$ by $$\frac{1-sy}{x}$$, we may consider $$a$$ as a Laurent polynomial in $$x$$ with coefficients in $$\mathbb{C}[s,y]$$ (the division by $$x$$ is not an issue because we will eventually be substituting a nonzero complex number for $$x$$). Since $$r$$ appears in $$a$$, some $$b_j$$ is nonzero. Thus one of the coefficients of this Laurent polynomial involves $$s$$, since we replaced $$r$$ with $$\frac{1-sy}{x}$$. So, we can also consider $$a$$ as a nonconstant polynomial in $$s$$ with coefficients in $$\mathbb{C}[x,1/x,y]$$. We can now choose $$x_0,y_0\in\mathbb{C}$$ with $$x_0\neq 0$$ such that when we substitute them for $$x$$ and $$y$$, $$a$$ becomes a nonconstant polynomial in $$s$$, and reach a contradiction as in the previous case.