To check $N\preccurlyeq^+ M$, does it suffice to consider single-variable formulas? Let $R$ any unital ring, and let $\mathcal{L}_R=\{+,-,0,r\}_{r\in R}$ be the language of left $R$-modules, where each $r$ is a unary function symbol. Recall that a positive primitive (pp) $\mathcal{L}_R$-formula is one of the form $\exists\overline{w}\bigwedge_{i=1}^k\overline{r_i}\bullet\overline{v}=\overline{s_i}\bullet\overline{w}$, where each $\overline{r_i}$ and $\overline{s_i}$ is a tuple of elements of $R$, and $\bullet$ denotes the "dot product". (So, eg, $\overline{r_i}\bullet\overline{v}=\sum_{j=1}^mr_{ij}\cdot v_j$.) It is well-known that, modulo the complete theory of any $R$-module, every $\mathcal{L}_R$-formula is equivalent to a boolean combination of pp-formulas. Given a pair of modules $N\leqslant M$, we say that $N$ is a pure submodule of $M$, denoted $N\preccurlyeq^+M$, if $$N\models\psi(\overline{a})\iff M\models\psi(\overline{a})$$ for any pp-formula $\psi$ and any tuple $\overline{a}\in N$. (Note that the forward implication always holds, so the content of purity is the backwards implication.)
Question: When checking that $N$ is a pure submodule of $M$, does it suffice to consider pp-formulas in a single variable? $\square$
This seems like a very natural and straightforward question, but the answer is unclear to me. Certainly if $\psi$ is of the form $\exists\overline{w}(\overline{r}\bullet\overline{v}=\overline{s}\bullet\overline{w})$ then the desired implications hold. Indeed, then the sentence $\psi(\overline{a})$ for a tuple $\overline{a}\in N$ is equivalent to the sentence $\psi'(a^1)$, where $a^1=\overline{r}\bullet\overline{a}\in N$ and $\psi'$ is the single-variable formula $\exists \overline{w}(v=\overline{s}\bullet\overline{w})$. However, things seem less straightforward if $\psi$ has multiple conjuncts. By a similar argument as above (considering each $\overline{r_i}\bullet\overline{a}$ as a single element of $N$), it suffices to consider formulas of the form $\exists\overline{w}\bigwedge_{i=1}^kv_i=\overline{s_i}\bullet\overline{w}$. Then saying that $N$ is pure in $M$ with respect to formulas in one variable amounts to saying that each equation $a_i=\overline{s_i}\bullet\overline{w}$ has a solution in $N$ if and only if it has a solution in $M$, for every $a_i\in N$. But I don't immediately see how we can "stitch" these solutions together in the way that we want, and I'm not even sure if we can in general. Does anyone have any thoughts?
A counterexample, or a proof for a particularly nice class of ring (PIDs perhaps?), would also be much appreciated. For instance, I believe the result holds if $R$ is a local PID. Sketch: suppose $R$ has maximal ideal $(\pi)$. Then every element of $R$ is associate with a power of $\pi$, so we may assume that the length of the tuple $\overline{w}$ in the formula above is $1$, and that each $s_i$ is of the form $\pi^{n_i}$ for some $n_i$. Then, assuming wlog that $n_1$ is minimal among the $n_i$, we have $N\models\exists w\bigwedge_{i=1}^ka_i=\pi^{n_i}w$ if and only if
$$\text{(i) }a_1\text{ is divisible by }\pi^{n_1}\text{ in }N\ \ \ \ \ \ \ \text{  and }\ \ \ \ \ \ \ \text{(ii) }a_i=\pi^{n_i-n_1}a_1\text{ for each }i.$$ Clearly (ii) holds in $N$ if and only if it holds in $M$, and (i) is covered by the pp-criterion for single variable formulas, and so we are done.
 A: Okay, I think I've found a proof in the case that $R$ is a PID. Throughout all modules will be taken over $R$. For convenience, we will call a submodule $N\leqslant M$ "weakly pure" if $N$ and $M$ agree on all pp-sentences with a single parameter from $N$. In other words, $N$ is weakly pure in $M$ if $$N\models\varphi(a)\iff M\models\varphi(a)$$ for any single-variable pp-formula $\varphi(v)$ and any $a\in N$. (Comment: the lemma below is based on a fact proved in Kaplansky's Infinite Abelian Groups.)

