# Complexity of Membership-Testing for finite abelian groups

Consider the following abelian-subgroup membership-testing problem.

Inputs:

1. A finite abelian group $G=\mathbb{Z}_{d_1}\times\mathbb{Z}_{d_1}\ldots\times\mathbb{Z}_{d_m}$ with arbitrary-large $d_i$.

2. A generating-set $\lbrace h_1,\ldots,h_n\rbrace$ of a subgroup $H\subset G$.

3. An element $b\in G$.

Output: 'yes' if $b\in H$ and 'no' elsewhere'.

Question: Can this problem be solved efficiently in a classical computer? I consider an algorithm efficient if it uses $O(\text{polylog}|G|)$ time and memory resources in the usual sense of classical Turing machines. Notice that we can assume $n= O(\log|G|)$ for any subgroup $H$. The input-size of this problem is $\lceil \log|G|\rceil$.

A bit of motivation. Intuitively it looks like the problem can be tackled with algorithms to solve linear systems of congruences or linear diophantine equations (read below). However, it seems that there are different notions of computational efficiency used in the context of computations with integers, such as: strongly versus weakly polynomial time, algebraic versus bit complexity. I am not an expert on these definitions and I can not find a reference that clearly settles down this question.

Update: the answer to the problem is "yes".

• In a late answer, I proposed a method based on Smith normal forms which is efficient for any group with the prescribed form.

• An answer by Blondin shows that in the particular case where all $d_i$ are of the form $d_i= N_i^{e_i}$ and $N_i, e_i$ are "tiny integers" then the problem belongs to $\text{NC}^3\subset \text{P}$. Tiny integers are exponentially small with the input size: $O(\log\log|A|)$.

In my answer I used "orthogonal subgroups" to solve this problem, but I believe this is not necessary. I will try to provide a more direct answer in the future based a row Echelon forms method I am reading.

## Some possible approaches

The problem is closely related to solving linear system of congruences and/or linear diophantine equations. I briefly summarise these connection for the sake of completion.

Take $A$ to be the matrix whose columns are the elements of the generating set $\lbrace h_1, \ldots, h_n \rbrace$. The following system of equations

$$Ax^{T}= \begin{pmatrix} h_1(1) & h_2(1) & \ldots & h_n(1)\\ h_1(2) & h_2(2) & \ldots & h_n(2)\\ \vdots & \vdots & \cdots & \vdots\\ h_1(m) & h_2(m) & \ldots & h_n(m) \end{pmatrix} \begin{pmatrix} x(1)\\ x(2)\\ \vdots\\ x(n) \end{pmatrix} = \begin{pmatrix} b(1) \\ b(2) \\ \vdots\\ b(m) \end{pmatrix} \begin{matrix} \mod d_1\\ \mod d_2\\ \vdots\\ \mod d_m \end{matrix}$$

has a solution if and only if $b\in H$.

If all cyclic factors have the same dimension $d=d_i$ there is an algorithm based on Smith normal forms that solves the problem in polynomial time. In this case, an efficient algorithm from  finds the Smith normal form of $A$: it returns a diagonal matrix $D$ and two invertible matrices $U$ and $V$ such that $D=UAV$. This reduced the problem to solving the equivalent system system $DY=Ub \mod d$ with $D$ diagonal. We can decide efficiently if the system has a solution using the Euclidean algorithm.

The above example suggest that the problem can be solved efficiently using similar techniques in the general case. We can try to solve the system doing modular operations, or by turning the system into a larger system of linear diophantine equations. Some possible techniques to approach the problem that I can think of are:

