If $X \subseteq R^n$ generates the null space of $A \in M_{m,n}(R)$, does it still generate the null space when we pass to an extension ring? Let $R$ be a commutative ring and $A$ an $m \times n$ matrix with entries in $R$. In other, words, an  $R$-linear map $R^n \to R^m$. Let $K =\ker(A) \subseteq R^n$ and suppose that $X$ is a finite $R$-generating set for $K$. Now suppose that $S$ is a commutative ring containing $R$ as a subring (I'm assuming $R$ and $S$ are unital with the same unit). We may also regard $A$ as a matrix with entries in $S$ i.e. a map $S^n \to S^m$. So now, we have another (larger) kernel to consider. The kernel $K'$ of $A$ considered as a map $S^n \to S^m$.

Question: Is $X$ still an $S$-generating set for $K'$? Or, equivalently, is $K'$ generated by $K = K' \cap R^n$? 

I only really care about the case where $X$ is finite, i.e. $K$ is finitely-generated over $R$. In fact, $R$ can be Noetherian. I'm not sure how relevant that would be here though.
In the linear algebra setting, i.e. when $R$ and $S$ are fields, this is pretty obvious. You can think of it as a consequence of the Gauss-Jordan elimination algorithm. Indeed, if you bring $A$ to echelon form over $R$, then that must also be the echelon form over $S$ (by uniqueness) so the basis for the null space which you read off from the echelon form works for either $R$ or $S$. 
I don't know much about commutative algebra, but I think this also has to hold in the case where $A$ is surjective. Then, applying $\otimes_R S$ to 
$$ 0 \to K \to R^n \overset{A}{\to} R^m \to 0 $$
gives
$$ \cdots \to \mathrm{Tor}_1^R(R^m,S) \to \ker_R(A) \otimes_R S \to S^n \overset{A}{\to} S^m \to 0$$ 
and the Tor group above is zero, because $R^m$ is projective, so we see that $\ker_R(A) \otimes_R S$ coincides with $K'$, as needed. 
So what do you think, does this hold in general? And, do we really need any commutative algebra tools to prove it if so? I feel like, because the statement is so transparent in the field case, if it is true in general it should hold for some fairly transparent reason.
 A: This is not true in general.  For a very simple example, let $R=\mathbb{Z}$ and let $S=\mathbb{Z}\times\mathbb{F}_2$.  Then the map $R\to R$ given by multiplication by $2$ is injective (so the kernel is generated by $X=\emptyset$), but the map $S\to S$ given by multiplication by $2$ is not.
In general, a sufficient condition for this to hold is for $S$ to be flat over $R$.  Indeed, the statement that $X$ generates the kernel of $A$ just means that the sequence $$R^{\oplus X}\to R^n\stackrel{A}\to R^m$$ is exact where the first map is induced by the inclusion $X\to R^n$.  The corresponding statement for $S$ is then obtained by just tensoring this sequence with $S$ over $R$.  If $S$ is flat over $R$, then the sequence remains exact after tensoring with $S$, and so $X$ generates the kernel of $A$ over $S$ as well.
A: Eric Wofsey gave an example to show the answer to my question is "not always" and also gave a sufficient condition for the answer to be "yes", namely that $S$ be a flat $R$-module. I believe that flatness is also a necessary condition. I formalize this in the below proposition.
Notation: all tensor products will be balanced over $R$.

Proposition: Let $R \subseteq S$ be commutative rings with a common unit. Then, the following are equivalent. 
  
  
*
  
*$S$ is a flat $R$-module.
  
*For any positive integers $m,n$ and any $R$-linear map $A : R^n \to R^m$, the map $A \otimes \mathrm{id}_S : S^n \to S^m$ has $\ker(A \otimes \mathrm{id}_S) = \ker(A) \otimes S$. 
  
*For any positive integer $n$ and any $R$-linear map $A : R^n \to R$, the map $A \otimes \mathrm{id}_S : S^n \to S$ has $\ker(A \otimes \mathrm{id}_S) = \ker(A) \otimes S$. 
  
  
  Proof: Eric explained why (1) implies (2), and obviously (2) implies (3). So, we just need to assume (3) and prove that $S$ is flat over $R$. According to wikipedia, to show $S$ is flat $R$-module, we just need to show that, for any finitely-generated ideal $I = \langle p_1,\ldots,p_k \rangle \in R$, the map $\phi : I \otimes S \to R \otimes S = S$ induced by the inclusion $I \to R$ is injective. Suppose, therefore,  that $x=\sum_{i=1}^m x_i \otimes s_i \in I \otimes S$ belongs to the kernel of $\phi$. In other words, $\sum_{i=1}^m x_is_i = 0$ in $S$. 
Write each $x_i \in I$ as $\sum_{j=1}^k r_{ij} p_j$, $r_{ij} \in R$. Then, we have $0 = \sum_{i=1, j=1}^{m,k} r_{ij} p_j  s_i = \sum_{j=1}^k p_j \left( \sum_{i=1}^m r_{ij} s_i \right)$ which shows that $\sum_{i=1}^m s_i(r_{i1},\ldots,r_{ik})$ belongs to $\ker(A \otimes \mathrm{id}_S)$ where $A : R^n \to R$ sends $(r_1,\ldots,r_k) \mapsto r_1p_1 + \ldots + r_kp_l$. By the assumption that (3) holds  there exist $(q_{i1},\ldots,q_{ik}) \in \ker(A)$ and $t_i \in S$, $i=1,\ldots,n$ such that $\sum_{i=1}^m s_i \cdot (r_{i1},\ldots,r_{ik}) = \sum t_i \cdot \sum_{i=1}^n (q_{i1},\ldots, q_{ik})$, that is $\sum_{i=1}^m s_i r_{ij} = \sum_{i=1}^n t_i q_{ij}$ for $j=1,\ldots,k$. But now, we see that $$x=\sum_{i=1,j=1}^{m,k} r_{ij} p_j \otimes s_i = \sum_{j=1}^k p_j \otimes \left( \sum_{i=1}^m s_i r_{ij} \right) = \sum_{j=1}^k p_j \otimes \left( \sum_{i=1}^n t_i q_{ij} \right) = \sum_{i=1}^n  \left( \underbrace{\sum_{j=1}^k p_j q_{ij}}_{0} \right) \otimes t_i = 0$$
  so the map $\phi$ is injective as desired.