Lemma: If $N$ is weakly pure in $O$, and $O\big/N$ is finitely generated, then $N$ is a direct summand of $O$.
Proof: Since $R$ is a PID, the structure theorem for finitely generated modules over a PID tells us that $O\big/N$ is a direct sum of cyclic modules. Say $O\big/N=R\overline{o_1}\oplus\dots\oplus R\overline{o_n}$ for some $o_i\in O$.
Claim: We may assume that $\operatorname{ann}\overline{o_i}=\operatorname{ann}{o_i}$ for each $i$. To see this, suppose $\operatorname{ann}\overline{o_i}=(r)$ for some $r\in R$, recalling that $R$ is a PID. Then $ro_i\in N$, and clearly $O\models\exists w(ro_i=rw)$, so by weak purity $N\models\exists w(ro_i=rw)$ and thus there is $n\in N$ with $ro_i=rn$. Then $\overline{o_i-n}=\overline{o_i}$ mod $N$, and $$(r)=\operatorname{ann}\overline{o_i}\supseteq\operatorname{ann}(o_i-n)\supseteq (r),$$ so $o_i-n$ gives the desired generator of $R\overline{o_i}$. $\dashv$
In particular, $N\cap Ro_i=\{0\}$; indeed, if $n=so_i$ for some $n\in N$ and $s\in R$, then $s\overline{o_i}=\overline{0}$. But this means $s\in\operatorname{ann}\overline{o_i}=\operatorname{ann}o_i$, so $n=so_i=0$, as desired. We claim $O=N\oplus \bigoplus_{i=1}^nRo_i$. Indeed, if $$n+r_1o_1+\dots+r_no_n=0$$ for some $n\in N$ and $r_i\in R$, then $\sum_{i=1}^nr_i\overline{o_i}=\overline{0}\in O\big/N$, and so (since $O\big/N$ is a direct sum of the $\overline{o_i}$) we have $r_1\overline{o_1}=\dots=r_n\overline{o_n}=\overline{0}$. This means each $r_io_i\in N$, and hence, since $N\cap Ro_i=\{0\}$, we have $r_io_i=0$. Thus $n=0$ too, as desired. $\square$

Theorem: If $N$ is weakly pure in $M$, then $N\preccurlyeq^+M$.
Proof: Let $\psi(\overline{v})\equiv\exists\overline{w}\bigwedge_{i=1}^k\overline{r_i}\bullet\overline{v}=\overline{s_i}\bullet\overline{w}$ be an arbitrary pp-formula and suppose that $M\models\psi(\overline{a})$ for some tuple $\overline{a}\in N$. Then there is a tuple $\overline{c}\in M$ such that $\overline{r_i}\bullet\overline{a}=\overline{s_i}\bullet\overline{c}$ for each $i\in\{1,\dots,k\}$, and we want to show that such a tuple also exists in $N$. To see this, consider the submodule $$O:=N+Rc_1+\dots+Rc_n$$ of $M$. Clearly $O\big/N$ is finitely generated, by the $\overline{c_i}$. Also, we claim that $N$ is weakly pure in $O$. Indeed, if $O\models\varphi(n)$ for a single-variable pp-formula $\varphi$ and an element $n\in N$, then $M\models\varphi(n)$ with the same witness, and so, since $N$ is weakly pure in $M$, $N\models\varphi(n)$ too, as desired. Thus the hypotheses of our lemma apply, and so $N$ is a direct summand of $O$. Denoting by $\pi:O\to N$ the canonical projection map, we then have $\overline{r_i}\bullet \overline{a}=\pi(\overline{r_i}\bullet\overline{a})=\pi(\overline{s_i}\bullet\overline{c})=\overline{s_i}\bullet\pi(\overline{c})$ for each $i$, since $\pi$ commutes with scalar multiplication. In particular, the $\pi(c_i)$ provide a witness for $\psi(\overline{a})$ in $N$, and so we are done. $\square$

Note that this proof relies heavily on the structure of PIDs, so I am now skeptical that the desired result holds in the general case, but I'm still struggling to think of a counterexample. Any thoughts would be appreciated!
A: I was enormously overthinking this; thank you to Ivo Herzog for showing me the following argument. I'm going to leave my proof for PIDs up, as it actually shows something stronger than the desired result. For now, suppose $N\leqslant M$ are modules that agree on pp-sentences over $N$ in a single variable. We prove by induction on $k$ that $N$ and $M$ agree on pp-sentences over $N$ in $k$-many variables, the base case being the hypothesis. For the inductive step, suppose $\varphi(\overline{v},w)$ is a pp-formula in $k+1$ variables, and let $\overline{a},b$ be a $k$-tuple and an element, respectively, from $N$. Suppose also that $M\models\varphi(\overline{a},b)$; we want to show that $N\models\varphi(\overline{a},b)$. To see this, first note that $\exists w\varphi(\overline{v},w)$ is a pp-formula in $k$ variables, and certainly $M\models\exists w\varphi(\overline{a},w)$, so by the inductive hypothesis $N\models\exists w\varphi(\overline{a},w)$; let $b'\in N$ be such that $N\models\varphi(\overline{a},b')$. Now, since $\varphi(\overline{v},w)$ cuts out a subgroup of $M^{k+1}$, we may subtract the tuple $(\overline{a},b')\in \varphi(N)\subseteq\varphi(M)$ from the tuple $(\overline{a},b)\in\varphi(M)$ to get $M\models\varphi(\overline{0},b-b')$. But, $b,b'\in N$, so $b-b'\in N$ too; since $\varphi(\overline{0},w)$ is a pp-formula in one variable, by the case $k=1$ we thus have $N\models\varphi(\overline{0},b-b')$. In other words, $(\overline{0},b-b')\in\varphi(N)$; since also $(\overline{a},b')\in\varphi(N)$, we may add these two tuples together to get $(\overline{a},b)\in\varphi(N)$, ie $N\models\varphi(\overline{a},b)$, as desired.