1. Computing the Smith normal forms of $A$.
2. Computing the row Echelon form of $A$.
3. Integer Gaussian elimination.
• simultaneously crossposted on MO: mathoverflow.net/questions/81300/… Nov 19, 2011 at 7:09
• It appears that you have crossposted this question simultaneously. While we don't mind a question being reposted, our site policy is to permit a repost only after sufficient time has passed and you did not obtain the desired answer elsewhere, because simultaneous crossposting duplicates effort and fractures discussion. You may flag this question for closing now, and then reflag it for opening if necessary after summarizing relevant discussions from other sites. Nov 19, 2011 at 7:10
• Closed at request of original poster (due to duplication on MO). Nov 19, 2011 at 16:39
• I posted an answer before the post was closed. In my opinion, the question is better suited here than on mathoverflow since it was extensively studied in the complexity theory literature. Nov 19, 2011 at 16:43
• reopened at OP request; focus on complexity makes it the right fit for here. Nov 19, 2011 at 21:51

Verifying whether $b \in \langle h_1, \ldots, h_n\rangle$ (where $h_i$ are vectors according to the OP's comments) is equivalent to verifying whether there is a solution to this system: $$\begin{pmatrix} h_{1}(1) & \cdots & h_{n}(1) & d_1^{e_1} & 0 & \cdots & 0 \\\\ \vdots & \ddots & \vdots & \vdots & \vdots & \vdots & \vdots \\\\ h_{1}(m) & \cdots & h_{n}(m) & 0 & 0 & \cdots & d_m^{e_N} \end{pmatrix} \begin{pmatrix} x(1) \\\\ \vdots \\\\ x(n) \\\\ y(1) \\\\ \vdots \\\\ y(m) \end{pmatrix} \equiv \begin{pmatrix} b(1) \\\\ \vdots \\\\ b(m) \end{pmatrix}$$

In your case $e_1, \ldots, e_N$ are tiny numbers (ie. their value is logartihmic in the input size). Unfortunately, it doesn't seem like we can assume that $d_1, \ldots, d_n$ are tiny.

If they are, then you can find a solution to the system in $\text{NC}^3$ from a result of McKenzie & Cook . This paper shows that solving linear congruences modulo an integer with tiny factors (LCON) is in $\text{NC}^3$. Moreover, this problem is $\text{NC}^1$-equivalent to the abelian permutation group membership problem (AGM). McKenzie's doctoral thesis is fully devoted to those problems . More recently, those problems were considered by Arvind & Vijayaraghavan .

 Pierre McKenzie & Stephen A. Cook. The parallel complexity of Abelian permutation group problems. 1987.

 Pierre McKenzie. Parallel complexity and permutation groups. 1984.

 V. Arvind & T. C. Vijayaraghavan. Classifying Problems on Linear Congruences and Abelian Permutation Groups Using Logspace Counting Classes. 2010.

• Thanks, unfortunatley I have no access to this papers until Monday. It surprises me that this works for any abelian group. For $Z_N^*$, which is abelian, determining wether $b$ belongs to $\langle a \rangle$ involves deciding wether $b=a^i\mod \varphi(N)$ has a solution. I see two problems here: 1) Classically it is hard to compute the Euler totient function 2) Its the decision version of a discrete logarithm. The problem reduces to solving modular equations if the cyclic decomposition is given. How do you go around this problem? Am I missing something important here? Nov 19, 2011 at 17:44
• Actually, it's for any abelian permutation group. Nov 19, 2011 at 18:29
• I will take a look at these papers and try to organise everything a bit. Thanks. Nov 19, 2011 at 19:45
• Could you provide more details on the encoding of the input? This way, I might be able to improve my answer. Nov 20, 2011 at 21:19
• The group decomposition $A=\mathbb{Z}_{d_1}\times\mathbb{Z}_{d_1}\ldots\times\mathbb{Z}_{d_N}$ as input (these would be a string with several numbers and the length I guess). Then, each element of the group is of the form $(g_1,\ldots,g_n)$ and can be represented by a tuple of numbers. To store it you need $n:= \lceil log_2 |A|\rceil$ bits. Does this answer it? Nov 20, 2011 at 23:33

After some time, I managed to find a perhaps not-optimal but simple algorithm that proves that the complexity of the problem is polynomial.

Algorithm

(a) Compute a generating-set of the orthogonal subgroup $H^{\perp}$ of $H$.

