Solving Linear Systems with Modular Arithmetic
Why study linear systems?
Solving linear systems is a fundamental problem in mathematics and computer science, with applications throughout science and engineering. It is a basic tool in machine learning, optimization, scientific simulation, computational number theory, and more.
In linear regression, we are given a data matrix \( B\in\mathbb R^{N\times d} \) and a vector \( y\in\mathbb R^N \). For simplicity, assume that the columns of \( B \) are linearly independent. We choose \( x\in\mathbb R^d \) to minimize the squared error \( \lVert Bx-y\rVert_2^2 \). Setting the gradient of this objective to zero gives the linear system \( B^\top Bx=B^\top y \), known as the normal equations. Therefore, solving a linear regression problem reduces to solving a linear system.
Linear systems also appear in computational number theory. Algorithms for factoring large integers and computing discrete logarithms, such as those in the CADO-NFS project , collect many arithmetic relations. These relations lead to large, sparse linear systems over finite fields, where arithmetic is performed modulo a prime.
In this post, we focus on square, invertible systems of the form
$$ Ax=b, $$
where \( A \) is an invertible \( n\times n \) matrix, \( b \) is a given \( n \)-dimensional vector, and \( x \) is unknown. We write \( m \) for the number of nonzero entries of \( A \). A dense matrix has \( m=\Theta(n^2) \), while a very sparse matrix has \( m=O(n) \) nonzeros.
Given the many applications of linear systems, understanding the time and space needed to solve them is an important algorithmic problem. We want to understand how these costs depend on the dimension \( n \) and the number of nonzeros \( m \).
You may already know that a dense linear system can be solved in \( n^{\omega+o(1)} \) arithmetic operations, where \( \omega \) is the matrix multiplication exponent. This bound counts each addition, subtraction, multiplication, or division as a single operation, regardless of how many bits the numbers contain. The actual time needed to perform these operations, and the space needed to store intermediate results, depend on the bit lengths of these numbers.
Returning to our two examples, linear regression leads to a numerical problem over the reals, where we usually seek an approximate solution and must control rounding errors. This is the numerical setting . The number-theoretic applications lead to systems over finite fields, where arithmetic is exact modulo a prime. This is the finite-field setting . This blog explores the connection between these two settings through the following question:
Can methods from the finite-field setting help us solve a linear system over the reals in the numerical setting?
This post presents three algorithms that answer this question affirmatively:
- Dixon’s algorithm [ Dix82 ], which recovers exact rational solutions by lifting modular solutions.
- The linear-space algorithm of Liu, Nguyen, and Yang [ LNY26 ], which solves numerical systems using linear working space.
- Kelner’s algorithm [ Kel26 ], which reduces the running time for sparse numerical systems.
Two settings: Finite-field vs Numerical
The finite-field setting
Definition 1 (Finite-field linear system solving). Given an invertible matrix \( A\in\mathbb F_p^{n\times n} \) and a vector \( b\in\mathbb F_p^n \), where \( p \) is prime, compute \( x\in\mathbb F_p^n \) such that \( Ax=b \) over \( \mathbb F_p \).
The field \( \mathbb F_p \) consists of the residues \( 0,1,\ldots,p-1 \), with addition and multiplication modulo \( p \). Every nonzero residue has an inverse. We will use primes whose binary length is \( O(\log n) \). Each field element then fits in one machine word.
Example (finite field). Let \( p=5 \) and consider
$$ A=\begin{bmatrix}2&1\\1&2\end{bmatrix}, \qquad b=\begin{bmatrix}1\\0\end{bmatrix}. $$
The solution over \( \mathbb F_5 \) is \( x=[4,3]^\top \), since \( Ax=[11,10]^\top\equiv[1,0]^\top=b\pmod5 \).
The numerical setting
Definition 2 (Numerical linear system solving). Given an invertible integer matrix \( A\in\mathbb Z^{n\times n} \) and an integer vector \( b\in\mathbb Z^n \), compute an approximation \( \widehat x \) to the exact solution \( x^\star=A^{-1}b \) under a specified approximation guarantee.
Example (numerical). For the same \( A \) and \( b \), the exact solution is \( x^\star=[2/3,-1/3]^\top \). A numerical approximation is \( \widehat x=[0.667,-0.333]^\top \), whose error is \( \widehat x-x^\star=[1/3000,1/3000]^\top \). Here we measure how close the answer is to the exact solution.
Remark (integer input). We assume integer input to simplify the presentation. Rational inputs can be converted exactly by multiplying \( A \) and \( b \) by the least common multiple of their denominators. For numerical approximation, we can instead scale and round the input to integers, using enough precision to control the error in the solution.
There are several ways to measure approximation. We will use the following definitions for \( 0<\epsilon<1 \):
Definition 3 (Approximation guarantees).
A normwise approximation guarantee requires
$$ \|\widehat x-x^\star\|_2\leq\epsilon\|x^\star\|_2. $$
An entrywise approximation guarantee requires
$$ |\widehat x_j-x^\star_j|\leq\epsilon|x^\star_j| \qquad\text{for every }j. $$
Since \( 0<\epsilon<1 \), this preserves the sign of every nonzero coordinate. If \( x^\star_j=0 \), the approximation must also be zero.
A normwise guarantee measures error in the solution as a whole. Entrywise accuracy implies normwise accuracy with the same \( \epsilon \). Under a normwise guarantee, small coordinates may be poorly approximated. An entrywise guarantee requires every coordinate to be close to its true value.
In the numerical setting, another important input parameter is the condition number, which helps describe how difficult it is to compute an accurate solution. It measures how sensitive the solution can be to changes in the input. In the Euclidean norm, define
$$ \kappa=\|A\|_2\|A^{-1}\|_2 =\frac{\sigma_{\max}(A)}{\sigma_{\min}(A)}. $$
The singular values describe how much the matrix stretches vectors in different directions. If one direction is compressed much more than another, applying the inverse can greatly amplify a small error. For a symmetric positive-definite matrix, the condition number is the ratio of the largest to the smallest eigenvalue.
For example, let
$$ A=\begin{bmatrix}1&0\\0&\delta\end{bmatrix}, \qquad b=\begin{bmatrix}1\\0\end{bmatrix}, \qquad 0<\delta<1. $$
The exact solution is \( x^\star=[1,0]^\top \). Replacing \( b \) with \( \widetilde b=[1,\delta]^\top \) changes the solution to \( \widetilde x=[1,1]^\top \). Thus a change of \( \delta \) in the right-hand side, measured in the Euclidean norm, causes a change of \( 1 \) in the solution. Here \( \kappa=1/\delta \). In general, when \( A \) is fixed,
$$ \frac{\|\widetilde x-x^\star\|_2}{\|x^\star\|_2} \leq \kappa\frac{\|\widetilde b-b\|_2}{\|b\|_2}, $$
where \( A\widetilde x=\widetilde b \) and \( b\neq0 \). A large condition number can therefore require more precision to keep the solution error small.
A common setting is to study polynomially conditioned systems , where \( \kappa\leq n^C \) for some constant \( C \).
Existing algorithms and complexity bounds
We focus on running time and working space. Running time is measured in bit operations, rather than arithmetic operations. This distinction is especially important in the numerical setting, where rounding errors can accumulate and the number of bits needed per number may grow with \( n \). Working space is measured in bits and counts the additional memory required by an algorithm, assuming read-only access to the input. A space-efficient algorithm may use only \( \widetilde O(n) \) bits of working space by maintaining a few vectors, even the input matrix itself takes \( O(n^2) \) space.
Standard approaches
Gaussian elimination is the standard textbook method. In the numerical setting, complete pivoting controls intermediate growth by choosing the largest entry in absolute value from the remaining submatrix. Its error analysis implies that \( O(\log^2 n+\log(\kappa/\epsilon)) \) bits per number suffice to achieve normwise error \( \epsilon \) [ Hig11 ]. In some cases, exploiting properties of the system can lead to better bounds.
Iterative methods improve an approximate solution through repeated matrix-vector products. A standard example is the conjugate gradient method (CG), which applies to symmetric positive-definite matrices [ She94 ]. Each iteration uses \( O(m) \) arithmetic operations, and the method stores only \( O(n) \) numbers.
In exact arithmetic, CG can achieve the normwise guarantee in Definition 3 within \( O(\sqrt{\kappa}\log(\kappa/\epsilon)) \) iterations. It also reaches the exact solution within \( n \) iterations. Combining these bounds gives a total cost of
$$ O\left(m\min\left\{n,\sqrt{\kappa}\log\frac{\kappa}{\epsilon}\right\}\right) $$
arithmetic operations. A small condition number can therefore make CG converge quickly. These bounds assume exact arithmetic: rounding errors can destroy the \( n \)-step termination guarantee [ Kel26 ]. To converge within \( O(n) \) iterations, CG requires storing \( \widetilde O(n) \) bits per number to control the error, at a cost of \( \widetilde O(mn^2) \) bit operations and \( \widetilde O(n^2) \) bits of working space [ MMS18 ].
An alternative implementation of CG uses fewer bits to store a number but has worse convergence bound that may have polynomial dependendence on the condition number. CG with only \( O(\log n) \) bits per number converges in \( \widetilde O(\sqrt{\kappa}) \) iterations. It runs in \( \widetilde O(m\sqrt{\kappa}) \) bit operations and uses \( O(n\log n) \) bits of working space [ MMS18 ]. This implementation may take more than \( n \) iterations.
| Method | Bit operations | Working space (bits) |
|---|---|---|
| Gaussian elimination with complete pivoting | \( \widetilde O(n^3) \) | \( \widetilde O(n^2) \) |
| CG with \( \widetilde O(n) \)-bit precision | \( \widetilde O(mn^2) \) | \( \widetilde O(n^2) \) |
| CG with \( O(\log n) \)-bit precision [ MMS18 ] | \( \widetilde O(m\sqrt{\kappa}) \) | \( O(n\log n) \) |
Finite-field methods
The classic Gaussian elimination algorithm uses \( O(n^3) \) field operations and stores \( O(n^2) \) field elements. However, faster algorithms are available for dense matrices via fast matrix multiplication and for sparse matrices via Wiedemann’s algorithm.
Over finite fields, Wiedemann’s randomized algorithm [ Wie86 ] solves a system exactly using \( O(n) \) black-box matrix-vector products. It accesses \( A \) only through an operation that returns \( Av \) for a given vector \( v \). Each product takes \( O(m) \) field operations, and the algorithm takes \( \widetilde O(nm) \) field operations in total while storing only \( O(n) \) field elements. We will rely on this algorithm later, but treat it as a black box. We remark that finite-field variants of CG can achieve similar time and space bounds [ EK97 ], but we focus only on Wiedemann’s algorithm in this post.
| Matrix regime | Algorithm | Field operations | Working space (field elements) |
|---|---|---|---|
| Dense | Gaussian elimination | \( O(n^3) \) | \( O(n^2) \) |
| Dense | Fast matrix multiplication | \( n^{\omega+o(1)} \) | \( O(n^2) \) |
| Very sparse | Wiedemann [ Wie86 ] | \( \widetilde O(nm)=\widetilde O(n^2) \) | \( O(n) \) |
Numerical baselines
Beyond standard approaches, numerical solvers can achieve better worst-case running times. Stable algorithms based on fast matrix multiplication give faster dense solvers [ DDH07 ]. Algorithms designed for sparse matrices can improve on the dense bound [ PV21 ].
For these numerical bounds, \( \omega \) refers to matrix multiplication over the reals. Table 3 substitutes OpenAI’s recent bound \( \omega(\mathbb C)\leq9/4 \) [ OAI26 ] into the running times.
| Matrix regime | Algorithm | Bit operations | Working space (bits) |
|---|---|---|---|
| Dense | Stable fast linear algebra [ DDH07 ] | \( O(n^{2.25+\eta}) \) | \( \widetilde O(n^2) \) |
| Very sparse | Peng–Vempala [ PV21 ] | \( O(n^{29/13+\eta}) \) | \( \widetilde O(n^2) \) |
| Very sparse | Nie’s refinement [ Nie22 ] | \( O(n^{2.2+\eta}) \) | \( \widetilde O(n^2) \) |
Time and space in this post
The three algorithms in this post bring finite-field methods into numerical linear system solving through modular arithmetic, each with a different advantage.
Dixon’s algorithm recovers an exact rational solution . The algorithm of Liu, Nguyen, and Yang uses only \( O(n\log n) \) bits of working space while providing an entrywise approximation guarantee . For very sparse, polynomially conditioned systems, Kelner’s algorithm uses only \( \widetilde O(n^2) \) bit operations . Table 4 compares their time, space, and accuracy guarantees.
| Algorithm | Bit operations | Working space (bits) | Approximation guarantee |
|---|---|---|---|
| Dixon with Wiedemann [ Dix82 , Wie86 ] | \( \widetilde O(n^3) \) | \( O(n^2\log n) \) | Exact |
| Liu–Nguyen–Yang [ LNY26 ] | \( \widetilde O(n^3) \) | \( \boldsymbol{O(n\log n)} \) | Entrywise |
| Kelner [ Kel26 ] | \( \boldsymbol{\widetilde O(n^2)} \) | \( \widetilde O(n^2) \) | Normwise |
All three algorithms use exact modular computations to recover rational solutions or numerical approximations. We begin with Dixon’s lifting method, using Wiedemann’s finite-field solver as a black box.
Dixon’s algorithm: p-adic lifting
The p-adic viewpoint describes a number through its residues modulo increasing powers of a prime \( p \). A residue modulo \( p^k \) can be written in base \( p \) as
$$ a_0+a_1p+\cdots+a_{k-1}p^{k-1}, $$
where each \( a_i \) is one of \( 0,1,\ldots,p-1 \), called a base-\( p \) digit . Knowing a number modulo \( p^k \) means knowing its first \( k \) digits, starting from the lowest power of \( p \). Extending this information to modulo \( p^{k+1} \) reveals the next digit.
Dixon’s algorithm [ Dix82 ] applies this idea to each coordinate of the solution. It starts with a solution modulo a suitable small prime \( p \), then extends it to solutions modulo \( p^2,p^3,\ldots \). This process is called p-adic lifting . Once \( p^k \) is large enough, the modular solution contains enough information to recover the exact rational solution through rational reconstruction .
The advantage of using powers of a small prime, rather than one huge prime, is that each lifting step only requires solving a system modulo \( p \). Each intermediate field element is represented by a single base-\( p \) digit in \( 0,\ldots,p-1 \), even as we accumulate information modulo a growing power of \( p \).
Suppose we already know the solution modulo \( p^k \). Write
$$ x\equiv zp^k+y\pmod{p^{k+1}}, $$
where \( y \) and \( z \) are integer vectors. Each coordinate of \( y \) lies in \( 0,\ldots,p^k-1 \) and contains the known first \( k \) base-\( p \) digits. Each coordinate of \( z \) lies in \( 0,\ldots,p-1 \) and is the next unknown digit. Substituting into \( Ax=b \) and dividing the resulting congruence by \( p^k \) gives
$$ Az\equiv\frac{b-Ay}{p^k}\pmod p. $$
The right-hand side is an integer vector because \( Ay\equiv b\pmod{p^k} \). To determine \( x \) modulo \( p^{k+1} \), we only need to find \( z \). We can do this by solving the new system modulo \( p \) , using Wiedemann’s algorithm.
Now denote the known part \( y \) by \( s_k \) and the \( k \)-th p-adic digit of \( x \), namely \( z \), by \( x_k \). This gives the lifting recurrence
$$ Ax_k\equiv \frac{b-As_k}{p^k}\pmod p, \qquad s_{k+1}=s_k+p^k x_k. $$
The updated vector \( s_{k+1} \) solves the original system modulo \( p^{k+1} \). Each finite-field solve therefore adds one digit of modular precision.
Computing \( b-As_k \) from scratch at every step would involve the growing entries of \( s_k \). To implement lifting efficiently, we maintain the scaled residual
$$ r_k=\frac{b-As_k}{p^k}. $$
The next digit satisfies \( Ax_k\equiv r_k\pmod p \). Once it is known, the identity \( s_{k+1}=s_k+p^k x_k \) gives
$$ r_{k+1} =\frac{b-As_{k+1}}{p^{k+1}} =\frac{r_k-Ax_k}{p}. $$
The division is exact because \( Ax_k\equiv r_k\pmod p \). Thus updating the residual only requires multiplying \( A \) by the digit vector \( x_k \), subtracting, and dividing by \( p \). For polynomially bounded integer inputs, the residual entries remain polynomially bounded and need only \( O(\log n) \) bits each.
We use rational reconstruction , an efficient procedure based on the extended Euclidean algorithm, as a black box. Suppose an unknown reduced fraction \( a/b \) satisfies \( |a|\leq H \) and \( 1\leq b\leq H \). Given its residue \( ab^{-1}\bmod M \), the black box recovers \( a \) and \( b \) whenever \( M>2H^2 \), provided \( b \) is invertible modulo \( M \).
After \( T \) iterations of p-adic lifting, we know
$$ s_T=x_0+x_1p+x_2p^2+\cdots+x_{T-1}p^{T-1} \equiv x\pmod{p^T}. $$
Once \( p^T>2H^2 \), we apply rational reconstruction to each coordinate of \( s_T \) to recover the exact rational solution. For polynomially bounded integer inputs, Cramer’s rule and determinant bounds give \( \log H=O(n\log n) \), so \( T=O(n) \) iterations suffice with a polynomial-size prime.
Using Wiedemann’s solver at each of the \( O(n) \) lifting steps gives a total running time of \( \widetilde O(n^2m) \) bit operations, or \( \widetilde O(n^3) \) for very sparse systems. Therefore, Dixon’s algorithm uses finite-field methods to recover the exact rational solution \( x \in \mathbb Q^n \) to \( Ax=b \) in the numerical setting. No approximation or rounding error is incurred.
Solving numerical linear systems in linear space
In Numerical Linear Algebra in Linear Space [ LNY26 ], presented at SODA 2026, Yiping Liu, Hoai-An Nguyen, and I study space-efficient linear system solvers. Recall that the working space is counted separately from the read-only input and the output. The algorithm can revisit the input, but cannot use the output as scratch space.
For this discussion, assume that the integer entries of \( A \) and \( b \) are polynomially bounded in \( n \), and that \( \epsilon \) is inverse-polynomial in \( n \). Recall that Wiedemann’s algorithm uses linear working space in the finite-field setting. Can we also achieve linear working space in the numerical setting, and how fast can such a solver be?
Our algorithm runs in \( \widetilde O(n^2m) \) bit operations and uses \( O(n\log n) \) bits of working space, achieving an entrywise \( \epsilon \)-approximation guarantee with high probability. Our approach builds on Dixon’s p-adic lifting. Our new idea is to use the determinant to make the solution integral, allowing us to approximate the coordinates using small space in a streaming setting we’ll define later. Our main technical contribution is a variant of the lifting procedure that stores a small carry vector instead of the large residual.
The first attempt: plain p-adic lifting
A natural first attempt is to use Dixon’s algorithm directly. After \( T=O(n) \) lifting steps, rational reconstruction recovers the solution from \( s_T=x\bmod p^T \). However, each coordinate of \( s_T \) may need \( O(n\log n) \) bits, so storing the full vector would already cost quadratic space.
To use linear working space, we accumulate the lifted digits for only one output coordinate, while still maintaining the short residual and current digit vectors. After rational reconstruction, we output that coordinate and repeat the lifting process for the next one. This uses \( O(n\log n) \) bits of working space, but repeats the \( O(n) \) lifting steps for each of the \( n \) coordinates, giving \( \widetilde O(n^3m) \) bit operations. For \( m=O(n) \), this is roughly \( n^4 \).
We would like to avoid this extra factor of \( n \) in the running time by computing all coordinates together while storing only a short approximation of each.
The second attempt: make the solution integral
Let \( \Delta := \det A \) and \( x^\star := A^{-1}b \). Cramer’s rule tells us that
$$ y=\Delta x^\star $$
is an integer vector. We can therefore solve
$$ Ay=\Delta b $$
by lifting its integer digits, then divide the result by \( \Delta \). An integer answer avoids coordinate-by-coordinate rational reconstruction.
Note that rational reconstruction does not need a known denominator. However, knowing the common denominator \( \Delta \) lets us approximate the integer vector \( y \) directly. For a coordinate of \( y \), we can retain only the most significant \( p \)-adic digits in the lifting and round away the lower ones, using \( O(\log n) \) bits per coordinate. Dividing by \( \Delta \) preserves the entrywise approximation guarantee. This lets us accumulate approximations to all coordinates together without storing all \( O(n) \) modular residues.
Computing \( \Delta \) also fits in linear space. We compute its residues modulo small primes using finite-field determinant algorithms based on Wiedemann, then combine the residues by the Chinese Remainder Theorem. Only one large integer needs to be stored, rather than a vector of large integers.
This removes the need to reconstruct fractions one at a time. However, there is still one memory problem remaining: although \( b \) has short entries, \( \Delta b \) can have \( O(n\log n) \) bits per entry. Applying the lifting recurrence directly to this vector again requires quadratic working storage.
Store the carry instead of the large residual
Recall the notation from Dixon’s algorithm. Here \( x_k \) is the \( k \)-th p-adic digit of the integer solution \( y \), and
$$ s_k=x_0+x_1p+\cdots+x_{k-1}p^{k-1} $$
contains the digits computed so far. For \( Ay=\Delta b \), the residual is \( r_k=(\Delta b-As_k)/p^k \), starting with \( r_0=\Delta b \). Each lifting step satisfies
$$ Ax_k\equiv r_k\pmod p, \qquad r_{k+1}=\frac{r_k-Ax_k}{p}. $$
Keeping \( r_k \) only modulo \( p \) is enough to find the current digit, but not to update the residual: dividing by \( p \) requires information that was discarded. Storing the full vector \( r_k \) would again require quadratic space.
To overcome this space bottleneck, we propose storing the carry \( c_k=\lfloor As_k/p^k\rfloor \) instead of the full residual. It records how the digits already computed contribute to higher positions when multiplied by \( A \). All floors are taken coordinatewise. Since \( r_k \) is integral, the fractional parts of \( \Delta b/p^k \) and \( As_k/p^k \) cancel, giving
$$ r_k= \left\lfloor\frac{\Delta b}{p^k}\right\rfloor -c_k. $$
We can recompute the first term one coordinate at a time from the stored determinant and the read-only vector \( b \). Together with the carry, this gives \( r_k\bmod p \) for the next finite-field solve. After finding \( x_k \), we update the carry by
$$ c_{k+1}=\left\lfloor\frac{c_k+Ax_k}{p}\right\rfloor. $$
This follows from \( s_{k+1}=s_k+p^k x_k \): the fractional part of \( As_k/p^k \) does not affect the floor after division by \( p \).
The carry stays small because every coordinate of \( s_k/p^k \) lies in \( [0,1) \). Each carry entry is therefore bounded in absolute value by the absolute row sum of \( A \), which is polynomial in \( n \). Thus the carry needs only \( O(\log n) \) bits per coordinate.
From digits to an approximate answer
Each lifting iteration computes \( r_k\bmod p \), generates \( x_k \), and updates \( c_k \). This requires only \( O(1) \) vectors with \( O(\log n) \)-bit entries, together with the stored determinant. Thus we can generate the digits using \( O(n\log n) \) bits of working space.
The remaining challenge is to turn these digits into an approximate solution. The vectors \( x_0,x_1,x_2,\ldots \) arrive one at a time, like a stream. Storing all \( O(n) \) vectors and reconstructing the answer afterward would again cost quadratic space. We must instead update our approximation as each vector arrives, then discard that vector.
For nonnegative integer coordinates, we maintain a short floating-point approximation to the running sum. When \( x_k \) arrives, we add \( p^k x_k \) and round each coordinate, retaining only its most significant bits and an exponent. This uses \( O(\log n) \) bits per coordinate. We choose enough precision to meet the entrywise \( \epsilon \)-approximation guarantee after all lifting steps.
Negative coordinates need more care. For a large modulus \( P \), \( -10 \) is represented by \( P-10 \). A \( (1\pm\epsilon) \) approximation to \( P-10 \) does not necessarily give a \( (1\pm\epsilon) \) approximation to \( 10 \) after subtracting from \( P \): an error that is small compared with \( P-10 \) can be large compared with \( 10 \).
Since we do not know each coordinate’s sign in advance, we accumulate short approximations to both its digits and their complement. The complement, followed by adding \( 1 \), represents the negative counterpart. For \( -10 \), this gives a direct approximation to \( 10 \) without subtracting two large numbers. With a sufficiently large modulus, the smaller of the two accumulations gives the magnitude and identifies the sign.
Wrap-up
For polynomially bounded input and inverse-polynomial accuracy, this yields a randomized algorithm with high-probability guarantees, \( \widetilde O(n^2m) \) bit operations, and \( O(n\log n) \) bits of working space. For a very sparse matrix, the time is \( \widetilde O(n^3) \). The guarantee is entrywise multiplicative, and there is no condition-number assumption.
As applications, our solver also leads to algorithms for regression, linear programming, eigenvalue problems, and singular value decomposition using small working space.
Kelner’s algorithm: choose an easier modular system
Kelner’s very recent breakthrough [ Kel26 ] gives a faster algorithm for sparse numerical linear systems. It uses Dixon’s p-adic lifting. The key idea is extremely clean and clever: change the system before lifting so that the modular solves become trivial.
Instead of solving \( Ax = b \), solve
$$ (PA+I)\widehat x=Pb. $$
Since \( PA+I\equiv I\pmod P \), its modular inverse is the identity. Starting from \( r_0=Pb \), the digit recurrence becomes
$$ x_k=r_k\bmod P,\qquad r_{k+1}=\frac{r_k-x_k}{P}-Ax_k. $$
No finite-field solve is needed at each iteration. There are \( O(n) \) iterations, each with a sparse matrix-vector product on \( O(\log P) \)-bit integers. Fast rational reconstruction recovers \( \widehat x \).
The returned vector solves \( (A+I/P)\widehat x=b \). Since \( A \) is a nonsingular integer matrix, \( \|A\|_2\geq1 \) and hence \( \|A^{-1}\|_2\leq\kappa \). Choosing \( P\geq2\kappa/\epsilon \) therefore gives the normwise approximation guarantee from Definition 3 :
$$ \|\widehat x-x^\star\|_2 \leq \frac{\|A^{-1}\|_2}{P-\|A^{-1}\|_2}\|x^\star\|_2 \leq\epsilon\|x^\star\|_2. $$
After normalization and input/output rounding, the algorithm achieves this guarantee in \( \widetilde O(mn\log(\kappa/\epsilon)) \) bit operations for short input entries.
For very sparse, polynomially conditioned systems and inverse-polynomial accuracy, this gives \( \widetilde O(n^2) \) time, with a storage upper bound of \( \widetilde O(n^2) \) bits in this regime.