\baregin{document}

\mathcalaketitle

\baregin{abstract}
We study  metabelian groups $G$ given by full rank finite presentations $\lambdaangle A \mathcalid R\rightarrowangle_{\mathcalc{M}}$  in the  variety $\mathcalathcal{M}$ of metabelian groups. We prove that $G$ is a product of a free metabelian subgroup of rank $\mathcalax\{0, |A|-|R|\}$ and a  virtually abelian normal subgroup, and that if $|R|\lambdaeq |A|-2$ then the Diophantine problem of $G$ is undecidable, while it is decidable if $|R|\gammaeq |A|$. We further prove that if $|R|\lambdaeq |A|-1$ then in any direct decomposition of $G$  all,  but one, factors are virtually abelian. Since  finite presentations have full rank asymptotically almost surely, finitely presented metabelian groups satisfy all the aforementioned properties asymptotically almost surely. 

\epsilonnd{abstract}

\tableofcontents

\sigmaection{Introduction}

In this paper we study finitely generated metabelian groups $G$ given by full rank finite presentations $G = \lambdaangle a_1, \lambdadots, a_n \mathcalid r_1, \lambdadots, r_m\rightarrowangle_{\mathcalc{M}}$ in the  variety $\mathcalathcal{M}$ of metabelian  groups, random metabelian groups in the few relators model, and the Diophantine problem in such groups. We prove that the  Diophantine problem  in   the group $G$ above is  undecidable  if $m \lambdaeq n-2$ and decidable if $m \gammaeq n$  (the case $m = n-1$ is still open); if $m \lambdaeq n-1$ then in any direct decomposition of $G$ all, but one,   factors are virtually abelian;  and, finally,  $G$ has a rather nice structure, namely, $G$ is a product of two subgroups $G= HL$, where $H$ is a free metabelian group of rank $\mathcalax\{n-m,0\}$ and $L$ is  a virtually abelian normal subgroup of $G$. The class of metabelian groups admitting full rank presentations is rather large. Indeed, it turns out that for fixed $n$ and $m$ a finite presentation $\lambdaangle a_1, \lambdadots, a_n \mathcalid r_1, \lambdadots, r_m\rightarrowangle_{\mathcalc{M}}$ has full rank asymptotically almost surely. In particular, random metabelian  groups (in the few relators model) have full rank presentations asymptotically almost surely. Hence, they asymptotically almost surely satisfy all the properties mentioned above. 

\sigmaubseteqeqsection{Metabelian groups with full rank presentations}

Let $A = \{a_1, \lambdadots,a_n\}$ be a finite alphabet,  $A^{-1} = \{a_1^{-1}, \lambdadots,a_n^{-1}\}$, $A^{\phim 1} = A \circup A^{-1}$, $(A^{\phim 1})^\alphast$  the set of all (finite) words in $A^{\phim 1}$, and  $R = \{r_1, \lambdadots,r_m \}$  a finite subset of $(A^\phim)^\alphast$. We fix this notation for the rest of the paper. 

A pair $(A,R)$ is called  a {\epsilonm finite  presentation}, we  denote it by $\lambdaangle A \mathcalid R\rightarrowangle$ or $\lambdaangle a_1, \lambdadots,a_n \mathcalid r_1, \lambdadots,r_m \rightarrowangle$. If $\mathcalathcal V$ is a variety or a quasivariety of groups then a finite presentation $\lambdaangle A \mathcalid R\rightarrowangle$ determines a group $G = F_{\mathcalathcal V}(A)/\lambdaangle \lambdaangle R \rightarrowangle \rightarrowangle$, where  $F_{\mathcalathcal V}(A)$ is a free group in $\mathcalathcal V$ with basis $A$ and $\lambdaangle \lambdaangle R \rightarrowangle \rightarrowangle$ is the normal subgroup of $F_{\mathcalathcal V}(A)$ generated by $R$. In this case we write $G = \lambdaangle A \mathcalid R\rightarrowangle_{\mathcalathcal V}$.    The {\epsilonm relation matrix} $M(A,R)$ of the presentation $\lambdaangle A \mathcalid R\rightarrowangle$
is an  $m \times n$ integral matrix whose $(i,j)$-th entry is the sum of the exponents of the $a_j$'s  that occur in $r_i$. It was introduced by Magnus in \circite{Magnus} (see also \circite{LS}, Chapter II.3,   for its ties  to relation modules in groups). The number $d = |A| - |R|$, if non-negative, is called the {\epsilonm deficiency} of the presentation $\lambdaangle A \mathcalid R\rightarrowangle$ (see \circite{LS}, Chapter II.2 for a short survey on groups with positive deficiency). The matrix $M(A,R)$ has {\epsilonm full rank} if its rank is equal to $\mathcalin\{|A|,|R|\}$, i. e., it is the maximum possible. 

We showed in \circite{GMO} that if a finitely generated nilpotent group $G$ admits a full-rank presentation, then $G$ is either virtually free nilpotent (provided the   deficiency $d \gammaeq 2$), or  virtually cyclic (if $d = 1$), or finite (if $d \lambdaeq 0$).  

Groups given in  the variety ${\mathcalathcal M}$  of all metabelian groups  by full rank presentations also have a rather restricted structure, as witnessed by the following result.

\baregin{thm}\lambdaabel{t: main_structure_theorem}
	Let $G$ be a metabelian group given by a full-rank presentation  $G=\lambdaangle A\mathcalid R\rightarrowangle_\mathcalc{M}$. Then there exist two finitely generated subgroups $H$ and $K$ of $G$ such that:
	\baregin{itemize}
	    \inftytem  [1.] $H$ is a free metabelian group of rank  $\mathcalax(|A| -|R|,0)$,
	    \inftytem [2.]  $K$ is a virtually abelian group with  $|R|$ generators, and its normal closure $L = K^G$ in $G$ is again virtually abelian;
	    \inftytem [3.] $G =  \lambdaangle H, K \rightarrowangle = LH$. 
	  	\epsilonnd{itemize}
	 Moreover, there is an algorithm that given a presentation $G=\lambdaangle A\mathcalid R\rightarrowangle_\mathcalc{M}$ finds a free basis for  the subgroup $H$ and a  generating set in $|R|$ generators for the subgroup $K$. 
