Manuscript Offprint
arXiv:2609.10496Testing the Binary Rank with Polynomial Query Complexity
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We provide an adaptive two-sided error testing algorithm for the binary rank of a 0, 1 matrix with query complexity , where is the tested binary rank bound and is the distance parameter. This answers an open question posed by Parnas, Ron and Shraibman [11], who asked whether the binary rank can be tested with query complexity polynomial in and .
Furthermore, our testing algorithm can be used to find an approximate binary decomposition of with an additional queries. That is, under the promise that the binary rank of is at most , we show how to find, with probability at least 5/6, two 0,1 matrices such that is a 0,1 matrix which differs from on at most an fraction of its entries.
Key Words— Real rank, Boolean rank, Binary rank.
1 Introduction
Rank functions have been used over the years to capture the complexity of an object. The most notable is the usual rank defined over the reals, which originated from the study of linear equations, but since then found many more applications. Whereas the real rank of a matrix is usually defined as the maximal number of independent rows or columns of , we use the following equivalent definition.
The real rank of a matrix of size , denoted here by , is the minimal integer for which there exist real matrices and of size and respectively, such that , where the operations are over .
Other rank functions considered over the years include the Boolean, binary and non-negative rank functions. Here we consider the binary rank defined as follows.
The binary rank of a 0,1 matrix of size , denoted by , is the minimal for which there exist 0,1 matrices and of size and respectively, such that , where the operations are over the integers.
*School of Computer Science, The Academic College of Tel Aviv-Yaffo, Tel Aviv 61083, Israel. Email address: michalp@mta.ac.il
The product is called a decomposition of size d of M. Note that by definition, for any 0,1 matrix M.
The real rank is defined over a field and can be computed in polynomial time. In contrast, the other rank functions mentioned above are defined over a semi-group and are NP-hard to compute (see Orlin [9], Jiang and Ravikumar [6], Vavasis [14] and Shitov [13]). See also a recent comprehensive survey about these rank functions by Parnas [10].
This motivates to find relaxations of the exact hard decision problems. One such relaxation is that of Property testing, a field which originated in a paper of Rubinfeld and Sudan [12] who introduced the notion of testing functions, and a paper by Goldreich, Goldwasser and Ron [4] who initiated the study of testing graph properties.
The idea proposed in [12, 4] was to relax the classic notion of decision algorithms and define testing algorithms which should, with high constant probability, accept an object that has the given property studied, and reject an object that is -far from having the property, that is, at least an -fraction of the object should be modified so that it has the tested property. For example, a testing algorithm for the rank property should decide if a matrix has rank at most d or is -far from any matrix with rank at most d, for a given rank function.
This relaxation allows testing algorithms to be very efficient in comparison with regular decision algorithms, where in many cases their query complexity is sub-linear and even independent of the input size, but depends on the error parameter and maybe some other parameters of the problem.
In our setting, if is the entry in the 'th row and 'th column of , then the distance between two 0,1 matrices of size is defined as:
A matrix is -far from binary rank at most if for every binary matrix with . Thus, in the context of testing the rank of a matrix, the requirement from a testing algorithm is defined formally as follows:
Definition 1. A testing algorithm for a given rank function is given query access to an matrix M, an error parameter and a parameter d. The algorithm should accept with probability at least 2/3 if M has rank at most d, and should reject with probability at least 2/3 if M is -far from every matrix of rank at most d.
The query complexity of the algorithm is the number of entries of M which it queries. The algorithm is non-adaptive if it determines its queries based only on the input and the random coin tosses, independently of the answers provided to previous queries. Otherwise, the algorithm is adaptive.
Although the real rank can be computed in polynomial time, Krauthgamer and Sasson [7] showed that there exists a non-adaptive property testing algorithm for the real rank with query complexity . Li, Wang and Woodruff [8] gave an adaptive algorithm for the real rank with a reduced query complexity of . Balcan, Woodruff and Zhang [1] gave a non-adaptive testing algorithm for the real rank with query complexity .
Parnas, Ron and Shraibman [11] developed algorithms for testing the binary and the Boolean rank. They give a non-adaptive testing algorithm for the Boolean rank with query complexity
. For the binary rank they provide a non-adaptive algorithm with query complexity , and an adaptive algorithm with query complexity . Bshouty [2] subsequently gave a one-sided adaptive tester for the binary rank with query complexity , improving the dependence on in [11] by a factor of , but still leaving an exponential dependence on . He also noted that a small adjustment to the analysis given by [11] for the Boolean rank results in an improved query complexity of . Note that the query complexity of all the above testing algorithms is independent of the size of the matrix .
It was asked in [11] if there exists an algorithm for the binary rank with polynomial query complexity in and . We answer this question in the affirmative and prove the following:
Theorem 2. For every integer and , there is an adaptive two-sided error testing algorithm for the binary rank with query complexity .
Using this result we also provide an approximate decomposition of the matrix as follows.
Theorem 3. Let and , and let be a matrix of size with . There is an adaptive randomized algorithm which uses queries, and with probability at least outputs matrices and of size and , respectively, such that is a matrix with .
We note that although the query complexity of both algorithms is polynomial in and the running time of both algorithms is exponential in .
-
Find an approximate real-rank core. The algorithm maintains row and column sets of the same size , such that at each step the current core has full real rank , where initially and the core is empty. In each iteration the algorithm samples a pair of a row and a column of , and extends the current core with this pair only if the real rank of the extended core increases from to . If the core reaches size , then the binary rank is larger than and the tester rejects. Otherwise, with high probability the resulting core determines the real-linear behavior of almost all entries of .
-
Enumerate binary decompositions of the core. For the final core , the algorithm considers every binary decomposition of size of , where and are of size and , respectively. Each such choice of represents one possible way in which the core could occur inside a binary decomposition of the whole matrix . For every row and column of , we then ask which 0,1 rows or columns can extend and consistently with the entries already seen on the core as described next.
-
Determine whether one core decomposition can be extended to most of the matrix. For each such possible decomposition , the testing algorithm considers the different ways in which rows and columns outside the core could extend this decomposition. There are two requirements: the chosen extensions must be consistent with the real-linear predictions forced by the core, and their pairwise products must be binary so that the resulting product matrix is a 0,1 matrix. The main structural part of the proof shows that both requirements can be encoded by a finite family of compact descriptions depending only on , even though there may be exponentially many possible binary extensions individually. The concrete linear-algebraic and combinatorial objects used for this encoding are introduced in Section 4.
-
Sample rows and columns to test these possibilities. After constructing the core, the testing algorithm samples only polynomially many rows and columns of and checks whether one of the possible compact descriptions is consistent with almost all the additional sampled rows and columns. If has binary rank at most , then a binary decomposition of , together with the approximate real-linear description supplied by the core, produces a compact description that is consistent with all but a small fraction of the rows and columns of , and hence with most sampled rows and columns with high probability. If the core happens to have real rank equal to , then its predictions are exact and this compact description is in fact consistent with every row and column. If is -far from binary rank at most , then every possible description fails on a noticeable fraction of the rows or columns of , and the algorithm can reject.
2 Preliminaries
For a positive integer , let and let denote the identity matrix.
If is an matrix and , then denotes the sub-matrix of whose rows are indexed by and whose columns are indexed by . If and , then denotes the row vector obtained by restricting row of to the columns in , while denotes the column vector obtained by restricting column to the rows in .
Let be a binary decomposition of a 0,1 matrix . Denote by the th row of and by the sub-matrix of consisting of the rows indexed by . Similarly, denotes the th column of , and denotes the sub-matrix of consisting of the columns indexed by . Thus, if , then . With a slight abuse of notation we write the product of a row vector and a column vector simply as without always specifying that is a column vector. Thus, this product can also be understood as the inner product of both vectors, and if is a row of and is a column of in a binary decomposition then .
The support of a vector is the set of coordinates in which it has value 1, and is defined as:
If is a linear subspace of , then denotes its orthogonal complement with respect to the standard inner product. All matrix products are over the reals unless explicitly stated otherwise, and products of matrices and vectors are taken over the real numbers using ordinary arithmetic.
It will be useful to consider also the equivalent formulation of the binary rank. The binary rank is equal to the minimum number of monochromatic rectangles required to partition all 1-entries of (see Gregory, Pullman, Jones and Lundgren [5]).
3 Finding a small full real rank core
The first phase of our testing algorithm is essentially the adaptive real-rank tester of Li, Wang and Woodruff [8]. The non-adaptive tester of Krauthgamer and Sasson [7] samples a small square sub-matrix of and tests whether its real rank is at most . Such a sampled sub-matrix need not have full real rank, whereas maintaining a full real rank sub-matrix of is essential for the second phase of our algorithm. Li, Wang and Woodruff [8] observed that one can instead maintain a growing square sub-matrix of full real rank by adding a new row and column to this sub-matrix only when the real rank increases by 1.
We use exactly this approach. Thus, the first stage of our algorithm produces a sub-matrix of of size which has real rank . We call such a sub-matrix a core of . The procedure starts with an empty core with , samples a row-column pair and queries the entries needed to determine the real rank of . If this enlarged sub-matrix has real rank , the sampled row and column are added to the current core. Hence, at every iteration the maintained core remains square and has full real rank equal to its size.
For completeness, we state this procedure and the elementary claims needed for its analysis in our notation, using the error parameters which will be needed for the final testing algorithm.
Algorithm 1: Find core for given .
-
Set and and initialize an empty core with and .
-
While :
(a) Independently sample uniformly random pairs .
(b) For :
-
Query the entries of that have not already been queried.
-
If , then set and and go back to the while loop.
(c) If none of the sampled pairs increases the real rank of the current core, exit the while loop and return the core found.
- Return the core . In this case .
Let be the resulting core returned by the algorithm, where and , with , and . For , this means that the square matrix is nonsingular and is defined. Note that at this stage the subsets are fixed.
Since has full real rank , the rows of form a basis of . Hence, for every row of , the restricted row , can be written uniquely as a linear combination of the rows of . That is, if is the row vector of coefficients in this linear combination, then . Since is nonsingular, the coefficient vector is uniquely determined and is given by . Thus, gives the coefficients when we express row of restricted to the columns of the core, as a linear combination of the core rows.
This discussion allows us to measure how well the resulting core describes the rest of the matrix , and this allows also to prove how well the real rank tester works. For , we say that the core predicts that should be
For the empty core where , define . Note that the product is a scalar.
The word “predicts” has a precise linear-algebraic meaning. For fixed and , the value is the unique value of the 'th entry of for which adjoining row and column of to the core does not increase its real rank. Thus, if then the enlarged sub-matrix still has real rank , whereas if , then its real rank is . In particular, if every entry of agrees with the value predicted by the core, then has real rank exactly .
Define the prediction-error density of the core by
where and are independent and uniform.
The following lemma connects this quantity to Algorithm 1. The matrix whose 'th entry is has real rank exactly . Indeed, every row of is a linear combination of the core rows, so . On the other hand, , and has real rank . Hence, . Moreover, a pair of a row and column of increases the real rank of the core from to exactly when the corresponding prediction is wrong. Consequently, if is -far from real rank at most and , then at least an fraction of the pairs increase the real rank of the current core. Thus, if the current core still gives a poor approximation of the real rank of , repeated sampling quickly finds another pair of a row and column which increase the real rank of the core.
Lemma 4. Let be a core of full real rank . For every pair ,
Consequently, is exactly the probability that a uniformly random pair of a row and column successfully increases the real rank of the core.
Proof: If , then by definition . Since is a 0,1 matrix, if and only if , which is equivalent to the sub-matrix having real rank 1.
Assume now that and consider a pair . First assume that or . Then the core prediction is exact at . Indeed, let be the th row index in . Then is the th row of , and thus, , where is the th standard basis vector. Hence, and therefore .
The case is analogous. Moreover, if or , adjoining and cannot increase the rank beyond , since at least one of the row or column sets is unchanged. Thus, both sides of the claimed equivalence are false in these cases.
It remains to consider and . The enlarged sub-matrix which includes the core and entry has the following block form
Since is nonsingular, the Schur complement formula gives
Here the Schur complement is a matrix, so its determinant is just its single scalar entry. Hence,
Thus, the enlarged matrix has real rank exactly when .
By Lemma 4, for any fixed core, a new sampled pair increases the real rank with probability . Thus, if no successful augmentation of the core is found in some iteration and Algorithm 1 stops, we can conclude with high probability that the final core predicts all but an -fraction of the entries of .
Lemma 5. With probability at least 5/6, Algorithm 1 either:
-
finds a core of full real rank or
-
stops with a core satisfying .
Equivalently, the probability that Algorithm 1 stops with a core with is at most 1/6.
Proof: Fix any core that is encountered by Algorithm 1, and condition on the entire history leading to this core. If then by Lemma 4, a new random pair increases the real rank of the current core with probability greater than . Hence, the conditional probability that none of the new pairs increases the real rank is at most:
where the last inequality holds for as set in Algorithm 1. The search is performed only for core sizes , so there are at most iterations at which an erroneous stopping event can occur. Applying a union bound over these iterations gives that with probability at most Algorithm 1 stops with a core whose prediction-error density exceeds . This is exactly the complement of the event stated in the lemma.
For real rank testing, a core that makes only a small fraction of prediction errors is already enough, since the predicted matrix itself is close to and has real rank . For our binary rank testing algorithm we need a much smaller prediction error threshold as set in Algorithm 1, since the second phase of our testing algorithm needs a more accurate core.
It is useful to note the special case in which the size of the final core is equal to the actual real rank of . If , then the core predicts every entry of exactly, and hence . Indeed, the rows of the core form a basis for the row space of , so the coefficients express each row of as a linear combination of the rows of the core. Hence, for every :
In such a case our binary testing algorithm will in fact have only a one sided error probability. The possibility of an error on a YES instance of the binary testing algorithm arises because Algorithm 1 is allowed to stop earlier with a core whose prediction error density is small rather than zero.
We next describe how the core found by Algorithm 1 can be used to test the binary rank of .
4 Using the core to test the binary rank
The first phase of the testing algorithm for the binary rank runs Algorithm 1 and finds a core of size and full real rank . If , then and the testing algorithm for the binary rank can reject immediately.
Otherwise, assume that Algorithm 1 stops with a core of full real rank . Note that is the real rank of the core, whereas is the binary-rank bound being tested. The core gives an approximate real-linear description of and the remaining task is to determine whether this description is compatible with some binary decomposition of size of .
4.1 Binary extensions compatible with the core
If , then after padding by zero coordinates if necessary, there is a binary decomposition , where are 0,1 matrices of size and respectively. Restricting this decomposition to the core gives a binary decomposition of the core. Thus, a binary decomposition of size of induces a binary decomposition of , where is of size and of size .
Such a binary decomposition of the core always exists when , independently of whether has binary rank at most . Indeed, for one may take and , so that . For , the empty and matrices give a decomposition of the empty core.
Note that the core itself has a binary decomposition of size , for example, . Nevertheless, a binary decomposition of size of the whole matrix may use more than columns of and rows of on the core, or in the rectangle-partition formulation, such a decomposition of may require more than rectangles to partition the 1 entries of . We, therefore, consider all binary decompositions of size of , rather than only decompositions of size of .
The testing algorithm for the binary rank will enumerate all pairs of 0,1 matrices of size and , respectively, such that . By the above argument this enumeration of the possible binary decompositions of the core is never empty. Note that when , the extra coordinates cannot simply be discarded, since a matrix can have real rank and binary rank strictly larger than .
Fix such a pair . A vector is a possible row extension of for row of , if multiplying with the columns of results in row of restricted to the columns of the core . Such a vector is a possible new row which can extend to . Accordingly, let the following set denote the possible row candidates which can extend and result in the 'th row of restricted to the current columns of the core .
Similarly, a vector is a possible column extension for Y for column j of M if it can extend Y to consistently with the core. Let the following set denote the corresponding column candidates:
See also Figure 1 for an illustration of these concepts.
Figure 1: A binary decomposition of given a fixed core . On the left is the matrix with the top left block equal to the core . One additional row and one additional column of are shown explicitly. The matrices on the right present a possible binary decomposition which can be extended by a row extension and a column extension .
Assume now that for most rows and columns of we can choose binary extensions that agree with the fixed decomposition of the core and are mutually compatible in the following sense. For every chosen row extension and column extension , the product is binary and equals the value predicted by the core. Then these extensions can be used to define a binary matrix of binary rank at most which is close to . The rest of this section develops a compact description of collections of row and column extensions with exactly these compatibility properties.
4.2 Separating the core-determined and residual parts
Fix a binary decomposition of the core. The next lemma shows that once this decomposition is fixed, every product of a row extension and a column extension splits into the core prediction and a residual term living in only real dimensions.
Lemma 6. There exist matrices and such that for every and ,
Proof: We show how to construct U and V. Define a matrix C as follows:
We first show that has real rank exactly . The case of is immediate. Assume that . Since , then . Hence, . Conversely, if , then , and hence
Thus, acts as the identity on . In particular, lies in , and therefore, . Hence, .
Since is an matrix and has real rank , the matrix has real rank exactly . Viewing as a linear map , the rank-nullity theorem gives .
Consequently, . But this means that we can choose a real-rank decomposition of size for as , where and .
Now let and . If , then and , and hence,
Using , we obtain
Thus, as claimed. If , then and , so the same identity holds.
For each fixed core decomposition , we now fix, once and for all, a pair of matrices satisfying Lemma 6. Such a pair can be obtained by a standard real-rank decomposition of the matrix constructed in the proof. All subsequent definitions associated with this pair use this fixed choice of .
For a row extension , we call its row residual vector, and for a column extension , we call its column residual vector.
The above lemma shows that the first term in the expression is completely determined by the entries of row and column on the core, while all dependence on the particular choices of and is confined to the lower-dimensional residual product .
We can now see precisely what remains to be enforced in order for the selected row and column extensions to define a 0, 1 matrix of binary rank at most d which is close to M. For the row and column extensions that agree with the core, we need the following two conditions:
-
The residual product should vanish, that is be 0. Then by Lemma 6, we have . We will enforce this simultaneously for many rows and columns using a linear subspace .
-
The product should belong to . This is a separate combinatorial condition, which we enforce using a graph G whose d vertices correspond to the d columns of X and the d rows of Y.
The next two subsections develop these two ingredients separately.
4.3 Making the residual product vanish
We want the equality to hold simultaneously for many row extensions and many column extensions . A single subspace provides a compact way to enforce all these pairwise zero conditions at once. We seek a linear subspace of , such that most selected row residual vectors lie in , while most selected column residual vectors lie in . By the definition of the orthogonal complement, every vector in is orthogonal to every vector in . Hence, for every such selected row extension and column extension , we automatically have .
Thus, the role of W is to make the residual product vanish simultaneously for all selected row and column pairs. The following lemma is the geometric ingredient used to find such a subspace W.
Lemma 7. Let and be independent random vectors in , with finite supports, and assume that . Then there is a linear subspace of , spanned by at most vectors from the support of , such that
For , let .
Proof: Assume first that and . We construct iteratively by adding vectors from the support of . The idea is to keep enlarging until it contains all but a small fraction of the distribution of . At the same time, we choose each vector that is added to so that it is nonorthogonal to only a small fraction of the distribution of .
To control the tradeoff between these two requirements, fix a parameter . This parameter is only a threshold for the construction: we will stop once . At the end of the proof we will choose so as to balance the error coming from with the error coming from .
Initially set . Assume that has already been constructed. If , we stop and set . Otherwise, let
Thus, is the fraction of the probability mass of that is still outside the current subspace . If is large, then many of the possible values of , in the probabilistic sense, are still not captured by . For every possible value of , define:
Thus, measures how often the fixed vector fails to be orthogonal to a random value of . A small value of means that is orthogonal to most of the distribution of .
We next relate the average value of to the assumption of the lemma. The quantity is a random variable whose value depends on the random choice of . By the law of total probability,
Since and are independent,
Hence,
Thus, although different possible values of may have very different probabilities of being nonorthogonal to , their average nonorthogonality probability is at most .
We now restrict our attention to those possible values of that are still outside . Since , their total contribution to the expectation above is at most . Dividing by their total probability mass gives
where the last inequality uses . Hence, the average value of among the possible values outside is less than . Therefore, at least one such vector, which we denote by , satisfies
Thus, is a vector not yet contained in which is nevertheless orthogonal to all but at most a fraction of the distribution of . We enlarge the subspace by setting
Because , the dimension increases by one. Hence, this process can continue for at most steps. If it has not stopped earlier, then after such steps the subspace is all of , so and the stopping condition must hold. Therefore, the process always stops, and when it stops the resulting subspace satisfies .
Assume that the construction selected the vectors , where . These vectors span . If a vector does not belong to , then it is not orthogonal to , and therefore it must be nonorthogonal to at least one of the selected spanning vectors . By the union bound,
The first estimate controls the fraction of x-mass lying outside W, while the second controls the fraction of y-mass lying outside . Combining them gives
Finally, choose . This makes the two terms on the right-hand side equal, and hence
The construction also shows that W is spanned by at most vectors from the support of x.
It remains to consider the case of . In this case . Since and are independent and have finite supports, every vector in the support of is orthogonal to every vector in the support of . Otherwise, two support vectors and with would occur together with positive probability. Let be the span of the support of . Then
Finally, since is a subspace of , it has a basis of at most vectors, which may be chosen from the support of .
In our application the finite support assumption in Lemma 7 is automatic. The random row and column residual vectors have the form and , where . Hence, each of them can have at most possible values.
Lemma 7 shows that in the YES case, that is, when and the algorithm should accept with high probability, the subspace used with a fixed residual matrix may be chosen to be spanned by at most row residual vectors. To make this dependence explicit, we denote such a subspace by . This motivates restricting attention to subspaces that have such a finite description.
Definition 8. Consider a fixed decomposition of a core with real rank , and let and be the matrices associated with this decomposition as promised by Lemma 6. A linear subspace of is relevant for if it is spanned by at most vectors of the form , where .
The relevant subspaces can be enumerated explicitly and this is what the testing algorithm for the binary rank will do. Specifically, there are only binary vectors , so for the fixed matrix , we can first compute all vectors . We then consider every collection of at most of these vectors and take its real linear span. Every subspace obtained in this way is relevant for
U. Conversely, if is relevant for , then by definition there are vectors , with , such that .
The enumeration considers this particular collection of residual vectors and produces . Hence, every subspace relevant for occurs in the enumeration. Different collections may span the same subspace, but eliminating such repetitions is unnecessary. Thus, we never enumerate arbitrary subspaces of , but enumerate only this finite family.
Lemma 7 guarantees that for a YES instance, a subspace with the required properties is contained in this family. A subspace can be represented simply by the selected vectors that span it. To test if another residual vector belongs to , we check if is a real linear combination of these spanning vectors. To test if belongs to , we check if it is orthogonal to every spanning vector of . Both are ordinary finite-dimensional linear-algebra computations.
4.4 Keeping the products binary
If then the product is equal to the core prediction , but it does not ensure that is a 0,1 value. Since and are 0,1 vectors, is the number of coordinates that belong to both and . Thus, exactly when the row extension and the column extension have at most one common coordinate. The compatibility graph defined next assures this purely combinatorial requirement.
Let be a graph with vertices whose edges are defined as follows. For a family of row extensions , add an edge to when some has a 1 in coordinates and . It follows immediately that the support of every row extension is represented by a clique of .
Now consider a column extension and recall that we want to have . By definition of , if is an edge of , then this edge certifies that there exists a row extension for which both coordinates and are 1. Therefore, a column extension cannot have a 1 in both coordinates and for any edge of . Otherwise, for any row extension which has a 1 in both coordinates and . Thus, the support of every admissible column extension should be an independent set in . Consequently, whenever the support of a row extension defines a clique in and the support of a column extension defines an independent set in then their supports intersect in at most one vertex of and thus, .
Note that we could, of course, have defined so that the columns determine the edges of the graph, and then columns correspond to cliques and rows to independent sets.
The preceding discussion is summarized in the following lemma. Together with Lemma 7, it gives the two pieces of information that a candidate decomposition which defines a matrix which is close to must have: a subspace of the residual space controlling the residual products, and a graph controlling whether the resulting products are binary.
Lemma 9. Let be two sets of vectors for which for every and . Then there is a graph with vertices such that the support of every is a clique of , and the support of every is an independent set of .
Proof: Add an edge to exactly when some has . Then every row support is a clique. If the support of some contained both and for some edge of , then for the corresponding we would have , a contradiction.
The testing algorithm for the binary rank will enumerate also the possible graphs, but this is easy: we consider every simple graph on the vertex set [d]. Such a graph is determined by choosing an arbitrary subset of the possible edges, and hence there are exactly possible graphs.
4.5 Candidates
We now collect the information needed to describe a possible extension of a core decomposition to most of the matrix M. A candidate should be thought of as a potential blueprint for extending the core decomposition to a decomposition of binary matrix with binary rank at most d. The matrices X, Y specify the decomposition on the core. The subspace specifies which row and column extensions can be chosen so that their residual products vanish, and hence, their products agree with the values predicted by the core. Finally, the graph G specifies which such extensions have a binary product. The fraction of rows and columns that fail these conditions will measure how well the candidate approximates M.
Definition 10. A candidate is a quadruple , where:
-
is a decomposition of size d of the core P,
-
is a relevant subspace for , where are the fixed residual matrices associated with as promised by Lemma 6,
-
G is a graph with d vertices.
A row is good for a given candidate if there is some such that and is a clique of ; otherwise, it is bad. A column is good for a candidate if there is some such that and is an independent set of ; otherwise, it is bad.
The family of candidates is nonempty since, as shown above, at least one core decomposition exists, and for any such pair the zero subspace is relevant for and one may choose any graph with vertices. See Figure 2 for an illustration of a candidate.
Lemma 11. There are at most candidates.
Proof: There are at most pairs . For fixed , there are at most possible vectors . A subspace relevant for is spanned by a collection of at most of these vectors, so the number of subspaces relevant for is at most . There are also graphs on vertices. Thus, the total number of candidates is at most .
4.6 The final testing algorithm
We now describe the complete testing algorithm for the binary rank. All random choices made in different iterations and different steps are independent.

