determining if a matrix of linear forms represents a non-degenerate matrix - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-23T19:30:45Z http://mathoverflow.net/feeds/question/82804 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/82804/determining-if-a-matrix-of-linear-forms-represents-a-non-degenerate-matrix determining if a matrix of linear forms represents a non-degenerate matrix Łukasz Grabowski 2011-12-06T17:40:24Z 2011-12-07T18:17:11Z <p>Let $k$ be a field with $p$ elements. Consider the following computational problem</p> <blockquote> <p><em>Input</em>: a natural number $n$, $n^2$ linear forms $M_{ij}$, $i,j=1,\ldots n$ in $n^2$ variables $X_{11}, \ldots X_{nn}$. </p> <p><em>Problem:</em> Is there an assignement of values to the variables $X_{ij}$ so that the matrix $M_{ij}$ is invertible?</p> </blockquote> <p>${}$</p> <blockquote> <p><strong>Question:</strong> What is known about algorithms for this problem?</p> </blockquote> <p>As usually, let's assume the addition and multiplication in the field to have computational cost $1$.</p> <p>The naive algorithm of checking each assignment of the variables $X_{ij}$ takes time bounded by a polynomial in $p^{n^2}$. I'd be interested to know if there is an improvement to polynomial in $p^n$ (or better). </p> <p>EDIT: Below Emil Jeřábek shows that the problem is NP-complete, but the reduction from 3-SAT is done in such a way that it still could be that there is an improvement to $p^n$ without proving anything unexpected about 3-SAT.</p> <p>EDIT: The special case when each $M_{ij}$ is equal either to $0$ or to $X_{ij}$ is solved below by Emil Jeřábek.</p> <p>EDIT: I've decided to ask a <a href="http://mathoverflow.net/questions/82892/3-sat-and-linear-forms-representing-a-non-degenerate-matrix" rel="nofollow">more specific follow-up question</a>.</p> http://mathoverflow.net/questions/82804/determining-if-a-matrix-of-linear-forms-represents-a-non-degenerate-matrix/82808#82808 Answer by Emil Jeřábek for determining if a matrix of linear forms represents a non-degenerate matrix Emil Jeřábek 2011-12-06T18:30:40Z 2011-12-07T13:44:43Z <p>The determinant of $M$, considered as a matrix over the polynomial ring $R=k[X_{11},\dots,X_{nn}]$, is a polynomial $f\in R$, and your problem is to determine whether $f$ defines the constant $0$ function over $k$.</p> <p>There are several division-free algorithms for computation of determinant in any commutative ring using polynomially many ring operations. In principle, you can use such an algorithm to compute $f$, but this may result in a long expression, since $f$ may have exponentially many terms. It is better to combine this with a polynomial identity testing algorithm: since $f$ has degree $n$, the Schwartz–Zippel lemma tells you that $f(a_{11},\dots,a_{nn})\ne0$ for randomly chosen $a_{ij}\in k$ with probability at least $1-n/p$, as long as $f\ne0$ and $p>n$. Thus, if (say) $p>2n$, you don’t actually have to evaluate $f$, you have a simple probabilistic polynomial-time algorithm: choose random assignment to your variables, and test whether the resulting matrix is nonsingular.</p> <p>In the special case where each $M_{ij}$ is either $0$ or $X_{ij}$, things are much simpler: it is easy to see that there is an assignment making the matrix nonsingular if and only if there is a permutation $\pi$ such that $M_{i\pi(i)}\ne0$ for each $i$, in other words, if and only if the bipartite graph whose biadjacency matrix is defined from $M$ by replacing every $X_{ij}$ with $1$ has a perfect matching. There are various efficient algorithm for finding perfect matchings and/or checking their existence, see e.g. <a href="http://en.wikipedia.org/wiki/Perfect_matching#Algorithms_and_computational_complexity" rel="nofollow">http://en.wikipedia.org/wiki/Perfect_matching#Algorithms_and_computational_complexity</a> .</p> <p>EDIT: For a fixed $p$, the full problem is NP-complete. The reduction is simplest for $\mathbb F_2$. Assume we are given a $3$-CNF $C(x_1,\dots,x_n)=\bigwedge_{i&lt; m}\bigvee_{j&lt; 3}l_{ij}$, where each $l_{ij}$ is either some $x_k$ or $\neg x_k$. We identify $\neg x_k$ with the linear polynomial $1+x_k$. Then $C$ is satisfiable if and only if the polynomial $f(x_1,\dots,x_n)=\prod_i(1+\prod_jl_{ij})$ assumes a nonzero value for some assignment over $\mathbb F_2$. Let $M$ be the block diagonal matrix consisting of $m$ blocks $M_i$, where $$M_i=\begin{pmatrix}1&amp;l_{i0}&amp;0\\0&amp;1&amp;l_{i1}\\l_{i2}&amp;0&amp;1\end{pmatrix}.$$ Then $\det(M)=f$, thus there is an assignment in $\mathbb F_2$ making $M$ invertible iff $C$ is satisfiable. One can get rid of the constants $1$ in the matrix as follows: we include in $M$ the identity matrix as yet another block, and then we replace $1$ with a new variable $x_0$ everywhere (i.e., in the $1$ entries as well as in the entries of the form $1+x_k$). Any assignment making the new matrix invertible must have $x_0=1$, and then it works as before. The new matrix has only entries of the form $0$, $x_k$, $x_0+x_k$.</p>