TITLE: Invariants and base change
QUESTION [7 upvotes]: Suppose $R$ is a Noetherian commutative ring, and $M$ a finite free $R$-module, with an action of a finitely generated discrete group $G$ by $R$-linear maps.  
Is there any homological condition on this data which would ensure that taking $G$-invariants commutes with base change?
That is, for any finite type map $R \rightarrow S$, we have
$$(M \otimes S)^G = (M^G)\otimes S.$$
For instance, suppose $M^G = 0$?

REPLY [2 votes]: Choose generators $g_1,\dots,g_n$ of $G$ and let $f\colon M\to M^n$, $f(m)=(g_im-m)_{i=1,\dots,n}$. This gives an exact sequence $$0\to M^G\to M\to M^n\to\mathrm{coker}(f)\to0$$ which can be interpreted (EDITED) as part of a flat resolution of $\mathrm{coker}(f)$. Since $\ker(f\otimes1_S)=(M\otimes S)^G$, the quotient $(M\otimes S)^G/\mathrm{im}(M^G\otimes S)$ may be identified with $\mathrm{Tor}_1(\mathrm{coker}(f),S)$, so they both vanish for all $S$ iff $\mathrm{coker}(f)$ is flat. If $\mathrm{coker}(f)$ is flat, we also get that $M^G\otimes S\to(M\otimes S)^G$ is injective, so we get the equivalence $M^G\otimes S\to(M\otimes S)^G$ bijective iff $\mathrm{coker}(f)$ is flat.