\epsilonnd{thm}

\mathcaledskip \noindent
The result above complements the Generalized Freiheissatz for ${\mathcalathcal M}$.  In \circite{Romanovskii} Romanovskii  proved that if a  metabelian  group $G$ is given in the variety  ${\mathcalathcal M}$ by a finite presentation $\lambdaangle A \mathcalid R\rightarrowangle_{\mathcalc{M}}$ of deficiency $d  \gammaeq 1$,  then there is a subset of generators $A_0 \sigmaubseteqeqseteq A$ with $|A_0| = d$ which freely generates a free metabelian  subgroup $H = \lambdaangle A_0\rightarrowangle$.   Theorem  \rightarrowef{t: main_structure_theorem} shows that if the presentation $\lambdaangle A \mathcalid R\rightarrowangle_{\mathcalc{M}}$ has full rank then  there is a free metabelian of rank $d$ subgroup $H$ of $G$ and,  in addition,  there are  virtually abelian subgroups $K$ and $L$ as described  in items 2) and 3) above, such that $G = HL$.  Two remarks are in order here. First, the subgroup $H$ in Theorem  \rightarrowef{t: main_structure_theorem} is not necessary equal to $\lambdaangle A_0\rightarrowangle$ for a suitable  $A_0 \sigmaubseteqeqseteq A$ as in the Romanovskii's result. However, for a given full rank presentation $G =  \lambdaangle A \mathcalid R\rightarrowangle_{\mathcalc{M}}$  of $G$ one can find algorithmically another full rank presentation of $G$, which is in Smith normal form (see Section \rightarrowef{se:Freiheissatz}), such that the subgroup $H$ is, indeed, generated by a suitable $A_0 \sigmaubseteqeqseteq A$ and $K$ is generated by $A \sigmamallsetminus A_0$.  Second, even if the presentation $G =  \lambdaangle A \mathcalid R\rightarrowangle_{\mathcalc{M}}$ is in 
 Smith normal form, but it is not of full rank, then the subgroups $K$ and $L$  as in Theorem  \rightarrowef{t: main_structure_theorem}  may not necessarily exist
(see details in Section \rightarrowef{se:Freiheissatz}).  

In another direction, we showed  in \circite{GMO}  that in any direct decomposition of a nilpotent group $G$ given in the nilpotent variety   $\mathcalathcal{N}_c$, $c \gammaeq 2$, by a finite full rank presentation of deficiency $\gammaeq 1$,  all, but one, direct factors are finite.  

A similar result holds in the variety $\mathcalathcal{M}$ as well.

\baregin{thm}\lambdaabel{t: Full-rank_direct_decomposition}
	Let $G$ be a finitely generated metabelian group given by a full-rank presentation $G=\lambdaangle A\mathcalid R \rightarrowangle_{\mathcalc{M}}$ such that $|R|\lambdaeq |A|-1$. Then  in any direct decomposition of $G$ all, but one, direct factors are virtually abelian. 
\epsilonnd{thm}

\sigmaubseteqeqsection{Diophantine problems}

In Section 3 we study the Diophantine problem in finitely generated metabelian  groups given by  full rank presentations. This  is a continuation of research  in \circite{GMO2} and \circite{GMO}.

  Recall, that the \epsilonmph{Diophantine problem} in an algebraic structure $\mathcalathcal{A}$ (denoted $\mathcalc{D}(\mathcalc{A})$)  is the task to determine whether or not  a given finite system of equations with constants in $\mathcalc{A}$ has a  solution in $\mathcalathcal{A}$. $D(\mathcalathcal{A})$ is \epsilonmph{decidable} if there is an algorithm that given a finite system $S$ of equations with constants in $\mathcalathcal{A}$ decides whether or not $S$ has a solution in $\mathcalc{A}$. Furthermore, $\mathcalc{D}(\mathcalc{A})$ is  \epsilonmph{reducible} to  $\mathcalc{D}(\mathcalc{M})$, for   another structure $\mathcalc{M}$,  if there is an algorithm that for any finite system of equations $S$  in $\mathcalc{A}$ computes a finite system of equations $S_{\mathcalc{M}}$ in $\mathcalc{M}$ such that $S$ has a solution in $\mathcalc{A}$ if and only if $S_{\mathcalc{M}}$  has a solution in $\mathcalc{M}$. 

 Note that due to the classical result of Davis,  Putnam, Robinson and Matiyasevich, the Diophantine problem  $\mathcalc{D}(\mathcalathbb{Z})$ in the ring of integers $\mathcalathbb{Z}$ is undecidable \circite{mat, DPR}.  Hence if $\mathcalc{D}(\mathcalathbb{Z})$ is reducible to $\mathcalc{D}(\mathcalc{M})$, then  $\mathcalc{D}(\mathcalc{M})$ is also  undecidable.  

To prove  that  $\mathcalc{D}(\mathcalc{A})$ reduces to  $\mathcalc{D}(\mathcalc{M})$ for some structures  $\mathcalc{A}$ and  $\mathcalc{M}$  it suffices to show that  $\mathcalc{A}$ is  interpretable by equations (or \epsilonmph{e-interpretable}) in $\mathcalc{M}$.  E-interpretability is a variation of the classical notion of the first-order interpretability, where instead of arbitrary first-order formulas finite systems of equations are used as the interpreting formulas (see Definition \rightarrowef{d: e-int} for details).  The main relevant property of such interpretations is that if $\mathcalc{A}$ is e-interpretable in $\mathcalc{M}$ then $\mathcalc{D}(\mathcalc{A})$  is reducible to $\mathcalc{D}(\mathcalc{M})$ by a polynomial time many-one reduction (Karp reductions).

