What are the conditions for a system of equations to have a solution in some abelian group extension? Given an abelian group $G$ and a system of equations
$$a_1 = n^1_1 y_1 + ... + n^1_r y_r$$
$$...$$
$$a_s = n^s_1 y_1 + ... + n^s_r y_r$$
for $a_i \in G$ and $n^i_j \in \mathbb{Z}_{\geq 0}$, under what conditions does there exist a group containing $G$ as a subgroup in which this system is solvable? In particular, can the conditions be stated in the first-order logic of group theory?
For example, a system
$$a_1 = y_1$$
$$a_2 = y_1$$
is solvable in an extension if and only if $a_1 = a_2$, so its conditions can be stated in first-order logic.
Furthermore, any single equation $a = n_1 y_1 + ... + n_r y_r$ with at least one $n_i \neq 0$ can be solved in some extension of any group, since in $H = (G \times \mathbb{Z}) / \langle (a, -n_i)\rangle $ we have $y_i = (0, 1)$ as a solution, with $G$ embedding into it by $\alpha: G \rightarrow H: g \mapsto (g, 0)$, as described by this answer
 A: Let $T:\mathbb{Z}^s\to\mathbb{Z}^r$ be the homomorphism with matrix $(n_i^j)$ and let $f:\mathbb{Z}^s\to G$ be the homomorphism that sends the $j$th basis vector to $a_j$.  Your question is then when there exists an injective homomorphism $i:G\to H$ and a homomorphism $g:\mathbb{Z}^r\to H$ such that $gT=if$.
Clearly a necessary condition is that $f$ must vanish on $\ker T$.  I claim that this is also sufficient.  Indeed, let $H$ be the pushout of $f$ and $T$ with $i:G\to H$ and $g:\mathbb{Z}^r\to H$ the structure maps.  Explicitly, $H$ is the quotient of $\mathbb{Z}^r\oplus G$ by the subgroup consisting of elements of the form $(T(x),-f(x))$ for $x\in\mathbb{Z}^s$, and $i$ and $g$ are given by the inclusions into the direct sum $\mathbb{Z}^r\oplus G$ composed with the quotient map.  This satisfies $gT=if$, so the only question is whether $i$ is injective.  If $i(x)=0$, that means there exists some $y\in\mathbb{Z}^s$ such that $(0,x)=(T(y),-f(y))$.  This means $y\in\ker T$, so by hypothesis, $f(y)=0$, so $x=0$.
So your desired extension exists iff $f$ vanishes on $\ker T$.  For any specific element $x\in\ker T$, the condition that $f(x)=0$ is just a certain equation the $a_j$ must satisfy.  Picking a finite set of generators for $\ker T$, you get a finite set of equations in the $a_j$ which is equivalent to the existence of your desired extension.
A: First let's note that there is a universal way to map $G$ to a group admitting solutions to these equations. Let $G' = (G\oplus \mathbb{Z}^r)/H$, where $H$ is the subgroup of $G\oplus \mathbb{Z}^r$ generated by $\{(-a_j,n_1^j,\dots,n_r^j)\mid 1\leq j \leq s\}$, and let $\varphi\colon G\to G'$ be defined by $\varphi(g) = (g,0,\dots,0)+H$. Then defining \begin{align*} e_1 &= (0,1,0,\dots,0) + H\\ e_2 &= (0,0,1,\dots,0) + H\\ &\vdots \\ e_r &= (0,0,0,\dots,1)+H\end{align*}
these elements are solutions to your equations, in the sense that $\varphi(a_j) = n^j_1e_1 + \dots + n^j_re_r$ for all $1\leq j \leq s$.
Moreover, if $\psi\colon G\to K$ is any group homomorphism, and $k_1,\dots,k_r$ are solutions to your equations in $K$, in the sense that $\psi(a_j) = n^j_1k_1 + \dots + n^j_rk_r$ for all $1\leq j \leq s$, then there is a unique homomorphism $\psi'\colon G'\to K$ such that $\psi'(e_i) = k_i$ for all $1\leq i\leq r$ and $\psi'\circ \varphi = \psi$.
Now suppose your equations are solvable in some group $K$ containing $G$ as a subgroup. Then taking $\psi$ to be the inclusion in the discussion above, we find that $\psi'\circ \varphi = \psi$ is injective, and hence $\varphi$ is injective. Conversely, if $\varphi$ is injective, then your equations are solvable in $G'$, which contains $G$ as a subgroup (or rather, contains its isomorphic copy $\text{im}(\varphi)$). So your question is equivalent to asking when $\varphi$ is injective.
Well, $\varphi$ is injective iff there is no $b\neq 0$ in $G$ such that $\varphi(b) = 0$. Equivalently, iff there is no $b\neq 0$ in $G$ such that $(b,0,\dots,0)\in H$.
A general element of $H$ is a $\mathbb{Z}$-linear combination of the generators: $$m_1(-a_1,n_1^1,\dots,n_r^1) + \dots + m_s(-a_s,n_1^s,\dots,n_r^s).$$ And now it's clear that the question is really one of linear algebra over $\mathbb{Z}$: is it the case that for all $(m_1,\dots,m_s)\in \mathbb{Z}^s$, if $$(*) \quad \left(\begin{matrix} n_1^1 & \dots & n_1^s \\ \vdots & \ddots & \vdots \\ n_r^1 & \dots & n_r^s \end{matrix}\right)\left(\begin{matrix} m_1\\ \vdots \\ m_s\end{matrix}\right) = \left(\begin{matrix}0\\ \vdots \\ 0\end{matrix}\right),$$ then $$(**) \quad m_1a_1 + \dots + m_sa_s = 0?$$
The set of solutions to $(*)$ is a subgroup of $\mathbb{Z}^s$ (the nullspace of the coefficient matrix), and since every subgroup of $\mathbb{Z}^s$ is finitely generated, we can pick generators $\{(m_1^k,\dots,m_s^k)\mid 1\leq k \leq \ell\}$. And it suffices to check $(**)$ on the generators. So yes, the condition on the coefficients $a_1,\dots,a_r$ is definable in first-order logic, even by a conjunction of atomic formulas: $$\bigwedge_{k=1}^\ell m_1^ka_1 + \dots + m_s^ka_s = 0.$$
