Introduction
A Constraint Satisfaction Problem (CSP(Γ \Gamma Γ )) is defined by a constraint language Γ \Gamma Γ that is a fixed finite collection of k k k -ary relations over a finite domain D D D .2 An instance of CSP(Γ \Gamma Γ ) consists of n n n variables V = { x 1 , … , x n } V = \{x_1, \ldots, x_n\} V = { x 1 , … , x n } taking values in D D D and a multiset of constraints C = R ( x i 1 , … , x i k ) C = R(x_{i_1}, \ldots, x_{i_k}) C = R ( x i 1 , … , x i k ) , where R ∈ Γ R \in\Gamma R ∈ Γ . An assignment σ : V → D \sigma: V \to D σ : V → D satisfies C C C if ( σ ( x i 1 ) , … , σ ( x i k ) ) ∈ R (\sigma(x_{i_1}), \ldots, \sigma(x_{i_k})) \in R ( σ ( x i 1 ) , … , σ ( x i k )) ∈ R , and satisfies the instance if it satisfies every constraint.
This is the standard general formulation of finite-domain CSPs. It includes both the well-studied single-relation model and the Boolean model with literals . For a single relation R R R , we write CSP(R R R ) for the special case Γ = { R } \Gamma= \{R\} Γ = { R } . In the model with literals , constraints may be applied to variables or their negations. For each pattern of negated arguments, complementing the corresponding coordinates of a relation gives another Boolean relation. Including these relations in the language lets us express every constraint with literals as a constraint applied directly to variables.
Graph coloring, satisfiability of Boolean formulas, and systems of equations over finite fields are examples of CSPs. Their study includes classifications of computational complexity [Sch78; JCG97; FV98; BJK05; Bul17; Zhu20], approximation algorithms and hardness of approximation [56 Hå̊s01, 4 , 66 , 7 , 57 ] , and learning constraints from examples and queries [18 , 12 , 21 , 9 , 11 ] . Other work studies exact sparsification and kernelization, which reduce instance size while preserving satisfiability [29 , 41 , 26 , 61 , 14 ] , and sparsifying instances while approximately preserving the number of constraints satisfied by every assignment [44 , 30 , 52 , 53 , 13 , 54 ] . We focus on streaming algorithms, which process constraints sequentially while retaining limited memory, a setting studied for both approximation and exact computation [46 , 36 , 45 , 25 , 24 KPSY23, 71 , 70 , 23 , 72 , 31 , 32 , 2 , 1 , 33 , 74 , 75 , 19 ] .
Two standard models for streaming algorithms are insertion-only and strict-turnstile . In an insertion-only stream, constraints are added one at a time. A strict-turnstile stream also permits deleting copies of constraints, provided that the number of copies of each constraint remains nonnegative after every update. A one-pass algorithm processes the updates sequentially and answers at the end using only its retained memory. Space is measured in bits as a function of the number of variables n n n , with D D D and Γ \Gamma Γ fixed. Computation time is unrestricted. The comparisons below concern streams of length polynomial in n n n .
There are four natural objectives for a CSP instance. Max-CSP(Γ \Gamma Γ ) asks us to approximate the maximum number of constraints that can be satisfied simultaneously, while Exact-CSP(Γ \Gamma Γ ) asks us to compute this maximum exactly. CSP(Γ \Gamma Γ ) asks only whether all constraints can be satisfied simultaneously. Finally, Min-CSP(Γ \Gamma Γ ) asks us to approximate the minimum number of unsatisfied constraints. We compare the space needed for these objectives in insertion-only and strict-turnstile streams. The insertion-only results provide a starting point for understanding the effect of deletions on these four objectives.
Insertion-only streams. Max-CSP has received considerable attention in the insertion-only setting. For every fixed ε > 0 \varepsilon> 0 ε > 0 , sampling constraints gives a ( 1 − ε ) (1-\varepsilon) ( 1 − ε ) -approximation in O ( n polylog n ) O(n\,\operatorname{polylog} n) O ( n polylog n ) space. Much of the work therefore concerns the approximation factors achievable in sublinear space. Results for Max-Cut [46 , 45 ] and other Boolean CSPs [36 , 25 ] led to a classification for sketching algorithms, whose summaries can be combined across instances [23 ] and linear-space lower bounds for broad classes of CSPs [24 ] . Recent work characterizes the approximation threshold for single-pass sublinear-space algorithms in terms of the basic linear programming relaxation [73 , 32 , 1 , 33 , 74 ] . Related results consider multiple passes [33 , 32 ] and random arrival order [71 , 46 ] .
For Exact-CSP, the parameter that governs space complexity turns out to be a polynomial degree. The indicator of a Boolean relation is the function that equals one on accepted tuples and zero on all other tuples. It has a unique multilinear polynomial representation, where multilinear means that each variable has exponent at most one; the degree of this polynomial is also called its Fourier degree .3 Kol, Paramonov, Saxena, and Yu [KPSY23] give bounds of Ω k ( n r ) \Omega_k(n^r) Ω k ( n r ) and O k ( n r log n ) O_k(n^r \log n) O k ( n r log n ) for Fourier degree r r r . Their algorithm sums the indicator polynomials of the constraints and stores the resulting O k ( n r ) O_k(n^r) O k ( n r ) coefficients, each using O k ( log n ) O_k(\log n) O k ( log n ) bits for polynomial-length streams. Evaluating this sum on an assignment gives its number of satisfied constraints, so maximizing over all assignments gives the exact optimum. Inserting a constraint adds its polynomial to the sum, and deleting it subtracts that polynomial; the same summary therefore also supports deletions. However, their lower bound applies only to languages that require constraints to be applicable to literals and constants, which as we discussed already are included in our constraint-language formulation above. Brakensiek, Putterman, Sharma, and Velusamy [19 ] extend this characterization to single-relation constraint families by reducing the relation to its core .4
For satisfiability, the characterization is instead given by non-redundancy . An instance is nonredundant if each constraint has an assignment violating that constraint and satisfying all the others. Thus removing any constraint changes the set of solutions. The non-redundancy of a constraint language is the largest number of constraints in such an instance on n n n variables. Sharma and Velusamy [75 ] characterize insertion-only space through this parameter for Boolean CSPs. Brakensiek, Putterman, Sharma, and Velusamy [19 ] extend this to every fixed finite constraint language by taking its common core. An algebraic characterization of the asymptotic growth of non-redundancy remains a major open problem. Recent work [12 , 21 , 13 , 14 , 16 , 76 , 15 , 10 ] has substantially advanced this question, but it remains open even for some Boolean relations of arity four. [19 ] also characterize the space complexity in the insertion-only setting for Min-CSP(Γ \Gamma Γ ), which approximates the minimum number of unsatisfied constraints. For every fixed ε > 0 \varepsilon> 0 ε > 0 , a ( 1 + ε ) (1+\varepsilon) ( 1 + ε ) -approximation has the same characterization by non-redundancy of the core, up to polylogarithmic factors.
Turnstile streams. Several approximation guarantees survive the introduction of deletions. The O ( n p o l y l o g n ) O(n \mathop{\rm polylog} n) O ( n polylog n ) -space ( 1 − ε ) (1-\varepsilon) ( 1 − ε ) -approximation, for fixed ε > 0 \varepsilon> 0 ε > 0 , extends by sampling constraints according to their current multiplicities using standard turnstile sampling algorithms [42 ] . Independent samples from the final instance estimate all assignments’ satisfied counts simultaneously, just as in the insertion-only argument. At smaller space bounds, the approximation algorithms of Chou, Golovnev, Sudan, and Velusamy [23 ] also support strict-turnstile updates: their linear sketches add a constraint’s contribution on insertion and subtract it on deletion. Vu [80 ] gives dynamic Max-SAT approximation algorithms for binary streams , where every constraint frequency remains in { 0 , 1 } \{0,1\} { 0 , 1 } after every update. For Boolean Exact-CSP(Γ \Gamma Γ ), deletions preserve the same bounds Ω k ( n r ) \Omega_k(n^r) Ω k ( n r ) and O k ( n r log n ) O_k(n^r \log n) O k ( n r log n ) , where r r r is the maximum Fourier degree of the relations in the core. Recall that after restricting to the core, the upper bound stores the sum of the constraints’ indicator polynomials.
Deleting a constraint subtracts its polynomial from this sum, so the same space bound holds under strict-turnstile updates [KPSY23; BPSV26]. The lower bounds hold even against insertion-only streams, so the characterization is the same in the strict-turnstile setting.
For satisfiability, prior strict-turnstile algorithms address particular problems rather than giving a general characterization. Ahn, Guha, and McGregor [5 ] decide graph bipartiteness in O ( n polylog n ) O(n\operatorname{polylog} n) O ( n polylog n ) space under edge insertions and deletions. Each edge requires its endpoints to receive different values in { 0 , 1 } \{0,1\} { 0 , 1 } . Thus testing bipartiteness is exactly deciding satisfiability for the Boolean relation R = { 01 , 10 } R=\{01,10\} R = { 01 , 10 } , or equivalently for equations x u ⊕ x v = 1 x_u \oplus x_v=1 x u ⊕ x v = 1 , where ⊕ \oplus ⊕ denotes addition modulo two.
This leads us to the central question addressed in this paper:
Can we characterize the single-pass strict-turnstile space complexity of CSP ( Γ ) \operatorname{CSP}(\Gamma) CSP ( Γ ) for every Boolean constraint language Γ \Gamma Γ , and is non-redundancy still the right characterization?
Applications. The problem also has practical motivation in systems and verification, where changing requirements must remain jointly satisfiable. Incremental SAT solvers for circuit verification and test generation reuse a circuit description while adding and removing constraints for different tests [81 ] . Network verification systems such as VeriFlow [59 ] and APKeep [84 ] check network properties such as reachability as forwarding rules are installed, modified, or withdrawn. The database management software Cobra [78 ] continuously checks whether observed database transactions are consistent with a serial execution, while discarding information. Stream-reasoning systems maintain scheduling requirements as jobs arrive and old requirements expire [35 ] . These systems have different representations and performance goals, but share the need to reason about requirements that change over time. Motivated by these applications and the complexity comparison above, we study the memory needed to decide satisfiability when constraints can be inserted and deleted.
Our results
Our main result characterizes the space complexity of deciding satisfiability of every fixed nontrivial Boolean constraint language in the strict-turnstile setting, up to polylogarithmic factors.
The parameter governing our characterization is the capturing degree of the constraint language. An integer polynomial captures a k k k -ary Boolean relation R R R if it vanishes exactly on R R R within { 0 , 1 } k \{0,1\}^{k} { 0 , 1 } k . The minimum degree of such a polynomial is its integer capturing degree , denoted deg Z ( R ) \deg_{\mathbb{Z}}(R) deg Z ( R ) . For a language Γ \Gamma Γ , define deg Z ( Γ ) = max R ∈ Γ deg Z ( R ) \deg_{\mathbb{Z}}(\Gamma)=\max_{R\in\Gamma}\deg_{\mathbb{Z}}(R) deg Z ( Γ ) = max R ∈ Γ deg Z ( R ) . By Observation 3.6 , allowing rational or real coefficients instead of integer coefficients does not change the minimum degree of a polynomial that vanishes exactly on the satisfying tuples. Consequently, our integer capturing degree coincides with the non-deterministic degree introduced by Wolf [82 ] , with the convention that the polynomial vanishes on satisfying tuples; see § 1.2 for further discussion.
Our result identifies the integer capturing degree as the governing parameter under strict-turnstile deletions, by giving a solution-preserving streaming algorithm and a matching space lower bound up to polylogarithmic factors.
Theorem 1.1 (Main result; Theorems 4.1 and 5.1 and Corollaries 4.15 , 4.16 and 5.10 ). For every fixed nontrivial Boolean language Γ \Gamma Γ ,5 let d = deg Z ( Γ ) d=\deg_{\mathbb{Z}}(\Gamma) d = deg Z ( Γ ) . Deciding CSP ( Γ ) \operatorname{CSP}(\Gamma) CSP ( Γ ) on n n n variables admits a randomized one-pass strict-turnstile algorithm using O k ( n d polylog n ) O_k(n^d\operatorname{polylog} n) O k ( n d polylog n ) bits and requires Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits.
Moreover, the algorithm also solves the exact sparsification problem, i.e., constructs a subset of at most O k ( n d polylog n ) O_k(n^d \operatorname{polylog} n) O k ( n d polylog n ) active constraints that preserves the entire set of satisfying assignments of the original instance. For this problem, we can extend the lower bound above to constant-satisfiable Boolean languages.
The randomized algorithm has error probability 1 / 3 1/3 1/3 and we assume polynomially bounded stream lengths. The subscripts in O k O_k O k and Ω k \Omega_k Ω k allow constants depending on the fixed maximum arity k k k . For a domain of size q q q , the notation O k , q O_{k,q} O k , q also allows dependence on q q q .
To our knowledge, our result gives the first polynomial separation between insertion-only and strict-turnstile space for CSP satisfiability. It also separates strict-turnstile satisfiability from exact optimization.
Both comparisons are strict for an infinite family of constraint languages. For instance, consider the k k k -XOR predicate with literals: every constraint is of the form ℓ i 1 ⊕ ⋯ ⊕ ℓ i k = 1 \ell_{i_1} \oplus\cdots\oplus\ell_{i_k} = 1 ℓ i 1 ⊕ ⋯ ⊕ ℓ i k = 1 , where each ℓ i j \ell_{i_j} ℓ i j is either the variable x i j x_{i_j} x i j or its negation ¬ x i j \neg x_{i_j} ¬ x i j . For every k ≥ 2 k \ge2 k ≥ 2 , insertion-only satisfiability has bounds Ω k ( n ) \Omega_k(n) Ω k ( n ) and O k ( n log n ) O_k(n \log n) O k ( n log n ) [75 ] . Our strict-turnstile bounds are Ω k ( n ⌈ k / 2 ⌉ ) \Omega_k(n^{\lceil k/2\rceil}) Ω k ( n ⌈ k /2 ⌉ ) and O k ( n ⌈ k / 2 ⌉ polylog n ) O_k(n^{\lceil k/2\rceil} \operatorname{polylog} n) O k ( n ⌈ k /2 ⌉ polylog n ) (see Corollary 3.13 ), whereas exact optimization has bounds Ω k ( n k ) \Omega_k(n^k) Ω k ( n k ) and O k ( n k log n ) O_k(n^k \log n) O k ( n k log n ) in either update model [KPSY23]. Both polynomial separations hold for every k ≥ 3 k \ge3 k ≥ 3 .
Our lower bound also applies to Min-CSP(Γ \Gamma Γ ). Recall that this problem asks to approximate the minimum number of unsatisfied constraints, and that its insertion-only space complexity is characterized by non-redundancy, up to polylogarithmic factors [19 ] . Indeed, any finite multiplicative approximation for Min-CSP(Γ \Gamma Γ ) must return zero on a satisfiable instance and a positive value otherwise, and therefore decide satisfiability. Consequently, every randomized one-pass strict-turnstile algorithm with this guarantee requires Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits. Our upper bound preserves satisfying assignments but does not provide an approximation guarantee for the minimum number of violations. Whether Min-CSP has the same strict-turnstile space characterization as satisfiability remains open.
Related work
Low-degree polynomial representations of CSP constraints have previously been used for sparsification and kernelization. Jansen and Pieterse [41 ] and Chen, Jansen, and Pieterse [26 ] introduced the notion of a polynomial capturing an unsatisfying tuple u ∉ R u \notin R u ∈ / R . Their definition allows the polynomial to be over either Q \mathbb{Q} Q or Z / q Z \mathbb{Z}/q\mathbb{Z} Z / q Z for some integer q > 1 q > 1 q > 1 , and therefore in particular includes finite fields F p \mathbb{F}_p F p , unlike our definition over the integers.6 They showed that if every unsatisfying tuple of a fixed Boolean relation admits such a capturing polynomial of degree at most d d d , then every n n n -variable instance admits an equivalent sub-instance with O ( n d ) O(n^d) O ( n d ) constraints that preserves all satisfying assignments.
The integer capturing degree is closely connected to the non-deterministic degree of Boolean functions, introduced by Wolf [82 ] . A non-deterministic polynomial for a Boolean function f f f is a real polynomial p p p satisfying p ( x ) ≠ 0 p(x) \ne0 p ( x ) = 0 if and only if f ( x ) = 1 f(x) = 1 f ( x ) = 1 , and ndeg ( f ) \operatorname{ndeg}(f) ndeg ( f ) is the minimum degree of such a polynomial. In our terminology, the polynomial vanishes on satisfying tuples, so the corresponding Boolean function is the complement of the relation’s characteristic function. Observation 3.6 shows that restricting the coefficients to integers does not change this minimum degree. Thus, our integer capturing degree is precisely non-deterministic degree, with this choice of convention.
Non-deterministic degree has been studied through its connections to several other complexity measures. De Wolf [82 ] showed that it exactly characterizes non-deterministic quantum query complexity. It is also closely related to rational degree, the minimum of max { deg p , deg q } \max\{\deg p,\deg q\} max { deg p , deg q } over rational representations f = p / q f=p/q f = p / q whose denominator is nonzero on the Boolean cube:
rdeg ( f ) = max { ndeg ( f ) , ndeg ( ¬ f ) } . \operatorname{rdeg}(f)=\max\{\operatorname{ndeg}(f),\operatorname{ndeg}(\neg f)\}. rdeg ( f ) = max { ndeg ( f ) , ndeg ( ¬ f )} .
Mahadev and Wolf [63 ] connected rational approximation degree to quantum query complexity with postselection. Iyer, Jain, Kothari, Kovacs-Deak, Kumar, Schaeffer, Wang, and Whitmeyer [38 ] studied rational degree for symmetric functions, unate functions, and read-once formulas, as well as composition properties and separations from other complexity measures. More recently, Kothari, Kovacs-Deak, Wang, and Yang [47 ] proved that the Fourier degree of every Boolean function is at most O ~ ( rdeg ( f ) 3 ) \widetilde{O}(\operatorname{rdeg}(f)^3) O ( rdeg ( f ) 3 ) , resolving a longstanding question about the relationship between rational degree and Fourier degree.
Rajagopalan and Saurabh [RS26] study extremal properties of non-deterministic degree and related questions concerning effective Nullstellensatz on the Boolean cube. They show that almost all Boolean functions on k k k variables have non-deterministic degree at most k / 2 + O ( k log k ) k/2+O(\sqrt{k\log k}) k /2 + O ( k log k ) , confirming a conjecture of Iyer, Jain, Kothari, Kovacs-Deak, Kumar, Schaeffer, Wang, and Whitmeyer [38 ] .
Our work gives a streaming characterization in terms of this established degree notion: for every fixed non-trivial Boolean constraint language, its non-deterministic degree determines the space complexity of strict-turnstile satisfiability up to polylogarithmic factors.
Organization
In § 2 , we explain the key technical ideas using 4-XOR as a running example. § 3 collects the preliminaries needed for our proofs. We prove the lower bound in § 4 and the upper bound in § 5 , with the full streaming row-sparsification algorithm and analysis in Appendix § 7 . In § 6 , we extend the upper bound to larger finite domains and discuss barriers to extending our lower-bound techniques to other settings.
Technical Overview
We explain our techniques using the 4-XOR predicate without literals. Satisfiability for 2-XOR without literals is equivalent to graph bipartiteness, for which Ahn, Guha, and McGregor [5 ] give a near-linear space dynamic algorithm. In contrast, 3-XOR without literals is constant-satisfiable, since assigning one to every variable satisfies every constraint. Thus, we choose 4-XOR7 as a natural example to explain our results. We first explain the quadratic upper bound in § 2.1 . We then develop the matching lower bound in § 2.2 , starting from the known lower bound for exact optimization.
From insertions to deletions. Each 4-XOR constraint, and more generally, each k k k -XOR constraint, is a linear equation over F 2 \mathbb{F}_2 F 2 . Under insertions, we can retain a basis, namely a subset of at most n + 1 n+1 n + 1 original equations whose linear combinations include every constraint received so far. Each retained equation specifies only k k k variables. For fixed k k k , the basis therefore can be stored using O ( n log n ) O(n\log n) O ( n log n ) bits of memory and preserves all satisfying assignments, giving a near-linear space insertion-only algorithm for satisfiability.
Sharma and Velusamy [75 ] extend this approach to general CSPs through non-redundancy , a parameter that plays a role similar to the size of a basis. However, deletions make maintaining this summary difficult. An equation that we did not store because it was implied by the retained basis may become necessary after one of those basis equations is deleted. For example, consider the following four equations over F 2 \mathbb{F}_2 F 2 .
E 1 : x 1 + x 2 + x 3 + x 4 = 1 , E 2 : x 1 + x 2 + x 5 + x 6 = 1 , E_1:\quad x_1+x_2+x_3+x_4=1,\qquad E_2:\quad x_1+x_2+x_5+x_6=1, E 1 : x 1 + x 2 + x 3 + x 4 = 1 , E 2 : x 1 + x 2 + x 5 + x 6 = 1 ,
E 3 : x 3 + x 4 + x 7 + x 8 = 1 , E 4 : x 5 + x 6 + x 7 + x 8 = 1. E_3:\quad x_3+x_4+x_7+x_8=1,\qquad E_4:\quad x_5+x_6+x_7+x_8=1. E 3 : x 3 + x 4 + x 7 + x 8 = 1 , E 4 : x 5 + x 6 + x 7 + x 8 = 1.
Adding the first three gives the fourth, so a basis can omit E 4 E_4 E 4 . If E 1 E_1 E 1 is later deleted, however, E 4 E_4 E 4 is still present and is no longer implied by E 2 , E 3 E_2,E_3 E 2 , E 3 . Indeed, the assignment x 1 = x 3 = 1 x_1=x_3=1 x 1 = x 3 = 1 , with all other variables zero, satisfies E 2 , E 3 E_2,E_3 E 2 , E 3 but leaves E 4 E_4 E 4 unsatisfied. The algorithm must retain enough information to recover an equation that was previously omitted.
A naive solution is to store the multiplicity of every possible constraint, using O ( n 4 log n ) O(n^4\log n) O ( n 4 log n ) bits. Indeed, this also supports the stronger objective of exact optimization , which asks to compute the minimum number of constraints left unsatisfied by any assignment.8 At the end of the stream, we can enumerate all the assignments and count the constraints each leaves unsatisfied.
More generally, this upper bound follows from the polynomial representation used by Kol, Paramonov, Saxena, and Yu [KPSY23], and Brakensiek, Putterman, Sharma, and Velusamy [19 ] . Every Boolean relation R R R has a unique multilinear polynomial g R g_R g R that evaluates to zero on satisfying tuples and one on unsatisfying tuples. We call g R g_R g R its indicator polynomial . Its coefficients are integers, and its degree is called the Fourier degree . For 4-XOR, g R ( z ) = ( 1 + ∏ a = 1 4 ( 1 − 2 z a ) ) / 2 g_R(z)=(1+\prod_{a=1}^{4}(1-2z_a))/2 g R ( z ) = ( 1 + ∏ a = 1 4 ( 1 − 2 z a )) /2 , which has degree four. For each constraint C C C , substituting its variables into g R g_R g R gives a polynomial g C ( x ) g_C(x) g C ( x ) that is one when C C C is unsatisfied and zero otherwise. Thus ∑ C f C g C ( x ) \sum_C f_Cg_C(x) ∑ C f C g C ( x ) counts the unsatisfied constraints, including their multiplicities, where f C f_C f C is the number of copies of C C C . If the indicator polynomial has degree ℓ \ell ℓ , this polynomial has only O k ( n ℓ ) O_k(n^\ell) O k ( n ℓ ) monomials. We can store their integer coefficients, adding or subtracting the coefficients of g C g_C g C when a copy of C C C is inserted or deleted. Each coefficient takes O k ( log n ) O_k(\log n) O k ( log n ) bits on polynomial-length streams, and evaluating the polynomial on every assignment gives the exact optimum.
Understanding satisfiability in the strict-turnstile model, which allows deletions, therefore raises two questions. First, can we decide satisfiability using less space than exact optimization requires? Second, can we match the nearly linear space achievable in the insertion-only model, or do deletions necessarily increase the space requirement? We address these questions in turn.
Upper Bound
Capturing Polynomial. Let us start with the first question. The degree-four indicator polynomial already gives an O ( n 4 log n ) O(n^4\log n) O ( n 4 log n ) -space algorithm for 4-XOR. However, it retains more information than satisfiability needs. In particular, a constraint’s polynomial need not evaluate to exactly one when the constraint is unsatisfied. We only need it to be zero on satisfying tuples and a non-zero integer on unsatisfying tuples. We call such an integer polynomial a capturing polynomial . Observe that squaring its value gives a non-negative integer that is zero precisely when the constraint is satisfied. Consequently, the sum of these squares is zero exactly when every constraint is satisfied. This is the property we will exploit to come up with our algorithm.
In general, the minimum degree of a capturing polynomial is at most the Fourier degree, since the indicator polynomial is also, by definition, a capturing polynomial. For 4-XOR, this inequality is strict. Let r = z 1 + z 2 + z 3 + z 4 r=z_1+z_2+z_3+z_4 r = z 1 + z 2 + z 3 + z 4 be the number of ones in the tuple. The polynomial ( r − 1 ) ( r − 3 ) (r-1)(r-3) ( r − 1 ) ( r − 3 ) vanishes exactly on satisfying tuples. Since we care only about Boolean inputs, we can replace each z a 2 z_a^2 z a 2 by z a z_a z a , obtaining the multilinear capturing polynomial p ( z ) = 3 − 3 ∑ a z a + 2 ∑ a < b z a z b p(z)=3-3\sum_a z_a+2\sum_{a<b}z_az_b p ( z ) = 3 − 3 ∑ a z a + 2 ∑ a < b z a z b of degree two.
Matrix Representation. For each constraint C C C , let p C p_C p C be the polynomial obtained by substituting the variables in C C C in p p p . Let ϕ ( x ) = ( 1 , ( x i ) i ∈ [ n ] , ( x i x j ) 1 ≤ i < j ≤ n ) ⊤ \phi(x) = (1, (x_i)_{i\in[n]}, (x_i x_j)_{1\le i<j\le n})^\top ϕ ( x ) = ( 1 , ( x i ) i ∈ [ n ] , ( x i x j ) 1 ≤ i < j ≤ n ) ⊤ be the column vector of all multilinear monomials of degree at most two, with dimension D = 1 + n + ( n 2 ) = O ( n 2 ) D = 1 + n + \binom{n}{2} = O(n^2) D = 1 + n + ( 2 n ) = O ( n 2 ) . For each constraint C C C , let b C b_C b C be the coefficient vector of p C p_C p C in this basis, so that p C ( x ) = b C ⊤ ϕ ( x ) p_C(x) = b_C^\top\phi(x) p C ( x ) = b C ⊤ ϕ ( x ) . For a constraint on four distinct variables, b C b_C b C has at most eleven non-zero entries, each bounded in magnitude by a constant. More generally, for a fixed relation R R R , both the number and the magnitudes of the non-zero coefficients are O k ( 1 ) O_k(1) O k ( 1 ) , independent of n n n . We now encode the constraints as rows of a matrix, with each row scaled by the corresponding constraint’s frequency. Let f C f_C f C denote the frequency of constraint C C C , and call C C C active if f C > 0 f_C > 0 f C > 0 . Enumerating all possible constraint types as C 1 , … , C m C_1,\ldots,C_m C 1 , … , C m , define
A f = [ f C 1 b C 1 ⋯ f C m b C m ] ⊤ . A_f = [f_{C_1}b_{C_1}\ \cdots\ f_{C_m}b_{C_m}]^\top. A f = [ f C 1 b C 1 ⋯ f C m b C m ] ⊤ .
Then, for any assignment α \alpha α ,
A f ϕ ( α ) = ( f C 1 p C 1 ( α ) , … , f C m p C m ( α ) ) ⊤ . A_f\phi(\alpha) = (f_{C_1}p_{C_1}(\alpha),\ldots,f_{C_m}p_{C_m}(\alpha))^\top. A f ϕ ( α ) = ( f C 1 p C 1 ( α ) , … , f C m p C m ( α ) ) ⊤ .
To see why this representation is useful, define G = A f ⊤ A f G = A_f^\top A_f G = A f ⊤ A f . The energy of an assignment α \alpha α is the quadratic form
E ( α ) = ϕ ( α ) ⊤ G ϕ ( α ) = ∑ C f C 2 p C ( α ) 2 . E(\alpha) = \phi(\alpha)^\top G\phi(\alpha) = \sum_C f_C^2p_C(\alpha)^2. E ( α ) = ϕ ( α ) ⊤ Gϕ ( α ) = C ∑ f C 2 p C ( α ) 2 .
This energy is zero for a satisfying assignment, and at least one otherwise. Indeed, every active constraint that is unsatisfied contributes the square of a non-zero integer.
We use sparsification to retain a small weighted subset of rows while approximately preserving the energy. Specifically, suppose we can recover a set S S S of active constraints and positive weights w C w_C w C such that W = ∑ C ∈ S w C b C b C ⊤ W = \sum_{C\in S}w_Cb_Cb_C^\top W = ∑ C ∈ S w C b C b C ⊤ satisfies
( 1 − ε ) ( G + λ I ) ⪯ W + λ I ⪯ ( 1 + ε ) ( G + λ I ) , (1) (1-\varepsilon)(G+\lambda I)\preceq W+\lambda I\preceq(1+\varepsilon)(G+\lambda I), \tag*{(1)} ( 1 − ε ) ( G + λ I ) ⪯ W + λ I ⪯ ( 1 + ε ) ( G + λ I ) , (1)
where 0 < ε ≤ 1 / 8 0<\varepsilon\le1/8 0 < ε ≤ 1/8 and 0 < λ < 1 / ( 100 D ) 8 0<\lambda<1/(100D)^{8} 0 < λ < 1/ ( 100 D ) 8 . Here I I I is the identity matrix, and U ⪯ V U\preceq V U ⪯ V means that y ⊤ U y ≤ y ⊤ V y y^\top Uy\le y^\top Vy y ⊤ U y ≤ y ⊤ V y for every real vector y y y .
We first show that S S S has exactly the same satisfying assignments as the original instance. Every satisfying assignment of the original instance satisfies S S S , since S S S contains only active constraints. Conversely, suppose α \alpha α satisfies every constraint in S S S . Then p C ( α ) = 0 p_C(\alpha)=0 p C ( α ) = 0 for every C ∈ S C\in S C ∈ S , so ϕ ( α ) ⊤ W ϕ ( α ) = 0 \phi(\alpha)^\top W\phi(\alpha)=0 ϕ ( α ) ⊤ W ϕ ( α ) = 0 . Moreover, each coordinate of ϕ ( α ) \phi(\alpha) ϕ ( α ) is a Boolean monomial and hence lies in { 0 , 1 } \{0,1\} { 0 , 1 } , giving ∥ ϕ ( α ) ∥ 2 2 ≤ D \|\phi(\alpha)\|_2^2\le D ∥ ϕ ( α ) ∥ 2 2 ≤ D . Applying the left inequality in (1) to ϕ ( α ) \phi(\alpha) ϕ ( α ) therefore yields
( 1 − ε ) E ( α ) ≤ ϕ ( α ) ⊤ ( W + λ I ) ϕ ( α ) = λ ∥ ϕ ( α ) ∥ 2 2 ≤ λ D . (1-\varepsilon)E(\alpha)\le\phi(\alpha)^\top(W+\lambda I)\phi(\alpha)=\lambda\|\phi(\alpha)\|_2^2\le\lambda D. ( 1 − ε ) E ( α ) ≤ ϕ ( α ) ⊤ ( W + λ I ) ϕ ( α ) = λ ∥ ϕ ( α ) ∥ 2 2 ≤ λ D .
Thus E ( α ) ≤ λ D / ( 1 − ε ) < 1 / 4 E(\alpha)\le\lambda D/(1-\varepsilon)<1/4 E ( α ) ≤ λ D / ( 1 − ε ) < 1/4 . Since E ( α ) E(\alpha) E ( α ) is either zero or at least one, it must be zero, and α \alpha α satisfies every original constraint. Recovering such a set S S S in O ( D polylog n ) O(D\operatorname{polylog} n) O ( D polylog n ) space would therefore yield the desired O ( n 2 polylog n ) O(n^2\operatorname{polylog} n) O ( n 2 polylog n ) -space algorithm.
Matrix Sparsification. We obtain the required recovery guarantee by adapting the graph sparsification techniques of Kapralov, Lee, Musco, Musco, and Sidford [48 ] and Chen, Khanna, and Li [27 ] . Let E E E be the edge incidence matrix, with a row e u − e v e_u-e_v e u − e v for each possible edge { u , v } \{u,v\} { u , v } , where e u e_u e u is the unit vector corresponding to vertex u u u . For a vector f f f of nonnegative edge weights, with f e = 0 f_e=0 f e = 0 for absent edges, the graph Laplacian is L f = E T diag ( f ) E L_f=E^{\mathsf{T}}\operatorname{diag}(f)E L f = E T diag ( f ) E . Spectral sparsification seeks a weighted subset of edges whose Laplacian L ~ \widetilde{L} L satisfies
( 1 − ε ) y T L f y ≤ y T L ~ y ≤ ( 1 + ε ) y T L f y (1-\varepsilon)y^{\mathsf{T}}L_fy \le y^{\mathsf{T}}\widetilde{L}y \le(1+\varepsilon)y^{\mathsf{T}}L_fy ( 1 − ε ) y T L f y ≤ y T L y ≤ ( 1 + ε ) y T L f y
for every real vector y y y . Our goal is analogous: we seek a weighted subset of constraint rows that approximately preserves the quadratic form of G = A f T A f G=A_f^{\mathsf{T}}A_f G = A f T A f , in which each row’s contribution is weighted by the square of its constraint’s frequency.
Both works recover sparsifiers from linear sketches. The algorithm of [48 ] handles unweighted graphs, where f e ∈ { 0 , 1 } f_e\in\{0,1\} f e ∈ { 0 , 1 } indicates whether edge e e e is present. It maintains sketches under edge insertions and deletions and recovers a sparsifier of L f L_f L f using space nearly linear in the number of vertices. For nonnegative edge weights, the procedure in [27 Lemma 6.5] sketches f f f and recovers a sparsifier of
L f 2 = E T diag ( f ) 2 E , L_{f^2}=E^{\mathsf{T}}\operatorname{diag}(f)^2E, L f 2 = E T diag ( f ) 2 E ,
the Laplacian of the graph with squared edge weights. This formulation matches the squared frequencies in our matrix G G G . The linearity of the sketches allows updates to f f f to be processed directly during the stream. We adapt these arguments to our integer coefficient rows, using their constant number of non-zero entries and bounded coefficient magnitudes, to obtain the following guarantee.
Theorem 2.2 (Informal; Corollary 5.4 and Theorem 5.5). Fix a constant 0 < ε ≤ 1 / 8 0<\varepsilon\le1/8 0 < ε ≤ 1/8 and a power of two λ = Θ ( 1 / D ) \lambda=\Theta(1/D) λ = Θ ( 1/ D ) satisfying λ < 1 / ( 100 D ) \lambda<1/(100D) λ < 1/ ( 100 D ) . There is a randomized one-pass algorithm that processes any polynomial-length strict-turnstile stream of constraints using O ( D polylog n ) O(D\operatorname{polylog} n) O ( D polylog n ) bits of space. With probability at least 2 / 3 2/3 2/3 , it recovers a set S S S of O ( D polylog n ) O(D\operatorname{polylog} n) O ( D polylog n ) constraints active at the end of the stream and positive weights ( w C ) C ∈ S (w_C)_{C\in S} ( w C ) C ∈ S such that the matrix W = ∑ C ∈ S w C b C b C T W=\sum_{C\in S}w_Cb_Cb_C^{\mathsf{T}} W = ∑ C ∈ S w C b C b C T satisfies Equation (1) .
We give a technical overview of the proof of this theorem in Section 5.1.1 and the full algorithm and analysis in Section A.
General Boolean Relations. The same argument extends to every fixed Boolean relation R R R . Choose a capturing polynomial for R R R with integer coefficients and degree d d d . Substituting the variables of each constraint yields polynomials of degree at most d d d , all expressible in a common monomial basis of size O k ( n d ) O_k(n^d) O k ( n d ) . Since these polynomials arise from a single fixed polynomial, each coefficient row has only constantly many non-zero integer entries, all of bounded magnitude. Thus the rows retain the sparsity, boundedness, and integrality properties used above. Moreover, every unsatisfied active constraint contributes at least one to the energy. The same sparsification argument therefore yields an algorithm using O k ( n d polylog n ) O_k(n^d\operatorname{polylog} n) O k ( n d polylog n ) bits of space. Choosing a capturing polynomial of minimum degree gives our upper bound in terms of the capturing degree , d = deg Z ( R ) d=\deg_Z(R) d = deg Z ( R ) . We prove this bound formally in Theorem 5.1 .
Extensions to Larger Domains and Constraint Languages. The same matrix representation yields both extensions. For larger domains, let R R R be a fixed nonempty proper relation of arity k k k over { 0 , … , q − 1 } \{0,\ldots,q-1\} { 0 , … , q − 1 } , and choose a capturing polynomial with integer coefficients and degree d = deg Z ( R ) d=\deg_Z(R) d = deg Z ( R ) . The resulting constraint polynomials share a monomial basis of size D = O k , q ( n d ) D=O_{k,q}(n^d) D = O k , q ( n d ) . On this domain, the monomial evaluations are bounded by constants depending only on k , q k,q k , q , so ∥ φ ( x ) ∥ 2 2 = O k , q ( D ) \lVert\varphi(x)\rVert_2^2=O_{k,q}(D) ∥ φ ( x ) ∥ 2 2 = O k , q ( D ) . Choosing λ = Θ k , q ( 1 / D ) \lambda=\Theta_{k,q}(1/D) λ = Θ k , q ( 1/ D ) with a sufficiently small implicit constant keeps the regularization term below the integer energy gap. The same sparsification argument therefore yields an algorithm using O k , q ( n deg Z ( R ) polylog n ) O_{k,q}(n^{\deg_{\mathbb{Z}}(R)}\operatorname{polylog} n) O k , q ( n d e g Z ( R ) polylog n ) bits of space.10
For constraint languages, let Γ \Gamma Γ be a fixed finite set of nonempty proper Boolean relations of arity k k k . Choose a minimum-degree integer capturing polynomial for each R ∈ Γ R \in\Gamma R ∈ Γ , and let d = max R ∈ Γ deg Z ( R ) d = \max_{R \in\Gamma} \deg_{\mathbb{Z}}(R) d = max R ∈ Γ deg Z ( R ) . All constraint polynomials then share a monomial basis of size O k ( n d ) O_k(n^d) O k ( n d ) . Since Γ \Gamma Γ is fixed, each coefficient row still has only constantly many non-zero integer entries, all of bounded magnitude. Combining all constraint types in a single matrix and applying the same sparsification argument therefore yields an algorithm using O k ( n d polylog n ) O_k(n^d \operatorname{polylog} n) O k ( n d polylog n ) bits of space. We state and prove this bound in Corollary 5.10 .
Lower Bound
We have answered the first question: satisfiability can be decided in O ( n 2 polylog n ) O(n^2 \operatorname{polylog} n) O ( n 2 polylog n ) space, improving on the O ( n 4 log n ) O(n^4 \log n) O ( n 4 log n ) bound for exact optimization. We now address the second question by showing that this quadratic dependence on n n n is necessary. This establishes a separation between strict-turnstile satisfiability and its insertion-only counterpart, which admits a near-linear space algorithm.
Exact optimization and Fourier degree. We begin with the exact-optimization reduction of [19 ] , using 4-XOR as a running example11 . Recall that the value of an assignment is the number of constraints it leaves unsatisfied, and exact optimization asks for the minimum value over all assignments. The indicator polynomial
g R ( z ) = 1 + ∏ a = 1 4 ( 1 − 2 z a ) 2 g_R(z) = \frac{1 + \prod_{a=1}^{4}(1 - 2z_a)}{2} g R ( z ) = 2 1 + ∏ a = 1 4 ( 1 − 2 z a )
is zero on satisfying tuples and one on unsatisfying tuples. It has degree four, with coefficient 8 on z 1 z 2 z 3 z 4 z_1z_2z_3z_4 z 1 z 2 z 3 z 4 . Summing the substituted copies of g R g_R g R over all constraints gives a polynomial whose evaluation at each assignment equals that assignment’s value. The reduction uses evaluations of this polynomial to isolate the contribution of a chosen constraint.
The reduction starts from the one-way communication problem INDEX. Alice receives bits X = ( X t ) t ∈ [ n ] 4 X = (X_t)_{t \in[n]^4} X = ( X t ) t ∈ [ n ] 4 , where [ n ] = { 1 , … , n } [n] = \{1, \ldots, n\} [ n ] = { 1 , … , n } , and Bob receives an index j = ( j 1 , j 2 , j 3 , j 4 ) ∈ [ n ] 4 j = (j_1,j_2,j_3,j_4) \in[n]^4 j = ( j 1 , j 2 , j 3 , j 4 ) ∈ [ n ] 4 . Alice sends a single message, after which Bob must recover X j X_j X j . Even with shared randomness and constant error probability bounded away from 1 / 2 1/2 1/2 , this requires Ω ( n 4 ) \Omega(n^4) Ω ( n 4 ) bits of communication [3 , 49 ] .
The construction uses four groups of variables x a , u x_{a,u} x a , u , for u ∈ [ n ] u \in[n] u ∈ [ n ] , one for each coordinate a ∈ [ 4 ] a \in[4] a ∈ [ 4 ] . Here n n n is the size of each group, so the instance has 4 n = O ( n ) 4n = O(n) 4 n = O ( n ) variables in total. For each t = ( t 1 , t 2 , t 3 , t 4 ) ∈ [ n ] 4 t = (t_1,t_2,t_3,t_4) \in[n]^4 t = ( t 1 , t 2 , t 3 , t 4 ) ∈ [ n ] 4 , define
C t = R ( x 1 , t 1 , x 2 , t 2 , x 3 , t 3 , x 4 , t 4 ) . C_t = R(x_{1,t_1}, x_{2,t_2}, x_{3,t_3}, x_{4,t_4}). C t = R ( x 1 , t 1 , x 2 , t 2 , x 3 , t 3 , x 4 , t 4 ) .
Alice inserts C t C_t C t if and only if X t = 1 X_t = 1 X t = 1 , then sends the streaming algorithm’s memory state to Bob. The resulting instance has value polynomial
F X ( x ) = ∑ t ∈ [ n ] 4 X t ⋅ g R ( x 1 , t 1 , x 2 , t 2 , x 3 , t 3 , x 4 , t 4 ) . F_X(x) = \sum_{t \in[n]^4} X_t \cdot g_R(x_{1,t_1}, x_{2,t_2}, x_{3,t_3}, x_{4,t_4}). F X ( x ) = t ∈ [ n ] 4 ∑ X t ⋅ g R ( x 1 , t 1 , x 2 , t 2 , x 3 , t 3 , x 4 , t 4 ) .
Bob wants to determine whether Alice inserted C j C_j C j . Let z a z_a z a denote the value of x a , j a x_{a,j_a} x a , j a , and obtain H j ( z ) H_j(z) H j ( z ) from F X ( x ) F_X(x) F X ( x ) by setting all other variables to zero. Every degree-four monomial except the one corresponding to C j C_j C j contains a variable set to zero and therefore vanishes. Hence
H j ( z ) = 8 X j z 1 z 2 z 3 z 4 + Q j ( z ) , deg Q j ≤ 3. H_j(z) = 8X_jz_1z_2z_3z_4 + Q_j(z), \qquad\deg Q_j \le3. H j ( z ) = 8 X j z 1 z 2 z 3 z 4 + Q j ( z ) , deg Q j ≤ 3.
Since H j H_j H j is multilinear, its values on { 0 , 1 } 4 \{0,1\}^4 { 0 , 1 } 4 determine all its coefficients, including 8 X j 8X_j 8 X j . It therefore suffices for Bob to recover these sixteen values.
Bob obtains these evaluations using the pinning lemma of [19 Lemma 4.6] . For any chosen assignment α \alpha α , he can append a gadget ensuring that every optimal assignment agrees with either α \alpha α or its complement on the original variables and satisfies all the added constraints. Complementing all four inputs preserves their parity, so α \alpha α and its complement violate exactly the same 4-XOR constraints. Since the added constraints contribute no violations, the optimum of the extended instance is exactly F X ( α ) F_X(\alpha) F X ( α ) . The gadget introduces only O ( n ) O(n) O ( n ) additional variables.
For each z ∈ { 0 , 1 } 4 z \in\{0,1\}^4 z ∈ { 0 , 1 } 4 , Bob starts from a copy of Alice’s memory state and appends the gadget for the assignment that sets x a , j a = z a x_{a,j_a}=z_a x a , j a = z a for each a ∈ [ 4 ] a \in[4] a ∈ [ 4 ] and all other original variables to zero. These sixteen continuations yield the values H j ( z ) H_j(z) H j ( z ) on { 0 , 1 } 4 \{0,1\}^4 { 0 , 1 } 4 . Inclusion–exclusion then gives
∑ z ∈ { 0 , 1 } 4 ( − 1 ) 4 − ∣ z ∣ H j ( z ) = 8 X j , \sum_{z\in\{0,1\}^4}(-1)^{4-|z|}H_j(z) = 8X_j, z ∈ { 0 , 1 } 4 ∑ ( − 1 ) 4 − ∣ z ∣ H j ( z ) = 8 X j ,
where ∣ z ∣ |z| ∣ z ∣ is the number of ones in z z z . Every lower-degree monomial omits a coordinate, so its contributions cancel between pairs of assignments differing only in that coordinate. Bob therefore recovers X j X_j X j . The communication lower bound for INDEX then implies an Ω ( n 4 ) \Omega(n^4) Ω ( n 4 ) space lower bound.
The obstruction for satisfiability. The exact-optimization reduction recovers X j X_j X j by taking an alternating sum of the values H j ( z ) H_j(z) H j ( z ) . A satisfiability algorithm tells Bob only whether each of these values is zero, which need not reveal the queried bit. For example, suppose Alice inserted a constraint involving only variables outside C j C_j C j . This constraint receives 0000 under all sixteen assignments, making every pinned instance unsatisfiable regardless of X j X_j X j . In exact optimization, its contribution cancels in the alternating sum. For satisfiability, however, Bob receives the same answer in all sixteen cases and learns nothing about X j X_j X j .
One might try to avoid this problem by choosing an assignment that violates C j C_j C j but satisfies every other possible constraint. Even for 4-XOR, such an assignment need not exist. Choose one additional variable in each of the first two groups. Keeping the last two queried variables fixed, the two choices in each of the first two groups give four constraints, including C j C_j C j . Every variable appears an even number of times across these four odd-parity equations, so an assignment must violate an even number of them. Thus an assignment that violates C j C_j C j necessarily violates at least one of the other three constraints as well.
Our approach is to choose an assignment violating C j C_j C j and remove every other constraint that it violates. Bob can identify which potential constraints his assignment violates, but he does not know which of them Alice inserted. Deleting all of them could therefore create negative frequencies. He needs a way to cancel only the contributions actually present.
We implement this cancellation using linear sketches. The theorem of Jiang, Liu, and Yu [40 Corollary 7.2.2] transfers lower bounds for linear sketches to the strict-turnstile model with only a constant-factor loss in space.12 The key property of linear sketches is their additivity. Let f f f be frequency vector of an instance, with f C f_C f C counting the copies of C C C , and write L ( f ) L(f) L ( f ) for its sketch. For integer vectors f , h f,h f , h ,
L ( f + h ) = L ( f ) + L ( h ) . L(f+h)=L(f)+L(h). L ( f + h ) = L ( f ) + L ( h ) .
Thus adding sketches adds the underlying frequency vectors, and subtracting sketches subtracts them. Alice will send sketches of selected subsets of her constraints, chosen without knowing Bob’s query. Bob can then combine these sketches according to his query to cancel the other violated constraints while retaining C j C_j C j exactly when Alice inserted it.
Suppose the sketch uses at most B B B bits and its decoder decides satisfiability with constant error. Alice and Bob share the randomness defining L L L , so all sketches use the same map. We include the auxiliary variables needed for pinning in the variable set from the outset.
Combining sketches to remove unsatisfied constraints. A naive approach is for Alice to send X t L ( e C t ) X_tL(e_{C_t}) X t L ( e C t ) for every t ∈ [ n ] 4 t \in[n]^4 t ∈ [ n ] 4 , where e C e_C e C is the frequency vector representing one copy of C C C . Bob selects the sketch indexed by j j j . This is the sketch of either the empty instance, if X j = 0 X_j=0 X j = 0 , or the single constraint C j C_j C j , if X j = 1 X_j=1 X j = 1 .
Let α j \alpha_j α j assign one to the four queried variables and zero to every other original variable. By the pinning lemma, Bob can add a gadget that allows precisely α j \alpha_j α j and its complement on the original variables, each with a satisfying extension to the auxiliary variables. These two assignments satisfy exactly the same 4-XOR constraints, so it suffices to analyze α j \alpha_j α j . Bob adds the sketch of the pinning gadget to his selected sketch. If X j = 0 X_j=0 X j = 0 , only the pinning constraints remain, and the instance is satisfiable. If X j = 1 X_j=1 X j = 1 , the query constraint receives either 1111 or 0000 under every assignment allowed by the gadget. Both tuples violate C j C_j C j , so the instance is unsatisfiable. Bob can therefore recover X j X_j X j .
The drawback is that Alice sends n 4 n^4 n 4 sketches. The communication lower bound for INDEX then gives n 4 B = Ω ( n 4 ) n^4B=\Omega(n^4) n 4 B = Ω ( n 4 ) , yielding only the trivial bound B = Ω ( 1 ) B=\Omega(1) B = Ω ( 1 ) .
To reduce communication, we relax the goal of isolating C j C_j C j . Bob needs to isolate it only among the constraints violated by α j \alpha_j α j ; constraints satisfied by α j \alpha_j α j can safely remain. Recall that α j \alpha_j α j sets the four queried variables to one and all other original variables to zero. A constraint matching the query in exactly r r r coordinates therefore receives r r r ones and is violated precisely when r ∈ { 0 , 2 , 4 } r \in\{0,2,4\} r ∈ { 0 , 2 , 4 } . The case r = 4 r=4 r = 4 identifies C j C_j C j , which Bob wants to retain exactly when Alice inserted it. His task is therefore to eliminate the constraints with r = 0 r=0 r = 0 or r = 2 r=2 r = 2 .
The case r = 0 r=0 r = 0 is easy to exclude: Bob selects only sketches of constraints incident to at least one queried variable. The remaining challenge is to cancel constraints with exactly two matches. Such a constraint belongs to two subsets obtained by fixing a single queried coordinate and one subset obtained by fixing both matching coordinates. This suggests combining sketches of these two kinds of subsets.
Accordingly, Alice sends
M a , u = ∑ t : t a = u X t L ( e C t ) , M a b , ( u , v ) = ∑ t : t a = u t b = v X t L ( e C t ) , (2) M_{a,u}=\sum_{t:t_a=u}X_tL(e_{C_t}),\qquad M_{ab,(u,v)}=\sum_{\substack{t:t_a=u\\t_b=v}}X_tL(e_{C_t}), \tag*{(2)} M a , u = t : t a = u ∑ X t L ( e C t ) , M ab , ( u , v ) = t : t a = u t b = v ∑ X t L ( e C t ) , (2)
where the first family ranges over a ∈ [ 4 ] a \in[4] a ∈ [ 4 ] and u ∈ [ n ] u \in[n] u ∈ [ n ] , and the second over 1 ≤ a < b ≤ 4 1 \leq a < b \leq4 1 ≤ a < b ≤ 4 and u , v ∈ [ n ] u,v \in[n] u , v ∈ [ n ] . These are sketches of Alice’s constraints incident to one specified variable or to two specified variables from different groups, respectively. There are 4 n + 6 n 2 = O ( n 2 ) 4n+6n^2=O(n^2) 4 n + 6 n 2 = O ( n 2 ) sketches in total, all computed without knowing Bob’s query.
Bob selects the sketches indexed by his queried variables and forms
M B o b = 2 ∑ 1 ≤ a < b ≤ 4 M a b , ( j a , j b ) − ∑ a = 1 4 M a , j a . (3) M_{\mathrm{Bob}} = 2\sum_{1\le a<b\le4} M_{ab,(j_a,j_b)}-\sum_{a=1}^{4}M_{a,j_a}. \tag*{(3)} M Bob = 2 1 ≤ a < b ≤ 4 ∑ M ab , ( j a , j b ) − a = 1 ∑ 4 M a , j a . (3)
Let r = r ( t , j ) r=r(t,j) r = r ( t , j ) be the number of coordinates in which t t t agrees with j j j . The constraint C t C_t C t appears in r r r selected single-index sketches and ( r 2 ) \binom{r}{2} ( 2 r ) selected pair sketches. By linearity, its frequency in the vector represented by M B o b M_{\mathrm{Bob}} M Bob is
X t ( 2 ( r 2 ) − r ) = X t r ( r − 2 ) . X_t\left(2\binom{r}{2}-r\right)=X_t r(r-2). X t ( 2 ( 2 r ) − r ) = X t r ( r − 2 ) .
Under α j \alpha_j α j , the constraint receives exactly r r r ones and is violated precisely when r ∈ { 0 , 2 , 4 } r\in\{0,2,4\} r ∈ { 0 , 2 , 4 } . The multiplier r ( r − 2 ) r(r-2) r ( r − 2 ) vanishes when r = 0 r=0 r = 0 or r = 2 r=2 r = 2 . The case r = 4 r=4 r = 4 occurs only for C j C_j C j , whose frequency becomes 8 X j 8X_j 8 X j . Every other constraint with non-zero frequency has r = 1 r=1 r = 1 or r = 3 r=3 r = 3 and is therefore satisfied by α j \alpha_j α j .
The resulting vector may still have negative entries, so Bob must repair it before decoding. Negative frequencies occur only when r = 1 r=1 r = 1 , where the frequency is − X t -X_t − X t . Bob adds one copy of every constraint with r = 1 r=1 r = 1 , changing its frequency to 1 − X t ≥ 0 1-X_t\ge0 1 − X t ≥ 0 . He can compute the sketch of this correction from his query alone. Since all constraints added in this step are satisfied by α j \alpha_j α j , the correction makes the instance valid without introducing any further violated constraints.
Bob then adds the sketch of the pinning gadget for α j \alpha_j α j , as in [19 Lemma 4.4] . Each pinning constraint contains an auxiliary variable and is therefore distinct from every C t C_t C t , so the corrected frequencies remain unchanged. The gadget uses only O k ( 1 ) O_k(1) O k ( 1 ) auxiliary variables, keeping the total number of variables at O ( n ) O(n) O ( n ) . If X j = 0 X_j=0 X j = 0 , all remaining original constraints are satisfied by α j \alpha_j α j , which extends to a satisfying assignment of the gadget. If X j = 1 X_j=1 X j = 1 , the query constraint has positive frequency and is violated by both α j \alpha_j α j and its complement, the only assignments permitted by the gadget on the original variables. The final instance is therefore unsatisfiable exactly when X j = 1 X_j=1 X j = 1 , allowing Bob to recover the queried bit.
Alice sends O ( n 2 ) O(n^2) O ( n 2 ) sketches of at most B B B bits each. The communication lower bound for INDEX therefore implies n 2 B = Ω ( n 4 ) n^2B=\Omega(n^4) n 2 B = Ω ( n 4 ) , and hence B = Ω ( n 2 ) B=\Omega(n^2) B = Ω ( n 2 ) . Applying the transfer theorem of Jiang, Liu, and Yu [40 ] yields the Ω ( n 2 ) \Omega(n^2) Ω ( n 2 ) space lower bound in the strict-turnstile model.
Selection polynomials and the general lower bound. To generalize this construction, we express the cancellation rule as a polynomial in the tuple received by a constraint. Let z ∈ { 0 , 1 } 4 z\in\{0,1\}^4 z ∈ { 0 , 1 } 4 be the tuple received by C t C_t C t under α j \alpha_j α j . In the case of 4-XOR, since α j \alpha_j α j sets the queried variables to one and all other variables to zero, z a = 1 z_a=1 z a = 1 exactly when t a = j a t_a=j_a t a = j a . Thus ∑ a z a \sum_a z_a ∑ a z a counts the selected single-index sketches containing C t C_t C t , while ∑ a < b z a z b \sum_{a<b}z_az_b ∑ a < b z a z b counts the selected pair sketches containing it. Bob’s combination therefore assigns C t C_t C t frequency X t q ( z ) X_tq(z) X t q ( z ) , where
q ( z ) = 2 ∑ a < b z a z b − ∑ a z a . q(z)=2\sum_{a<b}z_az_b-\sum_a z_a. q ( z ) = 2 a < b ∑ z a z b − a ∑ z a .
As the calculation above shows, q q q vanishes on the unsatisfying tuples with zero or two ones, while q ( 1111 ) = 8 q(1111)=8 q ( 1111 ) = 8 . It therefore singles out 1111 among the unsatisfying tuples.
This is the property needed for the general reduction. For an unsatisfying tuple b ∉ R b\notin R b ∈ / R , we call a polynomial q b q_b q b with integer coefficients a selection polynomial if it is non-zero at b b b and zero at every other tuple outside R R R . Its values on satisfying tuples are unrestricted, since constraints satisfied by Bob’s chosen assignment can remain.
Fix a degree-s s s selection polynomial q b q_b q b , choosing its sign so that q b ( b ) > 0 q_b(b)>0 q b ( b ) > 0 . In the general reduction, we use k k k groups of variables and constraints
C t = R ( x 1 , t 1 , … , x k , t k ) , t ∈ [ n k ] . C_t = R(x_{1,t_1},\ldots,x_{k,t_k}), \qquad t \in[n^k]. C t = R ( x 1 , t 1 , … , x k , t k ) , t ∈ [ n k ] .
with Alice inserting C t C_t C t exactly when X t = 1 X_t=1 X t = 1 . For his query j j j , Bob assigns b a b_a b a to x a , j a x_{a,j_a} x a , j a and 1 − b a 1-b_a 1 − b a to every other variable in group a a a . Thus only C j C_j C j receives the tuple b b b .
We now rewrite q b q_b q b as a polynomial in formal variables z 1 , … , z k z_1,\ldots,z_k z 1 , … , z k by replacing its a a a -th variable with z a z_a z a when b a = 1 b_a=1 b a = 1 and with 1 − z a 1-z_a 1 − z a when b a = 0 b_a=0 b a = 0 . For a fixed constraint C t C_t C t , the value assigned to its a a a -th variable by the pinning assignment is
{ b a , t a = j a , 1 − b a , t a ≠ j a , = { 1 { t a = j a } , b a = 1 , 1 − 1 { t a = j a } , b a = 0. \begin{cases}
b_a, & t_a=j_a,\\
1-b_a, & t_a\ne j_a,
\end{cases}
=
\begin{cases}
\mathbf{1}_{\{t_a=j_a\}}, & b_a=1,\\
1-\mathbf{1}_{\{t_a=j_a\}}, & b_a=0.
\end{cases} { b a , 1 − b a , t a = j a , t a = j a , = { 1 { t a = j a } , 1 − 1 { t a = j a } , b a = 1 , b a = 0.
The expressions on the right are precisely our substitutions evaluated at z a = 1 { t a = j a } z_a=\mathbf{1}_{\{t_a=j_a\}} z a = 1 { t a = j a } . Thus evaluating the rewritten polynomial at these indicators gives the value of q b q_b q b on the tuple received by C t C_t C t under Bob’s assignment. These substitutions do not increase degree. After multilinearization, each term therefore has the form c T ∏ a ∈ T z a c_T\prod_{a\in T}z_a c T ∏ a ∈ T z a with ∣ T ∣ ≤ s |T|\le s ∣ T ∣ ≤ s .
For each non-zero coefficient c T c_T c T and every tuple u ∈ [ n ] T u\in[n]^T u ∈ [ n ] T , Alice sends the sketch of her constraints with t a = u a t_a=u_a t a = u a for all a ∈ T a\in T a ∈ T . There are O k ( n s ) O_k(n^s) O k ( n s ) such sketches. Bob selects the sketch with u a = j a u_a=j_a u a = j a for every a ∈ T a\in T a ∈ T , multiplies it by c T c_T c T , and sums over the terms. The constant term corresponds to T = ∅ T=\varnothing T = ∅ and uses the sketch of Alice’s entire instance.
For a fixed constraint C t C_t C t , the subset selected for T T T contains C t C_t C t precisely when t a = j a t_a=j_a t a = j a for every a ∈ T a\in T a ∈ T . Its frequency in the combined sketch is therefore
X t ∑ T c T ∏ a ∈ T 1 { t a = j a } . X_t\sum_T c_T\prod_{a\in T}\mathbf{1}_{\{t_a=j_a\}}. X t T ∑ c T a ∈ T ∏ 1 { t a = j a } .
As we argued above, this equals X t X_t X t times the value of q b q_b q b on the tuple received by C t C_t C t under Bob’s assignment.
Only C j C_j C j receives b b b , so its frequency is X j q b ( b ) X_jq_b(b) X j q b ( b ) , which is positive exactly when X j = 1 X_j=1 X j = 1 . Every other violated constraint has frequency zero. Negative frequencies can occur only on constraints satisfied by Bob’s assignment. Bob corrects them without knowing Alice’s bits: if q b q_b q b evaluates to − β < 0 -\beta<0 − β < 0 on the tuple received by C t C_t C t , he adds β \beta β copies of that constraint, changing its frequency from − β X t -\beta X_t − β X t to β ( 1 − X t ) ≥ 0 \beta(1-X_t)\ge0 β ( 1 − X t ) ≥ 0 . This correction depends only on the query and introduces no constraints violated by the chosen assignment.
Bob then adds the pinning gadget, making the final instance unsatisfiable exactly when X j = 1 X_j=1 X j = 1 . If each sketch uses B B B bits, Alice’s message has size O k ( n s B ) O_k(n^sB) O k ( n s B ) . Since her input contains n k n^k n k bits, the communication lower bound for INDEX implies B = Ω k ( n k − s ) B=\Omega_k(n^{k-s}) B = Ω k ( n k − s ) .
The key to matching our upper bound is an exact relation between the capturing degree and the minimum selection degree that we prove in § 3 .
Lemma 2.5 (Informal; Lemma 3.10 ). Let R ⊆ { 0 , 1 } k R\subseteq\{0,1\}^k R ⊆ { 0 , 1 } k be nonempty and proper. Let d = deg Z ( R ) d=\deg_{\mathbb{Z}}(R) d = deg Z ( R ) , and let s s s be the minimum degree of a selection polynomial over all choices of the unsatisfying tuple b ∉ R b\notin R b ∈ / R . Then d + s = k d+s=k d + s = k .
Applying the reduction with s = k − d s=k-d s = k − d gives an Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) sketching lower bound for every nonempty Boolean relation R R R that is not constant-satisfiable. The streaming-to-sketching transfer then yields an Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) strict-turnstile lower bound, matching our O k ( n d polylog n ) O_k(n^d\operatorname{polylog} n) O k ( n d polylog n ) upper bound up to polylogarithmic factors.
To see why d + s ≥ k d+s\ge k d + s ≥ k , take a degree-d d d capturing polynomial and a degree-s s s selection polynomial for some tuple b ∉ R b\notin R b ∈ / R . Their product is nonzero at b b b and zero at every other Boolean tuple. Its unique multilinear representation is therefore a nonzero multiple of
∏ i : b i = 1 z i ∏ i : b i = 0 ( 1 − z i ) , \prod_{i:b_i=1} z_i \prod_{i:b_i=0}(1-z_i), i : b i = 1 ∏ z i i : b i = 0 ∏ ( 1 − z i ) ,
which has degree k k k . Since the product has degree at most d + s d+s d + s and multilinearization cannot increase degree, we obtain d + s ≥ k d+s\ge k d + s ≥ k .
For the reverse inequality, consider all polynomials of degree less than d d d that vanish on R R R . We claim that these polynomials have a common zero b ∉ R b\notin R b ∈ / R . Otherwise, for each tuple outside R R R , we could choose such a polynomial that is nonzero at that tuple. A suitable rational linear combination would then vanish on R R R and be nonzero at every tuple outside R R R . Clearing denominators would give a capturing polynomial of degree less than d d d , a contradiction.
To construct a selection polynomial for b b b , we start with a function f f f that equals one at b b b and zero at every other tuple outside R R R . Its values on R R R remain free to choose. A linear-algebra argument using the common-zero property of b b b shows that we can choose rational values so that every Fourier term of degree less than d d d vanishes.
We then multiply f f f by the full parity character χ [ k ] \chi_{[k]} χ [ k ] . This replaces each Fourier character χ T ( z ) = ∏ i ∈ T ( 1 − 2 z i ) \chi_T(z)=\prod_{i\in T}(1-2z_i) χ T ( z ) = ∏ i ∈ T ( 1 − 2 z i ) by the character on the complementary coordinates:
χ [ k ] ( z ) χ T ( z ) = χ [ k ] ∖ T ( z ) on Boolean inputs. \chi_{[k]}(z)\chi_T(z)=\chi_{[k]\setminus T}(z)\qquad\text{on Boolean inputs.} χ [ k ] ( z ) χ T ( z ) = χ [ k ] ∖ T ( z ) on Boolean inputs.
Since every character appearing in f f f has ∣ T ∣ ≥ d |T|\ge d ∣ T ∣ ≥ d , every resulting term has degree k − ∣ T ∣ ≤ k − d k-|T|\le k-d k − ∣ T ∣ ≤ k − d . Moreover, the parity character is always 1 1 1 or − 1 -1 − 1 , so multiplication preserves exactly where f f f is zero. The resulting polynomial therefore has degree at most k − d k-d k − d , is nonzero at b b b , and vanishes at every other tuple outside R R R . Clearing denominators gives an integer selection polynomial, proving s ≤ k − d s\le k-d s ≤ k − d .
For a non-constant-satisfiable Boolean constraint language Γ \Gamma Γ , we choose R ∈ Γ R\in\Gamma R ∈ Γ of maximum capturing degree and encode Alice’s input using only constraints applied on R R R . Although R R R need not itself be a core, Γ \Gamma Γ is, so Bob can use constraints from Γ \Gamma Γ to pin his assignment up to a common automorphism of Γ \Gamma Γ . Such automorphisms preserve satisfaction of every constraint, so the same reduction yields the lower bound with exponent deg Z ( Γ ) \deg_{\mathbb{Z}}(\Gamma) deg Z ( Γ ) .
We give the full lower-bound proof, including its extension to Boolean constraint languages, in § 4 .
Bottleneck for larger domains. The degree identity above can fail over larger domains, even for relations that are already cores. Consider R = { ( x , y , z ) ∈ { 0 , 1 , 2 } 3 : x + y + z ≡ 1 ( m o d 3 ) } R=\{(x,y,z)\in\{0,1,2\}^3:x+y+z\equiv1\pmod{3}\} R = {( x , y , z ) ∈ { 0 , 1 , 2 } 3 : x + y + z ≡ 1 ( mod 3 )} . Its capturing degree is two, while its minimum selection degree is four, attained at the tuple 000 000 000 . The two degrees therefore sum to six, rather than the arity three. Our upper bound still gives an O ( n 2 polylog n ) O(n^2\operatorname{polylog} n) O ( n 2 polylog n ) -space algorithm, but the Boolean degree identity no longer provides a matching lower bound. This example shows that extending our lower-bound argument to larger domains requires a different approach. We discuss this barrier in § 6.2 .
Binary streams. In a binary stream , every constraint has frequency zero or one after each update. Thus insertions add constraints that are currently absent, and deletions remove constraints that are currently present. Binary streams form a restricted class of strict-turnstile streams. Putterman [65 ] pointed us to an O k ( n 2 polylog n ) O_k(n^2\operatorname{polylog} n) O k ( n 2 polylog n ) -space algorithm for deciding the satisfiability of k k k -XOR with literals on binary streams, for every fixed k k k [58 Theorem 5.1.3] . For every fixed k ≥ 5 k \ge5 k ≥ 5 , this upper bound is polynomially smaller than our strict-turnstile lower bound of Ω k ( n ⌈ k / 2 ⌉ ) \Omega_k(n^{\lceil k/2\rceil}) Ω k ( n ⌈ k /2 ⌉ ) , obtained from Corollary 4.15 . Thus binary streams can admit substantially smaller space bounds than general strict-turnstile streams. In a related result, Kallaugher and Price [51 ] exhibit a problem solvable in O ( log n ) O(\log n) O ( log n ) space on binary streams for which every linear sketch requires Ω ( n 1 / 3 / log 1 / 3 n ) \Omega(n^{1/3}/\log^{1/3} n) Ω ( n 1/3 / log 1/3 n ) bits. Determining the optimal space bound for k k k -XOR satisfiability with literals on binary streams and obtaining a corresponding classification for general Boolean relations remain interesting open problems.
Acknowledgements. We gratefully acknowledge Aaron (Louie) Putterman and Joshua Brakensiek for helpful discussions in the initial stages of this project. In particular, Louie generated a proof of an Ω ( n 2 ) \Omega(n^2) Ω ( n 2 ) -space lower bound for 3-XOR using GPT-6 Astra and shared it with us, which served as a key inspiration for our own hardness proof and subsequent generalizations. He also pointed us to relevant work in the streaming sparsification literature, deepening our understanding of this area. SV also thanks Samson Zhou for raising the question of deciding satisfiability in the turnstile setting following her talk at WOLA 2026. We also thank Bart M. P. Jansen for bringing the notion of nondeterministic degree of a CSP to our attention and for pointing out its connection to our work.
AI disclosure. GPT-6 Astra was used in the initial stages of this project to develop a lower-bound argument for 3-XOR. We subsequently generalized this argument to the Boolean CSPs studied in this paper without LLM assistance. Our contributions in this phase included identifying capturing degree as the governing complexity parameter and establishing its duality with selection degree.
For the upper bound, we were aware of a simple O ( n ⌈ k / 2 ⌉ ) O(n^{\lceil k/2\rceil}) O ( n ⌈ k /2 ⌉ ) -space algorithm for k k k -XOR through a reduction to the connectivity problem in [5 ] . We suspected that existing ideas in the streaming sparsification literature might suffice to generalize this algorithm to all CSPs. GPT-6 Astra then produced a proof of Equation (2.2), essentially adapting techniques from [27 , 48 , 5 ] , thus completing the proof of the upper bound.
Codex assisted with writing and literature searches under our direction. All proofs are written and verified by us, and we take full responsibility for the results and their presentation.
Preliminaries
Let R ⊆ { 0 , 1 } k R \subseteq\{0,1\}^k R ⊆ { 0 , 1 } k be a fixed Boolean relation. The arity k k k , the number of coordinates of R R R , is fixed, and constants in O k O_k O k and Ω k \Omega_k Ω k may depend only on k k k . For a positive integer m m m , we define [ m ] = { 1 , … , m } [m] = \{1,\ldots,m\} [ m ] = { 1 , … , m } . The notation polylog ( t ) \operatorname{polylog}(t) polylog ( t ) denotes a fixed power of log ( t + 2 ) \log(t+2) log ( t + 2 ) .
Relations, instances, and streams
A Boolean relation is proper if it is not the full Boolean cube. A tuple is satisfying if it belongs to R R R , and unsatisfying otherwise. We define R ‾ = { 0 , 1 } k ∖ R \overline{R} = \{0,1\}^k \setminus R R = { 0 , 1 } k ∖ R . The Hamming weight of a Boolean tuple a a a is ∑ i = 1 k a i \sum_{i=1}^k a_i ∑ i = 1 k a i . A constraint has the form R ( x i 1 , … , x i k ) R(x_{i_1},\ldots,x_{i_k}) R ( x i 1 , … , x i k ) and is satisfied by an assignment α \alpha α when ( α ( x i 1 ) , … , α ( x i k ) ) ∈ R (\alpha(x_{i_1}),\ldots,\alpha(x_{i_k})) \in R ( α ( x i 1 ) , … , α ( x i k )) ∈ R . Its scope is the ordered tuple ( x i 1 , … , x i k ) (x_{i_1},\ldots,x_{i_k}) ( x i 1 , … , x i k ) . Constraints apply R R R directly to variables, without negations or prescribed constants. The model permits repeated variables within a scope, although every constraint in our reduction has distinct variables.
An instance is a multiset of constraints. On n n n variables, we define U n \mathcal{U}_n U n to be the universe of constraint types, indexed by ordered scopes in [ n ] k [n]^k [ n ] k . We represent an instance by its frequency vector f ∈ Z ≥ 0 U n f \in\mathbb{Z}_{\ge0}^{\mathcal{U}_n} f ∈ Z ≥ 0 U n . A constraint C C C is active if f C > 0 f_C > 0 f C > 0 . We define supp ( f ) = { C : f C > 0 } \operatorname{supp}(f) = \{C : f_C > 0\} supp ( f ) = { C : f C > 0 } as the set of active constraints. An assignment satisfies the instance if it satisfies every active constraint. We define Sat R ( f ) \operatorname{Sat}_{R}(f) Sat R ( f ) to be the set of such assignments and CSP ( R ) \operatorname{CSP}(R) CSP ( R ) to be the problem of deciding whether this set is nonempty. For a set S S S of constraint types, we also write S S S for the frequency vector with value one on S S S and zero elsewhere. This convention for sets does not restrict the multiplicities in a general multiset instance.
Constraint languages. A constraint language Γ \Gamma Γ is a fixed finite collection of relations over a common finite domain D D D . We assume without loss of generality that all its relations have a common arity k k k . 13 A constraint in a Γ \Gamma Γ -instance has the form R ( x i 1 , … , x i k ) R(x_{i_1}, \ldots, x_{i_k}) R ( x i 1 , … , x i k ) for some R ∈ Γ R \in\Gamma R ∈ Γ , and CSP ( Γ ) \operatorname{CSP}(\Gamma) CSP ( Γ ) asks whether all its constraints can be satisfied simultaneously. The universe U n Γ U_n^\Gamma U n Γ specifies both a relation and an ordered scope, so ∣ U n Γ ∣ = ∑ R ∈ Γ n k ≤ ∣ Γ ∣ n k \lvert U_n^\Gamma\rvert= \sum_{R\in\Gamma} n^k \leq\lvert\Gamma\rvert n^k ∣ U n Γ ∣ = ∑ R ∈ Γ n k ≤ ∣ Γ ∣ n k . We write Sat Γ ( f ) \operatorname{Sat}_{\Gamma}(f) Sat Γ ( f ) for the satisfying assignments of an instance f f f . The frequency-vector, stream, and sketch definitions apply with this universe as well. A language is Boolean when D = { 0 , 1 } D = \{0,1\} D = { 0 , 1 } , and we use O k O_k O k and Ω k \Omega_k Ω k in this case. Over a domain of size q q q , we use O k , q O_{k,q} O k , q and Ω k , q \Omega_{k,q} Ω k , q . For fixed k , q k,q k , q , there are only finitely many relations of arity at most k k k and constraint languages, including their restrictions to core domains. We fix the polynomial and gadget choices for each of them, so the constants in our bounds can be chosen to depend only on k , q k,q k , q .
Streams. A unit update inserts or deletes one copy of a constraint. A stream starts from the zero frequency vector and is strict turnstile if every prefix frequency vector is nonnegative. Both strict-turnstile and signed streams permit updates of − 1 -1 − 1 . A signed stream may delete a constraint more times than it has been inserted, making its accumulated frequency negative; the strict-turnstile model forbids this. A one-pass algorithm processes the updates once and decides satisfiability at the end. We allow unrestricted computation time and count all retained memory, including decoding workspace.
Non-constant-satisfiable CSP. We call R R R , or CSP ( R ) \operatorname{CSP}(R) CSP ( R ) , constant-satisfiable if there is a value a ∈ { 0 , 1 } a \in\{0,1\} a ∈ { 0 , 1 } such that assigning a a a to every variable satisfies every instance. This holds exactly when 0 k ∈ R 0^k \in R 0 k ∈ R or 1 k ∈ R 1^k \in R 1 k ∈ R . We call R R R non-constant-satisfiable if neither tuple belongs to R R R . If R R R is constant-satisfiable, an algorithm can ignore all updates and always report satisfiable, using constant space. If R = ∅ R = \varnothing R = ∅ , every active constraint is unsatisfiable, so it suffices to maintain the counter ∑ C ∈ U n f C \sum_{C\in U_n} f_C ∑ C ∈ U n f C and report satisfiable exactly when it is zero. When every prefix multiplicity is at most μ \mu μ , this counter uses O k ( log ( n μ + 2 ) ) O_k(\log(n\mu+2)) O k ( log ( n μ + 2 )) bits. Thus the only nontrivial cases are the nonempty, non-constant-satisfiable relations.
A Boolean language Γ \Gamma Γ is constant-satisfiable if there is one value a ∈ { 0 , 1 } a \in\{0,1\} a ∈ { 0 , 1 } such that a k ∈ R a^k \in R a k ∈ R for every R ∈ Γ R \in\Gamma R ∈ Γ , and non-constant-satisfiable otherwise. In the former case, the constant assignment with value a a a satisfies every Γ \Gamma Γ -instance, so decision uses constant space. The value must be common to all relations; the individual relations may be constant-satisfiable without the language being so. Empty relations can be handled separately by a counter for the total number of their active copies, using O k ( log ( n μ + 2 ) ) O_k(\log(n\mu+2)) O k ( log ( n μ + 2 )) bits when prefix multiplicities are at most μ \mu μ . If this counter is positive the instance is unsatisfiable; otherwise only the nonempty relations matter. Full relations impose no restrictions. We therefore state the language extensions for collections of nonempty proper relations.
Unless otherwise specified, R ⊆ { 0 , 1 } k R \subseteq\{0,1\}^k R ⊆ { 0 , 1 } k is assumed to be a fixed, proper (i.e., R ≠ { 0 , 1 } k R \ne\{0,1\}^k R = { 0 , 1 } k ), nonempty, non-constant-satisfiable Boolean relation, as assumed in the introduction.
Linear sketches
For the lower bound, we consider the following finite-image form of a linear sketch , following [40 Definition 3.1.3] . A linear sketch is specified by a public random seed ω \omega ω and a sketching map L ω : Z U n ⟶ Γ ω L_\omega: \mathbb{Z}^{U^n} \longrightarrow\Gamma_\omega L ω : Z U n ⟶ Γ ω into a finite abelian group. The map is a homomorphism, and L ω ( f ) L_\omega(f) L ω ( f ) is the sketch of f f f . Additivity means L ω ( f + h ) = L ω ( f ) + L ω ( h ) L_\omega(f+h)=L_\omega(f)+L_\omega(h) L ω ( f + h ) = L ω ( f ) + L ω ( h ) for all integer vectors f , h f,h f , h , including signed vectors. The decoder receives ω \omega ω and L ω ( f ) L_\omega(f) L ω ( f ) and decides whether the instance f f f is satisfiable. We define the sketch size to be B = sup ω log 2 ∣ im L ω ∣ B=\sup_\omega\log_2|\operatorname{im} L_\omega| B = sup ω log 2 ∣ im L ω ∣ . Thus one sketch can be encoded in at most B + 1 B+1 B + 1 bits; the public seed is not charged to this bound. For a constraint C C C , we define e C e_C e C to be the frequency vector corresponding to one copy of C C C .
Cores and pinning
Our proofs work directly with non-constant-satisfiable Boolean relations and do not require first replacing a relation by its core. We nevertheless recall cores and their consequences, particularly the pinning lemma that we use below, and retain the general reduction to a core for completeness. In this subsection, R R R may be any nonempty Boolean relation.
Definition 3.1 (Automorphisms and cores). An automorphism of R R R is a bijection g : { 0 , 1 } → { 0 , 1 } g:\{0,1\}\to\{0,1\} g : { 0 , 1 } → { 0 , 1 } such that a ∈ R a\in R a ∈ R if and only if g ( a ) ∈ R g(a)\in R g ( a ) ∈ R , where g g g is applied coordinatewise. We define Aut ( R ) \operatorname{Aut}(R) Aut ( R ) to be the set of these maps. The relation R R R is a core if every map e : { 0 , 1 } → { 0 , 1 } e:\{0,1\}\to\{0,1\} e : { 0 , 1 } → { 0 , 1 } with e ( R ) ⊆ R e(R)\subseteq R e ( R ) ⊆ R is an automorphism.
Observation 3.2 (Boolean cores and constant assignments). For a nonempty Boolean relation R R R , the relation R R R is a core if and only if CSP ( R ) \operatorname{CSP}(R) CSP ( R ) is non-constant-satisfiable.
Proof. The only nonbijective maps from { 0 , 1 } \{0,1\} { 0 , 1 } to itself are the two constant maps. Since R R R is nonempty, applying the constant map with value a a a to R R R gives the singleton set { a k } \{a^k\} { a k } . This map therefore preserves R R R exactly when a k ∈ R a^k\in R a k ∈ R . If either constant tuple belongs to R R R , a nonbijective map preserves R R R , so R R R is not a core. Conversely, if neither tuple belongs to R R R , every map preserving R R R must be a permutation. Such a permutation maps R R R onto itself, since R R R is finite, and hence is an automorphism. This proves the equivalence. □
We also retain the notation for the core of an arbitrary nonempty Boolean relation. If either constant tuple belongs to R R R , choose such a value a a a and define core ( R ) = R ∩ { a } k \operatorname{core}(R)=R\cap\{a\}^k core ( R ) = R ∩ { a } k , considered as a relation on the one-element domain { a } \{a\} { a } . Otherwise, define core ( R ) = R \operatorname{core}(R)=R core ( R ) = R . Thus the core removes any domain value unnecessary for satisfiability. We use R ⋆ = core ( R ) R^\star=\operatorname{core}(R) R ⋆ = core ( R ) for this relation. However, as implied by Observation 3.2 , for the nontrivial cases we consider throughout this paper, i.e., if R R R is nonempty and non-constant-satisfiable, then core ( R ) = R \operatorname{core}(R)=R core ( R ) = R .
The reduction of [19 ] lets us replace R R R by its core. Intuitively, applying the map onto the core to any satisfying assignment gives a satisfying assignment over the core domain; an assignment over that domain is already an assignment for R R R .
Lemma 3.3 (Reduction to the core, [19 Lemma 4.2] ). Replacing each R R R -constraint by the core ( R ) \operatorname{core}(R) core ( R ) -constraint on the same scope preserves satisfiability in both directions. This replacement preserves variables, multiplicities, and the update sequence. Consequently, the two decision problems have the same strict-turnstile streaming space complexity, up to constant extra space.
For a core relation, we can add constraints so that every satisfying assignment agrees with a chosen assignment on the original variables, up to applying one common automorphism. This common change of values preserves whether any constraint on the original variables is satisfied. The following variant of [19 Lemma 4.4] gives this guarantee with distinct variables within every scope.
Lemma 3.4 (Core pinning, [19 Lemma 4.4] ). If R R R is a core, then for every variable set V V V and every assignment α : V → { 0 , 1 } \alpha: V \to\{0,1\} α : V → { 0 , 1 } , there are a set Y Y Y of 4 k 4k 4 k variables disjoint from V V V and an R R R -instance P α P_\alpha P α on V ∪ Y V \cup Y V ∪ Y with O k ( ∣ V ∣ + 1 ) O_k(|V|+1) O k ( ∣ V ∣ + 1 ) constraints such that
{ γ ∣ V : γ ∈ Sat R ( P α ) } = { g ∘ α : g ∈ Aut ( R ) } . \{\gamma|_V : \gamma\in\operatorname{Sat}_R(P_\alpha)\} = \{g \circ\alpha: g \in\operatorname{Aut}(R)\}. { γ ∣ V : γ ∈ Sat R ( P α )} = { g ∘ α : g ∈ Aut ( R )} . Here γ ∣ V \gamma|_V γ ∣ V denotes the restriction of γ \gamma γ to V V V . Every scope contains distinct variables and at least one variable from Y Y Y . The variables in Y Y Y may be shared by several constraints. No ordered scope is repeated. If R R R is symmetric, meaning that membership is invariant under coordinate permutations, unordered scopes can also be deduplicated.
Cores of constraint languages. A map e : D → D e : D \to D e : D → D is an endomorphism of Γ \Gamma Γ if it preserves every relation in Γ \Gamma Γ . An automorphism is a bijection preserving membership in every relation in both directions; these maps form Aut ( Γ ) \operatorname{Aut}(\Gamma) Aut ( Γ ) . The language is a core if every endomorphism is an automorphism. For a Boolean language of nonempty relations, a constant map preserves the language exactly when its value satisfies every relation. Since constant maps are the only nonbijective Boolean maps, Γ \Gamma Γ is a core if and only if it is non-constant-satisfiable, by the same argument as in Observation 3.2 . If a common satisfying value a a a exists, define core ( Γ ) \operatorname{core}(\Gamma) core ( Γ ) by restricting every relation to the domain { a } \{a\} { a } ; otherwise, define core ( Γ ) = Γ \operatorname{core}(\Gamma)=\Gamma core ( Γ ) = Γ . Thus the core is taken for the entire language, with one common domain restriction. For an r r r -ary relation R R R , a map of the domain preserves R × D k − r R \times D^{k-r} R × D k − r if and only if it preserves R R R . Thus padding leaves the language’s endomorphisms, automorphisms, and common constant satisfying assignments unchanged.
Brakensiek, Putterman, Sharma, and Velusamy [19 Appendix A] extend the core reduction and pinning argument to constraint languages. In particular, when Γ \Gamma Γ is a core, any assignment α \alpha α on a variable set V V V can be pinned, up to one common automorphism in Aut ( Γ ) \operatorname{Aut}(\Gamma) Aut ( Γ ) , using constraints from Γ \Gamma Γ . The pinning instance has O k , q ( ∣ V ∣ + 1 ) O_{k,q}(|V|+1) O k , q ( ∣ V ∣ + 1 ) constraints and O k , q ( 1 ) O_{k,q}(1) O k , q ( 1 ) additional variables, and the assignments on V V V extending to its solutions are exactly { g ∘ α : g ∈ Aut ( Γ ) } \{g \circ\alpha: g \in\operatorname{Aut}(\Gamma)\} { g ∘ α : g ∈ Aut ( Γ )} .
Capturing and selection polynomials
We now define the notion of a capturing polynomial which is zero precisely on the satisfying tuples. The definitions and lemmas in this subsection apply to every nonempty proper Boolean relation R R R , whether or not it is constant-satisfiable.
Definition 3.5 (Capturing polynomial). An integer polynomial p ∈ Z [ z 1 , … , z k ] p \in\mathbb{Z}[z_1,\ldots,z_k] p ∈ Z [ z 1 , … , z k ] captures R R R if, for every Boolean tuple a a a ,
p ( a ) = 0 ⟺ a ∈ R . p(a)=0 \iff a \in R. p ( a ) = 0 ⟺ a ∈ R . The integer capturing degree d = deg Z ( R ) d=\deg_{\mathbb{Z}}(R) d = deg Z ( R ) is the minimum degree of such a polynomial. For an unsatisfying tuple b b b , we also define
d R ( b ) = min { deg p : p ∈ Z [ z 1 , … , z k ] , p ( a ) = 0 for every a ∈ R , p ( b ) ≠ 0 } . d_R(b)=\min\{\deg p : p \in\mathbb{Z}[z_1,\ldots,z_k],\ p(a)=0\text{ for every }a \in R,\ p(b)\ne0\}. d R ( b ) = min { deg p : p ∈ Z [ z 1 , … , z k ] , p ( a ) = 0 for every a ∈ R , p ( b ) = 0 } . A polynomial in the latter minimum may be zero at other unsatisfying tuples.
For a one-element core, we set $\deg_{\mathbb{Z}}(\operatorname{core}(R))=0.
Observation 3.6 (Integer, rational, and real coefficients). Let D ⊆ Z D \subseteq\mathbb{Z} D ⊆ Z be finite and let R ⊊ D k R \subsetneq D^k R ⊊ D k be nonempty. The minimum degree of a polynomial whose zeros on D k D^k D k are exactly R R R is the same for integer, rational, and real coefficients. The same holds for the minimum degree of a polynomial vanishing on R R R and nonzero at a specified tuple b ∈ D k ∖ R b \in D^k \setminus R b ∈ D k ∖ R .
Proof. Let p p p be a real polynomial of degree d d d whose zeros on D k D^k D k are exactly R R R . Vanishing on R R R imposes homogeneous linear equations on the coefficients of a polynomial of degree at most d d d . These equations have integer coefficients, since every element of D D D is an integer. Gaussian elimination therefore gives a basis p 1 , … , p m p_1,\ldots,p_m p 1 , … , p m of the real solution space consisting of polynomials with rational coefficients. Write p = ∑ i a i p i p = \sum_i a_i p_i p = ∑ i a i p i with a i ∈ R a_i \in\mathbb{R} a i ∈ R .
Replace the a i a_i a i by sufficiently close rational numbers. The resulting polynomial still vanishes on R R R , because every p i p_i p i does. It remains nonzero at every tuple outside R R R , because there are finitely many such tuples and evaluation at each is continuous in the coefficients. Clearing denominators then gives an integer polynomial of degree at most d d d with the same zeros on D k D^k D k . The reverse inequality follows because every integer polynomial is also a rational and a real polynomial. For the second statement, the same argument only requires preserving the nonzero value at b b b .
For Boolean relations, without loss of generality, we assume that the polynomials in these definitions are multilinear, meaning that every variable has exponent at most one: replacing every positive power z i r z_i^r z i r by z i z_i z i preserves all Boolean evaluations and cannot increase degree.
We also have
d = deg Z ( R ) = max b ∈ R ‾ d R ( b ) . (4) d = \deg_{\mathbb{Z}}(R) = \max_{b \in\overline{R}} d_R(b). \tag*{(4)} d = deg Z ( R ) = b ∈ R max d R ( b ) . (4)
Every capturing polynomial separates each unsatisfying tuple from R R R , giving d ≥ max b d R ( b ) d \ge\max_b d_R(b) d ≥ max b d R ( b ) . For the reverse inequality, enumerate R ‾ = { b 1 , … , b ℓ } \overline{R} = \{b_1,\ldots,b_\ell\} R = { b 1 , … , b ℓ } and choose an integer polynomial p i p_i p i attaining d R ( b i ) d_R(b_i) d R ( b i ) . For each b j b_j b j , the expression ∑ i = 1 ℓ T i − 1 p i ( b j ) \sum_{i=1}^{\ell} T^{i-1}p_i(b_j) ∑ i = 1 ℓ T i − 1 p i ( b j ) is a nonzero polynomial in T T T , since its coefficient of T j − 1 T^{j-1} T j − 1 is p j ( b j ) ≠ 0 p_j(b_j) \ne0 p j ( b j ) = 0 . Choose an integer T T T that is not a root of any of these finitely many polynomials. Then ∑ i T i − 1 p i \sum_i T^{i-1}p_i ∑ i T i − 1 p i captures R R R and has degree at most max b d R ( b ) \max_b d_R(b) max b d R ( b ) .
Definition 3.8 (Capturing degree of a constraint language). For a fixed finite Boolean language Γ \Gamma Γ of nonempty proper relations, its integer capturing degree is deg Z ( Γ ) = max R ∈ Γ deg Z ( R ) \deg_{\mathbb{Z}}(\Gamma) = \max_{R \in\Gamma} \deg_{\mathbb{Z}}(R) deg Z ( Γ ) = max R ∈ Γ deg Z ( R ) . Equivalently, it is the least d d d such that every R ∈ Γ R \in\Gamma R ∈ Γ has an integer capturing polynomial of degree at most d d d . We set this degree to zero for the empty language and for a language on a one-element core domain. Empty and full relations do not contribute to the maximum and are handled as described above.
Padding preserves capturing degree. If R R R has arity r r r and R ′ = R × { 0 , 1 } k − r R' = R \times\{0,1\}^{k-r} R ′ = R × { 0 , 1 } k − r , a polynomial capturing R R R also captures R ′ R' R ′ when viewed as a polynomial in k k k variables. Conversely, setting the added coordinates to zero in a polynomial capturing R ′ R' R ′ gives one capturing R R R , without increasing its degree. Hence deg Z ( R ′ ) = deg Z ( R ) \deg_{\mathbb{Z}}(R') = \deg_{\mathbb{Z}}(R) deg Z ( R ′ ) = deg Z ( R ) , so padding does not change the language’s capturing degree.
We now define a selection polynomial which we use to separate an unsatisfying tuple from all the other unsatisfying tuples.
Definition 3.9 (Selection polynomial). For an unsatisfying tuple b b b , an integer polynomial q ∈ Z [ z 1 , … , z k ] q \in\mathbb{Z}[z_1,\ldots,z_k] q ∈ Z [ z 1 , … , z k ] selects b b b if
q ( b ) ≠ 0 , q ( a ) = 0 for every unsatisfying a ≠ b . q(b) \ne0,\qquad q(a) = 0 \quad\text{for every unsatisfying } a \ne b. q ( b ) = 0 , q ( a ) = 0 for every unsatisfying a = b . Its values on satisfying tuples are unrestricted. We define s R ( b ) s_R(b) s R ( b ) to be the minimum degree of a selection polynomial for b b b .
Lemma 3.10 (Capturing and selection degrees). For every unsatisfying tuple b ∉ R b \notin R b ∈ / R ,
d R ( b ) + s R ( b ) = k . d_R(b) + s_R(b) = k. d R ( b ) + s R ( b ) = k . Consequently, if d = deg Z ( R ) d = \deg_{\mathbb{Z}}(R) d = deg Z ( R ) , then some unsatisfying tuple b b b has an integer multilinear selection polynomial q q q of degree k − d k-d k − d with q ( b ) > 0 q(b) > 0 q ( b ) > 0 .
Proof. Fix b ∉ R b \notin R b ∈ / R and define r = d R ( b ) r = d_R(b) r = d R ( b ) . We first show that r + s R ( b ) ≥ k r + s_R(b) \ge k r + s R ( b ) ≥ k . Let p p p be a degree-r r r polynomial that is zero on R R R and nonzero at b b b , and let q q q be a minimum-degree selection polynomial for b b b . On the Boolean cube, the product p q pq pq is nonzero exactly at b b b , and so its unique multilinear representation is
p ( b ) q ( b ) ∏ i : b i = 1 z i ∏ i : b i = 0 ( 1 − z i ) . p(b)q(b)\prod_{i:b_i=1} z_i\prod_{i:b_i=0}(1-z_i). p ( b ) q ( b ) i : b i = 1 ∏ z i i : b i = 0 ∏ ( 1 − z i ) . Observe that the coefficient of z 1 ⋯ z k z_1\cdots z_k z 1 ⋯ z k is nonzero, and hence it has degree k k k . Since multilinearization cannot increase degree, we get
k ≤ deg ( p q ) ≤ r + s R ( b ) . k \le\deg(pq) \le r+s_R(b). k ≤ deg ( pq ) ≤ r + s R ( b ) . For the reverse inequality, we construct a selection polynomial of degree at most k − r k-r k − r . We work over Q \mathbb{Q} Q , since rescaling to integer coefficients does not change the degree.
By the minimality of r r r , every polynomial of degree less than r r r that is zero on R R R must also be zero at b b b . Let v ( a ) v(a) v ( a ) be the vector of all multilinear monomials of degree less than r r r , evaluated at a a a . We claim that v ( b ) v(b) v ( b ) lies in the rational span of the vectors v ( a ) v(a) v ( a ) for a ∈ R a \in R a ∈ R . Otherwise, there would be a rational vector u u u with u T v ( a ) = 0 u^{\mathsf{T}}v(a)=0 u T v ( a ) = 0 for every a ∈ R a \in R a ∈ R but u T v ( b ) ≠ 0 u^{\mathsf{T}}v(b)\ne0 u T v ( b ) = 0 . The polynomial h ( z ) = u T v ( z ) h(z)=u^{\mathsf{T}}v(z) h ( z ) = u T v ( z ) would then have degree less than r r r , vanish on R R R , and be nonzero at b b b , a contradiction.
Consequently, v ( b ) = ∑ a ∈ R λ a v ( a ) v(b)=\sum_{a\in R}\lambda_a v(a) v ( b ) = ∑ a ∈ R λ a v ( a ) for rational coefficients λ a \lambda_a λ a . Taking the inner product with the coefficient vector of any multilinear polynomial h h h of degree less than r r r gives
h ( b ) = ∑ a ∈ R λ a h ( a ) for every h with deg h < r . (5) h(b)=\sum_{a\in R}\lambda_a h(a)\qquad\text{for every }h\text{ with }\deg h<r. \tag*{(5)} h ( b ) = a ∈ R ∑ λ a h ( a ) for every h with deg h < r . (5) The coefficients λ a \lambda_a λ a depend only on these evaluation vectors, so the same coefficients work for every h h h . Multilinearizing h h h preserves its Boolean evaluations and cannot increase its degree, so the identity also holds when h h h is not multilinear.
We use these coefficients to construct a selection polynomial for b b b of degree at most k − r k-r k − r . For each Boolean tuple a a a , define
c a = { 1 , a = b , − λ a , a ∈ R , 0 , otherwise . c_a =
\begin{cases}
1, & a=b,\\
-\lambda_a, & a\in R,\\
0, & \text{otherwise}.
\end{cases} c a = ⎩ ⎨ ⎧ 1 , − λ a , 0 , a = b , a ∈ R , otherwise . By Equation (5) ,
∑ a ∈ { 0 , 1 } k c a h ( a ) = 0 for every h with deg h < r . (6) \sum_{a\in\{0,1\}^k} c_a h(a)=0\qquad\text{for every }h\text{ with }\deg h<r. \tag*{(6)} a ∈ { 0 , 1 } k ∑ c a h ( a ) = 0 for every h with deg h < r . (6) For each a ∈ { 0 , 1 } k a\in\{0,1\}^k a ∈ { 0 , 1 } k , define its indicator polynomial
δ a ( z ) = ∏ i : a i = 1 z i ∏ i : a i = 0 ( 1 − z i ) . \delta_a(z)=\prod_{i:a_i=1}z_i\prod_{i:a_i=0}(1-z_i). δ a ( z ) = i : a i = 1 ∏ z i i : a i = 0 ∏ ( 1 − z i ) .
On Boolean inputs, δ a \delta_a δ a equals one at a a a and zero at every other tuple. Consider the rational multilinear polynomial
q ( z ) = ∑ a ∈ { 0 , 1 } k ( − 1 ) ∣ a ∣ c a δ a ( z ) . q(z)=\sum_{a\in\{0,1\}^{k}}(-1)^{|a|}c_a\delta_a(z). q ( z ) = a ∈ { 0 , 1 } k ∑ ( − 1 ) ∣ a ∣ c a δ a ( z ) .
Here ∣ a ∣ = ∑ i = 1 k a i |a|=\sum_{i=1}^{k}a_i ∣ a ∣ = ∑ i = 1 k a i is the Hamming weight of a a a . For every a ∈ { 0 , 1 } k a\in\{0,1\}^{k} a ∈ { 0 , 1 } k , we have q ( a ) = ( − 1 ) ∣ a ∣ c a q(a)=(-1)^{|a|}c_a q ( a ) = ( − 1 ) ∣ a ∣ c a . Thus q ( b ) ≠ 0 q(b)\ne0 q ( b ) = 0 and q q q is zero at every other unsatisfying tuple. Clearing denominators will give an integer polynomial with these same zeros.
It remains to show that deg q ≤ k − r \deg q\le k-r deg q ≤ k − r . Fix S ⊆ [ k ] S\subseteq[k] S ⊆ [ k ] and define z S = ∏ i ∈ S z i z_S=\prod_{i\in S}z_i z S = ∏ i ∈ S z i . The coefficient γ S \gamma_S γ S of z S z_S z S in q q q is
γ S = ( − 1 ) ∣ S ∣ ∑ a ∈ { 0 , 1 } k a i = 0 ∀ i ∉ S c a = ( − 1 ) ∣ S ∣ ∑ a ∈ { 0 , 1 } k c a ∏ i ∉ S ( 1 − a i ) . \begin{aligned}
\gamma_S=(-1)^{|S|}\sum_{\substack{a\in\{0,1\}^{k}\\a_i=0\ \forall i\notin S}}c_a \\
&=(-1)^{|S|}\sum_{a\in\{0,1\}^{k}}c_a\prod_{i\notin S}(1-a_i).
\end{aligned} γ S = ( − 1 ) ∣ S ∣ a ∈ { 0 , 1 } k a i = 0 ∀ i ∈ / S ∑ c a = ( − 1 ) ∣ S ∣ a ∈ { 0 , 1 } k ∑ c a i ∈ / S ∏ ( 1 − a i ) .
This is because in the expansion of δ a \delta_a δ a , the coefficient of z S z_S z S is zero unless every coordinate where a i = 1 a_i=1 a i = 1 belongs to S S S , in which case it equals ( − 1 ) ∣ S ∣ − ∣ a ∣ (-1)^{|S|-|a|} ( − 1 ) ∣ S ∣ − ∣ a ∣ .
Now, note that if ∣ S ∣ > k − r |S|>k-r ∣ S ∣ > k − r , the polynomial
h S ( z ) = ∏ i ∉ S ( 1 − z i ) h_S(z)=\prod_{i\notin S}(1-z_i) h S ( z ) = i ∈ / S ∏ ( 1 − z i )
has degree k − ∣ S ∣ < r k-|S|<r k − ∣ S ∣ < r . By (6) , the coefficient γ S \gamma_S γ S is therefore zero.
Thus the coefficient of every monomial of degree greater than k − r k-r k − r is zero, proving that deg q ≤ k − r \deg q\le k-r deg q ≤ k − r . Rescaling the coefficients gives an integer selection polynomial of the same degree. Consequently, s R ( b ) ≤ k − r s_R(b)\le k-r s R ( b ) ≤ k − r . Combining the two inequalities yields d R ( b ) + s R ( b ) = k d_R(b)+s_R(b)=k d R ( b ) + s R ( b ) = k .
Finally, by Equation (4) , there exists an unsatisfying tuple b b b with d R ( b ) = d d_R(b)=d d R ( b ) = d . The equality just proved gives a multilinear integer selection polynomial of degree k − d k-d k − d . Changing its sign if necessary ensures q ( b ) > 0 q(b)>0 q ( b ) > 0 . □
As an example, we show that the capturing and selection degrees of k k k -XOR are ⌈ k / 2 ⌉ \lceil k/2\rceil ⌈ k /2 ⌉ and ⌊ k / 2 ⌋ \lfloor k/2\rfloor ⌊ k /2 ⌋ , respectively.
Corollary 3.13 (Capturing degree of parity). For every k ≥ 2 k\ge2 k ≥ 2 and β ∈ { 0 , 1 } \beta\in\{0,1\} β ∈ { 0 , 1 } , the relation
R β = { z ∈ { 0 , 1 } k : ∑ i = 1 k z i ≡ β ( m o d 2 ) } R_\beta=\left\{z\in\{0,1\}^{k}:\sum_{i=1}^{k}z_i\equiv\beta\pmod2\right\} R β = { z ∈ { 0 , 1 } k : i = 1 ∑ k z i ≡ β ( mod 2 ) } has integer capturing degree ⌈ k / 2 ⌉ \lceil k/2\rceil ⌈ k /2 ⌉ . The same bound holds when any subset of the coordinates is complemented.
Proof. First consider R 1 R_1 R 1 and let w = z 1 + ⋯ + z k w=z_1+\cdots+z_k w = z 1 + ⋯ + z k . The polynomial
p ( z ) = ∏ j = 0 ⌈ k / 2 ⌉ − 1 ( w − ( 2 j + 1 ) ) p(z)=\prod_{j=0}^{\lceil k/2\rceil-1}(w-(2j+1)) p ( z ) = j = 0 ∏ ⌈ k /2 ⌉ − 1 ( w − ( 2 j + 1 )) vanishes exactly on the odd-weight tuples, so deg Z ( R 1 ) ≤ ⌈ k / 2 ⌉ \deg_Z(R_1)\le\lceil k/2\rceil deg Z ( R 1 ) ≤ ⌈ k /2 ⌉ . On the other hand,
q ( z ) = ∏ j = 1 ⌊ k / 2 ⌋ ( w − 2 j ) q(z)=\prod_{j=1}^{\lfloor k/2\rfloor}(w-2j) q ( z ) = j = 1 ∏ ⌊ k /2 ⌋ ( w − 2 j )
is nonzero at 0 k 0^k 0 k and vanishes at every other even-weight tuple. It therefore selects 0 k 0^k 0 k , giving s R 1 ( 0 k ) ≤ ⌊ k / 2 ⌋ s_{R_1}(0^k) \le\lfloor k/2 \rfloor s R 1 ( 0 k ) ≤ ⌊ k /2 ⌋ . By Lemma 3.10 ,
deg Z ( R 1 ) ≥ d R 1 ( 0 k ) = k − s R 1 ( 0 k ) ≥ ⌈ k / 2 ⌉ . \deg_{\mathbb{Z}}(R_1) \ge d_{R_1}(0^k) = k - s_{R_1}(0^k) \ge\lceil k/2 \rceil. deg Z ( R 1 ) ≥ d R 1 ( 0 k ) = k − s R 1 ( 0 k ) ≥ ⌈ k /2 ⌉ .
This proves equality. Complementing the coordinates is an invertible affine substitution on the Boolean cube, so it preserves the minimum capturing degree. Complementing one coordinate exchanges R 0 R_0 R 0 and R 1 R_1 R 1 , proving the remaining assertions.
Linear-algebra notation
For symmetric matrices, U ⪯ V U \preceq V U ⪯ V means x ⊤ U x ≤ x ⊤ V x x^\top Ux \le x^\top Vx x ⊤ U x ≤ x ⊤ V x for every real vector x x x . A symmetric matrix U U U is positive semidefinite if x ⊤ U x ≥ 0 x^\top Ux \ge0 x ⊤ U x ≥ 0 for all x x x , and positive definite if the inequality is strict for nonzero x x x . Its operator norm ∥ U ∥ o p \lVert U\rVert_{\mathrm{op}} ∥ U ∥ op is its largest absolute eigenvalue. Let I I I be the identity matrix, and let diag ( f ) \operatorname{diag}(f) diag ( f ) be the diagonal matrix with entries f i f_i f i . For a square matrix G G G , tr G \operatorname{tr} G tr G is the sum of its diagonal entries, and rank G \operatorname{rank} G rank G is the dimension of its column span. For positive semidefinite G G G , its pseudoinverse G † G^\dagger G † is obtained by inverting each positive eigenvalue and leaving zero eigenvalues at zero.
Lower bound
We prove that deciding satisfiability under our strict turnstile model requires Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits of space, where d d d is the integer capturing degree of R R R and n n n is the number of variables. This bound applies to algorithms required to handle all legal streams up to a sufficiently large polynomial length.
Theorem 4.1 (Main lower bound). Let R R R be a fixed nonempty, non-constant-satisfiable Boolean relation and let d = deg Z ( R ) d = \deg_{\mathbb{Z}}(R) d = deg Z ( R ) . There is a constant c R c_R c R such that every randomized one-pass algorithm deciding CSP ( R ) \operatorname{CSP}(R) CSP ( R ) with error at most 1 / 3 1/3 1/3 on every strict-turnstile stream of length at most n c R n^{c_R} n c R on n n n variables uses
Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits of space, for all sufficiently large n n n .
To prove this theorem, we combine two statements. The first, proved in § 4.1 , is the lower bound for linear sketches.
Theorem 4.2 (Sketching lower bound). For a fixed nonempty, non-constant-satisfiable Boolean relation R R R with d = deg Z ( R ) d = \deg_{\mathbb{Z}}(R) d = deg Z ( R ) , there is a constant F R F_R F R such that, for every sufficiently large n n n , there is a distribution on instances on n n n variables with frequencies at most F R F_R F R for which every public-coin linear sketch deciding satisfiability with average error at most 1 / 3 1/3 1/3 has size Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) . Every constraint in these instances has distinct variables within its scope.
The second statement follows from the strict-turnstile streaming-to-sketching theorem of Jiang, Liu, and Yu [40 Corollary 7.2.2] .
Theorem 4.3 (Strict-turnstile streaming to sketching, [40 Corollary 7.2.2] ). Fix R R R and a constant integer F ≥ 1 F \ge1 F ≥ 1 . There is a constant c R , F c_{R,F} c R , F such that any randomized S S S -bit one-pass algorithm deciding CSP ( R ) \operatorname{CSP}(R) CSP ( R ) with error at most 1 / 3 1/3 1/3 on every strict-turnstile stream of length at most n c R , F n^{c_{R,F}} n c R , F yields a public-coin linear sketch with the same error bound on every instance in { 0 , … , F } U n \{0,\ldots,F\}^{\mathcal{U}_n} { 0 , … , F } U n and size O k , F ( S ) O_{k,F}(S) O k , F ( S ) , for all sufficiently large n n n . Although the final frequency of each constraint is at most F F F , its intermediate frequency during the stream may be polynomially large in n n n .
Every final instance in { 0 , … , F } U n \{0,\ldots,F\}^{\mathcal{U}_n} { 0 , … , F } U n has at most F n k F n^k F n k constraint copies. We first reduce the streaming error to 1 / 100 1/100 1/100 using a constant number of independent copies. For sufficiently large c R , F c_{R,F} c R , F , we have n c R , F ≥ ( n + F n k + 100 ) C R n^{c_{R,F}} \ge(n+F n^k+100)^{C_R} n c R , F ≥ ( n + F n k + 100 ) C R , where C R C_R C R is the constant in their corollary. Their frequency-vector argument then gives a public-coin sketch with image size 2 O k , F ( S ) 2^{O_{k,F}(S)} 2 O k , F ( S ) , hence size O k , F ( S ) O_{k,F}(S) O k , F ( S ) bits, and error at most 3 / 100 3/100 3/100 .
These statements give the streaming lower bound directly.
Proof of Theorem 4.1 . Choose c R c_R c R large enough to apply Theorem 4.3 with the constant F R F_R F R from Theorem 4.2. An S S S -bit streaming algorithm then gives a linear sketch of size O k ( S ) O_k(S) O k ( S ) , whereas Theorem 4.2 requires Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits. Therefore, S = Ω k ( n d ) S=\Omega_k(n^d) S = Ω k ( n d ) .
It remains to prove Theorem 4.2, which we do in the next subsection.
INDEX to sketching reduction
We now prove Theorem 4.2. We retain the standing assumption that R R R is nonempty and non-constant-satisfiable, and let d = deg Z ( R ) d=\deg_{\mathbb{Z}}(R) d = deg Z ( R ) . We construct a hard distribution with frequencies bounded by O k ( 1 ) O_k(1) O k ( 1 ) and show that a linear sketch for it requires Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits per sketch. To prove the hardness, we reduce one-way INDEX to satisfiability. In INDEX, Alice receives a Boolean string X = ( X t ) t ∈ [ n ] k X=(X_t)_{t\in[n]^k} X = ( X t ) t ∈ [ n ] k , and Bob receives an index j ∈ [ n ] k j\in[n]^k j ∈ [ n ] k . Alice sends one message, after which Bob must recover X j X_j X j .
Roughly, we construct an instance on k n + 4 k = Θ k ( n ) kn+4k=\Theta_k(n) k n + 4 k = Θ k ( n ) variables that is unsatisfiable if and only if X j = 1 X_j=1 X j = 1 . Alice sends O k ( n k − d ) O_k(n^{k-d}) O k ( n k − d ) sketches. Bob combines selected sketches from her message with sketches he computes himself to obtain the sketch of this instance. The Ω ( n k ) \Omega(n^k) Ω ( n k ) communication lower bound for INDEX then implies an Ω k ( n k / n k − d ) = Ω k ( n d ) \Omega_k(n^k/n^{k-d})=\Omega_k(n^d) Ω k ( n k / n k − d ) = Ω k ( n d ) lower bound on the size of one sketch.
Recall from Definitions 3.5 and 3.9 that a capturing polynomial is zero precisely on satisfying tuples, while a selection polynomial is nonzero at one chosen unsatisfying tuple and zero at all the others. By Equation (4) and Lemma 3.10 , some tuple b ∈ R ‾ b\in\overline{R} b ∈ R has a selection polynomial q q q of degree k − d k-d k − d with q ( b ) > 0 q(b)>0 q ( b ) > 0 . For the entire lower bound proof, we will fix this tuple b b b and the selection polynomial q q q , and define s = k − d s=k-d s = k − d . They depend only on R R R and are known to both parties before their inputs arrive.
Fix a linear sketch as defined in § 3.2 . Since its seed is public, we omit ω \omega ω and write L = L ω L=L_\omega L = L ω for the sketching map. For a constraint C C C , the sketch of one copy is L ( e C ) L(e_C) L ( e C ) , which both parties can compute from its scope. Additivity gives L ( f ) = ∑ C f C L ( e C ) L(f)=\sum_C f_C L(e_C) L ( f ) = ∑ C f C L ( e C ) , where f C f_C f C is the frequency of C C C .
Reduction
We now define the reduction from INDEX to CSP ( R ) \operatorname{CSP}(R) CSP ( R ) . We create k k k disjoint groups of variables V a = { x a , u : u ∈ [ n ] } V_a=\{x_{a,u}:u\in[n]\} V a = { x a , u : u ∈ [ n ]} , one for each coordinate a ∈ [ k ] a\in[k] a ∈ [ k ] , and define V = ⋃ a V a V=\bigcup_a V_a V = ⋃ a V a . Each array entry t = ( t 1 , … , t k ) t=(t_1,\ldots,t_k) t = ( t 1 , … , t k ) corresponds to the constraint C t = R ( x 1 , t 1 , … , x k , t k ) C_t=R(x_{1,t_1},\ldots,x_{k,t_k}) C t = R ( x 1 , t 1 , … , x k , t k ) .
Alice. Alice constructs and sends the following sketches.
The full instance. She sends
M 0 = ∑ t ∈ [ n ] k X t L ( e C t ) . (7) M_0=\sum_{t\in[n]^k}X_tL(e_{C_t}). \tag*{(7)} M 0 = t ∈ [ n ] k ∑ X t L ( e C t ) . (7)
This is the sketch of the instance containing one copy of C t C_t C t whenever $X_t=1. (ii) Subinstances incident on at most k − d k-d k − d specified variables. For every nonempty S ⊆ [ k ] S \subseteq[k] S ⊆ [ k ] with ∣ S ∣ ≤ s |S| \le s ∣ S ∣ ≤ s , where s = k − d s=k-d s = k − d , and every u ∈ [ n ] S u \in[n]^S u ∈ [ n ] S , she sends
M S , u = ∑ t : t ∣ S = u X t L ( e C t ) . (8) M_{S,u}=\sum_{t:t|_S=u}X_t\mathcal{L}(eC_t). \tag*{(8)} M S , u = t : t ∣ S = u ∑ X t L ( e C t ) . (8)
Here t ∣ S t|_S t ∣ S denotes the tuple t t t restricted to the coordinates in S S S , and [ n ] S [n]^S [ n ] S is the set of possible restricted tuples. This is the sketch of the constraints in Alice’s instance that contain every specified variable x a , u a x_{a,u_a} x a , u a , for a ∈ S a \in S a ∈ S . There are O k ( n s ) O_k(n^s) O k ( n s ) such sketches: the number of choices of S S S depends only on R R R , and each has at most n s n^s n s choices of u u u .
Thus Alice sends O k ( n s ) = O k ( n k − d ) O_k(n^s)=O_k(n^{k-d}) O k ( n s ) = O k ( n k − d ) sketches in total, as required.
Bob. Bob combines Alice’s sketches with sketches of constraints he constructs himself. His goal is to obtain an instance that is satisfiable if and only if the queried bit is zero.
The high-level idea is that when X j = 1 X_j=1 X j = 1 , Bob needs the query constraint to rule out every satisfying assignment. By Observation 3.2 , our standing assumption makes R R R a core. The pinning lemma, Lemma 3.4 , therefore lets him force a chosen assignment α j \alpha_j α j on V V V up to a common automorphism, under which the query constraint is unsatisfied. For the other direction, when X j = 0 X_j=0 X j = 0 , all remaining constraints must be satisfied by α j \alpha_j α j . Bob uses the selection polynomial to remove every other constraint unsatisfied by this assignment.
In particular, Bob constructs the following three sketches.
(i) Pinning instance. Bob defines the assignment α j : V → { 0 , 1 } \alpha_j: V \to\{0,1\} α j : V → { 0 , 1 } by
α j ( x a , u ) = { b a , u = j a , 1 − b a , u ≠ j a . (9) \alpha_j(x_{a,u})=
\begin{cases}
b_a, & u=j_a,\\
1-b_a, & u\ne j_a.
\end{cases} \tag*{(9)} α j ( x a , u ) = { b a , 1 − b a , u = j a , u = j a . (9)
Thus the queried constraint C j C_j C j is assigned the unsatisfying tuple b b b . Bob constructs the pinning instance P α j P_{\alpha_j} P α j from Lemma 3.4 . Its constraints force the assignment on V V V to equal α j \alpha_j α j , up to a common automorphism of R R R . Such an automorphism preserves both satisfying and unsatisfying tuples, and as we will see later this freedom does not affect the reduction. The pinning instance uses 4 k 4k 4 k additional dummy variables, and Bob computes
M p i n = L ( P α j ) . M_{\mathrm{pin}}=\mathcal{L}(P_{\alpha_j}). M pin = L ( P α j ) .
Note that pinning already gives us one implication: if Bob simply added M p i n M_{\mathrm{pin}} M pin to M 0 M_0 M 0 , then X j = 1 X_j=1 X j = 1 would force unsatisfiability, because C j C_j C j would be present and violated under every assignment allowed by pinning. However, the converse can fail: even when X j = 0 X_j=0 X j = 0 , another constraint from Alice’s instance might be unsatisfied by α j \alpha_j α j . Bob’s next step removes every such constraint while retaining the query constraint exactly when X j = 1 X_j=1 X j = 1 .
(ii) Selecting the queried bit. For each t ∈ [ n ] k t \in[n]^k t ∈ [ n ] k , Bob defines
β j , t = q ( C t ( α j ) ) , (10) \beta_{j,t}=q(C_t(\alpha_j)), \tag*{(10)} β j , t = q ( C t ( α j )) , (10)
where C t ( α j ) C_t(\alpha_j) C t ( α j ) is the Boolean tuple assigned to the variables of C t C_t C t . To express these coefficients using Alice’s message, define z a ( t , j ) = 1 [ t a = j a ] z_a(t,j)=\mathbf{1}[t_a=j_a] z a ( t , j ) = 1 [ t a = j a ] . This indicator is one exactly when C t C_t C t uses the queried variable x a , j a x_{a,j_a} x a , j a in coordinate a a a , and zero otherwise. By Equation (9) , that coordinate is assigned b a b_a b a in the first case and 1 − b a 1-b_a 1 − b a in the second. We can express both cases as
( C t ( α j ) ) a = ( 1 − b a ) + ( 2 b a − 1 ) z a ( t , j ) . (C_t(\alpha_j))_a = (1-b_a) + (2b_a-1)z_a(t,j). ( C t ( α j ) ) a = ( 1 − b a ) + ( 2 b a − 1 ) z a ( t , j ) .
Substitute these expressions, one for each coordinate, into the fixed selection polynomial q q q . Each expression is affine in one indicator, so the resulting polynomial still has degree at most s = k − d s=k-d s = k − d . We therefore obtain an integer linear combination of products of at most s s s indicators:
β j , t = a ∅ + ∑ ∅ ≠ S ⊆ [ k ] ∣ S ∣ ≤ s a S ∏ a ∈ S 1 [ t a = j a ] . (11) \beta_{j,t}=a_{\varnothing}+\sum_{\substack{\varnothing\ne S\subseteq[k]\\ |S|\le s}}a_S\prod_{a\in S}\mathbf{1}[t_a=j_a]. \tag*{(11)} β j , t = a ∅ + ∅ = S ⊆ [ k ] ∣ S ∣ ≤ s ∑ a S a ∈ S ∏ 1 [ t a = j a ] . (11)
Note that the coefficients a S a_S a S depend only on R R R , b b b , q q q . The product indexed by S S S is one exactly for the array entries with t ∣ S = j ∣ S t|_S=j|_S t ∣ S = j ∣ S . Recall that Alice’s sketch M S , j ∣ S M_{S,j|_S} M S , j ∣ S sums over exactly these entries. So, Bob uses these sketches and forms the sketch
M B o b = a ∅ M 0 + ∑ ∅ ≠ S ⊆ [ k ] ∣ S ∣ ≤ s a S M S , j ∣ S = ∑ t β j , t X t L ( e C t ) . (12) M_{\mathrm{Bob}}=a_{\varnothing}M_0+\sum_{\substack{\varnothing\ne S\subseteq[k]\\ |S|\le s}}a_SM_{S,j|_S}=\sum_t\beta_{j,t}X_tL(e_{C_t}). \tag*{(12)} M Bob = a ∅ M 0 + ∅ = S ⊆ [ k ] ∣ S ∣ ≤ s ∑ a S M S , j ∣ S = t ∑ β j , t X t L ( e C t ) . (12)
The last equality follows by substituting Equations (7) and (8) and collecting the coefficient of each X t L ( e C t ) X_tL(e_{C_t}) X t L ( e C t ) .
The crucial property is that β j , t = 0 \beta_{j,t}=0 β j , t = 0 whenever t ≠ j t\ne j t = j and C t ( α j ) C_t(\alpha_j) C t ( α j ) is unsatisfying. Indeed, only C j C_j C j is assigned b b b , and q q q is zero at every other unsatisfying tuple. Thus the signed frequencies β j , t X t \beta_{j,t}X_t β j , t X t in Equation (12) eliminate every non-query constraint violated by α j \alpha_j α j . The query coefficient is β j , j = q ( b ) > 0 \beta_{j,j}=q(b)>0 β j , j = q ( b ) > 0 , so its signed frequency is positive exactly when X j = 1 X_j=1 X j = 1 .
(iii) Correcting negative frequencies. Some coefficients β j , t \beta_{j,t} β j , t may be negative, so M B o b M_{\mathrm{Bob}} M Bob need not yet be the sketch of a valid instance. If β j , t < 0 \beta_{j,t}<0 β j , t < 0 , the current frequency β j , t X t \beta_{j,t}X_t β j , t X t is either zero or β j , t \beta_{j,t} β j , t . Adding − β j , t -\beta_{j,t} − β j , t copies of C t C_t C t changes it to − β j , t -\beta_{j,t} − β j , t or zero, respectively. Bob can do this without knowing X t X_t X t , since β j , t \beta_{j,t} β j , t depends only on his query and the fixed polynomial q q q . He therefore computes
M p o s = ∑ t ∈ [ n ] k ( − β j , t ) + L ( e C t ) , (13) M_{\mathrm{pos}}=\sum_{t\in[n]^k}(-\beta_{j,t})_+L(e_{C_t}), \tag*{(13)} M pos = t ∈ [ n ] k ∑ ( − β j , t ) + L ( e C t ) , (13)
where v + = max { v , 0 } v_+=\max\{v,0\} v + = max { v , 0 } . Thus every negative coefficient now gives frequency ( − β j , t ) ( 1 − X t ) ≥ 0 (-\beta_{j,t})(1-X_t)\ge0 ( − β j , t ) ( 1 − X t ) ≥ 0 , and nonnegative coefficients are unchanged. A coefficient can be negative only when α j \alpha_j α j satisfies C t C_t C t , since q q q is zero at every unsatisfying tuple other than b b b and is positive at b b b . The added copies therefore introduce no constraint violated by α j \alpha_j α j . Constraints with coefficient zero remain absent, and the queried constraint still has frequency q ( b ) X j q(b)X_j q ( b ) X j .
Bob adds M p i n M_{\mathrm{pin}} M pin , M B o b M_{\mathrm{Bob}} M Bob , and M p o s M_{\mathrm{pos}} M pos , feeds the combined sketch to the decoder, and outputs one if it reports unsatisfiable and zero otherwise. This completes the reduction.
Correctness
Define the resulting frequency vector by
f B = f B ( X , j ) = P α j + ∑ t ∈ [ n ] k c j , t ( X ) e C t , c j , t ( X ) = β j , t X t + ( − β j , t ) + . (14) f_B=f_B(X,j)=P_{\alpha_j}+\sum_{t\in[n]^k}c_{j,t}(X)e_{C_t},\qquad c_{j,t}(X)=\beta_{j,t}X_t+(-\beta_{j,t})_+. \tag*{(14)} f B = f B ( X , j ) = P α j + t ∈ [ n ] k ∑ c j , t ( X ) e C t , c j , t ( X ) = β j , t X t + ( − β j , t ) + . (14)
It consists of the pinning constraints together with the constraints C t C_t C t at these frequencies. Additivity gives
L ( f B ) = M p i n + M B o b + M p o s . L(f_B) = M_{\mathrm{pin}} + M_{\mathrm{Bob}} + M_{\mathrm{pos}}. L ( f B ) = M pin + M Bob + M pos .
To prove correctness of the reduction, we establish two claims: (1) f B f_B f B has bounded nonnegative integer frequencies, and (2) f B f_B f B is unsatisfiable if and only if X j = 1 X_j = 1 X j = 1 .
Claim 4.12. ∥ f B ∥ 1 = O k ( n k ) \lVert f_B\rVert_1 = O_k(n^k) ∥ f B ∥ 1 = O k ( n k ) , where ∥ f B ∥ 1 = ∑ C ( f B ) C \lVert f_B\rVert_1 = \sum_C(f_B)_C ∥ f B ∥ 1 = ∑ C ( f B ) C is the total number of constraint copies.
Proof. From Equation (14) ,
c j , t ( X ) = ( − β j , t ) + + β j , t X t = { β j , t X t , β j , t ≥ 0 , ( − β j , t ) ( 1 − X t ) , β j , t < 0. (15) c_{j,t}(X) = (-\beta_{j,t})_+ + \beta_{j,t}X_t =
\begin{cases}
\beta_{j,t}X_t, & \beta_{j,t} \ge0, \\
(-\beta_{j,t})(1-X_t), & \beta_{j,t} < 0.
\end{cases} \tag*{(15)} c j , t ( X ) = ( − β j , t ) + + β j , t X t = { β j , t X t , ( − β j , t ) ( 1 − X t ) , β j , t ≥ 0 , β j , t < 0. (15) Since X t ∈ { 0 , 1 } X_t \in\{0,1\} X t ∈ { 0 , 1 } and β j , t \beta_{j,t} β j , t is an integer, both cases are nonnegative integers. Every pinning constraint contains an additional variable outside V V V , whereas every C t C_t C t has all its variables in V V V . The pinning constraints therefore do not coincide with any C t C_t C t , and each contributes frequency one. Set F R = max { 1 , max a ∈ { 0 , 1 } k ∣ q ( a ) ∣ } F_R = \max\{1,\max_{a \in\{0,1\}^k} |q(a)|\} F R = max { 1 , max a ∈ { 0 , 1 } k ∣ q ( a ) ∣ } . Each c j , t ( X ) c_{j,t}(X) c j , t ( X ) is at most ∣ β j , t ∣ ≤ F R |\beta_{j,t}| \le F_R ∣ β j , t ∣ ≤ F R , so every frequency is bounded by F R = O k ( 1 ) F_R = O_k(1) F R = O k ( 1 ) . There are n k n^k n k constraints C t C_t C t and O k ( n + 1 ) O_k(n+1) O k ( n + 1 ) pinning constraints. These bounds give ∥ f B ∥ 1 = O k ( n k ) \lVert f_B\rVert_1 = O_k(n^k) ∥ f B ∥ 1 = O k ( n k ) .
Claim 4.14. For every X , j X,j X , j , the instance f B ( X , j ) f_B(X,j) f B ( X , j ) is unsatisfiable if and only if X j = 1 X_j = 1 X j = 1 .
Proof. Under the pinned assignment α j \alpha_j α j , only C j C_j C j is assigned the tuple b b b (for every other t ≠ j t \ne j t = j , some coordinate has t a ≠ j a t_a \ne j_a t a = j a , and Equation (9) assigns the opposite Boolean value in that coordinate). If t ≠ j t \ne j t = j and C t ( α j ) C_t(\alpha_j) C t ( α j ) is unsatisfying, the selection polynomial gives β j , t = 0 \beta_{j,t} = 0 β j , t = 0 , so c j , t ( X ) = 0 c_{j,t}(X) = 0 c j , t ( X ) = 0 . Thus every active constraint C t C_t C t with t ≠ j t \ne j t = j is satisfied by α j \alpha_j α j . For the query index j j j , the frequency is c j , j ( X ) = q ( b ) X j c_{j,j}(X) = q(b)X_j c j , j ( X ) = q ( b ) X j , so C j C_j C j is active exactly when X j = 1 X_j = 1 X j = 1 .
If X j = 0 X_j = 0 X j = 0 , every active constraint C t C_t C t is satisfied by α j \alpha_j α j . The pinning lemma ensures that α j \alpha_j α j extends to an assignment satisfying P α j P_{\alpha_j} P α j . This extension satisfies all of f B f_B f B .
If X j = 1 X_j = 1 X j = 1 , every assignment satisfying the pinning constraints equals g ∘ α j g \circ\alpha_j g ∘ α j on V V V , for some common automorphism g ∈ Aut ( R ) g \in\operatorname{Aut}(R) g ∈ Aut ( R ) . The active query constraint is then assigned g ( b ) g(b) g ( b ) , which is still unsatisfying. No assignment can satisfy both the query constraint and the pinning constraints. This proves the equivalence.
Theorem 4.2 (restated). For a fixed nonempty, non-constant-satisfiable Boolean relation R R R with d = deg Z ( R ) d = \deg_Z(R) d = deg Z ( R ) , there is a constant F R F_R F R such that, for every sufficiently large n n n , there is a distribution on instances on n n n variables with frequencies at most F R F_R F R for which every public-coin linear sketch deciding satisfiability with average error at most 1 / 3 1/3 1/3 has size Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) . Every constraint in these instances has distinct variables within its scope.
Proof. We combine Claims 4.12 and 4.14 with the communication lower bound for INDEX. Alice sends 1 + ∑ r = 1 s ( k r ) n r = O k ( n k − d ) 1 + \sum_{r=1}^{s} \binom{k}{r} n^r = O_k(n^{k-d}) 1 + ∑ r = 1 s ( r k ) n r = O k ( n k − d ) sketches. By definition, B B B is the size in bits of one sketch, so each can be encoded in at most B + 1 B+1 B + 1 bits. When X X X and j j j are independent and uniform, f B ( X , j ) f_B(X,j) f B ( X , j ) has a fixed distribution independent of the sketch seed. By Claim 4.14, Bob recovers X j X_j X j exactly when the sketch decoder correctly decides satisfiability of f B ( X , j ) f_B(X,j) f B ( X , j ) . Hence a sketch with average error at most 1 / 3 1/3 1/3 on this distribution yields a public-coin INDEX protocol with the same error and communication O k ( n k − d ( B + 1 ) ) O_k(n^{k-d}(B+1)) O k ( n k − d ( B + 1 )) . The Ω ( n k ) \Omega(n^k) Ω ( n k ) one-way communication lower bound implies
B + 1 = Ω k ( n d ) . B + 1 = \Omega_k(n^d). B + 1 = Ω k ( n d ) .
For sufficiently large n n n , this gives B = Ω k ( n d ) B = \Omega_k(n^d) B = Ω k ( n d ) on k n + 4 k = Θ k ( n ) kn + 4k = \Theta_k(n) k n + 4 k = Θ k ( n ) variables. For an arbitrary sufficiently large total number n ′ n' n ′ of variables, take n = ⌊ ( n ′ − 4 k ) / k ⌋ n = \lfloor(n' - 4k)/k \rfloor n = ⌊( n ′ − 4 k ) / k ⌋ and leave the remaining variables unused. The same construction and communication argument then give B = Ω k ( ( n ′ ) d ) B = \Omega_k((n')^d) B = Ω k (( n ′ ) d ) .
Lower bounds for Boolean constraint languages
The reduction also applies to fixed finite Boolean constraint languages. We choose a relation of maximum capturing degree for Alice’s constraints. That relation need not itself be a core and Bob can use the entire language to pin the assignment.
Corollary 4.15 (Lower bounds for constraint languages). Let Γ \Gamma Γ be a fixed finite, non-constant-satisfiable Boolean language of nonempty proper relations of arity k k k , and let d = deg Z ( Γ ) d = \operatorname{deg}_{\mathbb{Z}}(\Gamma) d = deg Z ( Γ ) . There is a constant F Γ F_\Gamma F Γ such that, for every sufficiently large n n n , there is a distribution on instances on n n n variables with frequencies at most F Γ F_\Gamma F Γ for which every public-coin linear sketch deciding satisfiability with average error at most 1 / 3 1/3 1/3 has size Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) .
There is also a constant c Γ c_\Gamma c Γ such that every randomized one-pass algorithm deciding CSP ( Γ ) \operatorname{CSP}(\Gamma) CSP ( Γ ) with error at most 1 / 3 1/3 1/3 on every strict-turnstile stream of length at most n c Γ n^{c_\Gamma} n c Γ uses Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits, for all sufficiently large n n n .
Proof. Choose R ∈ Γ R \in\Gamma R ∈ Γ with deg Z ( R ) = d \operatorname{deg}_{\mathbb{Z}}(R) = d deg Z ( R ) = d . By Lemma 3.10 , some unsatisfying tuple b b b has an integer selection polynomial of degree k − d k-d k − d that is positive at b b b . This lemma requires only that R R R be nonempty and proper. Thus we can use exactly the same assignment, coefficients, and sketches as above, with n n n variables in each of k k k groups. Alice sends O k ( n k − d ) O_k(n^{k-d}) O k ( n k − d ) sketches to encode her n k n^k n k input bits.
The only change is to the pinning instance. Since Γ \Gamma Γ is not constant-satisfiable, it is a core. There is an analogous version of Lemma 3.4 for constraint languages (see [19 Appendix A] ). Applying this lemma, Bob can enforce α j \alpha_j α j up to one common automorphism of Γ \Gamma Γ . Such an automorphism preserves R R R , so every allowed assignment still violates the query constraint when X j = 1 X_j = 1 X j = 1 . When X j = 0 X_j = 0 X j = 0 , α j \alpha_j α j satisfies the constraints obtained from Alice’s message and extends to a solution of the pinning instance. Hence the final instance is unsatisfiable exactly when X j = 1 X_j = 1 X j = 1 .
Each data constraint has frequency at most max a ∈ { 0 , 1 } k ∣ q ( a ) ∣ \max_{a \in\{0,1\}^k} |q(a)| max a ∈ { 0 , 1 } k ∣ q ( a ) ∣ . Bob includes each distinct pinning constraint only once, so pinning increases any frequency by at most one. Thus all final frequencies are bounded by a constant F Γ F_\Gamma F Γ . For uniform independent X X X and j j j , the INDEX lower bound and the number of sketches in Alice’s message give Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits per sketch. The construction uses k n + O k ( 1 ) kn + O_k(1) k n + O k ( 1 ) variables, so the same bound holds in terms of the total number of variables, as in the proof of Theorem 4.2.
Finally, the streaming-to-sketching result of Jiang, Liu, and Yu [40 Corollary 7.2.2] applies to the universe U n Γ U_n^\Gamma U n Γ , whose size is polynomial in n n n . For a sufficiently large polynomial stream budget, an S S S -bit streaming algorithm therefore yields a sketch of size O k ( S ) O_k(S) O k ( S ) . The sketching lower bound gives S = Ω k ( n d ) S = \Omega_k(n^d) S = Ω k ( n d ) .
When a language is padded to arity k k k , dropping the dummy coordinates preserves satisfiability and is linear on frequency vectors, so any linear sketch for the original language can be used in the same reduction. Although some frequencies may add, the projected vector f f f still satisfies ∥ f ∥ 2 ≤ ∥ f ∥ 1 = O k ( n k ) \lVert f\rVert_2 \le\lVert f\rVert_1 = O_k(n^k) ∥ f ∥ 2 ≤ ∥ f ∥ 1 = O k ( n k ) , so the same streaming lower bound follows from Jiang, Liu, and Yu [40 Corollary 7.2.2] .
Lower bound for exact sparsification
The lower bound in Corollary 4.15 extends to exact sparsification even when Γ \Gamma Γ is constant-satisfiable. Recall that an exact sparsifier of a Γ \Gamma Γ -instance f f f is a set S ⊆ supp ( f ) S \subseteq\operatorname{supp}(f) S ⊆ supp ( f ) such that Sat Γ ( S ) = Sat Γ ( f ) \operatorname{Sat}_{\Gamma}(S) = \operatorname{Sat}_{\Gamma}(f) Sat Γ ( S ) = Sat Γ ( f ) . Thus it preserves the entire set of satisfying assignments, rather than only whether the instance is satisfiable.
We use the same construction with k k k variable groups. Dropping any dummy coordinates preserves whether each individual assignment satisfies the instance. The non-constant-satisfiability assumption was used only to pin Bob’s assignment α j \alpha_j α j . For exact sparsification, Bob omits the pinning instance and keeps the frequencies c j , t ( X ) c_{j,t}(X) c j , t ( X ) from Equation (15) . Every active constraint other than C j C_j C j is satisfied by α j \alpha_j α j , while C j C_j C j is violated by α j \alpha_j α j and is active exactly when X j = 1 X_j = 1 X j = 1 . Hence α j \alpha_j α j satisfies this instance if and only if X j = 0 X_j = 0 X j = 0 , and Bob can recover X j X_j X j by testing whether α j \alpha_j α j satisfies the returned sparsifier. The same INDEX reduction therefore gives an Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) sketching lower bound, where d = deg Z ( Γ ) d = \deg_{\mathbb{Z}}(\Gamma) d = deg Z ( Γ ) . A constant number of independent runs gives a list in which, with probability at least 0.99, a strict majority of the candidates are exact sparsifiers. Corollary 7.2.2 of Jiang, Liu, and Yu [40 ] applies to arbitrary output tasks, including this guarantee on the list, and gives a sketch of O k ( S ) O_k(S) O k ( S ) bits from an S S S -bit streaming algorithm. Bob tests α j \alpha_j α j on each candidate and takes the majority answer, giving the following corollary.
Corollary 4.16 (Lower bound for exact sparsification). Let Γ \Gamma Γ be a fixed finite nonempty Boolean language of nonempty proper relations of arity at most k k k , and let d = deg Z ( Γ ) d = \deg_{\mathbb{Z}}(\Gamma) d = deg Z ( Γ ) . There is a constant c Γ c_{\Gamma} c Γ such that every randomized one-pass algorithm that, on every strict-turnstile stream of length at most n c Γ n^{c_{\Gamma}} n c Γ on n n n variables, outputs an exact sparsifier of the final instance with probability at least 2 / 3 2/3 2/3 uses Ω k ( n d ) \Omega_k(n^d) Ω k ( n d ) bits, for all sufficiently large n n n .
Upper bound
In this section, we prove that the integer capturing degree of R R R also gives an upper bound on the space required to decide satisfiability in the strict-turnstile model. Throughout this section we drop the requirement that R R R be non-constant-satisfiable.
Theorem 5.1 (Main upper bound). Let R ⊆ { 0 , 1 } k R \subseteq\{0,1\}^k R ⊆ { 0 , 1 } k be a fixed nonempty proper Boolean relation of arity k k k , and let d = deg Z ( R ) d = \deg_{\mathbb{Z}}(R) d = deg Z ( R ) . Given a bound μ ≥ 1 \mu\ge1 μ ≥ 1 on every prefix multiplicity and 0 < δ < 1 / 2 0 < \delta< 1/2 0 < δ < 1/2 , there is a randomized one-pass strict-turnstile algorithm deciding CSP ( R ) \operatorname{CSP}(R) CSP ( R ) on n n n variables with error at most δ \delta δ using
O k ( n d polylog ( 2 n μ / δ ) ) O_k\left(n^d \operatorname{polylog}(2n\mu/\delta)\right) O k ( n d polylog ( 2 n μ / δ ) ) bits, including decoding workspace. The algorithm also recovers a set of active constraints with exactly the original satisfying assignments.
We first express the constraints as polynomial equations and represent their coefficients as rows of a matrix. Let d = deg Z ( R ) d = \deg_{\mathbb{Z}}(R) d = deg Z ( R ) and choose an integer capturing polynomial of degree d d d . Substituting a constraint’s variables into this polynomial gives a polynomial that vanishes precisely when the constraint is satisfied.
Every resulting polynomial uses products of at most d d d distinct variables, since repeated powers can be removed on Boolean inputs. Thus all these polynomials can be written using one common list of D = O k ( n d ) D = O_k(n^d) D = O k ( n d ) monomials, including the constant monomial. We give the matrix one column for each monomial and one row for each constraint type, with the row containing that polynomial’s coefficients. Each row has only constantly many nonzero integer entries because the capturing polynomial is fixed. Given an assignment, evaluating the monomials gives a Boolean vector; taking its inner product with a coefficient row evaluates the corresponding constraint polynomial.
The coefficient matrix is fixed. To represent the current instance, we form another matrix by multiplying each coefficient row by its constraint’s frequency. An insertion or deletion changes the corresponding row by adding or subtracting its coefficient vector. On a satisfying assignment, every scaled polynomial evaluates to zero. On any other assignment, the polynomial of at least one active constraint evaluates to a nonzero integer, even after multiplication by its positive integer frequency. Consequently, the sum of the squared evaluations is either zero, when the assignment satisfies the instance, or at least one otherwise. We call this sum the assignment’s energy . The following lemma expresses this sum as a quadratic form in the monomial vector. The number of monomials will determine our space bound, and the gap between zero and one will let us preserve satisfaction using an approximate matrix.
Lemma 5.2 (Polynomial representation). Let R R R be a fixed nonempty proper Boolean relation and d = deg Z ( R ) d = \deg_{\mathbb{Z}}(R) d = deg Z ( R ) . For every n n n , there exist an integer D D D with n + 1 ≤ D = O k ( n d ) n+1 \le D = O_k(n^d) n + 1 ≤ D = O k ( n d ) , a map ϕ : { 0 , 1 } n → { 0 , 1 } D \phi: \{0,1\}^n \to\{0,1\}^D ϕ : { 0 , 1 } n → { 0 , 1 } D of monomial values, and an integer matrix B ∈ Z U n × D B \in\mathbb{Z}^{\mathcal{U}_n \times D} B ∈ Z U n × D . Let b C T b_C^{\mathsf T} b C T be the row indexed by constraint C C C . For a nonnegative integer frequency vector f f f , set
A f = diag ( f ) B , G f = A f T A f = B T diag ( f ) 2 B . A_f = \operatorname{diag}(f)B,\qquad G_f = A_f^{\mathsf T} A_f = B^{\mathsf T}\operatorname{diag}(f)^2B. A f = diag ( f ) B , G f = A f T A f = B T diag ( f ) 2 B . Then every assignment α ∈ { 0 , 1 } n \alpha\in\{0,1\}^n α ∈ { 0 , 1 } n satisfies
ϕ ( α ) T G f ϕ ( α ) { = 0 , α ∈ Sat R ( f ) , ≥ 1 , α ∉ Sat R ( f ) . \phi(\alpha)^{\mathsf T}G_f\phi(\alpha)
\begin{cases}
= 0, & \alpha\in\operatorname{Sat}_R(f),\\
\ge1, & \alpha\notin\operatorname{Sat}_R(f).
\end{cases} ϕ ( α ) T G f ϕ ( α ) { = 0 , ≥ 1 , α ∈ Sat R ( f ) , α ∈ / Sat R ( f ) . Each row has O k ( 1 ) O_k(1) O k ( 1 ) nonzero entries and squared norm O k ( 1 ) O_k(1) O k ( 1 ) , and can be generated from its scope in polynomial time and O k ( log ( n + 2 ) ) O_k(\log(n+2)) O k ( log ( n + 2 )) workspace.
Proof. Choose an integer multilinear capturing polynomial p p p of minimum degree d d d , so p ( a ) = 0 p(a) = 0 p ( a ) = 0 precisely when a ∈ R a \in R a ∈ R . Let ϕ ( α ) \phi(\alpha) ϕ ( α ) contain all multilinear monomials in the assignment variables of degree at most d d d , including the constant monomial:
ϕ ( α ) = ( ∏ j ∈ T α j ) T ⊆ [ n ] , ∣ T ∣ ≤ d , D = ∑ j = 0 min ( d , n ) ( n j ) = O k ( n d ) . \phi(\alpha) = \left(\prod_{j \in T}\alpha_j\right)_{T \subseteq[n],\,|T|\le d},\qquad D = \sum_{j=0}^{\min(d,n)} \binom{n}{j} = O_k(n^d). ϕ ( α ) = j ∈ T ∏ α j T ⊆ [ n ] , ∣ T ∣ ≤ d , D = j = 0 ∑ m i n ( d , n ) ( j n ) = O k ( n d ) .
Every coordinate is zero or one, so ∥ ϕ ( α ) ∥ 2 2 ≤ D \lVert\phi(\alpha)\rVert_2^2 \le D ∥ ϕ ( α ) ∥ 2 2 ≤ D . Since d ≥ 1 d \ge1 d ≥ 1 , we also have D ≥ n + 1 D \ge n+1 D ≥ n + 1 .
For a constraint C C C , substitute its scope into p p p and use x i r = x i x_i^r = x_i x i r = x i for r ≥ 1 r \ge1 r ≥ 1 on Boolean inputs. Let b C b_C b C be the coefficient vector of the resulting polynomial p C p_C p C in the common monomial coordinates. Then p C ( α ) = b C T ϕ ( α ) p_C(\alpha) = b_C^{\mathsf T}\phi(\alpha) p C ( α ) = b C T ϕ ( α ) . The fixed polynomial p p p has a bounded number of terms and bounded integer coefficients, so every row has O k ( 1 ) O_k(1) O k ( 1 ) nonzero entries and squared norm O k ( 1 ) O_k(1) O k ( 1 ) . Repeated variables in a scope can only merge a fixed number of terms. To generate a row, enumerate the terms of p p p , identify the variable set in each substituted term, and combine matching sets. This takes polynomial time and O k ( log ( n + 2 ) ) O_k(\log(n+2)) O k ( log ( n + 2 )) workspace.
For every nonnegative integer frequency vector f f f ,
ϕ ( α ) T G f ϕ ( α ) = ∥ A f ϕ ( α ) ∥ 2 2 = ∑ C ∈ U n f C 2 p C ( α ) 2 . \phi(\alpha)^{\mathsf T}G_f\phi(\alpha) = \lVert A_f\phi(\alpha)\rVert_2^2 = \sum_{C\in\mathcal{U}_n} f_C^2p_C(\alpha)^2. ϕ ( α ) T G f ϕ ( α ) = ∥ A f ϕ ( α ) ∥ 2 2 = C ∈ U n ∑ f C 2 p C ( α ) 2 .
Every summand is a nonnegative integer. Their sum is zero exactly when every active constraint is satisfied. Otherwise, a violated active constraint contributes at least one, proving the lemma. □
Example 5.3 (Polynomial representation of 4-XOR). Consider odd parity on four variables, which accepts tuples with one or three ones. For r = z 1 + z 2 + z 3 + z 4 r = z_1 + z_2 + z_3 + z_4 r = z 1 + z 2 + z 3 + z 4 , the polynomial p ( z ) = ( r − 1 ) ( r − 3 ) p(z) = (r - 1)(r - 3) p ( z ) = ( r − 1 ) ( r − 3 ) captures this relation. On Boolean inputs it equals
p ( z ) = 3 − 3 ∑ a = 1 4 z a + 2 ∑ a < b z a z b . p(z) = 3 - 3\sum_{a=1}^{4} z_a + 2\sum_{a<b} z_a z_b. p ( z ) = 3 − 3 a = 1 ∑ 4 z a + 2 a < b ∑ z a z b .
The common monomial coordinates are the constant, the n n n individual variables, and their pairwise products, giving D = 1 + n + ( n 2 ) D = 1 + n + \binom{n}{2} D = 1 + n + ( 2 n ) . A constraint on four distinct variables has coefficient 3 3 3 on the constant coordinate, − 3 -3 − 3 on its four variable coordinates, 2 2 2 on its six pairwise-product coordinates, and zero elsewhere. At tuples with zero, two, or four ones, the polynomial has values 3 3 3 , − 1 -1 − 1 , 3 3 3 , respectively. Thus every violated active constraint contributes at least one to the energy.
The matrix B B B is fixed by the relation and the variable set; only the row frequencies change during the stream. We call G f = A f T A f G_f = A_f^{\mathsf T} A_f G f = A f T A f the Gram matrix of A f A_f A f . Our goal is to recover a small set S S S of active rows, those with positive final frequency. Every original solution satisfies the corresponding constraints, since they belong to the instance. We must ensure that keeping only these constraints introduces no new solutions.
To see what matrix guarantee suffices, let W = ∑ C ∈ S w C b C b C T W = \sum_{C\in S} w_C b_C b_C^{\mathsf T} W = ∑ C ∈ S w C b C b C T for positive weights w C w_C w C . An assignment α \alpha α satisfying the retained constraints has zero energy in W W W . If G f ⪯ W + I / ( 4 D ) G_f \preceq W + I/(4D) G f ⪯ W + I / ( 4 D ) , its energy in the original instance is therefore at most ∥ ϕ ( α ) ∥ 2 / ( 4 D ) ≤ 1 / 4 \lVert\phi(\alpha)\rVert^2/(4D) \le1/4 ∥ ϕ ( α ) ∥ 2 / ( 4 D ) ≤ 1/4 , because the monomial vector has D D D Boolean coordinates. The identity term thus contributes less than the energy of any violating assignment, which is at least one. This inequality guarantees that the retained constraints have exactly the original solutions.
The following corollary obtains this inequality using space proportional to D D D up to polylogarithmic factors. We derive it from Theorem 5.5 in § 5.1 . That stronger theorem adapts the linear-sketching methods of Chen, Khanna, and Li (CKL) [27 Lemma 6.5 and Section 6.4] and Kapralov, Lee, Musco, Musco, and Sidford (KLMMS) [48 Section 7] ; its proof is in Section A.
Corollary 5.4 (Active-row sparsification from Theorem 5.5). Let B ∈ Z m × D B \in\mathbb{Z}^{m\times D} B ∈ Z m × D be a fixed matrix, where m , D ≥ 1 m, D \ge1 m , D ≥ 1 . Each row b i T b_i^{\mathsf T} b i T has at most s 0 s_0 s 0 nonzero entries and squared norm at most b 0 b_0 b 0 , for fixed constants s 0 , b 0 s_0, b_0 s 0 , b 0 , and can be generated from i i i in polynomial time and polylogarithmic workspace. Given μ ≥ 1 \mu\ge1 μ ≥ 1 and 0 < δ < 1 / 2 0 < \delta< 1/2 0 < δ < 1/2 , a one-pass algorithm on a strict-turnstile stream maintaining integer frequencies 0 ≤ f i ≤ μ 0 \le f_i \le\mu 0 ≤ f i ≤ μ recovers a set S ⊆ supp ( f ) S \subseteq\operatorname{supp}(f) S ⊆ supp ( f ) of O s 0 , b 0 ( D polylog ( 2 m D μ / δ ) ) O_{s_0,b_0}(D\operatorname{polylog}(2mD\mu/\delta)) O s 0 , b 0 ( D polylog ( 2 m D μ / δ )) indices and positive weights w i w_i w i such that, with probability at least 1 − δ 1-\delta 1 − δ ,
B T diag ( f ) 2 B ⪯ ∑ i ∈ S w i b i b i T + 1 4 D I . B^{\mathsf T}\operatorname{diag}(f)^2B \preceq\sum_{i\in S} w_i b_i b_i^{\mathsf T} + \frac{1}{4D}I. B T diag ( f ) 2 B ⪯ i ∈ S ∑ w i b i b i T + 4 D 1 I . It uses O s 0 , b 0 ( D polylog ( 2 m D μ / δ ) ) O_{s_0,b_0}(D\operatorname{polylog}(2mD\mu/\delta)) O s 0 , b 0 ( D polylog ( 2 m D μ / δ )) bits, including recovery workspace and stored output. Recovery takes polynomial time in m , D , μ , δ − 1 m,D,\mu,\delta^{-1} m , D , μ , δ − 1 and the row-generation time.
The polynomial representation and sparsification guarantee together imply the upper bound.
Proof of Theorem 5.1 . Let f f f be the final frequency vector. Apply Lemma 5.2 to obtain B B B and ϕ \phi ϕ , and let G = B T diag ( f ) 2 B G = B^{\mathsf T}\operatorname{diag}(f)^2B G = B T diag ( f ) 2 B . By Corollary 5.4, with probability at least 1 − δ 1-\delta 1 − δ we recover active constraint types S S S and positive weights satisfying
G ⪯ W + 1 4 D I , W = ∑ C ∈ S w C b C b C T . (16) G \preceq W + \frac{1}{4D}I,\qquad W = \sum_{C\in S} w_C b_C b_C^{\mathsf T}. \tag*{(16)} G ⪯ W + 4 D 1 I , W = C ∈ S ∑ w C b C b C T . (16)
Regard S S S as an unweighted instance. Since its constraints are active (i.e., final frequency is non-zero), every solution of f f f satisfies S S S . Conversely, if α \alpha α satisfies S S S , each retained equation has b C ϕ ( α ) = 0 b_C\phi(\alpha)=0 b C ϕ ( α ) = 0 , and therefore ϕ ( α ) ⊤ W ϕ ( α ) = 0 \phi(\alpha)^\top W\phi(\alpha)=0 ϕ ( α ) ⊤ W ϕ ( α ) = 0 . The vector ϕ ( α ) \phi(\alpha) ϕ ( α ) has Boolean coordinates, so ∥ ϕ ( α ) ∥ 2 2 ≤ D \|\phi(\alpha)\|_2^2\le D ∥ ϕ ( α ) ∥ 2 2 ≤ D . The matrix inequality gives
0 ≤ ϕ ( α ) ⊤ G ϕ ( α ) ≤ ϕ ( α ) ⊤ W ϕ ( α ) + ∥ ϕ ( α ) ∥ 2 2 4 D ≤ 1 4 . 0\le\phi(\alpha)^\top G\phi(\alpha)\le\phi(\alpha)^\top W\phi(\alpha)+\frac{\|\phi(\alpha)\|_2^2}{4D}\le\frac{1}{4}. 0 ≤ ϕ ( α ) ⊤ Gϕ ( α ) ≤ ϕ ( α ) ⊤ W ϕ ( α ) + 4 D ∥ ϕ ( α ) ∥ 2 2 ≤ 4 1 .
The integer gap in Lemma 5.2 forces this energy to be zero: an assignment violating any active constraint would have energy at least one. Hence Sat R ( S ) = Sat R ( f ) \operatorname{Sat}_R(S)=\operatorname{Sat}_R(f) Sat R ( S ) = Sat R ( f ) .
Here m = ∣ U n ∣ = n k m=|{\cal U}_n|=n^k m = ∣ U n ∣ = n k and D = O k ( n d ) D=O_k(n^d) D = O k ( n d ) , so recovery uses O k ( n d polylog ( 2 n μ / δ ) ) O_k(n^d\operatorname{polylog}(2n\mu/\delta)) O k ( n d polylog ( 2 n μ / δ )) bits, including its workspace and output. After recovery, discard the weights and enumerate Boolean assignments to decide whether S S S is satisfiable. The additional O ( n ) O(n) O ( n ) work bits fit within D ≥ n + 1 D\ge n+1 D ≥ n + 1 . The equality of solution sets proves the decision guarantee. Recovery takes polynomial time while the final satisfiability computation may take exponential time.
It remains to prove the active-row sparsification guarantee in Corollary 5.4. We establish a stronger approximation guarantee for Gram matrices with an added positive identity term.
Streaming row sparsification
Our streaming algorithm maintains linear sketches of the multiplicity-scaled row matrix and recovers a small set of active rows from them after the stream. Throughout this subsection, a sparse row dictionary is a fixed integer matrix satisfying the sparsity, norm, and row-generation assumptions of Corollary 5.4. The theorem adds a positive identity term λ I \lambda I λ I , called a regularizer , to the Gram matrix so that inverse queries are well-defined. This term remains unchanged in the output.
Theorem 5.5 (Regularized dictionary recovery, adapting [27 , 48 ] ). Let B ∈ Z m × D B\in\mathbb{Z}^{m\times D} B ∈ Z m × D be a sparse row dictionary , and let a strict-turnstile stream maintain integer frequencies 0 ≤ f i ≤ μ 0\le f_i\le\mu 0 ≤ f i ≤ μ . Set G = B ⊤ diag ( f ) 2 B G=B^\top\operatorname{diag}(f)^2B G = B ⊤ diag ( f ) 2 B . Given 0 < ε ≤ 1 / 8 0<\varepsilon\le1/8 0 < ε ≤ 1/8 , 0 < δ < 1 / 2 0<\delta<1/2 0 < δ < 1/2 , and λ = 2 − L \lambda=2^{-L} λ = 2 − L for an integer L ≥ 0 L\ge0 L ≥ 0 , a randomized one-pass algorithm recovers active indices S S S and positive weights forming W = ∑ i ∈ S w i b i b i ⊤ W=\sum_{i\in S}w_i b_i b_i^\top W = ∑ i ∈ S w i b i b i ⊤ such that, with probability at least 1 − δ 1-\delta 1 − δ ,
( 1 − ε ) ( G + λ I ) ⪯ W + λ I ⪯ ( 1 + ε ) ( G + λ I ) . (17) (1-\varepsilon)(G+\lambda I)\preceq W+\lambda I\preceq(1+\varepsilon)(G+\lambda I). \tag*{(17)} ( 1 − ε ) ( G + λ I ) ⪯ W + λ I ⪯ ( 1 + ε ) ( G + λ I ) . (17) For Q = 2 + m D μ / ( ε δ λ ) Q=2+mD\mu/(\varepsilon\delta\lambda) Q = 2 + m D μ / ( ε δ λ ) , the output has O s 0 , b 0 ( D ε − 2 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-2}\operatorname{polylog}Q) O s 0 , b 0 ( D ε − 2 polylog Q ) indices, and the algorithm uses O s 0 , b 0 ( D ε − 4 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-4}\operatorname{polylog}Q) O s 0 , b 0 ( D ε − 4 polylog Q ) bits, including stored randomness, output, and working space, for every choice of random seeds. The time per update and the time after the stream are polynomial in m m m , D D D , μ \mu μ , ε − 1 \varepsilon^{-1} ε − 1 , δ − 1 \delta^{-1} δ − 1 , λ − 1 \lambda^{-1} λ − 1 and the time needed to obtain a row.
We prove this theorem in Section A. First, we derive Corollary 5.4 from its statement.
Proof of Corollary 5.4 from Theorem 5.5. Choose a power of two λ D \lambda_D λ D with 1 / ( 16 D ) < λ D ≤ 1 / ( 8 D ) 1/(16D)<\lambda_D\le1/(8D) 1/ ( 16 D ) < λ D ≤ 1/ ( 8 D ) and apply the theorem with ε = 1 / 8 \varepsilon=1/8 ε = 1/8 . If its row sum is W 0 W_0 W 0 , then G ⪯ 2 ( W 0 + λ D I ) ⪯ 2 W 0 + I / ( 4 D ) G\preceq2(W_0+\lambda_D I)\preceq2W_0+I/(4D) G ⪯ 2 ( W 0 + λ D I ) ⪯ 2 W 0 + I / ( 4 D ) . Doubling the returned weights gives the required inequality. Since λ D − 1 = O ( D ) \lambda_D^{-1}=O(D) λ D − 1 = O ( D ) , the space and time bounds become those in the corollary.
Technical overview of thm:ub-recovery
Our proof essentially adapts the sampling and sketching arguments of CKL [27 Section 6.4] and KLMMS [48 Sections 4 and 7] to sparse integer rows. We first explain the classical offline sampling algorithm with access to the final instance, and then describe how linear sketches let us implement it after a stream. The complete algorithm and analysis appear in Section A.
The offline algorithm. Let us first suppose that we know all final frequencies and can compute with the full matrix A = diag ( f ) B A = \operatorname{diag}(f)B A = diag ( f ) B and its Gram matrix G = A T A G = A^{\mathsf{T}}A G = A T A . This assumption lets us understand which rows to keep before addressing how to find them in a stream. We follow the iterative sampling approach of Koutis [50 ] , as used by Chen, Khanna, and Li [27 Sections 6.3–6.4] . If G = 0 G = 0 G = 0 , the empty output is exact. Otherwise, the range of G G G is the span of the active row vectors. Its pseudoinverse G † G^{\dagger} G † inverts G G G on this subspace and is zero on its orthogonal complement.
We would like to keep rows whose removal could substantially change the matrix. The leverage score τ i = f i 2 b i T G † b i \tau_i = f_i^2\mathbf{b}_i^{\mathsf{T}}G^{\dagger}\mathbf{b}_i τ i = f i 2 b i T G † b i measures precisely this possibility: it is the largest fraction f i 2 ( b i T x ) 2 / ( x T G x ) f_i^2(\mathbf{b}_i^{\mathsf{T}}x)^2/(x^{\mathsf{T}}Gx) f i 2 ( b i T x ) 2 / ( x T G x ) of the total energy that row i i i contributes in any direction x x x with x T G x > 0 x^{\mathsf{T}}Gx > 0 x T G x > 0 . Every score is at most one because the row’s contribution is part of the total energy. Moreover, ∑ i τ i = tr ( G † G ) = rank G ≤ D \sum_i \tau_i = \operatorname{tr}(G^{\dagger}G) = \operatorname{rank} G \le D ∑ i τ i = tr ( G † G ) = rank G ≤ D .{sup}13` Thus only a few rows can have large scores.
For graph incidence rows with edge weights w i = f i 2 w_i = f_i^2 w i = f i 2 , the leverage score is w i w_i w i times the corresponding effective resistance [69 ] . A simpler offline algorithm would sample directly according to these scores, as Spielman and Srivastava [69 ] do for graph sparsification. We follow the iterative approach because it only needs to test whether scores exceed a threshold. As we explain below, coordinate and norm sketches let us perform these tests without knowing the row frequencies.
The algorithm keeps rows with large scores and randomly samples the others. Each repetition is a sampling level . Let a i ( t ) a_i^{(t)} a i ( t ) be the scalar multiplying row b i \mathbf{b}_i b i at the start of level t t t , initially a i ( 0 ) = f i a_i^{(0)} = f_i a i ( 0 ) = f i , and let J t = ∑ i ( a i ( t ) ) 2 b i b i T J_t = \sum_i (a_i^{(t)})^2\mathbf{b}_i\mathbf{b}_i^{\mathsf{T}} J t = ∑ i ( a i ( t ) ) 2 b i b i T be the current matrix. Its row scores are s i ( t ) = ( a i ( t ) ) 2 b i T G † b i s_i^{(t)} = (a_i^{(t)})^2\mathbf{b}_i^{\mathsf{T}}G^{\dagger}\mathbf{b}_i s i ( t ) = ( a i ( t ) ) 2 b i T G † b i . We continue to measure them relative to the original G G G , even as the multipliers change.
We take T o f f = O ( log ( 2 m / δ ) ) T_{\mathrm{off}} = O(\log(2m/\delta)) T off = O ( log ( 2 m / δ )) levels and a threshold with θ o f f − 1 = O ( ε − 2 T o f f 2 log ( 2 D T o f f / δ ) ) \theta_{\mathrm{off}}^{-1} = O(\varepsilon^{-2}T_{\mathrm{off}}^2\log(2DT_{\mathrm{off}}/\delta)) θ off − 1 = O ( ε − 2 T off 2 log ( 2 D T off / δ )) , choosing sufficiently large constant factors in the number of levels and the reciprocal threshold. Starting with all active rows and an empty retained set, we repeat the following for t = 0 , … , T o f f − 1 t = 0,\ldots,T_{\mathrm{off}}-1 t = 0 , … , T off − 1 :
Retain each not-yet-retained row whose score is at least θ o f f \theta_{\mathrm{off}} θ off , and keep its current multiplier fixed thereafter.
Independently keep each remaining row with probability 1 / 4 1/4 1/4 . Double its multiplier if it survives and remove it otherwise. Leave retained rows unchanged.
After the final level, we return the retained rows, weighted by their squared multipliers. We declare failure if an unretained row remains.
The sampling rule preserves the matrix in expectation: a sampled row contributes four times as much if it survives, which happens with probability one quarter. To prove correctness, we need three guarantees: (i) the changes over all levels leave the matrix within relative error ε \varepsilon ε of G G G , (ii) no unretained row remains at the end, and (iii) at most O ( D / θ o f f ) O(D/\theta_{\mathrm{off}}) O ( D / θ off ) rows are retained.
For the first guarantee, we sample only rows with small scores. Each sampled row therefore has a small contribution in every direction, allowing matrix Bernstein to bound the change at one level; our threshold makes the errors small enough to add over all levels. For the second, an unretained row can remain only if it survives every sampling step, an event whose probability decreases geometrically. Finally, every retained row has score at least θ o f f \theta_{\mathrm{off}} θ off . Once the final matrix is close to G G G , its total score is O ( D ) O(D) O ( D ) , which gives the third guarantee. The following claim combines these arguments.
Claim 5.7 (Classical sampling, adapting [27 Section 6.4.1] ). With probability at least $1-\delta$, after T o f f T_{\mathrm{off}} T off levels only retained rows remain. There are O ( D / θ o f f ) O(D/\theta_{\mathrm{off}}) O ( D / θ off ) such rows, and their sum, weighted by the squared retained multipliers, lies between ( 1 − ε ) G (1-\varepsilon)G ( 1 − ε ) G and $(1+\varepsilon)G.
Proof. We first bound the change at one level. Fix all decisions preceding that level’s sampling, and suppose J t ⪯ 2 G J_t \preceq2G J t ⪯ 2 G . All matrices in the next calculation act on the range of G G G . For each row to be sampled, define Q i = ( a i T ) 2 ( G † ) 1 / 2 b i b i T ( G † ) 1 / 2 Q_i = (a_i^{\mathsf{T}})^2(G^\dagger)^{1/2}b_i b_i^{\mathsf{T}}(G^\dagger)^{1/2} Q i = ( a i T ) 2 ( G † ) 1/2 b i b i T ( G † ) 1/2 . Its operator norm is the row score, so 0 ⪯ Q i ⪯ θ o f f I 0 \preceq Q_i \preceq\theta_{\mathrm{off}}I 0 ⪯ Q i ⪯ θ off I , and ∑ i Q i ⪯ 2 I \sum_i Q_i \preceq2I ∑ i Q i ⪯ 2 I .
Let ξ i \xi_i ξ i indicate whether row i i i survives this level. The normalized change is ∑ i ( 4 ξ i − 1 ) Q i \sum_i(4\xi_i-1)Q_i ∑ i ( 4 ξ i − 1 ) Q i . Its summands are independent and have mean zero and norm at most 3 θ o f f 3\theta_{\mathrm{off}} 3 θ off . Their variance matrix is 3 ∑ i Q i 2 ⪯ 6 θ o f f I 3\sum_i Q_i^2 \preceq6\theta_{\mathrm{off}}I 3 ∑ i Q i 2 ⪯ 6 θ off I , since Q i 2 ⪯ θ o f f Q i Q_i^2 \preceq\theta_{\mathrm{off}}Q_i Q i 2 ⪯ θ off Q i . Matrix Bernstein [77 Theorem 6.1] , applied to both tails, therefore gives the following conditional bound.
Pr [ ∥ ∑ i ( 4 ξ i − 1 ) Q i ∥ o p ≥ ε T o f f ] ≤ 2 D exp ( − ε 2 147 T o f f 2 θ o f f ) ≤ δ 2 T o f f . \Pr\left[\left\|\sum_i(4\xi_i-1)Q_i\right\|_{\mathrm{op}} \ge\frac{\varepsilon}{T_{\mathrm{off}}}\right] \le2D\exp\left(-\frac{\varepsilon^2}{147T_{\mathrm{off}}^2\theta_{\mathrm{off}}}\right) \le\frac{\delta}{2T_{\mathrm{off}}}. Pr i ∑ ( 4 ξ i − 1 ) Q i op ≥ T off ε ≤ 2 D exp ( − 147 T off 2 θ off ε 2 ) ≤ 2 T off δ .
The last inequality follows by choosing the constant in θ o f f − 1 \theta_{\mathrm{off}}^{-1} θ off − 1 sufficiently large. Returning to the original coordinates, the change lies between − ( ε / T o f f ) G -(\varepsilon/T_{\mathrm{off}})G − ( ε / T off ) G and ( ε / T o f f ) G (\varepsilon/T_{\mathrm{off}})G ( ε / T off ) G outside this failure event. We now prove by induction that ( 1 − t ε / T o f f ) G ⪯ J t ⪯ ( 1 + t ε / T o f f ) G (1-t\varepsilon/T_{\mathrm{off}})G \preceq J_t \preceq(1+t\varepsilon/T_{\mathrm{off}})G ( 1 − tε / T off ) G ⪯ J t ⪯ ( 1 + tε / T off ) G . The base case is J 0 = G J_0=G J 0 = G . Assuming the bound at level t t t , we have J t ⪯ 2 G J_t \preceq2G J t ⪯ 2 G , so the preceding estimate applies and establishes the bound at level t + 1 t+1 t + 1 . A union bound over all levels gives the desired approximation to G G G with failure probability at most δ / 2 \delta/2 δ /2 .
Next, an unretained row still present at the end must have survived all T o f f T_{\mathrm{off}} T off independent sampling decisions. The probability that any such row remains is at most m 4 − T o f f ≤ δ / 2 m4^{-T_{\mathrm{off}}}\le\delta/2 m 4 − T off ≤ δ /2 . Otherwise, the retained rows form the entire final matrix.
Finally, each retained row keeps a score of at least θ o f f \theta_{\mathrm{off}} θ off , since both its multiplier and the reference G G G remain fixed. On the approximation event, their total score is at most tr ( G † J T o f f ) ≤ 2 D \operatorname{tr}(G^\dagger J_{T_{\mathrm{off}}})\le2D tr ( G † J T off ) ≤ 2 D . Hence there are at most 2 D / θ o f f 2D/\theta_{\mathrm{off}} 2 D / θ off retained rows. The two failure probabilities sum to at most δ \delta δ , proving all three guarantees.
In particular, the output contains O ( D ε − 2 polylog ( 2 m D / δ ) ) O(D\varepsilon^{-2}\operatorname{polylog}(2mD/\delta)) O ( D ε − 2 polylog ( 2 m D / δ )) rows.
Linear sketches. We now return to the streaming setting. The offline algorithm assumes access to both the frequencies and G G G , but storing all m m m frequencies or all D 2 D^2 D 2 entries of G G G can exceed our space bound. These difficulties also arise in KLMMS [48 Sections 3 and 7] and CKL [27 Section 6.4] . We first explain how to find important rows without knowing their frequencies, assuming a suitable approximation to G G G is available. We then explain how to obtain that approximation.
Our stored information consists of linear sketches Y = Φ A Y=\Phi A Y = Φ A , where Φ \Phi Φ is a random matrix with few rows, acting on the m m m row indices of A A A . A unit update ( i , σ ) (i,\sigma) ( i , σ ) changes Y Y Y by σ ( Φ e i ) b i T \sigma(\Phi e_i)b_i^{\mathsf{T}} σ ( Φ e i ) b i T , where e i e_i e i is the i i i th unit vector. We can make this change using the row index and update alone, without knowing f i f_i f i . After the stream, for any vector v v v we can compute Y v = Φ ( A v ) Yv=\Phi(Av) Y v = Φ ( A v ) . Thus a small matrix maintained during the stream gives us a sketch of A v Av A v even when we choose v v v afterward. The question is which vectors to query, and which information about them suffices to find important rows.
Detecting rows from a coarse approximation. For the moment, we add a known positive term ℓ I \ell I ℓ I to G G G . This modification is called regularization : it adds ℓ ∥ x ∥ 2 \ell\|x\|^2 ℓ ∥ x ∥ 2 to the energy in every direction x x x , so the resulting matrix G + ℓ I G+\ell I G + ℓ I is invertible even when G G G is singular. We call ℓ \ell ℓ the regularization parameter. We will later vary ℓ \ell ℓ to obtain the approximation needed for the row tests. First, let us see how the tests work if the exact matrix H = G + ℓ I H=G+\ell I H = G + ℓ I is given.
For a nonzero row b i b_i b i , define v i = H − 1 b i v_i=H^{-1}b_i v i = H − 1 b i and q i ∗ = b i T H − 1 b i > 0 q_i^*=b_i^{\mathsf{T}}H^{-1}b_i>0 q i ∗ = b i T H − 1 b i > 0 . The vector y ( i ) = A v i y^{(i)}=Av_i y ( i ) = A v i has i i i th coordinate f i q i ∗ f_iq_i^* f i q i ∗ , so this coordinate contains the unknown frequency multiplied by a known scalar. Moreover, its total energy, including the added identity term, is ∥ y ( i ) ∥ 2 2 + ℓ ∥ v i ∥ 2 2 = v i T H v i = q i ∗ \lVert y^{(i)}\rVert_2^2+\ell\lVert v_i\rVert_2^2=v_i^{\mathsf{T}}Hv_i=q_i^* ∥ y ( i ) ∥ 2 2 + ℓ ∥ v i ∥ 2 2 = v i T H v i = q i ∗ . Consequently,
∣ y i ( i ) ∣ 2 ∥ y ( i ) ∥ 2 2 + ℓ ∥ v i ∥ 2 2 = f i 2 b i T ( G + ℓ I ) − 1 b i . (18) \frac{\lvert y_i^{(i)}\rvert^2}{\lVert y^{(i)}\rVert_2^2+\ell\lVert v_i\rVert_2^2}=f_i^2b_i^{\mathsf{T}}(G+\ell I)^{-1}b_i. \tag*{(18)} ∥ y ( i ) ∥ 2 2 + ℓ ∥ v i ∥ 2 2 ∣ y i ( i ) ∣ 2 = f i 2 b i T ( G + ℓ I ) − 1 b i . (18)
The right-hand side is the leverage score with ( G + ℓ I ) − 1 (G+\ell I)^{-1} ( G + ℓ I ) − 1 in place of G † G^\dagger G † , called the regularized leverage score . The identity tells us how to test whether this score is large: we compare one squared coordinate with the total energy. If the coordinate is large enough to estimate accurately, dividing it by q i ∗ q_i^* q i ∗ also estimates the row’s frequency.
This is the reason for choosing an iterative sampling algorithm. At each level it only needs to detect rows above a score threshold and estimate their multipliers; small rows can continue to be sampled. The required estimates come from two standard streaming techniques: CountSketch [22 ] and the sketch of Alon, Matias, and Szegedy (AMS) [8 ] . A coordinate is ℓ 2 \ell_2 ℓ 2 -heavy at threshold θ \theta θ if its squared value is at least θ \theta θ times the squared norm of the vector. CountSketch estimates a specified coordinate with additive error proportional to that norm. For a heavy coordinate, sufficiently accurate estimates therefore have small relative error. AMS estimates the squared norm. Together, the two sketches let us estimate the numerator and denominator of Equation (18) ; the additional term ℓ ∥ v i ∥ 2 2 \ell\lVert v_i\rVert_2^2 ℓ ∥ v i ∥ 2 2 is already known. We examine row indices one at a time, testing their scores and estimating the multipliers of the rows we retain.
We do not need the exact matrix G + ℓ I G+\ell I G + ℓ I for these tests. Suppose instead that we are given a coarse approximation H H H , by which we mean 1 2 H ⪯ G + ℓ I ⪯ 2 H \frac{1}{2}H\preceq G+\ell I\preceq2H 2 1 H ⪯ G + ℓ I ⪯ 2 H . With v i = H − 1 b i v_i=H^{-1}b_i v i = H − 1 b i , the coordinate fraction in Equation (18) agrees with f i 2 b i T H − 1 b i f_i^2b_i^{\mathsf{T}}H^{-1}b_i f i 2 b i T H − 1 b i within constant factors. This is enough to distinguish scores above and below constant multiples of a threshold. The same reasoning applies as sampling changes the multipliers, provided their current Gram matrix plus ℓ I \ell I ℓ I stays within constant factors of H H H . Bounding the error at each sampling level, as in the offline argument, establishes this comparison.
Let us now specify the sketches that supply these estimates at successive sampling levels. Before the stream, we choose nested random subsets E 0 ⊇ E 1 ⊇ ⋯ E_0\supseteq E_1\supseteq\cdots E 0 ⊇ E 1 ⊇ ⋯ of the row indices, starting with E 0 = [ m ] E_0=[m] E 0 = [ m ] and keeping each member independently with probability 1 / 4 1/4 1/4 at the next level. Thus a row belongs to E t E_t E t with probability 4 − t 4^{-t} 4 − t . For each level, we maintain Y t = Φ t diag ( f 1 E t ) B Y_t=\Phi_t\operatorname{diag}(f\mathbf{1}_{E_t})B Y t = Φ t diag ( f 1 E t ) B , where f 1 E t f\mathbf{1}_{E_t} f 1 E t agrees with f f f on E t E_t E t and is zero elsewhere. The matrix Φ t \Phi_t Φ t consists of a CountSketch and an AMS sketch, each applied to every column of the sampled row matrix. An update to row i i i affects this pair only if i ∈ E t i\in E_t i ∈ E t , and its contribution is linear in the update. In particular, membership in the sample concerns a row index, not its unknown number of copies.
After the stream, Y t v Y_tv Y t v supplies both a coordinate estimate and a norm estimate for diag ( f 1 E t ) B v \operatorname{diag}(f\mathbf{1}_{E_t})Bv diag ( f 1 E t ) B v . A row that survives t t t sampling steps without being retained has multiplier 2 t f i 2^tf_i 2 t f i ; multiplying the sampled sketches by 2 t 2^t 2 t accounts for this rescaling. The decoder also maintains the small list of rows already retained and their estimated multipliers. We keep independent copies of the sketch pair for successive estimates, so each queried vector is determined independently of the sketch used to estimate it. All these copies are maintained during the same pass. This describes the sampled measurements underlying the algorithm; Section A gives the full decoder and proves that, given a coarse H H H , it returns a weighted row sum W W W such that W + ℓ I W+\ell I W + ℓ I approximates G + ℓ I G+\ell I G + ℓ I to relative error ε \varepsilon ε .
Successive approximations through regularization. We have reduced the problem to obtaining a coarse approximation H H H . There is an apparent circularity: the row tests need an approximation in order to produce one. The useful distinction is that they need only a constant-factor approximation, but return one with the much smaller relative error ε \varepsilon ε . Regularization lets us use this improvement repeatedly. We start with a large identity term, where a coarse approximation is immediate, and gradually reduce that term while maintaining an accurate approximation to the new target.
For the starting point, choose a power of two λ 0 = O b 0 ( m μ 2 ) \lambda_0 = O_{b_0}(m\mu^2) λ 0 = O b 0 ( m μ 2 ) large enough that G ⪯ λ 0 I G \preceq\lambda_0 I G ⪯ λ 0 I and λ 0 ≥ 1 \lambda_0 \ge1 λ 0 ≥ 1 . Such a choice follows from ∥ G ∥ o p ≤ tr G ≤ b 0 m μ 2 \lVert G\rVert_{\mathrm{op}} \le\operatorname{tr} G \le b_0m\mu^2 ∥ G ∥ op ≤ tr G ≤ b 0 m μ 2 . Then λ 0 I ⪯ G + λ 0 I ⪯ 2 λ 0 I \lambda_0 I \preceq G + \lambda_0 I \preceq2\lambda_0 I λ 0 I ⪯ G + λ 0 I ⪯ 2 λ 0 I , so the known matrix H 0 = λ 0 I H_0 = \lambda_0 I H 0 = λ 0 I is already a coarse approximation. Applying the decoder with this reference produces W 0 + λ 0 I W_0 + \lambda_0 I W 0 + λ 0 I with relative error ε \varepsilon ε . We have therefore learned enough about G G G to move to a smaller identity term.
Suppose we have reached some parameter ℓ \ell ℓ and obtained W + ℓ I W + \ell I W + ℓ I with relative error ε \varepsilon ε . We would next like to approximate G + ( ℓ / 2 ) I G + (\ell/2)I G + ( ℓ /2 ) I . A natural reference is H ′ = W + ( ℓ / 2 ) I H^\prime= W + (\ell/2)I H ′ = W + ( ℓ /2 ) I : we keep the recovered rows and halve only the identity term. The difference between the reference and its new target is still W − G W-G W − G . The target itself has decreased by at most a factor of two, since G + ℓ I ⪯ 2 ( G + ( ℓ / 2 ) I ) G + \ell I \preceq2(G + (\ell/2)I) G + ℓ I ⪯ 2 ( G + ( ℓ /2 ) I ) . Thus the relative error has increased to at most 2 ε 2\varepsilon 2 ε , which is still a coarse approximation. We can now apply the decoder again, at parameter ℓ / 2 \ell/2 ℓ /2 , to restore the relative error to ε \varepsilon ε .
This is the full cycle: an accurate approximation at one parameter gives a coarse approximation at half that parameter, and another decoding step makes it accurate again. We repeat until the parameter reaches the prescribed λ \lambda λ , taking O b 0 ( log ( 2 m μ 2 / λ ) ) O_{b_0}(\log(2m\mu^2/\lambda)) O b 0 ( log ( 2 m μ 2 / λ )) such steps. The error does not double repeatedly: each new call returns to relative error ε \varepsilon ε by querying fresh sketches of the original rows. The previous approximation only determines the vectors used in those queries. We maintain the independent sketch collections for all parameters during the single streaming pass, and decode them in this order afterward.
The final matrix W + λ I W + \lambda I W + λ I approximates G + λ I G + \lambda I G + λ I as required. In the CSP application, we stop at λ \lambda λ of order 1 / D 1/D 1/ D , where the identity term is small enough for the integer-gap argument to preserve all satisfying assignments. This construction follows the regularization argument of KLMMS [48 Section 4] , combined with CKL’s recovery for squared row multipliers [27 Lemma 6.5 and Section 6.4] . In Section A, we verify these adaptations for sparse integer rows and account for the space needed by the sketches and computations.
Removing the regularizer. A known condition-number bound also lets us approximate G G G itself, which is not needed in our main upper bound argument but is an additional result we can obtain. Here the condition number is the ratio of the largest eigenvalue of G G G to its smallest positive eigenvalue, so it is measured on the range of G G G . The bound lets us choose a regularizer whose contribution on that range can be absorbed into the relative error. Since the output contains only active rows, it also vanishes on the kernel of G G G . We obtain the following consequence, proved in Section A.3.
Corollary 5.9. Let B ∈ Z m × D B \in\mathbb{Z}^{m \times D} B ∈ Z m × D satisfy the sparsity, norm, and row-access assumptions of Theorem 5.5, and let a strict-turnstile stream maintain integer frequencies 0 ≤ f i ≤ μ 0 \le f_i \le\mu 0 ≤ f i ≤ μ . Set G = B T diag ( f ) 2 B G = B^\mathsf{T}\operatorname{diag}(f)^2B G = B T diag ( f ) 2 B . Suppose a known κ ≥ 1 \kappa\ge1 κ ≥ 1 satisfies λ max ( G ) / λ min + ( G ) ≤ κ \lambda_{\max}(G)/\lambda_{\min}^{+}(G) \le\kappa λ m a x ( G ) / λ m i n + ( G ) ≤ κ whenever G ≠ 0 G \ne0 G = 0 , where λ min + ( G ) \lambda_{\min}^{+}(G) λ m i n + ( G ) is the smallest positive eigenvalue. Given 0 < ε 0 < 1 0 < \varepsilon_0 < 1 0 < ε 0 < 1 and 0 < δ < 1 / 2 0 < \delta< 1/2 0 < δ < 1/2 , a randomized one-pass algorithm returns active indices S S S and positive weights forming W = ∑ i ∈ S w i b i b i T W = \sum_{i\in S} w_i b_i b_i^\mathsf{T} W = ∑ i ∈ S w i b i b i T such that, with probability at least 1 − δ 1-\delta 1 − δ ,
( 1 − ε 0 ) G ⪯ W ⪯ ( 1 + ε 0 ) G . (1-\varepsilon_0)G \preceq W \preceq(1+\varepsilon_0)G. ( 1 − ε 0 ) G ⪯ W ⪯ ( 1 + ε 0 ) G . For Q κ = 2 + m D μ κ / ( ε 0 δ ) Q_\kappa= 2 + mD\mu\kappa/(\varepsilon_0\delta) Q κ = 2 + m D μ κ / ( ε 0 δ ) , the output contains O s 0 , b 0 ( D ε 0 − 2 polylog Q κ ) O_{s_0,b_0}(D\varepsilon_0^{-2}\operatorname{polylog} Q_\kappa) O s 0 , b 0 ( D ε 0 − 2 polylog Q κ ) indices, and the algorithm uses O s 0 , b 0 ( D ε 0 − 4 polylog Q κ ) O_{s_0,b_0}(D\varepsilon_0^{-4}\operatorname{polylog} Q_\kappa) O s 0 , b 0 ( D ε 0 − 4 polylog Q κ ) bits, including seeds, output, and working space. The time per update and the time after the stream are polynomial in m m m , D D D , μ \mu μ , ε 0 − 1 \varepsilon_0^{-1} ε 0 − 1 , δ − 1 \delta^{-1} δ − 1 , κ \kappa κ and the time needed to obtain a row. If G = 0 G = 0 G = 0 , the successful output is empty after zero rows are ignored.
Upper bounds for Boolean constraint languages
For a constraint language, we choose one capturing polynomial for each relation and express all substituted polynomials in the same monomial coordinates. The largest degree determines the number of coordinates, so the matrix sparsification argument applies without any change.
Corollary 5.10 (Upper bound for constraint languages). Let Γ \Gamma Γ be a fixed finite nonempty Boolean language of nonempty proper relations of arity k k k , and put d = deg Z ( Γ ) d = \deg_{\mathbb{Z}}(\Gamma) d = deg Z ( Γ ) . Given a bound μ ≥ 1 \mu\ge1 μ ≥ 1 on every prefix multiplicity and 0 < δ < 1 / 2 0 < \delta< 1/2 0 < δ < 1/2 , a randomized one-pass strict-turnstile algorithm decides CSP ( Γ ) \operatorname{CSP}(\Gamma) CSP ( Γ ) on n n n variables with error at most δ \delta δ using O k ( n d polylog ( 2 n μ / δ ) ) O_k(n^d \operatorname{polylog}(2n\mu/\delta)) O k ( n d polylog ( 2 n μ / δ )) bits, including decoding workspace. With probability at least 1 − δ 1-\delta 1 − δ , it also recovers a set S S S of active constraints with Sat Γ ( S ) = Sat Γ ( f ) \operatorname{Sat}_{\Gamma}(S) = \operatorname{Sat}_{\Gamma}(f) Sat Γ ( S ) = Sat Γ ( f ) , where f f f is the final instance.
Proof. For each R ∈ Γ R \in\Gamma R ∈ Γ , fix an integer multilinear capturing polynomial p R ∈ Z [ z 1 , … , z k ] p_R \in\mathbb{Z}[z_1,\ldots,z_k] p R ∈ Z [ z 1 , … , z k ] of degree at most d d d . Let ϕ ( α ) \phi(\alpha) ϕ ( α ) contain all multilinear monomials of degree at most d d d on the n n n variables. Its dimension is D = O k ( n d ) D = O_k(n^d) D = O k ( n d ) , and ∥ ϕ ( α ) ∥ 2 2 ≤ D \lVert\phi(\alpha)\rVert_2^2 \le D ∥ ϕ ( α ) ∥ 2 2 ≤ D . For a constraint C C C using relation R R R , substitute its scope into p R p_R p R and let b C b_C b C be the resulting coefficient vector. As in Lemma 5.2 , these rows form a matrix B B B with constant row sparsity and norm, and each row can be generated in polynomial time and logarithmic workspace. The constants can be chosen uniformly over the fixed finite language.
Put G = B ⊤ diag ( f ) 2 B G = B^\top\operatorname{diag}(f)^2 B G = B ⊤ diag ( f ) 2 B . The energy ϕ ( α ) ⊤ G ϕ ( α ) = ∑ C f C 2 ( b C ⊤ ϕ ( α ) ) 2 \phi(\alpha)^\top G\phi(\alpha) = \sum_C f_C^2(b_C^\top\phi(\alpha))^2 ϕ ( α ) ⊤ Gϕ ( α ) = ∑ C f C 2 ( b C ⊤ ϕ ( α ) ) 2 is zero exactly on satisfying assignments and at least one otherwise. By Corollary 5.4, with probability at least 1 − δ 1-\delta 1 − δ we recover active rows with positive weights and weighted sum W W W satisfying G ⪯ W + I / ( 4 D ) G \preceq W + I/(4D) G ⪯ W + I / ( 4 D ) . Any assignment satisfying the retained constraints has zero energy in W W W , and therefore energy at most 1 / 4 1/4 1/4 in G G G . The integer gap forces it to satisfy the original instance. The converse holds because every retained constraint is active.
The number of rows is ∣ U Γ n ∣ = ∑ R ∈ Γ n k ≤ ∣ Γ ∣ n k = n O k ( 1 ) |U_\Gamma^n| = \sum_{R\in\Gamma} n^k \le|\Gamma|n^k = n^{O_k(1)} ∣ U Γ n ∣ = ∑ R ∈ Γ n k ≤ ∣Γ∣ n k = n O k ( 1 ) , so the sparsification uses the stated space, including the recovered constraints and working memory. Enumerating assignments to decide satisfiability adds only O ( n ) O(n) O ( n ) bits, which fit within this bound since d ≥ 1 d \ge1 d ≥ 1 .
Together with Corollary 4.15 , this gives matching bounds up to polylogarithmic factors for non-constant-satisfiable languages when algorithms must handle every stream up to a sufficiently large polynomial length. For an arbitrary fixed finite Boolean language, we first handle empty and full relations as in § 3.1 . The remaining language either admits a common constant satisfying assignment, making its decision problem trivial, or is covered by these two corollaries.
Extension to Larger Domains
We extend the upper bound to relations over arbitrary fixed finite domains by first restricting to a core. We then show that the Boolean degree identity used in the lower bound can fail on a three-element domain, so the same argument does not give a matching lower bound.
Upper bounds over finite domains
Let R ⊆ D k R \subseteq D^k R ⊆ D k be a nonempty relation over the fixed finite domain D = { 0 , … , q − 1 } D = \{0,\ldots,q-1\} D = { 0 , … , q − 1 } . The first step is to replace R R R by its core. Recall from § 3.3 that a relation is a core if every map of its domain preserving the relation is an automorphism. Brakensiek, Putterman, Sharma, and Velusamy [19 Lemma 4.2] show that deciding satisfiability over a relation and over its core have the same streaming space complexity. Their reduction replaces the relation on each constraint’s scope, and therefore also preserves multiplicities and strict-turnstile updates. It thus suffices to give an algorithm for the core. To specify this reduction on D D D , choose a map h : D → D h:D \to D h : D → D with h ( R ) ⊆ R h(R) \subseteq R h ( R ) ⊆ R and smallest image C C C , where h h h acts coordinatewise on tuples. Its restriction to C C C is a permutation: otherwise h 2 h^2 h 2 would have a smaller image. A suitable positive power e e e of h h h therefore fixes C C C pointwise, and e ( R ) = R ∩ C k e(R)=R \cap C^k e ( R ) = R ∩ C k . This restriction is a core. Indeed, a nonbijective map of C C C preserving it would compose with e e e to give a map preserving R R R with smaller image. Fix this choice and write R ⋆ = core ( R ) = R ∩ C k R^\star=\operatorname{core}(R)=R \cap C^k R ⋆ = core ( R ) = R ∩ C k , considered as a relation on C C C .
The core domain C C C retains its labels from D D D , and all degrees below refer to these inherited labels. When ∣ C ∣ ≥ 2 |C| \ge2 ∣ C ∣ ≥ 2 , let d = deg Z ( R ⋆ ) d=\deg_{\mathbb{Z}}(R^\star) d = deg Z ( R ⋆ ) be the minimum total degree of an integer polynomial whose zeros on C k C^k C k are exactly R ⋆ R^\star R ⋆ . Such a polynomial exists by interpolating the function that is zero on R ⋆ R^\star R ⋆ and one elsewhere on C k C^k C k , then clearing its rational denominators. Interpolation also gives d ≤ k ( ∣ C ∣ − 1 ) ≤ k ( q − 1 ) d \le k(|C|-1) \le k(q-1) d ≤ k ( ∣ C ∣ − 1 ) ≤ k ( q − 1 ) . By Observation 3.6 , allowing rational or real coefficients gives the same minimum degree. If ∣ C ∣ = 1 |C|=1 ∣ C ∣ = 1 , set deg Z ( R ⋆ ) = 0 \deg_{\mathbb{Z}}(R^\star)=0 deg Z ( R ⋆ ) = 0 , as in the Boolean case. The degree below refers to the chosen core with these integer labels. Restricting a capturing polynomial for R R R to C C C captures R ⋆ R^\star R ⋆ , so passing to the core cannot increase the degree.
After restricting to C C C , we apply the polynomial representation from Lemma 5.2 . The degree again bounds the number of monomials, and integer coefficients give the same gap between satisfaction and violation. The monomial values are no longer Boolean, but they remain bounded by a constant because the domain and polynomial are fixed. Choosing a smaller regularizer accounts for this change and gives the following bound.
Corollary 6.1 (Finite-domain upper bound). Let R ⊆ D k R \subseteq D^k R ⊆ D k be a fixed nonempty relation over a fixed finite domain of size q q q , with the core and integer labels chosen above, and put d = deg Z ( core ( R ) ) d=\deg_{\mathbb{Z}}(\operatorname{core}(R)) d = deg Z ( core ( R )) . Given μ ≥ 1 \mu\ge1 μ ≥ 1 and 0 < δ < 1 / 2 0<\delta<1/2 0 < δ < 1/2 , a randomized one-pass strict-turnstile algorithm decides CSP( R ) (R) ( R ) on n n n variables with error at most δ \delta δ using
O k , q ( n d polylog ( 2 n μ / δ ) ) O_{k,q}\left(n^d \operatorname{polylog}(2n\mu/\delta)\right) O k , q ( n d polylog ( 2 n μ / δ ) ) bits, including its working space, when every prefix multiplicity is at most μ \mu μ . It can also recover active constraints preserving exactly the satisfying assignments with values in the core domain C C C . The constants depend only on k k k and the original domain size q q q . If d = 0 d=0 d = 0 , the decision problem uses constant space.
Proof. We first justify restricting the assignments to C C C . If an assignment satisfies an R R R -instance, composing it with e e e gives a satisfying assignment over R ⋆ R^\star R ⋆ . Conversely, every R ⋆ R^\star R ⋆ -solution is an R R R -solution. Replacing R R R by R ⋆ R^\star R ⋆ on each scope therefore preserves satisfiability, variables, multiplicities, and the entire update sequence. This is the same argument as in Lemma 3.3 , and it applies to the finite domain D D D without change. If C = { a } C=\{a\} C = { a } , nonemptiness gives R ⋆ = { a k } R^\star=\{a^k\} R ⋆ = { a k } , so the constant assignment satisfies every instance. We may always report satisfiable and return the empty set of constraints.
Assume henceforth that ∣ C ∣ ≥ 2 |C| \ge2 ∣ C ∣ ≥ 2 . The nonempty core R ⋆ R^\star R ⋆ is proper, since a full relation would admit a constant map, so d ≥ 1 d \ge1 d ≥ 1 . Choose an integer polynomial p p p of degree d d d capturing R ⋆ R^\star R ⋆ . For an assignment α ∈ C n \alpha\in C^n α ∈ C n , let ϕ ( α ) \phi(\alpha) ϕ ( α ) be the vector of all monomials of total degree at most d d d , including the constant monomial. We include repeated powers, which cannot be removed on C C C . There are N = ( n + d d ) = O k , q ( n d ) N=\binom{n+d}{d}=O_{k,q}(n^d) N = ( d n + d ) = O k , q ( n d ) such monomials. Put M = max ( { 1 } ∪ { ∣ a ∣ : a ∈ C } ) M=\max(\{1\}\cup\{|a|:a \in C\}) M = max ({ 1 } ∪ { ∣ a ∣ : a ∈ C }) and K = M 2 d K=M^{2d} K = M 2 d . Since M ≤ max { 1 , q − 1 } M \le\max\{1,q-1\} M ≤ max { 1 , q − 1 } and d ≤ k ( q − 1 ) d \le k(q-1) d ≤ k ( q − 1 ) , the constant K K K is bounded in terms of k , q k,q k , q alone. Each squared monomial value is at most K K K , so ∥ ϕ ( α ) ∥ 2 2 ≤ K N \|\phi(\alpha)\|_2^2 \le KN ∥ ϕ ( α ) ∥ 2 2 ≤ K N .
Substituting a constraint’s scope into p p p gives an integer coefficient row b i b_i b i on these monomials. The polynomial is fixed, so every row has constantly many nonzero entries and bounded squared norm. Repeated variables in a scope may add exponents or combine terms, but do not increase total degree or the number of terms. A row can be generated from its scope in polynomial time and O k , q ( log ( n + 2 ) ) O_{k,q}(\log(n+2)) O k , q ( log ( n + 2 )) space. Thus the resulting matrix B ∈ Z m × N B \in\mathbb{Z}^{m \times N} B ∈ Z m × N , where m = n k m=n^k m = n k , meets the assumptions of Theorem 5.5.
For the final frequency vector f f f , set G = B T diag ( f ) 2 B G=B^{\mathsf{T}}\operatorname{diag}(f)^2B G = B T diag ( f ) 2 B . As in the Boolean proof, ϕ ( α ) T G ϕ ( α ) = ∑ i f i 2 p i ( α ) 2 \phi(\alpha)^{\mathsf{T}}G\phi(\alpha)=\sum_i f_i^2p_i(\alpha)^2 ϕ ( α ) T Gϕ ( α ) = ∑ i f i 2 p i ( α ) 2 , where p i p_i p i is the substituted polynomial for constraint i i i . All evaluations are integers because the domain labels and polynomial coefficients are integers. The energy is therefore zero on a satisfying assignment and at least one on any other assignment in C n C^n C n .
We now choose the regularizer small enough for the bound ∥ ϕ ( α ) ∥ 2 2 ≤ K N \|\phi(\alpha)\|_2^2 \le KN ∥ ϕ ( α ) ∥ 2 2 ≤ K N . Apply Theorem 5.5 with ε = 1 / 8 \varepsilon=1/8 ε = 1/8 and a power of two λ \lambda λ satisfying 1 / ( 16 K N ) < λ ≤ 1 / ( 8 K N ) 1/(16KN)<\lambda\le1/(8KN) 1/ ( 16 K N ) < λ ≤ 1/ ( 8 K N ) . On its success event, let W 0 W_0 W 0 be the returned weighted row sum. The lower approximation bound gives G ⪯ 2 ( W 0 + λ I ) G\preceq2(W_0+\lambda I) G ⪯ 2 ( W 0 + λ I ) . Doubling the returned weights gives W = 2 W 0 W=2W_0 W = 2 W 0 and hence G ⪯ W + I / ( 4 K N ) G\preceq W+I/(4KN) G ⪯ W + I / ( 4 K N ) . If α ∈ C n \alpha\in C^n α ∈ C n satisfies all retained constraints, its energy in W W W is zero, and
0 ≤ ϕ ( α ) T G ϕ ( α ) ≤ ∥ ϕ ( α ) ∥ 2 2 4 K N ≤ 1 4 . 0\le\phi(\alpha)^{\mathsf{T}}G\phi(\alpha)\le\frac{\|\phi(\alpha)\|_2^2}{4KN}\le\frac{1}{4}. 0 ≤ ϕ ( α ) T Gϕ ( α ) ≤ 4 K N ∥ ϕ ( α ) ∥ 2 2 ≤ 4 1 .
The integer gap forces this energy to be zero. Conversely, every original solution in C n C^n C n satisfies the retained constraints because they are active. Thus the retained constraints preserve exactly the solutions on the core domain, and deciding whether they have such a solution decides the original instance over D D D .
Finally, K K K is constant and λ − 1 = O k , q ( N ) \lambda^{-1}=O_{k,q}(N) λ − 1 = O k , q ( N ) . Substituting m = n k m=n^k m = n k and N = O k , q ( n d ) N=O_{k,q}(n^d) N = O k , q ( n d ) into Theorem 5.5 gives the stated space bound, including stored output and working space. After discarding the weights, we can enumerate assignments in C n C^n C n and test the retained constraints. This needs O ( n log ∣ C ∣ ) = O k , q ( n ) O(n\log|C|)=O_{k,q}(n) O ( n log ∣ C ∣ ) = O k , q ( n ) additional bits, which fit within the bound since d ≥ 1 d\ge1 d ≥ 1 . The failure probability is at most δ \delta δ .
For the empty relation over any domain, satisfiability is equivalent to having no active constraints. Maintaining the total number of constraint copies gives an O k , q ( log ( n μ + 2 ) ) O_{k,q}(\log(n\mu+2)) O k , q ( log ( n μ + 2 )) -bit algorithm, as in the Boolean case.
Limitations of the lower-bound argument
The core reduction above also applies to the lower-bound question, so we may assume that R R R is already a core. The preceding corollary gives an O k , q ( n d polylog ( 2 n μ / δ ) ) O_{k,q}(n^d\operatorname{polylog}(2n\mu/\delta)) O k , q ( n d polylog ( 2 n μ / δ )) -bit upper bound, where d = deg Z ( R ) d=\deg_{\mathbb{Z}}(R) d = deg Z ( R ) , μ \mu μ bounds prefix multiplicities, and δ \delta δ is the failure probability. The degree is taken with respect to the fixed integer labels for the domain. To obtain a matching lower bound by our Boolean argument, we would need a selection polynomial of degree k − d k-d k − d that is nonzero at one unsatisfying tuple and zero at every other unsatisfying tuple. The following example shows that such a polynomial need not exist over a larger domain.
Consider
R = { ( x , y , z ) ∈ { 0 , 1 , 2 } 3 : x + y + z ≡ 1 ( m o d 3 ) } . R=\{(x,y,z)\in\{0,1,2\}^3:x+y+z\equiv1\pmod{3}\}. R = {( x , y , z ) ∈ { 0 , 1 , 2 } 3 : x + y + z ≡ 1 ( mod 3 )} .
Observation 6.2. The relation R R R is a core with capturing degree two. Every selection polynomial has degree at least four, and degree four is attained for the forbidden tuple 000 000 000 . In particular, d R ( 000 ) + s R ( 000 ) = 6 d_R(000)+s_R(000)=6 d R ( 000 ) + s R ( 000 ) = 6 , rather than the arity three.
Proof. Let’s first verify that R R R is already a core. If h : { 0 , 1 , 2 } → { 0 , 1 , 2 } h:\{0,1,2\}\to\{0,1,2\} h : { 0 , 1 , 2 } → { 0 , 1 , 2 } preserves R R R , the tuples 001 , 022 ∈ R 001,022\in R 001 , 022 ∈ R imply 2 h ( 0 ) + h ( 1 ) ≡ 1 2h(0)+h(1)\equiv1 2 h ( 0 ) + h ( 1 ) ≡ 1 and h ( 0 ) + 2 h ( 2 ) ≡ 1 ( m o d 3 ) h(0)+2h(2)\equiv1\pmod{3} h ( 0 ) + 2 h ( 2 ) ≡ 1 ( mod 3 ) . Thus h ( a ) ≡ h ( 0 ) + a ( m o d 3 ) h(a)\equiv h(0)+a\pmod{3} h ( a ) ≡ h ( 0 ) + a ( mod 3 ) , so h h h is a translation and hence an automorphism. Therefore R R R is a core. Next, let’s compute the capturing degree of R R R . Let S = x + y + z S=x+y+z S = x + y + z . The polynomial p = ( S − 1 ) ( S − 4 ) p=(S-1)(S-4) p = ( S − 1 ) ( S − 4 ) captures R R R . Conversely, an affine linear polynomial vanishing at 100, 010, 001 must be a multiple of S − 1 S-1 S − 1 ; vanishing also at 022 forces it to be zero. Hence deg Z ( R ) = 2 \deg_{\mathbb{Z}}(R)=2 deg Z ( R ) = 2 , and indeed d R ( b ) = 2 d_R(b)=2 d R ( b ) = 2 for every unsatisfying tuple b b b .
Let q q q select an unsatisfying tuple b b b . Then p q pq pq is nonzero only at b b b on the grid { 0 , 1 , 2 } 3 \{0,1,2\}^{3} { 0 , 1 , 2 } 3 . The unique polynomial with individual degrees at most two representing this function is a nonzero multiple of
∏ i = 1 3 ∏ a ∈ { 0 , 1 , 2 } a ≠ b i x i − a b i − a , ( x 1 , x 2 , x 3 ) = ( x , y , z ) , \prod_{i=1}^{3}\prod_{\substack{a\in\{0,1,2\}\\a\ne b_i}}\frac{x_i-a}{b_i-a},\qquad(x_1,x_2,x_3)=(x,y,z), i = 1 ∏ 3 a ∈ { 0 , 1 , 2 } a = b i ∏ b i − a x i − a , ( x 1 , x 2 , x 3 ) = ( x , y , z ) ,
which has total degree six. Reducing p q pq pq using x i 3 = 3 x i 2 − 2 x i x_i^3=3x_i^2-2x_i x i 3 = 3 x i 2 − 2 x i preserves its values on the grid and cannot increase total degree. Consequently, 6 ≤ 2 + deg q 6\le2+\deg q 6 ≤ 2 + deg q , giving deg q ≥ 4 \deg q\ge4 deg q ≥ 4 .
Finally, q 0 = ( S − 2 ) ( S − 3 ) ( S − 5 ) ( S − 6 ) q_0=(S-2)(S-3)(S-5)(S-6) q 0 = ( S − 2 ) ( S − 3 ) ( S − 5 ) ( S − 6 ) selects 000: it is nonzero there and vanishes at every other unsatisfying tuple, whose sum is two, three, five, or six. Thus s R ( 000 ) = 4 s_R(000)=4 s R ( 000 ) = 4 .
For this relation, the finite-domain upper bound gives O ( n 2 polylog ( 2 n μ / δ ) ) O(n^2\operatorname{polylog}(2n\mu/\delta)) O ( n 2 polylog ( 2 n μ / δ )) bits. However, extending our Boolean lower-bound argument directly would require a selection polynomial of degree k − d = 1 k-d=1 k − d = 1 , whereas every selection polynomial has degree at least four. Since R R R is already a core, reducing to the core does not remove this obstruction. The example identifies a limitation of our current proof techniques; it does not rule out a matching lower bound by a different argument.
Streaming algorithm and analysis
The algorithm and proof in this section essentially follow CKL [27 Section 6.4] and KLMMS [48 Sections 4 and 7] , with slight adaptations to the present integer rows of constant sparsity and bounded squared norm. We include the details to verify correctness in this setting and to account for the space needed to store randomness and perform the computations.
We give the complete algorithm in Section A.1 and prove its guarantees in Section A.2, completing the proof of Theorem 5.5. Throughout, B ∈ Z m × D B \in\mathbb{Z}^{m \times D} B ∈ Z m × D is the given matrix, with at most s 0 s_0 s 0 nonzero entries and squared norm at most b 0 b_0 b 0 in each row. The constants s 0 s_0 s 0 , b 0 b_0 b 0 are fixed. We have access to each row in polynomial time and polylogarithmic workspace. The stream maintains integer frequencies 0 ≤ f i ≤ μ 0 \le f_i \le\mu 0 ≤ f i ≤ μ . Let G = B T diag ( f ) 2 B G = B^{\mathsf{T}}\operatorname{diag}(f)^2B G = B T diag ( f ) 2 B be the matrix at its end. Without loss of generality, we ignore zero rows but keep the original row indices (if all rows are zero, we return the empty list).
Algorithm
Algorithm 1 gives the complete algorithm. The next two subsections describe its sketching and decoding subroutines, respectively. Its inputs are B B B , the stream, μ ≥ 1 \mu\ge1 μ ≥ 1 , 0 < ε ≤ 1 / 8 0 < \varepsilon\le1/8 0 < ε ≤ 1/8 , 0 < δ < 1 / 2 0 < \delta< 1/2 0 < δ < 1/2 , and λ = 2 − L \lambda= 2^{-L} λ = 2 − L for an integer L ≥ 0 L \ge0 L ≥ 0 . We specify all remaining parameters from these inputs in Section A.1.3. In particular, K K K is the number of regularization levels and λ j = 2 − j λ 0 \lambda_j = 2^{-j}\lambda_0 λ j = 2 − j λ 0 , with λ K − 1 = λ \lambda_{K-1} = \lambda λ K − 1 = λ .
We represent each weighted row sum by a list of indices and positive weights. A multiplier a i a_i a i scales row b i T b_i^{\mathsf{T}} b i T , so its contribution to the Gram matrix is a i 2 b i b i T a_i^2b_ib_i^{\mathsf{T}} a i 2 b i b i T .
Algorithm 1 Streaming approximation of G + λ I G + \lambda I G + λ I
Input: B B B , the stream, μ \mu μ , ε \varepsilon ε , δ \delta δ , λ \lambda λ .
Output: A weighted row list representing W W W , or failure.
Compute the parameters in Section A.1.3.
Maintain the sketches in Algorithm 2 during the stream.
After the stream, set W ← 0 W \leftarrow0 W ← 0 .
for j = 0 , … , K − 1 j = 0,\ldots,K-1 j = 0 , … , K − 1 do
Set H ← W + λ j I H \leftarrow W + \lambda_j I H ← W + λ j I .
Apply Algorithm 3 to H H H , ℓ = λ j \ell= \lambda_j ℓ = λ j , and the sketches indexed by j j j .
Return failure if the call fails; otherwise set W W W to its output.
end for
Return the list representing W W W .
During the stream, Algorithm 1 maintains a separate collection of sketches for each regularization level. Once the stream ends, it starts with an empty row list and calls the decoder for λ 0 , λ 0 / 2 , … , λ \lambda_0, \lambda_0/2, \ldots, \lambda λ 0 , λ 0 /2 , … , λ . At each call, it forms H H H by adding the current identity term to the preceding weighted row sum, then replaces that sum with the decoder’s output. All calls operate on the stored sketches; none requires another pass over the stream.
Intuitively, the decreasing regularizers make it possible to supply the decoder with the approximation it needs. Initially, H = λ 0 I H = \lambda_0 I H = λ 0 I is within a factor of two of G + λ 0 I G + \lambda_0 I G + λ 0 I , since G ⪯ λ 0 I G \preceq\lambda_0 I G ⪯ λ 0 I . The decoder improves this to relative error ε \varepsilon ε . Halving the identity term increases that error by at most a factor of two, so the resulting matrix is accurate enough for the next call. Repeating this argument gives the final approximation to G + λ I G + \lambda I G + λ I ; we prove the induction in Section A.2. There are K = 1 + log 2 ( λ 0 / λ ) = O b 0 ( log ( 2 m μ 2 / λ ) ) K = 1 + \log_2(\lambda_0/\lambda) = O_{b_0}(\log(2m\mu^2/\lambda)) K = 1 + log 2 ( λ 0 / λ ) = O b 0 ( log ( 2 m μ 2 / λ )) calls, and only two consecutive row lists need to coexist. This construction follows Miller and Peng [62 Section 4] , as developed by KLMMS [48 Theorem 2 and Section 4] . The next two subsections describe the sketches and the decoder.
Sketching
During the stream, we maintain the sampled linear sketches in Algorithm 2. Let T T T be the number of sampling levels, h h h control the independence of the sampling choices, η \eta η be a threshold for testing rows, ε a \varepsilon_a ε a be the desired relative accuracy of multiplier estimates, and β s \beta_s β s be the failure probability allowed for one scan.
To indicate their sizes, we define Q = 2 + m D μ / ( ε δ λ ) Q = 2 + mD\mu/(\varepsilon\delta\lambda) Q = 2 + m D μ / ( ε δ λ ) . Roughly, we take T , h = O b 0 ( log Q ) T,h = O_{b_0}(\log Q) T , h = O b 0 ( log Q ) , with ε a − 1 = O b 0 ( ε − 1 log Q ) \varepsilon_a^{-1} = O_{b_0}(\varepsilon^{-1}\log Q) ε a − 1 = O b 0 ( ε − 1 log Q ) and η − 1 = O b 0 ( ε − 2 log 3 Q ) \eta^{-1} = O_{b_0}(\varepsilon^{-2}\log^3 Q) η − 1 = O b 0 ( ε − 2 log 3 Q ) . The failure budget satisfies β s − 1 = O b 0 ( δ − 1 log 3 Q ) \beta_s^{-1} = O_{b_0}(\delta^{-1}\log^3 Q) β s − 1 = O b 0 ( δ − 1 log 3 Q ) . The exact choices are in Section A.1.3.
We index the sketches by the regularization level j j j , sampling level t t t , and copy u u u used for successive decoding scans. For each triple, the map Φ j , t , u \Phi_{j,t,u} Φ j , t , u combines a CountSketch [22 ] and an AMS sketch [8 ] , applied to every column of the sampled row matrix. CountSketch estimates a specified coordinate of a vector y y y to additive error at most ( ε a η / 100 ) ∥ y ∥ 2 (\varepsilon_a\sqrt{\eta}/100)\lVert y\rVert_2 ( ε a η /100 ) ∥ y ∥ 2 , and AMS estimates its squared norm to relative error at most 1 / 10 1/10 1/10 . The probability that any of the estimates in one scan of at most m m m queries fails is at most β s \beta_s β s .
For each j , t j,t j , t , a sampling mask is a random function ξ j , t : [ m ] → { 0 , 1 } \xi_{j,t} : [m] \to\{0,1\} ξ j , t : [ m ] → { 0 , 1 } : the value one keeps an index in the next sample, and zero removes it. Each ξ j , t ( i ) \xi_{j,t}(i) ξ j , t ( i ) is Bernoulli with mean 1 / 4 1/4 1/4 . Within a mask, these variables are h h h -wise independent, meaning that every set of at most h h h entries has the joint distribution of independent variables. Different masks are independent. All sketch pairs are mutually independent and independent of the masks. We store seeds specifying these functions and evaluate them when needed. Here e i e_i e i denotes the i i i th unit vector, and f 1 E f1_E f 1 E agrees with f f f on E E E and is zero elsewhere.
Algorithm 2 Maintaining the linear sketches
Input: B B B and the stream.
Parameters: K , T , h , η , ε a , β s K,T,h,\eta,\varepsilon_a,\beta_s K , T , h , η , ε a , β s .
Output: Stored sketches and their seeds.
for j = 0 , … , K − 1 j = 0,\ldots,K-1 j = 0 , … , K − 1 do
Set E j , 0 ← [ m ] E_{j,0} \leftarrow[m] E j , 0 ← [ m ] .
for t = 0 , … , T − 1 t = 0,\ldots,T-1 t = 0 , … , T − 1 do
Choose ξ j , t \xi_{j,t} ξ j , t and define E j , t + 1 = { i ∈ E j , t : ξ j , t ( i ) = 1 } E_{j,t+1} = \{i \in E_{j,t} : \xi_{j,t}(i) = 1\} E j , t + 1 = { i ∈ E j , t : ξ j , t ( i ) = 1 } .
Choose Φ j , t , 0 , … , Φ j , t , T \Phi_{j,t,0},\ldots,\Phi_{j,t,T} Φ j , t , 0 , … , Φ j , t , T and initialize every Y j , t , u ← 0 Y_{j,t,u} \leftarrow0 Y j , t , u ← 0 .
end for
end for
for each update ( i , σ ) (i,\sigma) ( i , σ ) with b i ≠ 0 b_i \ne0 b i = 0 do
for each j , t , u j,t,u j , t , u with i ∈ E j , t i \in E_{j,t} i ∈ E j , t do
Y j , t , u ← Y j , t , u + σ ( Φ j , t , u e i ) b i T Y_{j,t,u} \leftarrow Y_{j,t,u} + \sigma(\Phi_{j,t,u}e_i)b_i^{\mathsf{T}} Y j , t , u ← Y j , t , u + σ ( Φ j , t , u e i ) b i T .
end for
end for
Return the stored sketches and seeds.
Algorithm 2 first chooses the nested samples and the independent sketch pairs. Starting with all row indices in E j , 0 E_{j,0} E j , 0 , each sampling mask keeps an index with probability 1 / 4 1/4 1/4 , so an index belongs to E j , t E_{j,t} E j , t with probability 4 − t 4^{-t} 4 − t . The algorithm initializes one pair Y j , t , u Y_{j,t,u} Y j , t , u for each j , t , u j,t,u j , t , u . For an update ( i , σ ) (i,\sigma) ( i , σ ) , it adds σ ( Φ j , t , u e i ) b i T \sigma(\Phi_{j,t,u}e_i)b_i^{\mathsf{T}} σ ( Φ j , t , u e i ) b i T to every pair whose sample contains i i i . This keeps Y j , t , u = Φ j , t , u diag ( f 1 E j , t ) B Y_{j,t,u} = \Phi_{j,t,u}\operatorname{diag}(f1_{E_{j,t}})B Y j , t , u = Φ j , t , u diag ( f 1 E j , t ) B at every stream prefix.
These updates require the row and the change in its frequency, but not the frequency itself. Sampling keeps an entire row type, including all its current copies. After the stream, multiplying a stored pair by v v v gives coordinate and norm estimates for diag ( f 1 E j , t ) B v \operatorname{diag}(f\mathbf{1}_{E_{j,t}})Bv diag ( f 1 E j , t ) B v . We keep several independent copies because the decoder will change row multipliers using answers to earlier queries: a later copy then provides fresh estimates for the modified matrix. The decoder below specifies the role of each copy. This construction follows CKL [27 Figure 6] .
Decoding at one regularizer
At a fixed regularizer ℓ \ell ℓ , we are given a matrix H H H satisfying 1 2 H ⪯ G + ℓ I ⪯ 2 H \frac{1}{2}H \preceq G+\ell I \preceq2H 2 1 H ⪯ G + ℓ I ⪯ 2 H . From the stored sketches, we seek a small weighted set of active rows whose sum W W W satisfies ( 1 − ε ) ( G + ℓ I ) ⪯ W + ℓ I ⪯ ( 1 + ε ) ( G + ℓ I ) (1-\varepsilon)(G+\ell I) \preceq W+\ell I \preceq(1+\varepsilon)(G+\ell I) ( 1 − ε ) ( G + ℓ I ) ⪯ W + ℓ I ⪯ ( 1 + ε ) ( G + ℓ I ) . Algorithm 3 obtains this approximation by saving rows as the sampled set shrinks; its probability of success is proved in Lemma A.3 .
Let θ \theta θ be the threshold for saving new rows and M max M_{\max} M m a x the maximum number of saved rows. We take θ = 1024 η \theta=1024\eta θ = 1024 η , so θ − 1 = O b 0 ( ε − 2 log 3 Q ) \theta^{-1}=O_{b_0}(\varepsilon^{-2}\log^3 Q) θ − 1 = O b 0 ( ε − 2 log 3 Q ) , and M max = O b 0 ( D ε − 2 log 3 Q ) M_{\max}=O_{b_0}(D\varepsilon^{-2}\log^3 Q) M m a x = O b 0 ( D ε − 2 log 3 Q ) . The remaining parameters control rounding, vector computation, and limits on stored numbers; we introduce them with the corresponding subroutines. All exact values are fixed in Section A.1.3.
We keep the matrix H H H fixed during one decoder call and omit the index j j j from its sketches and sampled sets. For each saved row, the list F F F contains its index i i i , the level c i c_i c i at which it was saved, and an estimated multiplier a ^ i \widehat{a}_i a i .
Algorithm 3 Decoding at regularizer ℓ \ell ℓ
Input: The sketches for one regularizer, H H H , ℓ \ell ℓ , and B B B .
Parameters: T T T , η \eta η , θ \theta θ , g a g_a g a , U U U , g v g_v g v , r i n v r_{\mathrm{inv}} r inv , M max M_{\max} M m a x , W max W_{\max} W m a x , C max C_{\max} C m a x .
Output: A weighted row list, or failure.
Set F ← ∅ F \leftarrow\varnothing F ← ∅ .
for t = 0 , … , T − 1 t=0,\ldots,T-1 t = 0 , … , T − 1 do
Obtain Z 0 , … , Z T Z_0,\ldots,Z_T Z 0 , … , Z T and the integers d i d_i d i from Algorithm 4.
Apply Algorithm 5 at level t t t to these sketches and integers.
for each nonzero row i i i outside F F F do
Test i i i with Z T Z_T Z T and threshold θ \theta θ by Algorithm 6.
if the test returns an estimate a ^ i \widehat{a}_i a i then
Return failure if ∣ F ∣ = M max |F|=M_{\max} ∣ F ∣ = M m a x .
Add ( i , c i = t , a ^ i ) (i,c_i=t,\widehat{a}_i) ( i , c i = t , a i ) to F F F .
end if
end for
After the queries, consult ξ t \xi_t ξ t to determine the next sampled set.
end for
Return failure if E T ≠ ∅ E_T\ne\varnothing E T = ∅ .
Return F F F with weights a ^ i 2 \widehat{a}_i^2 a i 2 , representing W = ∑ i ∈ F a ^ i 2 b i b i T W=\sum_{i\in F}\widehat{a}_i^2 b_i b_i^{\mathsf{T}} W = ∑ i ∈ F a i 2 b i b i T .
At each sampling level, Algorithm 3 first prepares working copies Z 0 , … , Z T Z_0,\ldots,Z_T Z 0 , … , Z T of that level’s sketches (line 3). It then adjusts the contributions of rows already in the saved list F F F (line 4). These two subroutines are described next. Once they finish, the decoder tests every row outside F F F using Z T Z_T Z T and saves those for which the test returns a multiplier estimate (lines 5 to 11). Only after these tests does it use the next sampling mask (line 12). At the end, it checks that the sample is empty and returns the saved rows, each weighted by the square of its estimated multiplier.
To understand the working sketches, consider an unsaved row that is still in the sample at level t t t . Its multiplier is 2 t f i 2^t f_i 2 t f i . If it survives the next sampling step, the multiplier doubles; otherwise, its contribution disappears. Since survival has probability 1 / 4 1/4 1/4 , the squared multiplier is preserved in expectation: 1 4 ( 2 a ) 2 = a 2 \frac{1}{4}(2a)^2=a^2 4 1 ( 2 a ) 2 = a 2 . A row saved at level c i c_i c i , however, should keep the multiplier 2 c i f i 2^{c_i}f_i 2 c i f i from then onward. The preparation and adjustment subroutines make the sketches represent both kinds of rows together.
There are T + 1 T+1 T + 1 sketch pairs for each regularization and sampling level. The adjustment subroutine queries Z 0 , … , Z T − 1 Z_0,\ldots,Z_{T-1} Z 0 , … , Z T − 1 in succession, modifying only copies that have not yet been queried. The final pair Z T Z_T Z T is reserved for testing new rows. These independent copies are what allow earlier estimates to determine changes to a matrix while later queries still have the usual sketch guarantees.
Saving rows in line 9 before revealing the next mask makes the choice of rows independent of that sampling step. The proof will show that every row left unsaved has a small contribution, so sampling those rows introduces only a small matrix error. We choose T T T large enough that the final sample is empty with high probability; when it is empty, the saved list contains all remaining contributions. Saving and adjusting rows follows CKL [27 Figure 6 and Lemma 6.5] , with graph rows replaced by the rows of B B B . The identity term ℓ I \ell I ℓ I remains unchanged throughout.
Every subroutine returns failure if one of its calls fails. We also check the specified bounds on stored numbers after each modification. These limits ensure that the space bound holds even when a random estimate is inaccurate. We prove in Section A.2.3 that the checks do not interrupt the computation while the estimates and sampling errors satisfy the bounds used in the proof.
Preparing the working sketches At the beginning of level t t t , we scale the sampled rows to their current multipliers and restore saved rows that have left the sample. Algorithm 4 makes these changes in working copies of the stored sketches. For a saved row still in the sample, let d i d_i d i be the number of halvings needed to restore the multiplier it had when saved. The parameter C max = Q O b 0 ( 1 ) C_{\max}=Q^{O_{b_0}(1)} C m a x = Q O b 0 ( 1 ) bounds the magnitude of each sketch entry; its exact value is fixed in Section A.1.3.
Algorithm 4 Preparing the sketches at level t t t
Input: t t t , the level-t t t sketches and seeds, F F F , and B B B .
Parameters: T T T , C max C_{\max} C m a x .
Output: Z 0 , … , Z T Z_0,\ldots,Z_T Z 0 , … , Z T and d i d_i d i for i ∈ F i\in F i ∈ F , or failure.
Set Z u ← 2 t Y t , u Z_u\leftarrow2^tY_{t,u} Z u ← 2 t Y t , u for u = 0 , … , T u=0,\ldots,T u = 0 , … , T .
for i ∈ F i\in F i ∈ F do
if i ∉ E t i\notin E_t i ∈ / E t then
Add a ^ i ( Φ t , u e i ) b i T \widehat a_i(\Phi_{t,u}e_i)b_i^{\mathsf T} a i ( Φ t , u e i ) b i T to every Z u Z_u Z u and set d i ← 0 d_i\leftarrow0 d i ← 0 .
else
Set d i ← t − c i d_i\leftarrow t-c_i d i ← t − c i .
end if
end for
Return failure if any modified sketch entry exceeds C max C_{\max} C m a x in magnitude.
Return the working sketches and the integers d i d_i d i .
Algorithm 4 multiplies every level-t t t sketch by 2 t 2^t 2 t , giving each sampled row its current multiplier 2 t f i 2^t f_i 2 t f i (line 1). It then goes through the saved list. If a saved row has left the sample, the algorithm adds its saved estimate a ^ i \widehat a_i a i to every working sketch and sets d i = 0 d_i=0 d i = 0 (line 4). If the row is still sampled, it already occurs with multiplier 2 t f i 2^t f_i 2 t f i , whereas its intended multiplier is 2 c i f i 2^{c_i}f_i 2 c i f i . The algorithm leaves this contribution in place and sets d i = t − c i d_i=t-c_i d i = t − c i for the next subroutine.
After preparation, every saved row is represented, including those absent from the sample. The counts d i d_i d i specify the halvings still needed for saved rows that remain sampled. Each sampling level starts from copies of its original stored sketches, so changes made at earlier levels are not carried forward. The proof uses this to control the accumulation of estimation errors. The additions of saved rows follow CKL [27 Figure 6] .
Correcting selected rows We next restore the multipliers of saved rows that remain in the sample. Algorithm 5 performs the halvings specified by the counts d i d_i d i . Each scan queries one sketch copy and modifies only later copies.
Algorithm 5 Correcting the multipliers of selected rows
Input: t t t , Z 0 , … , Z T Z_0,\ldots,Z_T Z 0 , … , Z T , their seeds, F F F , the integers d i d_i d i , H H H , ℓ \ell ℓ , and B B B .
Parameters: T T T , η \eta η , g a g_a g a , U U U , g v g_v g v , r i n v r_{\mathrm{inv}} r inv , W max W_{\max} W m a x , C max C_{\max} C m a x .
Output: Modified working sketches, or failure.
for u = 0 , … , T − 1 u = 0,\ldots,T-1 u = 0 , … , T − 1 do
for each i ∈ F i \in F i ∈ F with d i > 0 d_i > 0 d i > 0 do
Test i i i with Z u Z_u Z u and threshold η \eta η by Algorithm 6.
if the test returns z ^ i \widehat{z}_i z i then
Subtract ( z ^ i / 2 ) ( Φ t , v e i ) b i ⊤ (\widehat{z}_i/2)(\Phi_{t,v e_i})b_i^\top ( z i /2 ) ( Φ t , v e i ) b i ⊤ from every Z v Z_v Z v with v > u v > u v > u .
Set d i ← d i − 1 d_i \gets d_i - 1 d i ← d i − 1 .
end if
end for
Return failure if any modified sketch entry exceeds C max C_{\max} C m a x in magnitude.
end for
Return failure if some d i > 0 d_i > 0 d i > 0 ; otherwise return the modified sketches.
Algorithm 5 makes T T T scans through the saved rows. In scan u u u , it queries Z u Z_u Z u for every row with d i > 0 d_i > 0 d i > 0 (line 3). If the row test returns an estimate z ^ i \widehat{z}_i z i of its current multiplier, the algorithm subtracts half that estimate from every later copy Z v Z_v Z v , v > u v > u v > u , and decreases d i d_i d i by one (lines 5 to 6). Thus a multiplier z i z_i z i becomes z i − z ^ i / 2 z_i-\widehat{z}_i/2 z i − z i /2 , which is close to z i / 2 z_i/2 z i /2 . The queried copy is unchanged during the scan. The subroutine succeeds only if every count reaches zero.
Estimating the current multiplier at each halving keeps the error small relative to the contribution being adjusted. Subtracting the entire excess using only the old saved estimate could instead magnify that estimate’s error by the large factor 2 t − c i 2^{t-c_i} 2 t − c i . The smaller threshold η \eta η , compared with the threshold θ \theta θ for saving new rows, lets us estimate rows whose contributions still need adjustment.
A test need not detect every row with d i > 0 d_i > 0 d i > 0 in every scan. The proof shows that it detects all rows with the largest remaining count. That count therefore decreases after each scan, and T T T scans suffice to complete the halvings. Using a new copy for each scan is also essential: its represented matrix is determined by answers from earlier copies, independently of its own seed. This lets us apply the coordinate and norm guarantees even though the preceding changes depend on earlier estimates. The repeated estimation and halving follow CKL [27 Figure 6 and Claims 6.20–6.21] .
Testing a row Correction and selection both require a test that detects a sufficiently large row contribution and estimates its multiplier. Algorithm 6 performs this test, with a different threshold for the two uses. Let ϑ ∈ { η , θ } \vartheta\in\{\eta,\theta\} ϑ ∈ { η , θ } be the threshold passed to this call, g a g_a g a the rounding spacing for multiplier estimates, and W max W_{\max} W m a x their maximum allowed value. Their sizes satisfy g a − 1 = O b ( ε − 1 log Q ) g_a^{-1} = O_b(\varepsilon^{-1}\log Q) g a − 1 = O b ( ε − 1 log Q ) and W max = Q O b ( 1 ) W_{\max} = Q^{O_b(1)} W m a x = Q O b ( 1 ) . The parameters U U U , g v g_v g v , r i n v r_{\mathrm{inv}} r inv belong to the vector computation in Algorithm 7. All are fixed in Section A.1.3. For a positive power of two g g g , define round g ( x ) \operatorname{round}_g(x) round g ( x ) as a nearest multiple of g g g , with fixed tie breaking; for vectors, round each coordinate separately.
Algorithm 6 Testing a row and estimating its multiplier
Input: A nonzero row index i i i , a working sketch pair Z Z Z with its seed, H H H , and ℓ \ell ℓ .
Parameters: ϑ \vartheta ϑ , g a g_a g a , U U U , g v g_v g v , r i n v r_{\mathrm{inv}} r inv , W max W_{\max} W m a x .
Output: Rejection, an estimated multiplier, or failure.
Compute v i v_i v i by Algorithm 7 and set q i ← b i T v i q_i \leftarrow b_i^{\mathsf{T}}v_i q i ← b i T v i .
Return failure if q i ≤ 0 q_i \le0 q i ≤ 0 .
From Z v i Zv_i Z v i , obtain a CountSketch estimate y ^ i \widehat{y}_i y i of coordinate i i i and an AMS estimate ν ^ i \widehat{\nu}_i ν i of the squared norm.
Set t ^ i 2 ← ν ^ i + ℓ ∥ v i ∥ 2 2 \widehat{t}_i^2 \leftarrow\widehat{\nu}_i+\ell\lVert v_i\rVert_2^2 t i 2 ← ν i + ℓ ∥ v i ∥ 2 2 .
Reject unless y ^ i > 0 \widehat{y}_i>0 y i > 0 and y ^ i 2 ≥ 2 ϑ t ^ i 2 \widehat{y}_i^2\ge2\vartheta\widehat{t}_i^2 y i 2 ≥ 2 ϑ t i 2 .
Set z ^ i ← round g a ( y ^ i / q i ) \widehat{z}_i \leftarrow\operatorname{round}_{g_a}(\widehat{y}_i/q_i) z i ← round g a ( y i / q i ) .
Return failure unless 0 < z ^ i ≤ W max 0<\widehat{z}_i\le W_{\max} 0 < z i ≤ W m a x ; otherwise return z ^ i \widehat{z}_i z i .
Algorithm 6 first computes a vector v i v_i v i close to H − 1 b i H^{-1}b_i H − 1 b i and the scalar q i = b i T v i q_i=b_i^{\mathsf{T}}v_i q i = b i T v i (line 1). After checking that q i > 0 q_i>0 q i > 0 , it multiplies the sketch pair by v i v_i v i to estimate one coordinate and the squared norm of the resulting vector. The test then compares the squared coordinate estimate with ν ^ i + ℓ ∥ v i ∥ 2 2 \widehat{\nu}_i+\ell\lVert v_i\rVert_2^2 ν i + ℓ ∥ v i ∥ 2 2 , rejecting if the coordinate is nonpositive or too small (line 5). Otherwise, it divides the coordinate estimate by q i q_i q i , rounds the quotient, and returns it as the multiplier estimate (lines 6 to 7).
The reason for this quotient is an exact identity. Suppose the working sketch represents diag ( z ) B \operatorname{diag}(z)B diag ( z ) B , where z i z_i z i is row i i i ’s current multiplier. The queried vector is y = diag ( z ) B v i y=\operatorname{diag}(z)Bv_i y = diag ( z ) B v i , whose i i i th coordinate is y i = z i q i y_i=z_iq_i y i = z i q i . We need not know or store the multipliers z i z_i z i to query this vector. Dividing an accurate coordinate estimate by the known scalar q i q_i q i therefore estimates z i z_i z i , even though v i v_i v i only approximates H − 1 b i H^{-1}b_i H − 1 b i .
The comparison with the norm identifies the coordinates for which that estimate is accurate enough. CountSketch gives an additive error proportional to ∥ y ∥ 2 \lVert y\rVert_2 ∥ y ∥ 2 ; once a coordinate is sufficiently large, this becomes a small relative error. Moreover, when H H H approximates the represented Gram matrix plus ℓ I \ell I ℓ I , the fraction y i 2 / ( ∥ y ∥ 2 2 + ℓ ∥ v i ∥ 2 2 ) y_i^2/(\lVert y\rVert_2^2+\ell\lVert v_i\rVert_2^2) y i 2 / (∥ y ∥ 2 2 + ℓ ∥ v i ∥ 2 2 ) is comparable to the row’s leverage score z i 2 b i T H − 1 b i z_i^2b_i^{\mathsf{T}}H^{-1}b_i z i 2 b i T H − 1 b i . Thus the same test detects important rows and estimates their multipliers. The regularizer’s contribution is computed directly from v i v_i v i and ℓ \ell ℓ .
Under the sketch guarantees, a row with zero multiplier cannot pass the test. Rounding the returned estimate keeps its bit length bounded. The threshold is η \eta η when adjusting saved rows and ϑ \vartheta ϑ when testing new rows. This adapts CKL’s coordinate-to-energy test [27 Lemma 6.6 and Figure 7] , with the regularizer included explicitly.
Computing the vector v i v_i v i The row test needs a vector close to H − 1 b i H^{-1}b_i H − 1 b i . Algorithm 7 computes it by iteration from the positive identity term and weighted row list representing H H H . Let U U U bound its largest eigenvalue, g v g_v g v be the rounding spacing for vector coordinates, and r i n v r_{\mathrm{inv}} r inv be the number of iterations. All three, including g v − 1 g_v^{-1} g v − 1 in place of g v g_v g v , are bounded by Q O b ( 1 ) Q^{O_b(1)} Q O b ( 1 ) ; their exact values are fixed in Section A.1.3.
Algorithm 7 Computing v i v_i v i
Input: H = ℓ I + ∑ a w a b i a b i a T H = \ell I + \sum_a w_a b_{i_a} b_{i_a}^{\mathsf{T}} H = ℓ I + ∑ a w a b i a b i a T as a weighted row list, and a nonzero b i b_i b i .
Parameters: U , g v , r i n v U, g_v, r_{\mathrm{inv}} U , g v , r inv .
Output: A vector v i v_i v i .
Set v ← 0 v \leftarrow0 v ← 0 .
for r = 1 , … , r i n v r = 1, \ldots, r_{\mathrm{inv}} r = 1 , … , r inv do
Compute H v = ℓ v + ∑ a w a b i a ( b i a T v ) Hv = \ell v + \sum_a w_a b_{i_a}(b_{i_a}^{\mathsf{T}}v) H v = ℓ v + ∑ a w a b i a ( b i a T v ) by scanning the list.
Set v ← round g v ( v + U − 1 ( b i − H v ) ) v \leftarrow\operatorname{round}_{g_v}(v + U^{-1}(b_i - Hv)) v ← round g v ( v + U − 1 ( b i − H v )) .
end for
Return v i = v v_i = v v i = v .
Algorithm 7 starts from v = 0 v = 0 v = 0 . At each iteration, it computes H v Hv H v by scanning the weighted row list, adds U − 1 ( b i − H v ) U^{-1}(b_i - Hv) U − 1 ( b i − H v ) to v v v , and rounds each coordinate to the nearest multiple of g v g_v g v (line 4). After the prescribed number of iterations, it returns the current vector.
The difference b i − H v b_i - Hv b i − H v measures the error in the equation we want to solve. Adding a scaled copy of this difference reduces that error: U U U bounds the largest eigenvalue, while the positive term ℓ I \ell I ℓ I bounds every eigenvalue away from zero. Multiplication by H H H needs only the list, since each row contributes w a b i a ( b i a T v ) w_a b_{i_a}(b_{i_a}^{\mathsf{T}}v) w a b i a ( b i a T v ) and the identity term contributes ℓ v \ell v ℓ v . We therefore avoid storing a dense matrix or its inverse.
Rounding bounds the number of bits per coordinate. We choose the spacing small enough that accumulated rounding error remains below the accuracy needed by the row test, and enough iterations to reduce the initial error to the same scale. The computation needs only a constant number of length-D D D work vectors. We prove the accuracy and space bounds in Claims A.12 and A.23.
Parameter choices
We now fix all quantities used by the algorithms. We may first round ε \varepsilon ε and δ \delta δ down to powers of two, keeping the same notation. This strengthens the requested guarantees and changes the bounds by at most constant factors. Let ε a \varepsilon_a ε a be the relative error allowed in multiplier estimates, ε s \varepsilon_s ε s the error allowed in one sampling step, and ε v \varepsilon_v ε v the relative error allowed when computing v i v_i v i .
(i) We begin with a regularizer large enough that G ⪯ λ 0 I G \preceq\lambda_0 I G ⪯ λ 0 I , and halve it until reaching λ \lambda λ . We choose λ 0 \lambda_0 λ 0 as the least power of two at least max { 1 , b 0 m μ 2 } \max\{1, b_0m\mu^2\} max { 1 , b 0 m μ 2 } , set K = 1 + log 2 ( λ 0 / λ ) K = 1 + \log_2(\lambda_0/\lambda) K = 1 + log 2 ( λ 0 / λ ) , and set λ j = 2 − j λ 0 \lambda_j = 2^{-j}\lambda_0 λ j = 2 − j λ 0 for 0 ≤ j < K 0 \leq j < K 0 ≤ j < K .
(ii) We choose enough sampling levels that the final sample is empty with the required probability. We set T = ⌈ log 4 ( 8 K m / δ ) ⌉ T = \lceil\log_4(8Km/\delta)\rceil T = ⌈ log 4 ( 8 K m / δ )⌉ . Each of the K K K decoding calls has at most T T T sampling steps and T ( T + 1 ) T(T + 1) T ( T + 1 ) scans. We allow failure probability β c = δ / ( 8 K T ) \beta_c = \delta/(8KT) β c = δ / ( 8 K T ) for one sampling step and β s = δ / ( 8 K T ( T + 1 ) ) \beta_s = \delta/(8KT(T + 1)) β s = δ / ( 8 K T ( T + 1 )) for the estimates in one scan.
(iii) We choose the independence of each mask to control its sampling error, setting h = 2 ⌈ log 2 ( 4 D 2 / β c ) ⌉ h = 2\lceil\log_2(4D^2/\beta_c)\rceil h = 2 ⌈ log 2 ( 4 D 2 / β c )⌉ . The errors from successive sampling steps and multiplier corrections must remain small in total. We therefore set ε s = ε / ( 64 T ) \varepsilon_s = \varepsilon/(64T) ε s = ε / ( 64 T ) and ε a = ε / ( 1000 ( T + 1 ) ) \varepsilon_a = \varepsilon/(1000(T + 1)) ε a = ε / ( 1000 ( T + 1 )) . A fixed relative accuracy suffices for computing each v i v_i v i , so we set ε v = 1 / 100 \varepsilon_v = 1/100 ε v = 1/100 .
(iv) The selection threshold must be small enough that discarding unselected rows introduces little error. The correction threshold is smaller, so previously selected rows can still be detected while their multipliers are restored. We set η = ε s 2 / ( 2 14 ⋅ 1000 h ) \eta= \varepsilon_s^2/(2^{14}\cdot1000h) η = ε s 2 / ( 2 14 ⋅ 1000 h ) and θ = 1024 η \theta= 1024\eta θ = 1024 η , so 16 θ = ε s 2 / ( 1000 h ) 16\theta= \varepsilon_s^2/(1000h) 16 θ = ε s 2 / ( 1000 h ) . For rounding multiplier estimates, we choose g a g_a g a as the largest power of two at most ε a / 100 \varepsilon_a/100 ε a /100 . (v) We bound the saved list length, the multiplier estimates, and the magnitudes of sketch entries, respectively, by M max = ⌈ 12 D / θ ⌉ M_{\max} = \lceil12D/\theta\rceil M m a x = ⌈ 12 D / θ ⌉ , W max = 2 T + 3 μ W_{\max} = 2^{T+3}\mu W m a x = 2 T + 3 μ , and C max = 4 m ( T + 2 ) W max ( b 0 + 1 ) C_{\max} = 4m(T+2)W_{\max}(b_0+1) C m a x = 4 m ( T + 2 ) W m a x ( b 0 + 1 ) . These limits bound storage even when a random estimate is inaccurate. We prove below that they do not cause failure when the estimates and sampling steps satisfy their required bounds.
(vi) The list and multiplier limits give an upper bound on the largest eigenvalue of H H H . We choose U U U as the least power of two at least λ 0 + b 0 M max W max 2 \lambda_0+b_0M_{\max}W_{\max}^2 λ 0 + b 0 M m a x W m a x 2 . To control the rounding error in computing v i v_i v i , we choose g v g_v g v as the largest power of two at most ε v λ / ( 8 U 2 D ) \varepsilon_v\lambda/(8U^2D) ε v λ / ( 8 U 2 D ) . To reduce the error from the initial vector, we set r i n v = ( U / λ ) ⌈ log 2 ( 8 U ( b 0 + 1 ) / ( ε v λ ) ) ⌉ r_{\mathrm{inv}}=(U/\lambda)\lceil\log_2(8U(b_0+1)/(\varepsilon_v\lambda))\rceil r inv = ( U / λ ) ⌈ log 2 ( 8 U ( b 0 + 1 ) / ( ε v λ ))⌉ .
Each sketch pair uses O ( ( ε a 2 η ) − 1 log ( 2 m / β s ) ) O((\varepsilon_a^2\eta)^{-1}\log(2m/\beta_s)) O (( ε a 2 η ) − 1 log ( 2 m / β s )) entries per column. We implement the coordinate and norm estimates with coefficients in { − 1 , 0 , 1 } \{-1,0,1\} { − 1 , 0 , 1 } . Recall that Q = 2 + m D μ / ( ε δ λ ) Q=2+mD\mu/(\varepsilon\delta\lambda) Q = 2 + m D μ / ( ε δ λ ) . All the quantities above have O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) -bit rational descriptions. The implementation of the remaining arithmetic, including the tests before exceeding a storage limit, is given in Section A.2.3.
Correctness
We prove Theorem 5.5 by analyzing Algorithm 1. We restate the guarantee here before giving the three supporting lemmas.
Theorem 5.5 (restated). Let B ∈ Z m × D B \in\mathbb{Z}^{m\times D} B ∈ Z m × D have at most s 0 s_0 s 0 nonzero entries and squared norm at most b 0 b_0 b 0 in each row, where s 0 , b 0 s_0,b_0 s 0 , b 0 are fixed constants. Suppose that a row can be obtained from its index in polynomial time and polylogarithmic space. Let μ ≥ 1 \mu\ge1 μ ≥ 1 , 0 < ε ≤ 1 / 8 0<\varepsilon\le1/8 0 < ε ≤ 1/8 , 0 < δ < 1 / 2 0<\delta<1/2 0 < δ < 1/2 , and λ = 2 − L \lambda=2^{-L} λ = 2 − L for an integer L ≥ 0 L\ge0 L ≥ 0 , and define Q = 2 + m D μ / ( ε δ λ ) Q=2+mD\mu/(\varepsilon\delta\lambda) Q = 2 + m D μ / ( ε δ λ ) .
For every fixed strict-turnstile stream maintaining integer frequencies 0 ≤ f i ≤ μ 0\le f_i\le\mu 0 ≤ f i ≤ μ , Algorithm 1 returns, with probability at least 1 − δ 1-\delta 1 − δ , a set S ⊆ { i : f i > 0 } S\subseteq\{i:f_i>0\} S ⊆ { i : f i > 0 } and positive weights forming W = ∑ i ∈ S w i b i b i T W=\sum_{i\in S}w_i b_i b_i^{\mathsf{T}} W = ∑ i ∈ S w i b i b i T such that
( 1 − ε ) ( G + λ I ) ⪯ W + λ I ⪯ ( 1 + ε ) ( G + λ I ) , G = B T diag ( f ) 2 B . (1-\varepsilon)(G+\lambda I)\preceq W+\lambda I\preceq(1+\varepsilon)(G+\lambda I),\qquad G=B^{\mathsf{T}}\operatorname{diag}(f)^2B. ( 1 − ε ) ( G + λ I ) ⪯ W + λ I ⪯ ( 1 + ε ) ( G + λ I ) , G = B T diag ( f ) 2 B . The set has O s 0 , b 0 ( D ε − 2 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-2}\operatorname{polylog} Q) O s 0 , b 0 ( D ε − 2 polylog Q ) indices. For every choice of seeds, the algorithm uses O s 0 , b 0 ( D ε − 4 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-4}\operatorname{polylog} Q) O s 0 , b 0 ( D ε − 4 polylog Q ) bits, including all stored sketches, seeds, output, and working space. The time per update and the time after the stream are polynomial in m m m , D D D , μ \mu μ , ε − 1 \varepsilon^{-1} ε − 1 , δ − 1 \delta^{-1} δ − 1 , λ − 1 \lambda^{-1} λ − 1 and the time needed to obtain a row.
We use three lemmas. The sketching lemma guarantees accurate coordinate and norm estimates for queries fixed independently of the sketch seed. The decoding lemma shows how these estimates produce a small weighted set of active rows approximating G + ℓ I G+\ell I G + ℓ I at one regularizer ℓ \ell ℓ . The space and time lemma bounds the computation for every choice of seeds, including choices for which decoding fails. Their parameters always have the values fixed in Section A.1.3. We state the lemmas first and then prove Theorem 5.5, including the short induction over the regularizers. Their proofs follow in Sections A.2.1 to A.2.3, respectively.
Lemma A.1 (Sketching). Let β s = δ / ( 8 K T ( T + 1 ) ) \beta_s=\delta/(8KT(T+1)) β s = δ / ( 8 K T ( T + 1 )) be the failure probability allowed for all estimates in one scan of at most m m m row queries. Let Φ \Phi Φ be a sketch pair constructed as in Algorithm 2, and let A ∈ R m × D A\in\mathbb{R}^{m\times D} A ∈ R m × D and v 1 , … , v m ∈ R D v_1,\ldots,v_m\in\mathbb{R}^D v 1 , … , v m ∈ R D be fixed independently of its seed. Given Φ A \Phi A Φ A , the estimates for y ( i ) = A v i y^{(i)}=Av_i y ( i ) = A v i satisfy, simultaneously for every queried i i i ,
∣ y ^ i − y i ( i ) ∣ ≤ ε a η 100 ∥ y ( i ) ∥ 2 , 0.9 ∥ y ( i ) ∥ 2 2 ≤ v ^ i ≤ 1.1 ∥ y ( i ) ∥ 2 2 , (19) \left|\widehat{y}_i-y_i^{(i)}\right|\le\frac{\varepsilon_a\sqrt{\eta}}{100}\left\|y^{(i)}\right\|_2,\qquad0.9\left\|y^{(i)}\right\|_2^2\le\widehat{v}_i\le1.1\left\|y^{(i)}\right\|_2^2, \tag*{(19)} y i − y i ( i ) ≤ 100 ε a η y ( i ) 2 , 0.9 y ( i ) 2 2 ≤ v i ≤ 1.1 y ( i ) 2 2 , (19) with probability at least 1 − β s 1-\beta_s 1 − β s .
The independence assumption in Lemma A.1 needs care during decoding, because earlier estimates determine changes to later working sketches. We will verify that each queried matrix is determined independently of the seed used to estimate it in Claim A.22 . The next lemma gives the resulting guarantee for a complete decoding call.
Lemma A.3 (Decoding). Fix the main inputs and their parameter values, a frequency vector f ∈ { 0 , … , μ } m f \in\{0,\ldots,\mu\}^{m} f ∈ { 0 , … , μ } m , and j ∈ { 0 , … , K − 1 } j \in\{0,\ldots,K-1\} j ∈ { 0 , … , K − 1 } . Put ℓ = λ j \ell= \lambda_j ℓ = λ j . Suppose H = ℓ I + ∑ r = 1 p a r 2 b i r b i r T H = \ell I + \sum_{r=1}^{p} a_r^2 b_{i_r}b_{i_r}^{\mathsf{T}} H = ℓ I + ∑ r = 1 p a r 2 b i r b i r T , where p ≤ M max p \le M_{\max} p ≤ M m a x and each a r ∈ ( 0 , W max ] a_r \in(0,W_{\max}] a r ∈ ( 0 , W m a x ] is a multiple of g a g_a g a . Suppose also that 1 2 H ⪯ G + ℓ I ⪯ 2 H \frac{1}{2}H \preceq G+\ell I \preceq2H 2 1 H ⪯ G + ℓ I ⪯ 2 H and that H H H is independent of the masks and sketch seeds used in this call.
With probability at least 1 − δ / K 1-\delta/K 1 − δ / K , Algorithm 3 returns a list F F F of at most M max M_{\max} M m a x active rows with multipliers a ^ i ∈ ( 0 , W max ] \widehat{a}_i \in(0,W_{\max}] a i ∈ ( 0 , W m a x ] , each a multiple of g a g_a g a . The weighted sum W = ∑ i ∈ F a ^ i 2 b i b i T W=\sum_{i\in F}\widehat{a}_i^2b_i b_i^{\mathsf{T}} W = ∑ i ∈ F a i 2 b i b i T satisfies ( 1 − ε ) ( G + ℓ I ) ⪯ W + ℓ I ⪯ ( 1 + ε ) ( G + ℓ I ) (1-\varepsilon)(G+\ell I)\preceq W+\ell I\preceq(1+\varepsilon)(G+\ell I) ( 1 − ε ) ( G + ℓ I ) ⪯ W + ℓ I ⪯ ( 1 + ε ) ( G + ℓ I ) .
Lemma A.4 (Space and time). Let Q = 2 + m D μ / ( ε δ λ ) Q=2+mD\mu/(\varepsilon\delta\lambda) Q = 2 + m D μ / ( ε δ λ ) . For every choice of random seeds, Algorithm 1 uses O s 0 , b 0 ( D ε − 4 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-4}\operatorname{polylog}Q) O s 0 , b 0 ( D ε − 4 polylog Q ) bits, including the stored sketches, seeds, output, and working space. Its output contains at most O s 0 , b 0 ( D ε − 2 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-2}\operatorname{polylog}Q) O s 0 , b 0 ( D ε − 2 polylog Q ) indices. The time per update and the time after the stream are polynomial in m m m , D D D , μ \mu μ , ε − 1 \varepsilon^{-1} ε − 1 , δ − 1 \delta^{-1} δ − 1 , λ − 1 \lambda^{-1} λ − 1 and the time needed to obtain a row.
Proof of Theorem 5.5. Fix a legal stream and let f f f be its final frequency vector. During the stream, an update ( i , σ ) (i,\sigma) ( i , σ ) changes each sampled row matrix by σ 1 [ i ∈ E j , t ] e i b i T \sigma\mathbf{1}[i\in E_{j,t}]e_i b_i^{\mathsf{T}} σ 1 [ i ∈ E j , t ] e i b i T . The corresponding change to its sketch is exactly the update in Algorithm 2. Since the sketches start at zero, linearity gives Y j , t , u = Φ j , t , u diag ( f 1 E j , t ) B Y_{j,t,u}=\Phi_{j,t,u}\operatorname{diag}(f\mathbf{1}_{E_{j,t}})B Y j , t , u = Φ j , t , u diag ( f 1 E j , t ) B at the end of the single pass. The same linearity permits additions and subtractions during decoding: changing a row by a b T ab^{\mathsf{T}} a b T changes its sketch by a ( Φ e i ) b T a(\Phi e_i)b^{\mathsf{T}} a ( Φ e i ) b T .
We prove by induction over the decoding calls that each returned matrix W j W_j W j satisfies ( 1 − ε ) M j ⪯ W j + λ j I ⪯ ( 1 + ε ) M j (1-\varepsilon)M_j\preceq W_j+\lambda_jI\preceq(1+\varepsilon)M_j ( 1 − ε ) M j ⪯ W j + λ j I ⪯ ( 1 + ε ) M j , where M j = G + λ j I M_j=G+\lambda_jI M j = G + λ j I . This induction follows the sequence of regularizers of Miller and Peng [62 Section 4] , as presented by KLMMS [48 Theorem 2 and Section 4] . For the first call, the row-norm and frequency bounds give G ⪯ tr ( G ) I ⪯ b 0 m μ 2 I ⪯ λ 0 I G\preceq\operatorname{tr}(G)I\preceq b_0m\mu^2I\preceq\lambda_0I G ⪯ tr ( G ) I ⪯ b 0 m μ 2 I ⪯ λ 0 I , and hence H 0 = λ 0 I ⪯ M 0 ⪯ 2 H 0 H_0=\lambda_0I\preceq M_0\preceq2H_0 H 0 = λ 0 I ⪯ M 0 ⪯ 2 H 0 .
For a later call, suppose by induction that the previous calls returned the required approximations. We set H j = W j − 1 + λ j I H_j=W_{j-1}+\lambda_jI H j = W j − 1 + λ j I . Since λ j − 1 = 2 λ j \lambda_{j-1}=2\lambda_j λ j − 1 = 2 λ j , we have M j ⪯ M j − 1 ⪯ 2 M j M_j\preceq M_{j-1}\preceq2M_j M j ⪯ M j − 1 ⪯ 2 M j . The new matrix has exactly the previous approximation error, since H j − M j = ( W j − 1 + λ j − 1 I ) − M j − 1 H_j-M_j=(W_{j-1}+\lambda_{j-1}I)-M_{j-1} H j − M j = ( W j − 1 + λ j − 1 I ) − M j − 1 . By the induction hypothesis, this error lies between − ε M j − 1 -\varepsilon M_{j-1} − ε M j − 1 and ε M j − 1 \varepsilon M_{j-1} ε M j − 1 , and therefore between − 2 ε M j -2\varepsilon M_j − 2 ε M j and 2 ε M j 2\varepsilon M_j 2 ε M j . Thus ( 1 − 2 ε ) M j ⪯ H j ⪯ ( 1 + 2 ε ) M j (1-2\varepsilon)M_j\preceq H_j\preceq(1+2\varepsilon)M_j ( 1 − 2 ε ) M j ⪯ H j ⪯ ( 1 + 2 ε ) M j . As ε ≤ 1 / 8 \varepsilon\le1/8 ε ≤ 1/8 , these inequalities imply 1 2 H j ⪯ M j ⪯ 2 H j \frac{1}{2}H_j\preceq M_j\preceq2H_j 2 1 H j ⪯ M j ⪯ 2 H j .
The decoder is therefore given a constant-factor approximation at every call. With probability at least 1 − δ / K 1-\delta/K 1 − δ / K , it returns at most M max M_{\max} M m a x active rows with positive weights whose sum W j W_j W j satisfies ( 1 − ε ) M j ⪯ W j + λ j I ⪯ ( 1 + ε ) M j (1-\varepsilon)M_j\preceq W_j+\lambda_jI\preceq(1+\varepsilon)M_j ( 1 − ε ) M j ⪯ W j + λ j I ⪯ ( 1 + ε ) M j . This is proved in Lemma A.3 , which also guarantees that the returned multipliers lie in ( 0 , W max ] (0,W_{\max}] ( 0 , W m a x ] and are multiples of g a g_a g a . Thus the initial empty list and every successful output meet the representation requirements for the next call. Moreover, H j H_j H j depends only on earlier calls, independently of this call’s masks and sketch seeds. Thus the same success probability holds after fixing any earlier successful outputs. Summing the probabilities that each call is the first to fail gives total failure probability at most K ( δ / K ) = δ K(\delta/K)=\delta K ( δ / K ) = δ .
The last regularizer is λ K − 1 = λ \lambda_{K-1}=\lambda λ K − 1 = λ , so the last output satisfies the claimed matrix inequality and contains only active rows. The parameter choices give M max = O b 0 ( D ε − 2 polylog Q ) M_{\max}=O_{b_0}(D\varepsilon^{-2}\operatorname{polylog}Q) M m a x = O b 0 ( D ε − 2 polylog Q ) . Finally, all the sketches, seeds, row lists, and working vectors fit within O s 0 , b 0 ( D ε − 4 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-4}\operatorname{polylog}Q) O s 0 , b 0 ( D ε − 4 polylog Q ) bits on every random outcome, and each update and the computation after the stream take the stated polynomial time, as proved in Lemma A.4 . ∎
Sketching
We prove Lemma A.1 by combining the standard coordinate and norm estimates from CountSketch and AMS [22 , 8 ] . We state these guarantees without proof, then allocate their failure probabilities so that all estimates in one scan are accurate together.
Claim A.5 ([22 ] ). For any fixed y ∈ R m y \in\mathbb{R}^{m} y ∈ R m , coordinate i i i , 0 < α < 1 0 < \alpha< 1 0 < α < 1 , and 0 < β < 1 / 2 0 < \beta< 1/2 0 < β < 1/2 , a CountSketch with O ( α − 2 log ( 1 / β ) ) O(\alpha^{-2}\log(1/\beta)) O ( α − 2 log ( 1/ β )) entries returns an estimate satisfying Pr [ ∣ y ^ i − y i ∣ > α ∥ y ∥ 2 ] ≤ β \Pr[|\hat{y}_{i}-y_{i}| > \alpha\lVert y\rVert_{2}] \le\beta Pr [ ∣ y ^ i − y i ∣ > α ∥ y ∥ 2 ] ≤ β .
Claim A.6 ([8 ] ). For any fixed y ∈ R m y \in\mathbb{R}^{m} y ∈ R m and 0 < β < 1 / 2 0 < \beta< 1/2 0 < β < 1/2 , an AMS sketch with O ( log ( 1 / β ) ) O(\log(1/\beta)) O ( log ( 1/ β )) entries returns ν ^ \hat{\nu} ν ^ satisfying Pr [ ν ^ ∉ [ 0.9 ∥ y ∥ 2 2 , 1.1 ∥ y ∥ 2 2 ] ≤ β \Pr[\hat{\nu} \notin[0.9\lVert y\rVert_{2}^{2},1.1\lVert y\rVert_{2}^{2}] \le\beta Pr [ ν ^ ∈ / [ 0.9 ∥ y ∥ 2 2 , 1.1 ∥ y ∥ 2 2 ] ≤ β .
Proof of Lemma A.1 . The budget β s = δ / ( 8 K T ( T + 1 ) ) \beta_s = \delta/(8KT(T+1)) β s = δ / ( 8 K T ( T + 1 )) covers a whole scan. We allocate failure probability β s / ( 2 m ) \beta_s/(2m) β s / ( 2 m ) to each of its at most m m m coordinate estimates and m m m norm estimates. For a fixed query vector v i v_i v i , multiplying the stored matrix by v i v_i v i gives ( Φ A ) v i = Φ ( A v i ) (\Phi A)v_i = \Phi(Av_i) ( Φ A ) v i = Φ ( A v i ) . CountSketch estimates its i i i th coordinate with error at most ( ϵ a η / 100 ) ∥ A v i ∥ 2 (\epsilon_a\sqrt{\eta}/100)\lVert Av_i\rVert_2 ( ϵ a η /100 ) ∥ A v i ∥ 2 , with probability at least 1 − β s / ( 2 m ) 1-\beta_s/(2m) 1 − β s / ( 2 m ) , by Claim A.5 . The AMS estimate lies between 0.9 ∥ A v i ∥ 2 2 0.9\lVert Av_i\rVert_2^2 0.9 ∥ A v i ∥ 2 2 and 1.1 ∥ A v i ∥ 2 2 1.1\lVert Av_i\rVert_2^2 1.1 ∥ A v i ∥ 2 2 with the same success probability, by Claim A.6 . The independence assumed in the lemma permits both estimates for each of the fixed vectors. A union bound over at most m m m coordinate estimates and m m m norm estimates gives simultaneous success with probability at least 1 − β s 1-\beta_s 1 − β s , proving Equation (A.2).
Decoding
We prove Lemma A.3 . We fix one call, with regularizer ℓ \ell ℓ and matrix H H H , and put M ℓ = G + ℓ I M_{\ell}=G+\ell I M ℓ = G + ℓ I . We adapt CKL’s proof of squared-weight recovery [27 Lemmas 6.5–6.6 and 6.19] . The argument below uses the general rows of B B B , the fixed identity term, and the computed vectors v i v_i v i .
The target M ℓ M_{\ell} M ℓ and its coarse approximation H H H remain fixed throughout this call. To analyze the changing row multipliers, we consider two further matrices. The matrix J t J_t J t follows the decoder’s actual selection and sampling decisions with exact multipliers. The matrix M z M_z M z describes the multipliers actually represented by a working sketch, including unfinished corrections and estimation errors. Comparing J t J_t J t with M ℓ M_{\ell} M ℓ will bound the sampling error; comparing M z M_z M z with H H H will justify the row tests. Both matrices include the fixed regularizer ℓ I \ell I ℓ I .
We first define J t J_t J t and state the induction used to control it.
Let F t F_t F t be the saved set before level t t t . For a row selected at level c i c_i c i , let a i = 2 c i f i a_i=2^{c_i}f_i a i = 2 c i f i . We set a i ( t ) = a i a_i^{(t)}=a_i a i ( t ) = a i for i ∈ F t i\in F_t i ∈ F t , a i ( t ) = 2 t f i a_i^{(t)}=2^t f_i a i ( t ) = 2 t f i for i ∈ E t ∖ F t i\in E_t\setminus F_t i ∈ E t ∖ F t , and a i ( t ) = 0 a_i^{(t)}=0 a i ( t ) = 0 otherwise, and define J t = ℓ I + ∑ i ( a i ( t ) ) 2 b i b i T J_t=\ell I+\sum_i(a_i^{(t)})^2b_i b_i^{\mathsf T} J t = ℓ I + ∑ i ( a i ( t ) ) 2 b i b i T . Thus saved rows keep their exact selection multipliers, and unsaved sampled rows have their current multipliers. Saving a row fixes its multiplier at its current value, so only sampling changes this exact matrix. Let q i ∗ = b i T H − 1 b i q_i^*=b_i^{\mathsf T}H^{-1}b_i q i ∗ = b i T H − 1 b i be the leverage of row b i b_i b i relative to H H H .
We prove by induction on t t t that the following three properties hold whenever the estimates used so far satisfy Equation (A.2) and the previous sampling steps satisfy Claim A.9 :
(i) − t ϵ s H ⪯ J t − M ℓ ⪯ t ϵ s H -t\epsilon_sH \preceq J_t-M_{\ell}\preceq t\epsilon_sH − t ϵ s H ⪯ J t − M ℓ ⪯ t ϵ s H ;
(ii) ( a i ( t ) ) 2 q i ∗ ≥ θ / 4 (a_i^{(t)})^2q_i^*\ge\theta/4 ( a i ( t ) ) 2 q i ∗ ≥ θ /4 for every i ∈ F t i\in F_t i ∈ F t ;
(iii) ∣ a ^ i − a i ∣ ≤ ϵ a a i |\hat{a}_i-a_i|\le\epsilon_a a_i ∣ a ^ i − a i ∣ ≤ ϵ a a i for every i ∈ F t i\in F_t i ∈ F t .
At level zero, J 0 = M ℓ J_0=M_{\ell} J 0 = M ℓ and F 0 = ∅ F_0=\varnothing F 0 = ∅ . For the induction step, we assume the three properties at the beginning of level t t t . We first prove that the corrections finish and selection preserves the last two properties. We then bound the change from the next sample, which proves the first property at level t + 1 t+1 t + 1 .
We next define the quantities needed to analyze a row test. For a working sketch representing diag ( z ) B \operatorname{diag}(z)B diag ( z ) B , let z i z_i z i be its multiplier for row i i i and define M z = ℓ I + ∑ i z i 2 b i b i T M_z = \ell I + \sum_i z_i^2 b_i b_i^{\mathsf{T}} M z = ℓ I + ∑ i z i 2 b i b i T . Its query vector is y ( i ) = diag ( z ) B v i y^{(i)} = \operatorname{diag}(z)Bv_i y ( i ) = diag ( z ) B v i , whose i i i th coordinate is z i q i z_iq_i z i q i , where q i = b i T v i q_i = b_i^{\mathsf{T}}v_i q i = b i T v i . Define R i = ( z i q i ) 2 / ( v i T M z v i ) R_i = (z_iq_i)^2/(v_i^{\mathsf{T}}M_zv_i) R i = ( z i q i ) 2 / ( v i T M z v i ) , the fraction of the query energy, including the identity term, contributed by that coordinate. The quantities J t J_t J t , z z z , M z M_z M z , and q i ∗ q_i^* q i ∗ are used only for the proof and are not stored.
We use the following four claims. We state them together, finish the proof of the lemma, and then prove each claim.
Claim A.7. For every nonzero row, q i > 0 q_i > 0 q i > 0 and 0.96 q i ∗ ≤ q i 2 / ( v i T H v i ) ≤ q i ∗ 0.96q_i^* \le q_i^2/(v_i^{\mathsf{T}}Hv_i) \le q_i^* 0.96 q i ∗ ≤ q i 2 / ( v i T H v i ) ≤ q i ∗ . Fix z ≥ 0 z \ge0 z ≥ 0 and suppose that the estimates in a scan satisfy Equation (A.2). At threshold ϑ ∈ { η , θ } \vartheta\in\{\eta,\theta\} ϑ ∈ { η , θ } , every row with R i ≥ 4 ϑ R_i \ge4\vartheta R i ≥ 4 ϑ passes the acceptance tests, and every row passing them has R i ≥ ϑ R_i \ge\vartheta R i ≥ ϑ and z i > 0 z_i > 0 z i > 0 . If z i ≥ 0.99 z_i \ge0.99 z i ≥ 0.99 , its rounded estimate satisfies ∣ z i ^ − z i ∣ ≤ ε a z i |\widehat{z_i} - z_i| \le\varepsilon_a z_i ∣ z i − z i ∣ ≤ ε a z i and is positive.
Claim A.8. Fix 0 ≤ t < T 0 \le t < T 0 ≤ t < T . Suppose the three inductive properties hold at the beginning of level t t t and all its estimates satisfy Equation (A.2). Then all corrections finish within T T T scans. Every row saved after selection is active and satisfies a i 2 q i ∗ ≥ θ / 4 a_i^2q_i^* \ge\theta/4 a i 2 q i ∗ ≥ θ /4 and ∣ a i ^ − a i ∣ ≤ ε a a i |\widehat{a_i} - a_i| \le\varepsilon_a a_i ∣ a i − a i ∣ ≤ ε a a i . There are at most 12 D / θ 12D/\theta 12 D / θ saved rows, and every remaining row satisfies ( a i ( t ) ) 2 q i ∗ < 16 θ (a_i^{(t)})^2q_i^* < 16\theta ( a i ( t ) ) 2 q i ∗ < 16 θ .
Claim A.9. Fix the random choices used through the correction and selection at level t t t , and suppose the hypotheses and conclusions of Claim A.8 hold. With probability at least 1 − β c 1-\beta_c 1 − β c over the next sampling mask,
− ε s H ⪯ J t + 1 − J t ⪯ ε s H . (20) -\varepsilon_sH \preceq J_{t+1}-J_t \preceq\varepsilon_sH. \tag*{(20)} − ε s H ⪯ J t + 1 − J t ⪯ ε s H . (20)
Claim A.11. With probability at least 1 − δ / K 1-\delta/K 1 − δ / K , every scan satisfies Equation (A.2), every sampling step satisfies Equation (A.10), and E T = ∅ E_T = \varnothing E T = ∅ .
Proof of Lemma A.3 . With probability at least 1 − δ / K 1-\delta/K 1 − δ / K , every coordinate and norm estimate has the stated accuracy, every sampling step changes J t J_t J t by at most ε s H \varepsilon_sH ε s H in either matrix direction, and E T E_T E T is empty. This joint probability is proved in Claim A.11 . We fix choices for which these conclusions hold and verify the decoder’s output.
We prove the three properties above by induction on the sampling level. Initially, F 0 = ∅ F_0 = \varnothing F 0 = ∅ and J 0 = M ℓ J_0 = M_\ell J 0 = M ℓ , so all three hold. Suppose they hold at level t t t . The corrections finish within T T T scans. Each newly saved row has f i > 0 f_i > 0 f i > 0 , a i 2 q i ∗ ≥ θ / 4 a_i^2q_i^* \ge\theta/4 a i 2 q i ∗ ≥ θ /4 , and ∣ a i ^ − a i ∣ ≤ ε a a i |\widehat{a_i} - a_i| \le\varepsilon_a a_i ∣ a i − a i ∣ ≤ ε a a i , and the saved list has at most 12 D / θ 12D/\theta 12 D / θ rows; these are the conclusions of Claim A.8 . The previously saved multipliers and estimates remain unchanged. Saving a row also leaves J t J_t J t unchanged, because its multiplier is fixed at its current value. The next sampling step contributes at most ε s H \varepsilon_sH ε s H to the error in either direction. Adding this to the previous bound t ε s H t\varepsilon_sH t ε s H proves the first property at level t + 1 t+1 t + 1 , and the saved-row guarantees prove the other two.
After T T T levels, we have − T ε s H ⪯ J T − M ℓ ⪯ T ε s H -T\varepsilon_sH \preceq J_T-M_\ell\preceq T\varepsilon_sH − T ε s H ⪯ J T − M ℓ ⪯ T ε s H . Since H ⪯ 2 M ℓ H \preceq2M_\ell H ⪯ 2 M ℓ and T ε s = ε / 64 T\varepsilon_s = \varepsilon/64 T ε s = ε /64 , this gives ( 1 − ε / 32 ) M ℓ ⪯ J T ⪯ ( 1 + ε / 32 ) M ℓ (1-\varepsilon/32)M_\ell\preceq J_T \preceq(1+\varepsilon/32)M_\ell ( 1 − ε /32 ) M ℓ ⪯ J T ⪯ ( 1 + ε /32 ) M ℓ . The final sample is empty, so J T J_T J T consists exactly of the saved rows with their exact squared multipliers, together with ℓ I \ell I ℓ I . Replacing each multiplier by its saved estimate gives
( 1 − ε a ) 2 J T ⪯ W + ℓ I ⪯ ( 1 + ε a ) 2 J T . (1-\varepsilon_a)^2J_T \preceq W+\ell I \preceq(1+\varepsilon_a)^2J_T. ( 1 − ε a ) 2 J T ⪯ W + ℓ I ⪯ ( 1 + ε a ) 2 J T .
Combining these inequalities and ε a ≤ ε / 1000 \varepsilon_a \le\varepsilon/1000 ε a ≤ ε /1000 yields ( 1 − ε ) M ℓ ⪯ W + ℓ I ⪯ ( 1 + ε ) M ℓ (1-\varepsilon)M_\ell\preceq W+\ell I \preceq(1+\varepsilon)M_\ell ( 1 − ε ) M ℓ ⪯ W + ℓ I ⪯ ( 1 + ε ) M ℓ .
Every saved row is active, and the list has at most M max M_{\max} M m a x rows. Each saved multiplier is rounded to a multiple of g a g_a g a and checked to lie in ( 0 , W max ] (0,W_{\max}] ( 0 , W m a x ] by Algorithm 6; its square is the output weight. Under the same estimate and sampling bounds, the numerical and list limits cannot interrupt the computation; Claim A.24, proved in Section A.2.3, verifies these limits from the bounds within each level. Thus the decoder returns both the required approximation and the stated multiplier representation with probability at least 1 − δ / K 1-\delta/K 1 − δ / K .
Computing and testing a row We first justify the guarantees for a single row test in Claim A.7 . These guarantees will let us analyze both correction and selection. We bound the error of the rounded iteration, then compare the coordinate and norm estimates as in CKL [27 Lemma 6.6] . For a vector v v v , define ∥ v ∥ H = ( v T H v ) 1 / 2 \|v\|_{H} = (v^{\mathsf{T}}Hv)^{1/2} ∥ v ∥ H = ( v T H v ) 1/2 .
Although H H H is available as a weighted row list, forming its inverse could require too much space. Algorithm 7 instead approximates H − 1 b i H^{-1}b_i H − 1 b i using repeated products with H H H . The first claim shows that this approximation is accurate enough for the row test. Without rounding, each iteration shrinks the error. Rounding introduces a small new error, but subsequent iterations shrink that error as well. We bound these two contributions and then use the fact that b i b_i b i is a nonzero integer row to turn the resulting absolute error into a relative bound.
Claim A.12. For every H H H satisfying the representation assumptions of Lemma A.3 , λ I ⪯ H ⪯ U I \lambda I \preceq H \preceq UI λ I ⪯ H ⪯ U I . For every nonzero row b i b_i b i , Algorithm 7 returns v i v_i v i satisfying ∥ v i − H − 1 b i ∥ H ≤ ε v ∥ H − 1 b i ∥ H \|v_i - H^{-1}b_i\|_{H} \le\varepsilon_v\|H^{-1}b_i\|_{H} ∥ v i − H − 1 b i ∥ H ≤ ε v ∥ H − 1 b i ∥ H , where ε v = 1 / 100 \varepsilon_v = 1/100 ε v = 1/100 .
Proof. First, the stored representation gives the required eigenvalue bounds. Its identity term satisfies λ ≤ ℓ ≤ λ 0 \lambda\le\ell\le\lambda_0 λ ≤ ℓ ≤ λ 0 , and it contains at most M max M_{\max} M m a x rows, each with squared norm at most b 0 b_0 b 0 and multiplier at most W max W_{\max} W m a x . Consequently, λ I ⪯ H ⪯ ( λ 0 + b 0 M max W max 2 ) I ⪯ U I \lambda I \preceq H \preceq(\lambda_0 + b_0M_{\max}W_{\max}^2)I \preceq UI λ I ⪯ H ⪯ ( λ 0 + b 0 M m a x W m a x 2 ) I ⪯ U I .
Let v ∗ = H − 1 b i v_* = H^{-1}b_i v ∗ = H − 1 b i be the exact solution. An unrounded update sends the error v − v ∗ v-v_* v − v ∗ to ( I − H / U ) ( v − v ∗ ) (I-H/U)(v-v_*) ( I − H / U ) ( v − v ∗ ) , since H v ∗ = b i Hv_* = b_i H v ∗ = b i . Every eigenvalue of I − H / U I-H/U I − H / U lies in [ 0 , 1 − λ / U ] [0,1-\lambda/U] [ 0 , 1 − λ / U ] , so the Euclidean error shrinks by a factor of at most 1 − λ / U 1-\lambda/U 1 − λ / U . Rounding each coordinate to a multiple of g v g_v g v then adds a vector of Euclidean norm at most g v D g_v\sqrt{D} g v D . After the prescribed r i n v r_{\mathrm{inv}} r inv iterations, we therefore have
∥ v i − v ∗ ∥ 2 ≤ ( 1 − λ U ) r i n v ∥ v ∗ ∥ 2 + g v D ∑ r = 0 r i n v − 1 ( 1 − λ U ) r . \|v_i-v_*\|_2 \le\left(1-\frac{\lambda}{U}\right)^{r_{\mathrm{inv}}}\|v_*\|_2+g_v\sqrt{D}\sum_{r=0}^{r_{\mathrm{inv}}-1}\left(1-\frac{\lambda}{U}\right)^r. ∥ v i − v ∗ ∥ 2 ≤ ( 1 − U λ ) r inv ∥ v ∗ ∥ 2 + g v D r = 0 ∑ r inv − 1 ( 1 − U λ ) r .
The first term is the error remaining from the initial vector v = 0 v=0 v = 0 . We have ∥ v ∗ ∥ 2 ≤ b 0 / λ \|v_*\|_2 \le\sqrt{b_0}/\lambda ∥ v ∗ ∥ 2 ≤ b 0 / λ , and the choice of r i n v r_{\mathrm{inv}} r inv makes this term at most ε v / ( 8 U ) \varepsilon_v/(8U) ε v / ( 8 U ) , using ( 1 − λ / U ) r ≤ exp ( − r λ / U ) (1-\lambda/U)^r \le\exp(-r\lambda/U) ( 1 − λ / U ) r ≤ exp ( − r λ / U ) . If U = λ U=\lambda U = λ , it vanishes after one iteration. The second term sums the rounding errors after their subsequent contractions. The geometric sum is at most U / λ U/\lambda U / λ , and our choice g v ≤ ε v λ / ( 8 U 2 D ) g_v \le\varepsilon_v\lambda/(8U^2D) g v ≤ ε v λ / ( 8 U 2 D ) makes this term at most ε v / ( 8 U ) \varepsilon_v/(8U) ε v / ( 8 U ) . Thus ∥ v i − v ∗ ∥ 2 ≤ ε v / ( 4 U ) \|v_i-v_*\|_2 \le\varepsilon_v/(4U) ∥ v i − v ∗ ∥ 2 ≤ ε v / ( 4 U ) .
It remains to express this error relative to the size of the exact solution in the H H H -norm. Since H ⪯ U I H \preceq UI H ⪯ U I , the absolute H H H -norm error is at most U ∥ v i − v ∗ ∥ 2 ≤ ε v / ( 4 U ) \sqrt{U}\|v_i-v_*\|_2 \le\varepsilon_v/(4\sqrt{U}) U ∥ v i − v ∗ ∥ 2 ≤ ε v / ( 4 U ) . On the other hand, ∥ v ∗ ∥ H 2 = b i T H − 1 b i ≥ ∥ b i ∥ 2 2 / U ≥ 1 / U \|v_*\|_H^2 = b_i^{\mathsf{T}}H^{-1}b_i \ge\|b_i\|_2^2/U \ge1/U ∥ v ∗ ∥ H 2 = b i T H − 1 b i ≥ ∥ b i ∥ 2 2 / U ≥ 1/ U . The last inequality is where we use that b i b_i b i is a nonzero integer row. Comparing these bounds gives ∥ v i − v ∗ ∥ H ≤ ε v ∥ v ∗ ∥ H \|v_i-v_*\|_H \le\varepsilon_v\|v_*\|_H ∥ v i − v ∗ ∥ H ≤ ε v ∥ v ∗ ∥ H , as required. □
The row test uses the scalar q i = b i T v i q_i = b_i^{\mathsf{T}}v_i q i = b i T v i and the energy v i T H v i v_i^{\mathsf{T}}Hv_i v i T H v i . The next claim translates the vector approximation into the ratio bound needed for that test.
Claim A.13. If ∥ v i − H − 1 b i ∥ H ≤ ε v ∥ H − 1 b i ∥ H \|v_i-H^{-1}b_i\|_H \le\varepsilon_v\|H^{-1}b_i\|_H ∥ v i − H − 1 b i ∥ H ≤ ε v ∥ H − 1 b i ∥ H with ε v = 1 / 100 \varepsilon_v=1/100 ε v = 1/100 , then q i > 0 q_i>0 q i > 0 and 0.96 q i ∗ ≤ q i 2 / ( v i T H v i ) ≤ q i ∗ 0.96q_i^* \le q_i^2/(v_i^{\mathsf{T}}Hv_i) \le q_i^* 0.96 q i ∗ ≤ q i 2 / ( v i T H v i ) ≤ q i ∗ .
Proof. By Cauchy–Schwarz in the H H H inner product, ∣ q i − q i ∗ ∣ ≤ ε v q i ∗ |q_i-q_i^*|\le\varepsilon_v q_i^* ∣ q i − q i ∗ ∣ ≤ ε v q i ∗ . Also v i T H v i ≤ ( 1 + ε v ) 2 q i ∗ v_i^{\mathsf{T}}Hv_i\le(1+\varepsilon_v)^2q_i^* v i T H v i ≤ ( 1 + ε v ) 2 q i ∗ . These inequalities give positivity and the lower bound, since ( 1 − ε v ) 2 / ( 1 + ε v ) 2 > 0.96 (1-\varepsilon_v)^2/(1+\varepsilon_v)^2>0.96 ( 1 − ε v ) 2 / ( 1 + ε v ) 2 > 0.96 . Cauchy–Schwarz applied to b i T v i b_i^{\mathsf{T}}v_i b i T v i gives the upper bound. □
Claim A.14. Suppose z ≥ 0 z\ge0 z ≥ 0 , q i > 0 q_i>0 q i > 0 , and Equation (A.2) holds. At either threshold ϑ ∈ { η , θ } \vartheta\in\{\eta,\theta\} ϑ ∈ { η , θ } , the acceptance tests pass if R i ≥ 4 ϑ R_i\ge4\vartheta R i ≥ 4 ϑ and fail if R i < ϑ R_i<\vartheta R i < ϑ . For a row passing them with z i ≥ 0.99 z_i\ge0.99 z i ≥ 0.99 , the rounded estimate has relative error at most ε a \varepsilon_a ε a .
Proof. This is the threshold calculation from CKL [27 Lemma 6.6] , with the regularizer added exactly. Let t i 2 = v i T M z v i t_i^2 = v_i^\mathsf{T}M_zv_i t i 2 = v i T M z v i . The norm estimate gives 0.9 t i 2 ≤ t ^ i 2 ≤ 1.1 t i 2 0.9t_i^2 \le\hat{t}_i^2 \le1.1t_i^2 0.9 t i 2 ≤ t ^ i 2 ≤ 1.1 t i 2 , and the coordinate error is at most ( ε a ϑ / 100 ) t i (\varepsilon_a\sqrt{\vartheta}/100)t_i ( ε a ϑ /100 ) t i , since ϑ ≥ η \vartheta\ge\eta ϑ ≥ η .
If R i < ϑ R_i < \vartheta R i < ϑ , then ∣ y ^ i ∣ < ( 1 + ε a / 100 ) ϑ t i < 1.8 ϑ t i |\hat{y}_i| < (1+\varepsilon_a/100)\sqrt{\vartheta}\,t_i < \sqrt{1.8\vartheta}\,t_i ∣ y ^ i ∣ < ( 1 + ε a /100 ) ϑ t i < 1.8 ϑ t i , so the test fails. If R i ≥ 4 ϑ R_i \ge4\vartheta R i ≥ 4 ϑ , the nonnegative multiplier and positive q i q_i q i give y ^ i ≥ ( 2 − ε a / 100 ) ϑ t i > 2.2 ϑ t i > 0 \hat{y}_i \ge(2-\varepsilon_a/100)\sqrt{\vartheta}\,t_i > 2.2\sqrt{\vartheta}\,t_i > 0 y ^ i ≥ ( 2 − ε a /100 ) ϑ t i > 2.2 ϑ t i > 0 , so the test passes.
For a row passing the tests, R i ≥ ϑ R_i \ge\vartheta R i ≥ ϑ . The coordinate error is then at most ( ε a / 100 ) ∣ z i q i ∣ (\varepsilon_a/100)|z_iq_i| ( ε a /100 ) ∣ z i q i ∣ . Dividing by the computed q i q_i q i preserves this relative error. Rounding adds at most g a / 2 ≤ ε a / 200 g_a/2 \le\varepsilon_a/200 g a /2 ≤ ε a /200 , whose relative contribution for z i ≥ 0.99 z_i \ge0.99 z i ≥ 0.99 is at most ε a / 198 \varepsilon_a/198 ε a /198 . The sum is smaller than ε a \varepsilon_a ε a .
Proof of Claim A.7 . The computed vector has relative H H H -norm error at most ε v \varepsilon_v ε v by Claim A.12 . Applying Claim A.13 therefore gives q i > 0 q_i > 0 q i > 0 and 0.96 q i 2 / ( v i T H v i ) ≤ q i ∗ 0.96q_i^2/(v_i^\mathsf{T}Hv_i) \le q_i^* 0.96 q i 2 / ( v i T H v i ) ≤ q i ∗ .
With this positive q i q_i q i and the assumed sketch estimates, Claim A.14 shows that every row with R i ≥ 4 ϑ R_i \ge4\vartheta R i ≥ 4 ϑ passes and every passing row has R i ≥ ϑ R_i \ge\vartheta R i ≥ ϑ . A passing row therefore has z i > 0 z_i > 0 z i > 0 , since z ≥ 0 z \ge0 z ≥ 0 and its energy fraction is positive. For z i ≥ 0.99 z_i \ge0.99 z i ≥ 0.99 , the same claim gives ∣ z ^ i − z i ∣ ≤ ε a z i |\hat{z}_i-z_i| \le\varepsilon_a z_i ∣ z ^ i − z i ∣ ≤ ε a z i , which also makes the estimate positive because ε a < 1 \varepsilon_a < 1 ε a < 1 .
Correction and selection at one level The row test detects a large fraction R i R_i R i of the energy in a working sketch. For selection, however, we need to detect rows whose exact contribution ( a i ( t ) ) 2 q i ∗ (a_i^{(t)})^2q_i^* ( a i ( t ) ) 2 q i ∗ relative to H H H is large. Unfinished corrections can distort the working matrix and hence the fraction seen by the test. We will show that, once the corrections finish, M z M_z M z is within a constant factor of H H H . For an unsaved row, whose multiplier is still exact, the row-test fraction then approximates ( a i ( t ) ) 2 q i ∗ (a_i^{(t)})^2q_i^* ( a i ( t ) ) 2 q i ∗ within a constant factor. Thus selection saves every row whose contribution is too large for the next sampling step.
To prove Claim A.8 , we therefore first show that the corrections finish, then establish the selection guarantee and bound the saved list. Throughout this argument we assume the three inductive properties at level t t t and the estimates in Equation (A.2) for the scans of that level. The first property, together with t ε s ≤ 1 / 64 t\varepsilon_s \le1/64 t ε s ≤ 1/64 , gives ( 31 / 64 ) H ⪯ J t ⪯ ( 129 / 64 ) H (31/64)H \preceq J_t \preceq(129/64)H ( 31/64 ) H ⪯ J t ⪯ ( 129/64 ) H .
We divide the argument into three claims. The correction argument adapts CKL [27 Claims 6.20–6.21] , and the selection argument adapts their Lemma 6.19(2)–(3).
Claim A.15. Every correction count becomes zero within T T T scans. Every positive multiplier used in those scans is at least 0.99 0.99 0.99 . After the scans, H / 4 ⪯ M z ⪯ 3 H H/4 \preceq M_z \preceq3H H /4 ⪯ M z ⪯ 3 H .
Claim A.16. Every newly selected row i i i has f i > 0 f_i > 0 f i > 0 , a i 2 q i ∗ ≥ ϑ / 4 a_i^2q_i^* \ge\vartheta/4 a i 2 q i ∗ ≥ ϑ /4 , and ∣ a ^ i − a i ∣ ≤ ε a a i |\hat{a}_i-a_i| \le\varepsilon_a a_i ∣ a ^ i − a i ∣ ≤ ε a a i . Every row left unselected has ( a i ( t ) ) 2 q i ∗ < 16 ϑ (a_i^{(t)})^2q_i^* < 16\vartheta ( a i ( t ) ) 2 q i ∗ < 16 ϑ .
Claim A.17. After selection, ∣ F t + 1 ∣ ≤ 12 D / ϑ |F_{t+1}| \le12D/\vartheta ∣ F t + 1 ∣ ≤ 12 D / ϑ .
Proof of Claim A.8 . All correction counts become zero within T T T scans, every positive working multiplier remains at least 0.99 0.99 0.99 , and the resulting matrix satisfies H / 4 ⪯ M z ⪯ 3 H H/4 \preceq M_z \preceq3H H /4 ⪯ M z ⪯ 3 H , by Claim A.15 . The selection scan therefore begins with the required comparison between its working matrix and H H H .
Each newly saved row is active, satisfies a i 2 q i ∗ ≥ ϑ / 4 a_i^2q_i^* \ge\vartheta/4 a i 2 q i ∗ ≥ ϑ /4 , and has a multiplier estimate of relative error at most ε a \varepsilon_a ε a , while every remaining row satisfies ( a i ( t ) ) 2 q i ∗ < 16 ϑ (a_i^{(t)})^2q_i^* < 16\vartheta ( a i ( t ) ) 2 q i ∗ < 16 ϑ , by Claim A.16 . Previously saved rows keep their multipliers and estimates, and H H H is fixed, so their guarantees persist. The entire saved list has at most 12 D / ϑ 12D/\vartheta 12 D / ϑ rows by Claim A.17 .
Recall that d i d_i d i counts the remaining halvings for a saved row; for this calculation, set d i = 0 d_i = 0 d i = 0 for unselected rows. To prove Claim A.15 , we show that the largest positive count decreases in every scan. The first claim bounds the error accumulated during the halvings. The second shows that every row attaining the largest count is detected and has its count decreased.
Claim A.18. At the beginning of each correction scan, its represented multipliers satisfy 0.99 2 d i a i ( t ) ≤ z i ≤ 1.01 2 d i a i ( t ) 0.99\,2^{d_i}a_i^{(t)} \le z_i \le1.01\,2^{d_i}a_i^{(t)} 0.99 2 d i a i ( t ) ≤ z i ≤ 1.01 2 d i a i ( t ) . The same bounds hold for later copies after each correction applied to them, with the updated counts d i d_i d i .
Proof. We adapt the calculation in CKL [27 ] , Claim 6.20. Initially, a selected row in E t E_t E t has exact multiplier 2 d i a i 2^{d_i}a_i 2 d i a i , a selected row outside E t E_t E t has multiplier a i a_i a i , and an unselected row has its ideal multiplier a i ( t ) a_i^{(t)} a i ( t ) .
Suppose the next estimate is z ^ i = z i ( 1 + u i ) \widehat{z}_i = z_i(1+u_i) z i = z i ( 1 + u i ) with ∣ u i ∣ ≤ ε a \lvert u_i\rvert\le\varepsilon_a ∣ u i ∣ ≤ ε a . Subtracting half that estimate changes the multiplier to z i ( 1 − u i ) / 2 z_i(1-u_i)/2 z i ( 1 − u i ) /2 and decreases d i d_i d i by one. Relative to an exact halving, this contributes a factor in [ 1 − ε a , 1 + ε a ] [1-\varepsilon_a,1+\varepsilon_a] [ 1 − ε a , 1 + ε a ] . At most T T T halvings and one saved-estimate error give a factor between ( 1 − ε a ) T + 1 (1-\varepsilon_a)^{T+1} ( 1 − ε a ) T + 1 and ( 1 + ε a ) T + 1 (1+\varepsilon_a)^{T+1} ( 1 + ε a ) T + 1 , and hence in [ 0.99 , 1.01 ] [0.99,1.01] [ 0.99 , 1.01 ] .
This calculation also justifies the estimate used at the next correction. Every positive ideal multiplier is an integer at least one, so the inequalities keep a positive working multiplier at least 0.99 0.99 0.99 . We may therefore apply Claim A.7 at that correction. Induction over the corrections proves the claim, including intermediate modifications of later copies. At each new level we start from the original stored sketches, so these correction errors do not accumulate across levels. □
We next show why a row with the largest remaining correction count is still detectable. Up to the small errors just bounded, such a row has been amplified at least as much as every other row relative to its exact multiplier in J t J_t J t . Its squared contribution and the bound on the total query energy therefore contain the same amplification factor. These factors cancel when we compare the coordinate with the total energy, leaving a score large enough for detection because the row was selected earlier.
Claim A.19. If Δ = max i d i > 0 \Delta= \max_i d_i > 0 Δ = max i d i > 0 at the beginning of a correction scan, every selected row with d i = Δ d_i = \Delta d i = Δ has R i ≥ 4 η R_i \ge4\eta R i ≥ 4 η in that scan.
Proof. We use the cancellation in CKL [27 ] , Claim 6.21. By Claim A.18, M z ⪯ 1.01 2 Δ J t ⪯ 3 ⋅ 4 Δ H M_z \preceq1.01^{2\Delta}J_t \preceq3\cdot4^\Delta H M z ⪯ 1.0 1 2Δ J t ⪯ 3 ⋅ 4 Δ H , including the unchanged identity term. A row with d i = Δ d_i=\Delta d i = Δ has z i 2 ≥ 0.99 2 Δ a i ( t ) 2 z_i^2 \ge0.99^{2\Delta}a_i^{(t)2} z i 2 ≥ 0.9 9 2Δ a i ( t ) 2 . Consequently,
R i ≥ 0.99 2 3 a i 2 q i 2 v i T H v i ≥ 1 4 a i 2 q i ∗ ≥ θ 16 = 64 η > 4 η . R_i \ge\frac{0.99^2}{3}a_i^2\frac{q_i^2}{v_i^{\mathsf{T}}Hv_i} \ge\frac{1}{4}a_i^2q_i^* \ge\frac{\theta}{16}=64\eta>4\eta. R i ≥ 3 0.9 9 2 a i 2 v i T H v i q i 2 ≥ 4 1 a i 2 q i ∗ ≥ 16 θ = 64 η > 4 η .
We used Claim A.13 and the induction hypothesis for saved rows. The queried copy is unchanged during the scan, so this estimate applies to every row with the stated initial count. □
Proof of Claim A.15 . Suppose the largest count at the start of a scan is Δ > 0 \Delta>0 Δ > 0 . Every row with count Δ \Delta Δ has R i ≥ 4 η R_i\ge4\eta R i ≥ 4 η by Claim A.19, so the row test detects it by Claim A.7 . The algorithm subtracts half its estimated multiplier from the later copies and decreases its count by one. All other counts are already at most Δ − 1 \Delta-1 Δ − 1 , and no count increases. Thus the largest count after the scan is at most Δ − 1 \Delta-1 Δ − 1 . Initially all counts are at most t < T t<T t < T , so all become zero within T T T scans.
The multiplier bounds in Claim A.18 keep every positive multiplier at least 0.99 0.99 0.99 throughout these scans. When all counts reach zero, the same bounds give 0.99 2 J t ⪯ M z ⪯ 1.01 2 J t 0.99^2J_t\preceq M_z\preceq1.01^2J_t 0.9 9 2 J t ⪯ M z ⪯ 1.0 1 2 J t . Combining this with ( 31 / 64 ) H ⪯ J t ⪯ ( 129 / 64 ) H (31/64)H\preceq J_t\preceq(129/64)H ( 31/64 ) H ⪯ J t ⪯ ( 129/64 ) H gives H / 4 ⪯ M z ⪯ 3 H H/4\preceq M_z\preceq3H H /4 ⪯ M z ⪯ 3 H , as required. □
Proof of Claim A.16 . Correction leaves the multipliers of unselected rows unchanged, so z i = a i ( t ) z_i=a_i^{(t)} z i = a i ( t ) . The bound H / 4 ⪯ M z ⪯ 3 H H/4\preceq M_z\preceq3H H /4 ⪯ M z ⪯ 3 H from Claim A.15 , together with Claim A.13 , gives $\frac{1}{4}(a_i^{(t)})^2q_i^*\le R_i\le 4 ( a i ( t ) ) 2 q i ∗ 4(a_i^{(t)})^2q_i^* 4 ( a i ( t ) ) 2 q i ∗ . For the lower bound we used 0.96 / 3 > 1 / 4 0.96/3 > 1/4 0.96/3 > 1/4 . This comparison relates the row test to the exact multipliers in the induction.
A row passing the test has R i ≥ θ R_i \ge\theta R i ≥ θ by Claim A.7 , so the upper comparison gives a i 2 q i ∗ ≥ θ / 4 a_i^2q_i^* \ge\theta/4 a i 2 q i ∗ ≥ θ /4 . Its multiplier is 2 t f i > 0 2^t f_i > 0 2 t f i > 0 , so it is active. This multiplier is an integer at least one, and Claim A.7 bounds the estimate’s relative error by ε a \varepsilon_a ε a .
Conversely, an unselected row with ( a i ( t ) ) 2 q i ∗ ≥ 16 θ (a_i^{(t)})^2q_i^* \ge16\theta ( a i ( t ) ) 2 q i ∗ ≥ 16 θ would have R i ≥ 4 θ R_i \ge4\theta R i ≥ 4 θ by the lower comparison and would therefore be selected. This proves the bound for every remaining row.
Proof of Claim A.17 . Every selected row has a i 2 q i ∗ ≥ θ / 4 a_i^2q_i^* \ge\theta/4 a i 2 q i ∗ ≥ θ /4 , by Claim A.16 or the induction hypothesis. All these contributions occur in J t J_t J t . Thus ∣ F t + 1 ∣ θ / 4 ≤ ∑ i ∈ F t + 1 a i 2 q i ∗ ≤ tr ( H − 1 J t ) ≤ 3 D |F_{t+1}|\theta/4 \le\sum_{i\in F_{t+1}} a_i^2q_i^* \le\operatorname{tr}(H^{-1}J_t) \le3D ∣ F t + 1 ∣ θ /4 ≤ ∑ i ∈ F t + 1 a i 2 q i ∗ ≤ tr ( H − 1 J t ) ≤ 3 D . The last inequality follows by conjugating J t ⪯ 3 H J_t \preceq3H J t ⪯ 3 H by H − 1 / 2 H^{-1/2} H − 1/2 and taking traces. Rearranging proves the claim. The same bound holds for the list after any prefix of the selection scan.
The change caused by sampling We have shown that correction finishes, the saved list stays small, and every remaining row has a small contribution. We now bound the change caused by sampling the remaining rows. A remaining row with multiplier a a a survives with probability 1 / 4 1/4 1/4 and has its multiplier doubled if it survives. Its squared contribution is therefore preserved in expectation, since 1 4 ( 2 a ) 2 = a 2 \frac{1}{4}(2a)^2 = a^2 4 1 ( 2 a ) 2 = a 2 . Saved rows and the identity term stay unchanged. Consequently, sampling preserves the entire matrix in expectation. Since selection has removed every individually large contribution from this sample, a concentration bound will show that the actual change is small as well.
To measure that change relative to H H H , set A i = ( a i ( t ) ) 2 H − 1 / 2 b i b i T H − 1 / 2 A_i = (a_i^{(t)})^2H^{-1/2}b_i b_i^{\mathsf T}H^{-1/2} A i = ( a i ( t ) ) 2 H − 1/2 b i b i T H − 1/2 for each row left unselected, where H − 1 / 2 H^{-1/2} H − 1/2 is the inverse of the positive definite square root of H H H . Multiplication on both sides by H − 1 / 2 H^{-1/2} H − 1/2 turns a bound relative to H H H into a bound relative to I I I . In particular, the operator norm of A i A_i A i is exactly ( a i ( t ) ) 2 q i ∗ (a_i^{(t)})^2q_i^* ( a i ( t ) ) 2 q i ∗ , which selection has made small.
The sampling calculation adapts CKL [27 Lemma 6.19(4)] . Our masks have h h h -wise independent entries so that we can store them with short seeds. To justify this amount of independence, we bound an even h h h -th trace moment of the sampling error. Its expansion contains products involving at most h h h distinct indicators, so its expectation is the same as for fully independent sampling. We obtain the latter bound from Tropp’s matrix Bernstein inequality [77 Theorem 6.1(ii)] . We state the resulting concentration bound next, apply it to prove Claim A.9 , and then give its proof.
Claim A.20. Let A i ⪰ 0 A_i \succeq0 A i ⪰ 0 , ∑ i A i ⪯ 3 I \sum_i A_i \preceq3I ∑ i A i ⪯ 3 I , and ∥ A i ∥ o p ≤ τ \lVert A_i\rVert_{\mathrm{op}} \le\tau ∥ A i ∥ op ≤ τ . Suppose the indicators ξ i \xi_i ξ i are h h h -wise independent with mean 1 / 4 1/4 1/4 , where h h h is even and h ≥ ln ( 4 D 2 / β ) h \ge\ln(4D^2/\beta) h ≥ ln ( 4 D 2 / β ) . If 0 < ε s ≤ 1 0 < \varepsilon_s \le1 0 < ε s ≤ 1 and τ ≤ ε s 2 / ( 1000 h ) \tau\le\varepsilon_s^2/(1000h) τ ≤ ε s 2 / ( 1000 h ) , then Pr [ ∥ ∑ i ( 4 ξ i − 1 ) A i ∥ o p > ε s ] ≤ β \Pr[\lVert\sum_i(4\xi_i-1)A_i\rVert_{\mathrm{op}} > \varepsilon_s] \le\beta Pr [∥ ∑ i ( 4 ξ i − 1 ) A i ∥ op > ε s ] ≤ β .
Proof of Claim A.9 . Fix the choices made through correction and selection. For every row left unselected, A i ⪰ 0 A_i \succeq0 A i ⪰ 0 and ∥ A i ∥ o p = ( a i ( t ) ) 2 q i ∗ < 16 θ \lVert A_i\rVert_{\mathrm{op}} = (a_i^{(t)})^2q_i^* < 16\theta ∥ A i ∥ op = ( a i ( t ) ) 2 q i ∗ < 16 θ by Claim A.16 . Their sum is bounded by H − 1 / 2 J t H − 1 / 2 ⪯ 3 I H^{-1/2}J_tH^{-1/2} \preceq3I H − 1/2 J t H − 1/2 ⪯ 3 I , so these matrices meet the size bounds in Claim A.20.
The queries so far use only the masks defining E t E_t E t and sketches at that level or earlier. They do not use the next mask ξ t \xi_t ξ t , whose seed is independent. A remaining row disappears if ξ t ( i ) = 0 \xi_t(i)=0 ξ t ( i ) = 0 and has its multiplier doubled otherwise, so its squared contribution is multiplied by 4 ξ t ( i ) 4\xi_t(i) 4 ξ t ( i ) . Saved rows and ℓ I \ell I ℓ I stay unchanged. Hence H − 1 / 2 ( J t + 1 − J t ) H − 1 / 2 = ∑ i ( 4 ξ t ( i ) − 1 ) A i H^{-1/2}(J_{t+1}-J_t)H^{-1/2} = \sum_i(4\xi_t(i)-1)A_i H − 1/2 ( J t + 1 − J t ) H − 1/2 = ∑ i ( 4 ξ t ( i ) − 1 ) A i .
We can now apply Claim A.20 with τ = 16 θ \tau= 16\theta τ = 16 θ and β = β c \beta= \beta_c β = β c , since the parameter choices give 16 θ = ε s 2 / ( 1000 h ) 16\theta= \varepsilon_s^2/(1000h) 16 θ = ε s 2 / ( 1000 h ) and the required independence. With probability at least 1 − β c 1-\beta_c 1 − β c , the sum has operator norm at most ε s \varepsilon_s ε s and hence lies between − ε s I -\varepsilon_s I − ε s I and ε s I \varepsilon_s I ε s I . Multiplying on both sides by H 1 / 2 H^{1/2} H 1/2 gives the required bound − ε s H ⪯ J t + 1 − J t ⪯ ε s H -\varepsilon_s H \preceq J_{t+1}-J_t \preceq\varepsilon_s H − ε s H ⪯ J t + 1 − J t ⪯ ε s H .
To prove Claim A.20, let Y = ∑ i ( 4 ξ i − 1 ) A i Y = \sum_i(4\xi_i - 1)A_i Y = ∑ i ( 4 ξ i − 1 ) A i . We first bound an even trace moment for independent indicators and then retain that bound under h h h -wise independence.
Claim A.21. For fully independent indicators, E tr ( Y h ) ≤ 4 D 2 max { 18 h τ , 4 h τ } h \mathbb{E}\operatorname{tr}(Y^h) \le4D^2\max\{\sqrt{18h\tau},4h\tau\}^h E tr ( Y h ) ≤ 4 D 2 max { 18 h τ , 4 h τ } h .
Proof. The centered summands X i = ( 4 ξ i − 1 ) A i X_i=(4\xi_i-1)A_i X i = ( 4 ξ i − 1 ) A i have norm at most R 0 = 3 τ R_0=3\tau R 0 = 3 τ . Also E X i 2 = 3 A i 2 \mathbb{E}X_i^2=3A_i^2 E X i 2 = 3 A i 2 , so their variance satisfies σ 2 = ∥ ∑ i E X i 2 ∥ o p ≤ 9 τ \sigma^2=\left\|\sum_i\mathbb{E}X_i^2\right\|_{\mathrm{op}}\le9\tau σ 2 = ∑ i E X i 2 op ≤ 9 τ . Applying matrix Bernstein [77 Theorem 6.1(ii)] to Y Y Y and − Y -Y − Y gives
Pr ( ∥ Y ∥ o p ≥ u ) ≤ 2 D ( exp ( − u 2 4 σ 2 ) + exp ( − 3 u 4 R 0 ) ) . \Pr(\|Y\|_{\mathrm{op}}\ge u)\le2D\left(\exp\left(-\frac{u^2}{4\sigma^2}\right)+\exp\left(-\frac{3u}{4R_0}\right)\right). Pr ( ∥ Y ∥ op ≥ u ) ≤ 2 D ( exp ( − 4 σ 2 u 2 ) + exp ( − 4 R 0 3 u ) ) .
We integrate against h u h − 1 hu^{h-1} h u h − 1 . The first integral is ( 2 σ ) h Γ ( h / 2 + 1 ) ≤ ( 2 h σ ) h (2\sigma)^h\Gamma(h/2+1)\le(\sqrt{2h}\,\sigma)^h ( 2 σ ) h Γ ( h /2 + 1 ) ≤ ( 2 h σ ) h , and the second is ( 4 R 0 / 3 ) h h ! ≤ ( 4 R 0 h / 3 ) h (4R_0/3)^h h!\le(4R_0h/3)^h ( 4 R 0 /3 ) h h ! ≤ ( 4 R 0 h /3 ) h . Using tr ( Y h ) ≤ D ∥ Y ∥ o p h \operatorname{tr}(Y^h)\le D\|Y\|_{\mathrm{op}}^h tr ( Y h ) ≤ D ∥ Y ∥ op h and the bounds on σ 2 \sigma^2 σ 2 , R 0 R_0 R 0 proves the claim. If the variance is zero, the conclusion is immediate. □ \square □
Proof of Claim A.20. For fully independent indicators, Claim A.21 gives E tr ( Y h ) ≤ 4 D 2 max { 18 h τ , 4 h τ } h \mathbb{E}\operatorname{tr}(Y^h)\le4D^2\max\{\sqrt{18h\tau},4h\tau\}^h E tr ( Y h ) ≤ 4 D 2 max { 18 h τ , 4 h τ } h . This bound also holds under h h h -wise independence: expanding tr ( Y h ) \operatorname{tr}(Y^h) tr ( Y h ) as a polynomial in the indicators and replacing ξ i h \xi_i^h ξ i h by ξ i \xi_i ξ i leaves monomials with at most h h h distinct indicators. Each has the same expectation as in the fully independent case. The matrices A i A_i A i need not commute for this argument.
Since h h h is even, ∥ Y ∥ o p h ≤ tr ( Y h ) \|Y\|_{\mathrm{op}}^h\le\operatorname{tr}(Y^h) ∥ Y ∥ op h ≤ tr ( Y h ) . Markov’s inequality therefore gives ∥ Y ∥ o p ≤ exp ( 1 ) max { 18 h τ , 4 h τ } \|Y\|_{\mathrm{op}}\le\exp(1)\max\{\sqrt{18h\tau},4h\tau\} ∥ Y ∥ op ≤ exp ( 1 ) max { 18 h τ , 4 h τ } with probability at least 1 − 4 D 2 exp ( − h ) ≥ 1 − β 1-4D^2\exp(-h)\ge1-\beta 1 − 4 D 2 exp ( − h ) ≥ 1 − β . The assumption τ ≤ ε s 2 / ( 1000 h ) \tau\le\varepsilon_s^2/(1000h) τ ≤ ε s 2 / ( 1000 h ) makes this threshold at most ε s \varepsilon_s ε s , as required. □ \square □
Probability of failure
These arguments prove the required progress at each level when the estimates and sampling errors satisfy their bounds. It remains to show that all these bounds hold together and that the final sample is empty, as stated in Claim A.11 .
We first verify the independence needed to apply Lemma A.1 . In Algorithm 5, answers from one sketch copy modify only later copies; the copy being queried stays unchanged throughout its scan. Thus earlier answers determine the matrix represented by the next copy before we query it, independently of that copy’s seed. The final copy used for selection is also unchanged during its scan. This is the reason for keeping independent copies, following CKL [27 Figure 6] . The next claim makes the argument precise.
Claim A.22. Before a scan, fix the input stream, the previous calls’ outputs, the masks defining E t E_t E t , and the seeds of sketch pairs already queried. These choices determine the represented matrix and query vectors independently of the current pair’s seed. Conditional on these choices, the probability that the scan violates Equation (A.2) is at most β s \beta_s β s .
Proof. The matrix H H H depends only on earlier calls. At level t t t , the initial represented multipliers depend on E t E_t E t and the previously saved estimates. Every subsequent modification to the current copy is determined by answers from earlier copies. Once those earlier seeds are fixed, all these modifications are fixed independently of the current seed. The represented matrix remains unchanged throughout the scan, and each v i v_i v i depends only on H H H , b i b_i b i and the deterministic rounding choices.
We may therefore apply Lemma A.1 to this matrix and all its possible row queries simultaneously. The conditional probability that any estimate in the scan is inaccurate is at most β s \beta_s β s , regardless of which indices the algorithm inspects. By Claim A.24 below, storage checks cannot stop the computation before one of the stated estimate or sampling bounds fails; we do not condition on the entries of an unqueried sketch. □ \square □
Proof of Claim A.11 . We consider the first scan or sampling step to violate its required inequality. Until then, Claims A.8 and A.9 preserve the three inductive properties, and Claim A.24 ensures that no storage check interrupts the computation. Before a scan we fix the choices in Claim A.22 ; the conditional probability of an inaccurate estimate is at most β s \beta_s β s . After selection we fix those choices and answers before revealing the independent next mask. With these choices fixed, Claim A.9 bounds its probability of violating Equation (A.10) by β c \beta_c β c .
It remains to bound the probability that the final sample is nonempty. A fixed index belongs to E T E_T E T precisely when all T T T independently seeded masks retain it, each with probability 1 / 4 1/4 1/4 . Thus Pr [ i ∈ E T ] = 4 − T \Pr[i \in E_T] = 4^{-T} Pr [ i ∈ E T ] = 4 − T , and a union bound over the m m m indices gives Pr [ E T ≠ ∅ ] ≤ m 4 − T \Pr[E_T \ne\emptyset] \le m4^{-T} Pr [ E T = ∅ ] ≤ m 4 − T .
There are at most T ( T + 1 ) T(T+1) T ( T + 1 ) scans and T T T sampling steps. Adding their failure probabilities and the probability of a nonempty final sample gives at most T ( T + 1 ) β s + T β c + m 4 − T ≤ 3 δ / ( 8 K ) < δ / K T(T+1)\beta_s + T\beta_c + m4^{-T} \le3\delta/(8K) < \delta/K T ( T + 1 ) β s + T β c + m 4 − T ≤ 3 δ / ( 8 K ) < δ / K . This proves the claim and completes the proof of Lemma A.3 .
Space and time analyses
We prove Lemma A.4 , with Q = 2 + m D μ / ( ε δ λ ) Q = 2 + mD\mu/(\varepsilon\delta\lambda) Q = 2 + m D μ / ( ε δ λ ) . The main storage consists of the sketches, whose dimensions are fixed before the stream. We also need space for their seeds, the saved row lists, and the vectors used in decoding. Before counting these objects, we justify that each number needs only O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) bits and that the storage limits do not interrupt the correctness argument.
Claim A.23. Every stored scalar and arithmetic operand needs O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) bits, with failure declared before exceeding this bound. Computing v i v_i v i needs O b 0 ( D log Q ) O_{b_0}(D\log Q) O b 0 ( D log Q ) additional bits, besides the space needed to obtain rows.
Proof. All magnitude bounds and reciprocals of rounding spacings in Section A.1.3 are polynomial in Q Q Q . During the stream, each sketch entry is an integer signed sum of magnitude at most m μ b 0 m\mu\sqrt{b_0} m μ b 0 . This depends on the current frequencies, so cancelling updates do not increase the required precision. During decoding, working entries lie on the fixed grid of spacing g a / 2 g_a/2 g a /2 and are bounded by C max C_{\max} C m a x . Saved multipliers lie on the grid of spacing g a g_a g a and are bounded by W max W_{\max} W m a x . Thus these numbers have O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) -bit representations.
For the vector computation, λ I ⪯ H ⪯ U I \lambda I \preceq H \preceq UI λ I ⪯ H ⪯ U I follows from the list and multiplier limits. The contraction argument in Claim A.12 bounds every iterate by a polynomial in Q Q Q , and each coordinate is rounded to a multiple of g v g_v g v . Multiplication by H H H scans its weighted row list, so a constant number of length-D D D vectors suffices.
The remaining operations are sums, products, medians, and comparisons of these numbers. We choose power-of-two group sizes for the AMS averages, and round y ^ i / q i \widehat{y}_i/q_i y i / q i immediately to the g a g_a g a grid after checking q i > 0 q_i > 0 q i > 0 . Hence denominators do not accumulate across operations. The intermediate sums and products also have O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) bits. Choosing a sufficiently large constant in this bit bound and checking it before storing each result gives the guarantee for every choice of seeds.
Claim A.24. Consider a call satisfying the hypotheses of Lemma A.3 . Before the first violation of Equations (A.2) and (A.10), no limit on the saved list, multiplier estimates, sketch entries, or arithmetic is exceeded.
Proof. Assume that the estimates and sampling steps so far satisfy their inequalities. The induction in Claims A.8 and A.9 then applies to every completed level, and Claim A.17 bounds each prefix of the saved list by M max M_{\max} M m a x .
At level t t t , every working multiplier is at most 1.01 τ μ 1.01\,\tau_\mu 1.01 τ μ , including those in partially modified sketch copies, by Claim A.18. Its reported estimate is therefore below W max = 2 T + 3 τ μ W_{\max} = 2^{T+3}\tau_\mu W m a x = 2 T + 3 τ μ . Preparing a sketch adds at most one saved contribution per row; subsequent corrections subtract at most T T T half-estimates per row. Each sketch coefficient has magnitude at most one, and each row coefficient at most b 0 \sqrt{b_0} b 0 . The triangle inequality therefore bounds every intermediate sketch entry by C max = 4 m ( T + 2 ) W max ( b 0 + 1 ) C_{\max}=4m(T+2)W_{\max}(b_0+1) C m a x = 4 m ( T + 2 ) W m a x ( b 0 + 1 ) . This also bounds copies not yet queried. Finally, the preceding claim bounds the vector computation and remaining arithmetic. Thus the storage checks introduce no failure while the inequalities used in the correctness proof hold.
Proof of Lemma A.4. Sketches and seeds. There are K T ( T + 1 ) = O b 0 ( log 3 Q ) KT(T+1)=O_{b_0}(\log^3 Q) K T ( T + 1 ) = O b 0 ( log 3 Q ) sketch pairs. Each pair is applied to D D D columns and has O ( ( ε a 2 η ) − 1 log ( 2 m / β s ) ) O((\varepsilon_a^2\eta)^{-1}\log(2m/\beta_s)) O (( ε a 2 η ) − 1 log ( 2 m / β s )) entries per column. Since ε a − 1 = O ( ε − 1 log Q ) \varepsilon_a^{-1}=O(\varepsilon^{-1}\log Q) ε a − 1 = O ( ε − 1 log Q ) and η − 1 = O ( ε − 2 log 3 Q ) \eta^{-1}=O(\varepsilon^{-2}\log^3 Q) η − 1 = O ( ε − 2 log 3 Q ) , all stored sketches together have O b 0 ( D ε − 4 polylog Q ) O_{b_0}(D\varepsilon^{-4}\operatorname{polylog} Q) O b 0 ( D ε − 4 polylog Q ) entries. The T + 1 T+1 T + 1 working copies needed at one sampling level fit within the same bound. Each entry needs O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) bits by Claim A.23, giving the claimed space bound for the sketches.
The seeds take only polylog Q \operatorname{polylog} Q polylog Q additional bits. An h h h -wise independent mask has an O ( h log ( 2 m ) ) O(h\log(2m)) O ( h log ( 2 m )) -bit description by the standard polynomial construction [79 Construction 3.32 and Proposition 3.33] . Each CountSketch and AMS pair also has a polylog Q \operatorname{polylog} Q polylog Q -bit description [22 , 8 ] , and there are only polylogarithmically many masks and pairs. These descriptions can be constructed and evaluated in polynomial time and polylogarithmic workspace; the sampled sets are never stored.
Row lists and working space. Each list has at most M max = ⌈ 12 D / θ ⌉ = O b 0 ( D ε − 2 polylog Q ) M_{\max}=\lceil12D/\theta\rceil=O_{b_0}(D\varepsilon^{-2}\operatorname{polylog} Q) M m a x = ⌈ 12 D / θ ⌉ = O b 0 ( D ε − 2 polylog Q ) rows. We store an index, a selection level, and a multiplier for each row, taking O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) bits per entry. Two consecutive lists suffice, since a new output replaces the preceding list. Computing v i v_i v i adds only O b 0 ( D log Q ) O_{b_0}(D\log Q) O b 0 ( D log Q ) work bits, and rows of B B B are obtained one at a time. Thus the lists, output, and working space also fit within O s 0 , b 0 ( D ε − 4 polylog Q ) O_{s_0,b_0}(D\varepsilon^{-4}\operatorname{polylog} Q) O s 0 , b 0 ( D ε − 4 polylog Q ) bits.
The algorithm checks all storage limits before exceeding them, so this bound holds even when an estimate is inaccurate. The output has the claimed size because its list never exceeds M max M_{\max} M m a x . The preceding claim ensures that these checks do not affect the correctness guarantee.
Time. Every loop bound is polynomial in m m m , D D D , μ \mu μ , ε − 1 \varepsilon^{-1} ε − 1 , δ − 1 \delta^{-1} δ − 1 , λ − 1 \lambda^{-1} λ − 1 . An update evaluates the masks and sketch maps and modifies the entries corresponding to the nonzero coordinates of its row. After the stream, each scan examines at most m m m rows. Each vector iteration computes H v Hv H v by scanning a list of at most M max M_{\max} M m a x rows, and the prescribed number r i n v r_{\mathrm{inv}} r inv of iterations is polynomial in the same parameters. All arithmetic involves O b 0 ( log Q ) O_{b_0}(\log Q) O b 0 ( log Q ) -bit numbers. Including seed construction and row access, both the time per update and the time after the stream are therefore polynomial as claimed.
Removing the regularizer
We now prove the corollary stated at the end of § 5 , which uses a condition-number bound to remove the identity term.
Corollary 5.9 (restated). Let B ∈ Z m × D B\in\mathbb{Z}^{m\times D} B ∈ Z m × D satisfy the sparsity, norm, and row-access assumptions of Theorem 5.5, and let a strict-turnstile stream maintain integer frequencies 0 ≤ f j ≤ μ 0\le f_j\le\mu 0 ≤ f j ≤ μ . Set G = B T diag ( f ) 2 B G=B^{\mathsf T}\operatorname{diag}(f)^2B G = B T diag ( f ) 2 B . Suppose a known κ ≥ 1 \kappa\ge1 κ ≥ 1 satisfies λ max ( G ) / λ min + ( G ) ≤ κ \lambda_{\max}(G)/\lambda_{\min}^{+}(G)\le\kappa λ m a x ( G ) / λ m i n + ( G ) ≤ κ whenever G ≠ 0 G\ne0 G = 0 , where λ min + ( G ) \lambda_{\min}^{+}(G) λ m i n + ( G ) is the smallest positive eigenvalue. Given 0 < ε 0 < 1 0<\varepsilon_0<1 0 < ε 0 < 1 and 0 < δ < 1 / 2 0<\delta<1/2 0 < δ < 1/2 , a randomized one-pass algorithm returns active indices S S S and positive weights forming W = ∑ i ∈ S w i b i b i T W=\sum_{i\in S}w_i b_i b_i^{\mathsf T} W = ∑ i ∈ S w i b i b i T such that, with probability at least 1 − δ 1-\delta 1 − δ ,
( 1 − ε 0 ) G ⪯ W ⪯ ( 1 + ε 0 ) G . (1-\varepsilon_0)G\preceq W\preceq(1+\varepsilon_0)G. ( 1 − ε 0 ) G ⪯ W ⪯ ( 1 + ε 0 ) G . For Q κ = 2 + m D μ κ / ( ε 0 δ ) Q_\kappa=2+mD\mu\kappa/(\varepsilon_0\delta) Q κ = 2 + m D μ κ / ( ε 0 δ ) , the output contains O s 0 , b 0 ( D ε 0 − 2 polylog Q κ ) O_{s_0,b_0}(D\varepsilon_0^{-2}\operatorname{polylog}Q_\kappa) O s 0 , b 0 ( D ε 0 − 2 polylog Q κ ) indices, and the algorithm uses O s 0 , b 0 ( D ε 0 − 4 polylog Q κ ) O_{s_0,b_0}(D\varepsilon_0^{-4}\operatorname{polylog}Q_\kappa) O s 0 , b 0 ( D ε 0 − 4 polylog Q κ ) bits, including seeds, output, and working space. The time per update and the time after the stream are polynomial in m m m , D D D , μ \mu μ , ε 0 − 1 \varepsilon_0^{-1} ε 0 − 1 , δ − 1 \delta^{-1} δ − 1 , κ \kappa κ , and the time needed to obtain a row. If G = 0 G=0 G = 0 , the successful output is empty after zero rows are ignored.
Proof. Apply Theorem 5.5 with ε = ε 0 / 8 \varepsilon= \varepsilon_0/8 ε = ε 0 /8 and λ \lambda λ the largest power of two at most 1 / κ 1/\kappa 1/ κ . On its success event, the returned rows are active and the regularized matrices satisfy the stated approximation. If G = 0 G = 0 G = 0 , no nonzero row is active, so the output is empty and the conclusion holds. Assume henceforth that G ≠ 0 G \ne0 G = 0 .
Some active row f i b i f_i b_i f i b i is a nonzero integer vector. Since G ⪰ f i 2 b i b i T G \succeq f_i^2 b_i b_i^{\mathsf T} G ⪰ f i 2 b i b i T , we have λ max ( G ) ≥ ∥ f i b i ∥ 2 2 ≥ 1 \lambda_{\max}(G) \ge\lVert f_i b_i\rVert_2^2 \ge1 λ m a x ( G ) ≥ ∥ f i b i ∥ 2 2 ≥ 1 , and the assumed eigenvalue ratio gives λ min + ( G ) ≥ 1 / κ \lambda_{\min}^{+}(G) \ge1/\kappa λ m i n + ( G ) ≥ 1/ κ . Thus λ I ⪯ G \lambda I \preceq G λ I ⪯ G on the range of G G G .
Subtracting G + λ I G+\lambda I G + λ I from the regularized approximation shows that − ε ( G + λ I ) ⪯ W − G ⪯ ε ( G + λ I ) -\varepsilon(G+\lambda I) \preceq W-G \preceq\varepsilon(G+\lambda I) − ε ( G + λ I ) ⪯ W − G ⪯ ε ( G + λ I ) .
On this range, it follows that − 2 ε G ⪯ W − G ⪯ 2 ε G -2\varepsilon G \preceq W-G \preceq2\varepsilon G − 2 εG ⪯ W − G ⪯ 2 εG .
If x x x is in the kernel of G G G , then 0 = x T G x = ∑ i f i 2 ( b i T x ) 2 0 = x^{\mathsf T}Gx = \sum_i f_i^2(b_i^{\mathsf T}x)^2 0 = x T G x = ∑ i f i 2 ( b i T x ) 2 , so b i T x = 0 b_i^{\mathsf T}x = 0 b i T x = 0 for every active row. The output contains only active rows, hence W x = 0 Wx = 0 W x = 0 as well. Both symmetric matrices vanish on the orthogonal complement of the range, and the previous inequalities therefore hold on the whole space.
Since 2 ε ≤ ε 0 2\varepsilon\le\varepsilon_0 2 ε ≤ ε 0 , they imply the desired approximation.
Finally, 1 / ( 2 κ ) < λ ≤ 1 / κ 1/(2\kappa) < \lambda\le1/\kappa 1/ ( 2 κ ) < λ ≤ 1/ κ , so λ − 1 = O ( κ ) \lambda^{-1} = O(\kappa) λ − 1 = O ( κ ) and the parameter Q Q Q of Theorem 5.5 is O ( Q κ ) O(Q\kappa) O ( Q κ ) .
Substitution gives the output-size, space, and time bounds. The success probability remains at least 1 − δ 1-\delta 1 − δ . ∎