\baregin{thm}\lambdaabel{t: Diophantine_Problem_full_rank}
	Let $G$ be a metabelian group given by a full-rank presentation $G=\lambdaangle A\mathcalid R \rightarrowangle_{\mathcalc{M}}$. Then the following hold:
	\baregin{enumerate}
	    \inftytem If $|R| \lambdaeq |A|-2$ then the ring of integers $\mathcalbb{Z}$ is e-interpretable in $G$, and the Diophantine problem in $G$ is undecidable.
	    \inftytem If $|R| \gammaeq |A|$ then the Diophantine problem of $G$ is decidable (in fact, the first-order theory of $G$ is decidable).
	\epsilonnd{enumerate}
\epsilonnd{thm}

This result is analogous to the one obtained for nilpotent groups in \circite{GMO}.

\baregin{remark}

For the case of deficiency $1$ (i.e., $m=n-1$), decidability of the Diophantine problem over $G$ remains an interesting open problem. 
The recent work \circite{KLM_19} proves decidability of the Diophantine problem in $BS(1,n)=\lambdaangle a_1,a_2\mathcalid a_1^{n-1}=[a_1,a_2]\rightarrowangle$.
Also  some deficiency $1$  presentations define cyclic groups, which have decidable Diophantine problem  \circite{Ershov}. 
\epsilonnd{remark}
\baregin{conj}
Let $G$ be a metabelian group given by a full-rank presentation $G=\lambdaangle A\mathcalid R \rightarrowangle_{\mathcalc{M}}$. If $|A|-|R| = 1$ then 
the Diophantine problem in $G$  is decidable. 

\epsilonnd{conj}

\sigmaubseteqeqsection{Random finitely presented groups: the few-relations model}\lambdaabel{s: few_relators_model}

 

The first notion of \epsilonmph{genericity} or a \epsilonmph{random group} in the class of finitely presented groups is due to Gromov \circite{gromov_hyperbolic}, where he introduced what is now known as the few relators  model. A slightly different  approach was suggested by Olshanskii \circite{olshansky_random}  and Arzhantseva and Olshanskii \circite{arzhantsevsa_olshanski}. 

Nowadays, the few relators model can be described as follows.   Let $m, n$ be fixed positive integers. Consider, in the notation above,  the set $S(n,m)$ of all finite presentations $\lambdaangle A \mathcalid R\rightarrowangle$ with  $|A| = n, |R| = m$. For a given positive integer $\epsilonll$ consider a finite subset $S(n,m,\epsilonll)$ of $S(n,m)$ which consists of all presentations $\lambdaangle A \mathcalid R\rightarrowangle \inftyn S(n,m)$, where each relator in $R$ has length precisely $\epsilonll$. Now for a given property of groups $P$ consider a subset $S_P(n,m,\epsilonll)$ of $S(n,m,\epsilonll)$  of all presentations $\lambdaangle A \mathcalid R\rightarrowangle \inftyn S(n,m,\epsilonll)$ which define groups that  satisfy $P$. The property $P$ is termed \epsilonmph{$(n,m)$-generic} if 
$$
\lambdaim_{\epsilonll \to \inftynfty}\frac{|S_P(n,m,\epsilonll)|}{|S(n,m,\epsilonll)|} = 1.
$$
Here $|X|$ denotes the cardinality of a set $X$.
In this event we also say sometimes that   $P$ holds for $\lambdaangle A \mathcalid R\rightarrowangle$ \epsilonmph{asymptotically almost surely as $\epsilonll \to \inftynfty$}. 

In the book \circite{gromov_hyperbolic} Gromov stated that the group property of being hyperbolic is $(n,m)$-generic for all $n$ and $m$. Later Olshanskii \circite{olshansky_random} and Champetier \circite{champetier}  gave rigorous proofs of this result. We refer to \circite{Olivier} for a survey on random finitely presented groups and to Kapovich and Schupp \circite{kapovich_shupp} on group theoretic models of randomness and genericity.  

Observe that  the few relators model described above  concerns classical finitely presented groups. However, this approach  can be utilized as well for finitely presented groups in any fixed variety of groups $\mathcalathcal{V}$, in particular, for finitely generated metabelian groups given  in  the variety ${\mathcalathcal M}$ of all metabelian groups by finite presentations $\lambdaangle A \mathcalid R\rightarrowangle_{\mathcalathcal M}$.  Note that every finitely generated group in ${\mathcalathcal M}$ has a finite presentation in ${\mathcalathcal M}$.

For the variety of nilpotent groups ${\mathcalathcal N}_c$  (of a fixed nilpotency class $c$), this approach has been studied recently in \circite{Duchin, GMO}. Other models of randomness for the groups in ${\mathcalathcal N}_c$   can be found in \circite{Dymarz, GMO2}. To the best of our knowledge, there is no study of random metabelian groups (in any model) prior to this paper. 

The following result is fundamental to our approach. 

\baregin{thm} \circite{GMO} \lambdaabel{t: random_walks}

Let $R$ be a set of $m$ words of length $\epsilonll$ in an alphabet $A^{\phim 1} = \{a_1^{\phim 1}, \dots, a_n^{\phim 1} \}$, i.e.\ each word is obtained by successively concatenating  randomly chosen letters from $A^{\phim 1}$ with uniform probability. Then $M(A, R)$ has full rank (i.e.\ ${\inftyt rank}(M(A, R))=\mathcalin\{n, m\}$) asymptotically almost surely as $\epsilonll \to \inftynfty$.

\epsilonnd{thm}

 

\baregin{cor}

Let $\lambdaangle A\mathcalid R\rightarrowangle=\lambdaangle a_1, \dots, a_n \mathcalid r_1,\dots, r_m\rightarrowangle$ be a  presentation where all relators $r_i$ have length $\epsilonll> 0$. Then the presentation $\lambdaangle A\mathcalid R\rightarrowangle$ has full rank asymptotically almost surely as $\epsilonll$ tends to infinity.

\epsilonnd{cor}

