@references.viewer
Contents
1 Introduction 3
1.1 Our results 3
1.2 Prior work 5
2 The full algorithm and its guarantees 7
2.1 Constructing the lists 7
2.2 The decision algorithm 8
2.3 Correctness 9
2.4 Time and space complexity 11
2.5 Search and arbitrary secrets 12
3 Correctness under sample reuse 13
3.1 Describing entries by leaf selections 14
3.2 The moment bounds 15
3.3 The survival advantage of a linear dependency among leaf vectors 16
3.4 Shared subtrees and their weights 17
3.5 Comparing the actual and ideal means, covariance, and the uniform case 19
3.6 Applying the moments to decision 22
4 Proof of the time and space bounds 22
4.1 Enumerating compatible pairs efficiently 22
4.2 Exact sampling and the total cap 24
4.3 Numerical evaluation of the Fourier statistic 25
4.4 Resources of the reductions 27
5 Parameter choices 28
5.1 Computing the parameters 28
5.2 The mean in the ideal model 29
5.3 Verifying the guarantees 30
6 AI Acknowledgments 33
A Standard reductions with a fixed number of original samples 37
A.1 Bounded-secret search on the same samples 37
A.2 Normal form from the reserved samples 38
B Concurrent work 39
Introduction
Learning with errors (LWE) asks us to recover a secret from noisy linear equations, or to distinguish those equations from uniformly random data. Its connection to worst-case lattice problems and its use in public-key encryption make the resources needed to solve it an important cryptographic question [29 ] . Time and memory are two such resources; the number of equations used is another. For example, Regev’s public-key encryption scheme publishes a finite collection of noisy equations under one secret. For this reason, it is important to understand the complexity of the problem given a limited number of equations. We study this complexity for bounded errors and polynomial prime moduli.
Our results
Building on the Wagner/BKW approach to LWE [22 ] and its provable SIS variant [DEL25], we prove that a variant of the k k k -tree algorithm gives decision and search algorithms using a sublinear number of original samples for secrets bounded by exp ( ( ln n ) o ( 1 ) ) \exp((\ln n)^{o(1)}) exp (( ln n ) o ( 1 ) ) and errors bounded by n o ( 1 ) n^{o(1)} n o ( 1 ) , and only a sublinear excess over the secret dimension for arbitrary secrets and errors bounded by exp ( ( ln n ) o ( 1 ) ) \exp((\ln n)^{o(1)}) exp (( ln n ) o ( 1 ) ) . With these sample counts, our algorithms succeed with high probability for every fixed secret-error pair satisfying the stated bounds (and not just random secrets and errors).
Model and theorem. In LWE, the input consists of m m m noisy linear equations b j = ⟨ a j , s ⟩ + e j m o d q b_j = \langle a_j, s\rangle+ e_j \bmod q b j = ⟨ a j , s ⟩ + e j mod q , with unknown secret s ∈ F q n s \in\mathbb{F}_q^n s ∈ F q n and error e j ∈ F q e_j \in\mathbb{F}_q e j ∈ F q . We collect their public vectors a j a_j a j as the columns of A ∈ F q n × m A \in\mathbb{F}_q^{n\times m} A ∈ F q n × m and their right-hand sides in b ∈ F q m b \in\mathbb{F}_q^m b ∈ F q m , so b = A T s + e m o d q b = A^\mathsf{T}s + e \bmod q b = A T s + e mod q , where F q = Z / q Z \mathbb{F}_q = \mathbb{Z}/q\mathbb{Z} F q = Z / q Z . The search problem is to recover s s s mod q q q ; the decision problem is to distinguish such ( A , b ) (A,b) ( A , b ) from the case where b b b is uniform independently of A A A . We take A A A to be uniformly random and fix the secret-error pair ( s , e ) (s,e) ( s , e ) independently of A A A (note that the error coordinates need not be independent). We denote by E s , E e ≥ 0 E_s,E_e \ge0 E s , E e ≥ 0 the bounds on the absolute values of each coordinate of the secret and error, respectively.
Theorem 1.1 (LWE with few samples). Fix κ > 0 \kappa> 0 κ > 0 and C > min { 1 , 1 / κ } C > \min\{1,1/\kappa\} C > min { 1 , 1/ κ } , and let q = n κ + o ( 1 ) q = n^{\kappa+o(1)} q = n κ + o ( 1 ) run through primes. Consider the LWE problem with m m m equations, secret of length n n n , and modulus q q q , with E s E_s E s and E e E_e E e being bounds on the absolute values of the secret and error coordinates, respectively. There is a decision (resp. search) algorithm for LWE in each of the following regimes that succeeds with advantage (resp. probability) 1 − o ( 1 ) 1-o(1) 1 − o ( 1 ) for all large enough n n n :
E s ≤ exp ( ( ln n ) o ( 1 ) ) E_s \le\exp((\ln n)^{o(1)}) E s ≤ exp (( ln n ) o ( 1 ) ) , E e ≤ n o ( 1 ) E_e \le n^{o(1)} E e ≤ n o ( 1 ) , and m ≥ C n / ln ln q m \ge Cn/\ln\ln q m ≥ C n / ln ln q
E e ≤ exp ( ( ln n ) o ( 1 ) ) E_e \le\exp((\ln n)^{o(1)}) E e ≤ exp (( ln n ) o ( 1 ) ) and m ≥ n + C n / ln ln q m \ge n + Cn/\ln\ln q m ≥ n + C n / ln ln q
The expected running time of these algorithms is 2 ( 1 / 2 + o ( 1 ) ) m / ln q 2^{(1/2+o(1))m/\ln q} 2 ( 1/2 + o ( 1 )) m / l n q , and the same bound holds with probability at least 1 − 1 / n 1-1/n 1 − 1/ n . They work for uniformly random A A A and any (even worst-case) s s s and e e e fixed independently of A A A , as long as they satisfy the above bounds.
:::
We prove Theorem 1.1 at the end of § 2.5 . The core is a decision algorithm for bounded secrets and errors. We obtain the search algorithm by adapting Regev’s coordinate-guess reduction [29 ] , and reduce arbitrary-secret instances to bounded-secret ones using the normal-form transformation of Applebaum–Cash–Peikert–Sahai [2 ] . The second regime has the tighter error bound because normal form makes the original errors the new secret, which must satisfy the first regime’s secret bound. The algorithm is essentially a careful application of Wagner’s k k k -tree algorithm [Wag02]. The formal decision algorithm is Algorithm 2, with its correctness stated in Proposition 2.3; § 2.5 gives the extensions to search and arbitrary secrets, and Proposition 2.7 bounds the resources of the full algorithms.
The k k k -tree algorithm. Wagner’s k k k -tree algorithm addresses the generalized birthday problem: choose one entry from each of k k k lists of vectors so that their sum is zero [Wag02]. Its idea is to build candidate sums in stages. For four lists of binary vectors, with addition modulo two, first combine lists 1 and 2 and lists 3 and 4, keeping only sums that vanish on a chosen block of coordinates. Then combine the resulting two lists to find sums that vanish on the remaining coordinates as well. When k k k is a power of two, these pairwise merges form a binary tree, with the input lists at its leaves and the final list at its root. Filtering limits intermediate list growth, while sums remain zero on coordinates processed at earlier levels.
For bounded-secret LWE decision, we use the first d = min { m , n } d = \min\{m,n\} d = min { m , n } original equations and write A A A , b b b , e e e for their restrictions. The goal is to find coefficient vectors z z z that control error amplification and the secret’s contribution through A z Az A z , yielding a detectable LWE signal. We draw k k k initial lists at level zero, each with N N N independently sampled coefficient vectors. Each vector specifies one weight for each equation. When combining two lists, adding entry vectors x x x , y y y adds the corresponding weighted equations. At level i i i , the submatrix A i A_i A i formed from n i n_i n i rows of A A A filters these sums, keeping only those for which every coordinate of A i ( x + y ) A_i(x+y) A i ( x + y ) lies in the centered interval { − R i , … , R i } \{-R_i,\ldots,R_i\} { − R i , … , R i } mod q q q (for a choice of R i R_i R i ’s described later). We then independently subsample the passing sums, keeping each with probability p i p_i p i . Different levels use disjoint sets of rows, and the parameters are chosen to keep intermediate list sizes around the target size N N N .
Figure 1 illustrates the case k = 4 k=4 k = 4 . First merge lists 1 and 2, and lists 3 and 4; then merge the two resulting lists. At each merge, every compatible pair with one entry from the left list and one from the right list is enumerated. Every entry remains available for every compatible pair, so one entry can contribute to many combinations. Each final entry is the sum of exactly one coefficient vector from each of the k k k initial lists.
Figure 1. The construction with four initial lists. Each merge adds one entry from each incoming list, filters the sum, and independently decides whether to keep it. Using an entry leaves it available for other pairs; equal vector values produced by different pairs remain separate entries.
The decision algorithm. A coefficient vector z ∈ F q d z \in\mathbb{F}_q^d z ∈ F q d combines the equations as:
⟨ z , b ⟩ = ⟨ z , e ⟩ + ⟨ A z , s ⟩ ( m o d q ) . (1) \langle z,b\rangle= \langle z,e\rangle+ \langle Az,s\rangle\pmod q. \tag*{(1)} ⟨ z , b ⟩ = ⟨ z , e ⟩ + ⟨ A z , s ⟩ ( mod q ) . (1)
The two terms are the combined error and the secret’s contribution through the combined public vector. The initial coefficient interval controls error amplification, while the filters control the secret contribution. We map each combined right-hand side to a point on the complex unit circle and sum these points over the final list L r o o t \mathcal{L}_{\mathrm{root}} L root :
Z ( b ) = ∑ z ∈ L r o o t exp ( 2 π i ⟨ z , b ⟩ / q ) . (2) Z(b) = \sum_{z\in\mathcal{L}_{\mathrm{root}}} \exp(2\pi i\langle z,b\rangle/q). \tag*{(2)} Z ( b ) = z ∈ L root ∑ exp ( 2 π i ⟨ z , b ⟩ / q ) . (2)
Every list entry contributes separately, including duplicate vector values. The lists are generated using A A A and fresh randomness, without using b b b . The construction ensures that all final coefficient vectors are nonzero, so when b b b is uniform, every entry contributes a point with mean zero.
For intuition, suppose the final list leads to the above Z ( b ) Z(b) Z ( b ) being a sum of N N N independent terms with a common mean of magnitude N − o ( 1 ) N^{-o(1)} N − o ( 1 ) . Their sum would have mean magnitude N 1 − o ( 1 ) N^{1-o(1)} N 1 − o ( 1 ) and fluctuations of order N \sqrt{N} N . Under uniform data, its mean would be zero and its typical magnitude of order N \sqrt{N} N . A threshold T T T near N 3 / 4 N^{3/4} N 3/4 would separate these scales. The actual output terms are dependent; our analysis proves that this separation survives their dependence. Algorithm 1 summarizes the algorithm.
Algorithm 1: Bounded-secret LWE decision: informal outline
Input: d d d original equations, written as A ∈ F q n × d A \in\mathbb{F}_q^{n \times d} A ∈ F q n × d and b ∈ F q d b \in\mathbb{F}_q^d b ∈ F q d ; parameters, including list sizes, intervals, submatrices, and probabilities, chosen as in Table 2 .
Table 2. Parameter choices for levels 1 ≤ i ≤ r 1 \le i \le r 1 ≤ i ≤ r . The row capacities are computed by exact integer comparisons; ℓ i \ell_i ℓ i , H H H , D 0 D_0 D 0 , ε \varepsilon ε are analysis quantities.
Draw k = 2 r < q k = 2^r < q k = 2 r < q initial lists of N N N coefficient vectors ( 1 , X 2 , … , X d ) (1, X_2, \ldots, X_d) ( 1 , X 2 , … , X d ) mod q q q , where X 2 , … , X d X_2, \ldots, X_d X 2 , … , X d are sampled independently and uniformly from { − B , … , B } \{-B, \ldots, B\} { − B , … , B } ;
for i = 1 , … , r i = 1, \ldots, r i = 1 , … , r do
foreach merge of two lists at level i i i do
Enumerate all pairs ( x , y ) (x,y) ( x , y ) with x x x from the left list, y y y from the right list, and A i ( x + y ) ∈ [ − R i , R i ] n i m o d q A_i(x+y) \in[-R_i,R_i]^{n_i} \bmod q A i ( x + y ) ∈ [ − R i , R i ] n i mod q ;
Independently keep each sum x + y x+y x + y in the parent list with probability p i p_i p i ;
Leave both x , y x,y x , y available for other pairs, and keep equal sums from different pairs as separate entries;
Compute Z ( b ) Z(b) Z ( b ) from the final list by (2) ;
Output LWE if ∣ Z ( b ) ∣ ≥ T |Z(b)| \ge T ∣ Z ( b ) ∣ ≥ T , and uniform otherwise, with T T T near N 3 / 4 N^{3/4} N 3/4 ;
Controlling dependence. Independently sampled coefficient vectors still combine the same original equations, so the resulting terms need not be independent. We bound the Fourier statistic’s mean and fluctuations under the actual dependent output distribution. We bound its second moment by tracking which merge decisions two outputs share when they reuse the same intermediate entry. We also show that accidental linear dependencies are rare enough to offset the greater chance of passing the filters. Sampling the remaining coordinates independently from a wide uniform interval makes these dependencies rare. The moment bounds in Theorem 2.1 make the preceding separation rigorous without assuming independent outputs.
Prior work
LWE Hardness and the role of parameters. Ajtai introduced the short integer solution problem (SIS), which asks for a short nonzero integer vector in the kernel of a matrix modulo q q q , and gave a worst-case to average-case reduction; Micciancio–Regev developed this connection using Gaussian measures [7 , 27 ] . Regev introduced LWE and its quantum hardness reduction, and Brakerski–Langlois–Peikert–Regev–Stehlé established classical hardness for polynomial moduli [29 , 13 ] . For binary errors, Micciancio–Peikert prove hardness with suitably restricted samples and a change in lattice dimension [26 ] , whereas Arora–Ge’s linearization method gives polynomial-time recovery from m ≥ c n 2 m \ge cn^2 m ≥ c n 2 samples, for a sufficiently large constant c c c , with independent uniform binary errors and polynomial prime moduli q > 2 q > 2 q > 2 [6 ] . Thus both the error bound and the number of equations matter.
BKW and algorithms with restricted number of equations. BKW solves learning parity with noise (LPN), the binary-field analogue of LWE, with independent noise of any fixed rate below 1 / 2 1/2 1/2 in time and samples 2 O ( n / log n ) 2^{O(n/\log n)} 2 O ( n / l o g n ) [12 ] . It combines equations to eliminate blocks of coordinates at the cost of increasing the noise. Lyubashevsky reduces the original samples to n 1 + ϵ n^{1+\epsilon} n 1 + ϵ , for any fixed ϵ > 0 \epsilon> 0 ϵ > 0 , at time 2 O ( n / log log n ) 2^{O(n/\log\log n)} 2 O ( n / l o g l o g n ) by generating combinations of the available equations [25 ] . These results illustrate a time–sample tradeoff over the binary field.
For LWE, lazy modulus switching combines equations whose public vectors agree after rounding to a smaller modulus, trading small residual coordinates for fewer buckets [5 ] . Kirchner–Fouque generalize this quantization and vary its precision between stages [22 ] ; coded-BKW with sieving controls the accumulated error [17 ] . Further work improves practical implementations [11 ] and time–memory tradeoffs [WBLW25]. Guo, Mårtensson, and Stankovski Wagner experimentally study dependence from BKW-style combinations and sample amplification [18 ] . These experiments do not give an asymptotic guarantee for every fixed bounded secret-error pair, as we seek here.
Kirchner–Fouque claim subexponential time with a linear number of original samples and small secrets and errors [22 ] . For polylogarithmic secret and error bounds, polynomial moduli, and m = Θ ( n ) m = \Theta(n) m = Θ ( n ) , their claimed decision bound is 2 ( 1 / 2 + o ( 1 ) ) n / ln ln q 2^{(1/2+o(1))n/\ln\ln q} 2 ( 1/2 + o ( 1 )) n / l n l n q [22 full version, Cor. 6] . As explained by Ducas–Engelberts–Loyer, Herold–Kirshanova–May identify a flaw in the linear-sample narrow-error proof and resolve it for a sufficiently large constant multiple of n log 2 n n\log_2 n n log 2 n samples [20 DEL25] . The gap concerns joint closeness to independent samples after amplification under a shared random matrix. For bounded secrets, we match the claimed running time with sublinear original samples. Our theorem proves correctness of our construction, not of the Kirchner–Fouque algorithm.
Wagner’s algorithm for SIS and the obstacle for LWE. Ducas–Engelberts–Loyer’s Gaussian analysis of Wagner’s algorithm [DEL25] builds on discrete-Gaussian techniques developed for shortest and closest vector problems [3 , 4 , 10 , 8 , 1 ] . They view BKW as Wagner’s generalized birthday method [Wag02] on a dual lattice followed by the Aharonov–Regev distinguisher [9 ] . Their sampler lifts Gaussian vectors through a chain of projected lattices, with auxiliary superlattices keeping the lifts short. Gaussian randomized rounding lets them prove conditional similarity to independent samples, a notion from Aggarwal–Li–Stephens-Davidowitz [8 ] . This gives a provable subexponential algorithm for S I S ∗ \mathrm{SIS}^{*} SIS ∗ with m = n + ω ( n / ln ln n ) m = n + \omega(n/\ln\ln n) m = n + ω ( n / ln ln n ) variables, polynomially growing prime moduli, and norm bounds q / polylog ( n ) q/\operatorname{polylog}(n) q / polylog ( n ) for suitable polylogarithmic factors [DEL25].
Transferring this SIS guarantee to LWE requires controlling a statistic that aggregates many vectors. Ducas–Engelberts–Loyer explain that bounding the joint statistical distance of all the required samples demands an accuracy for which their sampler takes exponential time in n n n [DEL25, Section 4.3].2
k k k -trees and dependence among combinations. Levieil–Fouque’s LPN variant forms all pairwise sums within each bucket, but treats its analysis as heuristic because the resulting equations are dependent [23 Section 4] . For k k k -sum, Minder–Sinclair analyze extended k k k -trees with independent input lists, controlling dependence between candidate solutions; Lin–Vasudevan give success and complexity bounds over integers and modular groups [28 LV25] . Joux–Kippen–Loss modify merging to enforce independence and uniformity of intermediate entries [21 ] . Filtering coefficient vectors through a shared random matrix creates additional dependence beyond these analyses.
Kirchner–Fouque and Ducas–Engelberts–Loyer start from one list and discard both inputs after combining a pair [22 DEL25] . Our use of k k k separate lists is a design choice. The coefficient vectors are sampled uniformly in their free coordinates from a wide interval. Every entry remains available for every compatible pair, and we independently subsample passing sums. Building on the second-moment approach to k k k -trees [28 LV25] , we directly control the Fourier statistic’s mean and fluctuations, including shared entries and linear dependencies under the common matrix. This gives the LWE guarantees in Theorem 1.1 without requiring joint closeness to independent samples.
The full algorithm and its guarantees
The core of our result is a decision algorithm for bounded secrets and errors. We first specify how this algorithm works. We then state the correctness and resource guarantees, followed by the two standard reductions that give search and handle arbitrary secrets. § 3 and § 4 prove the correctness and resource statements conditioned on selecting good parameters; § 5 chooses parameters that meet these conditions.
The LWE problems. Let q q q be prime. An instance consists of A ∈ F q n × m A \in\mathbb{F}_q^{n \times m} A ∈ F q n × m and b ∈ F q m b \in\mathbb{F}_q^m b ∈ F q m . In the LWE case, A A A is uniform and b = A T s + e m o d q b = A^{\mathsf{T}}s+e \bmod q b = A T s + e mod q , where the secret s ∈ Z n s \in\mathbb{Z}^n s ∈ Z n and error vector e ∈ Z m e \in\mathbb{Z}^m e ∈ Z m are fixed independently of A A A . For bounded-secret LWE, we have the promise that ∥ s ∥ ∞ ≤ E s \lVert s\rVert_\infty\le E_s ∥ s ∥ ∞ ≤ E s and ∥ e ∥ ∞ ≤ E e \lVert e\rVert_\infty\le E_e ∥ e ∥ ∞ ≤ E e , where ∥ x ∥ ∞ = max j ∣ x j ∣ \lVert x\rVert_\infty= \max_j \lvert x_j\rvert ∥ x ∥ ∞ = max j ∣ x j ∣ ; in the arbitrary-secret case only the error bound is imposed. The search problem asks for s m o d q s \bmod q s mod q . The decision problem asks us to distinguish an LWE instance from the uniform case, in which b b b is uniform independently of A A A .
In standard definitions of LWE, s s s and e e e are sampled from distributions respecting bounds similar to the ones above. Our algorithms work even for worst-case s s s and e e e as in the definition above, which is stronger than them working for fixed distributions.
Constructing the lists
The decision algorithm uses only the first d = min { m , n } d = \min\{m,n\} d = min { m , n } original equations. Write A ∈ F q n × d A \in\mathbb{F}_q^{n \times d} A ∈ F q n × d and b ∈ F q d b \in\mathbb{F}_q^d b ∈ F q d for their matrix and right-hand-side vector. A coefficient vector z ∈ F q d z \in\mathbb{F}_q^d z ∈ F q d specifies a linear combination of these equations. Our goal is to generate many coefficient vectors for which the combined error and the secret contribution are controlled, so that their Fourier terms have a detectable mean when ( A , b ) (A,b) ( A , b ) is an LWE instance.
The parameter choices in Table 2 depend only on n , q , d , E s , E e n,q,d,E_s,E_e n , q , d , E s , E e . They specify a binary tree of depth r r r with 2 ≤ k = 2 r < q 2 \le k = 2^r < q 2 ≤ k = 2 r < q initial lists, each of size N = 2 L N = 2^L N = 2 L , a leaf radius B B B , and filter radii R 1 , … , R r R_1,\ldots,R_r R 1 , … , R r . They also specify a partition of the n n n rows of A A A into consecutive submatrices A i A_i A i with positive row counts n i n_i n i satisfying ∑ i n i = n \sum_i n_i = n ∑ i n i = n ; write s ( i ) s^{(i)} s ( i ) for the corresponding coordinates of the secret. We number levels upward from the initial lists at level zero. Write M i = k / 2 i M_i = k/2^i M i = k / 2 i for the number of nodes at level i i i , each storing one list; for i ≥ 1 i \ge1 i ≥ 1 , this is also the number of merges. We assume the parameter checks in § 5.1 hold for the list count k k k , radii B , R i B,R_i B , R i , and row counts n i n_i n i ; otherwise the algorithm returns UNIFORM.
Sample every entry of the initial lists independently as
( 1 , X 2 , … , X d ) m o d q , X 2 , … , X d independent and uniform on { − B , … , B } . (3) (1,X_2,\ldots,X_d) \bmod q,\qquad X_2,\ldots,X_d\text{ independent and uniform on }\{-B,\ldots,B\}. \tag*{(3)} ( 1 , X 2 , … , X d ) mod q , X 2 , … , X d independent and uniform on { − B , … , B } . (3)
All initial lists are sampled once. Fixing the first coordinate to one ensures that every vector at level i i i has first coordinate 2 i m o d q 2^i \bmod q 2 i mod q . Since k < q k<q k < q , every vector generated by the tree is nonzero.
At level i i i , merge two child lists by adding their entry vectors. A pair ( x , y ) (x,y) ( x , y ) , with one entry from each child list, is compatible when
A i ( x + y ) ∈ { − R i , … , R i } n i m o d q . (4) A_i(x+y) \in\{-R_i,\ldots,R_i\}^{n_i} \bmod q. \tag*{(4)} A i ( x + y ) ∈ { − R i , … , R i } n i mod q . (4)
For each compatible pair, independently keep its sum in the parent list with probability p i p_i p i . Write Q = 2 B + 1 Q=2B+1 Q = 2 B + 1 and W i = 2 R i + 1 W_i=2R_i+1 W i = 2 R i + 1 for the interval widths, and set
ρ i = ( W i / q ) n i , p i = q n i N W W i n i = 1 N ρ i . (5) \rho_i = (W_i/q)^{n_i},\qquad p_i = \frac{q^{n_i}}{NWW_i^{n_i}} = \frac{1}{N\rho_i}. \tag*{(5)} ρ i = ( W i / q ) n i , p i = N W W i n i q n i = N ρ i 1 . (5)
The parameter checks and construction ensure Q < q Q < q Q < q , 3 W i ≤ q 3W_i \le q 3 W i ≤ q , and 0 < p i ≤ 1 0 < p_i \le1 0 < p i ≤ 1 . Before the fresh submatrix A i A_i A i is revealed, a fixed nonzero pair sum has a uniform image, so it passes the filter and is kept with probability ρ i p i = 1 / N \rho_i p_i = 1/N ρ i p i = 1/ N . Two lists of size N N N would therefore produce N N N parent entries in expectation. The same submatrix is used at every merge of a level; different levels use disjoint rows.
Using an entry leaves it available for other compatible pairs. Equal vector values remain separate entries, both in the initial lists and when different pairs produce the same sum. Each root entry is thus the sum of one selected entry from each of the k k k initial lists. Figure 1 illustrates the case k = 4 k = 4 k = 4 .
Finding compatible pairs with buckets. Represent each coordinate of A i y A_i y A i y by a residue in { 0 , … , q − 1 } \{0,\ldots,q-1\} { 0 , … , q − 1 } and divide this range into consecutive intervals of width W i W_i W i , allowing a shorter final interval. We call each one-coordinate interval a cell . A bucket contains all right-list entries whose images fall in the same cell in every coordinate, so a bucket is indexed by a tuple of cell indices. Formally, the cells are
I i , j = { j W i , … , min { ( j + 1 ) W i − 1 , q − 1 } } , 0 ≤ j < ⌈ q / W i ⌉ . (6) \mathcal{I}_{i,j} = \{jW_i,\ldots,\min\{(j+1)W_i-1,q-1\}\}, \qquad0 \le j < \lceil q/W_i\rceil. \tag*{(6)} I i , j = { j W i , … , min {( j + 1 ) W i − 1 , q − 1 }} , 0 ≤ j < ⌈ q / W i ⌉ . (6)
For a merge at level i i i , write the right list with size J R J_R J R as L R = ( y 1 , … , y J R ) \mathcal{L}_R = (y_1,\ldots,y_{J_R}) L R = ( y 1 , … , y J R ) . For a tuple j = ( j 1 , … , j n i ) \mathbf{j} = (j_1,\ldots,j_{n_i}) j = ( j 1 , … , j n i ) with 0 ≤ j t < ⌈ q / W i ⌉ 0 \le j_t < \lceil q/W_i\rceil 0 ≤ j t < ⌈ q / W i ⌉ , define the bucket
B i , j = { a ∈ { 1 , … , J R } : ( A i y a ) t ∈ I i , j t for every t = 1 , … , n i } . (7) B_{i,\mathbf{j}} = \{a \in\{1,\ldots,J_R\} : (A_i y_a)_t \in\mathcal{I}_{i,j_t}\text{ for every }t = 1,\ldots,n_i\}. \tag*{(7)} B i , j = { a ∈ { 1 , … , J R } : ( A i y a ) t ∈ I i , j t for every t = 1 , … , n i } . (7)
It stores the entries y a y_a y a at these indices; equal vector values at different indices remain separate entries.
For each left entry x x x , a compatible right image must lie coordinatewise in − ( A i x ) j + { − R i , … , R i } m o d q -(A_i x)_j + \{-R_i,\ldots,R_i\}\bmod q − ( A i x ) j + { − R i , … , R i } mod q . In each coordinate, find the cells meeting this cyclic interval, and query the buckets for all tuples of these cell indices. Check every returned pair against (4) before sampling whether to keep it. Every compatible pair is found exactly once. The queries may also return pairs that fail the exact filter; they are discarded by the (4) check before subsampling. Sorting by these index tuples allows binary search for each bucket; § 4.1 gives the implementation details and time bound.
The decision algorithm
Let ω = exp ( 2 π i / q ) \omega= \exp(2\pi i/q) ω = exp ( 2 π i / q ) . For the analysis, let L r o o t \mathcal{L}_{\mathrm{root}} L root denote the root list obtained by running all merges without a storage limit, and define
Z ( b ) = ∑ z ∈ L r o o t ω ⟨ z , b ⟩ . (8) Z(b) = \sum_{z\in\mathcal{L}_{\mathrm{root}}} \omega^{\langle z,b\rangle}. \tag*{(8)} Z ( b ) = z ∈ L root ∑ ω ⟨ z , b ⟩ . (8)
Each entry contributes separately, including duplicate vector values. Generating the coefficient vectors uses only A A A and fresh randomness; b b b is used only when the sum Z ( b ) Z(b) Z ( b ) is evaluated. In the uniform case, each nonzero vector’s Fourier term has mean zero. Under LWE, ⟨ z , b ⟩ = ⟨ z , e ⟩ + ⟨ A z , s ⟩ m o d q \langle z,b\rangle= \langle z,e\rangle+ \langle Az,s\rangle\bmod q ⟨ z , b ⟩ = ⟨ z , e ⟩ + ⟨ A z , s ⟩ mod q , so the leaf radius B B B controls the error contribution, and the filters control the secret contribution through the node images. We decide by the magnitude of the sum, using the threshold
T = 2 ⌈ 3 L / 4 ⌉ . (9) T = 2^{\lceil3L/4\rceil}. \tag*{(9)} T = 2 ⌈ 3 L /4 ⌉ . (9)
The ideal test returns LWE when ∣ Z ( b ) ∣ ≥ T |Z(b)| \ge T ∣ Z ( b ) ∣ ≥ T and UNIFORM otherwise. Here ∣ Z ∣ |Z| ∣ Z ∣ is the complex modulus; the finite-precision implementation below applies the same rule to Z ~ \widetilde{Z} Z by comparing ∣ Z ~ ∣ 2 |\widetilde{Z}|^2 ∣ Z ∣ 2 with T 2 T^2 T 2 exactly.
For the resource guarantees, we stop and return UNIFORM if storing another entry would exceed K K K . We compute a rational estimate Z ~ \widetilde{Z} Z with ∣ Z ~ − Z ∣ ≤ T / 4 |\widetilde{Z}-Z| \le T/4 ∣ Z − Z ∣ ≤ T /4 whenever list construction finishes without exceeding this limit, and compare its squared modulus with T 2 T^2 T 2 exactly. These choices ensure bounded storage and reliable evaluation of the decision statistic; Section 4 gives the implementation and its cost. Set
K = 2 k n 4 N , P = min { j ∈ Z ≥ 1 : 2 j T ≥ 4 K } . (10) K = 2kn^4N,\qquad P = \min\{j \in\mathbb{Z}_{\ge1}: 2^jT \ge4K\}. \tag*{(10)} K = 2 k n 4 N , P = min { j ∈ Z ≥ 1 : 2 j T ≥ 4 K } . (10)
Keep all stored entries until the algorithm ends, counting initial entries and entries retained by subsampling toward K K K ; reaching exactly K K K is permitted. All random sampling is exact, using fresh random bits for each request as described in Section 4.2. On storage overflow, set Z ~ = 0 \widetilde{Z}=0 Z = 0 .
Algorithm 2: Bounded-secret LWE decision
Input: A ∈ F q n × m A \in\mathbb{F}_q^{n \times m} A ∈ F q n × m , b ∈ F q m b \in\mathbb{F}_q^m b ∈ F q m , and public bounds E s , E e E_s,E_e E s , E e .
Use the first d = min { m , n } d=\min\{m,n\} d = min { m , n } equations and compute the parameters in Table 2 ; return uniform if a parameter check fails;
Set the threshold T T T , storage limit K K K , and precision P P P by (2.7) and (2.8);
Draw k k k initial lists of N N N independent coefficient vectors from (2.1) using exact sampling (Section 4.2); set the stored-entry count J = k N J=kN J = k N ;
for i = 1 , … , r i=1,\ldots,r i = 1 , … , r do
foreach merge of two lists at level i i i , from left to right do
foreach compatible pair ( x , y ) (x,y) ( x , y ) found by bucket queries (Section 4.1) do
Independently keep x + y m o d q x+y \bmod q x + y mod q with exact probability p i p_i p i ;
if the sum is kept then
if J = K J=K J = K then return uniform;
Append the sum to the parent list and increment J J J ;
Leave child entries available for other pairs; keep equal sums from different pairs as separate entries;
Compute the rational estimate Z ~ \widetilde{Z} Z with error at most T / 4 T/4 T /4 , using the evaluation procedure of Section 4.3;
Return LWE if ∣ Z ~ ∣ 2 ≥ T 2 |\widetilde{Z}|^2 \ge T^2 ∣ Z ∣ 2 ≥ T 2 , and uniform otherwise, comparing exactly;
Correctness
Correctness rests on the mean and fluctuations of Z Z Z under the actual reuse of entries. To describe the expected LWE signal, first consider one selection of a leaf entry from each initial list. At each internal node v v v at level i i i , call A i z v A_i z_v A i z v its node image , where z v z_v z v is the sum of the selected leaf vectors below v v v . For the root vector z z z , the combined right-hand side is ⟨ z , e ⟩ + ⟨ A z , s ⟩ \langle z,e\rangle+\langle Az,s\rangle ⟨ z , e ⟩ + ⟨ A z , s ⟩ . Its block A i z A_i z A i z is the sum of the level-i i i node images because those nodes partition the selected leaves.
To make the expected signal easier to calculate, we consider an ideal model for one combination in which the node images are independent of one another and of the leaf vectors. In this model, sample k k k independent leaf vectors from (2.1) and, at each internal node at level i i i , sample an independent uniform image in the filter box { − R i , … , R i } n i m o d q \{-R_i,\ldots,R_i\}^{n_i}\bmod q { − R i , … , R i } n i mod q . Let z ∗ ∈ F q d z^* \in\mathbb{F}_q^d z ∗ ∈ F q d be the sum of these leaf vectors, and let y ∗ ∈ F q n y^* \in\mathbb{F}_q^n y ∗ ∈ F q n concatenate the sums of the ideal node images at levels 1 , … , r 1,\ldots,r 1 , … , r . Thus z ∗ z^* z ∗ combines the d d d error coordinates, while the i i i th block of y ∗ y^* y ∗ takes the place of A i z A_i z A i z and pairs with the corresponding secret coordinates. For a fixed integer secret-error pair ( s , e ) ∈ Z n × Z d (s,e)\in\mathbb{Z}^n\times\mathbb{Z}^d ( s , e ) ∈ Z n × Z d , the ideal mean below is the mean Fourier contribution in this independent model.
Γ = E [ ω ⟨ z ∗ , e ⟩ + ⟨ y ∗ , s ⟩ ] . (11) \Gamma= \mathbb{E}\left[\omega^{\langle z^*,e\rangle+\langle y^*,s\rangle}\right]. \tag*{(11)} Γ = E [ ω ⟨ z ∗ , e ⟩ + ⟨ y ∗ , s ⟩ ] . (11)
The algorithm does not compute Γ \Gamma Γ , which depends on the unknown secret and errors. We use it in the analysis: the following theorem shows that the actual mean of the sum is close to N Γ N\Gamma N Γ and bounds its fluctuations despite the dependence among outputs.
Theorem 2.1 (Moments of the Fourier statistic). Let A ∈ F q m × d A \in\mathbb{F}_q^{m \times d} A ∈ F q m × d be uniform and independent of the initial lists and subsampling randomness. Suppose the algorithm parameters additionally satisfy
2 k ≤ N , D 0 = d − 1 − 2 k ≥ 1 , 4 k N r + 1 ≤ Q D 0 , ε = 4 k N r Q − D 0 ≤ N − 1 . (12) \begin{aligned}
2k &\le N, & D_0 &= d-1-2k \ge1, & 4kN^{r+1} &\le Q^{D_0}, \\
\varepsilon&= 4kN^rQ^{-D_0} & &\le N^{-1}. \tag*{(12)}
\end{aligned} 2 k ε ≤ N , = 4 k N r Q − D 0 D 0 = d − 1 − 2 k ≥ 1 , ≤ N − 1 . 4 k N r + 1 ≤ Q D 0 , (12) For every fixed integer secret-error pair, with b = A T s + e m o d q b=A^\mathsf{T}s+e \bmod q b = A T s + e mod q ,
∣ E [ Z ( b ) ] − N Γ ∣ ≤ 3 N ε ≤ 3 , Var [ Z ( b ) ] ≤ 16 k N , (13) \left|\mathbb{E}[Z(b)]-N\Gamma\right|\le3N\varepsilon\le3,\qquad\operatorname{Var}[Z(b)]\le16kN, \tag*{(13)} ∣ E [ Z ( b )] − N Γ ∣ ≤ 3 N ε ≤ 3 , Var [ Z ( b )] ≤ 16 k N , (13) where Var [ Z ] = E [ ∣ Z − E [ Z ] ∣ 2 ] \operatorname{Var}[Z]=\mathbb{E}[|Z-\mathbb{E}[Z]|^2] Var [ Z ] = E [ ∣ Z − E [ Z ] ∣ 2 ] . If b b b is uniform independently of the matrix and tree randomness, then
E u n i f [ ∣ Z ( b ) ∣ 2 ] ≤ 10 k N . (14) \mathbb{E}_{\mathrm{unif}}[|Z(b)|^2]\le10kN. \tag*{(14)} E unif [ ∣ Z ( b ) ∣ 2 ] ≤ 10 k N . (14) For every tree node v v v , its list L v L_v L v in the construction without a storage limit satisfies E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N \mathbb{E}[|L_v|]\le(1+\varepsilon)N E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N .
Section § 3.5 proves Theorem 2.1 by accounting for shared intermediate entries and accidental linear dependencies among leaf vectors. With k = N o ( 1 ) k=N^{o(1)} k = N o ( 1 ) and ∣ Γ ∣ = N 1 − o ( 1 ) |\Gamma|=N^{1-o(1)} ∣Γ∣ = N 1 − o ( 1 ) , the LWE mean has magnitude N 1 − o ( 1 ) N^{1-o(1)} N 1 − o ( 1 ) , while the fluctuations in both cases have scale at most N 1 / 2 + o ( 1 ) N^{1/2+o(1)} N 1/2 + o ( 1 ) . The threshold near N 3 / 4 N^{3/4} N 3/4 separates these scales. Taking a magnitude also removes the unknown rotation ω k e 1 \omega^{ke_1} ω k e 1 contributed by the fixed first coordinates.
Lemma 2.2 (Decision from an accurate estimate). Suppose the moment bounds of Theorem 2.1 hold and 3 + 5 T / 4 ≤ N ∣ Γ ∣ / 2 3+5T/4\le N|\Gamma|/2 3 + 5 T /4 ≤ N ∣Γ∣/2 . Suppose the computed estimate satisfies P [ ∣ Z ~ − Z ∣ > T / 4 ] ≤ η \mathbb{P}[|\widetilde{Z}-Z|>T/4]\le\eta P [ ∣ Z − Z ∣ > T /4 ] ≤ η both under LWE with the fixed pair ( s , e ) (s,e) ( s , e ) and under uniform input, so η \eta η bounds the probability that the estimate differs from Z Z Z by more than T / 4 T/4 T /4 . The test returns LWE when ∣ Z ~ ∣ ≥ T |\widetilde{Z}|\ge T ∣ Z ∣ ≥ T and uniform otherwise. The subscripts below indicate the input model; probabilities include the uniform matrix, the algorithm’s random choices, and, in the uniform case, the independent uniform vector b b b . Its probability of returning uniform on an LWE input with the fixed pair ( s , e ) (s,e) ( s , e ) , and of returning LWE on a uniform input, respectively satisfy
P L W E [ ∣ Z ~ ∣ < T ] ≤ η + 64 k N ∣ Γ ∣ 2 , (15) \mathbb{P}_{\mathrm{LWE}}[|\widetilde{Z}|<T]\le\eta+\frac{64k}{N|\Gamma|^2}, \tag*{(15)} P LWE [ ∣ Z ∣ < T ] ≤ η + N ∣Γ ∣ 2 64 k , (15) P u n i f [ ∣ Z ~ ∣ ≥ T ] ≤ η + 160 k N 9 T 2 . (16) \mathbb{P}_{\mathrm{unif}}[|\widetilde{Z}|\ge T]\le\eta+\frac{160kN}{9T^2}. \tag*{(16)} P unif [ ∣ Z ∣ ≥ T ] ≤ η + 9 T 2 160 k N . (16)
We prove Lemma 2.2 in § 3.6 .
Theorem 2.4 bounds the probability of stopping because the stored-entry count would exceed K K K ; Corollary 2.5 therefore supplies the estimate condition with η = 2 n − 4 \eta=2n^{-4} η = 2 n − 4 . Lemma 2.6 shows that parameters can be set to satisfy ∣ Γ ∣ = N 1 − o ( 1 ) |\Gamma|=N^{1-o(1)} ∣Γ∣ = N 1 − o ( 1 ) and k = N o ( 1 ) k=N^{o(1)} k = N o ( 1 ) , which imply the threshold separation in Lemma 2.2 for sufficiently large n n n . Together these results give the following decision guarantee.
Proposition 2.3 (Bounded-secret decision). Fix κ > 0 \kappa>0 κ > 0 and C > min { 1 , 1 / κ } C>\min\{1,1/\kappa\} C > min { 1 , 1/ κ } . Let q = n κ + o ( 1 ) q=n^{\kappa+o(1)} q = n κ + o ( 1 ) be prime, let m ≥ C n / ln ln q m\ge Cn/\ln\ln q m ≥ C n / ln ln q be polynomial in n n n , and let public rational bounds 0 ≤ E s ≤ exp ( ( ln n ) o ( 1 ) ) 0\le E_s\le\exp((\ln n)^{o(1)}) 0 ≤ E s ≤ exp (( ln n ) o ( 1 ) ) and 0 ≤ E e ≤ n o ( 1 ) 0\le E_e\le n^{o(1)} 0 ≤ E e ≤ n o ( 1 ) have polynomial encoding length. For every fixed integer pair ( s , e ) ∈ Z n × Z m (s,e)\in\mathbb{Z}^n\times\mathbb{Z}^m ( s , e ) ∈ Z n × Z m with ∥ s ∥ ∞ ≤ E s \|s\|_\infty\le E_s ∥ s ∥ ∞ ≤ E s and ∥ e ∥ ∞ ≤ E e \|e\|_\infty\le E_e ∥ e ∥ ∞ ≤ E e , independent of uniform A A A , Algorithm 2 has error at most 3 n − 4 3n^{-4} 3 n − 4 for sufficiently large n n n . The same bound holds for uniformly random instances and for each fixed asymptotic growth of the public bounds throughout the stated parameter ranges.
We prove Proposition 2.3 in § 3.6 .
Time and space complexity
We measure time in bit operations and space in bits, including temporary storage. Thus the cost of arithmetic depends on the bit lengths of its operands.
The bucket merge, storage cap, and numerical evaluation turn the statistical test into an algorithm with bounded resources. The next theorem states their guarantees under explicit conditions on the parameters; its proof is in Section 4.
Theorem 2.4 (Total resources and numerical accuracy). Suppose the algorithm parameters are computable in polynomial time, have polynomial encoding length, and satisfy (12) . Assume q q q , m m m , and the encoding lengths of the public bounds are polynomial in n n n and, at every level,
log n = o ( L ) , 3 n i = N o ( 1 ) , N ρ i = N o ( 1 ) . (17) \log n = o(L), \qquad3^{n_i} = N^{o(1)}, \qquad N\rho_i = N^{o(1)}. \tag*{(17)} log n = o ( L ) , 3 n i = N o ( 1 ) , N ρ i = N o ( 1 ) . (17) Then Algorithm 2 terminates with probability 1 and uses worst-case space N 1 + o ( 1 ) N^{1+o(1)} N 1 + o ( 1 ) for every input, including temporary storage and all random sampling trials. For uniform A A A independent of the tree randomness, its expected running time is N 1 + o ( 1 ) N^{1+o(1)} N 1 + o ( 1 ) and the probability of exceeding the storage limit is at most 3 2 n − 4 \frac{3}{2}n^{-4} 2 3 n − 4 . When list construction finishes without exceeding the storage limit, evaluation and the final comparison use at most K poly ( n ) = N 1 + o ( 1 ) \mathrm{K}\,\operatorname{poly}(n) = N^{1+o(1)} K poly ( n ) = N 1 + o ( 1 ) time for every right-hand-side vector b b b .
When list construction finishes without exceeding the storage limit, ∣ Z ~ − Z ( b ) ∣ ≤ K 2 − P ≤ T / 4 \lvert\widetilde{Z}-Z(b)\rvert\le\mathrm{K}2^{-P} \le T/4 ∣ Z − Z ( b )∣ ≤ K 2 − P ≤ T /4 , and the squared-modulus comparison is exact, with equality returning LWE. These guarantees hold throughout any parameter range satisfying the hypotheses uniformly.
Corollary 2.5 (Accuracy of the decision statistic). Under the hypotheses of Theorem 2.4 , for uniform A A A independent of the tree randomness, the computed statistic satisfies
P [ ∣ Z ~ − Z ∣ > T / 4 ] ≤ 2 n − 4 , (18) \mathbb{P}\left[\lvert\widetilde{Z}-Z\rvert> T/4\right] \le2n^{-4}, \tag*{(18)} P [ ∣ Z − Z ∣ > T /4 ] ≤ 2 n − 4 , (18) both on LWE inputs with every fixed secret-error pair and on uniform inputs.
Proof. Outside storage overflow, the numerical error is at most T / 4 T/4 T /4 . The probability of overflow is at most 3 2 n − 4 ≤ 2 n − 4 \frac{3}{2}n^{-4} \le2n^{-4} 2 3 n − 4 ≤ 2 n − 4 by Theorem 2.4, and is the same in both input models because list construction does not use b b b .
Lemma 2.6 (Parameter choice). Fix κ > 0 \kappa> 0 κ > 0 and C > min { 1 , 1 / κ } C > \min\{1,1/\kappa\} C > min { 1 , 1/ κ } , and let q = n κ + o ( 1 ) q = n^{\kappa+o(1)} q = n κ + o ( 1 ) run through primes. For each fixed asymptotic growth of the public bounds and all sufficiently large n n n , the parameters chosen in Table 2 are computable in polynomial bit time for every integer dimension d d d and public rational bounds of polynomial encoding length satisfying
C n / ln ln q ≤ d ≤ n , 0 ≤ E s ≤ exp ( ( ln n ) o ( 1 ) ) , 0 ≤ E e ≤ n o ( 1 ) . (19) Cn/\ln\ln q \le d \le n, \qquad0 \le E_s \le\exp((\ln n)^{o(1)}), \qquad0 \le E_e \le n^{o(1)}. \tag*{(19)} C n / ln ln q ≤ d ≤ n , 0 ≤ E s ≤ exp (( ln n ) o ( 1 ) ) , 0 ≤ E e ≤ n o ( 1 ) . (19) All parameter checks pass, (12) and (17) hold, and
L = ( 1 2 + o ( 1 ) ) n ln ln q , k = N o ( 1 ) , ∣ Γ ∣ = N − o ( 1 ) . (20) L = \left(\frac{1}{2}+o(1)\right)\frac{n}{\ln\ln q}, \qquad k = N^{o(1)}, \qquad|\Gamma| = N^{-o(1)}. \tag*{(20)} L = ( 2 1 + o ( 1 ) ) ln ln q n , k = N o ( 1 ) , ∣Γ∣ = N − o ( 1 ) . (20) The estimate ∣ Γ ∣ = N − o ( 1 ) |\Gamma| = N^{-o(1)} ∣Γ∣ = N − o ( 1 ) holds for every fixed secret-error pair ( s , e ) (s,e) ( s , e ) with ∥ s ∥ ∞ ≤ E s \lVert s\rVert_\infty\le E_s ∥ s ∥ ∞ ≤ E s and ∥ e ∥ ∞ ≤ E e \lVert e\rVert_\infty\le E_e ∥ e ∥ ∞ ≤ E e . For each fixed asymptotic growth of the bounds, the estimates are uniform in d d d and the secret-error pair, including q < n q<n q < n and zero bounds.
Section 5.3 proves Lemma 2.6. Thus one invocation of the bounded-secret decision algorithm has expected running time and worst-case space 2 ( 1 / 2 + o ( 1 ) ) n / ln ln q 2^{(1/2+o(1))n/\ln\ln q} 2 ( 1/2 + o ( 1 )) n / l n l n q . The reductions below make polynomially many such invocations and execute them sequentially, so their time costs add in expectation and their workspace can be reused.
Proposition 2.7 (Resources across all calls). Under the hypotheses of Theorem 1.1 , the decision and search algorithms of § 2.5 have expected running time and worst-case space at most 2 ( 1 / 2 + o ( 1 ) ) n / ln ln q 2^{(1/2+o(1))n/\ln\ln q} 2 ( 1/2 + o ( 1 )) n / l n l n q . With probability at least 1 − 1 / n 1-1/n 1 − 1/ n , their running time is also at most 2 ( 1 / 2 + o ( 1 ) ) n / ln ln q 2^{(1/2+o(1))n/\ln\ln q} 2 ( 1/2 + o ( 1 )) n / l n l n q . They terminate with probability 1. These bounds include selecting and transforming the input equations, computing the parameters, all invocations of the bounded-secret decision algorithm, and all random sampling, including rejected draws. The high-probability time bound is a bound on runs taken to completion, so it introduces no additional correctness failure.
We prove Proposition 2.7 in § 4.4 .
Search and arbitrary secrets
Two standard transformations extend the bounded-secret decision algorithm to all the cases in the main theorem. Both use only the original input samples; search reuses these samples across all decision calls. Appendix § 7 verifies the adaptations for fixed secret-error pairs and the explicit failure bounds.
Recovering a bounded secret. Regev’s coordinate-guess transformation [29 full version, Lemma 4.2] tests a possible value σ \sigma σ of secret coordinate j j j by adding a fresh uniform w ∈ F q d w \in\mathbb{F}_q^d w ∈ F q d to row j j j of A A A and adding σ w \sigma w σ w to b b b . A correct guess preserves the LWE instance’s secret and errors; an incorrect guess makes the right-hand-side vector uniform given the perturbed matrix. Test each guess on a fresh perturbation of the same first d d d samples, using fresh decision randomness. Return the unique accepted value at each coordinate, reporting failure if it is missing or not unique.
Proposition 2.8 (Bounded-secret search). Under the hypotheses of Proposition 2.3, let S = { − ⌊ E s ⌋ , … , ⌊ E s ⌋ } S=\{-\lfloor E_s\rfloor,\ldots,\lfloor E_s\rfloor\} S = { − ⌊ E s ⌋ , … , ⌊ E s ⌋} be the set of candidate values for each secret coordinate. Search tests every σ ∈ S \sigma\in S σ ∈ S for every coordinate j = 1 , … , n j=1,\ldots,n j = 1 , … , n using the perturbation described above, the same first d = min { m , n } d=\min\{m,n\} d = min { m , n } original samples, and fresh randomness for each test. It returns the unique accepted value at each coordinate, reporting failure if there is none or more than one. The number of scheduled decision calls is
M c a l l s = n ∣ S ∣ = n ( 2 ⌊ E s ⌋ + 1 ) . (21) M_{\mathrm{calls}}=n|S|=n(2\lfloor E_s\rfloor+1). \tag*{(21)} M calls = n ∣ S ∣ = n ( 2 ⌊ E s ⌋ + 1 ) . (21)
For every fixed secret-error pair satisfying the bounds, failure or incorrect recovery has probability at most 3 M c a l l s n − 4 = n − 3 + o ( 1 ) 3M_{\mathrm{calls}}n^{-4}=n^{-3+o(1)} 3 M calls n − 4 = n − 3 + o ( 1 ) for sufficiently large n n n .
:::
We prove Proposition 2.8 in Appendix § 7 .§ 1 .
Replacing an arbitrary secret by errors. The normal-form transformation of Applebaum–Cash–Peikert–Sahai [2 Section 3.1, Lemma 2] uses an invertible block of original equations to make their errors the new secret, up to sign. We reserve the final n n n samples and test their matrix for invertibility once. On singularity, decision returns UNIFORM and search reports failure. Otherwise, apply normal form and use the bounded-secret algorithms with E s = E e = E E_s=E_e=E E s = E e = E .
Proposition 2.9 (Normal form using reserved samples). Let q q q be prime and m > n m>n m > n . There is a reduction, computable in time polynomial in the input length, from LWE with n n n secret coordinates, m m m equations, an arbitrary secret, and errors bounded by E E E to LWE with n n n secret coordinates, m − n m-n m − n equations, and both secret and errors bounded by E E E . It uses only the original samples and fails only when the matrix of the final n n n equations is singular, which happens with probability at most 1 / ( q − 1 ) 1/(q-1) 1/ ( q − 1 ) . For every fixed original secret-error pair independent of the uniform input matrix, conditional on any fixed invertible reserved matrix, the output matrix is uniform and the transformed secret-error pair is fixed. Uniform input remains uniform. A recovered transformed secret determines the original secret using the reserved equations.
Appendix A.2 proves Proposition 2.9 and gives the transformation and recovery formulas. The bounded-secret algorithms use only the first d = min { m − n , n } d=\min\{m-n,n\} d = min { m − n , n } transformed equations. Transforming just those equations is equivalent to transforming all m − n m-n m − n and then discarding the unused ones.
Corollary 2.10 (Arbitrary-secret decision and search). Fix κ > 0 \kappa>0 κ > 0 and C > min { 1 , 1 / κ } C>\min\{1,1/\kappa\} C > min { 1 , 1/ κ } . Let q = n κ + o ( 1 ) q=n^{\kappa+o(1)} q = n κ + o ( 1 ) be prime, let m ≥ n + C n / ln ln q m\ge n+Cn/\ln\ln q m ≥ n + C n / ln ln q be polynomial in n n n , and let the public rational bound 0 ≤ E ≤ exp ( ( ln n ) o ( 1 ) ) 0\le E\le\exp((\ln n)^{o(1)}) 0 ≤ E ≤ exp (( ln n ) o ( 1 ) ) have polynomial encoding length. For sufficiently large n n n , for every fixed secret s ∈ F q n s\in\mathbb{F}_q^n s ∈ F q n and fixed integer error vector e ∈ Z m e\in\mathbb{Z}^m e ∈ Z m with ∥ e ∥ ∞ ≤ E \lVert e\rVert_\infty\le E ∥ e ∥ ∞ ≤ E , independent of uniform A A A , normal form followed by bounded-secret decision or search with E s = E e = E E_s=E_e=E E s = E e = E has respective error bounds
3 n − 4 + 1 q − 1 , 3 n ( 2 ⌊ E ⌋ + 1 ) n − 4 + 1 q − 1 . (22) 3n^{-4}+\frac{1}{q-1},\qquad3n(2\lfloor E\rfloor+1)n^{-4}+\frac{1}{q-1}. \tag*{(22)} 3 n − 4 + q − 1 1 , 3 n ( 2 ⌊ E ⌋ + 1 ) n − 4 + q − 1 1 . (22) The same decision error bound holds for uniform input. Both algorithms use only the original samples; search keeps the reserved equations unchanged throughout its decision tests and recovery.
We prove Corollary 2.10 at the end of Appendix A.2.
Proof of Theorem 1.1. For bounded secrets and errors, apply Propositions 2.3 and 2.8; for arbitrary secrets, apply Corollary 2.10. All displayed error bounds tend to zero. Proposition 2.7 gives the total time, space, and termination guarantees. These bounds hold for every matrix-independent fixed secret-error pair, so averaging also allows any joint distribution satisfying the bounds and independent of the matrix.
Correctness under sample reuse
Algorithm 2 constructs coefficient-vector lists using A A A and fresh randomness. For the analysis, let L r o o t \mathcal{L}_{\mathrm{root}} L root be its root list without a storage limit and write Z ( b ) = ∑ z ∈ L r o o t ω ⟨ z , b ⟩ Z(b)=\sum_{z\in\mathcal{L}_{\mathrm{root}}}\omega^{\langle z,b\rangle} Z ( b ) = ∑ z ∈ L root ω ⟨ z , b ⟩ . Under LWE, we expect this sum to have mean close to N Γ N\Gamma N Γ , where Γ \Gamma Γ is the mean of one Fourier contribution in the ideal model with independent leaf vectors and independent uniform node images in their filter boxes. Correctness requires the fluctuations, and the statistic’s size under uniform input, to be small enough for the decision threshold to separate the two cases.
Moment bounds (Theorem 2.1). For uniform A A A independent of the tree randomness, under the theorem’s parameter hypotheses, including (2.10), the construction without a storage limit satisfies
∣ E L W E [ Z ( b ) ] − N Γ ∣ ≤ 3 N ε ≤ 3 , Var L W E [ Z ( b ) ] ≤ 16 k N , \left|\mathbb{E}_{\mathrm{LWE}}[Z(b)]-N\Gamma\right|\le3N\varepsilon\le3,\qquad\operatorname{Var}_{\mathrm{LWE}}[Z(b)]\le16kN, ∣ E LWE [ Z ( b )] − N Γ ∣ ≤ 3 N ε ≤ 3 , Var LWE [ Z ( b )] ≤ 16 k N , E u n i f [ ∣ Z ( b ) ∣ 2 ] ≤ 10 k N , E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N for every node v . \mathbb{E}_{\mathrm{unif}}\left[|Z(b)|^2\right]\le10kN,\qquad\mathbb{E}[|\mathcal{L}_v|]\le(1+\varepsilon)N\quad\text{for every node }v. E unif [ ∣ Z ( b ) ∣ 2 ] ≤ 10 k N , E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N for every node v . The LWE bounds hold for every secret-error pair fixed independently of the uniform matrix; the uniform bound holds when b b b is uniform independently of the matrix and tree randomness.
The terms of Z ( b ) Z(b) Z ( b ) can be dependent for two reasons. Two leaf selections may use the same leaf entries and hence share intermediate entries and entry randomness. Even leaf selections with no shared leaf entries use the same matrix, and a linear dependency among their leaf vectors can make several filters easier to pass. We account for shared entries by counting shared subtrees, and for the common matrix by bounding both the rarity of linear dependencies among leaf vectors and the advantage they give to survival.
Describing entries by leaf selections
For the analysis, describe a possible root entry by choosing one leaf entry from each leaf list. Denote the a a a th vector in list j j j by X j , a X_{j,a} X j , a , and write a = ( a 1 , … , a k ) ∈ [ N ] k a=(a_1,\ldots,a_k)\in[N]^k a = ( a 1 , … , a k ) ∈ [ N ] k for the leaf selection , a tuple of entry indices, where [ N ] = { 1 , … , N } [N]=\{1,\ldots,N\} [ N ] = { 1 , … , N } . These choices determine every intermediate sum, whether or not the entry is produced.
Denote the root node by root. For a node v v v , let h t ( v ) \mathrm{ht}(v) ht ( v ) be its level and I ( v ) ⊆ [ k ] I(v)\subseteq[k] I ( v ) ⊆ [ k ] the interval of leaf positions below it; in particular, I ( r o o t ) = [ k ] I(\mathrm{root})=[k] I ( root ) = [ k ] . Put
X a = ( X 1 , a 1 , … , X k , a k ) , z v ( a ) = ∑ j ∈ I ( v ) X j , a j . (23) X_a=(X_{1,a_1},\ldots,X_{k,a_k}),\qquad z_v(a)=\sum_{j\in I(v)}X_{j,a_j}. \tag*{(23)} X a = ( X 1 , a 1 , … , X k , a k ) , z v ( a ) = j ∈ I ( v ) ∑ X j , a j . (23)
The possible entry at v v v corresponding to a a a is identified by ( v , a ∣ I ( v ) ) (v,a|_{I(v)}) ( v , a ∣ I ( v ) ) . Restricting a a a to the two child subtrees determines its unique producing pair. Induction up the tree gives a one-to-one correspondence between possible entries at v v v and restricted leaf selections, even when different selections have equal vector sums. Every leaf vector has first coordinate one, so the first-coordinate invariant is
( z v ( a ) ) 1 = 2 h t ( v ) m o d q ≠ 0. (24) (z_v(a))_1=2^{\mathrm{ht}(v)}\bmod q\ne0. \tag*{(24)} ( z v ( a ) ) 1 = 2 ht ( v ) mod q = 0. (24)
The nonzero value follows from 2 h t ( v ) ≤ k < q 2^{\mathrm{ht}(v)}\le k<q 2 ht ( v ) ≤ k < q .
Represent the entry randomness for every possible internal entry by a Bernoulli subsampling variable U v , a ∣ I ( v ) U_{v,a|_{I(v)}} U v , a ∣ I ( v ) , equal to one with probability p h t ( v ) p_{\mathrm{ht}(v)} p ht ( v ) . These variables are mutually independent and independent of the leaf vectors and A A A . An entry’s variable is only used by the construction when its two children exist and their pair passes the filter. This lets us describe survival over a fixed family of leaf selections:
C a = ∏ v i n t e r n a l U v , a ∣ I ( v ) 1 { A h t ( v ) z v ( a ) ∈ [ − R h t ( v ) , R h t ( v ) ] n h t ( v ) m o d q } . (25) C_a=\prod_{v\ \mathrm{internal}}U_{v,a|_{I(v)}}\mathbf{1}\{A_{\mathrm{ht}(v)}z_v(a)\in[-R_{\mathrm{ht}(v)},R_{\mathrm{ht}(v)}]^{n_{\mathrm{ht}(v)}\bmod q}\}. \tag*{(25)} C a = v internal ∏ U v , a ∣ I ( v ) 1 { A ht ( v ) z v ( a ) ∈ [ − R ht ( v ) , R ht ( v ) ] n ht ( v ) mod q } . (25)
Thus C a = 1 C_a=1 C a = 1 precisely when all merges required by the leaf selection succeed. For any node v v v , let C v , a C_{v,a} C v , a denote the product in (25) restricted to the internal nodes in the subtree rooted at v v v , including v v v when it is internal. Then C v , a = 1 C_{v,a}=1 C v , a = 1 precisely when the restricted leaf selection a ∣ I ( v ) a|_{I(v)} a ∣ I ( v ) produces an entry at v v v ; for a leaf, the empty product is one. The Fourier statistic can now be written as
Z ( b ) = ∑ a ∈ [ N ] k C a ω ⟨ z r o o t ( a ) , b ⟩ . (26) Z(b)=\sum_{a\in[N]^k}C_a\omega^{\langle z_{\mathrm{root}}(a),b\rangle}. \tag*{(26)} Z ( b ) = a ∈ [ N ] k ∑ C a ω ⟨ z root ( a ) , b ⟩ . (26)
To control the fluctuations of Z ( b ) Z(b) Z ( b ) , we expand its second moment as a sum over ordered pairs of leaf selections:
E [ ∣ Z ( b ) ∣ 2 ] = ∑ a , a ′ ∈ [ N ] k E [ C a C a ′ ω ⟨ z r o o t ( a ) − z r o o t ( a ′ ) , b ⟩ ] . (27) \mathbb{E}[|Z(b)|^2]=\sum_{a,a'\in[N]^k}\mathbb{E}\left[C_aC_{a'}\omega^{\langle z_{\mathrm{root}}(a)-z_{\mathrm{root}}(a'),b\rangle}\right]. \tag*{(27)} E [ ∣ Z ( b ) ∣ 2 ] = a , a ′ ∈ [ N ] k ∑ E [ C a C a ′ ω ⟨ z root ( a ) − z root ( a ′ ) , b ⟩ ] . (27)
Each Fourier term has magnitude one, so the absolute value of a pair’s expected contribution is at most E [ C a C a ′ ] \mathbb{E}[C_aC_{a'}] E [ C a C a ′ ] , the probability that both selections survive. We therefore need to understand which merge decisions a pair shares.
Two leaf selections agreeing on every leaf entry below an internal node reuse the same intermediate entry, including its filter test and entry randomness. For example, in the four-leaf tree of Figure 1 , two leaf selections agreeing exactly in lists 1 and 2 share the first left merge. If they instead agree exactly in lists 1 and 3, they share two leaf entries but no internal entry. The arrangement of shared leaf entries determines which merge decisions are reused.
For the moment, suppose the distinct leaf vectors used by a pair are linearly independent. Its distinct merge decisions then succeed independently with probability ρ i p i = 1 / N \rho_i p_i=1/N ρ i p i = 1/ N each, by (5) . With no shared internal entry, the joint survival probability is N − 2 ( k − 1 ) N^{-2(k-1)} N − 2 ( k − 1 ) . Since there are N 2 k N^{2k} N 2 k ordered pairs of leaf selections in total, we use N 2 k N − 2 ( k − 1 ) = N 2 N^{2k}N^{-2(k-1)}=N^2 N 2 k N − 2 ( k − 1 ) = N 2 as the reference scale for the sum of pair-survival probabilities.
Of these N 2 k N^{2k} N 2 k pairs, exactly N 2 k − 2 N^{2k-2} N 2 k − 2 agree at two specified leaf positions; requiring no agreement elsewhere can only reduce this count. Thus each of the two sharing patterns above has a counting factor at most N − 2 N^{-2} N − 2 .
Sharing the entries in lists 1 and 2 also reuses one complete merge in their shared subtree: its filter and subsampling decision are required once rather than twice. Replacing two factors 1 / N 1/N 1/ N by one increases the joint survival probability by a factor N N N . Sharing the entries in lists 1 and 3 reuses no merge. Combining the counting and survival factors gives base weights N − 1 N^{-1} N − 1 for sharing lists 1 and 2 and N − 2 N^{-2} N − 2 for sharing lists 1 and 3. These weights bound the corresponding pair contributions after division by the reference scale N 2 N^2 N 2 , before accounting for linear dependencies among leaf vectors. Lemma 3.6 extends this count to arbitrary shared subtrees and includes the effect of those dependencies.
Table 1. Notation for the tree and its moment analysis.
The moment bounds
Use the leaf selections and survival indicators just defined. Enumerate the internal nodes as v 1 , … , v k − 1 v_1,\ldots,v_{k-1} v 1 , … , v k − 1 by increasing level and then from left to right. For a leaf selection a a a , define the ordered tuple of its node images by
Y a = ( A h t ( v 1 ) z v 1 ( a ) , … , A h t ( v k − 1 ) z v k − 1 ( a ) ) . (28) Y_a=\left(A^{\mathrm{ht}(v_1)}z_{v_1}(a),\ldots,A^{\mathrm{ht}(v_{k-1})}z_{v_{k-1}}(a)\right). \tag*{(28)} Y a = ( A ht ( v 1 ) z v 1 ( a ) , … , A ht ( v k − 1 ) z v k − 1 ( a ) ) . (28)
We prove the mean and variance bounds more generally for any fixed complex-valued contribution function g ( X , Y ) g(X,Y) g ( X , Y ) satisfying ∣ g ( X , Y ) ∣ ≤ 1 |g(X,Y)|\le1 ∣ g ( X , Y ) ∣ ≤ 1 for all inputs. For fixed integer secret and errors ( s , e ) ∈ Z n × Z d (s,e)\in\mathbb{Z}^n\times\mathbb{Z}^d ( s , e ) ∈ Z n × Z d , independent of A A A , the LWE contribution is obtained with
g ( ( x j ) j , ( y v ) v ) = ω ⟨ ∑ j x j , e ⟩ + ∑ i = 1 r ⟨ ∑ h t ( v ) = i y v , s ( i ) ⟩ . (29) g\left((x_j)_j,(y_v)_v\right)=\omega^{\left\langle\sum_j x_j,e\right\rangle+\sum_{i=1}^{r}\left\langle\sum_{\mathrm{ht}(v)=i}y_v,s^{(i)}\right\rangle}. \tag*{(29)} g ( ( x j ) j , ( y v ) v ) = ω ⟨ ∑ j x j , e ⟩ + ∑ i = 1 r ⟨ ∑ ht ( v ) = i y v , s ( i ) ⟩ . (29)
This function has absolute value one. Under LWE, substituting b = A T s + e b=A^{\mathsf{T}}s+e b = A T s + e gives ⟨ z r o o t ( a ) , b ⟩ = ⟨ z r o o t ( a ) , e ⟩ + ⟨ A z r o o t ( a ) , s ⟩ m o d q \langle z_{\mathrm{root}}(a),b\rangle=\langle z_{\mathrm{root}}(a),e\rangle+\langle Az_{\mathrm{root}}(a),s\rangle\ \mathrm{mod}\ q ⟨ z root ( a ) , b ⟩ = ⟨ z root ( a ) , e ⟩ + ⟨ A z root ( a ) , s ⟩ mod q . The level-i i i nodes partition the selected leaves, so their actual images sum to A i z r o o t ( a ) A_i z_{\mathrm{root}}(a) A i z root ( a ) . Hence g ( X a , Y a ) = ω ⟨ z r o o t ( a ) , b ⟩ g(X_a,Y_a)=\omega^{\langle z_{\mathrm{root}}(a),b\rangle} g ( X a , Y a ) = ω ⟨ z root ( a ) , b ⟩ . A surviving leaf selection contributes g ( X a , Y a ) g(X_a,Y_a) g ( X a , Y a ) , and a failed leaf selection contributes zero. Put
ξ a = C a g ( X a , Y a ) , Z g = ∑ a ∈ [ N ] k ξ a , Γ g = E [ g ( X ∗ , Y ∗ ) ] . (30) \xi_a=C_a g(X_a,Y_a),\qquad Z_g=\sum_{a\in[N]^k}\xi_a,\qquad\Gamma_g=\mathbb{E}[g(X^*,Y^*)]. \tag*{(30)} ξ a = C a g ( X a , Y a ) , Z g = a ∈ [ N ] k ∑ ξ a , Γ g = E [ g ( X ∗ , Y ∗ )] . (30)
Here ( X ∗ , Y ∗ ) (X^*,Y^*) ( X ∗ , Y ∗ ) is sampled from the ideal model for one leaf selection defined in § 2.3 . Recall that its leaf vectors are sampled independently from (3) , and its node images are independent uniform points in their respective filter boxes, independent of the leaf vectors. Thus, for this LWE contribution function, Γ g = Γ \Gamma_g=\Gamma Γ g = Γ from (11) .
The function g g g is the same for every leaf selection and depends only on its selected leaf vectors and node images; any additional parameters are fixed independently of the matrix, leaf vectors, and entry randomness. Thus every leaf selection has the same ideal mean Γ g \Gamma_g Γ g . We prove the mean and variance conclusions of Theorem 2.1 with Z g , Γ g Z_g,\Gamma_g Z g , Γ g in place of Z , Γ Z,\Gamma Z , Γ .
The proof has three steps. First we bound linear dependencies among leaf vectors, weighted by their advantage in passing the filters. Then we count pairs of leaf selections sharing subtrees. Finally we combine these bounds to control the mean, covariance, and uniform-case second moment. All sums count entries separately, including equal vector values.
The survival advantage of a linear dependency among leaf vectors
The wide intervals of the leaf distribution make linear dependencies rare, but a dependency can increase the chance of passing several filters. Proposition 3.1 bounds the probability that a sampled leaf vector lies in the affine subspace determined by earlier vectors and its fixed first coordinate. Proposition 3.2 bounds filter probabilities in terms of rank, while Proposition 3.3 identifies the conditional image distribution when the vectors are independent.
Proposition 3.1 (Affine-subspace concentration). Let x ∈ F q u x \in\mathbb{F}_q^u x ∈ F q u have independent coordinates, each taking any single value with probability at most ϑ ≤ 1 \vartheta\le1 ϑ ≤ 1 . For every fixed affine subspace of dimension at most t ≤ u t \le u t ≤ u , the probability that x x x lies in it is at most ϑ u − t \vartheta^{u-t} ϑ u − t .
Proof. For a nonempty affine subspace of dimension t ′ ≤ t t' \le t t ′ ≤ t , choose t ′ t' t ′ coordinates that determine its points uniquely. Conditional on these coordinates, membership forces each of the other u − t ′ u-t' u − t ′ coordinates to a single value, which it takes with probability at most ϑ \vartheta ϑ . Independence gives probability at most ϑ u − t ′ ≤ ϑ u − t \vartheta^{u-t'} \le\vartheta^{u-t} ϑ u − t ′ ≤ ϑ u − t ; the empty case is immediate. □ \square □
Proposition 3.2 (Filtering and rank). Fix a level i i i and vectors v 1 , … , v s ∈ F q d v_1,\ldots,v_s \in\mathbb{F}_q^d v 1 , … , v s ∈ F q d of rank t t t . For a uniform submatrix A i ∈ F q n i × d A_i \in\mathbb{F}_q^{n_i \times d} A i ∈ F q n i × d ,
P [ A i v j ∈ { − R i , … , R i } n i m o d q for all j ] ≤ ( W i / q ) n i t = ρ i t . (31) \mathbb{P}\left[A_i v_j \in\{-R_i,\ldots,R_i\}^{n_i \bmod q}\ \text{for all }j\right] \le\left(W_i/q\right)^{n_i t}=\rho_i^t. \tag*{(31)} P [ A i v j ∈ { − R i , … , R i } n i mod q for all j ] ≤ ( W i / q ) n i t = ρ i t . (31)
Proposition 3.3 (Independent images conditional on filtering). For fixed linearly independent vectors v 1 , … , v s ∈ F q d v_1,\ldots,v_s \in\mathbb{F}_q^d v 1 , … , v s ∈ F q d and a uniform submatrix A i ∈ F q n i × d A_i \in\mathbb{F}_q^{n_i \times d} A i ∈ F q n i × d , the images A i v 1 , … , A i v s A_i v_1,\ldots,A_i v_s A i v 1 , … , A i v s are independent and uniform on F q n i \mathbb{F}_q^{n_i} F q n i . Conditional on every image lying in { − R i , … , R i } n i m o d q \{-R_i,\ldots,R_i\}^{n_i \bmod q} { − R i , … , R i } n i mod q , they are independent and uniform in this box.
Proof of Propositions 3.2 and 3.3. Select t t t linearly independent vectors from the family. The linear map taking a uniform row to its inner products with those vectors is onto F q t \mathbb{F}_q^t F q t , so those inner products are independent uniform residues. The probability that all t t t selected inner products lie in { − R i , … , R i } \{-R_i,\ldots,R_i\} { − R i , … , R i } mod q q q is ( W i / q ) t (W_i/q)^t ( W i / q ) t ; requiring the remaining inner products to lie there can only decrease it. Multiplying over the n i n_i n i independent rows gives ( W i / q ) n i t = ρ i t (W_i/q)^{n_i t}=\rho_i^t ( W i / q ) n i t = ρ i t . If the whole family is linearly independent, the product uniform distribution gives independent uniform images, and conditioning it on the product filter box gives the stated conditional distribution. □ \square □
A linear dependency among the leaf vectors can lower the rank of the node sums at several levels. More generally, let the leaf vectors have rank deficiency ν \nu ν , meaning their rank is ν \nu ν less than their number. As shown in the pair-survival proof below, the node sums at each level lose at most ν \nu ν in rank. Each unit of rank deficiency in the node sums can increase the level-i i i filter probability by at most ρ i − 1 = N p i ≤ N \rho_i^{-1}=Np_i\le N ρ i − 1 = N p i ≤ N , by (5) and the parameter condition p i ≤ 1 p_i\le1 p i ≤ 1 stated there. Over r r r levels, the total survival advantage is therefore at most N r ν N^{r\nu} N r ν . The next lemma weights each possible rank deficiency by this survival advantage.
Lemma 3.4 (Linear dependencies among leaf vectors and their survival advantage). Under (12) , take any fixed collection of 1 ≤ J ≤ 2 k 1 \le J \le2^k 1 ≤ J ≤ 2 k distinct leaf entries. Let X X X be the d × J d \times J d × J matrix of their coefficient vectors, and let ν = J − rank X \nu= J - \operatorname{rank} X ν = J − rank X be their rank deficiency, the number of independent linear relations among these vectors. Thus ν = 0 \nu= 0 ν = 0 exactly when the selected leaf vectors are linearly independent. Then
E [ N r ν ] ≤ 1 + ε , E [ N r ν 1 { ν > 0 } ] ≤ ε 1 − N − r ≤ 2 ε . (32) \mathbb{E}[N^{r\nu}] \le1+\varepsilon,\qquad\mathbb{E}[N^{r\nu}\mathbf{1}_{\{\nu>0\}}] \le\frac{\varepsilon}{1-N^{-r}} \le2\varepsilon. \tag*{(32)} E [ N r ν ] ≤ 1 + ε , E [ N r ν 1 { ν > 0 } ] ≤ 1 − N − r ε ≤ 2 ε . (32) Also P [ ν > 0 ] ≤ ε / ( N r − 1 ) ≤ ε \mathbb{P}[\nu>0] \le\varepsilon/(N^r-1) \le\varepsilon P [ ν > 0 ] ≤ ε / ( N r − 1 ) ≤ ε .
Proof. Reveal the selected leaf vectors in a fixed order. Let I j I_j I j indicate that column j j j belongs to the span of its predecessors. The first column has first coordinate one, so I 1 = 0 I_1=0 I 1 = 0 . For j ≥ 2 j \ge2 j ≥ 2 , condition on the predecessor columns and let V V V be their span. A new column can lie in V V V only at a point whose first coordinate is one. Since V V V contains the first column, which has first coordinate one, fixing this coordinate removes exactly one degree of freedom from V V V . The allowed points therefore form an affine subspace of dimension dim ( V ) − 1 ≤ j − 2 \dim(V)-1 \le j-2 dim ( V ) − 1 ≤ j − 2 .
Ignoring the fixed first coordinate leaves an affine subspace of F q d − 1 \mathbb{F}_q^{d-1} F q d − 1 of the same dimension. By (3) , the remaining d − 1 d-1 d − 1 coordinates of the new column are independent of one another and of the predecessor columns. Each is uniform on the Q Q Q distinct residues from [ − B , B ] ∩ Z [-B,B]\cap\mathbb{Z} [ − B , B ] ∩ Z , so each residue has probability at most 1 / Q 1/Q 1/ Q . Conditional on the predecessor columns, I j = 1 I_j=1 I j = 1 exactly when these coordinates lie in that fixed affine subspace. Applying Proposition 3.1 with u = d − 1 u=d-1 u = d − 1 , t = j − 2 t=j-2 t = j − 2 , and ϑ = 1 / Q \vartheta=1/Q ϑ = 1/ Q gives
P [ I j = 1 ∣ X ⋅ , 1 , … , X ⋅ , j − 1 ] ≤ Q − ( d − j + 1 ) ≤ Q − D 0 . (33) \mathbb{P}[I_j=1\mid X_{\cdot,1},\ldots,X_{\cdot,j-1}] \le Q^{-(d-j+1)} \le Q^{-D_0}. \tag*{(33)} P [ I j = 1 ∣ X ⋅ , 1 , … , X ⋅ , j − 1 ] ≤ Q − ( d − j + 1 ) ≤ Q − D 0 . (33)
Each column lying in the span of its predecessors contributes one to ν \nu ν , so ν = ∑ j I j \nu=\sum_j I_j ν = ∑ j I j . Put λ = N r \lambda=N^r λ = N r . Since I j ∈ { 0 , 1 } I_j\in\{0,1\} I j ∈ { 0 , 1 } , we have λ I j = 1 + ( λ − 1 ) I j \lambda^{I_j}=1+(\lambda-1)I_j λ I j = 1 + ( λ − 1 ) I j , so (33) gives E [ λ I j ∣ X ⋅ , 1 , … , X ⋅ , j − 1 ] ≤ 1 + ( λ − 1 ) Q − D 0 \mathbb{E}[\lambda^{I_j}\mid X_{\cdot,1},\ldots,X_{\cdot,j-1}] \le1+(\lambda-1)Q^{-D_0} E [ λ I j ∣ X ⋅ , 1 , … , X ⋅ , j − 1 ] ≤ 1 + ( λ − 1 ) Q − D 0 . The earlier indicators are determined by the conditioned columns, so iterating conditional expectation from j = J j=J j = J down to j = 1 j=1 j = 1 gives
E [ λ ν ] ≤ ( 1 + ( λ − 1 ) Q − D 0 ) J ≤ exp ( 2 k N r Q − D 0 ) = e ε / 2 ≤ 1 + ε . (34) \mathbb{E}[\lambda^\nu] \le\left(1+(\lambda-1)Q^{-D_0}\right)^J \le\exp(2kN^rQ^{-D_0})=e^{\varepsilon/2}\le1+\varepsilon. \tag*{(34)} E [ λ ν ] ≤ ( 1 + ( λ − 1 ) Q − D 0 ) J ≤ exp ( 2 k N r Q − D 0 ) = e ε /2 ≤ 1 + ε . (34)
The last inequality follows from e x ≤ 1 + 2 x e^x\le1+2x e x ≤ 1 + 2 x for 0 ≤ x ≤ 1 0\le x\le1 0 ≤ x ≤ 1 and ε ≤ 1 / N \varepsilon\le1/N ε ≤ 1/ N .
To isolate the outcomes with ν > 0 \nu>0 ν > 0 , observe that λ ν − 1 \lambda^\nu-1 λ ν − 1 vanishes when ν = 0 \nu=0 ν = 0 . When ν > 0 \nu>0 ν > 0 , we have λ ν ≥ λ \lambda^\nu\ge\lambda λ ν ≥ λ , so 1 ≤ λ − 1 λ ν 1\le\lambda^{-1}\lambda^\nu 1 ≤ λ − 1 λ ν and hence λ ν − 1 ≥ ( 1 − λ − 1 ) λ ν \lambda^\nu-1\ge(1-\lambda^{-1})\lambda^\nu λ ν − 1 ≥ ( 1 − λ − 1 ) λ ν . Taking expectations and using (34) gives
( 1 − λ − 1 ) E [ λ ν 1 { ν > 0 } ] ≤ E [ λ ν − 1 ] ≤ ε . (35) (1-\lambda^{-1})\mathbb{E}[\lambda^\nu\mathbf{1}_{\{\nu>0\}}]\le\mathbb{E}[\lambda^\nu-1]\le\varepsilon. \tag*{(35)} ( 1 − λ − 1 ) E [ λ ν 1 { ν > 0 } ] ≤ E [ λ ν − 1 ] ≤ ε . (35)
This proves the weighted bound, and ( λ − 1 ) P [ ν > 0 ] ≤ E [ λ ν − 1 ] (\lambda-1)\mathbb{P}[\nu>0]\le\mathbb{E}[\lambda^\nu-1] ( λ − 1 ) P [ ν > 0 ] ≤ E [ λ ν − 1 ] proves the probability bound, since λ ≥ 2 \lambda\ge2 λ ≥ 2 . □
We apply Lemma 3.4 to the distinct leaf entries of a full leaf selection, a selection restricted to a subtree, or a pair of selections.
Shared subtrees and their weights
For two leaf selections a , a ′ ∈ [ N ] k a,a'\in[N]^k a , a ′ ∈ [ N ] k , define their agreement set by Sh ( a , a ′ ) = { j ∈ [ k ] : a j = a j ′ } \operatorname{Sh}(a,a')=\{j\in[k]:a_j=a'_j\} Sh ( a , a ′ ) = { j ∈ [ k ] : a j = a j ′ } . For every S ⊆ [ k ] S\subseteq[k] S ⊆ [ k ] , let c i ( S ) c_i(S) c i ( S ) count the level-i i i nodes v v v with I ( v ) ⊆ S I(v)\subseteq S I ( v ) ⊆ S , and let t ( S ) t(S) t ( S ) count the maximal subtrees whose leaves all lie in S S S , including isolated shared leaves. Put t ( ∅ ) = 0 t(\varnothing)=0 t ( ∅ ) = 0 .
Among all ordered pairs of leaf selections, a fraction N − ℓ N^{-\ell} N − ℓ agree throughout a specified subtree with ℓ \ell ℓ leaves. This subtree has ℓ − 1 \ell-1 ℓ − 1 internal nodes, so reusing its merge decisions increases joint survival by a factor N ℓ − 1 N^{\ell-1} N ℓ − 1 when the distinct leaf vectors are linearly independent. The reference scale N 2 = N 2 k N − 2 ( k − 1 ) N^2=N^{2k}N^{-2(k-1)} N 2 = N 2 k N − 2 ( k − 1 ) from Section 3.1 combines the ordered pair count with the baseline joint survival probability. Dividing by this scale leaves the subtree’s factor N − ℓ N ℓ − 1 = N − 1 N^{-\ell}N^{\ell-1}=N^{-1} N − ℓ N ℓ − 1 = N − 1 .
We will count one such factor for each maximal shared subtree, then include the additional survival advantage of rank deficiency.
Maximality means that we count a shared subtree at its highest shared node, without counting its descendants again. The example in Figure 2 has seven shared leaves and t ( S ) = 3 t(S)=3 t ( S ) = 3 .
Figure 2. Two leaf selections agree at positions S = { 2 , … , 8 } S=\{2,\ldots,8\} S = { 2 , … , 8 } . Their shared nodes are filled, and the three maximal shared subtrees are shaded. Agreement at seven leaf positions contributes a counting factor N − 7 N^{-7} N − 7 , while four reused merge decisions contribute a survival factor N 4 N^4 N 4 , giving base weight N − 3 N^{-3} N − 3 . Nested shared subtrees are not counted again.
Put p 0 = N 1 − k p_0=N^{1-k} p 0 = N 1 − k . For a fixed leaf selection with linearly independent leaf vectors, this is its survival probability: the k − 1 k-1 k − 1 internal nodes independently pass their filters and are kept, each with probability ρ i p i = 1 / N \rho_i p_i=1/N ρ i p i = 1/ N by (5) . The next bound combines the subtree count with the possible survival advantage from rank deficiencies among leaf vectors.
Proposition 3.5 (Shared-subtree identity). For every S ⊆ [ k ] S\subseteq[k] S ⊆ [ k ] ,
∑ i = 1 r c i ( S ) = ∣ S ∣ − t ( S ) . (36) \sum_{i=1}^{r}c_i(S)=|S|-t(S). \tag*{(36)} i = 1 ∑ r c i ( S ) = ∣ S ∣ − t ( S ) . (36)
Proof. The maximal shared subtrees partition S S S . A subtree with ℓ \ell ℓ leaves contains ℓ − 1 \ell-1 ℓ − 1 internal nodes, which proves (36) .
Lemma 3.6 (Shared-subtree pair bound). Under (12) , for every S ⊆ [ k ] S\subseteq[k] S ⊆ [ k ] ,
1 N 2 ∑ a , a ′ ∈ [ N ] k Sh ( a , a ′ ) = S E [ C a C a ′ ] ≤ ( 1 + ε ) N − t ( S ) . (37) \frac{1}{N^2}\sum_{\substack{a,a'\in[N]^k\\ \operatorname{Sh}(a,a')=S}}\mathbb{E}[C_aC_{a'}]\leq(1+\varepsilon)N^{-t(S)}. \tag*{(37)} N 2 1 a , a ′ ∈ [ N ] k Sh ( a , a ′ ) = S ∑ E [ C a C a ′ ] ≤ ( 1 + ε ) N − t ( S ) . (37)
Proof. Fix a pair a , a ′ a,a' a , a ′ with Sh ( a , a ′ ) = S \operatorname{Sh}(a,a')=S Sh ( a , a ′ ) = S . Compare their node sums in two copies of the tree, one for each selection. Let X X X be the d × J d\times J d × J matrix whose columns are the coefficient vectors of the J = 2 k − ∣ S ∣ J=2k-|S| J = 2 k − ∣ S ∣ distinct leaf entries, and put ν = J − rank X \nu=J-\operatorname{rank}X ν = J − rank X . A node sum is obtained by summing a subset of these columns. Represent that subset by its incidence vector h ∈ F q J h\in\mathbb{F}_q^J h ∈ F q J : the zero-one vector marking its selected leaf entries. Multiplication by X X X gives the node’s coefficient vector X h ∈ F q d Xh\in\mathbb{F}_q^d X h ∈ F q d . At level i i i , keep the incidence vectors from both copies, except that at each of the c i ( S ) c_i(S) c i ( S ) fully shared positions, they share the same incidence vector, so only one copy is kept. Therefore, we have 2 M i − c i ( S ) 2M_i-c_i(S) 2 M i − c i ( S ) incidence vectors. And here we show that they are linearly independent. Distinct node positions at this level have disjoint leaf intervals. Each position that is not fully shared therefore contains, in each copy, a private leaf entry that occurs in no other kept incidence vector. A leaf entry below a fully shared position occurs only in its one kept incidence vector. Suppose they are linearly dependent, then a linear combination of these incidence vectors is zero. Nevertheless, equating zero at these private coordinates requires that every coefficient of the linear combination is zero.
The kernel of the linear map h ↦ X h h\mapsto Xh h ↦ X h is ker ( X ) = { h ∈ F q J : X h = 0 } \ker(X)=\{h\in\mathbb{F}_q^J:Xh=0\} ker ( X ) = { h ∈ F q J : X h = 0 } . By the rank-nullity theorem, its dimension is dim ( ker ( X ) ) = J − rank X = ν \dim(\ker(X))=J-\operatorname{rank}X=\nu dim ( ker ( X )) = J − rank X = ν . Restricting this map to the span of the kept incidence vectors cannot increase its kernel dimension. If t i t_i t i is the rank of the resulting level-i i i node sums, multiplying the 2 M i − c i ( S ) 2M_i-c_i(S) 2 M i − c i ( S ) independent incidence vectors by X X X therefore gives t i ≥ 2 M i − c i ( S ) − ν t_i\geq2M_i-c_i(S)-\nu t i ≥ 2 M i − c i ( S ) − ν . Equal vector values at different leaf-entry indices contribute to the rank deficiency ν \nu ν ; we kept one copy only when the restricted leaf selections, and hence their incidence vectors, were fully shared and identical. For one leaf selection, or a leaf selection restricted to a subtree, the incidence vectors at each level have disjoint nonempty supports, and the same argument applies.
At level i i i , the pair uses exactly 2 M i − c i ( S ) 2M_i-c_i(S) 2 M i − c i ( S ) distinct subsampling variables, because it uses the same variable once at each fully shared node. Their probability of all equaling one is p i 2 M i − c i ( S ) p_i^{2M_i-c_i(S)} p i 2 M i − c i ( S ) . By Proposition 3.2 , conditional on X X X , the filter probability is at most ρ i t i ≤ ρ i 2 M i − c i ( S ) − ν \rho_i^{t_i} \le\rho_i^{2M_i-c_i(S)-\nu} ρ i t i ≤ ρ i 2 M i − c i ( S ) − ν . By (5) and the parameter condition p i ≤ 1 p_i \le1 p i ≤ 1 stated there, we have ρ i p i = 1 / N \rho_i p_i = 1/N ρ i p i = 1/ N and ρ i − 1 = N p i ≤ N \rho_i^{-1} = Np_i \le N ρ i − 1 = N p i ≤ N . The subsampling variables are independent of the matrix, and the submatrices for different levels are independent, so
E [ C a C a ′ ∣ X ] ≤ ∏ i = 1 r ρ i 2 M i − c i ( S ) − ν p i 2 M i − c i ( S ) = p 0 2 N ∑ i c i ( S ) ∏ i = 1 r ρ i − ν ≤ p 0 2 N ∑ i c i ( S ) N r ν . (38) \begin{aligned}
\mathbb{E}[C_aC_{a'}\mid X] &\le\prod_{i=1}^{r}\rho_i^{2M_i-c_i(S)-\nu}p_i^{2M_i-c_i(S)} \\
&=p_0^2N^{\sum_i c_i(S)}\prod_{i=1}^{r}\rho_i^{-\nu} \\
&\le p_0^2N^{\sum_i c_i(S)}N^{r\nu}. \tag*{(38)}
\end{aligned} E [ C a C a ′ ∣ X ] ≤ i = 1 ∏ r ρ i 2 M i − c i ( S ) − ν p i 2 M i − c i ( S ) = p 0 2 N ∑ i c i ( S ) i = 1 ∏ r ρ i − ν ≤ p 0 2 N ∑ i c i ( S ) N r ν . (38)
The middle equality uses p 0 = N 1 − k p_0=N^{1-k} p 0 = N 1 − k and ∑ i M i = k − 1 \sum_i M_i=k-1 ∑ i M i = k − 1 ; the last inequality uses ρ i − 1 ≤ N \rho_i^{-1}\le N ρ i − 1 ≤ N . There are exactly N k ( N − 1 ) k − ∣ S ∣ ≤ N 2 k − ∣ S ∣ N^k(N-1)^{k-|S|}\le N^{2k-|S|} N k ( N − 1 ) k − ∣ S ∣ ≤ N 2 k − ∣ S ∣ ordered pairs with Sh ( a , a ′ ) = S \operatorname{Sh}(a,a')=S Sh ( a , a ′ ) = S . The coefficient vectors of their distinct leaf entries have the same independent product distribution, regardless of the chosen indices. Multiplying (38) by this count and using N 2 k p 0 2 = N 2 N^{2k}p_0^2=N^2 N 2 k p 0 2 = N 2 leaves the factor N − ∣ S ∣ + ∑ i c i ( S ) = N − t ( S ) N^{-|S|+\sum_i c_i(S)}=N^{-t(S)} N − ∣ S ∣ + ∑ i c i ( S ) = N − t ( S ) , by Proposition 3.5 . Averaging over the leaf vectors and applying Lemma 3.4 proves (37) .
Proposition 3.7 (Total shared-forest weight). If 2 k ≤ N 2k\le N 2 k ≤ N , then
F r : = ∑ S ⊆ [ k ] N − t ( S ) ≤ e 2 k / N ≤ 1 + 4 k / N . (39) F_r:=\sum_{S\subseteq[k]}N^{-t(S)}\le e^{2k/N}\le1+4k/N. \tag*{(39)} F r := S ⊆ [ k ] ∑ N − t ( S ) ≤ e 2 k / N ≤ 1 + 4 k / N . (39) Proof. Put x = N − 1 x=N^{-1} x = N − 1 , and let V V V be the set of all 2 k − 1 2k-1 2 k − 1 nodes of the tree, leaves included. For S ⊆ [ k ] S\subseteq[k] S ⊆ [ k ] , let T ( S ) ⊆ V T(S)\subseteq V T ( S ) ⊆ V be the set of roots of its maximal shared subtrees, so ∣ T ( S ) ∣ = t ( S ) |T(S)|=t(S) ∣ T ( S ) ∣ = t ( S ) . Since S S S is the union of the leaves below T ( S ) T(S) T ( S ) , distinct sets S S S give distinct sets T ( S ) T(S) T ( S ) . Thus each term x t ( S ) x^{t(S)} x t ( S ) of F r F_r F r is a different term of ∑ T ⊆ V x ∣ T ∣ \sum_{T\subseteq V}x^{|T|} ∑ T ⊆ V x ∣ T ∣ , and the remaining terms are nonnegative. By the binomial theorem and 1 + x ≤ e x 1+x\le e^x 1 + x ≤ e x , F r ≤ ∑ T ⊆ V x ∣ T ∣ = ( 1 + x ) 2 k − 1 ≤ exp ( ( 2 k − 1 ) / N ) ≤ e 2 k / N F_r\le\sum_{T\subseteq V}x^{|T|}=(1+x)^{2k-1}\le\exp((2k-1)/N)\le e^{2k/N} F r ≤ ∑ T ⊆ V x ∣ T ∣ = ( 1 + x ) 2 k − 1 ≤ exp (( 2 k − 1 ) / N ) ≤ e 2 k / N . Apply e u ≤ 1 + 2 u e^u\le1+2u e u ≤ 1 + 2 u for 0 ≤ u ≤ 1 0\le u\le1 0 ≤ u ≤ 1 , using 2 k ≤ N 2k\le N 2 k ≤ N , to finish.
Summing (37) over nonempty S S S and multiplying by N 2 N^2 N 2 bounds all shared pairs by ( 1 + ε ) N 2 ( F r − 1 ) (1+\varepsilon)N^2(F_r-1) ( 1 + ε ) N 2 ( F r − 1 ) ; the empty set contributes 1 1 1 to F r F_r F r . This includes the case a = a ′ a=a' a = a ′ , for which S = [ k ] S=[k] S = [ k ] is one maximal shared subtree and ∑ a E [ C a ] ≤ ( 1 + ε ) N \sum_a\mathbb{E}[C_a]\le(1+\varepsilon)N ∑ a E [ C a ] ≤ ( 1 + ε ) N . The count uses indices: equal values at different leaf-entry indices remain separate and contribute to ν \nu ν , rather than to t ( S ) t(S) t ( S ) .
Comparing the actual and ideal means, covariance, and the uniform case
For a fixed leaf selection with linearly independent leaf vectors, the actual node images are independent uniform field vectors, by Proposition 3.3 and independence of the level submatrices. Conditional on survival, they are independent and uniform in their filter boxes, just as in the ideal model with those leaf vectors held fixed. We therefore compare the actual conditional mean E [ ξ a ∣ X a ] \mathbb{E}[\xi_a\mid X_a] E [ ξ a ∣ X a ] with p 0 p_0 p 0 times the ideal mean for the same leaf vectors, before averaging over the leaf vectors. These quantities agree when the leaf vectors are linearly independent. For leaf vectors with a linear dependency, Lemma 3.4 bounds their contribution to the mean discrepancy by accounting for their survival advantage.
For the variance, we separate pairs that share leaf entries from pairs that do not. The shared-subtree bound handles the former. For disjoint selections, their independently sampled leaf vectors allow us to express the covariance using only cases where the 2 k 2k 2 k selected vectors have a linear dependency.
Proof of Theorem 2.1. The mean and list sizes. Recall that C a C_a C a indicates survival, ξ a = C a g ( X a , Y a ) \xi_a = C_a g(X_a,Y_a) ξ a = C a g ( X a , Y a ) with ∣ g ∣ ≤ 1 |g| \le1 ∣ g ∣ ≤ 1 , and p 0 = N 1 − k p_0 = N^{1-k} p 0 = N 1 − k is the survival probability for linearly independent leaf vectors. Let ν \nu ν be the rank deficiency of the k k k selected leaf vectors. The argument for (38) , applied to one selection, gives
E [ C a ∣ X a ] ≤ p 0 N r ν , ∣ E [ ξ a ∣ X a ] ∣ ≤ p 0 N r ν , (40) \mathbb{E}[C_a \mid X_a] \le p_0N^{r\nu}, \qquad|\mathbb{E}[\xi_a \mid X_a]| \le p_0N^{r\nu}, \tag*{(40)} E [ C a ∣ X a ] ≤ p 0 N r ν , ∣ E [ ξ a ∣ X a ] ∣ ≤ p 0 N r ν , (40)
If ν = 0 \nu= 0 ν = 0 , Proposition 3.3 gives independent uniform node images at each level; different levels use independent submatrices. Conditional on all filters passing, these images are therefore independent uniform filter-box vectors. Requiring the independent subsampling variables to equal one changes no image distribution. Consequently, for these fixed leaf vectors,
E [ ξ a ∣ X a ] = p 0 γ ( X a ) , γ ( X a ) = E Y ∗ [ g ( X a , Y ∗ ) ] , ∣ γ ( X a ) ∣ ≤ 1. (41) \mathbb{E}[\xi_a \mid X_a] = p_0\gamma(X_a), \qquad\gamma(X_a) = \mathbb{E}_{Y^*}[g(X_a,Y^*)], \qquad|\gamma(X_a)| \le1. \tag*{(41)} E [ ξ a ∣ X a ] = p 0 γ ( X a ) , γ ( X a ) = E Y ∗ [ g ( X a , Y ∗ )] , ∣ γ ( X a ) ∣ ≤ 1. (41)
Here Y ∗ = ( Y v ∗ ) v Y^* = (Y_v^*)_v Y ∗ = ( Y v ∗ ) v internal has mutually independent node images, independent of the leaf vectors, with Y v ∗ Y_v^* Y v ∗ uniform in { − R i , … , R i } n i m o d q \{-R_i,\ldots,R_i\}^{n_i}\bmod q { − R i , … , R i } n i mod q when ht ( v ) = i \operatorname{ht}(v)=i ht ( v ) = i . Thus γ \gamma γ averages over these ideal images while holding its leaf-vector argument fixed. Averaging next over the sampled leaf vectors gives E [ γ ( X a ) ] = Γ g \mathbb{E}[\gamma(X_a)] = \Gamma_g E [ γ ( X a )] = Γ g . To compare the means, subtract p 0 γ ( X a ) p_0\gamma(X_a) p 0 γ ( X a ) from E [ ξ a ∣ X a ] \mathbb{E}[\xi_a \mid X_a] E [ ξ a ∣ X a ] before averaging over the leaf vectors. The difference vanishes when ν = 0 \nu= 0 ν = 0 and has absolute value at most p 0 ( N r ν + 1 ) p_0(N^{r\nu}+1) p 0 ( N r ν + 1 ) when ν > 0 \nu> 0 ν > 0 . Using (40) and Lemma 3.4 , we obtain the magnitude bound and the mean comparison
∣ E [ ξ a ] ∣ ≤ E [ C a ] ≤ p 0 E [ N r ν ] ≤ p 0 ( 1 + ε ) , ∣ E [ ξ a ] − p 0 Γ g ∣ ≤ p 0 ( E [ N r ν 1 { ν > 0 } ] + P [ ν > 0 ] ) ≤ 3 p 0 ε . (42) \begin{aligned}
|\mathbb{E}[\xi_a]| &\le\mathbb{E}[C_a] \le p_0\mathbb{E}[N^{r\nu}] \le p_0(1+\varepsilon),\\
|\mathbb{E}[\xi_a]-p_0\Gamma_g| &\le p_0\left(\mathbb{E}[N^{r\nu}\mathbf{1}_{\{\nu>0\}}]+\mathbb{P}[\nu>0]\right)\le3p_0\varepsilon. \tag*{(42)}
\end{aligned} ∣ E [ ξ a ] ∣ ∣ E [ ξ a ] − p 0 Γ g ∣ ≤ E [ C a ] ≤ p 0 E [ N r ν ] ≤ p 0 ( 1 + ε ) , ≤ p 0 ( E [ N r ν 1 { ν > 0 } ] + P [ ν > 0 ] ) ≤ 3 p 0 ε . (42)
Summing over the N k N^k N k leaf selections gives the mean assertion of Theorem 2.1, with Z g , Γ g Z_g,\Gamma_g Z g , Γ g in place of Z , Γ Z,\Gamma Z , Γ . A leaf selection restricted to a subtree rooted at level j j j has 2 j 2^j 2 j leaf vectors and 2 j − 1 2^j-1 2 j − 1 internal nodes. Its conditional survival probability is at most N 1 − 2 j N j ν ≤ N 1 − 2 j N r ν N^{1-2^j}N^{j\nu}\le N^{1-2^j}N^{r\nu} N 1 − 2 j N j ν ≤ N 1 − 2 j N r ν . Summing over its N 2 j N^{2^j} N 2 j possible leaf selections gives
E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N . (43) \mathbb{E}[|L_v|]\le(1+\varepsilon)N. \tag*{(43)} E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N . (43)
Leaf lists have size exactly N N N , so this proves the list-size bound at every node.
Covariance of disjoint leaf selections. Suppose a , a ′ a,a' a , a ′ share no leaf entries. Their two groups of selected leaf vectors are statistically independent, although their contributions use the same matrix. Define their conditional means and joint moment by
m a ( X a ) = E [ ξ a ∣ X a ] , m a ′ ( X a ′ ) = E [ ξ a ′ ∣ X a ′ ] , m_a(X_a)=\mathbb{E}[\xi_a\mid X_a], \qquad m_{a'}(X_{a'})=\mathbb{E}[\xi_{a'}\mid X_{a'}], m a ( X a ) = E [ ξ a ∣ X a ] , m a ′ ( X a ′ ) = E [ ξ a ′ ∣ X a ′ ] ,
J a , a ′ ( X a , X a ′ ) = E [ ξ a ξ a ′ ‾ ∣ X a , X a ′ ] . (44) \mathcal{J}_{a,a'}(X_a,X_{a'})=\mathbb{E}[\xi_a\overline{\xi_{a'}}\mid X_a,X_{a'}]. \tag*{(44)} J a , a ′ ( X a , X a ′ ) = E [ ξ a ξ a ′ ∣ X a , X a ′ ] . (44)
Regard X a X_a X a and X a ′ X_{a'} X a ′ as matrices with the selected leaf vectors as columns, and let ν = 2 k − rank [ X a X a ′ ] \nu=2k-\operatorname{rank}[X_a\ X_{a'}] ν = 2 k − rank [ X a X a ′ ] be the rank deficiency of all 2 k 2k 2 k vectors from the two selections. For fixed leaf vectors with ν = 0 \nu=0 ν = 0 , the node images from both selections are independent at each level by Proposition 3.3 ; submatrices at distinct levels and the two selections’ families of subsampling variables are also independent. Their contributions are therefore conditionally independent, giving
J a , a ′ ( X a , X a ′ ) = m a ( X a ) m a ′ ( X a ′ ) ‾ ( ν = 0 ) . (45) \mathcal{J}_{a,a'}(X_a,X_{a'})=m_a(X_a)\overline{m_{a'}(X_{a'})}\qquad(\nu=0). \tag*{(45)} J a , a ′ ( X a , X a ′ ) = m a ( X a ) m a ′ ( X a ′ ) ( ν = 0 ) . (45)
Each conditional mean is a function only of its own selected leaf vectors. Since disjoint selections use independently sampled leaf entries, X a X_a X a and X a ′ X_{a'} X a ′ are independent. Averaging over these leaf vectors therefore gives
E [ m a ( X a ) m a ′ ( X a ′ ) ‾ ] = E [ m a ( X a ) ] E [ m a ′ ( X a ′ ) ‾ ] = E [ ξ a ] E [ ξ a ′ ‾ ] . (46) \begin{aligned}
\mathbb{E}[m_a(X_a)\overline{m_{a'}(X_{a'})}] &= \mathbb{E}[m_a(X_a)]\mathbb{E}[\overline{m_{a'}(X_{a'})}]\\
&=\mathbb{E}[\xi_a]\mathbb{E}[\overline{\xi_{a'}}]. \tag*{(46)}
\end{aligned} E [ m a ( X a ) m a ′ ( X a ′ ) ] = E [ m a ( X a )] E [ m a ′ ( X a ′ ) ] = E [ ξ a ] E [ ξ a ′ ] . (46)
Write Cov ( ξ , ξ ′ ) = E [ ξ ξ ′ ‾ ] − E [ ξ ] E [ ξ ′ ‾ ] \operatorname{Cov}(\xi,\xi')=\mathbb{E}[\xi\overline{\xi'}]-\mathbb{E}[\xi]\mathbb{E}[\overline{\xi'}] Cov ( ξ , ξ ′ ) = E [ ξ ξ ′ ] − E [ ξ ] E [ ξ ′ ] for the covariance. Averaging (44) gives E [ J a , a ′ ] = E [ ξ a ξ a ′ ‾ ] \mathbb{E}[J_{a,a'}]=\mathbb{E}[\xi_a\overline{\xi_{a'}}] E [ J a , a ′ ] = E [ ξ a ξ a ′ ] . Subtracting (46) and using (45) then gives
Cov ( ξ a , ξ a ′ ) = E [ J a , a ′ − m a m a ′ ‾ ] = E [ ( J a , a ′ − m a m a ′ ‾ ) 1 { ν > 0 } ] . (47) \begin{aligned}
\operatorname{Cov}(\xi_a,\xi_{a'}) &= \mathbb{E}[J_{a,a'}-m_a\overline{m_{a'}}] \\
&= \mathbb{E}[(J_{a,a'}-m_a\overline{m_{a'}})\mathbf{1}_{\{\nu>0\}}]. \tag*{(47)}
\end{aligned} Cov ( ξ a , ξ a ′ ) = E [ J a , a ′ − m a m a ′ ] = E [( J a , a ′ − m a m a ′ ) 1 { ν > 0 } ] . (47)
We now bound the two terms on the event ν > 0 \nu>0 ν > 0 . By (38) with S = ∅ S=\varnothing S = ∅ , ∣ J a , a ′ ∣ ≤ p 0 2 N r ν |J_{a,a'}|\le p_0^2N^{r\nu} ∣ J a , a ′ ∣ ≤ p 0 2 N r ν . To bound the product of conditional means, apply the single-selection bound to each selection separately. Let ν 1 = k − rank X a \nu_1=k-\operatorname{rank}X_a ν 1 = k − rank X a and ν 2 = k − rank X a ′ \nu_2=k-\operatorname{rank}X_{a'} ν 2 = k − rank X a ′ be their individual rank deficiencies. By (40) , ∣ m a m a ′ ‾ ∣ ≤ p 0 2 N r ( ν 1 + ν 2 ) |m_a\overline{m_{a'}}|\le p_0^2N^{r(\nu_1+\nu_2)} ∣ m a m a ′ ∣ ≤ p 0 2 N r ( ν 1 + ν 2 ) . We compare this weight with the pair’s weight using rank subadditivity:
ν 1 + ν 2 = 2 k − rank X a − rank X a ′ ≤ 2 k − rank [ X a X a ′ ] = ν . (48) \nu_1+\nu_2=2k-\operatorname{rank}X_a-\operatorname{rank}X_{a'}\le2k-\operatorname{rank}[X_a\ X_{a'}]=\nu. \tag*{(48)} ν 1 + ν 2 = 2 k − rank X a − rank X a ′ ≤ 2 k − rank [ X a X a ′ ] = ν . (48)
Consequently, ∣ m a m a ′ ‾ ∣ ≤ p 0 2 N r ν |m_a\overline{m_{a'}}|\le p_0^2N^{r\nu} ∣ m a m a ′ ∣ ≤ p 0 2 N r ν as well. Applying Lemma 3.4 to the two terms in (47) yields
∣ Cov ( ξ a , ξ a ′ ) ∣ ≤ 2 p 0 2 E [ N r ν 1 { ν > 0 } ] ≤ 4 p 0 2 ε . (49) |\operatorname{Cov}(\xi_a,\xi_{a'})|\le2p_0^2\mathbb{E}[N^{r\nu}\mathbf{1}_{\{\nu>0\}}]\le4p_0^2\varepsilon. \tag*{(49)} ∣ Cov ( ξ a , ξ a ′ ) ∣ ≤ 2 p 0 2 E [ N r ν 1 { ν > 0 } ] ≤ 4 p 0 2 ε . (49)
There are at most N 2 k N^{2k} N 2 k disjoint ordered pairs, so their total absolute covariance is at most 4 N 2 ε 4N^2\varepsilon 4 N 2 ε .
Covariance of selections sharing leaf entries. Here we bound both terms in the covariance separately. For the joint moment, ∣ ξ a ξ a ′ ∣ ≤ C a C a ′ |\xi_a\xi_{a'}|\le C_aC_{a'} ∣ ξ a ξ a ′ ∣ ≤ C a C a ′ , so Lemma 3.6 and Proposition 3.7 give
∑ a , a ′ ∈ [ N ] k Sh ( a , a ′ ) ≠ ∅ ∣ E [ ξ a ξ a ′ ‾ ] ∣ ≤ ( 1 + ε ) N 2 ( F r − 1 ) ≤ 8 k N . (50) \sum_{\substack{a,a'\in[N]^k\\ \operatorname{Sh}(a,a')\ne\varnothing}}|\mathbb{E}[\xi_a\overline{\xi_{a'}}]|\le(1+\varepsilon)N^2(F_r-1)\le8kN. \tag*{(50)} a , a ′ ∈ [ N ] k Sh ( a , a ′ ) = ∅ ∑ ∣ E [ ξ a ξ a ′ ] ∣ ≤ ( 1 + ε ) N 2 ( F r − 1 ) ≤ 8 k N . (50)
For the product of the individual means, exactly a fraction 1 − ( 1 − 1 / N ) k ≤ k / N 1-(1-1/N)^k\le k/N 1 − ( 1 − 1/ N ) k ≤ k / N of ordered pairs share at least one leaf entry. Using (42) for each individual mean gives
∑ a , a ′ ∈ [ N ] k Sh ( a , a ′ ) ≠ ∅ ∣ E [ ξ a ] E [ ξ a ′ ‾ ] ∣ ≤ ( 1 + ε ) 2 k N ≤ 4 k N . (51) \sum_{\substack{a,a'\in[N]^k\\ \operatorname{Sh}(a,a')\ne\varnothing}}|\mathbb{E}[\xi_a]\mathbb{E}[\overline{\xi_{a'}}]|\le(1+\varepsilon)^2kN\le4kN. \tag*{(51)} a , a ′ ∈ [ N ] k Sh ( a , a ′ ) = ∅ ∑ ∣ E [ ξ a ] E [ ξ a ′ ] ∣ ≤ ( 1 + ε ) 2 k N ≤ 4 k N . (51)
Expanding the variance as the sum of all ordered covariances and bounding each by its absolute value, the disjoint total of (49) together with (50) and (51) now gives
Var [ Z g ] ≤ 4 N 2 ε + 8 k N + 4 k N ≤ 4 N + 12 k N ≤ 16 k N . (52) \operatorname{Var}[Z_g]\le4N^2\varepsilon+8kN+4kN\le4N+12kN\le16kN. \tag*{(52)} Var [ Z g ] ≤ 4 N 2 ε + 8 k N + 4 k N ≤ 4 N + 12 k N ≤ 16 k N . (52)
The last inequalities use ε ≤ 1 / N ≤ 1 \varepsilon\le1/N\le1 ε ≤ 1/ N ≤ 1 and 2 k ≤ N 2k\le N 2 k ≤ N .
The uniform case. Fix the matrix, leaf vectors, and entry randomness, so that C a C_a C a and z root ( a ) z_{\operatorname{root}}(a) z root ( a ) are fixed for every leaf selection. Averaging only over the independent uniform vector b b b gives
E b [ ∣ Z ( b ) ∣ 2 ] = ∑ a , a ′ ∈ [ N ] k C a C a ′ E b [ ω ⟨ z root ( a ) − z root ( a ′ ) , b ⟩ ] = ∑ a , a ′ ∈ [ N ] k C a C a ′ 1 { z root ( a ) = z root ( a ′ ) } . (53) \begin{aligned}
\mathbb{E}_b[|Z(b)|^2]
&=\sum_{a,a'\in[N]^k}C_aC_{a'}\mathbb{E}_b[\omega^{\langle z_{\operatorname{root}}(a)-z_{\operatorname{root}}(a'),b\rangle}]\\
&=\sum_{a,a'\in[N]^k}C_aC_{a'}\mathbf{1}_{\{z_{\operatorname{root}}(a)=z_{\operatorname{root}}(a')\}}. \tag*{(53)}
\end{aligned} E b [ ∣ Z ( b ) ∣ 2 ] = a , a ′ ∈ [ N ] k ∑ C a C a ′ E b [ ω ⟨ z root ( a ) − z root ( a ′ ) , b ⟩ ] = a , a ′ ∈ [ N ] k ∑ C a C a ′ 1 { z root ( a ) = z root ( a ′ )} . (53)
If z root ( a ) = z root ( a ′ ) z_{\operatorname{root}}(a)=z_{\operatorname{root}}(a') z root ( a ) = z root ( a ′ ) , the Fourier term equals one. Otherwise, some coordinate of z root ( a ) − z root ( a ′ ) z_{\operatorname{root}}(a)-z_{\operatorname{root}}(a') z root ( a ) − z root ( a ′ ) is nonzero, and the corresponding uniform coordinate of b b b makes the exponent uniform in F q \mathbb{F}_q F q . Its average is therefore ( 1 / q ) ∑ t = 0 q − 1 ω t = 0 (1/q)\sum_{t=0}^{q-1}\omega^t=0 ( 1/ q ) ∑ t = 0 q − 1 ω t = 0 . For pairs sharing leaf entries, discard the equality indicator and use Lemma 3.6 and Proposition 3.7. Their contribution is at most ( 1 + ε ) N 2 ( F r − 1 ) ≤ 8 k N (1+\varepsilon)N^2(F_r-1)\le8kN ( 1 + ε ) N 2 ( F r − 1 ) ≤ 8 k N , including the case a = a ′ a=a' a = a ′ . For disjoint leaf selections, a collision between root vectors implies
[ X a X a ′ ] ( 1 , … , 1 , − 1 , … , − 1 ) T = 0. (54) [X_a\ X_{a'}](1,\ldots,1,-1,\ldots,-1)^{\mathsf{T}}=0. \tag*{(54)} [ X a X a ′ ] ( 1 , … , 1 , − 1 , … , − 1 ) T = 0. (54)
The displayed coefficient vector is nonzero on distinct indexed columns, so a collision forces ν > 0 \nu>0 ν > 0 . The conditional pair bound (38) and Lemma 3.4 give at most 2 p 0 2 ε 2p_0^2\varepsilon 2 p 0 2 ε per disjoint pair, hence at most 2 N 2 ε ≤ 2 N 2N^2\varepsilon\le2N 2 N 2 ε ≤ 2 N in total. Thus E u n i f [ ∣ Z ( b ) ∣ 2 ] ≤ 8 k N + 2 N ≤ 10 k N \mathbb{E}_{\mathrm{unif}}[|Z(b)|^2]\le8kN+2N\le10kN E unif [ ∣ Z ( b ) ∣ 2 ] ≤ 8 k N + 2 N ≤ 10 k N . Equal values at different leaf-entry indices are included in this linear-dependence bound. ∄รดิต
Applying the moments to decision
The Fourier character for LWE. For a secret-error pair fixed independently of the matrix, the function g g g in (29) satisfies Z g = Z ( b ) Z_g = Z(b) Z g = Z ( b ) and Γ g = Γ \Gamma_g = \Gamma Γ g = Γ , whose product formula is given in (74) . Taking this contribution function gives the LWE mean and variance in Theorem 2.1; the uniform-case bound applies directly to (8) . We now use these moments to prove the decision bounds stated in § 2.3 .
Proof of Lemma 2.2. For LWE, on the event ∣ Z ~ − Z ∣ ≤ T / 4 |\widetilde{Z} - Z| \le T/4 ∣ Z − Z ∣ ≤ T /4 , returning UNIFORM implies ∣ Z ∣ < 5 T / 4 |Z| < 5T/4 ∣ Z ∣ < 5 T /4 . Since ∣ E [ Z ] ∣ ≥ N ∣ Γ ∣ − 3 |\mathbb{E}[Z]| \ge N|\Gamma| - 3 ∣ E [ Z ] ∣ ≥ N ∣Γ∣ − 3 , the threshold condition forces ∣ Z − E [ Z ] ∣ ≥ N ∣ Γ ∣ / 2 |Z - \mathbb{E}[Z]| \ge N|\Gamma|/2 ∣ Z − E [ Z ] ∣ ≥ N ∣Γ∣/2 . Chebyshev’s inequality bounds the probability of this deviation by 64 k / ( N ∣ Γ ∣ 2 ) 64k/(N|\Gamma|^2) 64 k / ( N ∣Γ ∣ 2 ) . A union bound with the accuracy-failure event, whose probability is at most η \eta η , gives (15) .
For the uniform case, on the event ∣ Z ~ − Z ∣ ≤ T / 4 |\widetilde{Z} - Z| \le T/4 ∣ Z − Z ∣ ≤ T /4 , returning LWE implies ∣ Z ∣ ≥ 3 T / 4 |Z| \ge3T/4 ∣ Z ∣ ≥ 3 T /4 . Markov’s inequality applied to ∣ Z ∣ 2 |Z|^2 ∣ Z ∣ 2 bounds this event by 160 k N / ( 9 T 2 ) 160kN/(9T^2) 160 k N / ( 9 T 2 ) . A union bound with the accuracy-failure event gives (16) .
Proof of Proposition 2.3. Work with the first d = min { m , n } d = \min\{m,n\} d = min { m , n } samples. For sufficiently large n n n , C n / ln ln q ≤ d ≤ n Cn/\ln\ln q \le d \le n C n / ln ln q ≤ d ≤ n , so Lemma 2.6 verifies the parameter checks and hypotheses of Theorem 2.1. For each fixed secret-error pair, that theorem gives the LWE mean and variance in (13) and the uniform-case bound in (14) .
Separating the scales. The parameter choice gives ∣ Γ ∣ = N − o ( 1 ) |\Gamma| = N^{-o(1)} ∣Γ∣ = N − o ( 1 ) and k = N o ( 1 ) k = N^{o(1)} k = N o ( 1 ) throughout the stated parameter range. With the threshold in (9) ,
N 3 / 4 ≤ T < 2 N 3 / 4 , 3 + 5 T / 4 ≤ N ∣ Γ ∣ / 2 (55) N^{3/4} \le T < 2N^{3/4}, \qquad3 + 5T/4 \le N|\Gamma|/2 \tag*{(55)} N 3/4 ≤ T < 2 N 3/4 , 3 + 5 T /4 ≤ N ∣Γ∣/2 (55)
for all sufficiently large n n n . Corollary 2.5 gives the accuracy bound P [ ∣ Z ~ − Z ∣ > T / 4 ] ≤ η = 2 n − 4 \mathbb{P}[|\widetilde{Z} - Z| > T/4] \le\eta= 2n^{-4} P [ ∣ Z − Z ∣ > T /4 ] ≤ η = 2 n − 4 for the computed statistic Z ~ \widetilde{Z} Z , both under LWE with every fixed secret-error pair and under uniform input. Applying Lemma 2.2, the remaining statistical terms are N − 1 + o ( 1 ) N^{-1+o(1)} N − 1 + o ( 1 ) on LWE and at most N − 1 / 2 + o ( 1 ) N^{-1/2+o(1)} N − 1/2 + o ( 1 ) in the uniform case. Hence both errors satisfy
δ d e c = 2 n − 4 + N − 1 / 2 + o ( 1 ) ≤ 3 n − 4 (56) \delta_{\mathrm{dec}} = 2n^{-4} + N^{-1/2+o(1)} \le3n^{-4} \tag*{(56)} δ dec = 2 n − 4 + N − 1/2 + o ( 1 ) ≤ 3 n − 4 (56)
for sufficiently large n n n , since L = Θ ( n / ln ln q ) L = \Theta(n/\ln\ln q) L = Θ ( n / ln ln q ) . The same decision bounds hold throughout the stated parameter ranges because the moment, signal, and accuracy bounds do, for every fixed secret-error pair satisfying the stated bounds.
Proof of the time and space bounds
We prove Theorem 2.4 for the algorithm of § 2 : expected bit time and worst-case bit space N 1 + o ( 1 ) N^{1+o(1)} N 1 + o ( 1 ) , storage-overflow probability at most 3 2 n − 4 \frac{3}{2}n^{-4} 2 3 n − 4 , and numerical error at most T / 4 T/4 T /4 when there is no overflow. The computation has three parts: bucket queries enumerate compatible pairs, exact sampling and the storage cap control the tree, and numerical evaluation approximates the decision statistic. We then prove Proposition 2.7 by adding the time costs of all calls and reusing their workspace. Throughout this section, assume the theorem’s parameter conditions hold.
Enumerating compatible pairs efficiently
At a level-i i i merge, the two child lists contain coefficient vectors x , y ∈ F q d x,y \in\mathbb{F}_q^d x , y ∈ F q d , and A i A_i A i has n i n_i n i rows. A pair is compatible when every coordinate of A i ( x + y ) A_i(x+y) A i ( x + y ) has centered magnitude at most R i R_i R i , as in (4) . Write u L = A i x u_L = A_i x u L = A i x , u R = A i y u_R = A_i y u R = A i y , and recall that W i = 2 R i + 1 W_i = 2R_i + 1 W i = 2 R i + 1 is the cell width. We group right entries into the buckets of (7) and query the cells meeting − ( u L ) j + { − R i , … , R i } -(u_L)_j + \{-R_i,\ldots,R_i\} − ( u L ) j + { − R i , … , R i } mod q q q in each coordinate. We prove that at most 3 n i 3^{n_i} 3 n i buckets are queried per left entry, every compatible pair is found exactly once, and the image A i ( x + y ) A_i(x+y) A i ( x + y ) of every returned pair lies in the enlarged radius-3 R i 3R_i 3 R i box. The last fact bounds the work spent on pairs that fail the exact filter.
Fill initial lists from left to right in sampling order, then process levels upward and merges from left to right. Number stored entries consecutively as they are inserted, including equal vectors as separate entries. We use this order later to compare capped and uncapped runs with the same randomness.
At each merge, compute and store the image of each right entry. Sort the right entries by their tuples of cell indices (their bucket keys ) and then by entry number. Each bucket occupies a consecutive range in the sorted array. For a queried key, two binary searches locate the first array position with a key at least the query and the first position with a larger key; equal positions mean the bucket is empty. Visit left entries in increasing order of entry number, computing each left image once. For each left entry, visit queried keys in lexicographic order and process the right entries in each returned range in sorted order. Generate the query tuples one at a time, and append each sum retained by subsampling to the parent list when its pair is visited.
A nonwrapping interval of W i W_i W i consecutive residues meets at most two cells. For a wrapping interval, the part beginning at zero lies in the first cell; the part ending at q − 1 q-1 q − 1 meets at most the last two cells, because the final cell may be short. Thus there are at most three distinct cells per coordinate and at most 3 n i 3^{n_i} 3 n i product queries. To obtain the cell indices, split the interval at zero if it wraps. For each resulting nonwrapping segment [ a , b ] [a,b] [ a , b ] , enumerate all integer indices from ⌊ a / W i ⌋ \lfloor a/W_i\rfloor ⌊ a / W i ⌋ through ⌊ b / W i ⌋ \lfloor b/W_i\rfloor ⌊ b / W i ⌋ , inclusive. If these quotients agree, the segment meets just one cell, and its index is included once. The two segments of a wrapping interval meet disjoint cells under 3 W i ≤ q 3W_i \le q 3 W i ≤ q .
Every right entry compatible with x x x lies in a queried product cell. Conversely, if y y y is returned, in each coordinate choose a residue in the intersection of its cell with the query interval. The chosen residue’s distance within that cell from ( u R ) j (u_R)_j ( u R ) j is at most W i − 1 = 2 R i W_i-1=2R_i W i − 1 = 2 R i , while its sum with ( u L ) j (u_L)_j ( u L ) j has centered magnitude at most R i R_i R i . Therefore A i ( x + y ) A_i(x+y) A i ( x + y ) lies in the enlarged radius-3 R i 3R_i 3 R i box. The width condition 3 W i ≤ q 3W_i\le q 3 W i ≤ q gives 3 R i < q / 2 3R_i<q/2 3 R i < q /2 and 6 R i + 1 = 3 W i − 2 < q 6R_i+1=3W_i-2<q 6 R i + 1 = 3 W i − 2 < q , so this box has exactly ( 6 R i + 1 ) n i (6R_i+1)^{n_i} ( 6 R i + 1 ) n i distinct residues, with no ambiguity from wrapping.
Each right entry has one bucket key, each distinct key is queried once for a fixed left entry, and each left entry is visited once. Thus every returned pair is tested exactly once, including every compatible pair. Equal vectors have distinct entries and insertion numbers. Induction on the tree shows that each possible entry is produced exactly when its required filters pass and its subsampling variables equal one, as in (25) . The specified orders determine one traversal; the observed child images determine the queried keys and exact-test outcomes.
Expected bit time. For this bound, consider the tree without imposing the storage cap. Let v v v be a level-i i i node with children v 0 , v 1 v_0,v_1 v 0 , v 1 . Condition on all leaf vectors, submatrices below level i i i , and entry randomness below level i i i ; call this the lower data. The child lists are then fixed and A i A_i A i is still uniform. This conditioning does not include earlier queries at level i i i . By (24) , every child-pair sum has nonzero first coordinate 2 i m o d q 2^i\bmod q 2 i mod q , so its image under A i A_i A i is uniform. It passes its exact filter and is kept by its independent subsampling variable with probability p i ρ i = 1 / N p_i\rho_i=1/N p i ρ i = 1/ N by (5) . Linearity, followed by averaging over the lower data and applying (43) , gives
E [ ∣ L v ∣ ∣ lower data ] = ∣ L v 0 ∣ ∣ L v 1 ∣ / N , E [ ∣ L v 0 ∣ ∣ L v 1 ∣ ] = N E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N 2 . (57) \mathbb{E}[|\mathcal{L}_v| \mid\text{lower data}] = |\mathcal{L}_{v_0}| |\mathcal{L}_{v_1}|/N,\qquad
\mathbb{E}[|\mathcal{L}_{v_0}| |\mathcal{L}_{v_1}|] = N\mathbb{E}[|\mathcal{L}_v|] \le(1+\varepsilon)N^2. \tag*{(57)} E [ ∣ L v ∣ ∣ lower data ] = ∣ L v 0 ∣∣ L v 1 ∣/ N , E [ ∣ L v 0 ∣∣ L v 1 ∣ ] = N E [ ∣ L v ∣ ] ≤ ( 1 + ε ) N 2 . (57)
This identity bounds the expected product of the sibling list sizes despite their dependence. Write Ret v \operatorname{Ret}_v Ret v for the number of candidate pairs returned by the bucket queries at v v v , before the exact compatibility check and subsampling. The enlarged box bounds each pair’s conditional return probability by ( ( 6 R i + 1 ) / q ) n i ≤ 3 n i ρ i ((6R_i+1)/q)^{n_i}\le3^{n_i}\rho_i (( 6 R i + 1 ) / q ) n i ≤ 3 n i ρ i , so
E [ Ret v ] ≤ 3 n i ρ i E [ ∣ L v 0 ∣ ∣ L v 1 ∣ ] ≤ ( 1 + ε ) 3 n i ( N ρ i ) N . (58) \mathbb{E}[\operatorname{Ret}_v]\le3^{n_i}\rho_i\mathbb{E}[|\mathcal{L}_{v_0}| |\mathcal{L}_{v_1}|]\le(1+\varepsilon)3^{n_i}(N\rho_i)N. \tag*{(58)} E [ Ret v ] ≤ 3 n i ρ i E [ ∣ L v 0 ∣∣ L v 1 ∣ ] ≤ ( 1 + ε ) 3 n i ( N ρ i ) N . (58)
The initial pass over the right list and the visit to each left entry compute one image per child entry; by (43) , the expected number of child entries processed this way is O ( N ) O(N) O ( N ) per merge. Each left entry generates at most 3 n i 3^{n_i} 3 n i bucket queries, so the expected number of queries is at most ( 1 + ε ) 3 n i N (1+\varepsilon)3^{n_i}N ( 1 + ε ) 3 n i N . For J R = ∣ L v 1 ∣ J_R=|L_{v_1}| J R = ∣ L v 1 ∣ right entries, comparison sorting uses O ( J R log ( J R + 2 ) ) O(J_R\log(J_R+2)) O ( J R log ( J R + 2 )) comparisons, and each bucket lookup uses O ( log ( J R + 2 ) ) O(\log(J_R+2)) O ( log ( J R + 2 )) comparisons for its two binary searches. Every tree list contains at most N k N^k N k entries, so log ( J R + 2 ) = O ( k L ) \log(J_R+2)=O(kL) log ( J R + 2 ) = O ( k L ) is polynomial in n n n . Sorting therefore uses O ( N k L ) O(NkL) O ( N k L ) expected comparisons per merge.
Computing an image A i z A_i z A i z uses O ( n i d ) O(n_i d) O ( n i d ) field operations per child entry. For each returned pair, add its stored images u L + u R u_L+u_R u L + u R and check whether every coordinate has centered magnitude at most R i R_i R i , as required by (4) . If the pair passes this check and is retained by subsampling, form its vector sum x + y x+y x + y and store the sum with references to its two child entries. Computing cell indices and query-interval endpoints uses integer division and modular arithmetic. Comparing bucket keys, advancing through array positions, and reading or storing child references also take polynomially many bit operations per entry, query, or returned pair.
All these operands have polynomial bit length. Field elements use O ( log q ) O(\log q) O ( log q ) bits, and a bucket key uses O ( n i log q ) O(n_i\log q) O ( n i log q ) bits. Use the insertion numbers assigned above as entry references. There are 2 k − 1 2k-1 2 k − 1 tree nodes and at most N k N^k N k entries per list, so entry numbers use O ( k L + log k ) O(kL+\log k) O ( k L + log k ) bits even without the cap; array positions satisfy the same bound. By (17) , 3 n i 3^{n_i} 3 n i , N ρ i = N o ( 1 ) N\rho_i=N^{o(1)} N ρ i = N o ( 1 ) , and k < q k<q k < q is polynomial in n n n , so the entry, query, and returned-pair bounds above give N 1 + o ( 1 ) N^{1+o(1)} N 1 + o ( 1 ) expected bit time over all nodes, apart from sampling, which we account for next.
Exact sampling and the total cap
Exact balancing requires Bernoulli subsampling with exact rational success probabilities. To sample uniformly from { 0 , … , D − 1 } \{0,\ldots,D-1\} { 0 , … , D − 1 } for an integer D ≥ 1 D\ge1 D ≥ 1 , draw ⌈ log 2 D ⌉ \lceil\log_2 D\rceil ⌈ log 2 D ⌉ fresh unbiased bits and interpret them as an integer. If it is at least D D D , discard the trial and repeat; for D = 1 D=1 D = 1 , return zero. Denote this sampler by Uniform(D D D ). It supplies the subsampling variables, leaf vectors, and perturbation vectors used in search. Each rejected trial overwrites the same workspace, so further trials increase the running time without using more space.
Taking D = Q = 2 B + 1 D=Q=2B+1 D = Q = 2 B + 1 and subtracting B B B gives the independent leaf coordinates X 2 , … , X d X_2,\ldots,X_d X 2 , … , X d in (3) ; taking D = q D=q D = q independently for each of d d d coordinates gives the uniform perturbation vector w ∈ F q d w\in\mathbb{F}_q^d w ∈ F q d from Section 2.5. A Bernoulli subsampling variable with success probability a / D a/D a / D equals one precisely when Uniform(D D D ) < a <a < a ; it is always zero when a = 0 a=0 a = 0 and always one when a = D a=D a = D . In particular, (5) gives a = q n i a=q^{n_i} a = q n i and D = N W i n i D=NW_i^{n_i} D = N W i n i , without rounding. Sampling the leaf entries costs O ( k N D log q ) O(kND\log q) O ( k N D log q ) expected bit time. Generating each requested Bernoulli sample costs polynomial expected bit time and worst-case workspace by the assumed polynomial encoding lengths of its numerator and denominator.
The following lemma gives the conditional guarantee needed for each request.
Lemma 4.1 (Exact sampling with bounded workspace). The sampler Uniform(D D D ) defined above is exactly uniform on { 0 , … , D − 1 } \{0,\ldots,D-1\} { 0 , … , D − 1 } and terminates with probability 1. For D ≥ 2 D\ge2 D ≥ 2 , its expected number of trials is less than two, its expected bit time is O ( log D ) O(\log D) O ( log D ) , and its worst-case workspace is O ( log D ) O(\log D) O ( log D ) ; the probability of more than j j j trials is at most 2 − j 2^{-j} 2 − j . For D = 1 D=1 D = 1 its output is always zero. These guarantees also hold conditional on the preceding computation, since each request uses fresh bits.
Proof. Put ℓ D = ⌈ log 2 D ⌉ \ell_D=\lceil\log_2 D\rceil ℓ D = ⌈ log 2 D ⌉ . Each trial accepts with probability D / 2 ℓ D > 1 / 2 D/2^{\ell_D}>1/2 D / 2 ℓ D > 1/2 . The output is uniform because all acceptable values are equally likely at every trial. Independent retries give probability at most 2 − j 2^{-j} 2 − j of needing more than j j j trials, hence termination with probability 1 and fewer than two trials on average. A trial takes O ( ℓ D ) O(\ell_D) O ( ℓ D ) bit time. Store only D D D , the current trial value, and the number of bits drawn in that trial; rejected trials overwrite this workspace, and no counter of past trials or old random bits is stored. Fresh unbiased bits allow the same argument conditional on the preceding computation.
Subsampling requests. Each possible internal entry has a unique producing child pair, visited at most once by the traversal in § 4.1 . Generate its Bernoulli variable from fresh bits when this pair passes the compatibility check. This realizes the independent entry randomness of (25) as needed. By Lemma 4.1, each request has polynomial expected bit time conditional on the preceding computation. Summing these conditional bounds gives total expected subsampling time at most a polynomial factor times ∑ v E [ Ret v ] \sum_v \mathbb{E}[\operatorname{Ret}_v] ∑ v E [ Ret v ] , even though earlier outcomes determine which requests are made. Here v v v ranges over the internal nodes, each bucket candidate causes at most one request, and (58) bounds each summand.
Comparing executions at the total cap. Compare the algorithm with and without the storage cap, using the same random bits for all sampling and the processing orders from § 4.1 . The capped and uncapped computations agree until a retained pair would require storing entry K + 1 K+1 K + 1 . All k N ≤ K kN \le K k N ≤ K leaf entries count toward the cap, and every stored internal entry remains until the algorithm ends. If V V V is the total number of entries produced without the cap, (43) and the choice K = 2 k n 4 N K=2kn^4N K = 2 k n 4 N in (10) give
E [ V ] ≤ k N + ( k − 1 ) ( 1 + ε ) N ≤ 3 k N , P [ V > K ] ≤ 3 k N K = 3 2 n − 4 . (59) \mathbb{E}[V] \le kN+(k-1)(1+\varepsilon)N \le3kN,\qquad\mathbb{P}[V>K]\le\frac{3kN}{K}=\frac{3}{2}n^{-4}. \tag*{(59)} E [ V ] ≤ k N + ( k − 1 ) ( 1 + ε ) N ≤ 3 k N , P [ V > K ] ≤ K 3 k N = 2 3 n − 4 . (59)
Overflow occurs exactly when V > K V>K V > K , except on the probability-zero event of a nonterminating sampler. At V = K V=K V = K the algorithm completes normally. On overflow, the algorithm returns uniform and its capped root list is defined to be empty. Otherwise every root entry is stored, counting entries with equal vector values separately. Until it stops, the capped algorithm follows the same traversal and makes the same sampling requests as the algorithm without the cap. Stopping early can only reduce these costs, so the expected construction and sampling time bounds above also apply to the capped algorithm.
Temporary space and termination. Each stored entry contains its vector in F q d \mathbb{F}_q^d F q d , its node, and, for an internal entry, two child references. These references are the insertion numbers from § 4.1 , so each entry uses O ( d log q + log K + log k ) O(d\log q+\log K+\log k) O ( d log q + log K + log k ) bits. The selected leaf entries can be recovered by following these references. There are at most K K K stored entries.
During one merge, the sorted right array and an auxiliary comparison-sort buffer use O ( K ) O(K) O ( K ) temporary items. Each item stores a right entry’s bucket key, image, and entry number, all of polynomial bit length. To enumerate query tuples, keep the at most three cell indices per coordinate and one counter per coordinate recording the current choice; generate tuples one at a time in lexicographic order. The two array positions found by binary search specify the start of each returned bucket and the position just after its last entry. Process the pairs in this range as they are visited, and release the sort buffers after the merge. All counters and the active sampling workspace use polynomial bit space. Thus the algorithm uses worst-case bit space K poly ( n ) = N 1 + o ( 1 ) K\operatorname{poly}(n)=N^{1+o(1)} K poly ( n ) = N 1 + o ( 1 ) during list construction, regardless of how many sampling trials are rejected.
The family of possible entries is finite, and each merge queries finitely many cells and pairs. All requested samplers terminate with probability 1 1 1 ; the subsequent numerical evaluation also uses finitely many operations, so the algorithm terminates with probability 1 1 1 .
Numerical evaluation of the Fourier statistic
Processing the root entries requires only integer arithmetic: count how many entries produce each exponent modulo q q q . Only q q q distinct roots of unity then require approximation. An error bound for each root of unity gives an absolute error bound for the whole sum.
Lemma 4.2 (Approximating roots of unity). For q ≥ 3 q\ge3 q ≥ 3 , 0 ≤ t < q 0\le t<q 0 ≤ t < q , and P ≥ 1 P\ge1 P ≥ 1 , exact rational arithmetic computes a complex number ω ~ t ∈ 2 − ( P + 3 ) ( Z + i Z ) \widetilde{\omega}_t\in2^{-(P+3)}(\mathbb{Z}+\mathrm{i}\mathbb{Z}) ω t ∈ 2 − ( P + 3 ) ( Z + i Z ) with a rational certificate of ∣ ω ~ t − e 2 π i t / q ∣ ≤ 2 − P |\widetilde{\omega}_t-e^{2\pi\mathrm{i}t/q}|\le2^{-P} ∣ ω t − e 2 π i t / q ∣ ≤ 2 − P . The bit time and every intermediate bit length are polynomial in P + log q P+\log q P + log q .
Proof. We use Taylor series with explicit remainder bounds [14 Section 4.4] . Set t ˉ = t \bar{t}=t t ˉ = t if t ≤ q / 2 t\le q/2 t ≤ q /2 and t ˉ = t − q \bar{t}=t-q t ˉ = t − q otherwise, so ∣ t ˉ ∣ ≤ q / 2 |\bar{t}|\le q/2 ∣ t ˉ ∣ ≤ q /2 , and put η = 2 − P − 6 \eta=2^{-P-6} η = 2 − P − 6 . To approximate π \pi π , use the identity π = 4 ( arctan ( 1 / 2 ) + arctan ( 1 / 3 ) ) \pi=4(\arctan(1/2)+\arctan(1/3)) π = 4 ( arctan ( 1/2 ) + arctan ( 1/3 )) and truncate the alternating series for the two arctangents; their errors are bounded by the first omitted terms. This gives a rational interval of width at most η \eta η containing π \pi π and contained in ( 3 , 4 ) (3,4) ( 3 , 4 ) ; let π ^ \hat{\pi} π ^ be its midpoint.
The rational angle θ ^ = 2 t ˉ π ^ / q \hat{\theta}=2\bar{t}\hat{\pi}/q θ ^ = 2 t ˉ π ^ / q satisfies ∣ θ ^ ∣ < 4 |\hat{\theta}|<4 ∣ θ ^ ∣ < 4 and ∣ θ ^ − 2 π t ˉ / q ∣ ≤ η / 2 |\hat{\theta}-2\pi\bar{t}/q|\le\eta/2 ∣ θ ^ − 2 π t ˉ / q ∣ ≤ η /2 . The Taylor polynomials about zero for cos θ ^ \cos\hat{\theta} cos θ ^ and sin θ ^ \sin\hat{\theta} sin θ ^ through degree J J J have error at most 4 J + 1 / ( J + 1 ) ! 4^{J+1}/(J+1)! 4 J + 1 / ( J + 1 )! ; choose J J J making this bound at most η \eta η . Since changing a real angle by ε \varepsilon ε changes its sine or cosine by at most ε \varepsilon ε , these approximations differ from the coordinates of e 2 π i t / q e^{2\pi i t/q} e 2 π i t / q by at most 3 η / 2 3\eta/2 3 η /2 .
Round each rational approximation to the nearest multiple of 2 − ( P + 3 ) 2^{-(P+3)} 2 − ( P + 3 ) , resolving ties by a fixed rule. Each coordinate error is at most
3 2 η + 2 − P − 4 < 2 − P − 3 , (60) \frac{3}{2}\eta+2^{-P-4}<2^{-P-3}, \tag*{(60)} 2 3 η + 2 − P − 4 < 2 − P − 3 , (60)
so the complex error is less than 2 2 − P − 3 < 2 − P \sqrt{2}\,2^{-P-3}<2^{-P} 2 2 − P − 3 < 2 − P . The rational intervals and exact rounding errors certify this bound. Both arctangent series have geometrically decreasing error bounds, and the Taylor remainder bound decreases by at least a factor of two at each additional degree once J ≥ 6 J\ge6 J ≥ 6 . Thus O ( P ) O(P) O ( P ) terms suffice for all three approximations. Their exact fractions have polynomial bit length in P + log q P+\log q P + log q , so evaluation, certification, and rounding all have polynomial bit time.
Write L r o o t c a p \mathcal{L}^{\mathrm{cap}}_{\mathrm{root}} L root cap for the stored root list, defined to be empty on a storage abort, and put
Z c a p ( b ) = ∑ z ∈ L r o o t c a p ω ⟨ z , b ⟩ . (61) Z^{\mathrm{cap}}(b)=\sum_{z\in\mathcal{L}^{\mathrm{cap}}_{\mathrm{root}}}\omega^{\langle z,b\rangle}. \tag*{(61)} Z cap ( b ) = z ∈ L root cap ∑ ω ⟨ z , b ⟩ . (61)
When list construction finishes without exceeding the storage limit, initialize the q q q integer counters c 0 , … , c q − 1 c_0,\ldots,c_{q-1} c 0 , … , c q − 1 to zero and process each root entry. Compute t = ⟨ z , b ⟩ m o d q t=\langle z,b\rangle\bmod q t = ⟨ z , b ⟩ mod q by exact modular arithmetic and increment c t c_t c t , giving
c t = ∑ z ∈ L r o o t c a p 1 { ⟨ z , b ⟩ = t m o d q } , t = 0 , … , q − 1. (62) c_t=\sum_{z\in\mathcal{L}^{\mathrm{cap}}_{\mathrm{root}}}\mathbf{1}\{\langle z,b\rangle=t\bmod q\},\qquad t=0,\ldots,q-1. \tag*{(62)} c t = z ∈ L root cap ∑ 1 {⟨ z , b ⟩ = t mod q } , t = 0 , … , q − 1. (62)
Consequently,
Z c a p ( b ) = ∑ t = 0 q − 1 c t ω t , 0 ≤ c t ≤ K , ∑ t = 0 q − 1 c t ≤ K . (63) Z^{\mathrm{cap}}(b)=\sum_{t=0}^{q-1}c_t\omega^t,\qquad0\le c_t\le K,\qquad\sum_{t=0}^{q-1}c_t\le K. \tag*{(63)} Z cap ( b ) = t = 0 ∑ q − 1 c t ω t , 0 ≤ c t ≤ K , t = 0 ∑ q − 1 c t ≤ K . (63)
Every root entry is counted separately. On abort use zero counters and Z ~ = 0 \widetilde{Z}=0 Z = 0 without evaluation. Apply Lemma 4.2 one root of unity at a time and form Z ~ = ∑ t = 0 q − 1 c t ω ~ t \widetilde{Z}=\sum_{t=0}^{q-1}c_t\widetilde{\omega}^t Z = ∑ t = 0 q − 1 c t ω t by multiplying and adding their integer numerators exactly at the common denominator 2 P + 3 2^{P+3} 2 P + 3 . The triangle inequality and the definition of P P P give
∣ ∑ t c t ω ~ t − Z c a p ( b ) ∣ ≤ ∑ t c t 2 − P ≤ K 2 − P ≤ T / 4. (64) \left|\sum_t c_t\widetilde{\omega}^t-Z^{\mathrm{cap}}(b)\right|\le\sum_t c_t2^{-P}\le K2^{-P}\le T/4. \tag*{(64)} t ∑ c t ω t − Z cap ( b ) ≤ t ∑ c t 2 − P ≤ K 2 − P ≤ T /4. (64)
This bound holds for every matrix, root list, and b b b .
The precision parameter P P P in (10) is the smallest integer P ≥ 1 P\ge1 P ≥ 1 satisfying 2 P T ≥ 4 K 2^P T\ge4K 2 P T ≥ 4 K . Since log 2 K = L + O ( log n ) \log_2 K=L+O(\log n) log 2 K = L + O ( log n ) and log 2 T = ⌈ 3 L / 4 ⌉ \log_2 T=\lceil3L/4\rceil log 2 T = ⌈ 3 L /4 ⌉ , this choice gives P = L / 4 + O ( log n ) P=L/4+O(\log n) P = L /4 + O ( log n ) . The q q q counters use q ⌈ log 2 ( K + 1 ) ⌉ q\lceil\log_2(K+1)\rceil q ⌈ log 2 ( K + 1 )⌉ bits. Since q q q and P P P are polynomial in n n n , the q q q evaluations of ω t \omega^t ω t use polynomial bit time and their reusable numerical workspace uses polynomial bit space. Write Z ~ = ( u + i v ) / 2 P + 3 \widetilde{Z}=(u+iv)/2^{P+3} Z = ( u + i v ) / 2 P + 3 , where the integer numerators u u u and v v v each have O ( P + log K ) O(P+\log K) O ( P + log K ) bits. Perform the exact integer comparison
u 2 + v 2 ≥ 2 2 ( P + 3 ) π 2 . (65) u^2+v^2\ge2^{2(P+3)}\pi^2. \tag*{(65)} u 2 + v 2 ≥ 2 2 ( P + 3 ) π 2 . (65)
The histogram can be reset and its workspace reused between calls.
Proof of Theorem 2.4 . Enumeration of every compatible pair and fresh entry randomness give the analyzed tree process, with overflow bounded by (59) . Sampling and traversal have expected bit time N 1 + o ( 1 ) N^{1+o(1)} N 1 + o ( 1 ) . Reading the input and computing the parameters use polynomial bit time, since the number of original samples m m m and the encoding lengths of the public bounds are polynomial in n n n . For every right-hand-side vector b b b , processing the root entries to form the histogram takes at most K poly ( n ) = N 1 + o ( 1 ) K\operatorname{poly}(n)=N^{1+o(1)} K poly ( n ) = N 1 + o ( 1 ) worst-case bit time, and its subsequent numerical evaluation and threshold comparison take polynomial bit time. Adding their space to the stored entries and sort buffers preserves the worst-case bit-space bound N 1 + o ( 1 ) N^{1+o(1)} N 1 + o ( 1 ) . Equations (64) and (65) give the numerical error bound for the capped statistic and the exact comparison. When list construction finishes without exceeding the storage limit, its root list equals the root list generated without the cap, so the same deterministic error bound gives ∣ Z ~ − Z ( b ) ∣ ≤ K 2 − P ≤ T / 4 |\widetilde{Z}-Z(b)|\le K2^{-P}\le T/4 ∣ Z − Z ( b ) ∣ ≤ K 2 − P ≤ T /4 . The proof uses only the parameter checks in § 5.1 and the assumptions of Theorem 2.4 , including (12) and (17) . The bounds therefore hold throughout any parameter range satisfying these assumptions uniformly.
Resources of the reductions
The reductions use the same original samples across calls, so their runtimes can be dependent. Linearity of expectation bounds the total time without requiring independence. One tail bound then gives the runtime guarantee for the entire search computation.
Proof of Proposition 2.7 . Computing the parameters and reading the input use polynomial bit time and space. For arbitrary secrets, Gaussian elimination over F q \mathbb{F}_q F q tests the reserved samples’ matrix A B A_B A B for invertibility. If it is invertible, the resulting matrix factorization is reused to form (A.2) and, after bounded-secret search, to perform the final linear solve (A.4). All these operations take polynomial bit time. Each perturbation samples the d d d coordinates of w w w exactly using Lemma 4.1, then performs polynomially many bit operations. Sampling the perturbation vector w w w takes polynomial expected bit time, and rejected trials reuse the same bounded workspace.
After successful preprocessing, decision makes one call to the bounded-secret decision algorithm, while search makes M c a l l s = n 1 + o ( 1 ) M_{\mathrm{calls}}=n^{1+o(1)} M calls = n 1 + o ( 1 ) such calls with identical algorithm parameters, by (21) . For bounded secrets, the input matrix and each perturbed matrix used in search are marginally uniform. For arbitrary secrets, the normal-form matrix and each subsequent perturbed matrix are uniform conditional on any fixed invertible A B A_B A B . The bijections in Appendix § 7 establish both statements.
Each call constructs the coefficient-vector lists of Algorithm 2 using its input matrix and fresh randomness; evaluation of the Fourier statistic has a worst-case time bound for every right-hand-side vector, by Theorem 2.4 . We can therefore sum that theorem’s one-call expected bounds, using the parameters of Lemma 2.6, without conditioning on earlier answers. In the arbitrary-secret case, these bounds hold conditional on each fixed invertible A B A_B A B ; if A B A_B A B is singular, the algorithm stops after the polynomial-time invertibility test. If W t o t a l W_{\mathrm{total}} W total denotes all bit time, including preprocessing, perturbations, calls, and recovery, linearity gives
E [ W t o t a l ] ≤ poly ( n ) + n 1 + o ( 1 ) 2 ( 1 / 2 + o ( 1 ) ) n / ln q = 2 ( 1 / 2 + o ( 1 ) ) n / ln q . (66) \mathbb{E}[W_{\mathrm{total}}]\le\operatorname{poly}(n)+n^{1+o(1)}2^{(1/2+o(1))n/\ln q}=2^{(1/2+o(1))n/\ln q}. \tag*{(66)} E [ W total ] ≤ poly ( n ) + n 1 + o ( 1 ) 2 ( 1/2 + o ( 1 )) n / l n q = 2 ( 1/2 + o ( 1 )) n / l n q . (66)
One Markov bound now yields
P [ W t o t a l > n E [ W t o t a l ] ] ≤ 1 / n . (67) \mathbb{P}\left[W_{\mathrm{total}}>n\mathbb{E}[W_{\mathrm{total}}]\right]\le1/n. \tag*{(67)} P [ W total > n E [ W total ] ] ≤ 1/ n . (67)
The factor n n n preserves the exponent because log n = o ( n / ln ln q ) \log n=o(n/\ln\ln q) log n = o ( n / ln ln q ) . We use this threshold only to bound total runtime; the algorithm continues to completion, so the runtime bound adds no correctness failure.
Execute the calls sequentially, releasing their stored entries and reusing the workspace for evaluating the Fourier statistic. Keep only the selected samples, the reserved samples’ matrix factorization when needed, the current perturbed pair, and, for each coordinate, one accepted guess and an acceptance count capped at two. This adds polynomial space to one call’s worst-case bound from Theorem 2.4 . The sampler for perturbation coordinates also overwrites rejected trials without storing a trial counter. Every call terminates with probability 1, so the finite sequence does too; arbitrarily many rejected sampling trials increase the running time but reuse the same workspace, preserving the worst-case space bound.
Parameter choices
We now choose the leaf width Q Q Q , filter widths W i W_i W i , and submatrix row counts n i n_i n i so that the moment and resource conditions hold and the bias ∣ Γ ∣ |\Gamma| ∣Γ∣ is large enough for decision. Our targets from Lemma 2.6 are L = ( 1 / 2 + o ( 1 ) ) n / ln ln q L=(1/2+o(1))n/\ln\ln q L = ( 1/2 + o ( 1 )) n / ln ln q , k = N o ( 1 ) k=N^{o(1)} k = N o ( 1 ) , and ∣ Γ ∣ = N − o ( 1 ) |\Gamma|=N^{-o(1)} ∣Γ∣ = N − o ( 1 ) . The two requirements compete: wider leaf intervals make linear dependencies rarer, while wider filter intervals reduce the per-row filtering strengths, so each level can filter more rows; both increase the bias loss − ln ∣ Γ ∣ -\ln|\Gamma| − ln ∣Γ∣ . We verify (12) and (17) and compute the mean in the ideal model for one leaf selection; Theorem 2.1 then bounds ∣ E [ Z ] − N Γ ∣ |\mathbb{E}[Z]-N\Gamma| ∣ E [ Z ] − N Γ∣ for the algorithm run without a storage limit.
Computing the parameters
Choosing the filter intervals. We choose the filter radius R i R_i R i on the scale q / ( f M i ) q/(f\sqrt{M_i}) q / ( f M i ) , with scale factor f f f fixed below and interval width W i = 2 R i + 1 W_i=2R_i+1 W i = 2 R i + 1 . In the ideal model, each coordinate of the sum of the M i M_i M i node images at level i i i has variance M i ( W i 2 − 1 ) / 12 M_i(W_i^2-1)/12 M i ( W i 2 − 1 ) /12 before reduction modulo q q q : the summands are independent and uniform on [ − R i , R i ] ∩ Z [-R_i,R_i]\cap\mathbb{Z} [ − R i , R i ] ∩ Z . This choice keeps the variance on the scale q 2 / f 2 q^2/f^2 q 2 / f 2 across levels and controls the secret’s contribution to the bias loss − ln ∣ Γ ∣ -\ln|\Gamma| − ln ∣Γ∣ .
We round q / ( f M i ) q/(f\sqrt{M_i}) q / ( f M i ) down to obtain integer R i R_i R i and balance the row counts n i n_i n i to limit list growth before subsampling. Lemma 2.6 proves the bit-time, linear-dependency, and signal bounds for these integer choices.
Public inputs and parameter checks. Let n ≥ 1 n\ge1 n ≥ 1 , let q q q be prime, and let E s , E e ≥ 0 E_s,E_e\ge0 E s , E e ≥ 0 be rational public bounds with polynomially many bits in n n n . The number of original samples m m m is polynomial in n n n , so reading the input costs polynomially many bit operations in the modulus regimes below. The bounded-secret decision algorithm uses the first d = min { m , n } d=\min\{m,n\} d = min { m , n } samples; normal form uses the first d = min { m − n , n } d=\min\{m-n,n\} d = min { m − n , n } samples and reserves the final n n n samples when m > n m>n m > n , and supplies E s = E e = E E_s=E_e=E E s = E e = E by Proposition 2.9 . Each decision call therefore has d ≤ n d\le n d ≤ n . All parameter checks below pass for sufficiently large n n n in the range of Lemma 2.6.
For a positive integer u u u , let bitlen ( u ) = 1 + ⌊ log 2 u ⌋ \operatorname{bitlen}(u)=1+\lfloor\log_2u\rfloor bitlen ( u ) = 1 + ⌊ log 2 u ⌋ denote its bit length. Define
h = bitlen ( 2 n − 1 ) = ⌊ log 2 ( 2 n ) ⌋ , f = 32 E ‾ s h , E ‾ s = max { 1 , ∣ E s ∣ } , E ‾ e = max { 1 , ∣ E e ∣ } . (68) \begin{aligned}
h&=\operatorname{bitlen}(2n-1)=\lfloor\log_2(2n)\rfloor, \qquad f=32\overline{E}_s h,\\
\overline{E}_s&=\max\{1,|E_s|\}, \qquad\overline{E}_e=\max\{1,|E_e|\}. \tag*{(68)}
\end{aligned} h E s = bitlen ( 2 n − 1 ) = ⌊ log 2 ( 2 n )⌋ , f = 32 E s h , = max { 1 , ∣ E s ∣ } , E e = max { 1 , ∣ E e ∣ } . (68)
Check that min { d , q } ≥ 2 h \min\{d,q\}\ge2h min { d , q } ≥ 2 h . Choose the largest power of two k ≤ min { d , q } / h k\le\min\{d,q\}/h k ≤ min { d , q } / h , and put r = log 2 k r=\log_2 k r = log 2 k . For levels 1 ≤ i ≤ r 1\le i\le r 1 ≤ i ≤ r , set
B = ⌊ q 2 E ‾ e ⌋ , Q = 2 B + 1 , M i = k / 2 i , R i = ⌊ q f M i ⌋ , W i = 2 R i + 1. (69) \begin{aligned}
B&=\left\lfloor\frac{\sqrt{q}}{2\overline{E}_e}\right\rfloor, \qquad Q=2B+1, \qquad M_i=k/2^i,\\
R_i&=\left\lfloor\frac{q}{f\sqrt{M_i}}\right\rfloor, \qquad W_i=2R_i+1. \tag*{(69)}
\end{aligned} B R i = ⌊ 2 E e q ⌋ , Q = 2 B + 1 , M i = k / 2 i , = ⌊ f M i q ⌋ , W i = 2 R i + 1. (69)
Check that B ≥ 1 B\ge1 B ≥ 1 , Q < q Q<q Q < q , and R i ≥ 1 R_i\ge1 R i ≥ 1 , 3 W i ≤ q 3W_i\le q 3 W i ≤ q at every level. The coefficient vector of each leaf entry is sampled independently as
( 1 , X 2 , … , X d ) m o d q , X 2 , … , X d independent and uniform on [ − B , B ] ∩ Z . (70) (1,X_2,\ldots,X_d)\bmod q,\qquad X_2,\ldots,X_d\text{ independent and uniform on }[-B,B]\cap\mathbb{Z}. \tag*{(70)} ( 1 , X 2 , … , X d ) mod q , X 2 , … , X d independent and uniform on [ − B , B ] ∩ Z . (70)
All vector coordinates are stored as residues modulo q q q .
Choosing the row counts. Write ℓ i = log 2 ( q / W i ) \ell_i = \log_2(q/W_i) ℓ i = log 2 ( q / W i ) for the per-row filtering strength. Since ρ i = ( W i / q ) n i = 2 − n i ℓ i \rho_i = (W_i/q)^{n_i} = 2^{-n_i\ell_i} ρ i = ( W i / q ) n i = 2 − n i ℓ i , we balance the total strengths n i ℓ i n_i\ell_i n i ℓ i near L L L , targeting a filter probability 1 / N 1/N 1/ N at every level. Ignoring the need for integer row counts, this allocates L / ℓ i L/\ell_i L / ℓ i rows to level i i i . Thus H = ∑ i = 1 r ℓ i − 1 H = \sum_{i=1}^r \ell_i^{-1} H = ∑ i = 1 r ℓ i − 1 gives a total of L H LH L H rows, suggesting the list-size exponent L ≈ n / H L \approx n/H L ≈ n / H . These logarithms are for analysis only; the algorithm uses the integer comparison (83) to compute the row counts exactly. Let
L = min { l ∈ Z ≥ 1 : ∑ i = 1 r ⌊ l ℓ i ⌋ ≥ n } , N = 2 L , b i = ⌊ L ℓ i ⌋ . (71) L = \min\left\{l \in\mathbb{Z}_{\ge1} : \sum_{i=1}^{r}\left\lfloor\frac{l}{\ell_i}\right\rfloor\ge n\right\}, \qquad N = 2^L, \qquad b_i = \left\lfloor\frac{L}{\ell_i}\right\rfloor. \tag*{(71)} L = min { l ∈ Z ≥ 1 : i = 1 ∑ r ⌊ ℓ i l ⌋ ≥ n } , N = 2 L , b i = ⌊ ℓ i L ⌋ . (71)
We call b i b_i b i the row capacity at level i i i : the largest row count with total filtering strength at most L L L . Write Δ = ∑ i b i − n \Delta= \sum_i b_i - n Δ = ∑ i b i − n for the excess capacity, and subtract one from the capacities at the Δ \Delta Δ lowest levels. This gives row counts n 1 , … , n r n_1,\ldots,n_r n 1 , … , n r summing to n n n . The bound 0 ≤ Δ ≤ r − 1 0 \le\Delta\le r-1 0 ≤ Δ ≤ r − 1 , proved below, ensures there are enough distinct levels for these subtractions. Check that every n i n_i n i is positive, and use these sizes for consecutive submatrices A i A_i A i . With
ρ i = ( W i / q ) n i , p i = q n i N W i n i = 1 N ρ i , (72) \rho_i = (W_i/q)^{n_i}, \qquad p_i = \frac{q^{n_i}}{NW_i^{n_i}} = \frac{1}{N\rho_i}, \tag*{(72)} ρ i = ( W i / q ) n i , p i = N W i n i q n i = N ρ i 1 , (72)
a uniform level-i i i image passes its filter and is kept by the independent subsampling variable with probability ρ i p i = 1 / N \rho_i p_i = 1/N ρ i p i = 1/ N . If any parameter check fails, the bounded-secret decision algorithm outputs “uniform” and search reports failure before its calls. These checks concern only the number of lists, leaf and filter intervals, and positive row counts, and depend only on n n n , q q q , d d d , E s E_s E s , E e E_e E e . The asymptotic inequalities below follow from the parameter choice. Table 2 collects these choices together with the threshold, storage limit, and precision from (9) and (10) .
The mean in the ideal model
The independent coordinates of the ideal model let us write its ideal mean as a product of Fourier coefficients. For an odd width W W W , define the Fourier coefficient at frequency t t t of the uniform distribution on the centered interval of width W W W by
χ W ( t ) = 1 W ∑ u = − ( W − 1 ) / 2 ( W − 1 ) / 2 ω t u , ω = exp ( 2 π i / q ) . (73) \chi_W(t) = \frac{1}{W}\sum_{u=-(W-1)/2}^{(W-1)/2}\omega^{tu}, \qquad\omega= \exp(2\pi\mathrm{i}/q). \tag*{(73)} χ W ( t ) = W 1 u = − ( W − 1 ) /2 ∑ ( W − 1 ) /2 ω t u , ω = exp ( 2 π i / q ) . (73)
Use the ideal model for one leaf selection from § 2.3 . Its k k k leaf vectors are sampled independently from the distribution in (70) . Its node images Y v ∗ Y_v^* Y v ∗ are independent of the leaf vectors and of one another, and each is uniform in its level’s filter box, with independent coordinates. Let z ∗ z^* z ∗ be the sum of the leaf vectors, and let the i i i th block of y ∗ y^* y ∗ be ∑ h ( v ) = i Y v ∗ \sum_{h(v)=i}Y_v^* ∑ h ( v ) = i Y v ∗ , with both sums reduced modulo q q q . For fixed integer vectors e ∈ Z d e \in\mathbb{Z}^d e ∈ Z d , s ∈ Z n s \in\mathbb{Z}^n s ∈ Z n , use the consecutive secret blocks s ( i ) s^{(i)} s ( i ) and define
Γ = E [ ω ⟨ z ∗ , e ⟩ + ⟨ y ∗ , s ⟩ ] = ω k e 1 G , G = ∏ j = 2 d χ Q ( e j ) k ∏ i = 1 r ∏ j = 1 n i χ W i ( s j ( i ) ) M i . (74) \Gamma= \mathbb{E}\left[\omega^{\langle z^*,e\rangle+\langle y^*,s\rangle}\right]=\omega^{ke_1}G,\qquad G=\prod_{j=2}^{d}\chi_Q(e_j)^k\prod_{i=1}^{r}\prod_{j=1}^{n_i}\chi_{W_i}\left(s_j^{(i)}\right)^{M_i}. \tag*{(74)} Γ = E [ ω ⟨ z ∗ , e ⟩ + ⟨ y ∗ , s ⟩ ] = ω k e 1 G , G = j = 2 ∏ d χ Q ( e j ) k i = 1 ∏ r j = 1 ∏ n i χ W i ( s j ( i ) ) M i . (74)
This is the mean of the fixed Fourier character for LWE in (29) under the ideal model. Symmetry of the centered intervals makes G G G real. Independence of the free leaf-vector coordinates and node-image coordinates gives the product. The fixed first coordinates contribute the common factor ω k e 1 \omega^{ke_1} ω k e 1 , which changes the mean’s direction but not its magnitude.
Verifying the guarantees
We prove Lemma 2.6. The argument establishes valid intervals, verifies the row balance that yields the running-time exponent, and bounds the weighted contribution of linear dependencies and the bias loss − ln ∣ Γ ∣ -\ln|\Gamma| − ln ∣Γ∣ . For each fixed asymptotic growth of the public bounds, we establish all estimates uniformly in the retained dimension and secret-error pair throughout (19) . We finish by verifying exact computation and bit lengths.
Proof of Lemma 2.6. Number of lists and interval sizes. Since ln ln q ∼ ln ln n \ln\ln q\sim\ln\ln n ln ln q ∼ ln ln n , the full interval (19) gives ln d = ln n + O ( ln ln ln n ) \ln d=\ln n+O(\ln\ln\ln n) ln d = ln n + O ( ln ln ln n ) throughout the dimension range. By (68) , h = Θ ( ln n ) h=\Theta(\ln n) h = Θ ( ln n ) and ln f = ( ln n ) o ( 1 ) \ln f=(\ln n)^{o(1)} ln f = ( ln n ) o ( 1 ) , so f = n o ( 1 ) f=n^{o(1)} f = n o ( 1 ) . Thus min { d , q } / h → ∞ \min\{d,q\}/h\to\infty min { d , q } / h → ∞ , which verifies min { d , q } ≥ 2 h \min\{d,q\}\ge2h min { d , q } ≥ 2 h from Section 5.1 for sufficiently large n n n . Rounding min { d , q } / h \min\{d,q\}/h min { d , q } / h down to a power of two gives
min { d , q } 2 h < k ≤ min { d , q } h , k d ≤ 1 h , k q ≤ 1 h . (75) \frac{\min\{d,q\}}{2h}<k\le\frac{\min\{d,q\}}{h},\qquad\frac{k}{d}\le\frac{1}{h},\qquad\frac{k}{q}\le\frac{1}{h}. \tag*{(75)} 2 h min { d , q } < k ≤ h min { d , q } , d k ≤ h 1 , q k ≤ h 1 . (75)
These inequalities give k = o ( d ) k=o(d) k = o ( d ) and ln k = ( min { 1 , κ } + o ( 1 ) ) ln n \ln k=(\min\{1,\kappa\}+o(1))\ln n ln k = ( min { 1 , κ } + o ( 1 )) ln n , with r = Θ ( ln n ) r=\Theta(\ln n) r = Θ ( ln n ) .
For the target filter radius R i ∗ = q / ( f M i ) R_i^*=q/(f\sqrt{M_i}) R i ∗ = q / ( f M i ) , the definition in (69) gives R i = ⌊ R i ∗ ⌋ R_i=\lfloor R_i^*\rfloor R i = ⌊ R i ∗ ⌋ . The minimum of R i ∗ R_i^* R i ∗ occurs at i = 1 i=1 i = 1 , and
R 1 ∗ ≥ q f k ≥ q h f ⟶ ∞ . (76) R_1^*\ge\frac{q}{f\sqrt{k}}\ge\frac{\sqrt{qh}}{f}\longrightarrow\infty. \tag*{(76)} R 1 ∗ ≥ f k q ≥ f q h ⟶ ∞. (76)
For all sufficiently large n n n , the definition in (69) gives, at every level,
R i ∗ / 2 ≤ R i ≤ R i ∗ , R i ∗ ≤ W i ≤ 3 R i ∗ . (77) R_i^*/2\le R_i\le R_i^*,\qquad R_i^*\le W_i\le3R_i^*. \tag*{(77)} R i ∗ /2 ≤ R i ≤ R i ∗ , R i ∗ ≤ W i ≤ 3 R i ∗ . (77)
Hence every R i ≥ 1 R_i\ge1 R i ≥ 1 . For the width check 3 W i ≤ q 3W_i\le q 3 W i ≤ q , we use 1 ≤ R i ≤ q / f 1\le R_i\le q/f 1 ≤ R i ≤ q / f to obtain
3 W i = 6 R i + 3 ≤ 6 q / f + 3 ≤ 9 q / f < q , (78) 3W_i=6R_i+3\le6q/f+3\le9q/f<q, \tag*{(78)} 3 W i = 6 R i + 3 ≤ 6 q / f + 3 ≤ 9 q / f < q , (78)
because f ≥ 32 f\ge32 f ≥ 32 by (68) . This verifies the filter-interval checks in Section 5.1. The bound 3 W i ≤ q 3W_i\le q 3 W i ≤ q also implies ℓ i ≥ log 2 3 > 1 \ell_i\ge\log_2 3>1 ℓ i ≥ log 2 3 > 1 , 6 R i + 1 = 3 W i − 2 < q 6R_i+1=3W_i-2<q 6 R i + 1 = 3 W i − 2 < q , and 3 R i < q / 2 3R_i<q/2 3 R i < q /2 . The last two inequalities ensure that the enlarged boxes used by bucket enumeration in Section 4.1 contain distinct centered residues.
Since E ‾ e = n o ( 1 ) \overline{E}_e=n^{o(1)} E e = n o ( 1 ) , (69) gives B → ∞ B\to\infty B → ∞ and Q = O ( q ) = o ( q ) Q=O(\sqrt{q})=o(q) Q = O ( q ) = o ( q ) . Thus B ≥ 1 B\ge1 B ≥ 1 and Q < q Q<q Q < q for sufficiently large n n n , verifying the leaf-interval checks in Section 5.1. The same definition yields
ln Q = 1 2 ln q − ln E ‾ e + O ( 1 ) = ( 1 2 + o ( 1 ) ) ln q , Q E e ≤ q + E ‾ e ≤ 3 2 q . (79) \ln Q=\frac{1}{2}\ln q-\ln\overline{E}_e+O(1)=\left(\frac{1}{2}+o(1)\right)\ln q,\qquad QE_e\le\sqrt{q}+\overline{E}_e\le\frac{3}{2}\sqrt{q}. \tag*{(79)} ln Q = 2 1 ln q − ln E e + O ( 1 ) = ( 2 1 + o ( 1 ) ) ln q , Q E e ≤ q + E e ≤ 2 3 q . (79)
for sufficiently large n n n . In particular Q E e ≤ q / 2 QE_{\mathrm e} \le q/2 Q E e ≤ q /2 . The filter widths W i ≤ 3 R i ∗ W_i \le3R_i^* W i ≤ 3 R i ∗ give W i E s ≤ 3 q E s / ( f M i ) ≤ 3 q / ( 32 h ) < q / 2 W_iE_{\mathrm s} \le3qE_{\mathrm s}/(f\sqrt{M_i}) \le3q/(32h) < q/2 W i E s ≤ 3 q E s / ( f M i ) ≤ 3 q / ( 32 h ) < q /2 . Thus the geometry needed for enumeration and signal evaluation is
6 R i + 1 < q , 3 R i < q / 2 , Q E e ≤ q / 2 , W i E s ≤ q / 2. (80) 6R_i+1<q,\qquad3R_i<q/2,\qquad QE_{\mathrm e}\le q/2,\qquad W_iE_{\mathrm s}\le q/2. \tag*{(80)} 6 R i + 1 < q , 3 R i < q /2 , Q E e ≤ q /2 , W i E s ≤ q /2. (80)
If either of E s , E e E_{\mathrm s},E_{\mathrm e} E s , E e is zero, the corresponding product W i E s W_iE_{\mathrm s} W i E s or Q E e QE_{\mathrm e} Q E e is zero, so the corresponding inequality holds automatically; the conventions E ‾ s , E ‾ e ≥ 1 \overline{E}_{\mathrm s},\overline{E}_{\mathrm e}\ge1 E s , E e ≥ 1 still define f f f and B B B .
Estimating the reciprocal sum H H H . Put α = log 2 f \alpha=\log_2 f α = log 2 f ; (5.1) gives log 2 ( 32 h ) ≤ α = ( ln n ) o ( 1 ) \log_2(32h)\le\alpha=(\ln n)^{o(1)} log 2 ( 32 h ) ≤ α = ( ln n ) o ( 1 ) . Taking logarithms in (5.10) gives ℓ i = α + 1 2 log 2 M i + O ( 1 ) \ell_i=\alpha+\frac{1}{2}\log_2 M_i+O(1) ℓ i = α + 2 1 log 2 M i + O ( 1 ) . Thus ℓ min : = min i ℓ i → ∞ \ell_{\min}:=\min_i\ell_i\to\infty ℓ m i n := min i ℓ i → ∞ and ℓ max : = max i ℓ i = O ( ln n ) \ell_{\max}:=\max_i\ell_i=O(\ln n) ℓ m a x := max i ℓ i = O ( ln n ) . Since M i = 2 r − i M_i=2^{r-i} M i = 2 r − i , put j = r − i j=r-i j = r − i , which ranges over 0 , … , r − 1 0,\ldots,r-1 0 , … , r − 1 . The reciprocal error is
∣ 1 ℓ i − 1 α + j / 2 ∣ = ∣ ℓ i − ( α + j / 2 ) ∣ ℓ i ( α + j / 2 ) = O ( ( α + j / 2 ) − 2 ) . (81) \left|\frac{1}{\ell_i}-\frac{1}{\alpha+j/2}\right|
=\frac{|\ell_i-(\alpha+j/2)|}{\ell_i(\alpha+j/2)}
=O\left((\alpha+j/2)^{-2}\right). \tag*{(81)} ℓ i 1 − α + j /2 1 = ℓ i ( α + j /2 ) ∣ ℓ i − ( α + j /2 ) ∣ = O ( ( α + j /2 ) − 2 ) . (81)
The numerator is O ( 1 ) O(1) O ( 1 ) , and each denominator factor has order α + j / 2 \alpha+j/2 α + j /2 because α → ∞ \alpha\to\infty α → ∞ . Summing (5.14) compares H H H with ∑ j = 0 r − 1 ( α + j / 2 ) − 1 \sum_{j=0}^{r-1}(\alpha+j/2)^{-1} ∑ j = 0 r − 1 ( α + j /2 ) − 1 . The total error is O ( 1 / α ) O(1/\alpha) O ( 1/ α ) , since the sum of ( α + j / 2 ) − 2 (\alpha+j/2)^{-2} ( α + j /2 ) − 2 is at most α − 2 + 2 / α \alpha^{-2}+2/\alpha α − 2 + 2/ α by comparison with its integral. For the positive decreasing function ( α + x / 2 ) − 1 (\alpha+x/2)^{-1} ( α + x /2 ) − 1 , the integral over [ 0 , r ] [0,r] [ 0 , r ] is a lower bound on the sum. The terms with 1 ≤ j ≤ r − 1 1\le j\le r-1 1 ≤ j ≤ r − 1 are each bounded by the integral over [ j − 1 , j ] [j-1,j] [ j − 1 , j ] , so their sum is at most the integral over [ 0 , r − 1 ] [0,r-1] [ 0 , r − 1 ] , and hence over [ 0 , r ] [0,r] [ 0 , r ] . Adding the j = 0 j=0 j = 0 term 1 / α 1/\alpha 1/ α therefore bounds the full sum by 1 / α 1/\alpha 1/ α plus the integral over [ 0 , r ] [0,r] [ 0 , r ] . Hence
H = ∑ j = 0 r − 1 1 α + j / 2 + O ( 1 / α ) = 2 ln ( α + r / 2 α ) + O ( 1 / α ) = ( 2 + o ( 1 ) ) ln ln q . (82) H=\sum_{j=0}^{r-1}\frac{1}{\alpha+j/2}+O(1/\alpha)
=2\ln\left(\frac{\alpha+r/2}{\alpha}\right)+O(1/\alpha)
=(2+o(1))\ln\ln q. \tag*{(82)} H = j = 0 ∑ r − 1 α + j /2 1 + O ( 1/ α ) = 2 ln ( α α + r /2 ) + O ( 1/ α ) = ( 2 + o ( 1 )) ln ln q . (82)
Indeed r = Θ ( ln n ) r=\Theta(\ln n) r = Θ ( ln n ) and α = ( ln n ) o ( 1 ) \alpha=(\ln n)^{o(1)} α = ( ln n ) o ( 1 ) , so ln ( α + r / 2 ) = ln ln n + O ( 1 ) \ln(\alpha+r/2)=\ln\ln n+O(1) ln ( α + r /2 ) = ln ln n + O ( 1 ) whereas ln α = o ( ln ln n ) = o ( ln ln q ) \ln\alpha=o(\ln\ln n)=o(\ln\ln q) ln α = o ( ln ln n ) = o ( ln ln q ) .
Exact capacities and positive row counts. The interval checks give 1 < ℓ i < log 2 q 1<\ell_i<\log_2q 1 < ℓ i < log 2 q . For a candidate integer l l l in (5.4), we need the capacities ⌊ l / ℓ i ⌋ \lfloor l/\ell_i\rfloor ⌊ l / ℓ i ⌋ . Computing this floor from an approximate logarithm could change the row count near an integer boundary. Instead, the capacity is the largest integer j ∈ [ 0 , l ] j\in[0,l] j ∈ [ 0 , l ] satisfying j ℓ i ≤ l j\ell_i\le l j ℓ i ≤ l . Exponentiating in base two gives the equivalent comparisons
j ℓ i ≤ l ⟺ ( q / W i ) j ≤ 2 l ⟺ q j ≤ 2 l W i j . (83) j\ell_i\le l\quad\Longleftrightarrow\quad(q/W_i)^j\le2^l\quad\Longleftrightarrow\quad q^j\le2^lW_i^j. \tag*{(83)} j ℓ i ≤ l ⟺ ( q / W i ) j ≤ 2 l ⟺ q j ≤ 2 l W i j . (83)
The final inequality uses only integer powers. Use binary search over j j j to compute each capacity for a fixed l l l , and over l l l to find the smallest value whose total capacity is at least n n n . The integer bound U max = n bitlen ( q − 1 ) = n ⌈ log 2 q ⌉ U_{\max}=n\,\operatorname{bitlen}(q-1)=n\lceil\log_2q\rceil U m a x = n bitlen ( q − 1 ) = n ⌈ log 2 q ⌉ is an upper search endpoint: since ℓ i ≤ ⌈ log 2 q ⌉ \ell_i\le\lceil\log_2q\rceil ℓ i ≤ ⌈ log 2 q ⌉ , at l = U max l=U_{\max} l = U m a x even one capacity is at least n n n .
Since ℓ i > 1 \ell_i>1 ℓ i > 1 , increasing l l l by one raises each capacity by at most one. Minimality of L L L in (5.4) gives ∑ i ⌊ ( L − 1 ) / ℓ i ⌋ ≤ n − 1 \sum_i\lfloor(L-1)/\ell_i\rfloor\le n-1 ∑ i ⌊( L − 1 ) / ℓ i ⌋ ≤ n − 1 , so n ≤ ∑ i b i ≤ n + r − 1 n\le\sum_i b_i\le n+r-1 n ≤ ∑ i b i ≤ n + r − 1 . This proves 0 ≤ Δ ≤ r − 1 0\le\Delta\le r-1 0 ≤ Δ ≤ r − 1 .
To quantify the effect of integer row counts, we compare L L L with n / H n/H n / H . By (5.4), n ≤ ∑ i b i ≤ L H n\le\sum_i b_i\le LH n ≤ ∑ i b i ≤ L H , so L ≥ n / H L\ge n/H L ≥ n / H . For an upper bound, set l ∗ = ⌈ n / H + ℓ max ⌉ l_*=\lceil n/H+\ell_{\max}\rceil l ∗ = ⌈ n / H + ℓ m a x ⌉ . The extra ℓ max \ell_{\max} ℓ m a x allows at least one more row at every level, compensating for the loss of less than one from taking a floor: since ℓ max ≥ ℓ i \ell_{\max}\ge\ell_i ℓ m a x ≥ ℓ i ,
l ∗ ℓ i ≥ l ∗ ℓ i − 1 ≥ n H ℓ i . (84) \frac{l_*}{\ell_i}\ge\frac{l_*}{\ell_i}-1\ge\frac{n}{H\ell_i}. \tag*{(84)} ℓ i l ∗ ≥ ℓ i l ∗ − 1 ≥ H ℓ i n . (84)
Summing (5.17) gives total capacity at least n n n , so l ∗ l_* l ∗ is successful in (5.4). Thus L ≤ l ∗ ≤ n / H + ℓ max + 1 L\le l_*\le n/H+\ell_{\max}+1 L ≤ l ∗ ≤ n / H + ℓ m a x + 1 .
For the actual row counts, b i = ⌊ L / ℓ i ⌋ b_i=\lfloor L/\ell_i\rfloor b i = ⌊ L / ℓ i ⌋ in (5.4) and the rule n i ∈ { b i − 1 , b i } n_i\in\{b_i-1,b_i\} n i ∈ { b i − 1 , b i } give L / ℓ i − 2 ≤ n i ≤ L / ℓ i L/\ell_i-2\le n_i\le L/\ell_i L / ℓ i − 2 ≤ n i ≤ L / ℓ i . Multiplying by ℓ i \ell_i ℓ i and combining with the bounds on L L L proves
L − 2 ℓ i ≤ n i ℓ i ≤ L , n H ≤ L ≤ n H + ℓ max + 1. (85) L-2\ell_i\le n_i\ell_i\le L,\qquad
\frac{n}{H}\le L\le\frac{n}{H}+\ell_{\max}+1. \tag*{(85)} L − 2 ℓ i ≤ n i ℓ i ≤ L , H n ≤ L ≤ H n + ℓ m a x + 1. (85)
Since ℓ max = O ( ln n ) \ell_{\max}=O(\ln n) ℓ m a x = O ( ln n ) , these bounds and (82) give
L = n H + O ( ln n ) = ( 1 2 + o ( 1 ) ) n ln ln q . (86) L=\frac{n}{H}+O(\ln n)=\left(\frac{1}{2}+o(1)\right)\frac{n}{\ln\ln q}. \tag*{(86)} L = H n + O ( ln n ) = ( 2 1 + o ( 1 ) ) ln ln q n . (86)
Every capacity satisfies b i ≥ L / ℓ max − 1 → ∞ b_i\ge L/\ell_{\max}-1\to\infty b i ≥ L / ℓ m a x − 1 → ∞ , so n i ≥ b i − 1 > 0 n_i\ge b_i-1>0 n i ≥ b i − 1 > 0 for sufficiently large n n n , verifying the row-count check in § 5.1 . The construction gives ∑ i n i = n \sum_i n_i=n ∑ i n i = n . Applying (85) yields
0 ≤ log 2 ( N ρ i ) = L − n i ℓ i ≤ 2 ℓ max = o ( L ) , n i L ≤ 1 ℓ min = o ( 1 ) . (87) 0\le\log_2(N\rho_i)=L-n_i\ell_i\le2\ell_{\max}=o(L),\qquad\frac{n_i}{L}\le\frac{1}{\ell_{\min}}=o(1). \tag*{(87)} 0 ≤ log 2 ( N ρ i ) = L − n i ℓ i ≤ 2 ℓ m a x = o ( L ) , L n i ≤ ℓ m i n 1 = o ( 1 ) . (87)
This proves both overhead bounds in (17) and 0 < p i ≤ 1 0<p_i\le1 0 < p i ≤ 1 . Since k ≤ n / h k\le n/h k ≤ n / h is polynomial and L = Θ ( n / ln ln q ) L=\Theta(n/\ln\ln q) L = Θ ( n / ln ln q ) , we also have log n = o ( L ) \log n=o(L) log n = o ( L ) , k = N o ( 1 ) k=N^{o(1)} k = N o ( 1 ) , and 2 k ≤ N 2k\le N 2 k ≤ N for sufficiently large n n n .
Linear-dependency bounds throughout the parameter range. Recall D 0 = d − 1 − 2 k D_0=d-1-2k D 0 = d − 1 − 2 k from (12) . By (75) , D 0 ≥ d ( 1 − 2 / h ) − 1 D_0\ge d(1-2/h)-1 D 0 ≥ d ( 1 − 2/ h ) − 1 . The lower bound d ≥ C n / ln ln q d\ge Cn/\ln\ln q d ≥ C n / ln ln q in (19) and the value of L L L in (86) give D 0 / L ≥ 2 C − o ( 1 ) D_0/L\ge2C-o(1) D 0 / L ≥ 2 C − o ( 1 ) and hence D 0 ≥ 1 D_0\ge1 D 0 ≥ 1 for sufficiently large n n n . Since k ≤ min { d , q } / h ≤ min { n , q } k\le\min\{d,q\}/h\le\min\{n,q\} k ≤ min { d , q } / h ≤ min { n , q } , we have ln k ≤ ( min { 1 , 1 / κ } + o ( 1 ) ) ln q \ln k\le(\min\{1,1/\kappa\}+o(1))\ln q ln k ≤ ( min { 1 , 1/ κ } + o ( 1 )) ln q . Together with (79) , this gives
D 0 ln Q − L ln k L ln q ≥ C − min { 1 , 1 / κ } − o ( 1 ) . (88) \frac{D_0\ln Q-L\ln k}{L\ln q}\ge C-\min\{1,1/\kappa\}-o(1). \tag*{(88)} L ln q D 0 ln Q − L ln k ≥ C − min { 1 , 1/ κ } − o ( 1 ) . (88)
(88) gives D 0 ln Q ≥ L ln k + ( C − min { 1 , 1 / κ } − o ( 1 ) ) L ln q D_0\ln Q\ge L\ln k+(C-\min\{1,1/\kappa\}-o(1))L\ln q D 0 ln Q ≥ L ln k + ( C − min { 1 , 1/ κ } − o ( 1 )) L ln q . To prove the target bound D 0 ln Q ≥ ln ( 4 k N r + 1 ) D_0\ln Q\ge\ln(4kN^{r+1}) D 0 ln Q ≥ ln ( 4 k N r + 1 ) , the margin beyond L ln k L\ln k L ln k must also cover L ln 2 + ln ( 4 k ) L\ln2+\ln(4k) L ln 2 + ln ( 4 k ) :
ln ( 4 k N r + 1 ) = L ln k + L ln 2 + ln ( 4 k ) , L ln 2 + ln ( 4 k ) L ln q = o ( 1 ) . (89) \ln(4kN^{r+1})=L\ln k+L\ln2+\ln(4k),\qquad\frac{L\ln2+\ln(4k)}{L\ln q}=o(1). \tag*{(89)} ln ( 4 k N r + 1 ) = L ln k + L ln 2 + ln ( 4 k ) , L ln q L ln 2 + ln ( 4 k ) = o ( 1 ) . (89)
Since C > min { 1 , 1 / κ } C>\min\{1,1/\kappa\} C > min { 1 , 1/ κ } , the margin exceeds these additional terms for sufficiently large n n n . Exponentiating the resulting inequality and using ε \varepsilon ε from (12) gives
4 k N r + 1 ≤ Q D 0 , ε = 4 k N r Q − D 0 ≤ N − 1 . (90) 4kN^{r+1}\le Q^{D_0},\qquad\varepsilon=4kN^rQ^{-D_0}\le N^{-1}. \tag*{(90)} 4 k N r + 1 ≤ Q D 0 , ε = 4 k N r Q − D 0 ≤ N − 1 . (90)
Together with 2 k ≤ N 2k\le N 2 k ≤ N and D 0 ≥ 1 D_0\ge1 D 0 ≥ 1 established above, this verifies (12) .
Bounding the bias loss. To prove the signal bound ∣ Γ ∣ = N − o ( 1 ) |\Gamma|=N^{-o(1)} ∣Γ∣ = N − o ( 1 ) in (20) , we show that − ln ∣ Γ ∣ = o ( L ) -\ln|\Gamma|=o(L) − ln ∣Γ∣ = o ( L ) . We first show that the Fourier coefficients in (74) are positive and bound their logarithmic losses. These losses add with weights k k k and M i M_i M i to give − ln ∣ Γ ∣ -\ln|\Gamma| − ln ∣Γ∣ .
If U W U_W U W is uniform on the centered interval of odd width W W W , symmetry gives χ W ( t ) = E [ cos ( 2 π t U W / q ) ] \chi_W(t)=\mathbb{E}[\cos(2\pi tU_W/q)] χ W ( t ) = E [ cos ( 2 π t U W / q )] and E [ U W 2 ] = ( W 2 − 1 ) / 12 \mathbb{E}[U_W^2]=(W^2-1)/12 E [ U W 2 ] = ( W 2 − 1 ) /12 . Hence cos x ≥ 1 − x 2 / 2 \cos x\ge1-x^2/2 cos x ≥ 1 − x 2 /2 implies
1 ≥ χ W ( t ) ≥ 1 − π 2 ( W 2 − 1 ) t 2 6 q 2 ≥ 1 − π 2 W 2 t 2 6 q 2 . (91) 1\ge\chi_W(t)\ge1-\frac{\pi^2(W^2-1)t^2}{6q^2}\ge1-\frac{\pi^2W^2t^2}{6q^2}. \tag*{(91)} 1 ≥ χ W ( t ) ≥ 1 − 6 q 2 π 2 ( W 2 − 1 ) t 2 ≥ 1 − 6 q 2 π 2 W 2 t 2 . (91)
When W ∣ t ∣ ≤ q / 2 W|t|\le q/2 W ∣ t ∣ ≤ q /2 , the last subtracted quantity is at most π 2 / 24 < 1 / 2 \pi^2/24<1/2 π 2 /24 < 1/2 . Positivity and − ln ( 1 − x ) ≤ 2 x -\ln(1-x)\le2x − ln ( 1 − x ) ≤ 2 x for 0 ≤ x ≤ 1 / 2 0\le x\le1/2 0 ≤ x ≤ 1/2 therefore give the complete bound
0 < χ W ( t ) ≤ 1 , 0 ≤ − ln χ W ( t ) ≤ π 2 W 2 t 2 3 q 2 . (92) 0<\chi_W(t)\le1,\qquad0\le-\ln\chi_W(t)\le\frac{\pi^2W^2t^2}{3q^2}. \tag*{(92)} 0 < χ W ( t ) ≤ 1 , 0 ≤ − ln χ W ( t ) ≤ 3 q 2 π 2 W 2 t 2 . (92)
At t = 0 t=0 t = 0 , the Fourier coefficient is one and its logarithmic loss is zero. Applying (92) to each factor in (74) , with Q E e ≤ q / 2 Q E_e\le q/2 Q E e ≤ q /2 and W i E s ≤ q / 2 W_i E_s\le q/2 W i E s ≤ q /2 from (80) , proves G > 0 G>0 G > 0 . Since ∣ Γ ∣ = G |\Gamma|=G ∣Γ∣ = G , summing the logarithmic losses yields
0 ≤ − ln G ≤ π 2 3 q 2 ( k Q 2 ∑ j = 2 d e j 2 + ∑ i = 1 r M i W i 2 ∥ s ( i ) ∥ 2 2 ) . (93) 0\le-\ln G\le\frac{\pi^2}{3q^2}\left(kQ^2\sum_{j=2}^{d}e_j^2+\sum_{i=1}^{r}M_iW_i^2\left\|s^{(i)}\right\|_2^2\right). \tag*{(93)} 0 ≤ − ln G ≤ 3 q 2 π 2 ( k Q 2 j = 2 ∑ d e j 2 + i = 1 ∑ r M i W i 2 s ( i ) 2 2 ) . (93)
By (79) and (77) , Q 2 E e 2 ≤ 9 q / 4 Q^2E_e^2\le9q/4 Q 2 E e 2 ≤ 9 q /4 and M i W i 2 ≤ 9 q 2 / f 2 M_iW_i^2\le9q^2/f^2 M i W i 2 ≤ 9 q 2 / f 2 for sufficiently large n n n . The coordinate bounds give ∑ j = 2 d e j 2 ≤ d E e 2 \sum_{j=2}^{d}e_j^2\le dE_e^2 ∑ j = 2 d e j 2 ≤ d E e 2 and ∥ s ( i ) ∥ 2 2 ≤ n i E s 2 \left\|s^{(i)}\right\|_2^2\le n_iE_s^2 s ( i ) 2 2 ≤ n i E s 2 . Substituting these inequalities into (93) bounds the error contribution by O ( d k / q ) O(dk/q) O ( d k / q ) and the secret contribution by O ( E s 2 ∑ i n i / f 2 ) = O ( n E s 2 / f 2 ) O(E_s^2\sum_i n_i/f^2)=O(nE_s^2/f^2) O ( E s 2 ∑ i n i / f 2 ) = O ( n E s 2 / f 2 ) , using ∑ i n i = n \sum_i n_i=n ∑ i n i = n . Finally, d ≤ n d\le n d ≤ n from (19) , k / q ≤ 1 / h k/q\le1/h k / q ≤ 1/ h from (75) , and E s / f ≤ 1 / ( 32 h ) E_s/f\le1/(32h) E s / f ≤ 1/ ( 32 h ) from (68) give − ln G = O ( n / h ) -\ln G=O(n/h) − ln G = O ( n / h ) . Together with (86) , this gives ( − ln G ) / L = O ( ln ln q / h ) = o ( 1 ) (-\ln G)/L=O(\ln\ln q/h)=o(1) ( − ln G ) / L = O ( ln ln q / h ) = o ( 1 ) . Thus
0 ≤ − ln G = O ( d k q + n E s 2 f 2 ) = O ( n / h ) = o ( L ) , ∣ Γ ∣ = G = N − o ( 1 ) . (94) 0\le-\ln G=O\left(\frac{dk}{q}+\frac{nE_s^2}{f^2}\right)=O(n/h)=o(L),\qquad|\Gamma|=G=N^{-o(1)}. \tag*{(94)} 0 ≤ − ln G = O ( q d k + f 2 n E s 2 ) = O ( n / h ) = o ( L ) , ∣Γ∣ = G = N − o ( 1 ) . (94)
Together with the bounds on L L L and k k k , this verifies (20) .
Bit lengths, encoding lengths, and termination. Computing the ceilings of the rational bounds, bit lengths, powers of two, and integer divisions uses polynomial bit time. The floors in (69) are computed exactly by binary search: B B B is the largest integer b ∈ [ 0 , q ] b\in[0,q] b ∈ [ 0 , q ] with 4 E e 2 b 2 ≤ q 4E_e^2b^2\le q 4 E e 2 b 2 ≤ q , and R i R_i R i is the largest integer u ∈ [ 0 , q ] u\in[0,q] u ∈ [ 0 , q ] with f 2 M i u 2 ≤ q 2 f^2M_i u^2\le q^2 f 2 M i u 2 ≤ q 2 . These comparisons use integers with O ( log n ) O(\log n) O ( log n ) bits in the stated regimes, so the searches take polynomial bit time. The search bound for row capacities is U max = O ( n log q ) U_{\max}=O(n\log q) U m a x = O ( n log q ) ; capacity comparisons have j , l ≤ U max j,l\le U_{\max} j , l ≤ U m a x , so their operands in (83) have O ( n ( log q ) 2 ) O(n(\log q)^2) O ( n ( log q ) 2 ) bits. The two nested binary searches make O ( r ( log U max ) 2 ) O(r(\log U_{\max})^2) O ( r ( log U m a x ) 2 ) such comparisons, with powers obtained by integer multiplication. Thus the capacity search takes polynomial bit time. When the parameter checks pass, n i ≤ n n_i\le n n i ≤ n , and the numerator and denominator of each subsampling probability have O ( L + n i log q ) O(L+n_i\log q) O ( L + n i log q ) bits. The integer N N N has L + 1 L+1 L + 1 bits, despite its exponential value.
For (10) , log 2 K = L + O ( log n ) \log_2 K=L+O(\log n) log 2 K = L + O ( log n ) and log 2 T = ⌈ 3 L / 4 ⌉ \log_2 T=\lceil3L/4\rceil log 2 T = ⌈ 3 L /4 ⌉ . The precision parameter P P P can be obtained by comparing integers or by subtracting this latter exponent from bitlen ( 4 K − 1 ) \operatorname{bitlen}(4K-1) bitlen ( 4 K − 1 ) and taking the maximum with one. Therefore P = L / 4 + O ( log n ) P=L/4+O(\log n) P = L /4 + O ( log n ) . There are q q q histogram counters c t c_t c t , each at most K K K , and exponents have O ( log q ) O(\log q) O ( log q ) bits. Fixed-point approximations of unit complex numbers can be represented at common denominator 2 P + 3 2^{P+3} 2 P + 3 with O ( P + 1 ) O(P+1) O ( P + 1 ) numerator bits; the weighted sum Z ~ = ∑ t c t ω ~ t \widetilde{Z}=\sum_t c_t\widetilde{\omega}_t Z = ∑ t c t ω t , with nonnegative integer weights totaling at most K K K , then has O ( P + log K ) O(P+\log K) O ( P + log K ) numerator bits. Squared-magnitude comparisons use integers of polynomial bit length. Section 4 constructs these approximations and bounds the cost of list construction and processing the root entries.
For the bounded-secret sample range of the main theorem, m ≥ C n / ln ln q m\ge Cn/\ln\ln q m ≥ C n / ln ln q implies d = min { m , n } ∈ [ C n / ln ln q , n ] d=\min\{m,n\}\in[Cn/\ln\ln q,n] d = min { m , n } ∈ [ C n / ln ln q , n ] for sufficiently large n n n ; for the arbitrary-secret range, m ≥ n + C n / ln ln q m\ge n+Cn/\ln\ln q m ≥ n + C n / ln ln q similarly gives m > n m>n m > n and d = min { m − n , n } d=\min\{m-n,n\} d = min { m − n , n } in the same interval. Thus the parameter checks succeed for sufficiently large inputs throughout both ranges. The retained positions depend only on the integer dimensions m , n m,n m , n , and the parameter choice and its checks depend only on n , q , d , E s , E e n,q,d,E_s,E_e n , q , d , E s , E e . The sample-size inequalities involving C C C and ln ln q \ln\ln q ln ln q are used only in the analysis.
This verifies the conditions assumed in Sections 3 and 4, and supplies the signal and running-time exponent used to assemble the main theorem in Section 2.5.
AI Acknowledgments
AI was used in the production of this work. Building on the second-moment method developed in our earlier work on k k k -trees over integers [LV25], we adapted this technique to the current setting, found ways to deal with the greater dependencies here, and essentially reduced the analysis to bounding the covariances among a set of indicator variables. OpenAI’s ChatGPT assisted with refining the required moment and covariance bounds and the parameter choices. This involved sustained interaction and verification over several weeks and passing over multiple earlier proof approaches that were needlessly complex, until we arrived at the current proof.
ChatGPT was also used for writing throughout the paper, including preparing all the figures and tables. Anthropic’s Claude was used for verifying correctness, in addition to our own verification. The authors take responsibility for all content in this paper.
Standard reductions with a fixed number of original samples
We verify the forms of the standard reductions used in § 2.5 . The points requiring care are the fixed secret-error pair, reuse of the original samples, and the explicit failure bounds.
Bounded-secret search on the same samples
Regev’s search-to-decision reduction [29 full version, Lemma 4.2] is stated for independent samples with errors drawn from one distribution and a decision procedure with exponentially small error for every field secret. Here the decision guarantee is 3 n − 4 3n^{-4} 3 n − 4 for bounded secrets and every fixed error vector, and all guesses must use the same original samples. The same coordinate perturbation applies; we record its marginal distributions and the resulting union bound.
Proof of Proposition 2.8 . Fix a secret-error pair satisfying the stated bounds. Write A A A , b b b for the matrix and right-hand-side vector of the first d d d samples, and e e e for their error vector. For each coordinate j = 1 , … , n j=1,\ldots,n j = 1 , … , n in turn, run a decision call for every guess σ ∈ S \sigma\in S σ ∈ S in increasing order, with S S S as in Proposition 2.8 . For a call ( j , σ ) (j,\sigma) ( j , σ ) , let u j u_j u j be the j j j th standard basis vector in F q n \mathbb{F}_q^n F q n and draw a fresh uniform w ∈ F q d w \in\mathbb{F}_q^d w ∈ F q d . The perturbed input is
A ^ = A + u j w T , b ^ = b + σ w = A ^ T s + e + ( σ − s j ) w . (95) \widehat{A}=A+u_jw^{\mathsf{T}},\qquad\widehat{b}=b+\sigma w=\widehat{A}^{\mathsf{T}}s+e+(\sigma-s_j)w. \tag*{(95)} A = A + u j w T , b = b + σ w = A T s + e + ( σ − s j ) w . (95)
For every fixed w w w , each possible A ^ \widehat{A} A is produced by exactly one original matrix, A = A ^ − u j w T A=\widehat{A}-u_jw^{\mathsf{T}} A = A − u j w T . All these original matrices are equally likely, so A ^ \widehat{A} A is uniform with the same distribution for every w w w . Thus A ^ \widehat{A} A and w w w are independent uniform variables.
If σ = s j mod q \sigma=s_j\operatorname{mod}q σ = s j mod q , (A.1) gives b ^ = A ^ T s + e \widehat{b}=\widehat{A}^{\mathsf{T}}s+e b = A T s + e , so the input has the same fixed pair ( s , e ) (s,e) ( s , e ) . Otherwise, σ − s j \sigma-s_j σ − s j is nonzero modulo the prime q q q , so multiplying by it permutes the vectors in F q d \mathbb{F}_q^d F q d . Conditional on A ^ \widehat{A} A , w w w is still uniform, so ( σ − s j ) w (\sigma-s_j)w ( σ − s j ) w is uniform. Adding the fixed vector A ^ T s + e \widehat{A}^{\mathsf{T}}s+e A T s + e preserves this uniformity, giving a uniform b ^ \widehat{b} b conditional on A ^ \widehat{A} A . Each call receives only the perturbed input and the public bounds, with independent fresh tree randomness.
If any parameter check in § 5.1 fails, report failure before the calls. For sufficiently large n n n , C n / ln q ≤ d ≤ n C n/\ln q \le d \le n C n / ln q ≤ d ≤ n , so these checks pass by Lemma 2.6. Also, E s ≤ n o ( 1 ) E_s \le n^{o(1)} E s ≤ n o ( 1 ) , so 2 ⌊ E s ⌋ < q 2\lfloor E_s\rfloor<q 2 ⌊ E s ⌋ < q for sufficiently large n n n . The guesses are therefore distinct modulo q q q and include each true coordinate exactly once, including when E s = 0 E_s=0 E s = 0 .
By Proposition 2.3, each call ( j , σ ) (j,\sigma) ( j , σ ) has answer error probability at most 3 n − 4 3n^{-4} 3 n − 4 , averaged over the original matrix, its perturbation vector, and its tree randomness. If every answer is correct, search recovers every coordinate. A union bound over all M c a l l s M_{\mathrm{calls}} M calls calls therefore gives failure probability at most 3 M c a l l s n − 4 = n − 3 + o ( 1 ) 3M_{\mathrm{calls}}n^{-4}=n^{-3+o(1)} 3 M calls n − 4 = n − 3 + o ( 1 ) . This argument neither conditions on earlier answers nor requires independence between calls.
The normal-form lemma of Applebaum–Cash–Peikert–Sahai [2 Section 3.1, Lemma 2] is stated for independent LWE samples. Its preprocessing collects linearly independent columns, discarding samples whose columns are linearly dependent on those already collected, before transforming fresh samples. We instead reserve exactly n n n fixed sample positions and allow failure when that block is singular. We also verify the transformation for every fixed error vector, so the guarantees hold even for error distributions with correlated coordinates.
Proof of Proposition 2.9 . Let A p r e ∈ F q n × ( m − n ) A_{\mathrm{pre}} \in\mathbb{F}_q^{n \times(m-n)} A pre ∈ F q n × ( m − n ) be the matrix of the first m − n m-n m − n equations and A B ∈ F q n × n A_B \in\mathbb{F}_q^{n \times n} A B ∈ F q n × n the matrix of the final n n n equations. Write b p r e , b B b_{\mathrm{pre}}, b_B b pre , b B and e p r e , e B e_{\mathrm{pre}}, e_B e pre , e B for their right-hand-side and error vectors. Test A B A_B A B for invertibility once and report failure if it is singular. Otherwise output
A n f = A B − 1 A p r e , b n f = b p r e − ( A n f ) T b B , s n f = − e B , e n f = e p r e . (96) \begin{aligned}
A^{\mathrm{nf}} &= A_B^{-1} A_{\mathrm{pre}}, \qquad b^{\mathrm{nf}} = b_{\mathrm{pre}} - (A^{\mathrm{nf}})^\mathsf{T} b_B,\\
s^{\mathrm{nf}} &= -e_B, \qquad e^{\mathrm{nf}} = e_{\mathrm{pre}}. \tag*{(96)}
\end{aligned} A nf s nf = A B − 1 A pre , b nf = b pre − ( A nf ) T b B , = − e B , e nf = e pre . (96)
Only A n f A^{\mathrm{nf}} A nf and b n f b^{\mathrm{nf}} b nf are computed; the transformed secret and errors specify their LWE representation.
Fix an original pair ( s , e ) (s,e) ( s , e ) and an invertible matrix of reserved samples A B A_B A B . Multiplication by A B − 1 A_B^{-1} A B − 1 carries the independent uniform matrix A p r e A_{\mathrm{pre}} A pre bijectively to uniform A n f A^{\mathrm{nf}} A nf . Substituting b p r e = A p r e T s + e p r e b_{\mathrm{pre}} = A_{\mathrm{pre}}^\mathsf{T}s + e_{\mathrm{pre}} b pre = A pre T s + e pre and b B = A B T s + e B b_B = A_B^\mathsf{T}s + e_B b B = A B T s + e B gives
b n f = e p r e − ( A n f ) T e B = ( A n f ) T s n f + e n f . (97) b^{\mathrm{nf}} = e_{\mathrm{pre}} - (A^{\mathrm{nf}})^\mathsf{T}e_B = (A^{\mathrm{nf}})^\mathsf{T}s^{\mathrm{nf}} + e^{\mathrm{nf}}. \tag*{(97)} b nf = e pre − ( A nf ) T e B = ( A nf ) T s nf + e nf . (97)
The transformed secret-error pair ( − e B , e p r e ) (-e_B,e_{\mathrm{pre}}) ( − e B , e pre ) is fixed, has dimensions n n n and m − n m-n m − n , and has both coordinate bounds at most E E E . In the uniform case, condition further on A n f , b B A^{\mathrm{nf}}, b_B A nf , b B : the right-hand-side vector b p r e b_{\mathrm{pre}} b pre remains independent uniform, and hence so does b n f b^{\mathrm{nf}} b nf . Since b B + s n f = A B T s b_B + s^{\mathrm{nf}} = A_B^\mathsf{T}s b B + s nf = A B T s , a recovered transformed secret gives
s = A B − T ( b B + s n f ) ( m o d q ) . (98) s = A_B^{-\mathsf{T}}(b_B + s^{\mathrm{nf}}) \pmod q. \tag*{(98)} s = A B − T ( b B + s nf ) ( mod q ) . (98)
The invertibility test, transformation, and recovery use Gaussian elimination and field arithmetic, taking time polynomial in the input length.
To bound the only transformation failure, reveal the columns of A B A_B A B in order. Conditional on the first j j j columns being linearly independent, the next lies in their span with probability q j − n q^{j-n} q j − n . Thus
P [ A B singular ] ≤ ∑ j = 0 n − 1 q j − n = 1 − q − n q − 1 ≤ 1 q − 1 . (99) \mathbb{P}[A_B\ \text{singular}] \le\sum_{j=0}^{n-1}q^{j-n} = \frac{1-q^{-n}}{q-1} \le\frac{1}{q-1}. \tag*{(99)} P [ A B singular ] ≤ j = 0 ∑ n − 1 q j − n = q − 1 1 − q − n ≤ q − 1 1 . (99)
Proof of Corollary 2.10 . For m ≤ n m \le n m ≤ n , define arbitrary-secret decision to output UNIFORM and search to report failure. Otherwise test the reserved matrix A B A_B A B once; on singularity, decision returns UNIFORM and search reports failure. On invertibility, apply Proposition 2.9 and use the first d = min { m − n , n } d=\min\{m-n,n\} d = min { m − n , n } transformed equations for bounded-secret decision or search with E s = E e = E E_s=E_e=E E s = E e = E . Computing only these d d d columns in (A.2) is equivalent to transforming the whole prefix and then discarding the unused equations. Search perturbs only these transformed equations, keeping the reserved samples and b B b_B b B unchanged for recovery by (A.4).
For sufficiently large n n n , the sample assumption gives m > n m>n m > n and C n / ln ln q ≤ d ≤ n Cn/\ln\ln q \le d \le n C n / ln ln q ≤ d ≤ n . The bound E ≤ exp ( ( ln n ) o ( 1 ) ) E \le\exp((\ln n)^{o(1)}) E ≤ exp (( ln n ) o ( 1 ) ) also implies E ≤ n o ( 1 ) E \le n^{o(1)} E ≤ n o ( 1 ) . Conditional on each fixed invertible reserved matrix, Propositions 2.3 and 2.8 therefore apply to the fixed transformed secret-error pair. Average their conditional bounds and add (A.5) once for the entire computation to obtain (22) . Uniform input remains uniform, and a singular reserved matrix yields the correct decision output UNIFORM, so the stated decision bound also holds in that case. Both bounds tend to zero for every κ > 0 \kappa>0 κ > 0 , including q < n q<n q < n and E = 0 E=0 E = 0 .
Concurrent work
Independent concurrent works by Han, Gao, and Hu [HGH26] and Chen, Jiang, Wang, and Zhang [15 ] contain results very similar to ours, and we discuss these similarities and differences here.
An important difference between our work and these is the approach we use in our analysis, which we consider our most important contribution. The concurrent works use a different analytical framework from ours. Both develop the Gaussian–Wagner framework of Ducas, Engelberts, and Loyer [DEL25], introducing new auxiliary superlattices that support the Gaussian sampling accuracy needed for LWE. Our approach extends the second-moment analysis of Lin and Vasudevan [LV25]: we control the Fourier statistic directly for a reusable k k k -tree, including the dependence created by the shared public matrix.
Han–Gao–Hu address arbitrary secrets with n + o ( n ) n + o(n) n + o ( n ) samples, whereas Chen–Jiang–Wang–Zhang address binary and, more generally, narrow secrets and errors with sublinear samples. Taken together, they provide Gaussian–Wagner analogues of our two main sample regimes, with several differences in scope and guarantees.
One difference is the modulus range. For polynomial prime moduli q = n κ + o ( 1 ) q = n^{\kappa+o(1)} q = n κ + o ( 1 ) , both papers state their main specializations for fixed κ > 1 / 2 \kappa> 1/2 κ > 1/2 . Our results allow every fixed κ > 0 \kappa> 0 κ > 0 , including moduli that grow more slowly than n \sqrt{n} n .
For arbitrary secrets, Han–Gao–Hu obtain a wider error range at the cost of a larger running time and more samples. Their theorem covers independent discrete Gaussian errors whose width can grow as exp ( ( ln n ) a + o ( 1 ) ) \exp((\ln n)^{a+o(1)}) exp (( ln n ) a + o ( 1 ) ) for any fixed 0 < a < 1 0 < a < 1 0 < a < 1 , beyond the range stated in our theorem, with a corresponding increase in the running-time exponent. Our theorem is formulated for every fixed bounded secret-error pair, allowing correlated errors; their headline theorem uses independent Gaussian errors.
For narrow secrets, Chen–Jiang–Wang–Zhang state a fixed bound on the average squared size of the secret and errors, whereas our theorem permits secret coordinates bounded by exp ( ( ln n ) o ( 1 ) ) \exp((\ln n)^{o(1)}) exp (( ln n ) o ( 1 ) ) and error coordinates bounded by n o ( 1 ) n^{o(1)} n o ( 1 ) . The two promises cover different inputs: a norm bound permits a few much larger coordinates, while our bounds permit all coordinates to grow. With Θ ( n / ln ln n ) \Theta(n/\ln\ln n) Θ ( n / ln ln n ) samples, their general sampler also appears to accommodate the polylogarithmic special case after a change of parameters, so that difference in stated scope should not be viewed as a limitation of their framework. A more substantial distinction is running time: at this sample scale, their proved bound has leading constant 8 in the base-two exponent, compared with 1 / 2 1/2 1/2 here. They also give a broader sample–time tradeoff for their stated norm promise, obtaining subexponential time with any m = ω ( n / ln n ) m = \omega(n/\ln n) m = ω ( n / ln n ) , m = o ( n ) m = o(n) m = o ( n ) , at the cost of a larger running time as the sample count decreases.