Rank and restriction of scalars Let $R \hookrightarrow S$ be commutative rings. Suppose that $M$ is a finitely generated projective $S$-module. Let $f : \text{Spec}(S) \rightarrow \text{Spec}(R)$.
We have locally constant rank functions $r_R^M : \text{Spec}(R) \rightarrow \mathbb{N}$ and $r_S^M : \text{Spec}(S) \rightarrow \mathbb{N}$.
Suppose that $S$ is finitely generated and free over $R$, of rank $n$. In particular, $M$ is then finitely generated and projective over $R$.
My questions are:
(1) If $M$ is of constant rank $m$ over $S$, then is $M_R$ of constant rank $nm$ over $R$?
(2) Perhaps more generally: does $r_R^M \circ f = n \cdot r_S^M$?
There are well known relations relating these ranks when one base changes modules from $R$ to $S$, but I can't find any for restriction from $S$ to $R$.
 A: sorry for the late answer: at least the special case $S$ being a polynomial ring over a field $k$ is an immediate consequence of the Quillen-Suslin theorem:
Every finitely generated, projective module $M$ over a polynomial ring $S/k$ is actually free.
As a consequence, if $R\subset S$ is an integral extension of rings such that $S$ is free of rank $n$ over $R$, the induced map $f: Spec(S)\rightarrow Spec(R)$ becomes a finite flat surjective morphism of degree $n$, in particular $f_*\mathcal{O}_{Spec(S)}\cong \mathcal{O}^n_{Spec(R)}$.
Now if $\tilde{M} \cong \mathcal{O}^m$ as an $\mathcal{O}_S$-module, you indeed get $f_*\tilde{M}=\mathcal{O}^{nm}_{Spec(R)}$
A: Yes, both your questions have affirmative answers.
The key observation is that we may reduce to the case when $M$ is in fact free: for a finite projective module, there are finitely many elements $s_1,\cdots,s_a\in S$ so that $M_{s_i}$ is free over $S_{s_i}$ (e.g. Stacks 00NX). Since $\operatorname{Spec} S\to\operatorname{Spec} R$ is finite, it is closed, and therefore each $f(V(s_i))$ is closed in $\operatorname{Spec} R$. So we can cover $\operatorname{Spec} R\setminus f(V(s_i))$ by open affines which have affine preimage in $\operatorname{Spec} S$ as $f$ is finite hence affine.
Now suppose $M\cong S^{\oplus m}$ is free. Then the pushforward of $\widetilde{M}$ to $\operatorname{Spec} R$ is just $M_R\cong (S^{\oplus m})_R \cong R^{\oplus mn}$.