One of the main appeals of full-rank presentations is that they occur asymptotically almost surely in the few-relators model for random groups in any variety $\mathcalathcal{V}$, in particular,  in the variety ${\mathcalathcal M}$.
Hence, random metabelian  groups (in the few relators model) have full rank presentations asymptotically almost surely. Therefore, all the properties described above for metabelian groups given by full rank presentations are generic in the class of finitely presented  metabelian groups. We refer to Section \rightarrowef{se:random} for precise statements of the results.

\sigmaection{Structural properties of  metabelian groups given by full-rank presentations}

Throughout the paper we use the following notation.

Let $G$ be a group. By $\gammaamma_i(G)$ we denote the $i$-th term of the lower central series of $G$, that is $\gammaamma_1(G)=G$ and $\gammaamma_{i+1}(G)=[G, \gammaamma_{i}(G)]$ for all $i\gammaeq 1$.  By $G^{(i)}$ we denote the $i$-th term of the derived series of $G$, that is $G^{(0)}=G$ and $G^{(i+1)}=[G^{(i)}, G^{(i)}]$. 

We denote by  $\mathcalc{N}_c$ and $\mathcalc{M}$ the families of nilpotent groups of nilpotency class at most $c$,  and of metabelian groups, respectively. In general, we refer to books \circite{LS,Segal} for the standard facts and notation in group theory and to \circite{Neumann} for basic notions regarding varieties. 

\sigmaubseteqeqsection{A variation of the Generalized Freiheissatz} \lambdaabel{se:Freiheissatz}

In this section we obtain some structural results on full rank metabelian groups, in particular, Theorem \rightarrowef{t: main_structure_theorem}.   

To prove this theorem we need some results on presentations in Smith normal form. 

Recall (see, for example, \circite{sims}), that an integer matrix $A = (a_{ij})$ is in \epsilonmph{Smith normal form} if there is some integer $r \gammaeq 0$ such that the entries $d_i = a_{ii}, 1\lambdaeq i \lambdaeq r$ are positive, $A$ has no other nonzero entries, and $d_i$ divides $d_{i+1}$ for $1\lambdaeq i<r$. 

\baregin{dfn}
A finite presentation $\lambdaangle A\mathcalid R\rightarrowangle$  is said to be in \epsilonmph{Smith normal form} if the relation matrix $M(A, R)$ is in Smith normal form.
\epsilonnd{dfn}

\baregin{prop}\lambdaabel{p: smith_normal_form}

For any   finite  presentation $\lambdaangle A \mathcalid R \rightarrowangle$ there exists a finite presentation in Smith normal form  $\lambdaangle A' \mathcalid R' \rightarrowangle$, with $|A| = |A'|$, $|R| = |R'|$,  and $rank(M(A,R))=rank(M(A',R'))$,  such that for any variety  $\mathcalc{V}$ the groups $G = \lambdaangle A \mathcalid R \rightarrowangle_{\mathcalc{V}}$ and $G' = \lambdaangle A' \mathcalid R' \rightarrowangle_{\mathcalc{V}}$ are isomorphic. Moreover, such a presentation $\lambdaangle A' \mathcalid R' \rightarrowangle$ and an isomorphism $G \to G'$ can be found algorithmically. 

\epsilonnd{prop}

\baregin{proof}
The presentation $\lambdaangle A' \mathcalid R' \rightarrowangle$ can be obtained by repeatedly applying Nielsen transformations on the tuples  $A$ and $R$. Indeed, note that such a Nielsen transformation has the effect in the relation matrix $M(A,R)$  of adding or subtracting two columns or two rows, respectively. It is known (see \circite{sims})  that one can find a finite sequence of elementary row and column operations that transform $M(A,R)$ into its Smith normal form. Performing the corresponding Nielsen transformation on $\lambdaangle A \mathcalid R \rightarrowangle$ one gets the required presentation $\lambdaangle A' \mathcalid R' \rightarrowangle$.  The details of this procedure can be found in \circite{GMO}. 

\epsilonnd{proof}

The complexity of finding a presentation in Smith normal form and other algorithmic considerations regarding full-rank presentations and presentations in Smith normal form will be studied in  upcoming work.

\baregin{lemma}\lambdaabel{t: structure_Smith_normal_form}

Let $G$ be a metabelian group given by a full-rank presentation in Smith normal form: 
$$
G=\lambdaangle A \mathcalid R\rightarrowangle_\mathcalc{M} = \lambdaangle a_1,\dots, a_n \mathcalid a_1^{\alphalpha_1}=c_1, \dots, a_{m}^{\alphalpha_m}=c_m \rightarrowangle_\mathcalc{M},
$$
where $c_i\inftyn [F(A),F(A)]$, $\alphalpha_i \inftyn \mathcalbb{Z}\sigmamallsetminus\{0\}$ for all $i=1, \dots, m$, and $m \lambdaeq n$.  Then the following holds:
\baregin{itemize}
\inftytem [1.]  $K= \lambdaangle a_1, \lambdadots a_m\rightarrowangle$ is a virtually abelian group, and its normal closure $L = K^G$ in $G$ is again virtually abelian;
\inftytem  [2.] $H = \lambdaangle a_{m+1}, \dots, a_n \rightarrowangle$ is a free metabelian group of rank $n-m$;
\inftytem [3.] $G = \lambdaangle H,K \rightarrowangle = HL$.
\epsilonnd{itemize}

\epsilonnd{lemma}

\baregin{proof}

We show first that  $K = \lambdaangle a_1, \lambdadots a_m\rightarrowangle$ is virtually abelian. 
Note that $K\circap G'$ is abelian. Set $N=\alphalpha_1\circdots\alphalpha_m$. Then for all $g\inftyn K$ one has  $g^N\inftyn K \circap G'$. Hence  $K/K \circap G'$ is finite, so $K$ is virtually abelian. Similarly, for $L = K^G$ the subgroup $L \circap G'$ is normal in $L$ and abelian. The quotient $L/L \circap G'$ is abelian, of period $N$, and finitely generated (since $L = K(L\circap G'))$, hence finite. It follows that $L$ is abelian-by-(finite abelian). Note that $L$ might not be finitely generated. 