Figure 2: An example of a candidate. On the left, the upper left block is the core of the displayed binary matrix , where the real rank of is , and the tested binary rank bound is . In the middle, the 0,1 matrices and are a decomposition of of size . On the right is a compatibility graph with vertices, where the support of each row of is a clique of , while the support of each column of is an independent set of . The residual subspace , which forms the remaining component of a candidate , is not shown.
Algorithm 2: Test for binary rank at most , given and .
-
Call Algorithm 1 and let be the output core of size .
-
If , reject.
-
Otherwise, enumerate all candidates .
-
Set
and independently sample uniformly random rows and uniformly random columns . Query for every sampled row and for every sampled column.
- For each candidate , compute
- If some candidate satisfies then accept; otherwise, reject.
Step 1 uses Algorithm 1 to find a core , while Steps 3 through 6 of Algorithm 2 estimate, for each candidate, the fractions of rows and columns that are bad for it, and accept if some candidate has sufficiently few sampled bad rows and columns.
We first note that the query complexity of Algorithm 2 is as promised. Indeed, Algorithm 1 has at most iterations, and in each iteration it samples pairs of row and column, and for each pair performs at most queries for a core whose final size is . Thus, Algorithm 1 uses queries.
In the second phase, Algorithm 2 samples rows and columns and queries at most entries for each sampled row or column, for a total of at most additional queries. Since
, the first bound dominates.
The query complexity is polynomial in and , but the running time is exponential, which is not surprising because computing the binary rank exactly is NP-hard.
Lemma 12. Assuming a query costs , Algorithm 2 uses poly arithmetic operations.
Proof: Algorithm 1 performs at most real rank tests on matrices of order at most . Using ordinary Gaussian elimination, this takes polynomial time in per test, and hence, polynomial time in and overall.
For the second phase of Algorithm 2, the number of candidates is at most by Lemma 11. The enumeration itself can be carried out within poly arithmetic operations: one enumerates the binary decompositions , the spanning sets defining the relevant subspaces , and the graphs exactly as described above.
It remains to determine for each candidate, whether a sampled row or column is good. For a sampled row , one can simply enumerate all vectors and check if and and if is a clique of . This requires poly operations. The column test is analogous.
Since there are sampled rows and columns and at most candidates, the total work in this phase is poly poly. Combining the two phases of Algorithm 2 proves the lemma.
4.7 Correctness of the algorithm
We now prove the completeness and soundness of Algorithm 2. We first show that every candidate with few bad rows and columns gives a 0,1 matrix with binary rank at most that is close to , and then show that a YES instance has at least one such candidate. From this follows that the sample used by the algorithm is large enough to guarantee the correct answer with high enough probability.
The next lemma shows that every candidate implies a binary matrix of binary rank at most whose distance from is bounded by the fraction of bad rows and columns of the candidate.
Lemma 13. Let be a candidate, where is a binary decomposition of the core , and let
Then there is a binary matrix with such that
Consequently, if is -far from binary rank at most , then every candidate satisfies
Proof: We show how to construct the required matrix . Let
For each , choose a row extension satisfying the conditions in the definition of a good row, and for each , choose a column extension satisfying the conditions in the definition of a good column.
For every and , we have and . Hence , and Lemma 6 gives
Moreover, the support of is a clique of and the support of is an independent set of . Thus, their supports intersect in at most one coordinate, and . Thus, all pairs of extensions chosen for good rows and good columns are mutually compatible as required: their product is binary and equals the value predicted by the core.
We now add the set of rows I and set of columns J of the core. Define
For every row , use the corresponding row of , and for every core column , use the corresponding column of . These are valid row and column extensions because . That is, and .
It remains to check that these added rows and columns of the core are compatible with the extensions already chosen on the good rows and columns. If and , then , so the coordinate corresponding to row gives . Similarly, if and , then , and hence, . Finally, if and , then .
Thus, on every pair involving a row or a column of the core, the core prediction is exact, so all these products also equal to and are in .
We can now construct the matrix directly. Let be a 0,1 matrix of size defined by using the chosen row extension on every row in and the all-zero row on every row outside . Similarly, let be a 0,1 matrix of size defined by using the chosen column extension on every column in and the all-zero column on every column outside . Set .
If or , then . If and , then by the compatibility just proved, . Hence, is a 0,1 matrix. Since it has a binary decomposition of size , then .
We finally bound the distance of from . If , , and the core prediction is correct at , then
Thus, and can differ only on a row outside , on a column outside , or at an entry where the core prediction is wrong.
By the assumptions of the lemma and the definition of good and bad rows and . Hence, since and , then
The set of entries where the core prediction is wrong has normalized size . Taking the union of these three possible sources of disagreement gives
If is -far from binary rank at most , the left-hand side of the above inequality is at least for every binary matrix of binary rank at most , which gives the final assertion.
The preceding discussion shows that any candidate with few bad rows and columns yields a matrix with binary rank at most d which is not far from M. We now prove the converse fact needed for completeness: if M actually has binary rank at most d, then a core with a small prediction error gives rise to such a candidate.
Lemma 14. Assume that . For every core off full real rank , there is a candidate such that
Proof: Fix a binary decomposition of size , padding with zero coordinates if necessary, and set and . Then , so this pair is among those enumerated by the tester when going over all candidates.
For every row , the 'th row of belongs to RowCand. Indeed, since ,
Similarly, for every column , the 'th column of belongs to ColCand, since
Therefore, Lemma 6 applied to these actual row and column extensions gives
and hence,
Here and are independent and uniform. Therefore, the random vectors and are independent and satisfy
This is exactly the hypothesis of Lemma 7, so there is a relevant linear subspace of such that
Let be the set of row vectors from the fixed decomposition satisfying , and let be the set of column vectors from this decomposition satisfying . These rows and columns serve as row and column extensions of the core decomposition. Since every is a row of and every is a column of , there exist indices such that and . Hence, since , then . Thus, Lemma 9 gives a graph for which the support of every is a clique and the support of every is an independent set.
Thus, every row represented in and every column represented in is good for the candidate , and the claimed bound follows.
Finally we show that if is -far from binary rank at most then every candidate has many bad rows or columns, while the preceding lemma says if has binary rank at most then there exists at least one candidate with few bad rows and columns. Thus, the final phase of the testing algorithm only has to estimate by sampling the percentage of bad rows and bad columns of each candidate defined for a given core. The following corollary summarizes the percentage of bad rows and columns in each case.
Corollary 15. Assume that , where is as defined in Algorithm 1.
-
If , then some candidate satisfies .
-
If is -far from binary rank at most , then every candidate satisfies .
Proof: The first assertion follows from Lemma 14 since for as set in Algorithm 1.
For the second assertion of the corollary, Lemma 13 gives . Since and , we have as claimed.
We can now complete the proof of Theorem 2.
Theorem 16. Let and . Then Algorithm 2 is an adaptive 2-sided error testing algorithm for the binary rank. The algorithm succeeds with probability at least 2/3 and uses queries.
Proof: First assume that . Then , so Algorithm 1 can never construct a core of full real rank . By Lemma 5, with probability at least 5/6 it stops with a core of size satisfying .
Condition on this event and on the complete history of Algorithm 1. The core and all candidates are now fixed, while the row and column samples in Algorithm 2 remain independent.
Recall that , defined in Step 5 of Algorithm 2, is the total number of sampled rows and columns that are bad for candidate . By Corollary 15, the candidate family is nonempty and some candidate satisfies . Hence, is a sum of independent Bernoulli variables: the row indicators have mean and the column indicators have mean . Therefore,
Since , the standard Chernoff bound gives
But and therefore,
Moreover, by the definition of , we have , and therefore,
Thus, the total probability of rejecting a YES instance is at most .
Now assume that is -far from binary rank at most . If Algorithm 1 reaches real rank , the tester rejects correctly. Otherwise, except with probability at most , it stops with a core satisfying . Condition again on the complete history of Algorithm 1.
By Corollary 15, every candidate satisfies , and hence, . Thus,
We now apply the standard lower-tail Chernoff bound which states that if is a sum of independent Bernoulli random variables with mean , then for every ,
Taking gives
Moreover, since ,
Therefore, for each candidate C,
Let denote the number of candidates for the fixed core. By Lemma 11, . Therefore, by a union bound,
By the definition of we have , and hence,
Together with the possible 1/6 error in Algorithm 1, the total error is at most 1/3.
We note that if Algorithm 1 happens to find a core of full real rank , then there exists a candidate arising from an actual binary decomposition of size of which has no bad rows or columns. In this case the second phase of Algorithm 2 accepts for every choice of sampled rows and columns.
5 Constructing an approximate binary decomposition
The core found by the testing algorithm can be used to find an approximate decomposition of as follows. Once the core has been found, querying every row of on the columns of the core and every column of on the rows of the core, reveals all the information needed to decide which rows and columns are good for every candidate. Thus, the construction given in Lemma 13 can be made explicit without querying the remaining entries of .
The following theorem, combined with the query bound of Algorithm 1, proves the result stated in Theorem 3.
Theorem 17. Let and . Assume that . With probability at least 5/6, the core returned by Algorithm 1 can be used, using at most additional queries, to construct 0,1 matrices of size and , respectively, such that is a 0,1 matrix and
Proof: Since , Algorithm 1 cannot reach a core of full real rank . Thus, Lemma 5 implies that, with probability at least 5/6, Algorithm 1 stops with a core of full real rank satisfying where as set by Algorithm 1. Condition on this event happening. Then Lemma 14 guarantees a candidate with
We now show how to construct the decomposition from the core found by Algorithm 1. Query for every row and for every column . For a fixed candidate , these queried entries determine whether each row and column is good. Indeed, for a row we enumerate the vectors and check whether at least one of them satisfies and its support is a clique of . The analogous test for a column enumerates the vectors and checks if at least one satisfies and its support is an independent set of .
Thus, we can compute for every candidate and choose a candidate minimizing this quantity. By the preceding bound, . Now let
and set
For every , fix a vector such that and is a clique of . For every , fix a vector such that and is an independent set of . For a core row , let denote the corresponding row of , and for a core column , let denote the corresponding column of .
Now, define the ith row of and the jth column of by
We next verify the products for indices in . If and , then and , so . Hence, by Lemma 6 we have . Moreover, is a clique of and is an independent set of , so their supports intersect in at most one coordinate and hence .
It remains only to consider a pair for which at least one index belongs to the core. If and , then because ; taking the coordinate corresponding to the core row gives . Similarly, if and , then because , and hence . Finally, if and , then . Since the core prediction is exact whenever or , all these products are also equal to and are in .
Thus, every entry of is in : outside the product is zero, and inside this set the preceding verification applies. Therefore, is a 0,1 matrix with binary rank at most .
By definition, and . Since and , we have
Thus, and can differ only on a row outside , on a column outside , or at an entry where the core prediction is wrong. Therefore,
Finally, gives , while because and . Hence, the right-hand side is at most .
The core itself has already been queried. Querying all remaining entries in the columns and rows of the core rows uses at most additional queries. To evaluate one row or column for one candidate, brute-force enumeration of all binary extensions costs operations. Together with the bound on the number of candidates, the construction uses arithmetic operations in the unit-cost real-arithmetic model.
There is also a useful comparison with the adaptive binary rank testing algorithm of Parnas, Ron and Shraibman [11]. Their testing algorithm maintains a sub-matrix containing at most distinct rows and at most distinct columns, and then they show that for a YES instance it is possible to modify a small fraction of the rows and columns of the matrix which do not agree with the sampled sub-matrix, so as to get a matrix with binary rank at most . Although they do not formulate a reconstruction result, a direct reconstruction following the representation used by their tester would naturally query each row and column on a sampled structure containing up to distinct row and column types. This leads to additional queries, as opposed to the additional queries in Theorem 17. We note that the dependence on is better in [11] since they use queries to sample the sub-matrix, whereas we find a core using queries.
This query improvement should be distinguished from a running time improvement. Finding the binary rank of a matrix is equivalent to the problem of finding a minimum biclique partition of the edges of a bipartite graph. Chandran, Issac and Karrenbauer [3] give an exact parameterized algorithm for this problem whose running time is .
Theorem 17 uses poly arithmetic operations to construct an approximate decomposition of once a core is found by Algorithm 1. This bound includes the work needed to process the at most additional queried entries. Algorithm 1 adds only poly arithmetic operations. Thus, the total running time of the approximate decomposition algorithm is at most
Hence, the improvement is in the number of entries of which must be queried in order to find an approximate decomposition, rather than in the running time.
Declaration of generative AI usage
During the preparation of this work the author used ChatGPT 5.6 Sol as an interactive research tool. The results were achieved throughout a back and forth discussion in which ChatGPT was used to propose proof ideas and explore possible suggestions proposed by the author. In particular, initial versions of several proofs were generated by ChatGPT and were subsequently examined, corrected, simplified and revised significantly through this iterative process.
The author directed the mathematical development throughout this process, including selecting the questions and proof directions to pursue, proposed modifications, identified gaps or unclear arguments and decided on the final statements and structure of the results. The author carefully wrote and verified each mathematical statement, definition and proof appearing in this final manuscript and takes full responsibility for the correctness and content of this work.
References
[1] Maria-Florina Balcan, Yi Li, David P. Woodruff, and Hongyang Zhang. Testing matrix rank, optimally. In Proceedings of the 13th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 727–746, 2019.
[2] Nader H Bshouty. On property testing of the binary rank. In 48th International Symposium on Mathematical Foundations of Computer Science (MFCS 2023). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2023.
[3] Sunil Chandran, Davis Issac, and Andreas Karrenbauer. On the parameterized complexity of biclique cover and partition. In 11th International Symposium on Parameterized and Exact Computation (IPEC 2016). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2017.
[4] Oded Goldreich, Shari Goldwasser, and Dana Ron. Property testing and its connection to learning and approximation. Journal of the ACM, 45(4):653–750, 1998.
[5] David A. Gregory, Norman J. Pullman, Kathryn F. Jones, and J. Richard Lundgren. Biclique coverings of regular bigraphs and minimum semiring ranks of regular matrices. Journal of Combinatorial Theory, Series B, 51(1):73–89, 1991.
[6] Tao Jiang and Bala Ravikumar. Minimal nfa problems are hard. SIAM Journal on Computing, 22(6):1117–1141, 1993.
[7] Robert Krauthgamer and Ori Sasson. Property testing of data dimensionality. In Proceedings of the 14th annual ACM-SIAM symposium on Discrete algorithms (SODA), pages 18–27. Society for Industrial and Applied Mathematics, 2003.
[8] Yi Li, Zhengyu Wang, and David P. Woodruff. Improved testing of low rank matrices. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), pages 691–700, 2014.
[9] James Orlin. Contentment in graph theory: covering graphs with cliques. Indagationes Mathematicae, 80(5):406–424, 1977.
[10] Michal Parnas. Mathematical and computational perspectives on the boolean and binary rank and their relation to the real rank. arXiv preprint arXiv:2601.13900, 2026.
[11] Michal Parnas, Dana Ron, and Adi Shraibman. Property testing of the boolean and binary rank. Theory of Computing Systems, 65(8):1193–1210, 2021.
[12] Ronitt Rubinfeld and Madhu Sudan. Robust characterizations of polynomials with applications to program testing. SIAM Journal on Computing, 25(2):252–271, 1996.
[13] Yaroslav Shitov. The nonnegative rank of a matrix: Hard problems, easy solutions. SIAM Review, 59(4):794–800, 2017.
[14] Stephen A Vavasis. On the complexity of nonnegative matrix factorization. SIAM journal on optimization, 20(3):1364–1377, 2010.