(b) Check whether or not the element $b$ is orthogonal to $H^{\perp}$.

There are efficient clasical algorithms for problems (a) and (b) (see analysis below). This gives an efficient membership-test since an element $b$ is orthogonal to $H^\perp$ if and only if $h\in H$.

Analysis

The orthogonal subgroup $H^{\perp}$ is defined via the character group of $G$ as: $$H^{\perp}:= \{g\in G : \chi_g(h)=1\quad \forall h\in H \}$$ Main properties:

1. $H^{\perp}$ is a subgroup of $G$.
2. $H^{\perp^\perp}=H$

Algorithm for (a):

I follow an algorithm from  with minor variations. $g$ belongs to $H^{\perp}$ if and only if $\chi_{g}(h)=1$ for all $h\in H$, but, by linearity it is enough to show $\chi_{b}(h_i)=1$ for each generator of $H$. Expanding the character in terms of exponentials (here I implicitly use the cyclic factor decomposition) this condition is equivalent to \begin{eqnarray} \exp \left\lbrace 2\pi i \left( \frac{g(1)h_{i}(1)}{d_1}+\ldots + \frac{g(m) h_{i}(m)}{d_m} \right) \right\rbrace=1 \end{eqnarray} To solve these equations, compute $M:= \text{lcm}(N_1,\ldots,N_d)$ using the Euclidean algorithm and the numbers $\alpha_i:=M/d_i$. We can re-write the conditions above for every $i$ as a system of linear modular equations.

$$\begin{pmatrix} \alpha_1 h_1(1) & \alpha_2 h_1(2) & \ldots & \alpha_m h_1(m)\\ \alpha_1 h_2(1) & \alpha_2 h_2(2) & \ldots & \alpha_m h_2(m)\\ \vdots & \vdots & \cdots & \vdots\\ \alpha_1 h_n(1) & \alpha_2 h_n(2) & \ldots & \alpha_m h_n(m) \end{pmatrix} \begin{pmatrix} g(1)\\ g(2)\\ \vdots\\ g(n) \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ \vdots\\ 0 \end{pmatrix} \begin{matrix} \mod M\\ \mod M\\ \vdots\\ \mod M \end{matrix}$$ As it is proven in 1, if we sample $t+\lceil\log|G|\rceil$ random solutions of this system of equations we will obtain a generating set of $H^{\perp}$ with probability exponentially close to one $p\geq 1 -1/2^{t}$. Now to sample from this equations write them in matrix form $AX=0 \pmod M$. Here $A$ is a rectangular matrix over the integers modulo $M$ for which an algorithm given in 2 allows to efficiently compute its Smith normal decomposition. The algorithm returns a diagonal matrix $D$ and two invertible matrices $U$, $V$ such that $D=UAV$. Using this formula the system of equations can be written as $DY=0 \pmod M$ with $X=VY$. Now it is possible to randomly compute solutions of $DY=0\pmod M$ using Euclid's algorithm, since this is a system of equations of the form $d_i y_i =0 \pmod M$. Finally, computing $X=VY$ one obtains a random element of the orthogonal group $H^{\perp}$ as desired.

Algorithm for (b):

Since we already know how to compute a generating-set of $H^{\perp}$, it is easy to check if a given element $b$ belongs to $H$. First compute a generating-set $\langle g_1,\ldots, g_s \rangle$ of $H^{\perp}$. Then, by definition, $b$ belongs to $H$ if and only if $\chi_{b}(g_i)=1$ for all generators of $H^{\perp}$. Since there are a O(polylog($|G|$)) number of them and this can be done efficiently using modular arithmetic we are done.

• it's fine to add your own answer if you've made discoveries in the mean time. However, it seems like you need to do some more investigation (based on your comment) before you decide which answer to accept. Nov 20, 2011 at 6:02
• Thanks. I would like to keep the discussion further to see if we put everything into one picture. Also, I think there could be a more practical algorithm that could pop-up. Nov 20, 2011 at 14:10