Now we show that $\lambdaangle a_{m+1}, \dots, a_n \rightarrowangle$ is a free metabelian group of rank $n-m$. Assume that $n-m\gammaeq 2$. By Romanovski's aforementioned result \circite{Romanovskii} (see the discussion after Theorem \rightarrowef{t: main_structure_theorem}), we know that there exists a subset $A_1\sigmaubseteqeqseteq A$ with $|A_1| = |A| - |R|$ such that $\lambdaangle A_1 \rightarrowangle$ is free metabelian freely generated by $A_1$. We claim that $A_1 = \{a_{m+1}, \dots, a_n\}$. Indeed, otherwise there exists $a_i \inftyn A_1$ such that  $a_i^t \inftyn G'$ for some $t\inftyn \mathcalbb{Z}\sigmamallsetminus\{0\}$. Note that $|A_1| \gammaeq 2$, so there is $a_j \inftyn A_1$ with $i \neq j$.  It follows then that  $[a_i^t,[a_i,a_j]]=1$, a contradiction with the fact that $A_1$ freely generates $\lambdaangle A_1 \rightarrowangle$ as a free metabelian group. 

If $n-m = 1$ then the map $a_n\to 1$ and $a_i\to 0$ for all $i=1,\dots, n-1$ gives rise to a  homomorphism $G\to \mathcalathbb{Z}$. 
Hence, $a_n$ has infinite order in $G$,  and $\lambdaangle a_n \rightarrowangle$ is a free metabelian group of rank $1$. We note in passing, that in the case when $m=n-1$ the element of $A$ that generates an infinite cyclic group (i.e.,  a free metabelian group of rank $1$) is not necessarily unique, e.g.,  in $BS(1,n)\circong \lambdaangle a_1,a_2\mathcalid a_1^{n-1}=[a_1,a_2]\rightarrowangle$, both $a_1$ and $a_2$ generate an infinite cyclic subgroup.

\epsilonnd{proof}

\baregin{proof}[Proof of Theorem \rightarrowef{t: main_structure_theorem}]

	Let $G$ be a metabelian group given by a full-rank presentation  $G=\lambdaangle A\mathcalid R\rightarrowangle_\mathcalc{M}$.  By Proposition \rightarrowef{p: smith_normal_form} one can find algorithmically another presentation $G  \lambdaangle A'\mathcalid R'\rightarrowangle_\mathcalc{M} = \lambdaangle a_1',\dots, a_n' \mathcalid r_1', \lambdadots, r_m' \rightarrowangle_\mathcalc{M}$ of $G$ which is in Smith normal form. 
	
	If $m \lambdaeq n$ then Lemma \rightarrowef{t: structure_Smith_normal_form} applied to the presentation $\lambdaangle A', \mathcalid R'\rightarrowangle$ gives  subgroups $H$ and $K$ with the required properties. From these we obtain  the required subgroups in $G$ by inverting the isomorphism $\lambdaangle A\mathcalid R\rightarrowangle =\lambdaangle A'\mathcalid R\rightarrowangle$. 
	
	On the other hand, if $m > n$, then $G$ is a quotient of the full-rank metabelian group with zero deficiency $G_1= \lambdaangle a_1', \lambdadots,a_n' \mathcalid r_1', \lambdadots,r_n'\rightarrowangle$ (since $M(A',R')$ is in Smith normal form, this is a full-rank presentation), and by the previous case it follows that $G_1$ is virtually abelian. Since $G$ is a quotient of $G_1$, $G$ is also virtually abelian.

\epsilonnd{proof}

\baregin{remark}
\lambdaabel{rem:2} 
Note, that if the presentation in Lemma \rightarrowef{t: structure_Smith_normal_form} is in  Smith normal form, but not of full rank, then by the Generalized Freiheissatz \circite{Romanovskii} the free subgroup $H = \lambdaangle A_0\rightarrowangle$ of $G$ exists, but there might not exists corresponding  subgroups $K$ and $L$ for $H$.   Indeed, let
$$
    G = \lambdaangle a_1, a_2, a_3, a_4 \mathcalid [a_1,a_3] = 1, [a_2,a_4] = 1\rightarrowangle.
$$
Then $a_3,a_4$ generate a free metabelian group of rank 2, but $G/H^G$ is free metabelian of rank 2, so there is no a virtually abelian subgroup $L$, such that $G = HL$.

\epsilonnd{remark}

\baregin{remark}
Finally, note that  Theorem \rightarrowef{t: main_structure_theorem} or Lemma \rightarrowef{t: structure_Smith_normal_form}  may  not reveal fully the structure   of $G$ and how it is related to the subgroups $H$ and $K$. 
For example, consider 
$$
G=\lambdaangle a_1,a_2,a_3,a_4\mathcalid a_1^m=[a_1,a_3],a_2^k=[a_2,a_4]\rightarrowangle.
$$
Lemma \rightarrowef{t: structure_Smith_normal_form}  tells us that $\lambdaangle a_3,a_4\rightarrowangle$ is freely generated by $a_3,a_4$ and $\lambdaangle a_1,a_2\rightarrowangle$ is a virtually abelian group. On the other hand, it is easy to check  that $\lambdaangle a_1,a_3\rightarrowangle\circong BS(1,m+1)$, $\lambdaangle a_2,a_4\rightarrowangle\circong BS(1,k+1)$, and $G$ is  the free metabelian product of two Baumslag-Solitar groups, which is not clear directly from the decomposition $G = HL$.
\epsilonnd{remark}

\sigmaubseteqeqsection{Direct decompositions}

In this section we  prove our main result on direct decomposition of metabelian groups given by full rank presentations, namely Theorem \rightarrowef{t: Full-rank_direct_decomposition}. 

\baregin{proof}[Proof of Theorem \rightarrowef{t: Full-rank_direct_decomposition}]

