Reference for (co)limit-preserving functor $X\mapsto R^X$ Fix a commutative ring $R$. There's a contravariant functor from finite sets to finite $R$-algebras sending $X$ to $R^X$.  Viewed as a covariant functor $\text{set}^{op}\to R\text{-alg}$, this functor preserves finite limits and colimits; this is easy to verify directly by checking finite products ($R^{\coprod_i X_i} \cong \prod_i R^{X_i}$) and coproducts ($R^{\prod_i X_i}\cong \bigotimes_i R^{X_i}$), as well as equalizers and coequalizers.  I'd love to just cite this fact instead of (re)proving it in a paper I'm writing.
The preserving of limits comes from the fact that the contravariant functors $X\mapsto R^X$ and $A\mapsto Hom_{R\text{-alg}}(A,R)$ are "adjoint on the right":
$Hom_{R\text{-alg}}(A,R^X) \cong Hom_{R\text{-alg}}(A,R)^X \cong Hom_{\text{set}^{op}}(Hom_{R\text{-alg}}(A,R),X).$
If $R$ is Noetherian, then $X\mapsto R^X$ also has a right adjoint: an $R$-algebra homomorphism $R^X\to A$ corresponds to a complete set of orthogonal idempotents in $A$ indexed by $X$. If $A$ is finite (or even finite type) over $R$ then $Spec(A)$ is the topological disjoint union of its finitely many connected components, so a complete set of orthogonal idempotents is just a function $\pi_0(Spec(A))\to X$.  Thus
$Hom_{R\text{-alg}}(R^X, A)\cong Hom_{\text{set}^{op}}(X, \pi_0(Spec(A)).$
But even with no extra hypotheses on $R$, the functor $X\mapsto R^X$ sends finite limits to colimits anyway.  Does anyone know a reference for this, or something close to a one-liner proof so I can avoid a tedious nuts-and-bolts argument?
 A: Maybe this is more complicated than you are looking for, but you can get your right adjoint to exist without any Noetherian hypothesis by extending the domain to the category of all Boolean algebras.  Specifically, let $\text{Bool}$ be the category of Boolean algebras and $R\text{-Alg}$ be the category of $R$-algebras (with no finiteness assumed).  There is a functor $F:\text{Bool}\to R\text{-Alg}$ which sends a Boolean algebra $B$ to the $R$-algebra which is generated by idempotents corresponding to the elements of $B$ and satisfying the relations in $B$.  When $B=\mathcal{P}(X)$ is the power set of a finite set $X$, $F(B)$ is just $R^X$, and in general, $F(B)$ can also be described as the ring of locally constant functions from the Stone space of $B$ to $R$.  Furthermore, it is easy to see that $F$ is left adjoint to the functor $G:R\text{-Alg}\to\text{Bool}$ which sends an $R$-algebra to its Boolean algebra of idempotents.  Finally, note that $X\mapsto \mathcal{P}(X)$ is an equivalence from $\text{set}^{op}$ to the full subcategory of finite Boolean algebras (which is closed under finite limits and colimits), and so finite colimits of Boolean algebras of the form $\mathcal{P}(X)$ are the same as finite limits of finite sets.
Incidentally, the fact that your functor $\text{set}^{op}\to R\text{-Alg}$ extends to both a functor $\text{Set}^{op}\to R\text{-Alg}$ which has a left adjoint and to a functor $\text{Bool}\to R\text{-Alg}$ which has a right adjoint is essentially equivalent to the fact that it preserves both finite limits and finite colimits.  Indeed, $\text{Set}^{op}$ is the pro-completion of $\text{set}^{op}$, so you automatically get an extension to $\text{Set}^{op}$ preserving filtered limits; since your original functor preserved finite limits, this extension will actually preserve all limits.  Similarly, $\text{Bool}$ is the ind-completion of $\text{set}^{op}$, so you get a corresponding story for colimits.
A: I don't know if this is short enough, but:
Once we know $R^{(-)}$ preserves coproducts we're left with reflexive coequalizers, and we can compute those after forgetting down to Set. But it's not so hard to see that for any set $Y$, the functor $\text{Hom}(-, Y): Sets^{op} \rightarrow Sets$ commutes with coequalizers as long as $Y$ is nonempty.

Here's a justification of that last fact, which is long so probably disqualifies the argument (unless you deem it 'exercise for the reader'-worthy.)
Let $f,g: A \rightrightarrows B$ be a diagram of sets and denote by $E$ the equalizer. Let $C$ be the coequalizer of $Y^A \leftleftarrows Y^B$. There is a natural map $C \rightarrow Y^E$ and it admits a section by 'extending a function by zero' where $0 \in Y$ is an element. 
On the other hand, given a function $h: A \rightarrow Y$ and an element $a \in A$ with $f(a) \ne g(a)$, we can always pick functions $h', k: B \rightarrow Y$ such that $h'$ extends $h$ along $f$ and $k$ extends $h$ along $g$ except that it sends $g(a)$ to $0$. In this way we can modify the equivalence class of a function until it is extended by zero. 