We showed in \circite{GMO} that if  $H$ is  a finitely generated nilpotent group of class $c \gammaeq 2$ given by a finite full rank presentation $H = \lambdaangle A \mathcalid R \rightarrowangle_{\mathcalc{N}_c}$ with $|R| \lambdaeq |A|-1$,  then  in any direct decomposition of $H$ all, but one, direct factors are finite. We will use this fact in our proof. Let now $G$ be a finitely generated metabelian group given by a full-rank presentation $G=\lambdaangle A\mathcalid R \rightarrowangle_{\mathcalc{M}}$ such that $|R|\lambdaeq |A|-1$. Assume $G=G_1\times \dots \times G_k$ for some $k\gammaeq 2$ and some subgroups $G_i$, $i=1, \dots, k$. Let $\phii$ be the natural projection of $G$ onto $H = G/\gammaamma_3(G)$. The quotient $H$ admits the full-rank presentation $\lambdaangle A\mathcalid R\rightarrowangle_{\mathcalc{N}_2}$, so by the result mentioned above  all, but one, say $\phii(G_k)$, of the groups $\phii(G_1), \dots, \phii(G_k)$ are finite. Hence ${\it ker}\phii \circap G_i$ has finite index in $G_i$ for all $i=1,\dots, k-1$. However  ${\it ker}\phii$ is abelian since ${\it ker}\phii = \gammaamma_3(G) \lambdaeq [G,G]$. 

\epsilonnd{proof}

\sigmaection{Diophantine problem}

\sigmaubseteqeqsection{Diophantine problem and e-interpretability}
\lambdaabel{se:e-interpretability}

In this section we introduce the technique  of interpretability by systems of equations.  It is nothing else than the classical model-theoretic technique of interpretability (see \circite{Marker, Hodges}), restricted to  systems of equations (equivalently, positive existential formulas without disjunctions). In \circite{ GMO1, GMO3} we used this technique to  study the Diophantine problem in different classes of solvable groups and rings. 

\mathcaledskip

In what follows we often  use non-cursive boldface letters to denote tuples of elements: e.g.\ $\mathcalathbf{a}=(a_1, \dots, a_n)$. Furthermore, we always assume that equations may contain constants from  the algebraic structure in which they are considered.

\baregin{dfn}\lambdaabel{d: e-def} 
 A set $D \sigmaubseteqeqset M^m$ is called \epsilonmph{definable by systems of equations} in $\mathcalathcal{M}$, or \epsilonmph{e-definable} in $\mathcalathcal{M}$, if there exists a finite system of equations, say $\Sigma_{D}(x_1,\lambdadots,x_m, y_1, \dots, y_k)$, in the language of $\mathcalc{M}$  such that 
for any tuple $\mathcalathbf{a}\inftyn M^m$, one has that  $\mathcalathbf{a} \inftyn D$ if and only if  the system  $\Sigma_{D}(\mathcalathbf{a}, \mathcalb{y})$ on variables $\mathcalathbf {y}$ has a solution in $\mathcalathcal{M}$. In this case $\Sigma_D$ is said to \epsilonmph{e-define} $D$ in $\mathcalc{M}$.
\epsilonnd{dfn}
\baregin{remark}
Observe that, in the notation above, if $D \sigmaubseteqeqset M^m$ is e-definable then it is definable in $\mathcalathcal{M}$ by the formula $\epsilonxists \mathcalb{y}  \Sigma_{D}(\mathcalathbf{x}, \mathcalb{y})$. Such formulas are called \epsilonmph{positive primitive}, or pp-formulas. Hence, e-definable subsets are sometimes called pp-definable. On the other hand, in number theory  such sets  are usually referred to as Diophantine ones. And yet, in algebraic geometry they can be described as projections of algebraic sets.
\epsilonnd{remark}

\baregin{dfn}\lambdaabel{d: e-int}

An algebraic structure $\mathcalathcal{A}= \lambdaeft(A; f, \dots, r, \dots, c, \dots \rightarrowight)$  is called \epsilonmph{e-interpretable} in another algebraic structure $\mathcalathcal{M}$ if there exists $n\inftyn \mathcalathbb{N}$, a subset $D \sigmaubseteqeqseteq \mathcalathcal{M}^n$ and an onto map  (called the \epsilonmph{interpreting} map)

$

\phihi: D \twoheadrightarrow \mathcalathcal{A},

$ 

such that:

\baregin{enumerate}

\inftytem $D$ is e-definable in $\mathcalathcal{M}$. 

\inftytem  For every function $f=f(x_1, \dots, x_n)$ in the language of $\mathcalathcal{A}$, the preimage by $\phihi$ of the graph of $f$, i.e.\ the set $\{(x_1, \dots, x_k, x_{k+1}) \mathcalid \phihi(x_{k+1}) = f(x_1, \dots, x_k)\}$, is e-definable in $\mathcalathcal{M}$. 

\inftytem For every relation $r$ in the language of $\mathcalathcal{A}$, and also for  the equality relation $=$ in $\mathcalathcal{A}$,  the preimage by $\phihi$ of the graph of $r$ is e-definable in $\mathcalathcal{M}$.

\epsilonnd{enumerate}

\epsilonnd{dfn}

The following is a fundamental property of e-interpretability. Intuitively it states that if $\mathcalc{A}$ is e-interpretable in $\mathcalc{M}$, then any system of equations in $\mathcalc{A}$ can be `encoded' as a system of equations in $\mathcalc{M}$.

\baregin{lemma}
\lambdaabel{RedLemma}

Let  $\mathcalathcal{A}$ be e-interpretable in $\mathcalathcal{M}$ with  an  interpreting map  $\phihi: D \twoheadrightarrow \mathcalathcal{A}$ (in the notation of the Definition \rightarrowef{d: e-int}). Then for every finite system of equations $S(\mathcalathbf{x})$ in $\mathcalathcal{A}$, there exists   a finite system of equations $S^*(\mathcalathbf{y}, \mathcalathbf{z})$ in $\mathcalathcal{M}$, such that if $(\mathcalathbf{b}, \mathcalathbf{c})$ is a solution to $S^*(\mathcalathbf{y}, \mathcalathbf{z})$ in $\mathcalathcal{M}$, then $\mathcalathbf{b}\inftyn D$ and $\phihi(\mathcalathbf{b})$ is a solution to $S(\mathcalathbf{x})$ in $\mathcalathcal{A}$. Moreover, any solution $\mathcalathbf{a}$ to $S(\mathcalathbf{x})$ in $\mathcalathcal{A}$ arises in this way, i.e.\  $\mathcalathbf{a} = \phihi(\mathcalathbf{b})$ for some solution $(\mathcalathbf{b}, \mathcalathbf{c})$ to $S^*(\mathcalathbf{y}, \mathcalathbf{z})$ in $\mathcalathcal{M}$, for some $i=1,\dots, k$. Furthermore, there is a polynomial time algorithm that constructs the system $S^*(\mathcalathbf{y}, \mathcalathbf{z})$ when given a system $S(\mathcalathbf{x})$. 

\epsilonnd{lemma}

\baregin{proof}

It suffices to follow step by step the proof of Theorem 5.3.2 from \circite{Hodges}, which states that an analogue of the above holds when $\mathcalc{A}$ is interpretable by first order formulas in $\mathcalc{M}$. One needs to replace all first order formulas by systems of equations.

\epsilonnd{proof}

 Now we state two key consequences of Lemma \rightarrowef{RedLemma}. 

\baregin{cor}\lambdaabel{RedCor}

If $\mathcalathcal{A}$ is e-interpretable in $\mathcalathcal{M}$, then $\mathcalc{D}(\mathcalc{A})$ is reducible to $\mathcalc{D}(\mathcalc{M})$. Consequently, if $\mathcalc{D}(\mathcalathcal{A})$  is undecidable, then $\mathcalc{D}(\mathcalathcal{M})$ is undecidable as well.

\epsilonnd{cor}

\baregin{cor}\lambdaabel{transitivity}

e-interpetability is a transitive relation, i.e.,  if $\mathcalc{A}_1$ is e-intepretable in $\mathcalc{A}_2$, and $\mathcalc{A}_2$ is e-interpretable in $\mathcalc{A}_3$, then $\mathcalc{A}_1$ is e-interpretable in $\mathcalc{A}_3$.

\epsilonnd{cor}

The following is a key  property of e-interpretability that is used below. 

\baregin{prop}[\circite{GMO1}]\lambdaabel{extra_prop1}

Let $H$ be a normal subgroup of a group $G$. If  $H$ is e-definable in $G$ (as a set) then the natural map  $\phii: G \to G/H$ is an e-interpretation of $G/H$ in $G$.   Consequently, $\mathcalc{D}(G/H)$ is reducible to $\mathcalc{D}(G)$. 

\epsilonnd{prop}

\sigmaubseteqeqsection{The Diophantine problem in metabelian groups given by full rank presentations}

 

We next discuss the Diophantine problem in  metabelian groups admitting a full-rank presentation. We will need the following result regarding the same problem in nilpotent groups:

\baregin{thm}[\circite{GMO}]\lambdaabel{t: Dioph_full_rank_nilpotent}

Let $G$ be a finitely generated nonabelian nilpotent group admitting a full rank presentation of deficiency at least $2$ (i.e.\ there are at least two more generators than relations). Then the ring of integers $\mathcalbb{Z}$ is e-interpretable in $G$, and, in particular, the Diophantine problem of $G$ is undecidable.

\epsilonnd{thm}

Next we recall the definition of (finite) verbal width. This notion  is conveniently related to definability by equations, as we see in  Proposition \rightarrowef{p: interp_verbal_elliptic}. 

Let $w=w(x_1, \dots, x_m)$ be a word on an alphabet of variables and its inverses $\{x_1, \dots, x_m\}^{\phim 1}$. The \epsilonmph{$w$-verbal subgroup} of a group $G$ is defined as $w(G) = \lambdaangle w(g_1,\lambdadots,g_m)\mathcalid g_i\inftyn G \rightarrowangle$, and  $G$ is said to have \epsilonmph{finite $w$-width} if there exists an integer $n$, such that every  $g \inftyn w(G)$ can be expressed as a product of at most $n$ elements of the form $w(g_1,\lambdadots,g_m)^{\phim 1}$
. Hence, $w(G)$ is e-definable  in $G$ through the equation

$
x=\phirod_{i=1}^n w(y_{i1}, \dots, y_{im}) w(z_{i1}, \dots, z_{im})^{-1}
$
on variables $x$ and $\{y_{ij}, z_{ij} \mathcalid 1\lambdaeq i\lambdaeq n, \ 1\lambdaeq j \lambdaeq m\}$. 

\baregin{prop}\lambdaabel{p: interp_verbal_elliptic}
Let $G$ be a group and let $H$ be a  normal verbal subgroup of $G$ with finite verbal width. Then the quotient $G/H$ is e-interpretable in $G$.
\epsilonnd{prop}
\baregin{proof} 
By the argument above the subgroup $H$ is e-definable in $G$. Now the result follows from Proposition \rightarrowef{extra_prop1}.

\epsilonnd{proof}

\baregin{proof}[Proof of Theorem \rightarrowef{t: Diophantine_Problem_full_rank}]
Let $G=\lambdaangle A\mathcalid R \rightarrowangle_{\mathcalc{M}}$ be a full rank presentation of a metabelian group $G$. To prove 1) note first that since $\gammaamma_3(G) \gammaeq [G',G']$  the 2-nilpotent quotient  $G/\gammaamma_3(G)$ admits a  presentation $\lambdaangle A\mathcalid R\rightarrowangle_{\mathcalc{N}_2}$ in  the variety $\mathcalc{N}_2$ of nilpotent groups of class $\lambdaeq 2$. In particular, the group $G/\gammaamma_3(G)$ has a  full-rank presentation of deficiency at least 2.  By Theorem \rightarrowef{t: Dioph_full_rank_nilpotent}, the ring $\mathcalbb{Z}$ is e-interpretable in $G/\gammaamma_3(G)$.   It is known that in a finitely generated metabelian group any verbal subgroup has finite width \circite{Segal10}, in particular, the subgroup $\gammaamma_3(G)$ has finite width in $G$.  Hence by Proposition \rightarrowef{p: interp_verbal_elliptic}  the group $G/\gammaamma_3(G)$ is e-interpretable in $G$. 
It follows from transitivity of e-interpretations that $\mathcalbb{Z}$ is e-interpretable in $G$, so the Diophantine problem in $G$ is undecidable. 

To prove the second statement of the theorem observe that if $|R| \gammaeq |A|$ then  by Theorem \rightarrowef{t: main_structure_theorem} the group $G$ is virtually abelian. Hence the Diophantine problem in $G$ is decidable (see  \circite{Ershov}).  
\epsilonnd{proof}

\sigmaection{Random metabelian groups}
\lambdaabel{se:random}

In this section we study random metabelian groups in the   few-relators model.
More precisely, we consider group presentations 

\baregin{equation}\lambdaabel{e: main_presentation2}

G=\lambdaangle a_1, \dots, a_n \mathcalid r_1, \dots, r_m\rightarrowangle_{\mathcalathcal{M}} = \lambdaangle A \mathcalid R \rightarrowangle_{\mathcalc{M}}

\epsilonnd{equation}

in the variety of metabelian groups $\mathcalc{M}$, where the set of generators $A = \{a_1, \lambdadots, a_n\}$ is fixed, the number of relations $m$ is also fixed,   and $R$ is a set of $m$ words of length $\epsilonll$ in the alphabet $A^{\phim 1}$ chosen randomly and uniformly, as explained in Section \rightarrowef{s: few_relators_model}. We then study the asymptotic properties of $G$ as $\epsilonll$ tends to infinity. 

As we mentioned in the introduction the key observation here is that due to Theorem \rightarrowef{t: random_walks}  a finite presentation in the variety of all groups (hence, any variety) has full rank asymptotically almost surely.   

\baregin{thm}
 Let $n, m\inftyn \mathcalbb{N}$, and let $G$ be a finitely generated metabelian group given by a presentation $\lambdaangle A\mathcalid R\rightarrowangle_{\mathcalc{M}}=\lambdaangle a_1, \dots, a_n \mathcalid r_1, \dots, r_m \rightarrowangle_{\mathcalc{M}}$, where all relators $r_i$ have length $\epsilonll$. Then  the following holds asymptotically almost surely  as $\epsilonll \to \inftynfty$: There exist two finitely generated subgroups $H$ and $K$ of $G$ such that:
	\baregin{itemize}
	    \inftytem  [1.] $H$ is a free metabelian group of rank  $\mathcalax(|A| -|R|,0)$,
	    \inftytem [2.]  $K$ is a virtually abelian group with  $|R|$ generators, and its normal closure $L = K^G$ in $G$ is again virtually abelian;
	    \inftytem [3.] $G =  \lambdaangle H, K \rightarrowangle = LH$. 
	  	\epsilonnd{itemize}
	 Moreover, in this case there is an algorithm that given a presentation $G=\lambdaangle A\mathcalid R\rightarrowangle_\mathcalc{M}$ finds a free basis for  the subgroup $H$ and a  generating set in $|R|$ generators for the subgroup $K$. 
\epsilonnd{thm}
\baregin{proof}
It follows from Theorems \rightarrowef{t: random_walks}  and \rightarrowef{t: main_structure_theorem}.
\epsilonnd{proof}

\baregin{thm}
Let $n, m\inftyn \mathcalbb{N}$, and let $G$ be a finitely generated metabelian group given by a presentation $\lambdaangle A\mathcalid R\rightarrowangle_{\mathcalc{M}}=\lambdaangle a_1, \dots, a_n \mathcalid r_1, \dots, r_m \rightarrowangle_{\mathcalc{M}}$, where all relators $r_i$ have length $\epsilonll$. Then  the following hold asymptotically almost surely  as $\epsilonll \to \inftynfty$: 
	\baregin{enumerate}
	    \inftytem If $|R| \lambdaeq |A|-2$ then the ring of integers $\mathcalbb{Z}$ is interpretable in $G$ by systems of equations, and the Diophantine problem in $G$ is undecidable.
	    \inftytem If $|R| \gammaeq |A|$ then the Diophantine problem of $G$ is decidable (in fact, the first-order theory of $G$ is decidable).
	\epsilonnd{enumerate}
\epsilonnd{thm}
\baregin{proof}
It follows from  Theorems \rightarrowef{t: random_walks}  and \rightarrowef{t: Diophantine_Problem_full_rank}.
\epsilonnd{proof}

\baregin{thm}
Let $n, m\inftyn \mathcalbb{N}$, and let $G$ be a finitely generated metabelian group given by a presentation $\lambdaangle A\mathcalid R\rightarrowangle_{\mathcalc{M}}=\lambdaangle a_1, \dots, a_n \mathcalid r_1, \dots, r_m \rightarrowangle_{\mathcalc{M}}$, where all relators $r_i$ have length $\epsilonll$. Assume $n\gammaeq m-1$. Then  the following holds asymptotically almost surely  as $\epsilonll \to \inftynfty$:    in any direct decomposition of $G$ all, but one, direct factors are virtually abelian. 
\epsilonnd{thm}
\baregin{proof}
It follows from  Theorems \rightarrowef{t: random_walks}  and \rightarrowef{t: Full-rank_direct_decomposition}.
\epsilonnd{proof} 

\sigmaection{Acknowledgements}

This work was supported by the Mathematical Center in Akademgorodok.

Additionally, the first named author was supported by the ERC grant PCG-336983. The first and second named authors were supported by the Basque Government  grant IT974-16, and by the Ministry of Economy, Industry and Competitiveness of the Spanish Government Grant MTM2017-86802-P. 
 
 
\baribliography{bib}

\epsilonnd{document}