Internal Anthropic model refuted the 3SUM and APSP hypotheses: first truly subquadratic 3SUM and truly subcubic APSP (Alman & Vassilevska Williams)
Summary
An internal Anthropic Claude model discovered the first truly subquadratic 3SUM algorithm (O(n^1.9992)) and truly subcubic APSP algorithm (O(n^2.9995)), refuting the long-standing 3SUM and APSP hypotheses in fine-grained complexity theory. The result, formalized in a paper by Josh Alman and Virginia Vassilevska Williams, stems from a new thin matrix multiplication algorithm and was verified using Lean 4.
View Cached Full Text
Cached at: 10/06/26, 07:36 AM
# Truly Subquadratic 3SUM and Truly Subcubic APSP via Triangles in Sparse Lopsided Graphs
Source: [https://arxiv.org/html/2610.06783](https://arxiv.org/html/2610.06783)
###### Abstract
We give the first polynomial improvements over the textbook algorithms for33SUM and All\-Pairs Shortest Paths \(APSP\): we show how to deterministically solve33SUM onnnintegers of polynomial size inO\(n1\.9992\)O\(n^\{1\.9992\}\)time and APSP on directednn\-vertex graphs with polynomially bounded integer weights inO\(n2\.9995\)O\(n^\{2\.9995\}\)time\. This refutes the33SUM and APSP hypotheses of fine\-grained complexity theory\. Using known reductions, we also refute the real\-valued versions of the33SUM and APSP hypotheses, the Exact Triangle hypothesis, the Zero\-Weightkk\-Clique hypotheses, and the three rectangular hinted Online Matrix–Vector conjectures of van den Brand, Nanongkai, and Saranurak, and we give polynomial speedups for a variety of other problems\.
All of these results follow from a single new algorithm for thin matrix products\. LetXXbe anN×DN\\times Dinteger matrix andYYaD×ND\\times Ninteger matrix withD≤N1/18D\\leq N^\{1/18\}, and letWWbe any set of at mostN2/DN^\{2\}/\\sqrt\{D\}positions\. We compute the entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, inO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)operations, which is polynomially less than the time needed to write downXYXYor to computeN2/DN^\{2\}/\\sqrt\{D\}inner products one by one\. We design this algorithm by modifying a variant of Coppersmith’s rectangular matrix multiplication algorithm, built from a ten\-multiplication identity of Schönhage, to perform only the operations needed for the entries inWW, and show that few operations are needed\. Interpreted as a graph algorithm, this solves the All\-Edges Sparse Triangle problem in truly subquadratic time on sparse lopsided tripartite graphs where two parts havennvertices but one part hasnεn^\{\\varepsilon\}vertices forε<0\.12\\varepsilon<0\.12\. By known reductions, Exact Triangle, and hence33SUM and APSP, reduce to this problem\. We also give a data structure version that answers queries for single entries ofXYXY, not known in advance\.
We view this as a great success for fine\-grained complexity, whose main focus has been reductions that uncover connections between problems\. So far these reductions have mostly served to infer conditional hardness, since33SUM and APSP themselves resisted improvement for so long\. But reductions are also algorithms, and they allow a single new technique to speed up a wide range of problems at once\. This opens new directions in both algorithm design and complexity\.
Claude, an AI model developed by Anthropic, discovered the algorithm that refutes the33SUM, APSP, and Exact Triangle hypotheses\. The authors then worked to understand, simplify, strengthen, and extend the algorithm, derive additional consequences, and make the presentation accessible\. See “Acknowledgments and Methodology” for how the result was found and shared with the authors\. The authors take full responsibility for this paper\.
Claude also verified this paper’s main results using the Lean 4 proof assistant with the Mathlib library\.
## 1Introduction
Since its inception, algorithms research has sought the fastest possible algorithm for every problem it considers\. Powerful techniques have been developed, from variants of dynamic programming to surprising algebraic tools such as the Fast Fourier Transform\[[CT65](https://arxiv.org/html/2610.06783#bib.bibx65)\]and fast matrix multiplication\[[Str69](https://arxiv.org/html/2610.06783#bib.bibx147)\]\. Yet for many problems, these techniques have not sufficed\. Some examples include:
- •33SUM: Givennnnumbers, decide whether three of them sum to00\. This is a classical problem with a long history, and it is central to computational geometry \(see\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92)\]\)\. Despite many decades of research, theO\(n2\)O\(n^\{2\}\)\-time algorithm taught in algorithms classes has only been sped up by polylogarithmic factors\[[BDP08](https://arxiv.org/html/2610.06783#bib.bibx35),[GP18](https://arxiv.org/html/2610.06783#bib.bibx94),[Cha20](https://arxiv.org/html/2610.06783#bib.bibx55)\]\.
- •All\-Pairs Shortest Paths\(APSP\): Given an edge\-weighted graph onnnvertices with no negative cycles, compute the shortest\-path distance between every pair of vertices\. Classical algorithms such as Johnson’s\[[Joh77](https://arxiv.org/html/2610.06783#bib.bibx107)\]and Floyd and Warshall’s\[[Flo62](https://arxiv.org/html/2610.06783#bib.bibx85),[War62](https://arxiv.org/html/2610.06783#bib.bibx162)\]solve APSP inO\(n3\)O\(n^\{3\}\)time\. After a long line of work\[[Fre76](https://arxiv.org/html/2610.06783#bib.bibx87),[Tak92](https://arxiv.org/html/2610.06783#bib.bibx150),[Dob90](https://arxiv.org/html/2610.06783#bib.bibx76),[Han04](https://arxiv.org/html/2610.06783#bib.bibx97),[Tak04](https://arxiv.org/html/2610.06783#bib.bibx151),[Tak05](https://arxiv.org/html/2610.06783#bib.bibx152),[Zwi06](https://arxiv.org/html/2610.06783#bib.bibx173),[Cha08](https://arxiv.org/html/2610.06783#bib.bibx52),[Han08](https://arxiv.org/html/2610.06783#bib.bibx98),[Cha10](https://arxiv.org/html/2610.06783#bib.bibx53),[HT16](https://arxiv.org/html/2610.06783#bib.bibx102)\], the fastest known algorithm\[[Wil18](https://arxiv.org/html/2610.06783#bib.bibx166)\]only shaves a subpolynomial,2Ω\(logn\)2^\{\\Omega\(\\sqrt\{\\log n\}\)\}factor off the cubic running time\.
- •Directed Unweighted APSP: The version of APSP innn\-vertex directed unweighted graphs\. The fastest known algorithm, by Zwick\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172)\], runs inO\(n2\.5275\)O\(n^\{2\.5275\}\)time with the current bounds for rectangular matrix multiplication\[[ADV\+25](https://arxiv.org/html/2610.06783#bib.bibx10)\], and beyond improvements to the matrix multiplication bounds, it has not been improved for more than two decades\. If the exponentω\\omegaof matrix multiplication is22, the best known running time for this problem\[[AGM97](https://arxiv.org/html/2610.06783#bib.bibx14),[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172)\]is still onlyO~\(n2\.5\)\\tilde\{O\}\(n^\{2\.5\}\)\.
- •Tree Edit Distance: Given two rooted, ordered, labeled trees withnnvertices, and costs for deleting, inserting, and relabeling vertices, find the cheapest sequence of such operations that transforms one tree into the other\. Tree Edit Distance is used, for instance, to compare RNA secondary structures and XML documents\. The fastest known algorithms for this problem\[[DMRW09](https://arxiv.org/html/2610.06783#bib.bibx75),[NPS\+25](https://arxiv.org/html/2610.06783#bib.bibx133)\]run in cubic time, up to subpolynomial improvements\. Only when all costs are equal to11are truly subcubic algorithms known\[[Mao21](https://arxiv.org/html/2610.06783#bib.bibx127),[Dür23](https://arxiv.org/html/2610.06783#bib.bibx78),[NPS\+25](https://arxiv.org/html/2610.06783#bib.bibx133)\]\.
- •Online Set Disjointness: Preprocess setsS1,…,SNS\_\{1\},\\dots,S\_\{N\}andT1,…,TNT\_\{1\},\\dots,T\_\{N\}over a universe of sizeDD, so that givenIIandJJone can quickly decide whetherSI∩TJ=∅S\_\{I\}\\cap T\_\{J\}=\\emptyset, or, in the counting version, return\|SI∩TJ\|\|S\_\{I\}\\cap T\_\{J\}\|\. Essentially only two straightforward solutions are known: \(1\) to compute allN2N^\{2\}answers in advance, which fast rectangular matrix multiplication does inN2\+o\(1\)N^\{2\+o\(1\)\}time whenD≤N0\.321D\\leq N^\{0\.321\}\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62),[VXXZ24](https://arxiv.org/html/2610.06783#bib.bibx161)\], and \(2\) to store the sets and compute each intersection at query time inO\(D\)O\(D\)time\. Set Disjointness data structures have been studied extensively\[[CP10](https://arxiv.org/html/2610.06783#bib.bibx64),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[GKLP17](https://arxiv.org/html/2610.06783#bib.bibx89),[KV20](https://arxiv.org/html/2610.06783#bib.bibx119),[GLP19](https://arxiv.org/html/2610.06783#bib.bibx90)\], mostly for sets of small total size over a large universe\.
- •CNF\-SAT: Given a Boolean formulaFFin conjunctive normal form overnnvariables andO\(n\)O\(n\)clauses, is there an assignment to the variables that satisfies all clauses? The brute\-force algorithm solves CNF\-SAT in2npoly\(n\)2^\{n\}\\polyop\(n\)time\. There are slightly faster algorithms when the width of the clauses is bounded by a constant independent ofnn\[[Sch99](https://arxiv.org/html/2610.06783#bib.bibx144),[PPSZ05](https://arxiv.org/html/2610.06783#bib.bibx136),[Her14](https://arxiv.org/html/2610.06783#bib.bibx99)\]\. However, noO\(1\.99999n\)O\(1\.99999^\{n\}\)\-time algorithm is known\.
- •Orthogonal Vectors \(OV\): GivennnBoolean vectors ind=ω\(logn\)d=\\omega\(\\log n\)dimensions, are two of them orthogonal? The brute\-force algorithm solves OV inO\(n2d\)O\(n^\{2\}d\)time, and only subpolynomial improvements are known: the fastest algorithms\[[AWY15](https://arxiv.org/html/2610.06783#bib.bibx30),[CW21](https://arxiv.org/html/2610.06783#bib.bibx70)\]run inn2−1/O\(log\(d/logn\)\)n^\{2\-1/O\(\\log\(d/\\log n\)\)\}time\.
The apparent lack of progress on problems such as these led to new theories of hardness: NP\-completeness\[[Coo71](https://arxiv.org/html/2610.06783#bib.bibx61),[Kar72](https://arxiv.org/html/2610.06783#bib.bibx110)\]for problems with no known polynomial\-time algorithm, and fine\-grained complexity \(FGC\)\[[Vas18](https://arxiv.org/html/2610.06783#bib.bibx154),[Bri19](https://arxiv.org/html/2610.06783#bib.bibx45)\]for problems whose best known algorithms were stuck at essentially the straightforward running time\. Both theories relate problems via reductions\. FGC focuses on improvements in the exponent: a fine\-grained reduction from problemAAto problemBBwith respect to running timesa\(n\)a\(n\)andb\(n\)b\(n\)implies that anO\(b\(n\)1−ε\)O\(b\(n\)^\{1\-\\varepsilon\}\)\-time algorithm forBBfor someε\>0\\varepsilon\>0can be converted into anO\(a\(n\)1−δ\)O\(a\(n\)^\{1\-\\delta\}\)\-time algorithm forAAfor someδ\>0\\delta\>0\.
Fine\-grained complexity took three of the problems from our list above and postulated that the state\-of\-the\-art algorithms cannot be beaten: in the word RAM model of computation withO\(logn\)O\(\\log n\)\-bit words, APSP with polynomially bounded integer weights requiresn3−o\(1\)n^\{3\-o\(1\)\}time \(the “APSP hypothesis”\[[RZ04](https://arxiv.org/html/2610.06783#bib.bibx140),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[AV14](https://arxiv.org/html/2610.06783#bib.bibx26)\]\),33SUM onnnintegers of polynomial size requiresn2−o\(1\)n^\{2\-o\(1\)\}time \(the “33SUM hypothesis”\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92),[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135)\]\), and there is noε\>0\\varepsilon\>0such that CNF\-SAT onnnvariables andO\(n\)O\(n\)clauses can be solved in\(2−ε\)n\(2\-\\varepsilon\)^\{n\}time \(the “Strong Exponential Time Hypothesis,” SETH\[[IP01](https://arxiv.org/html/2610.06783#bib.bibx103),[IPZ01](https://arxiv.org/html/2610.06783#bib.bibx104),[CIP10](https://arxiv.org/html/2610.06783#bib.bibx58)\]\)\.
Through fine\-grained reductions, FGC built a web of relations among problems, and within it, classes of problems that are equivalent to each other \(see the surveys\[[Vas18](https://arxiv.org/html/2610.06783#bib.bibx154),[Bri19](https://arxiv.org/html/2610.06783#bib.bibx45)\]\)\. For a large variety of problems for which no improved running times had been obtained in decades, FGC pointed to reasons: they are 3SUM\-hard, APSP\-hard, SETH\-hard, or worse\. In other words, to improve the known algorithms, one knew which obstacle needed to be overcome\.
For instance, many problems are known to be equivalent to APSP under fine\-grained reductions\. Either all of the following problems are solvable in*truly subcubic*time, meaning inO\(n3−ε\)O\(n^\{3\-\\varepsilon\}\)time for some constantε\>0\\varepsilon\>0\(*truly subquadratic*is defined similarly\), or none of them is: the\(min,\+\)\(\\min,\+\)\-productA⋆BA\\star Bof twon×nn\\times nmatricesAAandBB\(defined by\(A⋆B\)\[i,j\]=mink\(A\[i,k\]\+B\[k,j\]\)\(A\\star B\)\[i,j\]=\\min\_\{k\}\(A\[i,k\]\+B\[k,j\]\)\)\[[FM71](https://arxiv.org/html/2610.06783#bib.bibx86),[AHU74](https://arxiv.org/html/2610.06783#bib.bibx19)\]111The equivalence between APSP and\(min,\+\)\(\\min,\+\)\-product is extremely tight: the running times are the same up to constant factors\[[FM71](https://arxiv.org/html/2610.06783#bib.bibx86),[AHU74](https://arxiv.org/html/2610.06783#bib.bibx19)\]\., Negative Triangle and Second Shortest Simple Path\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\], Graph Radius\[[AGV15](https://arxiv.org/html/2610.06783#bib.bibx16),[AGV23](https://arxiv.org/html/2610.06783#bib.bibx17)\], Tree Edit Distance\[[BGMW20](https://arxiv.org/html/2610.06783#bib.bibx39),[NPS\+25](https://arxiv.org/html/2610.06783#bib.bibx133)\], and many other problems\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[RV11](https://arxiv.org/html/2610.06783#bib.bibx138),[AGV15](https://arxiv.org/html/2610.06783#bib.bibx16),[AGV23](https://arxiv.org/html/2610.06783#bib.bibx17)\], more of which are listed below, after Figure[1](https://arxiv.org/html/2610.06783#S1.F1)\. Perhaps surprisingly, it is also known\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66)\]that solving APSP in truly subcubic time would give a polynomially faster algorithm for directed unweighted APSP as well, and the corresponding hypotheses are in fact equivalent\[[Fis26](https://arxiv.org/html/2610.06783#bib.bibx82)\]\(albeit conditionally222The equivalence in\[[Fis26](https://arxiv.org/html/2610.06783#bib.bibx82)\]requires bothω=2\\omega=2and the resolution of a conjecture in combinatorics\.\), even though the longstanding running times of the two problems are different:≈n3\\approx n^\{3\}for APSP and≈n2\.5\\approx n^\{2\.5\}for directed unweighted APSP \(ifω=2\\omega=2\)\.
Similar reductions and equivalences are also known for33SUM: all nontrivial 3\-linear degeneracy tests are equivalent to33SUM\[[DGS20](https://arxiv.org/html/2610.06783#bib.bibx73)\], and many other problems are 3SUM\-hard \(e\.g\., many problems in computational geometry\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92),[BHP01](https://arxiv.org/html/2610.06783#bib.bibx41),[SEO03](https://arxiv.org/html/2610.06783#bib.bibx146),[AHP08](https://arxiv.org/html/2610.06783#bib.bibx18)\], and some string problems\[[ACLL14](https://arxiv.org/html/2610.06783#bib.bibx6),[AVW14](https://arxiv.org/html/2610.06783#bib.bibx27),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\]\)\.
CNF\-SAT reduces to Orthogonal Vectors\[[Wil05](https://arxiv.org/html/2610.06783#bib.bibx163)\], so that unless SETH is refuted, OV requiresn2−o\(1\)n^\{2\-o\(1\)\}time\. SETH also implies fine\-grained hardness for many exponential\-time problems\[[CDL\+16](https://arxiv.org/html/2610.06783#bib.bibx49)\]\.
Both33SUM and APSP reduce to the Exact Triangle problem \(given a tripartite graph with integer edge weights, is there a triangle whose three weights sum to zero?\)\[[VW13](https://arxiv.org/html/2610.06783#bib.bibx158),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\]\. Through Exact Triangle, both reduce to online Set Disjointness \(from the list above\), and even to its offline version, in which the query pairs are given in advance together with the sets\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160),[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\]; for33SUM, direct reductions are also known\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[JX23](https://arxiv.org/html/2610.06783#bib.bibx109),[ABF23](https://arxiv.org/html/2610.06783#bib.bibx1)\]\. In graph terms, offline Set Disjointness is the All\-Edges Sparse Triangle problem: given a graph withmmedges, decide for every edge whether it lies in a triangle\.
All\-Edges Sparse Triangle thus inherits the hardness of both33SUM and APSP, and it is in turn the source of the conditional lower bounds for Set Disjointness data structures, dynamic graph problems, and other problems\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[AV14](https://arxiv.org/html/2610.06783#bib.bibx26),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[GLP19](https://arxiv.org/html/2610.06783#bib.bibx90)\]\. Many came to regard it as one of the most reliably hard problems in fine\-grained complexity, and the evidence seemed good\.
All\-Edges Sparse Triangle can be solved inO\(m3/2\)O\(m^\{3/2\}\)time just by listing all triangles\[[IR78](https://arxiv.org/html/2610.06783#bib.bibx105),[CN85](https://arxiv.org/html/2610.06783#bib.bibx60)\], and a high\-degree/low\-degree split combined with matrix multiplication\[[AYZ97](https://arxiv.org/html/2610.06783#bib.bibx32)\]improves this toO\(m2ω/\(ω\+1\)\)O\(m^\{2\\omega/\(\\omega\+1\)\}\), where2≤ω<2\.3722\\leq\\omega<2\.372is the matrix multiplication exponent\.333Triangle detection innn\-vertex graphs has long been known to be reducible to matrix multiplication\[[IR78](https://arxiv.org/html/2610.06783#bib.bibx105)\]\.Even ifω=2\\omega=2, this ism4/3m^\{4/3\}\. On the graphs the reductions produce, which havennvertices of degree aboutn\\sqrt\{n\}, this equals the brute\-force running timen2n^\{2\}conjectured to be optimal\. Matrix multiplication only seemed useful for dealing with dense inputs, whereas these instances ask for a sparse set of outputs, and it seemed plausible that no technique could do better\.
However, a reduction fromAAtoBB, proved in order to show thatBBis hard, is also an algorithm forAAwheneverBBturns out to be easy\. In this paper we give a new algorithm for a*lopsided*version of All\-Edges Sparse Triangle, in which the graph is tripartite and one of the three parts is significantly smaller than the other two\. Most known reductions to All\-Edges Sparse Triangle can be slightly modified to produce such instances\.
As a consequence, all of the problems in the list above \(and many more\), except for CNF\-SAT and Orthogonal Vectors, have polynomially faster algorithms than before:
- •33SUM: deterministicO\(n1\.9992\)O\(n^\{1\.9992\}\)time for integers of polynomial size \(Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)\), and for real numbers, a Las Vegas algorithm withO\(n1\.998\)O\(n^\{1\.998\}\)expected time whose only operations on real numbers are comparisons, additions, and subtractions \(Theorem[35](https://arxiv.org/html/2610.06783#Thmtheorem35)\)\.
- •APSP: deterministicO\(n2\.9995\)O\(n^\{2\.9995\}\)time for polynomially bounded integer weights, and the same bound for the\(min,\+\)\(\\min,\+\)\-product \(Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)\), and for real weights, Las Vegas algorithms withO\(n2\.998\)O\(n^\{2\.998\}\)expected time, again using only comparisons, additions, and subtractions on real numbers \(Theorem[35](https://arxiv.org/html/2610.06783#Thmtheorem35)\)\.
- •Directed Unweighted APSP: a deterministic algorithm running inO\(n2\+μ−ε′′\)O\(n^\{2\+\\mu\-\\varepsilon^\{\\prime\\prime\}\}\)time for some constantε′′\>0\\varepsilon^\{\\prime\\prime\}\>0, whereμ<0\.5275\\mu<0\.5275is defined byω\(1,μ,1\)=1\+2μ\\omega\(1,\\mu,1\)=1\+2\\mu, andω\(1,μ,1\)\\omega\(1,\\mu,1\)is the exponent of multiplying ann×nμn\\times n^\{\\mu\}by annμ×nn^\{\\mu\}\\times nmatrix\. Note thatO~\(n2\+μ\)≤O\(n2\.5275\)\\tilde\{O\}\(n^\{2\+\\mu\}\)\\leq O\(n^\{2\.5275\}\)is the longstanding running time of Zwick’s algorithm\. This is the first improvement over Zwick’s algorithm that does not come from faster rectangular matrix multiplication, and it refutes the Directed Unweighted APSP hypothesis\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66),[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68),[Fis26](https://arxiv.org/html/2610.06783#bib.bibx82)\]\(Theorem[34](https://arxiv.org/html/2610.06783#Thmtheorem34)\)\.
- •Tree Edit Distance:O\(n2\.9995\)O\(n^\{2\.9995\}\)time for polynomially bounded integer costs via the tight reduction of\[[NPS\+25](https://arxiv.org/html/2610.06783#bib.bibx133)\]\.
- •Online Set Disjointness: forD≤N0\.12D\\leq N^\{0\.12\}, a deterministic data structure whose preprocessing time is polynomially less thanN2N^\{2\}and whose query time is polynomially less thanD\\sqrt\{D\}, and which returns\|SI∩TJ\|\|S\_\{I\}\\cap T\_\{J\}\|, so that it solves the counting version as well\. ForD≤N1/18D\\leq N^\{1/18\}, the preprocessing takesO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)time and the queries takeO\(D0\.437\)O\(D^\{0\.437\}\)time \(Theorem[3](https://arxiv.org/html/2610.06783#Thmtheorem3)\)\.
The APSP and33SUM hypotheses are therefore refuted, and so are several other hypotheses of fine\-grained complexity\. Figure[1](https://arxiv.org/html/2610.06783#S1.F1)summarizes the problems affected, and in Section[1\.2](https://arxiv.org/html/2610.06783#S1.SS2)below we list many more new algorithmic results\. All of these results follow from one algorithm, for computing a given sparse set of entries of the product of two thin matrices, which we describe in the next subsection\.
We view this as a great success for fine\-grained complexity\. The hypotheses were made to be tested\. The reductions and connections between problems have always been the focus of fine\-grained complexity, and these connections persist whether or not the problems turn out to be hard\. The web of reductions that was interpreted to imply hardness is exactly what turns a single new algorithm into faster algorithms for a myriad of problems at once\. This also opens a number of research directions in fine\-grained complexity, algorithm design, and algebraic complexity; we discuss some in Section[6](https://arxiv.org/html/2610.06783#S6)\.
### 1\.1All\-Edges Sparse Triangle
In this paper we present a simple algebraic technique that solves All\-Edges Sparse Triangle inO\(n2−δ\)O\(n^\{2\-\\delta\}\)time, for a constantδ\>0\\delta\>0, on sparse tripartite graphs with two parts ofnnvertices and a third part of at mostn0\.12n^\{0\.12\}vertices\. In matrix language it computes a prescribed sparse set of entries of a dense product of thin matrices\. We call a product of anN×DN\\times Dmatrix by aD×ND\\times Nmatrix*thin*whenDDis a small power ofNN, and, given a setWWof positions of the product, we call these positions, and the entries of the product at them,*wanted*\. Unlike in usual fast matrix multiplication algorithms, the wanted entries are a sparse subset of the full matrix product, and our new algorithm critically exploits this\. A matrix multiplication algorithm computes allN2N^\{2\}entries of the product whether they are wanted or not, and thus takesΩ\(N2\)\\Omega\(N^\{2\}\)time, whereas ours is faster than this\. Our theorem is as follows\.
###### Theorem 1\(see Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)and Theorem[25](https://arxiv.org/html/2610.06783#Thmtheorem25)\)\.
LetN≥D18N\\geq D^\{18\}, letX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}have entries of absolute valueNO\(1\)N^\{O\(1\)\}, and letWWbe any set of\|W\|≤N2/D\|W\|\\leq N^\{2\}/\\sqrt\{D\}positions\. The entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, can be computed deterministically inO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)operations onO\(logN\)O\(\\log N\)\-bit integers\. More generally, for everyε<0\.1204\\varepsilon<0\.1204and everyκ\>0\\kappa\>0there is aγ\>0\\gamma\>0such that, wheneverD≤NεD\\leq N^\{\\varepsilon\}and\|W\|≤N2/Dκ\|W\|\\leq N^\{2\}/D^\{\\kappa\}, the task takesO\(N2/Dγ\)O\(N^\{2\}/D^\{\\gamma\}\)operations\.
For comparison, when\|W\|=N2/D\|W\|=N^\{2\}/\\sqrt\{D\}, computing each wanted entry one by one as an inner product costsN2DN^\{2\}\\sqrt\{D\}, and computing the whole product with Coppersmith’s rectangular matrix multiplication algorithm\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62)\]costsN2\+o\(1\)N^\{2\+o\(1\)\}\. Our algorithm is faster than either of these, and uses polynomially less than one operation per entry of the full product\.
The algorithm builds on Coppersmith’s algorithm\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62)\]for rectangular matrix multiplication, which makes use of an algebraic identity of Schönhage\[[Sch81](https://arxiv.org/html/2610.06783#bib.bibx143)\]\. The high\-level idea is to carefully analyze the inner workings of Coppersmith’s algorithm to see which operations are no longer needed since they are only used to compute output entries outside ofWW\. This approach would not work effectively for most known matrix multiplication algorithms,444In fact, prior to this work, the authors had tried approaches like this using the Coppersmith–Winograd identities\[[CW90](https://arxiv.org/html/2610.06783#bib.bibx69)\]and more, without success\.but it turns out that Schönhage’s identity has sparsity and combinatorial properties we can take advantage of to make this work\. See Section[2](https://arxiv.org/html/2610.06783#S2)for a more detailed overview\.
Coppersmith’s paper\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62)\]contains two algorithms\. The first algorithm achieves ann2polylognn^\{2\}\\polylog nrunning time forn×n0\.172×nn\\times n^\{0\.172\}\\times nmatrix multiplication \(for matrices withpolylogn\\polylog nbit entries\)\. We do not use this algorithm here, but it has been extensively used before, both in the previous fastest APSP algorithm by Williams\[[Wil18](https://arxiv.org/html/2610.06783#bib.bibx166)\]and to design the fastest fine\-grained algorithms for a number of problems using the polynomial method\[[Wil14](https://arxiv.org/html/2610.06783#bib.bibx164),[AWY15](https://arxiv.org/html/2610.06783#bib.bibx30),[AW15](https://arxiv.org/html/2610.06783#bib.bibx29),[CW21](https://arxiv.org/html/2610.06783#bib.bibx70),[ACW16](https://arxiv.org/html/2610.06783#bib.bibx7),[ACW20](https://arxiv.org/html/2610.06783#bib.bibx8)\]\. Our approach instead builds on the second algorithm in\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62)\], which only achieves ann2\+o\(1\)n^\{2\+o\(1\)\}running time \(and notn2polylognn^\{2\}\\polylog n\) forn×nα×nn\\times n^\{\\alpha\}\\times nmatrix multiplication for some constantα\>0\\alpha\>0; theseno\(1\)n^\{o\(1\)\}factors become insignificant in our setting of polynomial savings\. Subsequent work on rectangular matrix multiplication has mostly followed this second approach\[[Cop97](https://arxiv.org/html/2610.06783#bib.bibx63),[LG12](https://arxiv.org/html/2610.06783#bib.bibx120),[LU18](https://arxiv.org/html/2610.06783#bib.bibx124),[VXXZ24](https://arxiv.org/html/2610.06783#bib.bibx161)\]achieving the current boundα\>0\.321\\alpha\>0\.321\. In order to take advantage of the wanted set, we will modify Coppersmith’s second algorithm quite differently from prior work, in a way which ultimately achieves the worse boundα\>0\.12\\alpha\>0\.12\.
Computing the wanted entries of a thin matrix product is equivalent to the counting version of Lopsided All\-Edges Sparse Triangle \(ifXXandYYare the two biadjacency matrices, then\(XY\)\[a,b\]\(XY\)\[a,b\]is the number of middle vertices adjacent to bothaaandbb\), so it solves the detection variant as well\. In a tripartite graph with two parts ofnnvertices and a middle part ofnεn^\{\\varepsilon\}vertices, our algorithm counts the triangles through each of\|W\|\|W\|prescribed pairs of outer vertices inO\(\|W\|n0\.437ε\+n2−0\.063ε\)O\(\|W\|\\,n^\{0\.437\\varepsilon\}\+n^\{2\-0\.063\\varepsilon\}\)time forε<1/18\\varepsilon<1/18, which isO\(n2−0\.063ε\)O\(n^\{2\-0\.063\\varepsilon\}\)for\|W\|≤n2−ε/2\|W\|\\leq n^\{2\-\\varepsilon/2\}, and, whenever\|W\|≤n2−Ω\(1\)\|W\|\\leq n^\{2\-\\Omega\(1\)\}, in truly subquadratic time for everyε<0\.1204\\varepsilon<0\.1204\(Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16)and Theorem[25](https://arxiv.org/html/2610.06783#Thmtheorem25)\)\.
### 1\.2Known reductions
It is known that33SUM\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\], Exact Triangle and hence APSP\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160)\], and even their real\-valued versions\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\], all reduce to Lopsided All\-Edges Sparse Triangle\. In matrix terms, this detection version is a Boolean matrix problem, and it is also known as offline Set Disjointness\[[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[VX20](https://arxiv.org/html/2610.06783#bib.bibx160)\]\.
The published reductions are mostly randomized, since the hypotheses were stated for randomized algorithms, but some have been derandomized: the reductions from33SUM\[[CH20](https://arxiv.org/html/2610.06783#bib.bibx51),[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\], including the reduction of\[[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\]to offline Set Disjointness\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84), Theorem 1\.4\], and the reduction from Exact Triangle to the standard balanced case of All\-Edges Sparse Triangle, by Chan and Xu\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\]\. We show that the reduction from Exact Triangle to the lopsided case can also be made deterministic by hashing the weights modulo a prime chosen with fast matrix multiplication and building the instances as Chan and Xu\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\]do \(Section[3\.2](https://arxiv.org/html/2610.06783#S3.SS2)\), so we refute both hypotheses deterministically\.
With randomization, we refute the hypotheses in their most general form, where the inputs are real numbers\. The reduction of Chan, Vassilevska Williams, and Xu\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]from the real\-valued problems to sparse triangle problems \(which was designed as a hardness argument\) uses only additions, subtractions, and comparisons \(via Fredman’s trick\[[Fre76](https://arxiv.org/html/2610.06783#bib.bibx87)\]\), so combined with our algorithm it gives Las Vegas algorithms for the real\-valued versions of33SUM and APSP \(Section[5\.2](https://arxiv.org/html/2610.06783#S5.SS2)\)\. Unlike the reductions for integer inputs, which need only the detection version, the reduction of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]that we use is to the counting version of Lopsided All\-Edges Sparse Triangle, which asks for the number of triangles through each prescribed pair, and which our Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)also solves\. Chan, Vassilevska Williams, and Xu\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]also give a reduction to the Boolean version of All\-Edges Sparse Triangle, but it is tight only from real APSP, not from real33SUM or Exact Triangle\.
###### Theorem 2\(Theorems[19](https://arxiv.org/html/2610.06783#Thmtheorem19),[22](https://arxiv.org/html/2610.06783#Thmtheorem22), and[35](https://arxiv.org/html/2610.06783#Thmtheorem35)\)\.
On a word RAM withO\(logn\)O\(\\log n\)\-bit words, deterministic algorithms solve the following problems, where all numbers in the input are integers of absolute valuenO\(1\)n^\{O\(1\)\}:
- •Exact Triangle onnn\-vertex graphs inO\(n2\.9983\)O\(n^\{2\.9983\}\)time,
- •APSP on directednn\-vertex graphs with no negative cycles inO\(n2\.9995\)O\(n^\{2\.9995\}\)time,
- •the\(min,\+\)\(\\min,\+\)\-product of twon×nn\\times nmatrices inO\(n2\.9995\)O\(n^\{2\.9995\}\)time, and
- •33SUM onnnnumbers inO\(n1\.9992\)O\(n^\{1\.9992\}\)time\.
In the real RAM in which the only operations allowed on real numbers are comparisons, additions, and subtractions, Las Vegas algorithms solve the following problems on real inputs:
- •33SUM onnnnumbers inO\(n1\.998\)O\(n^\{1\.998\}\)expected time,
- •APSP inO\(n2\.998\)O\(n^\{2\.998\}\)expected time,
- •the\(min,\+\)\(\\min,\+\)\-product inO\(n2\.998\)O\(n^\{2\.998\}\)expected time, and
- •Exact Triangle inO\(n2\.998\)O\(n^\{2\.998\}\)expected time\.
Lower bounds are known for the above problems in some restricted models of computation: over the\(min,\+\)\(\\min,\+\)semiring, straight\-line programs needn3n^\{3\}operations\[[Ker70](https://arxiv.org/html/2610.06783#bib.bibx111)\]and path\-comparison algorithms needΩ\(n3\)\\Omega\(n^\{3\}\)time\[[KKP93](https://arxiv.org/html/2610.06783#bib.bibx112)\], and 3\-linear decision trees for33SUM need depthΩ\(n2\)\\Omega\(n^\{2\}\)\[[Eri99](https://arxiv.org/html/2610.06783#bib.bibx79),[AC05](https://arxiv.org/html/2610.06783#bib.bibx4)\]\.
Our algorithms are not in these restricted models, since the known reductions remove the weights \(by hashing, or by Fredman’s trick for real inputs\), and we then count triangles in unweighted graphs using integer matrix multiplication\.
We remark that there already was some indication that some of these models were too restricted, as for instance recent work\[[KLM19](https://arxiv.org/html/2610.06783#bib.bibx113)\]showed that66\-linear decision trees of depthO\(nlog2n\)O\(n\\log^\{2\}n\)suffice to solve33SUM, and similar strong bounds are known for Exact Triangle\. \(See the paragraph on unaffected conjectures below for more on this\.\)
##### Data structure version, and hinted Online Matrix–Vector\.
Our algorithm for computing the wanted entries of a thin matrix product can also be converted into a data structure\. We strengthen Theorem[1](https://arxiv.org/html/2610.06783#Thmtheorem1)as follows \(Section[4](https://arxiv.org/html/2610.06783#S4)\):
###### Theorem 3\(see Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)and Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\)\.
LetN≥D18N\\geq D^\{18\}, and letX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\},Y∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}have entries of absolute valueNO\(1\)N^\{O\(1\)\}\. The pair\(X,Y\)\(X,Y\)can be preprocessed deterministically inO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)time, polynomially less than the size of the product\. After this, any single entry\(XY\)\[I,J\]\(XY\)\[I,J\]can be computed deterministically inO\(D0\.437\)O\(D^\{0\.437\}\)time, polynomially less thanD\\sqrt\{D\}\. More generally, for everyε<0\.1204\\varepsilon<0\.1204and everyq\>0q\>0there is aγ\>0\\gamma\>0such that, wheneverD≤NεD\\leq N^\{\\varepsilon\}, the pair can be preprocessed inO\(N2/Dγ\)O\(N^\{2\}/D^\{\\gamma\}\)time, after which any single entry can be computed inO\(Dq\)O\(D^\{q\}\)time\.
The bounds of Theorem[1](https://arxiv.org/html/2610.06783#Thmtheorem1)follow by asking\|W\|\|W\|queries to the data structure\.
This allows us to refute the hinted Online Matrix–Vector \(OMv\) conjectures of van den Brand, Nanongkai, and Saranurak\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]in the regime of thin hints, i\.e\., for very rectangular matrices\. In the OMv problem, one is given ann×nn\\times nBoolean matrixMM, and thennnvectors arrive one at a time, each of which must be multiplied byMMbefore the next one arrives\. The OMv conjecture\[[HKNS15](https://arxiv.org/html/2610.06783#bib.bibx100)\]asserts that this requiresn3−o\(1\)n^\{3\-o\(1\)\}total time, and it implies tight lower bounds for many dynamic problems\. In the hinted versions, the algorithm gets a hint before the vector arrives\. For instance, invv\-hinted Mv,MMis ann×tn\\times tmatrix and the hint is at×nt\\times nmatrixVV, one of whose columns will be the vector\. One can then either compute all ofMVMVby fast matrix multiplication as soon as the hint arrives, or wait and compute one matrix–vector product inO\(nt\)O\(nt\)time, and van den Brand et al\.\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]conjecture that no algorithm is polynomially faster than both\. Our data structure is faster than both when the hint is thin:
###### Theorem 4\(Corollary[40](https://arxiv.org/html/2610.06783#Thmtheorem40)\)\.
Thevv\-hinted Mv, Mv\-hinted Mv, and uMv\-hinted uMv conjectures of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\(Conjectures 5\.2, 5\.7, and 5\.12 there\) are refuted in the regime of thin hints\. For hint dimensiont=nτt=n^\{\\tau\}with0<τ<1/180<\\tau<1/18, the phase after the hint takesO\(n2−0\.063τ\)O\(n^\{2\-0\.063\\tau\}\)time and the phase after the vectorO\(n1\+0\.437τ\)O\(n^\{1\+0\.437\\tau\}\)time, against the conjecturedn2−o\(1\)n^\{2\-o\(1\)\}andn1\+τ−o\(1\)n^\{1\+\\tau\-o\(1\)\}\. Correspondingly, the uMv version, whose two hints have dimensionst1=nτ1t\_\{1\}=n^\{\\tau\_\{1\}\}andt2=nτ2t\_\{2\}=n^\{\\tau\_\{2\}\}, fails forτ1<τ2/18\\tau\_\{1\}<\\tau\_\{2\}/18\. All three fail, with smaller savings, for everyτ<0\.1204\\tau<0\.1204\(for the uMv version,τ1<0\.1204τ2\\tau\_\{1\}<0\.1204\\,\\tau\_\{2\}\)\.
The main conditional lower bounds of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]for dynamic matrix inverse use the conjectures atτ≈0\.53\\tau\\approx 0\.53, far from the thin regime, and are unaffected\. The bounds that are affected are those for the tail end of the update–query trade\-offs with the fastest queries\. These had established the conditional optimality of the dynamic matrix inverse algorithms of Sankowski\[[San04](https://arxiv.org/html/2610.06783#bib.bibx141)\]and of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]when queries are fast, and these no longer have a believable conditional lower bound\. Neither do other results whose lower bounds were based on this end of the trade\-offs, e\.g\., for partially dynamic distance oracles\[[HLS24](https://arxiv.org/html/2610.06783#bib.bibx101)\]and dynamic attention\[[vdBSZ24](https://arxiv.org/html/2610.06783#bib.bibx156)\]\(Section[5\.4](https://arxiv.org/html/2610.06783#S5.SS4)\)\.
Exact Triangle≡\\equiv\#Exact Triangle\[[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68)\]*here:*truly subcubicAPSP class\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[RV11](https://arxiv.org/html/2610.06783#bib.bibx138),[AGV15](https://arxiv.org/html/2610.06783#bib.bibx16),[AGV23](https://arxiv.org/html/2610.06783#bib.bibx17),[BGMW20](https://arxiv.org/html/2610.06783#bib.bibx39),[NPS\+25](https://arxiv.org/html/2610.06783#bib.bibx133),[TT00](https://arxiv.org/html/2610.06783#bib.bibx153),[BDT16](https://arxiv.org/html/2610.06783#bib.bibx36)\]APSP,\(min,\+\)\(\\min,\+\)\-product, Negative / Min\-Weight Triangle, Metricity,\(min,\+\)\(\\min,\+\)\-Product Verification, Minimum Weight Cycle, Replacement Paths, Second Shortest Simple Path, Radius, Median, Betweenness Centrality \(for unique shortest paths\), Tree Edit Distance, Maximum Subarray*here:*truly subcubicZero\-Weightkk\-Cliquefolding\[[NP85](https://arxiv.org/html/2610.06783#bib.bibx132)\]*here:*O\(nk−ε\)O\(n^\{k\-\\varepsilon\}\)3SUM class\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84),[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[CH20](https://arxiv.org/html/2610.06783#bib.bibx51),[DGS20](https://arxiv.org/html/2610.06783#bib.bibx73),[LPV20](https://arxiv.org/html/2610.06783#bib.bibx123),[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68),[FJX25](https://arxiv.org/html/2610.06783#bib.bibx83)\]3SUM, GeomBase, All\-Numbers 3SUM, Convolution\-3SUM,3\-LinearDegeneracy Testing \(e\.g\. 3AP\), \#3SUM; MonoConvolution \(baselinen1\.5n^\{1\.5\}\)*here:*truly subquadratic, andO\(n1\.5−ε\)O\(n^\{1\.5\-\\varepsilon\}\)for MonoConvolutionAll\-Edges Sparse Triangle\(balanced,m4/3m^\{4/3\}\), triangle listing\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[VX20](https://arxiv.org/html/2610.06783#bib.bibx160),[DKPV20](https://arxiv.org/html/2610.06783#bib.bibx74),[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\], and 4\-cycle listing\[[ABKZ22](https://arxiv.org/html/2610.06783#bib.bibx3),[JX23](https://arxiv.org/html/2610.06783#bib.bibx109)\]3SUM\-hard problemscomputational geometry: three collinear points \(hence minimum\-area triangle\), point covering, motion planning\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92)\], polygon containment\[[BHP01](https://arxiv.org/html/2610.06783#bib.bibx41)\]strings: jumbled indexing\[[ACLL14](https://arxiv.org/html/2610.06783#bib.bibx6)\], local alignment\[[AVW14](https://arxiv.org/html/2610.06783#bib.bibx27)\]set\-intersection and set\-disjointness data structures\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\]\(for universes larger than in Theorem[3](https://arxiv.org/html/2610.06783#Thmtheorem3)\)approximate distance oracles\[[ABKZ22](https://arxiv.org/html/2610.06783#bib.bibx3),[ABF23](https://arxiv.org/html/2610.06783#bib.bibx1)\]Dynamic graph problems\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[AV14](https://arxiv.org/html/2610.06783#bib.bibx26),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\]: reachability, shortest paths, subgraph connectivity, matching, …\(𝐦𝐢𝐧,\+\)\(\\min,\+\)\-Convolution class\[[CMWW19](https://arxiv.org/html/2610.06783#bib.bibx59),[KPS17](https://arxiv.org/html/2610.06783#bib.bibx117)\]: Superadditivity Testing, MaxConv Upper Bound, Unbounded and 0/1 Knapsack with capacitytt\(time in terms ofn\+tn\+t\)*here:*truly subquadratic \(randomized for 0/1 Knapsack\)Min\-/Max\-Weightkk\-Cliquefolding\[[NP85](https://arxiv.org/html/2610.06783#bib.bibx132)\]*here:*O\(nk−ε\)O\(n^\{k\-\\varepsilon\}\)Directed unweighted APSP\(and weights≤logcn\\leq\\penalty\\log^\{c\}n\)\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66)\]*here:*polynomially faster than Zwick’s algorithmLopsided All\-Edges Sparse TriangleDefinitions[13](https://arxiv.org/html/2610.06783#Thmtheorem13)and[14](https://arxiv.org/html/2610.06783#Thmtheorem14)*here:*truly subquadraticforD=nεD=n^\{\\varepsilon\},ε<0\.12\\varepsilon<0\.12Real\-valued problems\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]: real 3SUM, real APSP and\(min,\+\)\(\\min,\+\)\-product, real Exact Triangle*here:*truly subquadratic and truly subcubic \(Las Vegas\)Hinted OMv\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\], thin regime:vv\-hinted Mv, Mv\-hinted Mv, uMv\-hinted uMv*here:*polynomially faster than conjectured3XOR*here:*truly subquadratic\[[CH20](https://arxiv.org/html/2610.06783#bib.bibx51),[VW13](https://arxiv.org/html/2610.06783#bib.bibx158)\]\[[VW13](https://arxiv.org/html/2610.06783#bib.bibx158),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\]\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160),[CX24](https://arxiv.org/html/2610.06783#bib.bibx71),[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\], Sec\.[3\.2](https://arxiv.org/html/2610.06783#S3.SS2)Sec\.[5\.2](https://arxiv.org/html/2610.06783#S5.SS2)Thm\.[24](https://arxiv.org/html/2610.06783#Thmtheorem24),Sec\.[5\.4](https://arxiv.org/html/2610.06783#S5.SS4)Remark[23](https://arxiv.org/html/2610.06783#Thmtheorem23)\[[BCD\+14](https://arxiv.org/html/2610.06783#bib.bibx34)\]\[[BIS17](https://arxiv.org/html/2610.06783#bib.bibx43),[CMWW19](https://arxiv.org/html/2610.06783#bib.bibx59)\]Unaffected:SETH, Orthogonal Vectors, OMv without hints,kk\-SUM andkk\-XOR fork≥4k\\geq 4, 3SUM\-Indexingnew, polynomially faster algorithmreductions no longer give evidence of hardnessA→BA\\to B:AAreduces toBB, so our algorithm forBBgives one forAAA→BA\\to B:BBis hard underAAA⇢BA\\dashrightarrow B:AAuses the data structure versionof our algorithm forBB\(Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)\)
Figure 1:Problems affected by our algorithm, which solves the problem in the orange box \(Lopsided All\-Edges Sparse Triangle\) directly\. The problems inside each of the three thick\-bordered blue boxes \(3SUM class, Exact Triangle, and APSP class\) are pairwise equivalent under fine\-grained reductions \(for MonoConvolution, whose baseline isn1\.5n^\{1\.5\}, this meansO\(n1\.5−ε\)O\(n^\{1\.5\-\\varepsilon\}\)time\), and we omit the arrows between them\. Problems in gray boxes are reached from 3SUM, APSP, or Exact Triangle only by one\-way reductions, so our result gives no faster algorithms for them, but these reductions no longer give evidence of hardness\. The new algorithms are deterministic except where marked\. Citations are to the reductions; for the problems in the top rows, the cited papers contain many more problems of the same kind\.
##### More new algorithms\.
Figure[1](https://arxiv.org/html/2610.06783#S1.F1)shows the reductions involved\. In addition to the results listed above, composing known reductions with our algorithms for Exact Triangle,33SUM, APSP, and the\(min,\+\)\(\\min,\+\)\-product \(Theorem[2](https://arxiv.org/html/2610.06783#Thmtheorem2)\) gives polynomially faster algorithms for many other problems\. We next list some examples\. Throughout, the numbers in the input are integers of absolute value polynomial in the input size,nnis the number of vertices, matrix rows, or input elements, and our algorithms are deterministic unless stated otherwise\.
- •The APSP class\.Negative Triangle, which asks whether an edge\-weighted graph has a triangle of negative total weight, is arguably the simplest problem of the subcubic equivalence class of APSP\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\]; the fact that it is equivalent to APSP made many other reductions possible\. The APSP subcubic equivalence class also contains Minimum Weight Cycle \(with nonnegative weights\)\[[RV11](https://arxiv.org/html/2610.06783#bib.bibx138),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\], Replacement Paths \(for each edge of a shortestss–ttpath, the length of a shortestss–ttpath avoiding it\) and Second Shortest Simple Path in directed graphs\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\], Radius, Median, and \(for unique shortest paths\) Betweenness Centrality\[[AGV15](https://arxiv.org/html/2610.06783#bib.bibx16),[AGV23](https://arxiv.org/html/2610.06783#bib.bibx17)\], Metricity \(does a given matrix satisfy the triangle inequality?\) and\(min,\+\)\(\\min,\+\)\-Product Verification \(isC=A⋆BC=A\\star Bfor given matricesAA,BB, andCC?\)\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\], Tree Edit Distance\[[BGMW20](https://arxiv.org/html/2610.06783#bib.bibx39),[NPS\+25](https://arxiv.org/html/2610.06783#bib.bibx133)\], Maximum Subarray \(the contiguous submatrix of ann×nn\\times nmatrix with the largest sum of entries\)\[[TT00](https://arxiv.org/html/2610.06783#bib.bibx153),[BDT16](https://arxiv.org/html/2610.06783#bib.bibx36)\], the Wiener Index \(returning the sum of all distances in a graph\)\[[LVW18](https://arxiv.org/html/2610.06783#bib.bibx125)\], computing the number of witnesses for every entry of the\(min,\+\)\(\\min,\+\)\-product\[[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68)\]and a variety of parity versions of many of the mentioned problems\[[AFW20](https://arxiv.org/html/2610.06783#bib.bibx12)\]\.*We give the first truly subcubic algorithms for all of these problems*, and for Diameter and many other problems which reduce to APSP but may not be known to be equivalent\.
- •The33SUM class\.The subquadratic equivalence class of33SUM contains the variant with three input setsAA,BB, andCC\(is therea∈Aa\\in A,b∈Bb\\in B,c∈Cc\\in Cwitha\+b=ca\+b=c?\) and GeomBase \(givennnpoints with integer coordinates on the three horizontal linesy=0y=0,y=1y=1, andy=2y=2, is there a non\-horizontal line through three of them?\)\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92)\], All\-Numbers33SUM \(for every input number, decide whether it is part of a solution\)\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\]\(the reduction becomes deterministic with the self\-reductions of\[[LVWW16](https://arxiv.org/html/2610.06783#bib.bibx126),[GP18](https://arxiv.org/html/2610.06783#bib.bibx94)\], as noted in\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\]\), Convolution\-3SUM \(dox0,…,xn−1x\_\{0\},\\dots,x\_\{n\-1\}satisfyxi\+xj=xi\+jx\_\{i\}\+x\_\{j\}=x\_\{i\+j\}for somei,ji,j?\)\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[CH20](https://arxiv.org/html/2610.06783#bib.bibx51)\], and every nontrivial variant of 3\-Linear Degeneracy Testing \(are there distinct input numbersx1,x2,x3x\_\{1\},x\_\{2\},x\_\{3\}withα1x1\+α2x2\+α3x3=t\\alpha\_\{1\}x\_\{1\}\+\\alpha\_\{2\}x\_\{2\}\+\\alpha\_\{3\}x\_\{3\}=t, for fixed integersα1,α2,α3,t\\alpha\_\{1\},\\alpha\_\{2\},\\alpha\_\{3\},t?\), such as 3AP, the casex1\+x2=2x3x\_\{1\}\+x\_\{2\}=2x\_\{3\}\(do three of the numbers form an arithmetic progression?\)\[[DGS20](https://arxiv.org/html/2610.06783#bib.bibx73)\]\. The counting version \#3SUM is also in the class\[[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68),[FJX25](https://arxiv.org/html/2610.06783#bib.bibx83)\]; see the last item below\.*We give the first truly subquadratic algorithms for all of these problems*\. The33SUM class also contains MonoConvolution, a “colored” version of Boolean convolution: given three integer sequencesa,b,ca,b,cof lengthnn, determine for every indexiiwhether there is aj<ij<iwitha\[j\]=b\[i−j\]=c\[i\]a\[j\]=b\[i\-j\]=c\[i\]\. Lincoln, Polak, and Vassilevska Williams\[[LPV20](https://arxiv.org/html/2610.06783#bib.bibx123), Theorems 7 and 8\]show that MonoConvolution is\(n2,n1\.5\)\(n^\{2\},n^\{1\.5\}\)fine\-grained equivalent to33SUM: anO\(n2−ε\)O\(n^\{2\-\\varepsilon\}\)\-time algorithm for33SUM gives anO~\(n3/2−ε/\(8−2ε\)\)\\tilde\{O\}\(n^\{3/2\-\\varepsilon/\(8\-2\\varepsilon\)\}\)\-time algorithm for MonoConvolution\. Our approach givesO\(n1\.4999\)O\(n^\{1\.4999\}\)time for MonoConvolution, improving on the previousO~\(n1\.5\)\\tilde\{O\}\(n^\{1\.5\}\)time of\[[LPV20](https://arxiv.org/html/2610.06783#bib.bibx123)\]\.
- •The\(min,\+\)\(\\min,\+\)\-convolution class\.The\(min,\+\)\(\\min,\+\)\-convolution of two sequencesaaandbbofnnintegers is defined as the sequenceccwithc\[k\]=mini\+j=k\(a\[i\]\+b\[j\]\)c\[k\]=\\min\_\{i\+j=k\}\(a\[i\]\+b\[j\]\)for allkk\. This convolution version of APSP is fine\-grained reducible to both the\(min,\+\)\(\\min,\+\)\-product\[[BCD\+14](https://arxiv.org/html/2610.06783#bib.bibx34)\]and33SUM\[[BIS17](https://arxiv.org/html/2610.06783#bib.bibx43),[CMWW19](https://arxiv.org/html/2610.06783#bib.bibx59)\]\. Problems equivalent to\(min,\+\)\(\\min,\+\)\-convolution include Superadditivity Testing \(isa\[i\+j\]≥a\[i\]\+a\[j\]a\[i\+j\]\\geq a\[i\]\+a\[j\]for alli,ji,j?\), Maximum Consecutive Subsums \(for everykk, the largest sum ofkkconsecutive elements\), and Tree Sparsity \(a subtree withkkvertices of maximum weight in a vertex\-weighted tree\)\[[CMWW19](https://arxiv.org/html/2610.06783#bib.bibx59)\]\.*We give the first truly subquadratic algorithms for all of these problems*, refuting the\(min,\+\)\(\\min,\+\)\-convolution hypothesis\[[KPS17](https://arxiv.org/html/2610.06783#bib.bibx117),[CMWW19](https://arxiv.org/html/2610.06783#bib.bibx59)\]\. \(This would have been possible by refuting either the APSP or the33SUM hypothesis, and we refute both\.\)
- •Knapsack and Approximate Subset Sum\.Both 0/1 and Unbounded Knapsack, withnnitems and capacitytt, reduce to\(min,\+\)\(\\min,\+\)\-convolution\[[CMWW19](https://arxiv.org/html/2610.06783#bib.bibx59)\]\. So does approximating Subset Sum to within a factor1−ε1\-\\varepsilon, which is in fact equivalent to it: an algorithm for\(min,\+\)\(\\min,\+\)\-convolution in timeT\(n\)T\(n\)gives a randomized approximation scheme inO~\(n\+T\(1/ε\)\)\\tilde\{O\}\(n\+T\(1/\\varepsilon\)\)time\[[BN21](https://arxiv.org/html/2610.06783#bib.bibx44)\]\. For 0/1 Knapsack, the best known bound in terms ofnnand the largest item weightwmax≤tw\_\{\\max\}\\leq tisO~\(n\+wmax2\)\\tilde\{O\}\(n\+w\_\{\\max\}^\{2\}\)\[[Bri24](https://arxiv.org/html/2610.06783#bib.bibx46),[Jin24](https://arxiv.org/html/2610.06783#bib.bibx106)\]\.*We give the first algorithms running inO~\(n\+t2−δ\)\\tilde\{O\}\(n\+t^\{2\-\\delta\}\)time, and the first approximation scheme running inO~\(n\+\(1/ε\)2−δ\)\\tilde\{O\}\(n\+\(1/\\varepsilon\)^\{2\-\\delta\}\)time, for a constantδ\>0\\delta\>0\.*Only the algorithm for Unbounded Knapsack is deterministic\.
- •Zero\-, Min\-, and Max\-Weightkk\-Clique\.For a constantk≥3k\\geq 3, findkkvertices of an edge\-weighted graph whose\(k2\)\\binom\{k\}\{2\}edge weights sum to zero, or to the minimum or maximum possible value\. Due to the now classical reduction of Nešetřil and Poljak\[[NP85](https://arxiv.org/html/2610.06783#bib.bibx132)\]fromkk\-Clique to triangle detection, our new Exact Triangle algorithm immediately implies*the first algorithms running inO\(nk−ε\)O\(n^\{k\-\\varepsilon\}\)time for anε\>0\\varepsilon\>0*\(Section[5\.3](https://arxiv.org/html/2610.06783#S5.SS3)\), refuting the weightedkk\-Clique hypotheses\[[AL13](https://arxiv.org/html/2610.06783#bib.bibx21),[LVW18](https://arxiv.org/html/2610.06783#bib.bibx125),[BDT16](https://arxiv.org/html/2610.06783#bib.bibx36)\]\.
- •3XOR\.Given three lists ofnnvectors in𝔽2d\\mathbb\{F\}\_\{2\}^\{d\}, whered=O\(logn\)d=O\(\\log n\), decide whether there are vectorsaa,bb, andcc, one from each list, witha⊕b⊕c=0a\\oplus b\\oplus c=0, where⊕\\oplusdenotes the bitwise XOR\. This is a well\-studied variant of33SUM\[[JV16](https://arxiv.org/html/2610.06783#bib.bibx108),[DSW18](https://arxiv.org/html/2610.06783#bib.bibx77)\]\. It is not known to reduce to33SUM, but the same approach works for it as well, so*we give the first truly subquadratic algorithm*\(Remark[23](https://arxiv.org/html/2610.06783#Thmtheorem23)\)\.
- •Counting versions\.Counting the zero\-weight triangles of an Exact Triangle instance, or the solutions of a33SUM instance, is equivalent to the decision problem\[[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68)\], and for33SUM the equivalence also holds under deterministic reductions\[[FJX25](https://arxiv.org/html/2610.06783#bib.bibx83)\]\. Similarly, counting the witnesses of each entry of the\(min,\+\)\(\\min,\+\)\-product is equivalent to computing the\(min,\+\)\(\\min,\+\)\-product\[[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68)\]\.*We give the first truly subcubic algorithms for \#Exact Triangle and for counting the witnesses of the\(min,\+\)\(\\min,\+\)\-product, and the first truly subquadratic algorithm for \#3SUM*\. See\[[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68),[FJX25](https://arxiv.org/html/2610.06783#bib.bibx83)\]for applications\.
For problems that are only known to be 3SUM\-hard or APSP\-hard, such as many of the geometric problems of\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92)\]and the dynamic problems of\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[AV14](https://arxiv.org/html/2610.06783#bib.bibx26),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\], we get no faster algorithms, since the reductions go the other way\. For instance, it is now open whether one can find three collinear points amongnnpoints in the plane in truly subquadratic time\.
##### Relationships to some unaffected conjectures\.
While we refute various hypotheses, their underlying problems are all similar in nature\. We outline how a few other important problems with fine\-grained hypotheses differ from33SUM, Exact Triangle, and APSP, signaling that refuting them might require other techniques\.
We begin with CNF\-SAT and Orthogonal Vectors \(OV\)\. Neither of these problems is known to reduce to All\-Edges Sparse Triangle or similar problems\. CNF\-SAT and Exact Triangle are known to both reduce to certain triangle problems \(Matching Triangles and Triangle Collection\[[AVY15](https://arxiv.org/html/2610.06783#bib.bibx28)\]\), but these triangle problems concern the triangles in each of aboutn3n^\{3\}color triples in dense node\-colored graphs, and our techniques do not appear to work there\.
Unlike CNF\-SAT and Orthogonal Vectors,33SUM, APSP, and Exact Triangle have long been known to have fast algorithms in certain more powerful models\.
33SUM \(and more generallykk\-SUM\) and also Exact Triangle have very efficientlinear decision trees\. Following a long line of work\[[Mey84](https://arxiv.org/html/2610.06783#bib.bibx130),[Eri99](https://arxiv.org/html/2610.06783#bib.bibx79),[AC05](https://arxiv.org/html/2610.06783#bib.bibx4),[GS17](https://arxiv.org/html/2610.06783#bib.bibx96),[ES17](https://arxiv.org/html/2610.06783#bib.bibx80),[CIO16](https://arxiv.org/html/2610.06783#bib.bibx57),[GP18](https://arxiv.org/html/2610.06783#bib.bibx94),[KLM19](https://arxiv.org/html/2610.06783#bib.bibx113)\], it is now known\[[KLM19](https://arxiv.org/html/2610.06783#bib.bibx113)\]that for everyk≥3k\\geq 3,kk\-SUM has2k2k\-linear decision trees of depthO\(nlog2n\)O\(n\\log^\{2\}n\), and Exact Triangle inmm\-edge graphs has66\-linear decision trees of depthO\(mlog2m\)O\(m\\log^\{2\}m\)\. APSP has decision trees of depthO~\(n2\.5\)\\tilde\{O\}\(n^\{2\.5\}\)\[[Fre76](https://arxiv.org/html/2610.06783#bib.bibx87)\]\. No such results are known for CNF\-SAT and OV\.
33SUM, Exact Triangle, and APSP also all have fastnondeterministic and co\-nondeterministic algorithms\. A nondeterministic algorithm for a decision problem verifies a proof for YES, and a co\-nondeterministic algorithm verifies a given proof for NO\. Carmosino et al\.\[[CGI\+16](https://arxiv.org/html/2610.06783#bib.bibx50)\]showed that33SUM can be solved nondeterministically and co\-nondeterministically inO~\(n1\.5\)\\tilde\{O\}\(n^\{1\.5\}\)time, and Exact Triangle and APSP inO~\(n\(3\+ω\)/2\)\\tilde\{O\}\(n^\{\(3\+\\omega\)/2\}\)time\. The best known co\-nondeterministic algorithms for CNF\-SAT and OV are no better than the known deterministic ones, and\[[CGI\+16](https://arxiv.org/html/2610.06783#bib.bibx50)\]postulate NSETH, the hypothesis that CNF\-SAT requires2n−o\(n\)2^\{n\-o\(n\)\}time even for co\-nondeterministic algorithms\. They then prove that if NSETH is true, then there cannot be a deterministic \(or zero\-error randomized\) fine\-grained reduction from CNF\-SAT or OV to33SUM, APSP, or Exact Triangle\. In fact, our algorithm shows that if there were a deterministic fine\-grained reduction from CNF\-SAT or OV to33SUM, APSP, or Exact Triangle, then SETH \(and not merely NSETH\) is false\.
Interestingly, the issues posed by co\-nondeterminism disappear in the Merlin–Arthur world where randomization is allowed\. CNF\-SAT\[[Wil16](https://arxiv.org/html/2610.06783#bib.bibx165)\],33SUM, and APSP\[[ACJ\+22](https://arxiv.org/html/2610.06783#bib.bibx5)\]all have vastly improved Merlin–Arthur protocols: the verification time for CNF\-SAT \(indeed for counting its satisfying assignments\) is2n/2poly\(n\)2^\{n/2\}\\polyop\(n\), for33SUM it isO~\(n\)\\tilde\{O\}\(n\), and for APSP it isO~\(n2\)\\tilde\{O\}\(n^\{2\}\)\.
While we obtain a polynomial improvement for33SUM, we are unable to do so forkk\-SUM fork≥4k\\geq 4\.33SUM reduces tokk\-SUM, but no reduction in the other direction is known, and althoughkk\-SUM reduces to exact\-weight subgraph problems\[[AL13](https://arxiv.org/html/2610.06783#bib.bibx21),[ALW14](https://arxiv.org/html/2610.06783#bib.bibx23)\], whosenkn^\{k\}baseline we improve \(Section[5\.3](https://arxiv.org/html/2610.06783#S5.SS3)\), those reductions can only givekk\-SUM algorithms far slower than then⌈k/2⌉n^\{\\lceil k/2\\rceil\}baseline\. The same holds forkk\-XOR fork≥4k\\geq 4and for the 3SUM\-Indexing conjecture\[[GKLP17](https://arxiv.org/html/2610.06783#bib.bibx89),[KP19](https://arxiv.org/html/2610.06783#bib.bibx115),[GGH\+20](https://arxiv.org/html/2610.06783#bib.bibx88)\]\. Ultimately, we believe that one good reason for the lack of progress onk≥4k\\geq 4is thatkk\-SUM fork≥4k\\geq 4is not known to have fine\-grained self\-reductions\. This has been a major obstacle in designing reductions fromkk\-SUM and is also a major obstacle in designing algorithms for it\. \(The same goes forkk\-XOR fork≥4k\\geq 4\.\)
##### Combinatorial algorithms\.
The new algorithms are algebraic and potentially impractical in their current form: the constants hidden in theO\(⋅\)O\(\\cdot\)are enormous, and the exponents can likely be improved\. One might ask whether there are practical or “combinatorial” algorithms for these problems, similar to how one talks about combinatorial Boolean Matrix Multiplication \(BMM\)\. The known algorithms for combinatorial BMM, including the Four Russians\[[ADKF70](https://arxiv.org/html/2610.06783#bib.bibx9)\], then3/polylognn^\{3\}/\\polylog nbounds of\[[BW09](https://arxiv.org/html/2610.06783#bib.bibx48),[Cha15](https://arxiv.org/html/2610.06783#bib.bibx54),[Yu18](https://arxiv.org/html/2610.06783#bib.bibx169)\], and the recentn3/2Ω\(\(logn\)1/7\)n^\{3\}/2^\{\\Omega\(\(\\log n\)^\{1/7\}\)\}bound of Abboud, Fischer, Kelley, Lovett, and Meka\[[AFK\+24](https://arxiv.org/html/2610.06783#bib.bibx11)\], save only a subpolynomial factor, and no truly subcubic combinatorial algorithm is known\. We do not know whether such algorithms exist\. Most FGC reductions are combinatorial, so one could refocus the hypotheses to be about combinatorial algorithms\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[AV14](https://arxiv.org/html/2610.06783#bib.bibx26)\]\.
##### Other parameter regimes\.
Even without considering combinatorial algorithms, one might also ask whether All\-Edges Sparse Triangle can be solved faster in every regime of how large the three parts are\. Our technique \(due to the identity we use\) needs the middle part to have at mostn0\.12n^\{0\.12\}vertices, whereas prior reductions have focused on different regimes\.
For instance, the balanced sparse case of All\-Edges Sparse Triangle introduced by Pătraşcu\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135)\]has as input a tripartite graph with roughly equal parts andmmedges overall\. Most known fine\-grained reductions produce such balanced instances and give conditional lower bounds ofm4/3−o\(1\)m^\{4/3\-o\(1\)\}\.
Another case of interest is where the tripartite graph has two parts of sizennand one part of sizen\\sqrt\{n\}andO\(n3/2\)O\(n^\{3/2\}\)edges overall\. Solving this version inO\(n2−ε\)O\(n^\{2\-\\varepsilon\}\)time, even only for triangle detection \(and not even for the all\-edge version\), would have consequences for girth approximation in undirected unweighted graphs\[[RV12](https://arxiv.org/html/2610.06783#bib.bibx139)\]\.
##### Even faster algorithms\.
Our focus in this paper is to give the simplest presentation of our new algorithm for thin matrix products, and show how known reductions to All\-Edges Sparse Triangle combine with this to give all the polynomial speedups mentioned above\. In particular, over the course of this project, with Claude we generated some algorithms whose exponents are slightly better than the ones we present here, but which are significantly more complicated\. We intentionally did not include them in this paper\. See also the discussion in Section[6](https://arxiv.org/html/2610.06783#S6)and footnote[10](https://arxiv.org/html/2610.06783#footnote10)\.
##### Organization\.
In Section[2](https://arxiv.org/html/2610.06783#S2)we give the main matrix algorithm\. In Section[3](https://arxiv.org/html/2610.06783#S3)we derive the algorithms for Exact Triangle,33SUM, and APSP from it, by using or slightly modifying known reductions\. In Section[4](https://arxiv.org/html/2610.06783#S4)we give the data structure version of our matrix algorithm, proving Theorems[1](https://arxiv.org/html/2610.06783#Thmtheorem1)and[3](https://arxiv.org/html/2610.06783#Thmtheorem3)\. In Section[5](https://arxiv.org/html/2610.06783#S5)we present reductions to achieve the other algorithmic results discussed above\. Finally, in Section[6](https://arxiv.org/html/2610.06783#S6)we discuss future directions\.
## 2Quickly computing certain entries of a thin matrix product
We now present our main new algorithm, for computing a subset of the output entries of a thin matrix product\. We call such a matrix product*thin*since the input matrices are highly rectangular\. We work in the standard word RAM model withO\(logN\)O\(\\log N\)\-bit words, and thus count operations onO\(logN\)O\(\\log N\)\-bit integers\.
###### Theorem 5\.
LetD≥4D\\geq 4be a power of four andN≥D18N\\geq D^\{18\}\. Given as input matricesX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}, whose entries are integers of absolute value at mostNO\(1\)N^\{O\(1\)\}, as well as a setWWof at mostN2/DN^\{2\}/\\sqrt\{D\}positions of anN×NN\\times Nmatrix, the entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, can be computed deterministically in timeO\(N2log2D/D1/18\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{1/18\}\)\.
We call the positions inWW, and the entries ofXYXYat them,*wanted*\. We emphasize thatX,YX,Y, andXYXYmay be arbitrary dense matrices, and no structure is assumed about the setWWother than its size\|W\|≤N2/D\|W\|\\leq N^\{2\}/\\sqrt\{D\}\.
We have aimed to present this section in a way that is accessible to nonexperts\. Some details in Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5), such as the exponent1818, are chosen to simplify the presentation in this section while still proving a version sufficient to refute the33SUM and APSP hypotheses\. Later, in Section[4](https://arxiv.org/html/2610.06783#S4), we present a stronger data structure version that has improved parameter trade\-offs\.
Notably, while the language of tensors and bilinear complexity naturally describes much of our algorithm and the prior work it builds on, we deliberately avoid that language here\. This is in part so that a reader unfamiliar with that background may still follow, but also because our arguments here will focus on sparsity and combinatorial properties of our algorithms and algebraic identities that are often intentionally abstracted away in tensor language\.
Sections[2\.1](https://arxiv.org/html/2610.06783#S2.SS1)–[2\.3](https://arxiv.org/html/2610.06783#S2.SS3)present an exposition of the relevant prior work that we directly build on, especially Strassen\[[Str69](https://arxiv.org/html/2610.06783#bib.bibx147)\], Schönhage\[[Sch81](https://arxiv.org/html/2610.06783#bib.bibx143)\], and Coppersmith\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62)\], and no prior understanding of those works is assumed\. The main new idea of this paper is then presented in Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)\.
##### Technique overview\.
Strassen’s algorithm multiplies matrices by applying a small identity \(seven products for multiplying2×22\\times 2matrices\) recursively\. In that algorithm, the multiplications happen at the leaves of a recursion tree, and the additions that prepare the leaves \(the “encoding phase”\) and assemble the result \(the “decoding phase”\) are comparatively cheap\. We do the same with an identity of Schönhage that computes, simultaneously, two small rectangular matrix products\. Applied atLLlevels of recursion, the identity computes2L2^\{L\}matrix products at once\. In order to multiplyXXandYYusing this, we cut them into smaller blocks, and then simultaneously multiply many pairs of blocks using Schönhage’s identity \(Section[2\.3](https://arxiv.org/html/2610.06783#S2.SS3)\)\.
The new idea \(Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)\) is to visit only the leaves of the recursion tree that the wanted entries fromWWneed\. A priori, it is not clear that this reduces the number of leaves by much, or that the encoding and decoding phases stay cheap\. Both nonetheless turn out to hold, for two reasons\.
First, we observe that the additions in the encoding phase that prepare the leaves depend onXXalone or onYYalone \(as is the case in all tensor rank decompositions\)\. Since eachXXblock is multiplied with everyYYblock, we only need to compute these additions once for eachXXblock and may share them among many calls to our algorithm \(and similarly forYY\)\. One reason for the requirementN≥D18N\\geq D^\{18\}is to ensure that this total cost will be negligible \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\)\.
Second, we prune the recursion tree, and make a recursive call only when one of its outputs is wanted byWW\. This way, the running time is governed by the union of the sets of leaves that the wanted entries need\. Most of the analysis goes into bounding this union \(Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)\)\. We will see that every output entry has a private leaf that no other entry needs, but that all its other leaves are shared by many entries\. We will characterize each leaf by how often one needs to pick each of the two matrix products from Schönhage’s identity to get to it in the recursion tree, and find a trade\-off: choosing one of the matrix products leads to a relatively small number of leaves, while choosing the other increases how many output entries share each leaf\. Balancing the two, we will find that a set ofN2/DN^\{2\}/\\sqrt\{D\}wanted entries only needs aboutN2/D1/18N^\{2\}/D^\{1/18\}leaves in all, and payingO\(log2D\)O\(\\log^\{2\}\\\!D\)operations per leaf gives Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)\.
### 2\.1Strassen’s recursive algorithm
We use the recursive approach for multiplying matrices introduced by Strassen\[[Str69](https://arxiv.org/html/2610.06783#bib.bibx147)\]\. We begin by recalling his algorithm for intuition\. The key behind his algorithm is an identity that shows how to multiply two2×22\\times 2matricesAAandBBusing only seven multiplications instead of eight\. It forms seven products, each of a linear combination of the entries ofAAwith a linear combination of the entries ofBB, and then obtains each entry ofABABas a linear combination of those seven products\. Recall that, writingA=\(aij\)A=\(a\_\{ij\}\)andB=\(bij\)B=\(b\_\{ij\}\), the seven products are
S1\\displaystyle S\_\{1\}=\(a11\+a22\)\(b11\+b22\),\\displaystyle=\(a\_\{11\}\+a\_\{22\}\)\(b\_\{11\}\+b\_\{22\}\),S5\\displaystyle\\qquad S\_\{5\}=\(a11\+a12\)b22,\\displaystyle=\(a\_\{11\}\+a\_\{12\}\)\\,b\_\{22\},\(1\)S2\\displaystyle S\_\{2\}=\(a21\+a22\)b11,\\displaystyle=\(a\_\{21\}\+a\_\{22\}\)\\,b\_\{11\},S6\\displaystyle S\_\{6\}=\(a21−a11\)\(b11\+b12\),\\displaystyle=\(a\_\{21\}\-a\_\{11\}\)\(b\_\{11\}\+b\_\{12\}\),S3\\displaystyle S\_\{3\}=a11\(b12−b22\),\\displaystyle=a\_\{11\}\\,\(b\_\{12\}\-b\_\{22\}\),S7\\displaystyle S\_\{7\}=\(a12−a22\)\(b21\+b22\),\\displaystyle=\(a\_\{12\}\-a\_\{22\}\)\(b\_\{21\}\+b\_\{22\}\),S4\\displaystyle S\_\{4\}=a22\(b21−b11\),\\displaystyle=a\_\{22\}\\,\(b\_\{21\}\-b\_\{11\}\),and the product is
AB=\(S1\+S4−S5\+S7S3\+S5S2\+S4S1−S2\+S3\+S6\)\.AB=\\begin\{pmatrix\}S\_\{1\}\+S\_\{4\}\-S\_\{5\}\+S\_\{7\}&S\_\{3\}\+S\_\{5\}\\\\ S\_\{2\}\+S\_\{4\}&S\_\{1\}\-S\_\{2\}\+S\_\{3\}\+S\_\{6\}\\end\{pmatrix\}\.To use this identity to multiplyN×NN\\times NmatricesA,BA,Bfor largerNN, we interpretAAandBBas2×22\\times 2block matrices \(whose entries areN/2×N/2N/2\\times N/2matrices\), then multiply them as in the identity, i\.e\., we form seven pairs of linear combinations of the blocks ofAAand ofBB, recursively multiply each pair, and then assemble the four blocks ofABABfrom the seven results\. WhenN=2LN=2^\{L\}, the recursion tree \(Figure[2](https://arxiv.org/html/2610.06783#S2.F2)\) hasLLlevels, and7L7^\{L\}leaves, one for each choice of one of the seven products at each level\. The multiplications take place at the leaves, meaning there are7L=Nlog27<N2\.817^\{L\}=N^\{\\log\_\{2\}7\}<N^\{2\.81\}multiplications in total\. We call the additions on the way down, which prepare the leaves and are computed fromAAalone and fromBBalone, the*encoding*, and those on the way up, which assemble the product, the*decoding*\.
N×NN\\times NN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdotsN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdotsN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdotsN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdotsN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdotsN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdotsN2×N2\\tfrac\{N\}\{2\}\\times\\tfrac\{N\}\{2\}⋮\\vdots7L7^\{L\}leaves: products of two numbers↓\\downarrowon the way down: seven pairs oflinear combinations of the blocks \(encoding\)↑\\uparrowon the way up: the four blocks ofthe product from the seven results \(decoding\)Figure 2:Strassen’s recursion onN×NN\\times Nmatrices,N=2LN=2^\{L\}, showing the first two levels of calls below the root\.To calculate the total cost of Strassen’s algorithm, we also need to count the additions and subtractions at the internal vertices of the recursion tree\. At depthkkof the recursion tree, there are7k7^\{k\}internal vertices\. Both on the way down and on the way up the tree, the algorithm must compute linear combinations of2L−k×2L−k2^\{L\-k\}\\times 2^\{L\-k\}matrices at each of these vertices, which usesO\(4L−k\)O\(4^\{L\-k\}\)operations\. The total across the whole tree is therefore∑k=0L−17k4L−k=O\(7L\)\\sum\_\{k=0\}^\{L\-1\}7^\{k\}4^\{L\-k\}=O\(7^\{L\}\), a geometric series dominated by its last term, so the additions only increase the running time by a constant factor\. This phenomenon is prevalent in recursive matrix multiplication algorithms, although in the new algorithm we develop in Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)below, this same argument will no longer apply, and we will need to count the additions and subtractions more carefully\.
### 2\.2Schönhage’s identity for an inner product and an outer product
While we will still use Strassen’s recursive approach here, we will replace his identity with another one due to Schönhage\[[Sch81](https://arxiv.org/html/2610.06783#bib.bibx143)\]\. In this subsection we give the notation to introduce this identity and explain its usefulness\.
It will be convenient to write such identities as trilinear polynomials\.555These are often called tensors, or order\-3 tensors, in the literature\.As an example, we first show how to write Strassen’s identity from Section[2\.1](https://arxiv.org/html/2610.06783#S2.SS1)in this way\. Introduce four*output variables*c11,c12,c21,c22c\_\{11\},c\_\{12\},c\_\{21\},c\_\{22\}, one for each entry of the productABAB, and multiply each of the seven productsS1,…,S7S\_\{1\},\\dots,S\_\{7\}of Strassen’s identity above by the signed sum of the output variables of the entries where it appeared in the decoding phase\. For instance,S1S\_\{1\}appears in the formulas for\(AB\)11\(AB\)\_\{11\}and\(AB\)22\(AB\)\_\{22\}, so it is multiplied byc11\+c22c\_\{11\}\+c\_\{22\}, andS5S\_\{5\}appears in the formula for\(AB\)11\(AB\)\_\{11\}with a minus sign and in the formula for\(AB\)12\(AB\)\_\{12\}, so it is multiplied byc12−c11c\_\{12\}\-c\_\{11\}\. Strassen’s identity then reads
S1\(c11\+c22\)\+S2\(c21−c22\)\+S3\(c12\+c22\)\+S4\(c11\+c21\)\+S5\(c12−c11\)\+S6c22\+S7c11=∑i,j,k=12aijbjkcik,S\_\{1\}\(c\_\{11\}\+c\_\{22\}\)\+S\_\{2\}\(c\_\{21\}\-c\_\{22\}\)\+S\_\{3\}\(c\_\{12\}\+c\_\{22\}\)\+S\_\{4\}\(c\_\{11\}\+c\_\{21\}\)\\\\ \+S\_\{5\}\(c\_\{12\}\-c\_\{11\}\)\+S\_\{6\}\\,c\_\{22\}\+S\_\{7\}\\,c\_\{11\}\\;=\\;\\sum\_\{i,j,k=1\}^\{2\}a\_\{ij\}\\,b\_\{jk\}\\,c\_\{ik\},whereS1,…,S7S\_\{1\},\\dots,S\_\{7\}are the products of two linear forms from \([1](https://arxiv.org/html/2610.06783#S2.E1)\)\. Now the coefficient ofcikc\_\{ik\}on the right\-hand side is the entry\(AB\)ik=ai1b1k\+ai2b2k\(AB\)\_\{ik\}=a\_\{i1\}b\_\{1k\}\+a\_\{i2\}b\_\{2k\}that we want, and its coefficient on the left\-hand side is the combination of the seven products that computes it, such asS1\+S4−S5\+S7S\_\{1\}\+S\_\{4\}\-S\_\{5\}\+S\_\{7\}forc11c\_\{11\}\. This polynomial identity thus records the linear combinations and products to be formed, as well as the combinations that assemble the outputs from them\.
We will next present Schönhage’s identity in the same way\. Recall that the*outer product*of two vectors\(x1,x2,x3\)\(x\_\{1\},x\_\{2\},x\_\{3\}\)and\(y1,y2,y3\)\(y\_\{1\},y\_\{2\},y\_\{3\}\)consists of the nine numbersxiyjx\_\{i\}y\_\{j\}, and the*inner product*of two vectors\(p11,p12,p21,p22\)\(p\_\{11\},p\_\{12\},p\_\{21\},p\_\{22\}\)and\(q11,q12,q21,q22\)\(q\_\{11\},q\_\{12\},q\_\{21\},q\_\{22\}\)is the single number∑i,j=12pijqij\\sum\_\{i,j=1\}^\{2\}p\_\{ij\}q\_\{ij\}\. These are special cases of matrix products: the outer product is multiplying a3×13\\times 1matrix times a1×31\\times 3matrix, and the inner product is multiplying a1×41\\times 4matrix times a4×14\\times 1matrix\. \(We index theppandqqvariables with\{1,2\}×\{1,2\}\\\{1,2\\\}\\times\\\{1,2\\\}rather than\{1,2,3,4\}\\\{1,2,3,4\\\}to set up nicer notation forp^\\hat\{p\}andq^\\hat\{q\}in Lemma[6](https://arxiv.org/html/2610.06783#Thmtheorem6)below\.\)
Separately computing the inner product and outer product would use9\+4=139\+4=13multiplications\. However, Schönhage\[[Sch81](https://arxiv.org/html/2610.06783#bib.bibx143), §6, eq\. \(6\.3\), withk=n=3k=n=3\]showed that they can be computed \(along with some error terms that will turn out to be harmless\) using only 10 multiplications\. The fact that this is possible even when the inner and outer products are on disjoint sets of variables is surprising, and refuted a border rank version of the “direct sum conjecture for tensor rank”\[[Str73](https://arxiv.org/html/2610.06783#bib.bibx148)\]\.
We callx1,x2,x3,p11,p12,p21,p22x\_\{1\},x\_\{2\},x\_\{3\},\\allowbreak p\_\{11\},p\_\{12\},p\_\{21\},p\_\{22\}the seven*left variables*andy1,y2,y3,q11,q12,q21,q22y\_\{1\},y\_\{2\},y\_\{3\},\\allowbreak q\_\{11\},q\_\{12\},q\_\{21\},q\_\{22\}the seven*right variables*\. We will also use ten output variableszijz\_\{ij\}\(for1≤i,j≤31\\leq i,j\\leq 3\) andz0z\_\{0\}, one for each of the ten quantities we aim to compute, namely, the coefficients of the output variables in the polynomial
G:=∑i,j=13xiyjzij\+\(∑i,j=12pijqij\)z0\.G:=\\sum\_\{i,j=1\}^\{3\}x\_\{i\}y\_\{j\}\\,z\_\{ij\}\+\\left\(\\sum\_\{i,j=1\}^\{2\}p\_\{ij\}q\_\{ij\}\\right\)z\_\{0\}\.
As a notational helper to state the identity, we introduce two3×33\\times 3matricesp^\\hat\{p\}andq^\\hat\{q\}of linear forms\. These are formed by starting with the2×22\\times 2matrices of thepp’s and of theqq’s, then extending them to3×33\\times 3matrices so that every column ofp^\\hat\{p\}and every row ofq^\\hat\{q\}sums to zero:
p^=\(p11p120p21p220−p11−p21−p12−p220\),q^=\(q11q12−q11−q12q21q22−q21−q22000\)\.\\hat\{p\}=\\begin\{pmatrix\}p\_\{11\}&p\_\{12\}&0\\\\ p\_\{21\}&p\_\{22\}&0\\\\ \-p\_\{11\}\-p\_\{21\}&\-p\_\{12\}\-p\_\{22\}&0\\end\{pmatrix\},\\qquad\\hat\{q\}=\\begin\{pmatrix\}q\_\{11\}&q\_\{12\}&\-q\_\{11\}\-q\_\{12\}\\\\ q\_\{21\}&q\_\{22\}&\-q\_\{21\}\-q\_\{22\}\\\\ 0&0&0\\end\{pmatrix\}\.Notice that∑i,j=13p^ijq^ij=∑i,j=12pijqij\\sum\_\{i,j=1\}^\{3\}\\hat\{p\}\_\{ij\}\\hat\{q\}\_\{ij\}=\\sum\_\{i,j=1\}^\{2\}p\_\{ij\}q\_\{ij\}is the desired inner product\.
Schönhage’s identity has ten*terms*, which we namePijP\_\{ij\}\(for1≤i,j≤31\\leq i,j\\leq 3, corresponding to the entries ofp^\\hat\{p\}andq^\\hat\{q\}\) andP0P\_\{0\}\. Each termλ\\lambdais the product of a linear formφλ\\varphi\_\{\\lambda\}in the left variables, a linear formψλ\\psi\_\{\\lambda\}in the right variables, and a linear formχλ\\chi\_\{\\lambda\}in the output variables\. These linear forms are as follows:
φPij\\displaystyle\\varphi\_\{P\_\{ij\}\}=xi\+p^ij,\\displaystyle=x\_\{i\}\+\\hat\{p\}\_\{ij\},ψPij\\displaystyle\\qquad\\psi\_\{P\_\{ij\}\}=yj\+q^ij,\\displaystyle=y\_\{j\}\+\\hat\{q\}\_\{ij\},χPij\\displaystyle\\qquad\\chi\_\{P\_\{ij\}\}=zij\+z0,\\displaystyle=z\_\{ij\}\+z\_\{0\},φP0\\displaystyle\\varphi\_\{P\_\{0\}\}=−\(x1\+x2\+x3\),\\displaystyle=\-\(x\_\{1\}\+x\_\{2\}\+x\_\{3\}\),ψP0\\displaystyle\\psi\_\{P\_\{0\}\}=y1\+y2\+y3,\\displaystyle=y\_\{1\}\+y\_\{2\}\+y\_\{3\},χP0\\displaystyle\\chi\_\{P\_\{0\}\}=z0\.\\displaystyle=z\_\{0\}\.
###### Lemma 6\.
Summing over the ten terms,
∑λφλψλχλ=G\+E,whereE:=∑i,j=13\(xiq^ij\+p^ijyj\+p^ijq^ij\)zij\.\\sum\_\{\\lambda\}\\varphi\_\{\\lambda\}\\psi\_\{\\lambda\}\\chi\_\{\\lambda\}\\;=\\;G\+E,\\qquad\\text\{where\}\\qquad E:=\\sum\_\{i,j=1\}^\{3\}\\big\(x\_\{i\}\\hat\{q\}\_\{ij\}\+\\hat\{p\}\_\{ij\}y\_\{j\}\+\\hat\{p\}\_\{ij\}\\hat\{q\}\_\{ij\}\\big\)\\,z\_\{ij\}\.
###### Proof\.
We compute the coefficient of each output variable on the left\-hand side\. The coefficient ofzijz\_\{ij\}comes only from the termPijP\_\{ij\}, and it isφPijψPij=\(xi\+p^ij\)\(yj\+q^ij\)=xiyj\+\(xiq^ij\+p^ijyj\+p^ijq^ij\)\\varphi\_\{P\_\{ij\}\}\\psi\_\{P\_\{ij\}\}=\(x\_\{i\}\+\\hat\{p\}\_\{ij\}\)\(y\_\{j\}\+\\hat\{q\}\_\{ij\}\)=x\_\{i\}y\_\{j\}\+\(x\_\{i\}\\hat\{q\}\_\{ij\}\+\\hat\{p\}\_\{ij\}y\_\{j\}\+\\hat\{p\}\_\{ij\}\\hat\{q\}\_\{ij\}\)\. The coefficient ofz0z\_\{0\}is∑i,j=13\(xi\+p^ij\)\(yj\+q^ij\)−\(x1\+x2\+x3\)\(y1\+y2\+y3\)\\sum\_\{i,j=1\}^\{3\}\(x\_\{i\}\+\\hat\{p\}\_\{ij\}\)\(y\_\{j\}\+\\hat\{q\}\_\{ij\}\)\-\(x\_\{1\}\+x\_\{2\}\+x\_\{3\}\)\(y\_\{1\}\+y\_\{2\}\+y\_\{3\}\)\. In this expression, the productsxiyjx\_\{i\}y\_\{j\}cancel, and the cross terms sum to∑i=13xi∑j=13q^ij\+∑j=13yj∑i=13p^ij=0\\sum\_\{i=1\}^\{3\}x\_\{i\}\\sum\_\{j=1\}^\{3\}\\hat\{q\}\_\{ij\}\+\\sum\_\{j=1\}^\{3\}y\_\{j\}\\sum\_\{i=1\}^\{3\}\\hat\{p\}\_\{ij\}=0since the rows ofq^\\hat\{q\}and the columns ofp^\\hat\{p\}sum to zero\. What remains is∑i,j=13p^ijq^ij=∑i,j=12pijqij\\sum\_\{i,j=1\}^\{3\}\\hat\{p\}\_\{ij\}\\hat\{q\}\_\{ij\}=\\sum\_\{i,j=1\}^\{2\}p\_\{ij\}q\_\{ij\}, as desired\. ∎
Lemma[6](https://arxiv.org/html/2610.06783#Thmtheorem6)is the key identity we will use\. It computes our desiredGGplus an error polynomialEE\. Before moving on to our algorithm, we make two structural observations about the identity that we will use below\.
Our first observation will be used to handle the errorEE\. We call the variables of the inner product,pp,qq, andz0z\_\{0\},*inner*, and those of the outer product,xx,yy, andzijz\_\{ij\},*outer*\. Notice that every monomial ofGGconsists only of inner variables \(pijqijz0p\_\{ij\}q\_\{ij\}z\_\{0\}\) or only of outer variables \(xiyjzijx\_\{i\}y\_\{j\}z\_\{ij\}\)\. Meanwhile, every monomial ofEEhas an outer output variable together with an inner left or right variable\. We will use this observation to show thatEEis harmless in our algorithm in Lemma[9](https://arxiv.org/html/2610.06783#Thmtheorem9)below\.666Schönhage stated the identity approximately, as a “border rank” expression: multiplying everyppandqqby an indeterminateε\\varepsilonand everyzijz\_\{ij\}byε2\\varepsilon^\{2\}turns it into∑λφλψλχλ=ε2G\+O\(ε3\)\\sum\_\{\\lambda\}\\varphi\_\{\\lambda\}\\psi\_\{\\lambda\}\\chi\_\{\\lambda\}=\\varepsilon^\{2\}G\+O\(\\varepsilon^\{3\}\)\. One could view this as approximately computingGGasε→0\\varepsilon\\to 0, although Bini\[[Bin80](https://arxiv.org/html/2610.06783#bib.bibx42)\]showed that when a border rank expression is applied recursively, it may be converted to an exact identity with only small additional cost\. Rather than do this, we instead substituteε=1\\varepsilon=1into the identity, and we will see thatEEis harmless in our algorithm\.
Our second observation concerns the pattern of output variables in our identity, and will be used to take advantage of the sparsity of the setWWof wanted entries in our final algorithm\. We say that a termλ\\lambda*contributes to*an output variablezzifzzappears inχλ\\chi\_\{\\lambda\}\. We see that every term contributes toz0z\_\{0\}, and onlyPijP\_\{ij\}contributes tozijz\_\{ij\}\. \(The decoding layer of Figure[3](https://arxiv.org/html/2610.06783#S2.F3)below will also illustrate this\.\) The fact that only one term contributes to eachzijz\_\{ij\}will eventually help us to reduce how many products we need to compute when we only need certain output entries\. Since theχλ\\chi\_\{\\lambda\}forms are all sums of output variables \(without any minus signs or other coefficients\), it follows that for each output variablezz, its coefficient on the left\-hand side of the identity is∑λφλψλ\\sum\_\{\\lambda\}\\varphi\_\{\\lambda\}\\psi\_\{\\lambda\}, where the sum is over the termsλ\\lambdacontributing tozz\.
### 2\.3Rectangular matrix multiplication using Schönhage’s identity
In this subsection, we apply Schönhage’s identity recursively to derive an algorithm for rectangular matrix multiplication \(computing all the output entries, not just a small subset\)\. Our approach is similar to Coppersmith’s algorithm\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62), “Proof version 2”\], although we will make modifications that worsen some parameters of the algorithm in exchange for preserving some of the combinatorial and structural properties of Schönhage’s identity that we will use below\.
#### 2\.3\.1The recursion
Schönhage’s identity computes two matrix products, the outer product and the inner product, on disjoint sets of variables\. We will see that applying it toLLlevels of recursion therefore involves2L2^\{L\}matrix products, one for each way of choosing the outer or the inner product at each level\. A choice with the inner product atmmof the levels, and the outer product at the otherL−mL\-mlevels, corresponds to the product of a3L−m×4m3^\{L\-m\}\\times 4^\{m\}matrix and a4m×3L−m4^\{m\}\\times 3^\{L\-m\}matrix\. \(We will focus on a setting ofmmmuch smaller thanLLso that these are thin matrix products\.\) In this subsection, we set up notation for the arrays that the recursion works on and state the recursion, then in Section[2\.3\.2](https://arxiv.org/html/2610.06783#S2.SS3.SSS2)we will describe precisely what it computes\.
The inputs and outputs of our algorithm will be arrays that contain the entries of many different matrices concatenated together\. \(Later in Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)we will use this algorithm as a subroutine to multiply a single pair of matrices\.\) We will index the entries of these arrays by strings ofLLvariables of Schönhage’s identity\. Whether each variable is an inner or outer variable will tell us which of the2L2^\{L\}matrix products the array entry corresponds to, and the specific variables will tell us which entry of the matrix it corresponds to\.
A*left string*of lengthLLis a stringu=u1u2⋯uLu=u\_\{1\}u\_\{2\}\\cdots u\_\{L\}ofLLleft variables, and we calluℓu\_\{\\ell\}its variable at*level*ℓ\\ell\. An*arrayaaon the left strings of lengthLL*assigns an integera\[u\]a\[u\]to eachuuthat is a left string of lengthLL\. The arrayaahas7L7^\{L\}entries in total \(since there are77left variables\)\. We define right strings, output strings, and arrays on them in the same way\. For instance, an array on the output strings of lengthLLhas10L10^\{L\}entries \(since there are1010output variables\)\.
For a termλ\\lambdaand a left variabless, letφλ\(s\)∈\{0,±1\}\\varphi\_\{\\lambda\}\(s\)\\in\\\{0,\\pm 1\\\}denote the coefficient ofssinφλ\\varphi\_\{\\lambda\}, and defineψλ\(t\)\\psi\_\{\\lambda\}\(t\)similarly for right variablestt\. Recall from Schönhage’s identity that, for each termλ\\lambda, at most three of the seven valuesφλ\(s\)\\varphi\_\{\\lambda\}\(s\)are nonzero since eachφλ\\varphi\_\{\\lambda\}has at most three monomials, and similarly for the seven valuesψλ\(t\)\\psi\_\{\\lambda\}\(t\)\.
Just as Strassen’s algorithm cuts matrices into blocks, we cut an arrayaaon strings of lengthL≥1L\\geq 1into*slices*according to the variable at level11: the slice ofaaat a left variablessis the arrayasa\_\{s\}on the strings of lengthL−1L\-1given byas\[u′\]:=a\[su′\]a\_\{s\}\[u^\{\\prime\}\]:=a\[su^\{\\prime\}\]\. Thus,aaconsists of its seven slices, just as a block matrix consists of its blocks\. We similarly define the slicesbtb\_\{t\}of an arraybbon right strings, andczc\_\{z\}of an arrayccon output strings\.
The recursionFull\(a,b\)\\textnormal\{\{Full\}\}\(a,b\), for arraysa,ba,bon the left and right strings of lengthLL, returns an array on the output strings of lengthLL:
1. \(1\)IfL=0L=0, return the numberabab\.
2. \(2\)For each termλ\\lambdaof Schönhage’s identity, formAλ:=∑sφλ\(s\)asA\_\{\\lambda\}:=\\sum\_\{s\}\\varphi\_\{\\lambda\}\(s\)\\,a\_\{s\}andBλ:=∑tψλ\(t\)btB\_\{\\lambda\}:=\\sum\_\{t\}\\psi\_\{\\lambda\}\(t\)\\,b\_\{t\}\.
3. \(3\)For each termλ\\lambda, recursively computeCλ:=Full\(Aλ,Bλ\)C\_\{\\lambda\}:=\\textnormal\{\{Full\}\}\(A\_\{\\lambda\},B\_\{\\lambda\}\)\.
4. \(4\)Return the arrayccwhose slices areczij:=CPijc\_\{z\_\{ij\}\}:=C\_\{P\_\{ij\}\}andcz0:=∑λCλc\_\{z\_\{0\}\}:=\\sum\_\{\\lambda\}C\_\{\\lambda\}\.
ForL=1L=1,Fullis one application of Schönhage’s identity: step \(2\) evaluates the linear formsφλ\\varphi\_\{\\lambda\}andψλ\\psi\_\{\\lambda\}at the seven numbersa\[s\]a\[s\]and the seven numbersb\[t\]b\[t\], step \(3\) multiplies the two values for eachλ\\lambda, and step \(4\) sums the products into the ten outputs as the formsχλ\\chi\_\{\\lambda\}prescribe\. In the terms of Section[2\.1](https://arxiv.org/html/2610.06783#S2.SS1), step \(2\) is the encoding and step \(4\) the decoding\.
The calls ofFullform a recursion tree\. We refer to the call reached by choosing the termsτ1,…,τk\\tau\_\{1\},\\dots,\\tau\_\{k\}at levels1,…,k1,\\dots,kas the*vertex*τ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}, a string ofkkterms\. It is at depthkk, and its input arrays are on strings of lengthL−kL\-k\. The root is the vertex withk=0k=0, and the*leaves*, the verticesτ=τ1⋯τL\\tau=\\tau\_\{1\}\\cdots\\tau\_\{L\}at depthLL, are the10L10^\{L\}multiplications performed in step \(1\)\.
ax1a\_\{x\_\{1\}\}ax2a\_\{x\_\{2\}\}ax3a\_\{x\_\{3\}\}ap11a\_\{p\_\{11\}\}ap12a\_\{p\_\{12\}\}ap21a\_\{p\_\{21\}\}ap22a\_\{p\_\{22\}\}the arrayaa, cut into its seven slicesasa\_\{s\}according to the variablessat level 1AP11A\_\{P\_\{11\}\}CP11C\_\{P\_\{11\}\}AP12A\_\{P\_\{12\}\}CP12C\_\{P\_\{12\}\}AP13A\_\{P\_\{13\}\}CP13C\_\{P\_\{13\}\}AP21A\_\{P\_\{21\}\}CP21C\_\{P\_\{21\}\}AP22A\_\{P\_\{22\}\}CP22C\_\{P\_\{22\}\}AP23A\_\{P\_\{23\}\}CP23C\_\{P\_\{23\}\}AP31A\_\{P\_\{31\}\}CP31C\_\{P\_\{31\}\}AP32A\_\{P\_\{32\}\}CP32C\_\{P\_\{32\}\}AP33A\_\{P\_\{33\}\}CP33C\_\{P\_\{33\}\}AP0A\_\{P\_\{0\}\}CP0C\_\{P\_\{0\}\}cz11c\_\{z\_\{11\}\}cz12c\_\{z\_\{12\}\}cz13c\_\{z\_\{13\}\}cz21c\_\{z\_\{21\}\}cz22c\_\{z\_\{22\}\}cz23c\_\{z\_\{23\}\}cz31c\_\{z\_\{31\}\}cz32c\_\{z\_\{32\}\}cz33c\_\{z\_\{33\}\}cz0c\_\{z\_\{0\}\}the arraycc, cut into its ten slicesczc\_\{z\}according to the output variablezzat level 1step \(2\):encodestep \(3\):recursestep \(4\):decodeFigure 3:One level of the recursion, the analog of one step of Strassen’s algorithm\. In step \(2\), each of the ten termsλ\\lambdacombines at most three of the seven slicesasa\_\{s\}intoAλ=∑sφλ\(s\)asA\_\{\\lambda\}=\\sum\_\{s\}\\varphi\_\{\\lambda\}\(s\)\\,a\_\{s\}\(solid lines:\+\+, dashed:−\-\)\. For instance,AP31=ax3−ap11−ap21A\_\{P\_\{31\}\}=a\_\{x\_\{3\}\}\-a\_\{p\_\{11\}\}\-a\_\{p\_\{21\}\}andAP0=−ax1−ax2−ax3A\_\{P\_\{0\}\}=\-a\_\{x\_\{1\}\}\-a\_\{x\_\{2\}\}\-a\_\{x\_\{3\}\}\. The same is done tobbwith the formsψλ\\psi\_\{\\lambda\}\. In step \(3\), the ten pairs are multiplied by recursive calls,Cλ=Full\(Aλ,Bλ\)C\_\{\\lambda\}=\\textnormal\{\{Full\}\}\(A\_\{\\lambda\},B\_\{\\lambda\}\)\. In step \(4\), the sliceczijc\_\{z\_\{ij\}\}of the output isCPijC\_\{P\_\{ij\}\}, and the slicecz0c\_\{z\_\{0\}\}is the sum of all ten, because every term contributes toz0z\_\{0\}\.Let us now count the operations performed by this algorithm\. At depthkkthere are10k10^\{k\}vertices \(since Schönhage’s identity has1010terms\), each with two input arrays of7L−k7^\{L\-k\}entries and an output array of10L−k10^\{L\-k\}entries\. Step \(2\) takesO\(7L−k\)O\(7^\{L\-k\}\)operations at a vertex, and step \(4\) takesO\(10L−k\)O\(10^\{L\-k\}\)operations\. Hence,Fulluses∑k=0L10k⋅O\(7L−k\+10L−k\)=O\(L⋅10L\)\\sum\_\{k=0\}^\{L\}10^\{k\}\\cdot O\(7^\{L\-k\}\+10^\{L\-k\}\)=O\(L\\cdot 10^\{L\}\)operations in total, which is not much more than the10L10^\{L\}multiplications\. Of this, the encodings, step \(2\), account for only∑k=0L10k⋅O\(7L−k\)=O\(10L\)\\sum\_\{k=0\}^\{L\}10^\{k\}\\cdot O\(7^\{L\-k\}\)=O\(10^\{L\}\)operations, and the decodings, step \(4\), for the rest\.
#### 2\.3\.2Unraveling the recursion computation
In this subsection, we carefully work out which two numbers are multiplied at the leafτ\\tau, and what is returned byFull\(a,b\)\\textnormal\{\{Full\}\}\(a,b\)\. For a leafτ\\taulet
Φτ\(a\):=∑ua\[u\]∏ℓ=1Lφτℓ\(uℓ\),Ψτ\(b\):=∑vb\[v\]∏ℓ=1Lψτℓ\(vℓ\),\\Phi\_\{\\tau\}\(a\):=\\sum\_\{u\}a\[u\]\\prod\_\{\\ell=1\}^\{L\}\\varphi\_\{\\tau\_\{\\ell\}\}\(u\_\{\\ell\}\),\\qquad\\Psi\_\{\\tau\}\(b\):=\\sum\_\{v\}b\[v\]\\prod\_\{\\ell=1\}^\{L\}\\psi\_\{\\tau\_\{\\ell\}\}\(v\_\{\\ell\}\),where the sums are over all left stringsuuand all right stringsvvof lengthLL\. We extend the relation “contributes to” of Section[2\.2](https://arxiv.org/html/2610.06783#S2.SS2)from terms to vertices: a vertexτ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}*contributes to*an output stringwwifτℓ\\tau\_\{\\ell\}contributes towℓw\_\{\\ell\}at every levelℓ≤k\\ell\\leq k\. Thus the leafτ\\taucontributes towwifτℓ=Pij\\tau\_\{\\ell\}=P\_\{ij\}at every levelℓ\\ellwherewℓ=zijw\_\{\\ell\}=z\_\{ij\}\(butτℓ\\tau\_\{\\ell\}may be arbitrary at the levels wherewℓ=z0w\_\{\\ell\}=z\_\{0\}\)\. LetMult\(a,b\)\\textnormal\{\{Mult\}\}\(a,b\)be the array on the output strings of lengthLLgiven by
Mult\(a,b\)\[w\]:=∑τcontributing towΦτ\(a\)Ψτ\(b\)\.\\textnormal\{\{Mult\}\}\(a,b\)\[w\]\\;:=\\;\\sum\_\{\\tau\\text\{ contributing to \}w\}\\Phi\_\{\\tau\}\(a\)\\,\\Psi\_\{\\tau\}\(b\)\.\(2\)
###### Lemma 7\.
At the leafτ\\tau,Full\(a,b\)\\textnormal\{\{Full\}\}\(a,b\)multipliesΦτ\(a\)\\Phi\_\{\\tau\}\(a\)byΨτ\(b\)\\Psi\_\{\\tau\}\(b\), and it returnsMult\(a,b\)\\textnormal\{\{Mult\}\}\(a,b\)\.
###### Proof\.
By induction onLL\(see Figure[3](https://arxiv.org/html/2610.06783#S2.F3)\)\. ForL=0L=0, the only leaf is the empty stringτ\\tau, andΦτ\(a\)=a\\Phi\_\{\\tau\}\(a\)=aandΨτ\(b\)=b\\Psi\_\{\\tau\}\(b\)=b, as the products over the levels are empty, so step \(1\) multiplies them and returnsab=Mult\(a,b\)ab=\\textnormal\{\{Mult\}\}\(a,b\)\. ForL≥1L\\geq 1, step \(2\) is the encoding: sinceas\[u′\]=a\[su′\]a\_\{s\}\[u^\{\\prime\}\]=a\[su^\{\\prime\}\], for every leafλτ′\\lambda\\tau^\{\\prime\}we have
Φλτ′\(a\)=∑sφλ\(s\)Φτ′\(as\)=Φτ′\(Aλ\),\\Phi\_\{\\lambda\\tau^\{\\prime\}\}\(a\)=\\sum\_\{s\}\\varphi\_\{\\lambda\}\(s\)\\,\\Phi\_\{\\tau^\{\\prime\}\}\(a\_\{s\}\)=\\Phi\_\{\\tau^\{\\prime\}\}\(A\_\{\\lambda\}\),and similarlyΨλτ′\(b\)=Ψτ′\(Bλ\)\\Psi\_\{\\lambda\\tau^\{\\prime\}\}\(b\)=\\Psi\_\{\\tau^\{\\prime\}\}\(B\_\{\\lambda\}\)\. Thus, by induction, the leafλτ′\\lambda\\tau^\{\\prime\}multipliesΦλτ′\(a\)\\Phi\_\{\\lambda\\tau^\{\\prime\}\}\(a\)byΨλτ′\(b\)\\Psi\_\{\\lambda\\tau^\{\\prime\}\}\(b\), andCλ\[w′\]=∑τ′Φλτ′\(a\)Ψλτ′\(b\)C\_\{\\lambda\}\[w^\{\\prime\}\]=\\sum\_\{\\tau^\{\\prime\}\}\\Phi\_\{\\lambda\\tau^\{\\prime\}\}\(a\)\\Psi\_\{\\lambda\\tau^\{\\prime\}\}\(b\), summed over theτ′\\tau^\{\\prime\}contributing tow′w^\{\\prime\}\. Step \(4\) is the decoding: the leaves contributing tozw′zw^\{\\prime\}are theλτ′\\lambda\\tau^\{\\prime\}withλ\\lambdacontributing tozzandτ′\\tau^\{\\prime\}contributing tow′w^\{\\prime\}, soc\[zw′\]=∑λcontributing tozCλ\[w′\]c\[zw^\{\\prime\}\]=\\sum\_\{\\lambda\\text\{ contributing to \}z\}C\_\{\\lambda\}\[w^\{\\prime\}\]agrees with \([2](https://arxiv.org/html/2610.06783#S2.E2)\)\. ∎
Since one application of the identity computes the coefficients ofG\+EG\+E, we expect thatLLrecursive applications should compute products ofLLsuch coefficients\. For a left variabless, a right variablett, and an output variablezz, let
γ\(s,t,z\):=∑λcontributing tozφλ\(s\)ψλ\(t\),\\gamma\(s,t,z\)\\;:=\\;\\sum\_\{\\lambda\\text\{ contributing to \}z\}\\varphi\_\{\\lambda\}\(s\)\\,\\psi\_\{\\lambda\}\(t\),\(3\)the coefficient of the monomialstzstzon the left\-hand side of the identity\. By Lemma[6](https://arxiv.org/html/2610.06783#Thmtheorem6), it is also the coefficient ofstzstzinG\+EG\+E, and we know thatγ\(s,t,z\)∈\{0,±1\}\\gamma\(s,t,z\)\\in\\\{0,\\pm 1\\\}\.
###### Lemma 8\.
For all arraysa,ba,band every output stringww,
Mult\(a,b\)\[w\]=∑u,vγ\(u1,v1,w1\)γ\(u2,v2,w2\)⋯γ\(uL,vL,wL\)a\[u\]b\[v\],\\textnormal\{\{Mult\}\}\(a,b\)\[w\]\\;=\\;\\sum\_\{u,v\}\\gamma\(u\_\{1\},v\_\{1\},w\_\{1\}\)\\,\\gamma\(u\_\{2\},v\_\{2\},w\_\{2\}\)\\cdots\\gamma\(u\_\{L\},v\_\{L\},w\_\{L\}\)\\;a\[u\]\\,b\[v\],the sum over all left stringsuuand right stringsvv\.
###### Proof\.
By the definitions ofΦτ\\Phi\_\{\\tau\}andΨτ\\Psi\_\{\\tau\}, the coefficient ofa\[u\]b\[v\]a\[u\]\\,b\[v\]in \([2](https://arxiv.org/html/2610.06783#S2.E2)\) is∑τ∏ℓ=1Lφτℓ\(uℓ\)ψτℓ\(vℓ\)\\sum\_\{\\tau\}\\prod\_\{\\ell=1\}^\{L\}\\varphi\_\{\\tau\_\{\\ell\}\}\(u\_\{\\ell\}\)\\psi\_\{\\tau\_\{\\ell\}\}\(v\_\{\\ell\}\), summed over the leavesτ\\taucontributing toww\. These are the leaves whose term at levelℓ\\ellcontributes towℓw\_\{\\ell\}, independently for eachℓ\\ell, so this sum of products is the product of sums
∏ℓ=1L∑τℓcontributing towℓφτℓ\(uℓ\)ψτℓ\(vℓ\)=∏ℓ=1Lγ\(uℓ,vℓ,wℓ\)\\prod\_\{\\ell=1\}^\{L\}\\ \\sum\_\{\\tau\_\{\\ell\}\\text\{ contributing to \}w\_\{\\ell\}\}\\varphi\_\{\\tau\_\{\\ell\}\}\(u\_\{\\ell\}\)\\,\\psi\_\{\\tau\_\{\\ell\}\}\(v\_\{\\ell\}\)\\;=\\;\\prod\_\{\\ell=1\}^\{L\}\\gamma\(u\_\{\\ell\},v\_\{\\ell\},w\_\{\\ell\}\)by \([3](https://arxiv.org/html/2610.06783#S2.E3)\)\. ∎
We will use both descriptions ofMult: Lemma[8](https://arxiv.org/html/2610.06783#Thmtheorem8)to read matrix products off it \(Section[2\.3\.3](https://arxiv.org/html/2610.06783#S2.SS3.SSS3)\), and the sum over leaves in \([2](https://arxiv.org/html/2610.06783#S2.E2)\) to skip the leaves that do not contribute to the wanted entries \(Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)\)\.
#### 2\.3\.3Batch computation of multiple matrix products
We now explain the claim from the beginning of Section[2\.3\.1](https://arxiv.org/html/2610.06783#S2.SS3.SSS1), that our recursive algorithm is simultaneously computing many matrix products\. We will also show that the errorEEis harmless, using the fact that each of its monomials uses an outer output variable, but at least one inner input variable\.
The*inner set*of a left string is the set of levels at which it has app\(as opposed to anxx\)\. It will tell us which of the2L2^\{L\}matrix products the string belongs to\. Similarly, the inner set of a right string is the set of levels at which it has aqq\(as opposed to ayy\), and the inner set of an output string is the set of levels at which it hasz0z\_\{0\}\(as opposed to azijz\_\{ij\}\)\. The*inner part*of a string is the string of its variables at the levels of its inner set, in the order of the levels, and its*outer part*is the string of its variables at the other levels\. A string is determined by its inner set, its outer part, and its inner part\.
Fixm≥1m\\geq 1, and letN0:=3L−mN\_\{0\}:=3^\{L\-m\}andD:=4mD:=4^\{m\}\. Of the2L2^\{L\}matrix products, one for each setQ⊆\{1,…,L\}Q\\subseteq\\\{1,\\dots,L\\\}of levels at which the inner product is chosen, we will use only the\(Lm\)\\binom\{L\}\{m\}products with\|Q\|=m\|Q\|=m, and set the inputs of the others to zero\. As we now make precise, the product for such aQQmultiplies anN0×DN\_\{0\}\\times Dmatrix by aD×N0D\\times N\_\{0\}matrix: theL−mL\-mouter levels, with three left and three right outer variables each, give itsN0=3L−mN\_\{0\}=3^\{L\-m\}rows andN0N\_\{0\}columns, and themminner levels, with four left and four right inner variables each, give theD=4mD=4^\{m\}terms of the sum in each of its entries\. \(To prove Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5), we will ultimately setL=19mL=19m, a choice we will explain in Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)below\.\)
We will index the rows and columns of the matrices in these products by strings of variables\. For anN0×DN\_\{0\}\\times Dmatrix, we index itsN0N\_\{0\}rows by theN0N\_\{0\}strings ofL−mL\-mouter left variables, and itsDDcolumns by theDDstrings ofmminner left variables\. Similarly, for aD×N0D\\times N\_\{0\}matrix, we index itsDDrows by the strings ofmminner right variables, and itsN0N\_\{0\}columns by the strings ofL−mL\-mouter right variables\. To multiply anN0×DN\_\{0\}\\times DmatrixAAby aD×N0D\\times N\_\{0\}matrixBB, we match the column ofAAindexed by the stringπ=pi1j1pi2j2⋯pimjm\\pi=p\_\{i\_\{1\}j\_\{1\}\}p\_\{i\_\{2\}j\_\{2\}\}\\cdots p\_\{i\_\{m\}j\_\{m\}\}with the row ofBBindexed by the stringπ′=qi1j1qi2j2⋯qimjm\\pi^\{\\prime\}=q\_\{i\_\{1\}j\_\{1\}\}q\_\{i\_\{2\}j\_\{2\}\}\\cdots q\_\{i\_\{m\}j\_\{m\}\}with the same indices, so that the entry ofABABin rowrrand columnccis
\(AB\)\[r,c\]:=∑πA\[r,π\]B\[π′,c\],\(AB\)\[r,c\]\\;:=\\;\\sum\_\{\\pi\}A\[r,\\pi\]\\,B\[\\pi^\{\\prime\},c\],where the sum is over all theDDstringsπ\\piofmminner left variables\. Thus, the rows of the product are indexed by the strings of outer left variables and its columns by the strings of outer right variables\.
LetQQbe a subset of\{1,…,L\}\\\{1,\\dots,L\\\}of sizemm\. As above, the outer part of a left stringuuwith inner setQQis a row of anN0×DN\_\{0\}\\times Dmatrix and its inner part is a column, so the left strings with inner setQQindex the entries of such a matrix\. For anN0×DN\_\{0\}\\times DmatrixXQX\_\{Q\}we writeXQ\[u\]X\_\{Q\}\[u\]for its entry at the row and the column ofuu\. Similarly, the right stringsvvwith inner setQQindex the entries of aD×N0D\\times N\_\{0\}matrixYQY\_\{Q\}, the row given by the inner part ofvvand the column by the outer part, and we writeYQ\[v\]Y\_\{Q\}\[v\]for this entry\. Finally, the output strings with inner setQQindex the entries of the productXQYQX\_\{Q\}Y\_\{Q\}: if the variables ofwwat the levels outsideQQarezi1j1,…,ziL−mjL−mz\_\{i\_\{1\}j\_\{1\}\},\\dots,z\_\{i\_\{L\-m\}j\_\{L\-m\}\}, in the order of the levels, then the*row*ofwwis the stringxi1⋯xiL−mx\_\{i\_\{1\}\}\\cdots x\_\{i\_\{L\-m\}\}and its*column*is the stringyj1⋯yjL−my\_\{j\_\{1\}\}\\cdots y\_\{j\_\{L\-m\}\}, and we write\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]for the entry there \(Figure[4](https://arxiv.org/html/2610.06783#S2.F4)\)\.
We can now check thatFull, which returnsMult\(a,b\)\\textnormal\{\{Mult\}\}\(a,b\), really computes these products\. For each of theK:=\(Lm\)K:=\\binom\{L\}\{m\}subsetsQQof\{1,…,L\}\\\{1,\\dots,L\\\}of sizemm, letXQX\_\{Q\}be anyN0×DN\_\{0\}\\times Dmatrix andYQY\_\{Q\}be anyD×N0D\\times N\_\{0\}matrix\. Let the input arraysaaandbbbe these matrices laid side by side, by setting
a\[u\]:=XQ\[u\],b\[v\]:=YQ\[v\]a\[u\]:=X\_\{Q\}\[u\],\\qquad b\[v\]:=Y\_\{Q\}\[v\]for all the left stringsuuand the right stringsvvwhose inner setQQhas exactlymmelements, anda\[u\]:=0a\[u\]:=0,b\[v\]:=0b\[v\]:=0at every other string\.
left stringuu:x1x\_\{1\}p11p\_\{11\}x2x\_\{2\}x3x\_\{3\}p22p\_\{22\}x1x\_\{1\}outer partx1x2x3x1x\_\{1\}x\_\{2\}x\_\{3\}x\_\{1\}: the row ofuuinXQX\_\{Q\},inner partp11p22p\_\{11\}p\_\{22\}: its column,souuindexes an entry ofXQX\_\{Q\}right stringvv:y3y\_\{3\}q11q\_\{11\}y1y\_\{1\}y3y\_\{3\}q22q\_\{22\}y2y\_\{2\}inner partq11q22q\_\{11\}q\_\{22\}: the row ofvvinYQY\_\{Q\},outer party3y1y3y2y\_\{3\}y\_\{1\}y\_\{3\}y\_\{2\}: its column,sovvindexes an entry ofYQY\_\{Q\}output stringww:z13z\_\{13\}z0z\_\{0\}z21z\_\{21\}z33z\_\{33\}z0z\_\{0\}z12z\_\{12\}rowx1x2x3x1x\_\{1\}x\_\{2\}x\_\{3\}x\_\{1\}and columny3y1y3y2y\_\{3\}y\_\{1\}y\_\{3\}y\_\{2\}, read offfrom itszijz\_\{ij\}, sowwindexes an entry ofXQYQX\_\{Q\}Y\_\{Q\}levelsℓ=1,…,6\\ell=1,\\dots,6\(shaded: the inner setQ=\{2,5\}Q=\\\{2,5\\\}\)XQX\_\{Q\}:81×1681\\times 16rowx1x2x3x1x\_\{1\}x\_\{2\}x\_\{3\}x\_\{1\}⋅\\cdotYQY\_\{Q\}:16×8116\\times 81columny3y1y3y2y\_\{3\}y\_\{1\}y\_\{3\}y\_\{2\}==XQYQX\_\{Q\}Y\_\{Q\}:81×8181\\times 81\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]Figure 4:From strings to matrix entries, forL=6L=6andm=2m=2\. A string whose inner set isQ=\{2,5\}Q=\\\{2,5\\\}has an inner variable \(pp,qq, orz0z\_\{0\}\) at the two levels ofQQand an outer one at the other four\. One run ofFullcomputes all\(62\)=15\\binom\{6\}\{2\}=15productsXQYQX\_\{Q\}Y\_\{Q\}, one for each subsetQQof size22\.###### Lemma 9\.
For the input arraysa,ba,babove and every output stringwwwhose inner setQQhas exactlymmelements,
Mult\(a,b\)\[w\]=\(XQYQ\)\[w\]\.\\textnormal\{\{Mult\}\}\(a,b\)\[w\]\\;=\\;\(X\_\{Q\}Y\_\{Q\}\)\[w\]\.\(4\)
###### Proof\.
By Lemma[8](https://arxiv.org/html/2610.06783#Thmtheorem8),Mult\(a,b\)\[w\]\\textnormal\{\{Mult\}\}\(a,b\)\[w\]is the sum, over all left stringsuuand right stringsvv, ofγ\(u1,v1,w1\)⋯γ\(uL,vL,wL\)a\[u\]b\[v\]\\gamma\(u\_\{1\},v\_\{1\},w\_\{1\}\)\\cdots\\gamma\(u\_\{L\},v\_\{L\},w\_\{L\}\)\\,a\[u\]b\[v\], whereγ\(s,t,z\)\\gamma\(s,t,z\)is the coefficient ofstzstzinG\+EG\+E\. We determine which summands can be nonzero\. First,a\[u\]b\[v\]≠0a\[u\]b\[v\]\\neq 0requires the inner sets ofuuandvvto have exactlymmelements\. Next, at a levelℓ∈Q\\ell\\in Qwe havewℓ=z0w\_\{\\ell\}=z\_\{0\}, and the only monomials ofG\+EG\+Ethat containz0z\_\{0\}are thepijqijz0p\_\{ij\}q\_\{ij\}z\_\{0\}, with coefficient11\. So\(uℓ,vℓ\)=\(pij,qij\)\(u\_\{\\ell\},v\_\{\\ell\}\)=\(p\_\{ij\},q\_\{ij\}\)for somei,ji,j\. Thusuuandvvhave an inner variable at every level ofQQ, and their inner sets are therefore exactlyQQ\. Finally, at a levelℓ∉Q\\ell\\notin Qwe havewℓ=zijw\_\{\\ell\}=z\_\{ij\}for somei,ji,j, anduℓu\_\{\\ell\}andvℓv\_\{\\ell\}are outer\. The only monomial ofG\+EG\+Ethat containszijz\_\{ij\}and no inner variable isxiyjzijx\_\{i\}y\_\{j\}z\_\{ij\}, with coefficient11, so\(uℓ,vℓ\)=\(xi,yj\)\(u\_\{\\ell\},v\_\{\\ell\}\)=\(x\_\{i\},y\_\{j\}\)\.
Hence, the summands that remain are those whereuuhas inner setQQ, the rowrrofwwas its outer part, and some inner partπ\\pi, and wherevvhas inner setQQ, the columnccofwwas its outer part, and the inner partπ′\\pi^\{\\prime\}with the same indices asπ\\pi\. There is one such summand for each of theDDstringsπ\\pi, and its coefficient is11\. Their sum is∑πXQ\[r,π\]YQ\[π′,c\]=\(XQYQ\)\[w\]\\sum\_\{\\pi\}X\_\{Q\}\[r,\\pi\]\\,Y\_\{Q\}\[\\pi^\{\\prime\},c\]=\(X\_\{Q\}Y\_\{Q\}\)\[w\]\. ∎
To summarize: one run ofFull, which uses10L10^\{L\}multiplications, computes allKKof the productsXQYQX\_\{Q\}Y\_\{Q\}\. TheKKproducts can be completely independent: we are free to plug in any choices forXQX\_\{Q\}andYQY\_\{Q\}and the algorithm will give us allKKproducts\. In the next subsection we will end up plugging in the same matrix for different copiesXQX\_\{Q\}\(andYQY\_\{Q\}\)\.
#### 2\.3\.4Tiling theN×D×NN\\times D\\times Nproduct by products of shapeN0×D×N0N\_\{0\}\\times D\\times N\_\{0\}
We now use our algorithm, which performsKKsimultaneous multiplications of anN0×DN\_\{0\}\\times Dmatrix with aD×N0D\\times N\_\{0\}matrix, in order to do a single multiplication of anN×DN\\times DmatrixXXwith aD×ND\\times NmatrixYY\. For our parameter setting,N≫N0N\\gg N\_\{0\}, so we can do this with a simple tiling approach\. Tiling enlarges only the outer dimensions, so it handles a smaller inner dimension than Coppersmith’s algorithm from the same identity \(at bestD≈N0\.1204D\\approx N^\{0\.1204\}rather thanN0\.1402N^\{0\.1402\}\[[Cop82](https://arxiv.org/html/2610.06783#bib.bibx62)\]\)\. We use it because each entry ofXYXYis then a single output of a single run ofFull, rather than a linear combination of many outputs as in Coppersmith’s algorithm\. We will take advantage of this in our algorithm below \(Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)\)\.
We cutXXinto*row blocks*ofN0N\_\{0\}consecutive rows andYYinto*column blocks*ofN0N\_\{0\}consecutive columns\. Thus,XYXYconsists of all the products of a row block by a column block, each anN0×DN\_\{0\}\\times DbyD×N0D\\times N\_\{0\}product, and one run ofFullcomputesKKsuch products at once\. We use each run on aK0×K0K\_\{0\}\\times K\_\{0\}grid of block products, whereK0:=⌊K⌋K\_\{0\}:=\\lfloor\\sqrt\{K\}\\rfloor: we group the row blocks into*bands*ofK0K\_\{0\}consecutive blocks, and similarly the column blocks, and we call a row band together with a column band a*tile*\(Figure[5](https://arxiv.org/html/2610.06783#S2.F5)\)\. Each tile is one run ofFull\. We fixK02≤KK\_\{0\}^\{2\}\\leq Kdistinct subsets of\{1,…,L\}\\\{1,\\dots,L\\\}of sizemm, one for each block product of the grid, the same in every tile\. In a tile, letXQX\_\{Q\}andYQY\_\{Q\}be the row block and the column block of the block product with subsetQQ, and letXQ=YQ=0X\_\{Q\}=Y\_\{Q\}=0for the other subsetsQQ\. Then one run ofFullcomputes allK02K\_\{0\}^\{2\}block products of the tile \(Lemma[9](https://arxiv.org/html/2610.06783#Thmtheorem9)\), and running it on every tile computes all ofXYXY\.
We pair the blocks in a grid like this, rather than arbitrarily, so that the left input array of a tile depends only on its row band and the right one only on its column band\. This will let us share their encodings among tiles in Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)below\. \(To make the bands fit, we first padNNto a multiple ofK0N0K\_\{0\}N\_\{0\}with zero rows ofXXand zero columns ofYY, which at most doublesNNsinceN≥K0N0N\\geq K\_\{0\}N\_\{0\}, as we will see in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)\.\)
Before moving on, let us compute the number of operations performed by this algorithm\. LetM:=KN02M:=KN\_\{0\}^\{2\}denote the number of output entries among allKKproducts of a tile\. SinceK0≥K/2K\_\{0\}\\geq\\sqrt\{K\}/2, there are\(N/K0N0\)2≤4N2/M\(N/K\_\{0\}N\_\{0\}\)^\{2\}\\leq 4N^\{2\}/Mtiles\. Thus, recalling the operation count of a single tile from Section[2\.3\.1](https://arxiv.org/html/2610.06783#S2.SS3.SSS1), the whole product takesO\(N2ML⋅10L\)O\\big\(\\tfrac\{N^\{2\}\}\{M\}\\,L\\cdot 10^\{L\}\\big\)operations, that is,O\(L⋅10L/M\)O\(L\\cdot 10^\{L\}/M\)per entry ofXYXY\. One can calculate that this isN2poly\(L\)N^\{2\}\\,\\mathrm\{poly\}\(L\)in total whenL=10mL=10m, but aboutN2D0\.2N^\{2\}D^\{0\.2\}for our choiceL=19mL=19m\. We nonetheless chooseL=19mL=19m, and in Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)below we explain why this is needed for our sparsity arguments\.
YY:66column blocks, in22bands ofK0=3K\_\{0\}=3XX:66row blocks, in22bands ofK0=3K\_\{0\}=3Q1Q\_\{1\}Q2Q\_\{2\}Q3Q\_\{3\}Q4Q\_\{4\}Q5Q\_\{5\}Q6Q\_\{6\}Q7Q\_\{7\}Q8Q\_\{8\}Q9Q\_\{9\}the tile of row band22andcolumn band11:K02=9K\_\{0\}^\{2\}=9blockproductsXQYQX\_\{Q\}Y\_\{Q\}, all from oneleft input array \(row band22\)and one right input array\(column band11\)44tilesFigure 5:The tiling, drawn forN=6N0N=6N\_\{0\}andK0=3K\_\{0\}=3\. A block product, a row block ofXXtimes a column block ofYY, holdsN02N\_\{0\}^\{2\}entries ofXYXY\. A tile, a band ofK0K\_\{0\}row blocks together with a band ofK0K\_\{0\}column blocks, is one run ofFull, which computes itsK02≤KK\_\{0\}^\{2\}\\leq Kblock products, each with its own subsetQQ\(Q1,…,Q9Q\_\{1\},\\dots,Q\_\{9\}shown in the highlighted tile\)\.
### 2\.4Extracting only the desired entries
In this subsection, we present the main new idea of this paper\. Our goal is now to compute only the wanted entries ofXYXY, i\.e\., those at the positions inWW, which is a set of size\|W\|≤N2/D\|W\|\\leq N^\{2\}/\\sqrt\{D\}\. We will modify the algorithm of Section[2\.3](https://arxiv.org/html/2610.06783#S2.SS3)in two ways\. First, we will observe that the encoding \(step \(2\)\) of each input array depends only on that array and not the other, and that each input array is shared by many tiles \(defined in Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)\), so we can compute each encoding only once and share it among those tiles \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\)\. Second, we will prune the recursion tree for the multiplication and decoding steps \(steps \(3\) and \(4\)\), by skipping a recursive call whenever none of its outputs leads to an output entry fromWW\(Section[2\.4\.2](https://arxiv.org/html/2610.06783#S2.SS4.SSS2)\)\. Finally we will analyze the algorithm by counting the leaves that are reached \(Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)\), and adding up the costs \(Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)\)\.
#### 2\.4\.1Sharing the encoding
The two numbersΦτ\(a\)\\Phi\_\{\\tau\}\(a\)andΨτ\(b\)\\Psi\_\{\\tau\}\(b\)multiplied at a leafτ\\taudepend onaaalone and onbbalone, respectively, so we will compute them once per input array rather than once per tile\. The*encoding*ofaais the array of the10L10^\{L\}numbersΦτ\(a\)\\Phi\_\{\\tau\}\(a\), indexed by the leavesτ\\tau\. This is the array that the encoding steps ofFullcompute fromaa\. To compute it, we runFullwithbbleft out and without step \(4\): by Lemma[7](https://arxiv.org/html/2610.06783#Thmtheorem7), the left number at the leafτ\\tauisΦτ\(a\)\\Phi\_\{\\tau\}\(a\), and the leaf stores it\. This takesO\(10L\)O\(10^\{L\}\)operations, the cost of the encoding in Section[2\.3\.1](https://arxiv.org/html/2610.06783#S2.SS3.SSS1)\. The encoding ofbb, the array of the numbersΨτ\(b\)\\Psi\_\{\\tau\}\(b\), is computed in the same way\.
We compute the encodings of the input arrays of all row bands and all column bands \(defined in Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)\),2N/K0N02N/K\_\{0\}N\_\{0\}arrays of10L10^\{L\}numbers in all, and every tile reads its two encodings from these\. It is important that these encodings are shared, since an encoding has10L=\(9\+1\)L10^\{L\}=\(9\+1\)^\{L\}numbers, more than theM=\(Lm\)9L−mM=\\binom\{L\}\{m\}9^\{L\-m\}entries of theKKproducts of a tile, so encoding every tile separately would cost more than one operation per entry of the entire matrix product \(even before focusing onWW\)\. Since each encoding is computed only once per band, the2N/K0N02N/K\_\{0\}N\_\{0\}encodings are used by all\(N/K0N0\)2\(N/K\_\{0\}N\_\{0\}\)^\{2\}tiles\. Each one costsO\(10L\)O\(10^\{L\}\), independently ofWW\. The assumptionN≥D18N\\geq D^\{18\}makes this cost negligible \(as we will compute in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)\)\.
#### 2\.4\.2Skipping the calls that are not needed
Once the encodings are computed as above, we can skip that phase ofFull\. Instead, each leaf reads its two numbers from the encodings, and each call only performs the decoding of step \(4\)\. We now modifyFullso that each call computes only the outputs that are wanted from it, i\.e\., the outputs that lead to entries inWW\. We will implement this by passing to each call the setSSof the outputs that are wanted from it\.
More precisely, the outputs of the vertexτ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}\(defined in Section[2\.3\.1](https://arxiv.org/html/2610.06783#S2.SS3.SSS1)\) are indexed by output strings of lengthL−kL\-k, andSSis a set of such strings\. IfUUis the set passed to the root \(in the final algorithm, this will be the set of output strings of the wanted entries of the tile\), we will see in Lemma[10](https://arxiv.org/html/2610.06783#Thmtheorem10)thatSSwill consist of the suffixeswk\+1⋯wLw\_\{k\+1\}\\cdots w\_\{L\}of the stringsw∈Uw\\in Uto which the vertex contributes \(as defined in Section[2\.3\.2](https://arxiv.org/html/2610.06783#S2.SS3.SSS2)\)\. Sets of output strings have slices like arrays \(see Section[2\.3\.1](https://arxiv.org/html/2610.06783#S2.SS3.SSS1)\): for a setSSof output strings and an output variablezz, the sliceSzS\_\{z\}is the set of output stringsw′w^\{\\prime\}withzw′∈Szw^\{\\prime\}\\in S, and an array onSSassigns an integer to each string ofSS\.
Our modified version of the recursive algorithmFull, which we callPruned, is as follows\.
Prunedτ1⋯τk\(S\)\\textnormal\{\{Pruned\}\}\_\{\\tau\_\{1\}\\cdots\\tau\_\{k\}\}\(S\), for a setSSof output strings of lengthL−kL\-k, returns the array returned by the vertexτ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}ofFull, restricted to the strings inSS:
1. \(1\)Ifk=Lk=L, then look upΦτ\(a\)\\Phi\_\{\\tau\}\(a\)andΨτ\(b\)\\Psi\_\{\\tau\}\(b\)from the precomputed encodings \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\) and returnΦτ\(a\)Ψτ\(b\)\\Phi\_\{\\tau\}\(a\)\\,\\Psi\_\{\\tau\}\(b\)for the leafτ=τ1⋯τL\\tau=\\tau\_\{1\}\\cdots\\tau\_\{L\}\.
2. \(2\)For each termλ\\lambdaof Schönhage’s identity, letSλS\_\{\\lambda\}be the union of the slicesSzS\_\{z\}over thezzto whichλ\\lambdacontributes, i\.e\.,SPij:=Szij∪Sz0S\_\{P\_\{ij\}\}:=S\_\{z\_\{ij\}\}\\cup S\_\{z\_\{0\}\}andSP0:=Sz0S\_\{P\_\{0\}\}:=S\_\{z\_\{0\}\}\.
3. \(3\)For each termλ\\lambdaof Schönhage’s identity withSλ≠∅S\_\{\\lambda\}\\neq\\emptyset, computeCλ:=Prunedτ1⋯τkλ\(Sλ\)C\_\{\\lambda\}:=\\textnormal\{\{Pruned\}\}\_\{\\tau\_\{1\}\\cdots\\tau\_\{k\}\\lambda\}\(S\_\{\\lambda\}\), an array onSλS\_\{\\lambda\}\.
4. \(4\)Return the arraycconSSwhose slices areczij:=CPijc\_\{z\_\{ij\}\}:=C\_\{P\_\{ij\}\}andcz0:=∑λCλc\_\{z\_\{0\}\}:=\\sum\_\{\\lambda\}C\_\{\\lambda\}, restricted toSzijS\_\{z\_\{ij\}\}and toSz0S\_\{z\_\{0\}\}\. \(These restrictions make sense, sinceSzij⊆SPijS\_\{z\_\{ij\}\}\\subseteq S\_\{P\_\{ij\}\}andSz0⊆SλS\_\{z\_\{0\}\}\\subseteq S\_\{\\lambda\}for everyλ\\lambda, by step \(2\)\.\)
Let us confirm which leavesPrunedvisits\. Recall from \([2](https://arxiv.org/html/2610.06783#S2.E2)\) thatMult\(a,b\)\[w\]\\textnormal\{\{Mult\}\}\(a,b\)\[w\]is the sum ofΦτ\(a\)Ψτ\(b\)\\Phi\_\{\\tau\}\(a\)\\Psi\_\{\\tau\}\(b\)over the leaves contributing toww\(as defined in Section[2\.3\.2](https://arxiv.org/html/2610.06783#S2.SS3.SSS2)\), i\.e\., those that choosePijP\_\{ij\}at every level wherewwhaszijz\_\{ij\}, and may choose any term at levels wherewwhasz0z\_\{0\}\. For a setUUof output strings of lengthLL, we writeLeaves\(U\)\\mathrm\{Leaves\}\(U\)for the set of leaves that contribute to some output string ofUU\.
###### Lemma 10\.
Letaaandbbbe input arrays, and letUUbe a set of output strings of lengthLL\. Called at the root,Pruned\(U\)\\textnormal\{\{Pruned\}\}\(U\)returnsMult\(a,b\)\\textnormal\{\{Mult\}\}\(a,b\)restricted toUU\. The leaves it visits are exactly those ofLeaves\(U\)\\mathrm\{Leaves\}\(U\), and the sets passed to the calls it makes have total size at most\(L\+1\)\|Leaves\(U\)\|\(L\+1\)\\,\|\\mathrm\{Leaves\}\(U\)\|\.
###### Proof\.
The values are correct by induction onL−kL\-k: eachCλC\_\{\\lambda\}is the array of the corresponding child ofFullrestricted toSλS\_\{\\lambda\}, so step \(4\) is step \(4\) ofFullrestricted toSS\.
Recall thatSλS\_\{\\lambda\}consists of the lastL−k−1L\-k\-1variables of each string inSSsuch thatλ\\lambdacontributes to the first variable of that string\. Thus, an induction onkkshows that the set passed to the vertexτ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}consists of the suffixeswk\+1⋯wLw\_\{k\+1\}\\cdots w\_\{L\}of the stringswwofUUto which the vertex contributes, and furthermore that the vertex is called if and only if this set is nonempty\. This means a leaf is visited if and only if it contributes to some string ofUU\.
For the total size, map each suffix in the set passed to a vertexτ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}to the leaf that extendsτ1⋯τk\\tau\_\{1\}\\cdots\\tau\_\{k\}by pickingPijP\_\{ij\}at the levels where the suffix haszijz\_\{ij\}and by pickingP0P\_\{0\}where it hasz0z\_\{0\}\. By the previous paragraph, the vertex contributes to some stringwwofUUwith this suffix, and then so does this leaf, so the leaf is inLeaves\(U\)\\mathrm\{Leaves\}\(U\)\. The leaf determines the vertex and the suffix\. This means the sets passed to the vertices at each of theL\+1L\+1depths have total size at most\|Leaves\(U\)\|\|\\mathrm\{Leaves\}\(U\)\|\. ∎
In other words, each call is made at most once, no matter how many strings ofUUdepend on it, and the running time depends on the size of the union of the sets of leaves contributing to the strings ofUU, rather than the sum of their sizes\. It remains to bound this union\.
#### 2\.4\.3Few leaves contribute to a sparse set of entries
In our final algorithm, which we present below in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4), the setUUpassed toPrunedwill consist only of the output strings we have been focusing on, i\.e\., output strings of lengthLLwhose inner sets \(defined in Section[2\.3\.3](https://arxiv.org/html/2610.06783#S2.SS3.SSS3)\) have exactlymmelements, so that they index the entries of the productsXQYQX\_\{Q\}Y\_\{Q\}\(Lemma[9](https://arxiv.org/html/2610.06783#Thmtheorem9)\)\. There areM=\(Lm\)9L−m=KN02M=\\binom\{L\}\{m\}9^\{L\-m\}=KN\_\{0\}^\{2\}such output strings \(withMMas defined in Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)\), and in this subsection all output strings are of this kind\.
Our focus in this subsection is on counting how many leaves thePrunedalgorithm visits\. A single output string has10m=Dlog410≈D1\.6610^\{m\}=D^\{\\log\_\{4\}10\}\\approx D^\{1\.66\}leaves contributing to it\. This may appear problematic, since it is more than theDDmultiplications that computing that output entry directly, as an inner product, would take\. Because of this, it is important that we do not simply count the leaves of each output string ofUUseparately\. Instead, we will find that most leaves contributing to an output string also contribute to many other output strings, and there are few such leaves in total\.
Let us begin by classifying leaves by how many levels they chooseP0P\_\{0\}at \(as opposed to one of thePijP\_\{ij\}s\)\. As we mentioned above, the leaves contributing to an output string with inner setQQare the10m10^\{m\}leaves that choose any term at each of themmlevels ofQQ, butPijP\_\{ij\}at every level outsideQQwhere the output string haszijz\_\{ij\}\. We call the one that choosesP0P\_\{0\}at every level ofQQthe*private leaf*of the output string\. The private leaf contributes to no other output string, since an output string with a different inner set requires a term other thanP0P\_\{0\}at some level ofQQ, and an output string with the same inner set but a different outer part \(a differentzijz\_\{ij\}at some level outsideQQ\) requires a different term there\.
To describe how close a leaf is to being a private leaf, we define the*order*of a leaf asmmminus the number of levels at which it choosesP0P\_\{0\}\. A leaf contributing to an output string choosesP0P\_\{0\}only at levels of the output string’s inner set, so its order is at least00\. SinceP0P\_\{0\}is the only term that serves the inner product alone, this is the classification described in the technique overview: the order of a leaf contributing to an output string is the number of levels of the string’s inner set at which the leaf takes one of the termsPijP\_\{ij\}shared with the outer product\. The only leaf of order00contributing to an output string is its private leaf\. Beyond this, exactly
αd:=\(md\)9d\\alpha\_\{d\}:=\\binom\{m\}\{d\}9^\{d\}leaves of orderddcontribute to an output string, namely its private leaf withP0P\_\{0\}replaced by one of the nine other terms atddof the levels ofQQ\(Figure[6](https://arxiv.org/html/2610.06783#S2.F6)\)\.
The total number of leaves of orderddin the entire recursion tree is
βd:=\(Lm−d\)9L−m\+d\\beta\_\{d\}:=\\binom\{L\}\{m\-d\}9^\{L\-m\+d\}since we can choose them−dm\-dlevels withP0P\_\{0\}and one of the nine other terms at every other level\. In particular,β0=\(Lm\)9L−m=M\\beta\_\{0\}=\\binom\{L\}\{m\}9^\{L\-m\}=Msince the leaves of order00are exactly the private leaves, and there is one per output string\. A leaf of orderddcontributes to\(L−m\+dd\)\\binom\{L\-m\+d\}\{d\}output strings, one for each inner set of sizemmthat contains them−dm\-dlevels at which it choosesP0P\_\{0\}\. Indeed,Mαd=βd\(L−m\+dd\)M\\alpha\_\{d\}=\\beta\_\{d\}\\binom\{L\-m\+d\}\{d\}, as both sides count the pairs of an output string and a leaf of orderddcontributing to it\. Finally, ifL=19mL=19m, then for1≤d≤m1\\leq d\\leq mwe have
βdβd−1=9\(m−d\+1\)L−m\+d≤9m18m\+1<12,soβd≤2−dM\.\\frac\{\\beta\_\{d\}\}\{\\beta\_\{d\-1\}\}=\\frac\{9\(m\-d\+1\)\}\{L\-m\+d\}\\leq\\frac\{9m\}\{18m\+1\}<\\frac\{1\}\{2\},\\qquad\\text\{so\}\\qquad\\beta\_\{d\}\\leq 2^\{\-d\}M\.\(5\)
As in the technique overview, leaves of higher order are more numerous per output string, but each of them is shared by more output strings, and by \([5](https://arxiv.org/html/2610.06783#S2.E5)\) there are fewer of them in all\. Below, we count all the leaves of orderd\>m/9d\>m/9, whether or not they contribute to a string ofUU, and this count will be small enough since theβd\\beta\_\{d\}decrease geometrically\. By the ratio in \([5](https://arxiv.org/html/2610.06783#S2.E5)\), this requiresmmto be well belowL/10L/10: atm≈L/10m\\approx L/10, the choice that computes the whole product cheaply \(Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)\), the ratio would be close to11for smalldd, so theβd\\beta\_\{d\}would stay aboutMMinstead of decreasing, and the count would give no saving\. A smallmmalso makesD=4mD=4^\{m\}small compared withN0=318mN\_\{0\}=3^\{18m\}\(aboutN00\.07N\_\{0\}^\{0\.07\}\), and since a tile must fit into the product,NNmust be a large power ofDD\. Together with the cost of the encodings \(Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)\), this is why Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)assumesN≥D18N\\geq D^\{18\}\.
From now on, we fixL=19mL=19m, so thatN0=318mN\_\{0\}=3^\{18m\}andK=\(19mm\)K=\\binom\{19m\}\{m\}\. Recall thatD=4mD=4^\{m\}, so2m=D2^\{m\}=\\sqrt\{D\}and2−m/9=D−1/182^\{\-m/9\}=D^\{\-1/18\}\.
order 0:P13P\_\{13\}P0P\_\{0\}P21P\_\{21\}P33P\_\{33\}P0P\_\{0\}P12P\_\{12\}the private leaf ofww,α0=1\\alpha\_\{0\}=1leaf, contributing to11output stringorder 1:P13P\_\{13\}PijP\_\{ij\}P21P\_\{21\}P33P\_\{33\}P0P\_\{0\}P12P\_\{12\}P13P\_\{13\}P0P\_\{0\}P21P\_\{21\}P33P\_\{33\}PijP\_\{ij\}P12P\_\{12\}α1=\(21\)⋅9=18\\alpha\_\{1\}=\\binom\{2\}\{1\}\\cdot 9=18leaves,each contributing to\(51\)=5\\binom\{5\}\{1\}=5output stringsorder 2:P13P\_\{13\}PijP\_\{ij\}P21P\_\{21\}P33P\_\{33\}PijP\_\{ij\}P12P\_\{12\}α2=\(22\)⋅81=81\\alpha\_\{2\}=\\binom\{2\}\{2\}\\cdot 81=81leaves,each contributing to\(62\)=15\\binom\{6\}\{2\}=15output stringslevelsℓ=1,…,6\\ell=1,\\dots,6\(shaded: the levels ofQ=\{2,5\}Q=\\\{2,5\\\}\)Figure 6:The leaves contributing to one output string, drawn forL=6L=6,m=2m=2, and the output stringw=z13z0z21z33z0z12w=z\_\{13\}z\_\{0\}z\_\{21\}z\_\{33\}z\_\{0\}z\_\{12\}of Figure[4](https://arxiv.org/html/2610.06783#S2.F4)\. A leaf is written as the string of terms it chose, level by level\. A leaf of orderddis the private leaf withP0P\_\{0\}replaced by one of the nine termsPijP\_\{ij\}\(shown as a genericPijP\_\{ij\}in the shaded cells\) at exactlyddlevels\. Leaves of higher order are more numerous per output string, but each is shared by more output strings: a leaf that choseP0P\_\{0\}atm−dm\-dlevels contributes to one output string for each setQQof sizemmcontaining those levels,\(L−m\+dd\)\\binom\{L\-m\+d\}\{d\}of them\. AtL=19mL=19mthis makes them fewer in all, by \([5](https://arxiv.org/html/2610.06783#S2.E5)\)\.###### Lemma 11\.
For every setUUof output strings whose inner sets have exactlymmelements,
\|Leaves\(U\)\|≤∑d=0mmin\{\|U\|αd,βd\},\|\\mathrm\{Leaves\}\(U\)\|\\;\\leq\\;\\sum\_\{d=0\}^\{m\}\\min\\\{\|U\|\\alpha\_\{d\},\\ \\beta\_\{d\}\\\},and ifL=19mL=19m, then\|Leaves\(U\)\|≤2−m/9\(2m\|U\|\+2M\)\|\\mathrm\{Leaves\}\(U\)\|\\leq 2^\{\-m/9\}\\big\(2^\{m\}\|U\|\+2M\\big\)\.
orderddnumber of leaves \(log scale\)\|U\|αd\|U\|\\,\\alpha\_\{d\}βd≤2−dM\\beta\_\{d\}\\leq 2^\{\-d\}Mm/9m/9mm\\vphantom\{/9\}MM\|U\|\|U\|small order:charge eachoutput stringlarge order:take all the leavesFigure 7:The count of Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11), schematically\. The leaves of orderddinLeaves\(U\)\\mathrm\{Leaves\}\(U\)number at mostmin\{\|U\|αd,βd\}\\min\\\{\|U\|\\alpha\_\{d\},\\,\\beta\_\{d\}\\\}: the bound\|U\|αd\|U\|\\alpha\_\{d\}grows withddup tod≈0\.9md\\approx 0\.9m\(more leaves of higher order contribute to each output string\), and the boundβd\\beta\_\{d\}shrinks geometrically \(there are fewer leaves of higher order\)\. The proof splits atd=m/9d=m/9, which is not necessarily where the two bounds cross, and it bounds the total by the shaded area\.###### Proof\.
We bound the number of leaves of orderddinLeaves\(U\)\\mathrm\{Leaves\}\(U\)in two ways: by\|U\|αd\|U\|\\alpha\_\{d\}, charging each output string ofUUfor its leaves of orderdd, and byβd\\beta\_\{d\}, the number of all leaves of orderdd\. Since every leaf ofLeaves\(U\)\\mathrm\{Leaves\}\(U\)has an order0≤d≤m0\\leq d\\leq m, summing the smaller of the two overddgives the first inequality\. \(Summed on their own,\|U\|αd\|U\|\\alpha\_\{d\}gives\|U\|⋅10m\|U\|\\cdot 10^\{m\}, the cost of computing each output string ofUUby itself, andβd\\beta\_\{d\}gives less than2M2Mby \([5](https://arxiv.org/html/2610.06783#S2.E5)\), the cost of computing allMMoutput strings\.\) Neither\|U\|αd\|U\|\\alpha\_\{d\}norβd\\beta\_\{d\}depends on which output strings are inUU\.
For the second inequality, letL=19mL=19m\. We use\|U\|αd\|U\|\\alpha\_\{d\}for the ordersd≤m/9d\\leq m/9andβd\\beta\_\{d\}for the ordersd\>m/9d\>m/9\(Figure[7](https://arxiv.org/html/2610.06783#S2.F7)\)\. The ordersd\>m/9d\>m/9contribute at most∑d\>m/9βd≤M∑d\>m/92−d<2⋅2−m/9M\\sum\_\{d\>m/9\}\\beta\_\{d\}\\leq M\\sum\_\{d\>m/9\}2^\{\-d\}<2\\cdot 2^\{\-m/9\}Mby \([5](https://arxiv.org/html/2610.06783#S2.E5)\)\. The ordersd≤m/9d\\leq m/9contribute at most\|U\|∑d≤m/9\(md\)9d\|U\|\\sum\_\{d\\leq m/9\}\\binom\{m\}\{d\}9^\{d\}, and since9d=72d8−d≤72m/98−d9^\{d\}=72^\{d\}8^\{\-d\}\\leq 72^\{m/9\}8^\{\-d\}ford≤m/9d\\leq m/9,
∑d≤m/9\(md\)9d≤72m/9∑d=0m\(md\)8−d=72m/9\(98\)m=\(72⋅\(98\)9\)m/9<256m/9=2m⋅2−m/9,\\sum\_\{d\\leq m/9\}\\binom\{m\}\{d\}9^\{d\}\\leq 72^\{m/9\}\\sum\_\{d=0\}^\{m\}\\binom\{m\}\{d\}8^\{\-d\}=72^\{m/9\}\\Big\(\\frac\{9\}\{8\}\\Big\)^\{m\}=\\Big\(72\\cdot\\big\(\\tfrac\{9\}\{8\}\\big\)^\{9\}\\Big\)^\{m/9\}<256^\{m/9\}=2^\{m\}\\cdot 2^\{\-m/9\},since72⋅\(9/8\)9<20872\\cdot\(9/8\)^\{9\}<208\. Adding the two parts gives the second inequality\. ∎
Since2m=D2^\{m\}=\\sqrt\{D\}and2−m/9=D−1/182^\{\-m/9\}=D^\{\-1/18\}, the second inequality of Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11)says that
\|Leaves\(U\)\|≤D−1/18\(D\|U\|\+2M\)\.\|\\mathrm\{Leaves\}\(U\)\|\\;\\leq\\;D^\{\-1/18\}\\big\(\\sqrt\{D\}\\,\|U\|\+2M\\big\)\.Consider a tile in which\|U\|=M/D\|U\|=M/\\sqrt\{D\}entries are wanted\. \(This is the density of Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5), which allowsN2/DN^\{2\}/\\sqrt\{D\}wanted entries out ofN2N^\{2\}\.\) ThenD\|U\|=M\\sqrt\{D\}\\,\|U\|=M, and the bound says that onlyO\(M/D1/18\)O\(M/D^\{1/18\}\)leaves contribute to the wanted entries of the tile\. This is a factorD1/18D^\{1/18\}below the numberMMof output entries of the tile, and far below the\|U\|⋅D=MD\|U\|\\cdot D=M\\sqrt\{D\}multiplications that computing each wanted entry directly, as an inner product, would take\. Next in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)we sum the number of leaves over all the tiles, and we will use the fact that the bound is linear in\|U\|\|U\|, meaning the total is the same no matter how the wanted entries are spread over the tiles\.
#### 2\.4\.4Proof of Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)
We finally put everything together to state and analyze our algorithm\. As before, setD=4mD=4^\{m\}andL=19mL=19m\.
*Two consequences ofN≥D18N\\geq D^\{18\}\.*We use the assumptionN≥D18N\\geq D^\{18\}twice, each time to check thatNNis large enough compared with a quantity that grows exponentially inmm\. SinceD18=418mD^\{18\}=4^\{18m\}, we comparemm\-th powers by comparing their bases\.
First, the tiling of Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)requires thatN≥K0N0N\\geq K\_\{0\}N\_\{0\}so that it does not lose too much when padding, since it padsNNto a multiple ofK0N0K\_\{0\}N\_\{0\}\. This holds: using the general bound\(Lm\)≤\(eL/m\)m\\binom\{L\}\{m\}\\leq\(eL/m\)^\{m\}, we haveK=\(19mm\)≤\(19e\)mK=\\binom\{19m\}\{m\}\\leq\(19e\)^\{m\}, soKN0≤\(19e⋅318\)m≤418mKN\_\{0\}\\leq\(19e\\cdot 3^\{18\}\)^\{m\}\\leq 4^\{18m\}, as19e⋅318<41819e\\cdot 3^\{18\}<4^\{18\}, and henceK0N0≤KN0≤D18≤NK\_\{0\}N\_\{0\}\\leq KN\_\{0\}\\leq D^\{18\}\\leq N\. This means the padding at most doublesNN, and we continue to writeNNfor the padded size\.
Second, the encoding phase of the algorithm \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\) has a cost that does not depend onWWat all, and we need to ensure it is not too large\. Recall that we perform2N/K0N02N/K\_\{0\}N\_\{0\}encodings, which useO\(10L\)O\(10^\{L\}\)operations each\. To afford them within our budget ofO\(2−m/9N2\)O\(2^\{\-m/9\}N^\{2\}\)operations, we need
10L≤2−m/9NN0\.10^\{L\}\\leq 2^\{\-m/9\}\\,NN\_\{0\}\.\(6\)This also holds:1019⋅21/9/318<41810^\{19\}\\cdot 2^\{1/9\}/3^\{18\}<4^\{18\}, so10L⋅2m/9/N0≤D18≤N10^\{L\}\\cdot 2^\{m/9\}/N\_\{0\}\\leq D^\{18\}\\leq N\.
*The algorithm\.*We compute the encodings of all row bands and column bands \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\)\. Each wanted position\(I,J\)∈W\(I,J\)\\in Wlies in one tileTTand is indexed by one output string ofTT, the string whose inner set is the subsetQQof the block product containing\(I,J\)\(I,J\)and whose row and column are those of\(I,J\)\(I,J\)within that block product \(Sections[2\.3\.3](https://arxiv.org/html/2610.06783#S2.SS3.SSS3)and[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)\)\. For each tileTT, letWTW\_\{T\}be the set of the output strings of the wanted positions inTT\. Then, for each tileTTwithWT≠∅W\_\{T\}\\neq\\emptyset, we runPruned\(WT\)\\textnormal\{\{Pruned\}\}\(W\_\{T\}\), and report, for each\(I,J\)∈W\(I,J\)\\in W, the value at its output string\. This is correct by Lemmas[9](https://arxiv.org/html/2610.06783#Thmtheorem9)and[10](https://arxiv.org/html/2610.06783#Thmtheorem10)\.
*The cost\.*By \([6](https://arxiv.org/html/2610.06783#S2.E6)\), the encodings cost\(2N/K0N0\)⋅O\(10L\)=O\(2−m/9N2\)\(2N/K\_\{0\}N\_\{0\}\)\\cdot O\(10^\{L\}\)=O\(2^\{\-m/9\}N^\{2\}\)operations\. Each position ofWWlands in one setWTW\_\{T\}, so∑T\|WT\|≤\|W\|≤N2/D=2−mN2\\sum\_\{T\}\|W\_\{T\}\|\\leq\|W\|\\leq N^\{2\}/\\sqrt\{D\}=2^\{\-m\}N^\{2\}, and there are at most4N2/M4N^\{2\}/Mtiles, so∑TM≤4N2\\sum\_\{T\}M\\leq 4N^\{2\}\. A call ofPrunedwith a setSStakesO\(L\|S\|\)O\(L\|S\|\)operations, since each of its steps handles each string ofSSa constant number of times and a string has lengthLL\(we store the sets as sorted lists, so that a slice is a segment and a union of slices is a merge\)\. By Lemma[10](https://arxiv.org/html/2610.06783#Thmtheorem10), the total number of operations per leaf ofLeaves\(WT\)\\mathrm\{Leaves\}\(W\_\{T\}\)is thusO\(L2\)=O\(log2D\)O\(L^\{2\}\)=O\(\\log^\{2\}\\\!D\)\. Thus, by Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11)summed over the tiles, the pruned recursions use
O\(L2∑T\|Leaves\(WT\)\|\)≤O\(L22−m/9\(2m\|W\|\+2∑TM\)\)=O\(L22−m/9N2\)O\\Big\(L^\{2\}\\sum\_\{T\}\|\\mathrm\{Leaves\}\(W\_\{T\}\)\|\\Big\)\\;\\leq\\;O\\Big\(L^\{2\}\\,2^\{\-m/9\}\\Big\(2^\{m\}\|W\|\+2\\sum\_\{T\}M\\Big\)\\Big\)\\;=\\;O\(L^\{2\}\\,2^\{\-m/9\}N^\{2\}\)operations, no matter howWWis distributed among the tiles\. The remaining minutiae, which list theK02K\_\{0\}^\{2\}subsets, locate the output strings, and sort the setsWTW\_\{T\}, takeO\(L\)O\(L\)operations per subset, per tile, and per position ofWW, which isO\(L2−m/9N2\)O\(L\\,2^\{\-m/9\}N^\{2\}\)in all \(asK≤NK\\leq N, there are at most4N2/N04N^\{2\}/N\_\{0\}tiles,\|W\|≤2−mN2\|W\|\\leq 2^\{\-m\}N^\{2\}, andN,N0≥2m/9N,N\_\{0\}\\geq 2^\{m/9\}\)\. Finally, sinceL=19log4DL=19\\log\_\{4\}Dand2−m/9=D−1/182^\{\-m/9\}=D^\{\-1/18\}, the total operation count isO\(N2log2D/D1/18\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{1/18\}\), as desired\.
*Word size\.*Every number the algorithm handles is an integer of magnitudeNO\(1\)N^\{O\(1\)\}\. The input entries are of this size, by assumption\. Every number in an encoding, or formed on the way to one, is a±1\\pm 1combination of at most7L7^\{L\}input entries, as step \(2\) only adds and subtracts slices, and every value computed byPrunedis a sum of at most10L10^\{L\}products of two encoded numbers \(Lemma[7](https://arxiv.org/html/2610.06783#Thmtheorem7)\), where7L≤10L≤N27^\{L\}\\leq 10^\{L\}\\leq N^\{2\}by \([6](https://arxiv.org/html/2610.06783#S2.E6)\)\. Indices and list positions are at most the number of words in use, alsoNO\(1\)N^\{O\(1\)\}\. Hence every integer hasO\(logN\)O\(\\log N\)bits, as desired\. ∎
## 3Exact Triangle reduces to computing certain entries of a thin matrix product
This section derives the faster deterministic algorithms for Exact Triangle \(given a tripartite graph with integer weights on its edges, is there a triangle whose three weights sum to zero?\),33SUM, and APSP from our new matrix theorem\. Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)already suffices for this, and its stronger form in Section[4](https://arxiv.org/html/2610.06783#S4), Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26), gives the running times stated in the introduction\. Later, in Section[5](https://arxiv.org/html/2610.06783#S5), we will similarly derive our other algorithmic results\.
Almost nothing in this section is new\. We will apply known reductions from fine\-grained complexity theory, due to Pătraşcu\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135)\], Kopelowitz, Pettie, and Porat\[[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\], Vassilevska Williams and Williams\[[VW13](https://arxiv.org/html/2610.06783#bib.bibx158),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\], Vassilevska Williams and Xu\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160)\], Chan and He\[[CH20](https://arxiv.org/html/2610.06783#bib.bibx51)\], Chan and Xu\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\], and Fischer, Kaliciak, and Polak\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\]\. We go into some detail rather than just citing these known results for two main reasons\. First, the theorem statements in the literature do not quite match the parameter regime of the matrix theorem, and obtaining exactly the matrix shapes that our algorithm needs requires slight modifications of the known constructions\. Second, for one step, the reduction from Exact Triangle to the lopsided triangle problem, the only known reduction that achieves the parameters we need is randomized\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160)\], and the known deterministic one\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\]targets the balanced problem\. We will make a small modification to achieve a deterministic reduction, using a known tool\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\]\. The reductions from33SUM and APSP to Exact Triangle are deterministic already, and we cite them as they are\. Thus, all the steps are deterministic, and so we ultimately design deterministic algorithms for all these problems\. In Figure[8](https://arxiv.org/html/2610.06783#S3.F8)we give an overview of the relevant reductions\.
3SUMO\(n1\.99923\)O\(n^\{1\.99923\}\),O\(n1\.9992\)O\(n^\{1\.9992\}\)\(Thm\.[22](https://arxiv.org/html/2610.06783#Thmtheorem22)\)APSPO\(n2\.99949\)O\(n^\{2\.99949\}\),O\(n2\.99942\)O\(n^\{2\.99942\}\)\(Thm\.[22](https://arxiv.org/html/2610.06783#Thmtheorem22)\)Exact TriangleO\(n3−1/648log2n\)O\(n^\{3\-1/648\}\\log^\{2\}n\),O\(n3−0\.00175logn\)O\(n^\{3\-0\.00175\}\\log n\)\(Thm\.[19](https://arxiv.org/html/2610.06783#Thmtheorem19)\)Lopsided All\-Edges Sparse TriangleO\(n2log2D/D1/18\)O\(n^\{2\}\\log^\{2\}\\\!D/D^\{1/18\}\)\(Cor\.[15](https://arxiv.org/html/2610.06783#Thmtheorem15)\),O\(n2/D0\.063\)O\(n^\{2\}/D^\{0\.063\}\)\(Cor\.[16](https://arxiv.org/html/2610.06783#Thmtheorem16)\)Certain entries of a thin matrix productO\(n2log2D/D1/18\)O\(n^\{2\}\\log^\{2\}\\\!D/D^\{1/18\}\)\(Thm\.[5](https://arxiv.org/html/2610.06783#Thmtheorem5)\),O\(n2/D0\.063\)O\(n^\{2\}/D^\{0\.063\}\)\(Cor\.[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\)\[[CH20](https://arxiv.org/html/2610.06783#bib.bibx51),[VW13](https://arxiv.org/html/2610.06783#bib.bibx158)\], Thm\.[21](https://arxiv.org/html/2610.06783#Thmtheorem21)\(a\)\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[VW13](https://arxiv.org/html/2610.06783#bib.bibx158)\], Thm\.[21](https://arxiv.org/html/2610.06783#Thmtheorem21)\(b\)\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160),[CX24](https://arxiv.org/html/2610.06783#bib.bibx71),[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\], Thm\.[17](https://arxiv.org/html/2610.06783#Thmtheorem17)Straightforward \(Sec\.[3\.1](https://arxiv.org/html/2610.06783#S3.SS1)\)Figure 8:The reductions of this section\. Each arrow is a reduction, labeled with the prior work it follows and with the statement here that proves it\. Each box gives two running times: the first follows from Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5), and the second from its stronger form, Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\. We reprove only the reduction from Exact Triangle to Lopsided All\-Edges Sparse Triangle, deterministically and for the parameters of the matrix theorem; the reductions from 3SUM and APSP are cited as they are\. The running times in the two bottom boxes assumen≥D18n\\geq D^\{18\}and\|W\|≤n2/D\|W\|\\leq n^\{2\}/\\sqrt\{D\}\.We remind the reader of some basics from fine\-grained complexity that we will use here\. A*reduction*from a problemAAto a problemBBis an algorithm forAAthat builds instances ofBB, solves them using an*oracle*\(an algorithm forBBthat it treats as a constant time black box\), and does some extra work\. We will typically state three things about it: how many instances it builds, of what size, and how much extra time it uses\. Composed with an algorithm forBB, it is an algorithm forAA, whose running time is the extra time plus the total time to solveBBon each instance created\. Such a reduction can be interpreted as conferring hardness \(ifAAis hard then so isBB\) or as an algorithmic tool \(a faster algorithm forBBgives one forAA\)\. Here we will use the second interpretation to design our algorithms\.
The particular types of reductions we focus on arefine\-grained reductions\. Here, for two problemsAAandBBand two time boundsa\(n\),b\(n\)a\(n\),b\(n\), an\(a\(n\),b\(n\)\)\(a\(n\),b\(n\)\)\-fine\-grained reduction fromAAtoBBis an algorithmRRthat solves anynn\-sized instance ofAAby making oracle calls to instances ofBBof some sizesn1,…,ntn\_\{1\},\\ldots,n\_\{t\}where for everyδ\>0\\delta\>0there is anε\>0\\varepsilon\>0s\.t\.∑i=1t\(b\(ni\)\)1−δ≤a\(n\)1−ε\\sum\_\{i=1\}^\{t\}\(b\(n\_\{i\}\)\)^\{1\-\\delta\}\\leq a\(n\)^\{1\-\\varepsilon\}and so thatRRsolvesAAinO\(a\(n\)1−ε\)O\(a\(n\)^\{1\-\\varepsilon\}\)time\. In other words, ifBBhad anO\(b\(N\)1−δ\)O\(b\(N\)^\{1\-\\delta\}\)time algorithm, then replacing the oracle calls by calls to the algorithm, due to the inequality above, we would get anO\(a\(n\)1−ε\)O\(a\(n\)^\{1\-\\varepsilon\}\)time algorithm forAA\.
Section[3\.1](https://arxiv.org/html/2610.06783#S3.SS1)restates Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)and Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)in the language of graphs\. Section[3\.2](https://arxiv.org/html/2610.06783#S3.SS2)reproves the reduction from Exact Triangle to the lopsided problem in a deterministic way\. It hashes the weights modulo a small prime \(in place of the random hash functions of earlier reductions: almost\-linear hashing in the reductions from33SUM\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\], and a random map into a large prime field in\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160)\]\), chooses the prime deterministically by counting false positives, as in the33SUM reduction of Fischer, Kaliciak, and Polak\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\], and builds the instances and searches for witnesses as in Chan and Xu\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\]\. The false positive counting in\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\]is accomplished using the FFT; here, similar to prior work \(e\.g\.,\[[AGM97](https://arxiv.org/html/2610.06783#bib.bibx14)\]\), for Exact Triangle we compute the count by multiplying two matrices whose entries are polynomials of low degree which can be done efficiently using fast matrix multiplication\. Section[3\.3](https://arxiv.org/html/2610.06783#S3.SS3)combines this reduction with Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)and Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)to solve Exact Triangle in truly subcubic time\. Section[3\.4](https://arxiv.org/html/2610.06783#S3.SS4)restates the reductions from33SUM and APSP to Exact Triangle\[[VW13](https://arxiv.org/html/2610.06783#bib.bibx158),[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[CH20](https://arxiv.org/html/2610.06783#bib.bibx51)\]with their overheads, and applies them\.
### 3\.1The Lopsided All\-Edges Sparse Triangle problem
We define a lopsided \(rectangular\) version of the well\-studied problem All\-Edges Sparse Triangle\. When viewed in graph terms, Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)counts the triangles through prescribed pairs of vertices in a tripartite graph whose middle part is small, and thus in particular can be used to solve All\-Edges Sparse Triangle in such graphs\.
###### Definition 13\(Lopsided All\-Edges Sparse Triangle,Lop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)\)\.
We are given an unweighted undirected tripartite graph with two partsAAandBBofnnvertices each and a middle partMMof at mostDDvertices, with arbitrary edges inM×AM\\times AandM×BM\\times B\. LetW⊆A×BW\\subseteq A\\times Bbe the set of edges betweenAAandBB\. Decide, for every edge\(a,b\)∈W\(a,b\)\\in W, whether it lies in a triangle with some vertex ofMM, that is, whetheraaandbbhave a common neighbor inMM\.
In this notation, the usual All\-Edges Sparse Triangle problem is the balanced caseD=nD=n\(after the standard reduction to tripartite graphs\), except that one asks about every edge of the graph, not only those betweenAAandBB, and that the running time is measured in terms of the numbermmof edges\. We think ofWWas being polynomially smaller thann2n^\{2\}andDDas polynomially smaller thannn, so the instance is sparse in this sense\. The brute\-force algorithm solvesLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)inO\(\|W\|D\)O\(\|W\|D\)time\. IfD≤n0\.321D\\leq n^\{0\.321\}, then, since0\.321≤α0\.321\\leq\\alpha\[[VXXZ24](https://arxiv.org/html/2610.06783#bib.bibx161)\],777Hereα\\alphadenotes the supremum of the constantsα∈\(0,1\]\\alpha\\in\(0,1\]such thatn×nαn\\times n^\{\\alpha\}bynα×nn^\{\\alpha\}\\times nmatrices can be multiplied usingn2\+o\(1\)n^\{2\+o\(1\)\}operations\.fast rectangular matrix multiplication can solve the problem inn2\+o\(1\)n^\{2\+o\(1\)\}time even when\|W\|=n2\|W\|=n^\{2\}\. We will beat both\|W\|D\|W\|Dandn2n^\{2\}forD=nεD=n^\{\\varepsilon\}and\|W\|=n2/D\|W\|=n^\{2\}/\\sqrt\{D\}with a constantε\>0\\varepsilon\>0, and this will suffice to refute both the33SUM and the APSP hypotheses\.
Some of the known reductions, such as those from the real\-valued problems in Section[5\.2](https://arxiv.org/html/2610.06783#S5.SS2), reduce to the counting version of All\-Edges Sparse Triangle, which asks for the number of triangles through each edge; we define the lopsided version\.
###### Definition 14\(Lopsided All\-Edges Sparse Triangle Counting,\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)\)\.
This is the same problem asLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\), except that for every edge\(a,b\)∈W\(a,b\)\\in Wwe ask for the number of triangles it lies in, that is, the number of common neighbors ofaaandbbinMM\.
In matrix language, letX∈\{0,1\}n×DX\\in\\\{0,1\\\}^\{n\\times D\}andY∈\{0,1\}D×nY\\in\\\{0,1\\\}^\{D\\times n\}be the biadjacency matrices of the edges betweenAAandMMand betweenMMandBB, that is,X\[a,v\]=1X\[a,v\]=1if and only ifa∈Aa\\in Aandv∈Mv\\in Mare adjacent, andY\[v,b\]=1Y\[v,b\]=1if and only ifv∈Mv\\in Mandb∈Bb\\in Bare adjacent \(padded with zeros ifMMhas fewer thanDDvertices\)\. ThenLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)asks for the entries of the Boolean product ofXXandYYat the positions inWW, and\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)asks for the corresponding entries of the product ofXXandYYover the integers\. In the language of Section[2](https://arxiv.org/html/2610.06783#S2),WWis the set of wanted positions, and we call its elements the*query pairs*\.
The counting version\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)is also equivalent, up to polylogarithmic factors, to the problem of Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)and Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26), that is, to computing the wanted entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, of a thin matrix product, for matricesX∈ℤn×DX\\in\\mathbb\{Z\}^\{n\\times D\}andY∈ℤD×nY\\in\\mathbb\{Z\}^\{D\\times n\}whose entries have absolute valuenO\(1\)n^\{O\(1\)\}\.888An instance of\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)asks for the wanted entries of a thin matrix product of two0/10/1matrices\. To reduce to\#Lop\-AE\-SparseTri\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}, we use a standard idea: split each matrix into its positive and negative parts and write their entries in binary,X=∑i2iXiX=\\sum\_\{i\}2^\{i\}X\_\{i\}andY=∑j2jYjY=\\sum\_\{j\}2^\{j\}Y\_\{j\}with0/10/1matricesXiX\_\{i\}andYjY\_\{j\}\. ThenXY=∑i,j2i\+jXiYjXY=\\sum\_\{i,j\}2^\{i\+j\}X\_\{i\}Y\_\{j\}, so a product withbb\-bit entries costsO\(b2\)O\(b^\{2\}\)instances of\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)with the same query pairsWW\.
Besides asking for the wanted entries of a Boolean thin matrix product, the detection versionLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)can also be viewed as offline Set Disjointness \(see, e\.g\.,\[[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[VX20](https://arxiv.org/html/2610.06783#bib.bibx160)\]\): the sets are the neighborhoods inMMof the vertices ofAAandBB, over a universe of at mostDDelements, and a query pair\(a,b\)∈W\(a,b\)\\in Wasks whether the sets ofaaandbbare disjoint\. The reductions below \(mostly from prior work\) produce at mostn2/Dn^\{2\}/\\sqrt\{D\}query pairs and sets of at mostD\\sqrt\{D\}elements, which is the regime of\[[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\]and of\[[VX20](https://arxiv.org/html/2610.06783#bib.bibx160), Corollary 3\.12\]\.
With the above discussion in mind, Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)gives the following\.
###### Corollary 15\.
LetD≥4D\\geq 4be a power of four withn≥D18n\\geq D^\{18\}, and consider an instance of\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)or ofLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)with\|W\|\|W\|query pairs\. If\|W\|≤n2/D\|W\|\\leq n^\{2\}/\\sqrt\{D\}, then the instance can be solved deterministically inO\(n2log2D/D1/18\)O\(n^\{2\}\\log^\{2\}\\\!D/D^\{1/18\}\)time\. In general, splittingWWinto sets of at mostn2/Dn^\{2\}/\\sqrt\{D\}query pairs solves it deterministically in time
O\(\(n2\+\|W\|D\)log2D/D1/18\)\.O\\big\(\(n^\{2\}\+\|W\|\\sqrt\{D\}\)\\log^\{2\}\\\!D/D^\{1/18\}\\big\)\.
###### Proof\.
Apply Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)withN=nN=nto the two biadjacency matrices: the entries\(XY\)\[a,b\]\(XY\)\[a,b\],\(a,b\)∈W\(a,b\)\\in W, are the numbers of common neighbors, and they are nonzero exactly for the query pairs that lie in a triangle\. For largerWW, apply the theorem to each of at most⌈\|W\|D/n2⌉\+1\\lceil\|W\|\\sqrt\{D\}/n^\{2\}\\rceil\+1pieces\. ∎
The data structure of Section[4](https://arxiv.org/html/2610.06783#S4)improves the savingD1/18D^\{1/18\}toD0\.063D^\{0\.063\}\(Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\), and gives the following\.
###### Corollary 16\.
Letn≥D18n\\geq D^\{18\}, and consider an instance of\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)or ofLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)with\|W\|\|W\|query pairs\. It can be solved deterministically inO\(\|W\|D0\.437\+n2/D0\.063\)O\(\|W\|\\,D^\{0\.437\}\+n^\{2\}/D^\{0\.063\}\)time\.
###### Proof\.
This is Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)withN=nN=n, applied to the two biadjacency matrices as above\. ∎
For\|W\|=O\(n2/D\)\|W\|=O\(n^\{2\}/\\sqrt\{D\}\), which is what the reductions below produce, the running time in Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16)isO\(n2/D0\.063\)O\(n^\{2\}/D^\{0\.063\}\)\.
The reduction of Section[3\.2](https://arxiv.org/html/2610.06783#S3.SS2)is stated for an arbitraryDD, with the number of oracle calls and the additional time as functions ofDDand a free parametergg, and Section[3\.3](https://arxiv.org/html/2610.06783#S3.SS3)choosesDDandgg\.
### 3\.2A deterministic reduction from Exact Triangle to𝐋𝐨𝐩\-𝐀𝐄\-𝐒𝐩𝐚𝐫𝐬𝐞𝐓𝐫𝐢\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}
##### Exact Triangle\.
An instance of*Exact Triangle*\(also called Zero\-Weight Triangle, and sometimes “Love Triangle”\[[GP18](https://arxiv.org/html/2610.06783#bib.bibx94)\]\) consists of a complete tripartite graph on vertex partsA,B,CA,B,Cofnnvertices each, and an integer weightw\(e\)w\(e\)on every edge, with\|w\(e\)\|≤nν\|w\(e\)\|\\leq n^\{\\nu\}for some constantν≥1\\nu\\geq 1\. LetS\(a,b,c\):=w\(a,b\)\+w\(b,c\)\+w\(a,c\)S\(a,b,c\):=w\(a,b\)\+w\(b,c\)\+w\(a,c\)\. A*zero triangle*is a triangle\(a,b,c\)∈A×B×C\(a,b,c\)\\in A\\times B\\times CwithS\(a,b,c\)=0S\(a,b,c\)=0, and the task is to decide whether one exists\. As is standard, an instance on an arbitrarynn\-vertex graph reduces to this form by taking three copies of the vertex set and giving every missing edge the weight3nν\+13n^\{\\nu\}\+1, which lies in no zero triangle \(this replacesν\\nubyν\+1\\nu\+1\), and the search version, which asks the algorithm to find a zero triangle if one exists, is equivalent to the decision version via a simple self\-reduction \(the reduction below finds one anyway\)\.
###### Theorem 17\(Exact Triangle toLop\-AE\-SparseTri\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}, deterministically\)\.
Let16≤D≤n16\\leq D\\leq n, and let1≤g≤D1\\leq g\\leq\\sqrt\{D\}be an integer\. Exact Triangle onnnvertices per part with weights of absolute value at mostnνn^\{\\nu\}reduces deterministically to at most4ng4nginstances ofLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\), each with at mostn2/Dn^\{2\}/\\sqrt\{D\}query pairs, plusO\(νn3logn/g\+nω\+o\(1\)D3/2\+n2Dg\)O\(\\nu\\,n^\{3\}\\log n/g\+n^\{\\omega\+o\(1\)\}D^\{3/2\}\+n^\{2\}Dg\)additional time, whereω<2\.372\\omega<2\.372is the matrix multiplication exponent\[[ADV\+25](https://arxiv.org/html/2610.06783#bib.bibx10)\]\. The reduction is non\-adaptive: it produces all the instances before it makes any oracle call, so they can be solved in any order, or all together\.
The parameterggtrades the number of instances against the cost of the search for witnesses in the last step of the proof \(the termνn3logn/g\\nu n^\{3\}\\log n/g\); Section[3\.3](https://arxiv.org/html/2610.06783#S3.SS3)balances the two\. The oracle returns at mostn2/Dn^\{2\}/\\sqrt\{D\}answers per instance, and the time to read them is counted as part of the oracle calls, rather than as additional time\.
###### Proof\.
The proof has three steps: we hash the weights modulo a prime, build the instances, and search for witnesses\.
*Hashing modulo a prime\.*We reduce the weights modulo a primep∈\[D/2,D\)p\\in\[\\sqrt\{D\}/2,\\sqrt\{D\}\), chosen deterministically\. This size ofppfits the instances below: a piece ofCCof up toD\\sqrt\{D\}vertices, paired with thepplabels, gives a middle part of at mostDDvertices, and then2n^\{2\}pairs\(a,b\)\(a,b\)fall intoppresidue classes of aboutn2/Dn^\{2\}/\\sqrt\{D\}pairs on average, which is the number of query pairs that an instance may have\. A*false positive*ofppis a triple\(a,b,c\)\(a,b,c\)withS\(a,b,c\)≠0S\(a,b,c\)\\neq 0andp\|S\(a,b,c\)p\\mid S\(a,b,c\); letF\(p\)F\(p\)denote the number of false positives ofpp\. For every primeppin the range we count the triples withS\(a,b,c\)≡0\(modp\)S\(a,b,c\)\\equiv 0\\pmod\{p\}\. This number is the number of false positivesF\(p\)F\(p\)plusZ0Z\_\{0\}, the number of zero triangles, which does not depend onpp\. EachF\(p\)\+Z0F\(p\)\+Z\_\{0\}is computed by a standard trick for small weights\[[AGM97](https://arxiv.org/html/2610.06783#bib.bibx14),[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172)\]: letP\[a,c\]:=xw\(a,c\)modpP\[a,c\]:=x^\{w\(a,c\)\\bmod p\}andQ\[c,b\]:=xw\(b,c\)modpQ\[c,b\]:=x^\{w\(b,c\)\\bmod p\}be matrices over the ringℤ\[x\]/\(xp−1\)\\mathbb\{Z\}\[x\]/\(x^\{p\}\-1\), so that the coefficient ofxrx^\{r\}in\(PQ\)\[a,b\]\(PQ\)\[a,b\]is the number ofc∈Cc\\in Cwithw\(a,c\)\+w\(b,c\)≡r\(modp\)w\(a,c\)\+w\(b,c\)\\equiv r\\pmod\{p\}; thenF\(p\)\+Z0F\(p\)\+Z\_\{0\}is the sum over the pairs\(a,b\)∈A×B\(a,b\)\\in A\\times Bof the coefficient ofx−w\(a,b\)modpx^\{\-w\(a,b\)\\bmod p\}in\(PQ\)\[a,b\]\(PQ\)\[a,b\]\. ComputingPQPQtakesnω\+o\(1\)n^\{\\omega\+o\(1\)\}ring operations, orO\(nlog27\)O\(n^\{\\log\_\{2\}7\}\)with Strassen’s algorithm\[[Str69](https://arxiv.org/html/2610.06783#bib.bibx147)\], each of themO\(p2\)O\(p^\{2\}\)word operations, sonω\+o\(1\)D3/2n^\{\\omega\+o\(1\)\}D^\{3/2\}time over the fewer thanD\\sqrt\{D\}primes in the range\. \(Any matrix multiplication algorithm fast enough to make this term negligible suffices\. For our choice ofDD, Strassen’s algorithm already does, and keeps the reduction potentially practical\.\)999Our reduction uses matrix multiplication, so that it is not “combinatorial\.” One can obtain a combinatorial reduction to\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)instead ofLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)by counting the false positives with the oracle itself \(for instance, by choosing the modulus one prime factor at a time as in\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84), Lemma 3\.2\]\)\. We use matrix multiplication because we want to show that even the detection problemLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)solves Exact Triangle deterministically\.
We select the prime with the smallest count, which is also the prime with the fewest false positives, and call itpp\. To boundF\(p\)F\(p\), note that a triple withS\(a,b,c\)≠0S\(a,b,c\)\\neq 0is a false positive exactly of the primes in the range that divideS\(a,b,c\)S\(a,b,c\)\. Since0<\|S\(a,b,c\)\|≤3nν0<\|S\(a,b,c\)\|\\leq 3n^\{\\nu\}and these primes are at leastD/2\\sqrt\{D\}/2, there are at mostlogD/2\(3nν\)\\log\_\{\\sqrt\{D\}/2\}\(3n^\{\\nu\}\)of them\. Hence the numbers of false positives of all the primes in the range add up to at mostn3logD/2\(3nν\)n^\{3\}\\log\_\{\\sqrt\{D\}/2\}\(3n^\{\\nu\}\)\. By the prime number theorem there areΩ\(D/logD\)\\Omega\(\\sqrt\{D\}/\\log D\)primes in the range, andF\(p\)F\(p\)is at most the average over them, so, as in\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84), Lemma 3\.2\],F\(p\)=O\(n3log\(3nν\)/D\)=O\(νn3logn/D\)F\(p\)=O\(n^\{3\}\\log\(3n^\{\\nu\}\)/\\sqrt\{D\}\)=O\(\\nu\\,n^\{3\}\\log n/\\sqrt\{D\}\), sincelogD=O\(log\(D/2\)\)\\log D=O\(\\log\(\\sqrt\{D\}/2\)\)forD≥16D\\geq 16\.
*The instances\.*As in\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\], lets:=⌊D⌋s:=\\lfloor\\sqrt\{D\}\\rfloorand splitCCinto piecesC1,…,ChC\_\{1\},\\ldots,C\_\{h\}of at most⌈s/g⌉\\lceil s/g\\rceilvertices each, so thath≤⌈ng/s⌉h\\leq\\lceil ng/s\\rceil\. Forϱ∈ℤp\\varrho\\in\\mathbb\{Z\}\_\{p\}letWϱW\_\{\\varrho\}be the set of edges\(a,b\)∈A×B\(a,b\)\\in A\\times Bwithw\(a,b\)≡ϱ\(modp\)w\(a,b\)\\equiv\\varrho\\pmod\{p\}, and cut it into chunks of at mostn2/Dn^\{2\}/\\sqrt\{D\}query pairs\. There are at mostp\+D≤2Dp\+\\sqrt\{D\}\\leq 2\\sqrt\{D\}chunks in all\. For each chunk𝒬⊆Wϱ\\mathcal\{Q\}\\subseteq W\_\{\\varrho\}and each pieceCkC\_\{k\}form the instance ofLop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)with query pairsW:=𝒬W:=\\mathcal\{Q\}and middle partCk×ℤpC\_\{k\}\\times\\mathbb\{Z\}\_\{p\}, of size at mostsp≤Dsp\\leq D, whose middle vertices are pairs \(vertex, label\) as in\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\], with
a∼\(c,σ\)⇔σ≡w\(a,c\)\+ϱ,\(c,σ\)∼b⇔σ≡−w\(b,c\)\(modp\)\.a\\sim\(c,\\sigma\)\\iff\\sigma\\equiv w\(a,c\)\+\\varrho,\\qquad\(c,\\sigma\)\\sim b\\iff\\sigma\\equiv\-w\(b,c\)\\pmod\{p\}\.Within the chunk, the conditionS\(a,b,c\)≡0\(modp\)S\(a,b,c\)\\equiv 0\\pmod\{p\}has become the equalityw\(a,c\)\+ϱ≡−w\(b,c\)w\(a,c\)\+\\varrho\\equiv\-w\(b,c\)of a label of\(a,c\)\(a,c\)and a label of\(b,c\)\(b,c\), so a query pair\(a,b\)∈𝒬\(a,b\)\\in\\mathcal\{Q\}has a common neighbor if and only if somec∈Ckc\\in C\_\{k\}hasS\(a,b,c\)≡0\(modp\)S\(a,b,c\)\\equiv 0\\pmod\{p\}\. There are at most2Dh≤2D\(ng/s\+1\)≤4ng2\\sqrt\{D\}\\,h\\leq 2\\sqrt\{D\}\(ng/s\+1\)\\leq 4nginstances, sinces≥D−1≥3D/4s\\geq\\sqrt\{D\}\-1\\geq 3\\sqrt\{D\}/4becauseD≥16D\\geq 16, andD≤n≤2n/3\\sqrt\{D\}\\leq\\sqrt\{n\}\\leq 2n/3becauseD≤nD\\leq nand we may assumen≥3n\\geq 3, and they are produced non\-adaptively, sinceppis chosen before any of them\. Writing them down costsO\(n2Dg\)O\(n^\{2\}Dg\): the two bipartite graphs of an instance haveO\(nD\)O\(nD\)entries, and the chunks are computed once and shared by the pieces\.
*Witnesses\.*For every query pair that the oracle accepts, scan the pieceCkC\_\{k\}of its instance for accwithS\(a,b,c\)=0S\(a,b,c\)=0, as in the exhaustive search of\[[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\]\. A zero triangle is always found, since itscclies in some piece and makes the oracle accept its pair\. We stop as soon as a zero triangle is found\. A failed scan, of a pieceCkC\_\{k\}for a pair\(a,b\)\(a,b\), contains ac∈Ckc\\in C\_\{k\}withS\(a,b,c\)≡0\(modp\)S\(a,b,c\)\\equiv 0\\pmod\{p\}butS\(a,b,c\)≠0S\(a,b,c\)\\neq 0, that is, a false positive\(a,b,c\)\(a,b,c\)ofpp, and distinct scans contain distinct false positives, so there are at mostF\(p\)F\(p\)failed scans, and the scans costO\(\(F\(p\)\+1\)D/g\)=O\(νn3logn/g\)O\(\(F\(p\)\+1\)\\sqrt\{D\}/g\)=O\(\\nu\\,n^\{3\}\\log n/g\)\. ∎
### 3\.3Exact Triangle in truly subcubic time
###### Theorem 19\(Exact Triangle\)\.
Letε′:=0\.00175\\varepsilon^\{\\prime\}:=0\.00175andεT:=0\.0017\\varepsilon\_\{T\}:=0\.0017\. For every constantν≥1\\nu\\geq 1, Exact Triangle onnnvertices per part with integer weights of absolute value at mostnνn^\{\\nu\}can be solved by a deterministic algorithm inO\(n3−1/648log2n\)O\(n^\{3\-1/648\}\\log^\{2\}n\)time using Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)\(via Corollary[15](https://arxiv.org/html/2610.06783#Thmtheorem15)\), and inO\(n3−ε′logn\)≤O\(n3−εT\)O\(n^\{3\-\\varepsilon^\{\\prime\}\}\\log n\)\\leq O\(n^\{3\-\\varepsilon\_\{T\}\}\)time using Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\(via Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16)\)\.
###### Proof\.
Assumennis larger than a constant depending onν\\nu\(smaller instances are solved by brute force\)\. In both cases we apply Theorem[17](https://arxiv.org/html/2610.06783#Thmtheorem17), whose instances have at mostn2/Dn^\{2\}/\\sqrt\{D\}query pairs each, and solve every instance by a corollary of Section[3\.1](https://arxiv.org/html/2610.06783#S3.SS1)\. The values ofggbelow balance the cost of the instances against that of the scans \(Remark[20](https://arxiv.org/html/2610.06783#Thmtheorem20)\)\.
*By Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)\.*LetDDbe the largest power of four withD≤n1/18D\\leq n^\{1/18\}, so thatD≥n1/18/4D\\geq n^\{1/18\}/4, and letg:=⌈D1/36⌉g:=\\lceil D^\{1/36\}\\rceil\. Solve every instance by Corollary[15](https://arxiv.org/html/2610.06783#Thmtheorem15), which applies becauseD18≤nD^\{18\}\\leq n\. TheO\(nD1/36\)O\(nD^\{1/36\}\)instances costO\(n2log2D/D1/18\)O\(n^\{2\}\\log^\{2\}\\\!D/D^\{1/18\}\)each, soO\(n3D−1/36log2n\)O\(n^\{3\}D^\{\-1/36\}\\log^\{2\}n\)in all, the scans costO\(n3D−1/36logn\)O\(n^\{3\}D^\{\-1/36\}\\log n\), the choice ofppcostsO\(nlog27D3/2\)=O\(n2\.9\)O\(n^\{\\log\_\{2\}7\}D^\{3/2\}\)=O\(n^\{2\.9\}\)with Strassen’s algorithm, and building the instances costsO\(n2D1\.03\)O\(n^\{2\}D^\{1\.03\}\)\. FinallyD−1/36≤41/36n−1/648D^\{\-1/36\}\\leq 4^\{1/36\}n^\{\-1/648\}, so the time isO\(n3−1/648log2n\)O\(n^\{3\-1/648\}\\log^\{2\}n\)\.
*By Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\.*LetD:=⌊n1/18⌋D:=\\lfloor n^\{1/18\}\\rfloorandg:=⌈D0\.0315⌉g:=\\lceil D^\{0\.0315\}\\rceil, and solve every instance by Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16), which applies becauseD18≤nD^\{18\}\\leq n\. The instances costO\(nD0\.0315\)⋅O\(n2/D0\.063\)=O\(n3D−0\.0315\)O\(nD^\{0\.0315\}\)\\cdot O\(n^\{2\}/D^\{0\.063\}\)=O\(n^\{3\}D^\{\-0\.0315\}\), the scansO\(n3D−0\.0315logn\)O\(n^\{3\}D^\{\-0\.0315\}\\log n\), the choice ofppcostsO\(nlog27D3/2\)=O\(n2\.9\)O\(n^\{\\log\_\{2\}7\}D^\{3/2\}\)=O\(n^\{2\.9\}\)with Strassen’s algorithm, and building the instances costsO\(n2D1\.04\)O\(n^\{2\}D^\{1\.04\}\)\. FinallyD≥n1/18/2D\\geq n^\{1/18\}/2givesD−0\.0315≤2n−0\.0315/18=2n−0\.00175D^\{\-0\.0315\}\\leq 2\\,n^\{\-0\.0315/18\}=2\\,n^\{\-0\.00175\}, so the time isO\(n3−ε′logn\)≤O\(n3−εT\)O\(n^\{3\-\\varepsilon^\{\\prime\}\}\\log n\)\\leq O\(n^\{3\-\\varepsilon\_\{T\}\}\)\. ∎
### 3\.43SUM and APSP reduce to Exact Triangle
The reductions here are known and deterministic\. We recall them in the form we use, and then apply Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19), with its boundO\(n3−ε′logn\)O\(n^\{3\-\\varepsilon^\{\\prime\}\}\\log n\),ε′=0\.00175\\varepsilon^\{\\prime\}=0\.00175, when it uses Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\.
###### Theorem 21\(Known reductions\)\.
For every constantν\\nu:
1. \(a\)\(33SUM\)33SUM onnnintegers of absolute value at mostnνn^\{\\nu\}reduces deterministically, inn3/2\+o\(1\)n^\{3/2\+o\(1\)\}time, ton1/2\+o\(1\)n^\{1/2\+o\(1\)\}instances of Exact Triangle onn1/2\+o\(1\)n^\{1/2\+o\(1\)\}vertices per part with weights of absolute valuenO\(1\)n^\{O\(1\)\}\[[CH20](https://arxiv.org/html/2610.06783#bib.bibx51),[VW13](https://arxiv.org/html/2610.06783#bib.bibx158)\]\.
2. \(b\)\(\(min,\+\)\(\\min,\+\)\-product and APSP\)If a deterministic algorithm solves Exact Triangle onssvertices per part with weights of absolute value at mostcUcU, for a suitable constantcc, in timeT\(s\)T\(s\)withT\(s\)/sT\(s\)/snondecreasing, then the\(min,\+\)\(\\min,\+\)\-product of twon×nn\\times ninteger matrices with entries of absolute value at mostUUcan be computed deterministically inO\(n2T\(n1/3\)log2U\)O\(n^\{2\}T\(n^\{1/3\}\)\\log^\{2\}U\)time, and APSP on directednn\-vertex graphs with integer weights of absolute value at mostnνn^\{\\nu\}and no negative cycles inO\(n2T\(n1/3\)log3n\)O\(n^\{2\}T\(n^\{1/3\}\)\\log^\{3\}n\)time\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[VW13](https://arxiv.org/html/2610.06783#bib.bibx158)\]\.
Using the above known reductions we solve both33SUM and APSP polynomially faster:
###### Theorem 22\(33SUM and APSP\)\.
Letν\\nube a constant\. Using Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)\(through Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19)\), deterministic algorithms solve33SUM onnnintegers of absolute value at mostnνn^\{\\nu\}inn2−1/1296\+o\(1\)≤O\(n1\.99923\)n^\{2\-1/1296\+o\(1\)\}\\leq O\(n^\{1\.99923\}\)time, and the\(min,\+\)\(\\min,\+\)\-product of twon×nn\\times ninteger matrices with entries of absolute value at mostnνn^\{\\nu\}, as well as APSP on directednn\-vertex graphs with integer weights of absolute value at mostnνn^\{\\nu\}and no negative cycles, inO~\(n3−1/1944\)≤O\(n2\.99949\)\\tilde\{O\}\(n^\{3\-1/1944\}\)\\leq O\(n^\{2\.99949\}\)time\. Using Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)instead, the times aren2−ε′/2\+o\(1\)≤O\(n1\.9992\)n^\{2\-\\varepsilon^\{\\prime\}/2\+o\(1\)\}\\leq O\(n^\{1\.9992\}\)andO~\(n3−ε′/3\)≤O\(n2\.99942\)\\tilde\{O\}\(n^\{3\-\\varepsilon^\{\\prime\}/3\}\)\\leq O\(n^\{2\.99942\}\)\.
###### Proof\.
Plug Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19)into Theorem[21](https://arxiv.org/html/2610.06783#Thmtheorem21)\. With the boundO\(n3−1/648log2n\)O\(n^\{3\-1/648\}\\log^\{2\}n\)of Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19), the cost for33SUM is
n3/2\+o\(1\)\+n1/2\+o\(1\)⋅O\(\(n1/2\+o\(1\)\)3−1/648log2n\)=n2−1/1296\+o\(1\)=n1\.999228…\+o\(1\),n^\{3/2\+o\(1\)\}\+n^\{1/2\+o\(1\)\}\\cdot O\\big\(\(n^\{1/2\+o\(1\)\}\)^\{3\-1/648\}\\log^\{2\}n\\big\)=n^\{2\-1/1296\+o\(1\)\}=n^\{1\.999228\\ldots\+o\(1\)\},and for the\(min,\+\)\(\\min,\+\)\-product and APSP, withT\(s\)=O\(s3−1/648log2s\)T\(s\)=O\(s^\{3\-1/648\}\\log^\{2\}s\), for whichT\(s\)/sT\(s\)/sis nondecreasing, it is
O~\(n2\(n1/3\)3−1/648\)=O~\(n3−1/1944\),3−1/1944=2\.99948…<2\.99949\.\\tilde\{O\}\\big\(n^\{2\}\(n^\{1/3\}\)^\{3\-1/648\}\\big\)=\\tilde\{O\}\\big\(n^\{3\-1/1944\}\\big\),\\quad 3\-1/1944=2\.99948\\ldots<2\.99949\.With the boundO\(n3−ε′logn\)O\(n^\{3\-\\varepsilon^\{\\prime\}\}\\log n\)instead, the cost for33SUM is
n3/2\+o\(1\)\+n1/2\+o\(1\)⋅O\(\(n1/2\+o\(1\)\)3−ε′logn\)=n2−ε′/2\+o\(1\)=n1\.999125\+o\(1\),n^\{3/2\+o\(1\)\}\+n^\{1/2\+o\(1\)\}\\cdot O\\big\(\(n^\{1/2\+o\(1\)\}\)^\{3\-\\varepsilon^\{\\prime\}\}\\log n\\big\)=n^\{2\-\\varepsilon^\{\\prime\}/2\+o\(1\)\}=n^\{1\.999125\+o\(1\)\},and for the\(min,\+\)\(\\min,\+\)\-product and APSP, withT\(s\)=O\(s3−ε′logs\)T\(s\)=O\(s^\{3\-\\varepsilon^\{\\prime\}\}\\log s\), it is
O~\(n2\(n1/3\)3−ε′\)=O~\(n3−ε′/3\),3−ε′/3=2\.99941…<2\.99942\.\\tilde\{O\}\\big\(n^\{2\}\(n^\{1/3\}\)^\{3\-\\varepsilon^\{\\prime\}\}\\big\)=\\tilde\{O\}\\big\(n^\{3\-\\varepsilon^\{\\prime\}/3\}\\big\),\\qquad 3\-\\varepsilon^\{\\prime\}/3=2\.99941\\ldots<2\.99942\.∎
## 4The matrix theorem in general: a data structure
In this section, we extend our algorithm from Section[2](https://arxiv.org/html/2610.06783#S2)in two directions\. First, we turn it into a data structure\. After preprocessingXXandYYin less time than it takes to write downXYXY, the data structure answers a query for any single entry ofXYXY, not known in advance, in time polynomially smaller than theDDoperations that it would take to compute that entry as an inner product\. Second, we let the parameters of our construction vary\. This will give larger time savings thanD1/18D^\{1/18\}, and trade\-offs between the time savings, how thin the product must be, the query time, and the density of the setWWof wanted entries\. We assume that the reader is familiar with Section[2](https://arxiv.org/html/2610.06783#S2), whose notation we use throughout, although we will begin with a brief reminder of the relevant notions\.
In Section[4\.1](https://arxiv.org/html/2610.06783#S4.SS1), we state the main results, Theorems[24](https://arxiv.org/html/2610.06783#Thmtheorem24)and[25](https://arxiv.org/html/2610.06783#Thmtheorem25), with explicit parameter examples in Table[2](https://arxiv.org/html/2610.06783#S4.T2), as well as Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26), the instance of Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)that our reductions in Sections[3](https://arxiv.org/html/2610.06783#S3)and[5](https://arxiv.org/html/2610.06783#S5)use\. In Section[4\.2](https://arxiv.org/html/2610.06783#S4.SS2), we will introduce the key new idea, the partial sums that our data structure stores, which we call boxes\. In Section[4\.3](https://arxiv.org/html/2610.06783#S4.SS3), we will then give the data structure in terms of the parameters \(listed in Table[1](https://arxiv.org/html/2610.06783#S4.T1)\), and finally we will set the parameters in Section[4\.4](https://arxiv.org/html/2610.06783#S4.SS4)\.
symbolmeaningin Section[2](https://arxiv.org/html/2610.06783#S2)in this sectionmm,D=4mD=4^\{m\}the number of inner levels, and the inner dimension of the productXYXYLL,c=L/mc=L/mthe number of levels of the recursion, and its ratio tommL=19mL=19mL=cmL=cm,c\>10c\>10N0=3L−mN\_\{0\}=3^\{L\-m\}the number of rows of a row block, and of columns of a column blockK=\(Lm\)K=\\binom\{L\}\{m\}the number of productsXQYQX\_\{Q\}Y\_\{Q\}of a tile, one for each setQQofmmlevelsM=KN02M=KN\_\{0\}^\{2\}the number of output entries of a tileαd=\(md\)9d\\alpha\_\{d\}=\\binom\{m\}\{d\}9^\{d\}the number of leaves of orderddcontributing to one output entryβd=\(Lm−d\)9L−m\+d\\beta\_\{d\}=\\binom\{L\}\{m\-d\}9^\{L\-m\+d\}the number of leaves of orderddin a tileβd≤2−dM\\beta\_\{d\}\\leq 2^\{\-d\}Mβd≤ρdM\\beta\_\{d\}\\leq\\rho^\{d\}Mρ=9m/\(L−m\+1\)\\rho=9m/\(L\-m\+1\)the decay rate of theβd\\beta\_\{d\}:βd/βd−1≤ρ\\beta\_\{d\}/\\beta\_\{d\-1\}\\leq\\rho, see \([7](https://arxiv.org/html/2610.06783#S4.E7)\)ρ<12\\rho<\\frac\{1\}\{2\}ρ<1\\rho<1ttthe switching order: a query reads the leaves of order belowtt, and the preprocessing puts the others into boxes; in Section[2](https://arxiv.org/html/2610.06783#S2), the order at which the count of Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11)splitst=m/9t=m/9t=θmt=\\theta m,0<θ<0\.90<\\theta<0\.9γ\\gammathe preprocessing, or the whole computation whenWWis given in advance, takesO\(N2log2D/Dγ\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\)timeγ=1/18\\gamma=1/18see Table[2](https://arxiv.org/html/2610.06783#S4.T2)ε\\varepsilonthe results hold forD≤NεD\\leq N^\{\\varepsilon\}ε=1/18\\varepsilon=1/18ε<Rc\(γ\)<0\.1204…\\varepsilon<R\_\{c\}\(\\gamma\)<0\.1204\\ldotsqqa query takesO\(DqlogD\)O\(D^\{q\}\\log D\)timeno queriessee Table[2](https://arxiv.org/html/2610.06783#S4.T2)κ\\kappathe setWWof wanted entries has\|W\|≤N2/Dκ\|W\|\\leq N^\{2\}/D^\{\\kappa\}κ=12\\kappa=\\frac\{1\}\{2\}see Table[2](https://arxiv.org/html/2610.06783#S4.T2)Table 1:The parameters of our construction\. The last two columns give their values or bounds in Section[2](https://arxiv.org/html/2610.06783#S2)and in this section\. Where these columns are empty, the parameter is given by the formula in the first column in both sections\. In this section,LLandttarecmcmandθm\\theta mrounded up to integers, and the boundRc\(γ\)R\_\{c\}\(\\gamma\)is defined in Section[4\.4](https://arxiv.org/html/2610.06783#S4.SS4)\.##### Notions from Section[2](https://arxiv.org/html/2610.06783#S2)\.
We keep the recursion, the tiling, and the encodings of Sections[2\.3](https://arxiv.org/html/2610.06783#S2.SS3)and[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1), and we use the terminology of Sections[2\.3\.2](https://arxiv.org/html/2610.06783#S2.SS3.SSS2)and[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)as defined there: the leaves contributing to an output string, its private leaf, the order of a leaf, and the countsαd\\alpha\_\{d\}andβd\\beta\_\{d\}\. For convenience, we briefly recall these notions here\.
- •A*leaf*τ=τ1⋯τL\\tau=\\tau\_\{1\}\\cdots\\tau\_\{L\}is a string ofLLterms of Schönhage’s identity, whereτℓ\\tau\_\{\\ell\}is the term chosen at*level*ℓ\\ellof the recursion \(Section[2\.3\.1](https://arxiv.org/html/2610.06783#S2.SS3.SSS1)\)\. Throughout this section, we compare levels by their indices: we say that levelℓ\\ellis*lower*than levelℓ′\\ell^\{\\prime\}ifℓ<ℓ′\\ell<\\ell^\{\\prime\}, so that the lowest level is the first level of the recursion\.
- •An*output string*wwwith*inner set*QQhas the variablez0z\_\{0\}at each of themmlevels ofQQ, and one of the variableszijz\_\{ij\}at every other level\. It indexes the entry\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]of the productXQYQX\_\{Q\}Y\_\{Q\}\(Section[2\.3\.3](https://arxiv.org/html/2610.06783#S2.SS3.SSS3)\)\.
- •A leaf*contributes to*wwif it choosesPijP\_\{ij\}at every level wherewwhaszijz\_\{ij\}, while it may choose any of the ten terms at the levels ofQQ, wherewwhasz0z\_\{0\}\(Section[2\.3\.2](https://arxiv.org/html/2610.06783#S2.SS3.SSS2)\)\.
- •The*private leaf*ofwwis the leaf contributing towwthat choosesP0P\_\{0\}at every level ofQQ\(Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)\)\.
- •The*order*of a leaf ismmminus the number of levels at which it choosesP0P\_\{0\}\. For a leaf contributing toww, this is the number of levels ofQQat which it chooses a term other thanP0P\_\{0\}\(Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3)\)\.
- •A*tile*consists of a*band*ofK0=⌊K⌋K\_\{0\}=\\lfloor\\sqrt\{K\}\\rfloorrow blocks ofXXtogether with a band ofK0K\_\{0\}column blocks ofYY\(Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)\), and the*encoding*of a band is the array of the10L10^\{L\}numbersΦτ\(a\)\\Phi\_\{\\tau\}\(a\), orΨτ\(b\)\\Psi\_\{\\tau\}\(b\), computed from its input array \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\)\. We will recall both in more detail in Section[4\.3](https://arxiv.org/html/2610.06783#S4.SS3)\.
As in Section[2\.4\.3](https://arxiv.org/html/2610.06783#S2.SS4.SSS3), all output strings in this section have inner sets of exactlymmelements, so that they index theM=KN02M=KN\_\{0\}^\{2\}entries of theKKproductsXQYQX\_\{Q\}Y\_\{Q\}of a tile, and we will use thatM=β0≤10LM=\\beta\_\{0\}\\leq 10^\{L\}\. For a leafτ\\tauof a tile with input arraysaaandbb, we callΦτ\(a\)Ψτ\(b\)\\Phi\_\{\\tau\}\(a\)\\Psi\_\{\\tau\}\(b\)the*product at*τ\\tau\. We read its two factors from the encodings of the tile \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\), and by \([2](https://arxiv.org/html/2610.06783#S2.E2)\) and Lemma[9](https://arxiv.org/html/2610.06783#Thmtheorem9),\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]is the sum of the products at the leaves contributing toww\. The one change from Section[2](https://arxiv.org/html/2610.06783#S2)is thatLLis now any integer withL≥10mL\\geq 10m, and we callc=L/mc=L/mthe*ratio*\.
##### Technique overview\.
The pruned recursion of Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)needs to knowWWin advance, since it visits exactly the leaves that the wanted entries need\. When the queries arrive one at a time, we must instead prepare for every possible output entry\.
Recall that our preprocessing must take less time than it takes to write downXYXY\. This means it stores fewer than one number per entry ofXYXY, so each number that it stores must be useful for many different entries\. Meanwhile, a query must take far fewer than theDDoperations that it would take to compute the entry directly as an inner product\. In Section[2](https://arxiv.org/html/2610.06783#S2), the running time had three parts: the leaves of small order, the leaves of large order, and the encodings \(Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11)and Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)\)\. Our data structure will divide these parts between the queries and the preprocessing\. Each output entry uses only a few of the leaves of small order, so a query may just read them one by one\. By contrast, each output entry may use many leaves of large order, but there are not too many such leaves in total, and each of them is shared by many output entries\. Thus, in preprocessing we will add them up in advance, in groups which can be quickly summed during queries\. The preprocessing also computes the encodings, once\.
The10m10^\{m\}leaves contributing to an output string form a cube: at each level of the inner setQQof the output string, they choose any of the ten terms, and at each other level, they agree with the private leaf of the output string\. Every one of these leaves, other than the private leaf, also contributes to other output entries\. We will therefore add up parts of every cube in advance, into what we call boxes \(which are themselves smaller cubes\), so that a query adds up a few box values instead of10m10^\{m\}products\. For this we need a rule that cuts every cube into few boxes, with each of its leaves of large order in exactly one of them; we will prove this for our rule in Lemma[27](https://arxiv.org/html/2610.06783#Thmtheorem27)\. We will make sure that the definition of a box does not refer to the output entry, so that the same box serves many output entries, which keeps the total number of boxes small, as we will show in Lemma[29](https://arxiv.org/html/2610.06783#Thmtheorem29)\.
We also need to compute all the boxes of a tile quickly in preprocessing, and here we will use dynamic programming\. Since a box is a cube, it has a fixed term at some levels, and its other levels are free, meaning all ten terms are allowed there\. Fixing each of the ten terms in turn at the highest free level splits the box into ten smaller boxes, and its value is the sum of their values\. Thus, in Lemma[29](https://arxiv.org/html/2610.06783#Thmtheorem29), we will compute the boxes from the smallest up, each from the values of smaller boxes computed before\.
The orderttat which a query switches from leaves to boxes, which we call the*switching order*, trades off the query time \(aboutαt\\alpha\_\{t\}\) against the preprocessing time \(aboutρt\\rho^\{t\}boxes per entry of the product, whereρ<1\\rho<1is the rate at which theβd\\beta\_\{d\}decay\)\. The ratioc=L/mc=L/m\(which we fixed to be1919in Section[2](https://arxiv.org/html/2610.06783#S2), but we now allow to vary\) trades off the time savings against how thin the product must be\. While a largerccmakesρ\\rhosmaller, it also makes the encodings larger relative toDD, so that computing them stays within the time bound only whenNNis a larger power ofDD\. Withc=21c=21andt=m/9t=m/9, we will get the instanceN≥D18N\\geq D^\{18\}of Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26), and pushingccdown toward1010will give the upper limit forDDof our technique, namelyD≤N0\.1204D\\leq N^\{0\.1204\}\(Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31)\)\.
### 4\.1The results
In this section, we design a data structure with the following guarantee\. Letε∗:=ln4/\(5ln10\)=0\.1204…\\varepsilon^\{\*\}:=\\ln 4/\(5\\ln 10\)=0\.1204\\ldots\.
###### Theorem 24\.
For everyε<ε∗\\varepsilon<\\varepsilon^\{\*\}, and everyq\>0q\>0, there is aγ\>0\\gamma\>0such that the following holds\. Given as input matricesX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}, where2≤D≤Nε2\\leq D\\leq N^\{\\varepsilon\}, whose entries are integers of absolute value at mostNO\(1\)N^\{O\(1\)\}, we can preprocess them deterministically inO\(N2log2D/Dγ\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\)time and space, after which any single entry\(XY\)\[I,J\]\(XY\)\[I,J\]can be computed deterministically inO\(DqlogD\)O\(D^\{q\}\\log D\)time\.
The constantε∗\\varepsilon^\{\*\}gives the upper limit forDDof our technique, and we will explain where it comes from in Section[4\.4](https://arxiv.org/html/2610.06783#S4.SS4)below \(after the proof of Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31)\)\. To achieve the general form of the matrix theorem, where we know the positions in advance as in Section[2](https://arxiv.org/html/2610.06783#S2), we simply ask the data structure one query per position\. Setting the parameters to balance the preprocessing time and the total time for all the queries gives the following\.
###### Theorem 25\.
For everyε<ε∗\\varepsilon<\\varepsilon^\{\*\}and everyκ\>0\\kappa\>0there is aγ\>0\\gamma\>0such that the following holds\. Given as input matricesX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}, where2≤D≤Nε2\\leq D\\leq N^\{\\varepsilon\}, whose entries are integers of absolute value at mostNO\(1\)N^\{O\(1\)\}, as well as a setWWof at mostN2/DκN^\{2\}/D^\{\\kappa\}positions of anN×NN\\times Nmatrix, the entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, can be computed deterministically in timeO\(N2log2D/Dγ\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\)\.
The logarithmic factors in both theorems can be removed by halvingγ\\gammaand applying Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)withq/2q/2in place ofqq; forD=1D=1the bounds are trivial\.
Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24): the data structureTheorem[25](https://arxiv.org/html/2610.06783#Thmtheorem25): the wanted entriesratioD≤NεD\\leq N^\{\\varepsilon\}γ\\gammafor query timeDqD^\{q\},q=q=γ\\gammafor\|W\|≤N2/Dκ\|W\|\\leq N^\{2\}/D^\{\\kappa\},κ=\\kappa=ccε\\varepsilon0\.100\.100\.250\.250\.430\.430\.500\.500\.750\.750\.900\.900\.100\.100\.250\.250\.500\.500\.750\.751\.001\.0040400\.0290\.0290\.02050\.02050\.06080\.06080\.11750\.11750\.14290\.14290\.24170\.24170\.30950\.30950\.01660\.01660\.04730\.04730\.10600\.10600\.17200\.17200\.24420\.244221210\.0560\.0560\.01120\.01120\.03310\.03310\.0640\\mathbf\{0\.0640\}0\.07780\.07780\.13160\.13160\.16850\.16850\.00990\.00990\.02860\.02860\.06530\.06530\.10740\.10740\.15460\.154619190\.0620\.0620\.00970\.00970\.02870\.02870\.0555\\mathbf\{0\.0555\}0\.06750\.06750\.11420\.11420\.14630\.14630\.00870\.00870\.02530\.02530\.05780\.05780\.09540\.09540\.13790\.137915150\.0790\.0790\.00610\.00610\.01830\.01830\.03540\.03540\.04300\.04300\.07280\.07280\.09320\.09320\.00570\.00570\.01680\.01680\.03890\.03890\.06460\.06460\.09410\.094112120\.0990\.0990\.00280\.00280\.00830\.00830\.01600\.01600\.01950\.01950\.03300\.03300\.04230\.04230\.00270\.00270\.00800\.00800\.01860\.01860\.03120\.03120\.04590\.045910\.510\.50\.1140\.1140\.00070\.00070\.00220\.00220\.00430\.00430\.00520\.00520\.00890\.00890\.01140\.01140\.00070\.00070\.00220\.00220\.00520\.00520\.00870\.00870\.01290\.0129Table 2:Explicit parameters for Theorems[24](https://arxiv.org/html/2610.06783#Thmtheorem24)and[25](https://arxiv.org/html/2610.06783#Thmtheorem25)\. Each row is a choice of the ratioc=L/mc=L/m\. The parameterε\\varepsilonis determined byccand says how thin the product must be, i\.e\., every entry of the row holds wheneverD≤NεD\\leq N^\{\\varepsilon\}\. On the left, the columns correspond to a choice ofqq, and the numerical entry is a valueγ\\gammafor which Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)holds, meaning that afterO\(N2log2D/Dγ\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\)preprocessing, a query takesO\(DqlogD\)O\(D^\{q\}\\log D\)time\. On the right, the columns correspond to a choice ofκ\\kappa, and the numerical entry is a valueγ\\gammafor which Theorem[25](https://arxiv.org/html/2610.06783#Thmtheorem25)holds, meaning that any\|W\|≤N2/Dκ\|W\|\\leq N^\{2\}/D^\{\\kappa\}wanted entries takeO\(N2log2D/Dγ\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\)time\. On the left side, the columnq=0\.43q=0\.43uses the switching ordert=m/9t=m/9of Section[2](https://arxiv.org/html/2610.06783#S2)\(more precisely,q=0\.4277…q=0\.4277\\ldots\), and its two bold entries are Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)\(c=19c=19, whereγ=1/18=0\.0555…\\gamma=1/18=0\.0555\\ldots\) and Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\(c=21c=21\)\. A largerccgives a largerγ\\gammabut a smallerε\\varepsilon, and a slower query or a sparserWWallows a largerγ\\gamma\. We round all values down, and we will explain how we compute them in Section[4\.4](https://arxiv.org/html/2610.06783#S4.SS4)\.In Table[2](https://arxiv.org/html/2610.06783#S4.T2), we list several parameter settings for Theorems[24](https://arxiv.org/html/2610.06783#Thmtheorem24)and[25](https://arxiv.org/html/2610.06783#Thmtheorem25)\. Theorem[5](https://arxiv.org/html/2610.06783#Thmtheorem5)is the entryc=19c=19,q=0\.43q=0\.43, applied to a setWWofN2/DN^\{2\}/\\sqrt\{D\}wanted entries \(that is,κ=12\\kappa=\\frac\{1\}\{2\}\)\. We next state explicitly the parameter setting that we use in the introduction and in our reductions in Sections[3](https://arxiv.org/html/2610.06783#S3)and[5](https://arxiv.org/html/2610.06783#S5)\. It is the entryc=21c=21,q=0\.43q=0\.43of Table[2](https://arxiv.org/html/2610.06783#S4.T2), whose switching order ist=m/9t=m/9, as in Section[2](https://arxiv.org/html/2610.06783#S2), with the logarithmic factors absorbed into the exponents\.
###### Corollary 26\.
LetN≥D18N\\geq D^\{18\}, and letX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}have entries of absolute value at mostNO\(1\)N^\{O\(1\)\}\. We can preprocess them deterministically inO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)time and space, after which any single entry\(XY\)\[I,J\]\(XY\)\[I,J\]can be computed deterministically inO\(D0\.437\)O\(D^\{0\.437\}\)time\. Hence, for every setWWof positions of anN×NN\\times Nmatrix, the entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, can be computed deterministically inO\(\|W\|D0\.437\+N2/D0\.063\)O\(\|W\|\\,D^\{0\.437\}\+N^\{2\}/D^\{0\.063\}\)time, which isO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)whenever\|W\|≤N2/D\|W\|\\leq N^\{2\}/\\sqrt\{D\}\.
### 4\.2Boxes
In this subsection, we define the boxes and prove two important facts about them\. Intuitively, a box is a group of leaves that is shared by many output strings\. In preprocessing we will add up the products at the leaves of each box, and then that value can help to answer many queries\. In terms of the switching ordertt, we will ensure that the boxes of an output string partition its leaves of order at leasttt, and that there are onlyαt\\alpha\_\{t\}of them\. We will thus see, in Lemmas[27](https://arxiv.org/html/2610.06783#Thmtheorem27)and[28](https://arxiv.org/html/2610.06783#Thmtheorem28), that every output entry is the sum of a few products and a few values of boxes\.
##### Cubes\.
A*cube*is a stringπ=π1⋯πL\\pi=\\pi\_\{1\}\\cdots\\pi\_\{L\}ofLLsymbols, each of which is one of the ten terms of Schönhage’s identity or a star∗\\ast\. Its*leaves*are the leaves obtained by replacing each star by any of the ten terms, so a cube witheestars has10e10^\{e\}leaves, and a cube without stars is a single leaf\. The*value*of a cubeπ\\piis the sum of the products at its leaves,
val\(π\):=∑τa leaf ofπΦτ\(a\)Ψτ\(b\)\.\\mathrm\{val\}\(\\pi\):=\\sum\_\{\\tau\\text\{ a leaf of \}\\pi\}\\Phi\_\{\\tau\}\(a\)\\,\\Psi\_\{\\tau\}\(b\)\.Every output entry is the value of a cube\. Indeed, recall that the entry\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]of an output stringwwwith inner setQQis the sum of the products at the10m10^\{m\}leaves contributing toww\. These are the leaves of the*cube ofww*, the cubeπw\\pi^\{w\}that has a star at each level wherewwhasz0z\_\{0\}\(the levels ofQQ\) and the termPijP\_\{ij\}at each level wherewwhaszijz\_\{ij\}, so that\(XQYQ\)\[w\]=val\(πw\)\(X\_\{Q\}Y\_\{Q\}\)\[w\]=\\mathrm\{val\}\(\\pi^\{w\}\)\. In Figure[6](https://arxiv.org/html/2610.06783#S2.F6), this cube is all the rows taken together\. Figure[9](https://arxiv.org/html/2610.06783#S4.F9)shows the cube of an output string, and the boxes defined next, in the recursion tree of a small example\.
We will cut the cube of every output string into parts that are again cubes, in a way where each leaf of the cube lies in exactly one part, so that
\(XQYQ\)\[w\]=val\(πw\)=∑partsπofπwval\(π\),\(X\_\{Q\}Y\_\{Q\}\)\[w\]=\\mathrm\{val\}\(\\pi^\{w\}\)=\\sum\_\{\\text\{parts \}\\pi\\text\{ of \}\\pi^\{w\}\}\\mathrm\{val\}\(\\pi\),and the value of a part will be shared by all the output strings that have it as a part\. In Lemma[28](https://arxiv.org/html/2610.06783#Thmtheorem28)below, we will prove this equation for the parts that we will choose\. There will be two kinds of parts\. Each leaf of small order will be a part on its own \(recall that a single leaf is a cube without stars\), whereas the leaves of large order will be grouped together into larger parts, which we call boxes\.
rootP0P\_\{0\}P21P\_\{21\}P11P\_\{11\}P21P\_\{21\}P12P\_\{12\}P21P\_\{21\}P13P\_\{13\}P21P\_\{21\}P21P\_\{21\}P21P\_\{21\}P22P\_\{22\}P21P\_\{21\}P23P\_\{23\}P21P\_\{21\}P31P\_\{31\}P21P\_\{21\}P32P\_\{32\}P21P\_\{21\}P33P\_\{33\}P21P\_\{21\}one subtreethe cubeπw=∗P21∗\\pi^\{w\}=\\ast\\,P\_\{21\}\\,\\astorder:001122level1∈Q1\\in Qlevel2∉Q2\\notin QP0P\_\{0\}P11P\_\{11\}P12P\_\{12\}P13P\_\{13\}P21P\_\{21\}P22P\_\{22\}P23P\_\{23\}P31P\_\{31\}P32P\_\{32\}P33P\_\{33\}level3∈Q3\\in Qprivate leafP21P\_\{21\}is the termofwwat level2299boxesPijP21P0P\_\{ij\}\\,P\_\{21\}\\,P\_\{0\}99boxes∗P21Pij\\ast\\,P\_\{21\}\\,P\_\{ij\}Figure 9:The cube and the boxes of the output stringw=z0z21z0w=z\_\{0\}z\_\{21\}z\_\{0\}in the recursion tree, forL=3L=3and switching ordert=1t=1\. Sincewwhasz0z\_\{0\}at levels11and33, its inner set isQ=\{1,3\}Q=\\\{1,3\\\}\(som=2m=2\)\. A query forwwreads the private leaf, which has order0<t0<t, and the values of theα1=18\\alpha\_\{1\}=18boxes ofww, which contain the other9999leaves \(of orders11and22\)\. A box with a star is not a subtree: it consists of the same leaf of every subtree\.
##### The definition of a box\.
The order of a leaf tells us how widely it is shared between output entries\. Recall that the order ismmminus the number of levels at which the leaf choosesP0P\_\{0\}, so thatαd=\(md\)9d\\alpha\_\{d\}=\\binom\{m\}\{d\}9^\{d\}leaves of orderddcontribute to an output string, and that a leaf of larger order contributes to more output strings\. Throughout, we fix the switching ordertt, an integer with0≤t≤m0\\leq t\\leq m\. The boxes will collect the leaves of order at leasttt, i\.e\., the leaves that chooseP0P\_\{0\}at mostm−tm\-ttimes, and a query will read the leaves of order belowttone by one \(Section[4\.3](https://arxiv.org/html/2610.06783#S4.SS3)\)\.
Before giving the formal definition, we describe the idea informally and give some examples\. Consider an output stringwwwith inner setQQ, and a leafτ\\tauof order at leastttcontributing toww\. To find the box ofτ\\tau, we look at the levels ofQQone at a time, from the highest down, and we stop as soon as we have seenttlevels at whichτ\\tauchooses a term other thanP0P\_\{0\}\. The box ofτ\\tauthen agrees withτ\\taueverywhere, except that it has a star at every level ofQQbelow the level where we stopped\. For instance, letm=4m=4andt=2t=2as in Figure[10](https://arxiv.org/html/2610.06783#S4.F10), and suppose thatτ\\tauchooses the termsP12,P0,P31,P22P\_\{12\},P\_\{0\},P\_\{31\},P\_\{22\}at the four levelsℓ1<ℓ2<ℓ3<ℓ4\\ell\_\{1\}<\\ell\_\{2\}<\\ell\_\{3\}<\\ell\_\{4\}ofQQ\. We seeP22P\_\{22\}at levelℓ4\\ell\_\{4\}andP31P\_\{31\}at levelℓ3\\ell\_\{3\}, and we stop there, so the box ofτ\\tauis∗∗P31P22\\ast\\;\\ast\\;P\_\{31\}\\;P\_\{22\}\(in the first row of the figure\)\. This box containsτ\\taualong with the9999other leaves that differ fromτ\\tauonly at the levelsℓ1\\ell\_\{1\}andℓ2\\ell\_\{2\}\. Similarly, for a leaf that chooses the termsP0,P23,P0,P11P\_\{0\},P\_\{23\},P\_\{0\},P\_\{11\}, we stop at levelℓ2\\ell\_\{2\}, so its box is∗P23P0P11\\ast\\;P\_\{23\}\\;P\_\{0\}\\;P\_\{11\}\(in the second row of the figure\)\. Since a box has stars at the levels that we did not reach, it contains many leaves\. Moreover, although we described the box ofτ\\tauin terms ofww, the definition of a box below does not refer to an output string, and the same box serves many output strings\.
VVℓ1\\ell\_\{1\}ℓ2\\ell\_\{2\}ℓ3\\ell\_\{3\}ℓ4\\ell\_\{4\}setsZZof its leavesleaves per box\{ℓ1,ℓ2\}\\\{\\ell\_\{1\},\\ell\_\{2\}\\\}∗\\ast∗\\astPijP\_\{ij\}PijP\_\{ij\}∅,\{ℓ1\},\{ℓ2\},\{ℓ1,ℓ2\}\\emptyset,\\ \\\{\\ell\_\{1\}\\\},\\ \\\{\\ell\_\{2\}\\\},\\ \\\{\\ell\_\{1\},\\ell\_\{2\}\\\}10210^\{2\}\{ℓ1,ℓ3\}\\\{\\ell\_\{1\},\\ell\_\{3\}\\\}∗\\astPijP\_\{ij\}P0P\_\{0\}PijP\_\{ij\}\{ℓ3\},\{ℓ1,ℓ3\}\\\{\\ell\_\{3\}\\\},\\ \\\{\\ell\_\{1\},\\ell\_\{3\}\\\}1010\{ℓ1,ℓ4\}\\\{\\ell\_\{1\},\\ell\_\{4\}\\\}∗\\astPijP\_\{ij\}PijP\_\{ij\}P0P\_\{0\}\{ℓ4\},\{ℓ1,ℓ4\}\\\{\\ell\_\{4\}\\\},\\ \\\{\\ell\_\{1\},\\ell\_\{4\}\\\}1010\{ℓ2,ℓ3\}\\\{\\ell\_\{2\},\\ell\_\{3\}\\\}PijP\_\{ij\}P0P\_\{0\}P0P\_\{0\}PijP\_\{ij\}\{ℓ2,ℓ3\}\\\{\\ell\_\{2\},\\ell\_\{3\}\\\}11\{ℓ2,ℓ4\}\\\{\\ell\_\{2\},\\ell\_\{4\}\\\}PijP\_\{ij\}P0P\_\{0\}PijP\_\{ij\}P0P\_\{0\}\{ℓ2,ℓ4\}\\\{\\ell\_\{2\},\\ell\_\{4\}\\\}11\{ℓ3,ℓ4\}\\\{\\ell\_\{3\},\\ell\_\{4\}\\\}PijP\_\{ij\}PijP\_\{ij\}P0P\_\{0\}P0P\_\{0\}\{ℓ3,ℓ4\}\\\{\\ell\_\{3\},\\ell\_\{4\}\\\}11Figure 10:The boxes of an output stringwwform=4m=4andt=2t=2, drawn at the four levelsℓ1<ℓ2<ℓ3<ℓ4\\ell\_\{1\}<\\ell\_\{2\}<\\ell\_\{3\}<\\ell\_\{4\}of its inner setQQ\(at every other level, they have the term of the private leaf ofww\)\. HerePijP\_\{ij\}stands for one of the nine terms other thanP0P\_\{0\}, and∗\\astfor all ten terms\. Each row is one of the six setsVVofm−t=2m\-t=2levels and stands for the9t=819^\{t\}=81boxes ofℬV\\mathcal\{B\}\_\{V\}, one for each choice of the two termsPijP\_\{ij\}\. Read from right to left, a row stops at its secondPijP\_\{ij\}, and the levels to the left of it, those ofFVF\_\{V\}, carry stars\. On the right are the setsZZof levels at which the leaves of such a box chooseP0P\_\{0\}, and the number10\|FV\|10^\{\|F\_\{V\}\|\}of its leaves\. Every setZZof at most two levels appears in exactly one row \(Lemma[27](https://arxiv.org/html/2610.06783#Thmtheorem27)\), so these6⋅81=486=α26\\cdot 81=486=\\alpha\_\{2\}boxes contain each of theα2\+α3\+α4=9963\\alpha\_\{2\}\+\\alpha\_\{3\}\+\\alpha\_\{4\}=9963leaves of order at least22contributing towwexactly once\.A*box*is a cubeπ=π1⋯πL\\pi=\\pi\_\{1\}\\cdots\\pi\_\{L\}such that \(i\) at mostm−tm\-tof its symbols areP0P\_\{0\}or stars, and \(ii\) every star is at a lower level than everyP0P\_\{0\}\. That is, the symbolsP0P\_\{0\}and stars of a box, read in increasing order of the levels, are
∗∗⋯∗⏟eP0P0⋯P0⏟f−efor some0≤e≤f≤m−t,\\underbrace\{\\ast\\;\\ast\\;\\cdots\\;\\ast\}\_\{e\}\\;\\;\\underbrace\{P\_\{0\}\\;P\_\{0\}\\;\\cdots\\;P\_\{0\}\}\_\{f\-e\}\\qquad\\text\{for some \}0\\leq e\\leq f\\leq m\-t,and its otherL−fL\-fsymbols are among the nine termsPijP\_\{ij\}\. A leaf ofπ\\pichoosesP0P\_\{0\}at thef−ef\-elevels whereπ\\pihasP0P\_\{0\}and possibly at some of itseestar levels, and hence at mostf≤m−tf\\leq m\-ttimes by \(i\), so a box only contains leaves of order at leasttt\. By \(ii\), a box is obtained from a leaf of order at leastttby replacing itseelowest symbolsP0P\_\{0\}\(rather than an arbitrary subset of them\) by stars\. Therefore, each leaf yields at mostm\+1m\+1boxes, one for each value ofee, which keeps their total number small, as we will show in Lemma[29](https://arxiv.org/html/2610.06783#Thmtheorem29)\. Boxes of this shape suffice: we will prove in Lemmas[27](https://arxiv.org/html/2610.06783#Thmtheorem27)and[28](https://arxiv.org/html/2610.06783#Thmtheorem28)that the leaves of order at leastttof an output string can be split amongαt\\alpha\_\{t\}of them\. \(We will see below that the boxes of an output string all have exactlym−tm\-tsymbols that areP0P\_\{0\}or stars\. We nonetheless allow fewer in the definition of a box, since boxes with fewer such symbols will arise as intermediate values in the dynamic program of Lemma[29](https://arxiv.org/html/2610.06783#Thmtheorem29)\.\)
It is important here that a star stands for all ten terms,P0P\_\{0\}included, so that one box collects leaves of several orders \(fromm−fm\-ftom−f\+em\-f\+e, for a box witheestars andf−ef\-esymbolsP0P\_\{0\}\)\. This is needed for fast queries\. If a star stood only for the nine termsPijP\_\{ij\}, then every box would fix the set of levels at which its leaves chooseP0P\_\{0\}, so an output string would need a separate box for each subset ofQQof size at mostm−tm\-t\. That would be about2m=D2^\{m\}=\\sqrt\{D\}boxes whenttis small, so a query would take aboutD\\sqrt\{D\}time, which gives no saving belowN2N^\{2\}when there areN2/DN^\{2\}/\\sqrt\{D\}queries\.
##### The boxes of an output string\.
We now make precise the informal rule above for finding the box of a leaf, and describe all the boxes of an output stringwwwith inner setQQ\. Letτ\\taube a leaf of order at leastttcontributing toww, whose box we found above by going through the levels ofQQfrom the highest down \(Figure[10](https://arxiv.org/html/2610.06783#S4.F10)\)\. In symbols, let
Z\\displaystyle Z:=\{ℓ∈Q:τℓ=P0\}\\displaystyle:=\\\{\\ell\\in Q:\\ \\tau\_\{\\ell\}=P\_\{0\}\\\}\(the levels at whichτ\\tauchoosesP0P\_\{0\}\),V\\displaystyle V:=Z∪\{them−t−\|Z\|lowest levels ofQ∖Z\}\\displaystyle:=Z\\cup\\\{\\text\{the $m\-t\-\|Z\|$ lowest levels of \}Q\\setminus Z\\\}\(ZZpadded from the bottom\),FV\\displaystyle F\_\{V\}:=\{ℓ∈Q:ℓ<min\(Q∖V\)\}\\displaystyle:=\\\{\\ell\\in Q:\\ \\ell<\\min\(Q\\setminus V\)\\\}\(the levels that we have not reached\)\.Since the order ofτ\\tauism−\|Z\|≥tm\-\|Z\|\\geq t, the setVVhas exactlym−tm\-tlevels, namely, all the levels ofQQexcept thettat which we saw a term other thanP0P\_\{0\}\. We defineFVF\_\{V\}by the same formula for everyV⊆QV\\subseteq Q, withFV:=QF\_\{V\}:=QifV=QV=Q\. It is the longest initial segment ofQQcontained inVV\. \(ZZstands for*zero*, since these are the levels whereτ\\tauchoosesP0P\_\{0\}, andFFstands for*free*, since these are the levels where the box has a star\.\)
ForV⊆QV\\subseteq Qwith\|V\|=m−t\|V\|=m\-t, letℬV\\mathcal\{B\}\_\{V\}be the set of the9t9^\{t\}cubesπ\\piwith
πℓ=\{∗ifℓ∈FV,P0ifℓ∈V∖FV,one of the nine termsPijifℓ∈Q∖V,the termPijwithwℓ=zijifℓ∉Q\.\\pi\_\{\\ell\}=\\begin\{cases\}\\ast&\\text\{if \}\\ell\\in F\_\{V\},\\\\ P\_\{0\}&\\text\{if \}\\ell\\in V\\setminus F\_\{V\},\\\\ \\text\{one of the nine terms \}P\_\{ij\}&\\text\{if \}\\ell\\in Q\\setminus V,\\\\ \\text\{the term \}P\_\{ij\}\\text\{ with \}w\_\{\\ell\}=z\_\{ij\}&\\text\{if \}\\ell\\notin Q\.\\end\{cases\}Every cube inℬV\\mathcal\{B\}\_\{V\}is a box: it satisfies condition \(i\) of the definition because it has\|V\|=m−t\|V\|=m\-tsymbolsP0P\_\{0\}or stars, and condition \(ii\) because its stars are below its symbolsP0P\_\{0\}, sinceFVF\_\{V\}is an initial segment ofQQ\. WhenVVis the set defined above from a leafτ\\tau, the box ofτ\\tauis the one inℬV\\mathcal\{B\}\_\{V\}with the terms ofτ\\tauat the levels ofQ∖VQ\\setminus V\. Since a box ofℬV\\mathcal\{B\}\_\{V\}has stars at the levels ofFVF\_\{V\}, it contains the leaves with any terms there, of which there are10\|FV\|10^\{\|F\_\{V\}\|\}\. Notice that the setℬV\\mathcal\{B\}\_\{V\}depends onww\(since it depends onQQand on the terms at the levels outsideQQ\), but we omit this from the notation sincewwwill always be clear from context\. We call the boxes in these sets, over allV⊆QV\\subseteq Qwith\|V\|=m−t\|V\|=m\-t, the*boxes ofww*\.
There is another way to describe the boxes ofww, in terms of the leaves of order exactlyttcontributing toww\. For such a leaf, consider the lowest level ofQQat which it chooses a term other thanP0P\_\{0\}, and replace itsP0P\_\{0\}by a star at every lower level ofQQ\(or at every level ofQQ, ift=0t=0\)\. The result is a box ofww, and each box ofwwarises exactly once in this way\. This means thatwwhas exactlyαt\\alpha\_\{t\}boxes\.
##### Every leaf of order at leastttlies in exactly one box\.
A leaf contributing towwthat choosesP0P\_\{0\}at the setZZof levels is a leaf of a box ofℬV\\mathcal\{B\}\_\{V\}if and only if it choosesP0P\_\{0\}at every level ofV∖FVV\\setminus F\_\{V\}and at no level ofQ∖VQ\\setminus V, that is,
V∖FV⊆Z⊆V\.V\\setminus F\_\{V\}\\;\\subseteq\\;Z\\;\\subseteq\\;V\.Furthermore, it is a leaf of exactly one of these boxes, namely, the one with its terms at the levels ofQ∖VQ\\setminus V\. We will see in the following lemma that, for\|Z\|≤m−t\|Z\|\\leq m\-t, exactly oneVVsatisfies this condition, namelyZZpadded from the bottom\. Thus every leaf of order at leastttlands in exactly one box\.
###### Lemma 27\.
LetQQbe a set ofmmlevels, and let0≤t≤m0\\leq t\\leq m\. For everyZ⊆QZ\\subseteq Qwith\|Z\|≤m−t\|Z\|\\leq m\-t, there is exactly one setV⊆QV\\subseteq Qwith\|V\|=m−t\|V\|=m\-tand
V∖FV⊆Z⊆V,V\\setminus F\_\{V\}\\;\\subseteq\\;Z\\;\\subseteq\\;V,namelyZZtogether with them−t−\|Z\|m\-t\-\|Z\|lowest levels ofQ∖ZQ\\setminus Z\.
###### Proof\.
LetV⊆QV\\subseteq Qwith\|V\|=m−t\|V\|=m\-tandZ⊆VZ\\subseteq V\. We show thatV∖FV⊆ZV\\setminus F\_\{V\}\\subseteq Zholds if and only ifV∖ZV\\setminus Zconsists of the\|V∖Z\|=m−t−\|Z\|\|V\\setminus Z\|=m\-t\-\|Z\|lowest levels ofQ∖ZQ\\setminus Z, which determinesVV\. IfV=QV=Q, then both conditions hold:FV=QF\_\{V\}=Q, soV∖FV=∅⊆ZV\\setminus F\_\{V\}=\\emptyset\\subseteq Z, andV∖ZV\\setminus Zis all ofQ∖ZQ\\setminus Z\. Otherwise, letℓ\\ellbe the lowest level ofQ∖VQ\\setminus V\. ThenFVF\_\{V\}consists of the levels ofQQbelowℓ\\ell, soV∖FV⊆ZV\\setminus F\_\{V\}\\subseteq Zsays that every level ofV∖ZV\\setminus Zis belowℓ\\ell\. SinceQ∖ZQ\\setminus Zis the disjoint union ofV∖ZV\\setminus ZandQ∖VQ\\setminus V, and every level ofQ∖VQ\\setminus Vis at leastℓ\\ell, this holds if and only ifV∖ZV\\setminus Zconsists of the lowest levels ofQ∖ZQ\\setminus Z\. ∎
###### Lemma 28\.
Letwwbe an output string, with inner setQQ\. The leaves of order at leastttcontributing towware exactly the leaves of the boxes in⋃VℬV\\bigcup\_\{V\}\\mathcal\{B\}\_\{V\}, the union over allV⊆QV\\subseteq Qwith\|V\|=m−t\|V\|=m\-t, and each of them is a leaf of exactly one of these boxes\. Hence
\(XQYQ\)\[w\]=∑τcontributing towof order<tΦτ\(a\)Ψτ\(b\)\+∑V⊆Q\|V\|=m−t∑π∈ℬVval\(π\),\(X\_\{Q\}Y\_\{Q\}\)\[w\]\\;=\\sum\_\{\\begin\{subarray\}\{c\}\\tau\\text\{ contributing to \}w\\\\ \\text\{of order \}<\\,t\\end\{subarray\}\}\\Phi\_\{\\tau\}\(a\)\\,\\Psi\_\{\\tau\}\(b\)\\;\+\\;\\sum\_\{\\begin\{subarray\}\{c\}V\\subseteq Q\\\\ \|V\|=m\-t\\end\{subarray\}\}\\;\\sum\_\{\\pi\\in\\mathcal\{B\}\_\{V\}\}\\mathrm\{val\}\(\\pi\),a sum of∑d=0t−1αd\\sum\_\{d=0\}^\{t\-1\}\\alpha\_\{d\}products andαt\\alpha\_\{t\}values of boxes\.
###### Proof\.
Every leaf of a box ofℬV\\mathcal\{B\}\_\{V\}agrees with the private leaf ofwwoutsideQQ, so it contributes toww, and it choosesP0P\_\{0\}at most\|V\|=m−t\|V\|=m\-ttimes, so its order is at leasttt\. Conversely, a leafτ\\taucontributing toww, of order at leasttt, choosesP0P\_\{0\}at a setZ⊆QZ\\subseteq Qof at mostm−tm\-tlevels, and as we saw above, it is a leaf of a box ofℬV\\mathcal\{B\}\_\{V\}if and only ifV∖FV⊆Z⊆VV\\setminus F\_\{V\}\\subseteq Z\\subseteq V, and then of exactly one such box\. By Lemma[27](https://arxiv.org/html/2610.06783#Thmtheorem27), exactly oneVVsatisfies this condition\. The desired equation follows, since\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]is the sum of the products at the leaves contributing toww\. Finally,αd\\alpha\_\{d\}leaves of orderddcontribute toww, and there are\(mm−t\)\\binom\{m\}\{m\-t\}setsVVwith9t9^\{t\}boxes each, i\.e\.,\(mm−t\)9t=\(mt\)9t=αt\\binom\{m\}\{m\-t\}9^\{t\}=\\binom\{m\}\{t\}9^\{t\}=\\alpha\_\{t\}boxes in all \(as many as the leaves of order exactlyttcontributing toww, although they cover its leaves of every order fromtttomm\)\. ∎
### 4\.3The data structure, in terms of the parameters
In this subsection, we assemble the boxes into our data structure and bound its costs in terms of the parametersmm,LL, andtt\. We will then choose settings for the parameters in Section[4\.4](https://arxiv.org/html/2610.06783#S4.SS4)\. We begin by recalling two notions from Section[2](https://arxiv.org/html/2610.06783#S2)that the data structure builds on\.
The*tiling*of Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4)cuts the productXYXYinto*tiles*\. A row block isN0N\_\{0\}consecutive rows ofXX, a column block isN0N\_\{0\}consecutive columns ofYY, and a tile is a band ofK0=⌊K⌋K\_\{0\}=\\lfloor\\sqrt\{K\}\\rfloorconsecutive row blocks together with a band ofK0K\_\{0\}consecutive column blocks\. One run of the recursion computes allK02K\_\{0\}^\{2\}block products of a tile at once, each as the productXQYQX\_\{Q\}Y\_\{Q\}for its own subsetQQ\. The*encodings*of Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)are the arrays of the10L10^\{L\}numbersΦτ\(a\)\\Phi\_\{\\tau\}\(a\), one for each leafτ\\tau, computed from the input arrayaaof a row band, and similarly the numbersΨτ\(b\)\\Psi\_\{\\tau\}\(b\)computed from the input arraybbof a column band\. We compute an encoding once per band and share it among all the tiles that use that band, and the product at a leaf of a tile is the product of its two encoded numbers\.
Our data structure consists of three components:
- •the list of theK02K\_\{0\}^\{2\}subsetsQQassigned to the block products of a tile \(recall that this list is the same for every tile\),
- •the encodings of all row bands and all column bands, and
- •for every tile, the values of all its boxes \(the boxes are the same strings in every tile, but their values depend on the input arrays of the tile\)\.
To answer a query for an entry\(XY\)\[I,J\]\(XY\)\[I,J\], the data structure performs the following three steps:
1. \(1\)Find the tile that contains\(I,J\)\(I,J\), the subsetQQof its block product, and the output stringwwof\(I,J\)\(I,J\)\.
2. \(2\)Add up the products at the leaves of order belowttcontributing toww, by reading the two factors of each product from the encodings of the tile\.
3. \(3\)Add to this the values of theαt\\alpha\_\{t\}boxes ofww, which are stored for the tile\.
By Lemma[28](https://arxiv.org/html/2610.06783#Thmtheorem28), the result is\(XQYQ\)\[w\]=\(XY\)\[I,J\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]=\(XY\)\[I,J\]\. We will give the details of the query, as well as the preprocessing, in the proof of Theorem[30](https://arxiv.org/html/2610.06783#Thmtheorem30)below\.
The encodings are indexed by the leaves \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\), and for each tile we store its boxes, with their values, in a standard trie on their strings ofLLsymbols\. Thus reading the product at a leaf, or looking up or inserting a box, takesO\(L\)O\(L\)operations\.
We will next show that there are at mostm\+1m\+1times as many boxes as there are leaves of order at leasttt, and that the dynamic program described in the technique overview computes their values \(a box witheestars being the sum of ten boxes withe−1e\-1stars\)\.
###### Lemma 29\.
There are at most\(m\+1\)∑d=tmβd\(m\+1\)\\sum\_\{d=t\}^\{m\}\\beta\_\{d\}boxes\. Given the two encodings of a tile, we can compute the values of all these boxes, and store them in the trie for that tile, inO\(L\)O\(L\)time and space per box\.
###### Proof\.
*The count\.*A box in whichffof the symbols areP0P\_\{0\}or stars is obtained from a leaf of orderm−fm\-f\(namely the leaf we get by replacing its stars withP0P\_\{0\}\) by turning theeelowest symbolsP0P\_\{0\}of that leaf into stars, for somee≤fe\\leq f\. Thus, such a box can be specified by choosing thefflevels of these symbols, the numberee, and a term other thanP0P\_\{0\}at each of the otherL−fL\-flevels\. There are hence\(f\+1\)\(Lf\)9L−f=\(f\+1\)βm−f\(f\+1\)\\binom\{L\}\{f\}9^\{L\-f\}=\(f\+1\)\\,\\beta\_\{m\-f\}such boxes, and summing overf≤m−tf\\leq m\-tgives the upper bound on the number of boxes\.
*The values\.*We compute the values of the boxes in increasing order of their number of stars\. The boxes without stars are the leaves with at mostm−tm\-tsymbolsP0P\_\{0\}, and the value of each of them is the product of its two numbers in the encodings\.
For a boxπ\\piwithe≥1e\\geq 1stars, letℓ\\ellbe the highest level at whichπ\\pihas a star\. The leaves ofπ\\piare the leaves of the ten stringsπ\[ℓ←λ\]\\pi\[\\ell\\leftarrow\\lambda\]obtained by replacing that star by a termλ\\lambda, and each of these strings is again a box, withe−1e\-1stars\. Indeed, ifλ=P0\\lambda=P\_\{0\}, then the number of symbols that areP0P\_\{0\}or stars stays the same, and the newP0P\_\{0\}at levelℓ\\ellis above all the remaining stars\. Ifλ\\lambdais any other term, then that number decreases by one, and every star is still below everyP0P\_\{0\}\. Thus conditions \(i\) and \(ii\) in the definition of a box hold in both cases\. \(We expand the highest star because replacing a lower star byP0P\_\{0\}would leave a star above aP0P\_\{0\}, which is not a box\.\) Hence we compute
val\(π\)=∑λval\(π\[ℓ←λ\]\)\\mathrm\{val\}\(\\pi\)=\\sum\_\{\\lambda\}\\mathrm\{val\}\(\\pi\[\\ell\\leftarrow\\lambda\]\)with ten lookups in the trie, inO\(L\)O\(L\)operations\. Generating the boxes witheestars and inserting them into the trie also takesO\(L\)O\(L\)operations per box, and adds at mostLLvertices per box\. ∎
See Figure[7](https://arxiv.org/html/2610.06783#S2.F7)for an illustration of these counts \(in that figure, the switching orderttis set tom/9m/9\)\. At every orderdd, the pruned recursion of Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)visits at mostmin\{\|U\|αd,βd\}\\min\\\{\|U\|\\alpha\_\{d\},\\beta\_\{d\}\\\}leaves of orderddin a tile whose wanted output strings form the setUU\(see the proof of Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11)\), the smaller of the two bounds at that order\. The data structure cannot do this, sinceUUis not known in advance\. Instead, a query computesαd\\alpha\_\{d\}products at every orderd<td<t, and looks upαt\\alpha\_\{t\}boxes at the ordertt\. The data structure also stores at most\(m\+1\)∑d≥tβd\(m\+1\)\\sum\_\{d\\geq t\}\\beta\_\{d\}boxes per tile, even if they are not used by a query\. The preprocessing time is therefore dominated by the sum∑d≥tβd\\sum\_\{d\\geq t\}\\beta\_\{d\}, and hence by how fast theβd\\beta\_\{d\}decay\. Let
ρ:=9mL−m\+1,\\rho:=\\frac\{9m\}\{L\-m\+1\},which is less than11sinceL≥10mL\\geq 10m\. It plays the role of12\\frac\{1\}\{2\}in \([5](https://arxiv.org/html/2610.06783#S2.E5)\): for1≤d≤m1\\leq d\\leq m,
βdβd−1=9\(m−d\+1\)L−m\+d≤9mL−m\+1=ρ,soβd≤ρdM\.\\frac\{\\beta\_\{d\}\}\{\\beta\_\{d\-1\}\}=\\frac\{9\(m\-d\+1\)\}\{L\-m\+d\}\\leq\\frac\{9m\}\{L\-m\+1\}=\\rho,\\qquad\\text\{so\}\\qquad\\beta\_\{d\}\\leq\\rho^\{d\}\\,M\.\(7\)The closer the ratioc=L/mc=L/mis to1010, the closerρ\\rhois to11, and the more boxes the preprocessing has to compute\. This is one side of the trade\-off mentioned at the beginning of this section between the time savings and how thin the product must be\.
We can now bound the costs\. The theorem below assumes thatN≥KN0N\\geq\\sqrt\{K\}\\,N\_\{0\}\. Since a tile spansK0N0≤KN0K\_\{0\}N\_\{0\}\\leq\\sqrt\{K\}\\,N\_\{0\}rows and as many columns of theN×NN\\times NproductXYXY, this ensures that a tile fits insideXYXY, so paddingNNto a multiple ofK0N0K\_\{0\}N\_\{0\}at most doubles it\. We checked the same requirement in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4), where it was the first of the two consequences ofN≥D18N\\geq D^\{18\}\. Here it will also follow, in Section[4\.4](https://arxiv.org/html/2610.06783#S4.SS4), from the requirement that computing the encodings takes at mostN2/DγN^\{2\}/D^\{\\gamma\}time, since10L≥M10^\{L\}\\geq M\.
###### Theorem 30\.
Letm≥1m\\geq 1,D=4mD=4^\{m\},L≥10mL\\geq 10m,0≤t≤m0\\leq t\\leq m, andN≥KN0N\\geq\\sqrt\{K\}\\,N\_\{0\}\. Given as input matricesX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}, whose entries are integers of absolute value at mostNO\(1\)N^\{O\(1\)\}, we can preprocess them deterministically in time and space
O\(Lmρt1−ρN2\+N⋅10LKN0\)\.O\\Big\(L\\,m\\,\\frac\{\\rho^\{t\}\}\{1\-\\rho\}\\,N^\{2\}\\;\+\\;\\frac\{N\\cdot 10^\{L\}\}\{\\sqrt\{K\}\\,N\_\{0\}\}\\Big\)\.\(8\)After this, any single entry\(XY\)\[I,J\]\(XY\)\[I,J\]can be computed deterministically inO\(L∑d=0tαd\)O\\big\(L\\sum\_\{d=0\}^\{t\}\\alpha\_\{d\}\\big\)time\. In particular, for every setWWof positions of anN×NN\\times Nmatrix, the entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, can be computed deterministically in time
O\(L\|W\|∑d=0tαd⏟queries\+Lmρt1−ρN2⏟boxes\+N⋅10LKN0⏟encodings\)\.O\\Big\(\\underbrace\{L\\,\|W\|\\sum\_\{d=0\}^\{t\}\\alpha\_\{d\}\}\_\{\\text\{queries\}\}\\;\+\\;\\underbrace\{L\\,m\\,\\frac\{\\rho^\{t\}\}\{1\-\\rho\}\\,N^\{2\}\}\_\{\\text\{boxes\}\}\\;\+\\;\\underbrace\{\\frac\{N\\cdot 10^\{L\}\}\{\\sqrt\{K\}\\,N\_\{0\}\}\}\_\{\\text\{encodings\}\}\\Big\)\.\(9\)The constants hidden in theO\(⋅\)O\(\\cdot\)depend only on the exponent inNO\(1\)N^\{O\(1\)\}\.
###### Proof\.
*Preprocessing\.*We tile the product as in Section[2\.3\.4](https://arxiv.org/html/2610.06783#S2.SS3.SSS4), paddingNNto a multiple ofK0N0K\_\{0\}N\_\{0\}, which at most doubles it sinceN≥KN0≥K0N0N\\geq\\sqrt\{K\}\\,N\_\{0\}\\geq K\_\{0\}N\_\{0\}, and we store theK02K\_\{0\}^\{2\}subsets, inO\(KL\)≤O\(10L\)O\(KL\)\\leq O\(10^\{L\}\)operations\. We then form and encode the input arrays of all row bands and column bands, at most4N/\(KN0\)4N/\(\\sqrt\{K\}\\,N\_\{0\}\)of them sinceK0≥K/2K\_\{0\}\\geq\\sqrt\{K\}/2\. Each has at mostKN0D≤7LKN\_\{0\}D\\leq 7^\{L\}nonzero entries, so we form it inO\(L⋅7L\)O\(L\\cdot 7^\{L\}\)operations, and its encoding takesO\(10L\)O\(10^\{L\}\)operations \(Section[2\.4\.1](https://arxiv.org/html/2610.06783#S2.SS4.SSS1)\)\. This is the last term of \([8](https://arxiv.org/html/2610.06783#S4.E8)\)\. Finally, we compute the values of all the boxes of each of the at most4N2/M4N^\{2\}/Mtiles, whereM=KN02M=KN\_\{0\}^\{2\}is the number of output entries of a tile\. By Lemma[29](https://arxiv.org/html/2610.06783#Thmtheorem29), this takesO\(L\(m\+1\)∑d≥tβd\)O\(L\(m\+1\)\\sum\_\{d\\geq t\}\\beta\_\{d\}\)time and space per tile, and∑d≥tβd≤Mρt/\(1−ρ\)\\sum\_\{d\\geq t\}\\beta\_\{d\}\\leq M\\rho^\{t\}/\(1\-\\rho\)by \([7](https://arxiv.org/html/2610.06783#S4.E7)\), which gives the first term\.
*Query\.*Given\(I,J\)\(I,J\), we find its tile from the bands of rowIIand columnJJ, the subsetQQof its block product, and its output stringww\(whose variables at the levels outsideQQwe read off the row and column of\(I,J\)\(I,J\)within the block product\), all inO\(L\)O\(L\)operations \(Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4)\)\. We then compute\(XQYQ\)\[w\]\(X\_\{Q\}Y\_\{Q\}\)\[w\]as the sum in Lemma[28](https://arxiv.org/html/2610.06783#Thmtheorem28), which has two parts\.
The first part is the sum of the products at the leaves of order belowttcontributing toww\. Each of these leaves is obtained from the private leaf ofww, which hasP0P\_\{0\}at every level ofQQ, by picking fewer thanttof those levels and replacingP0P\_\{0\}with one of the nine other terms at each of them\. We enumerate them, and for each such leafτ\\tauwe look up its two numbersΦτ\(a\)\\Phi\_\{\\tau\}\(a\)andΨτ\(b\)\\Psi\_\{\\tau\}\(b\)in the encodings of the tile and multiply them\. The second part is the sum of the values of the boxes ofww: for everyV⊆QV\\subseteq Qwith\|V\|=m−t\|V\|=m\-tand every box ofℬV\\mathcal\{B\}\_\{V\}, we look up its value in the trie of the tile\. In all, these are∑d=0t−1αd\+αt\\sum\_\{d=0\}^\{t\-1\}\\alpha\_\{d\}\+\\alpha\_\{t\}numbers, and we find each of them inO\(L\)O\(L\)operations, including forming its leaf or its box from the private leaf\. Enumerating them also takesO\(L\)O\(L\)operations per number\. By Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4), the sum is\(XY\)\[I,J\]\(XY\)\[I,J\]\. For a setWW, we ask\|W\|\|W\|queries, which gives \([9](https://arxiv.org/html/2610.06783#S4.E9)\)\.
*Word size\.*As in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4), every number in an encoding is a sum of entries of the input array with coefficients0,±10,\\pm 1, and every value we compute is a sum of at most10m10^\{m\}products of two such numbers\. SinceN≥N0=3L−mN\\geq N\_\{0\}=3^\{L\-m\}andL≥10mL\\geq 10m, we have10L≤N5/210^\{L\}\\leq N^\{5/2\}, so, as in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4), all the values areNO\(1\)N^\{O\(1\)\}in absolute value, and every integer we use hasO\(logN\)O\(\\log N\)bits\. ∎
### 4\.4Choosing the parameters
We now choose the parameters in Theorem[30](https://arxiv.org/html/2610.06783#Thmtheorem30)and prove the results of Section[4\.1](https://arxiv.org/html/2610.06783#S4.SS1)\. In other words, we do the arithmetic and bookkeeping to derive the explicit exponents from Theorem[30](https://arxiv.org/html/2610.06783#Thmtheorem30)\. We first do the calculation in full for a single choice of the parameters,L=21mL=21mandt=⌈m/9⌉t=\\lceil m/9\\rceil, which proves Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\. We then say what changes for other choices, which gives Theorems[24](https://arxiv.org/html/2610.06783#Thmtheorem24)and[25](https://arxiv.org/html/2610.06783#Thmtheorem25)and the entries of Table[2](https://arxiv.org/html/2610.06783#S4.T2)\.
###### Proof of Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\.
*Setting up\.*Letm:=⌈log4D⌉m:=\\lceil\\log\_\{4\}D\\rceil, and pad the inner dimension to4m<4D4^\{m\}<4Dwith zero columns ofXXand zero rows ofYY\. This changes no entry ofXYXY, and it changesDDby a factor less than44, which only affects the constants\. So from now onD=4mD=4^\{m\}, and since the originalDDwas larger than4m−14^\{m\-1\}, the assumptionN≥D18N\\geq D^\{18\}now readsN≥418\(m−1\)N\\geq 4^\{18\(m\-1\)\}\. LetL:=21mL:=21mandt:=⌈m/9⌉t:=\\lceil m/9\\rceil\. We will apply Theorem[30](https://arxiv.org/html/2610.06783#Thmtheorem30)with these parameters, and we will verify its conditionN≥KN0N\\geq\\sqrt\{K\}\\,N\_\{0\}below, in the step on the encodings\.
*Boxes\.*We haveρ=9m/\(L−m\+1\)=9m/\(20m\+1\)<9/20\\rho=9m/\(L\-m\+1\)=9m/\(20m\+1\)<9/20, so1/\(1−ρ\)<21/\(1\-\\rho\)<2, and sincet≥m/9t\\geq m/9, alsoρt≤\(9/20\)m/9=D−γ\\rho^\{t\}\\leq\(9/20\)^\{m/9\}=D^\{\-\\gamma\}, whereγ:=ln\(20/9\)/\(9ln4\)=0\.0640…\\gamma:=\\ln\(20/9\)/\(9\\ln 4\)=0\.0640\\ldots\. Hence the first term of \([8](https://arxiv.org/html/2610.06783#S4.E8)\) isO\(m2N2/Dγ\)O\(m^\{2\}N^\{2\}/D^\{\\gamma\}\)\.
*Queries\.*A query reads∑d≤tαd\\sum\_\{d\\leq t\}\\alpha\_\{d\}numbers, and we bound this sum as in the proof of Lemma[11](https://arxiv.org/html/2610.06783#Thmtheorem11)\. Since9d=72d8−d≤72t8−d9^\{d\}=72^\{d\}8^\{\-d\}\\leq 72^\{t\}8^\{\-d\}ford≤td\\leq t, andt<m/9\+1t<m/9\+1,
∑d=0t\(md\)9d≤72t∑d=0m\(md\)8−d=72t\(98\)m<72⋅\(72⋅\(98\)9\)m/9=72Dq,\\sum\_\{d=0\}^\{t\}\\binom\{m\}\{d\}9^\{d\}\\;\\leq\\;72^\{t\}\\sum\_\{d=0\}^\{m\}\\binom\{m\}\{d\}8^\{\-d\}=72^\{t\}\\Big\(\\frac\{9\}\{8\}\\Big\)^\{m\}<72\\cdot\\Big\(72\\cdot\\big\(\\tfrac\{9\}\{8\}\\big\)^\{9\}\\Big\)^\{m/9\}=72\\,D^\{q\},whereq:=ln\(72⋅\(9/8\)9\)/\(9ln4\)=0\.4277…q:=\\ln\(72\\cdot\(9/8\)^\{9\}\)/\(9\\ln 4\)=0\.4277\\ldots\. Hence a query takesO\(LDq\)=O\(mDq\)O\(L\\,D^\{q\}\)=O\(m\\,D^\{q\}\)time\.
*Encodings\.*It remains to show that the last term of \([8](https://arxiv.org/html/2610.06783#S4.E8)\) is at mostN2/DγN^\{2\}/D^\{\\gamma\}, and thatN≥KN0N\\geq\\sqrt\{K\}\\,N\_\{0\}\. Both follow from
Dγ⋅10LKN0≤N,\\frac\{D^\{\\gamma\}\\cdot 10^\{L\}\}\{\\sqrt\{K\}\\,N\_\{0\}\}\\;\\leq\\;N,\(10\)the first by rearranging, and the second because10L≥M=KN0210^\{L\}\\geq M=KN\_\{0\}^\{2\}andDγ≥1D^\{\\gamma\}\\geq 1\. As in Section[2\.4\.4](https://arxiv.org/html/2610.06783#S2.SS4.SSS4), we comparemm\-th powers by comparing their bases\. We haveDγ=\(20/9\)m/9D^\{\\gamma\}=\(20/9\)^\{m/9\},10L=1021m10^\{L\}=10^\{21m\}, andN0=320mN\_\{0\}=3^\{20m\}, and the standard bound\(nk\)≥1n\+1⋅nnkk\(n−k\)n−k\\binom\{n\}\{k\}\\geq\\frac\{1\}\{n\+1\}\\cdot\\frac\{n^\{n\}\}\{k^\{k\}\(n\-k\)^\{n\-k\}\}givesK=\(21mm\)≥121m\+1\(2121/2020\)mK=\\binom\{21m\}\{m\}\\geq\\frac\{1\}\{21m\+1\}\\big\(21^\{21\}/20^\{20\}\\big\)^\{m\}\. Hence the left\-hand side of \([10](https://arxiv.org/html/2610.06783#S4.E10)\) is at most21m\+1⋅Λm\\sqrt\{21m\+1\}\\cdot\\Lambda^\{m\}, where
Λ:=1021⋅\(20/9\)1/9\(2121/2020\)1/2⋅320=4\.198…⋅1010\.\\Lambda:=\\frac\{10^\{21\}\\cdot\(20/9\)^\{1/9\}\}\{\(21^\{21\}/20^\{20\}\)^\{1/2\}\\cdot 3^\{20\}\}=4\.198\\ldots\\cdot 10^\{10\}\.We now use the assumptionN≥D18N\\geq D^\{18\}\. Its base418=6\.871…⋅10104^\{18\}=6\.871\\ldots\\cdot 10^\{10\}is larger thanΛ\\Lambdaby a factor of more than1\.631\.63\. SinceN≥418\(m−1\)N\\geq 4^\{18\(m\-1\)\}, the inequality \([10](https://arxiv.org/html/2610.06783#S4.E10)\) therefore holds whenever1\.63m≥41821m\+11\.63^\{m\}\\geq 4^\{18\}\\sqrt\{21m\+1\}, which is the case for allm≥60m\\geq 60\. \(Form<60m<60,DDis bounded by a constant, and the corollary holds trivially\.\)
*Conclusion\.*Form≥60m\\geq 60, Theorem[30](https://arxiv.org/html/2610.06783#Thmtheorem30)thus applies\. The preprocessing takesO\(m2N2/Dγ\)O\(m^\{2\}N^\{2\}/D^\{\\gamma\}\)time and space, and a query takesO\(mDq\)O\(m\\,D^\{q\}\)time\. Sincem=O\(logD\)m=O\(\\log D\)and the exponentsγ−0\.063\\gamma\-0\.063and0\.437−q0\.437\-qare positive, we havem2=O\(Dγ−0\.063\)m^\{2\}=O\(D^\{\\gamma\-0\.063\}\)andm=O\(D0\.437−q\)m=O\(D^\{0\.437\-q\}\), which gives the boundsO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)andO\(D0\.437\)O\(D^\{0\.437\}\)of the corollary\. The bound for a setWWfollows by asking\|W\|\|W\|queries\. ∎
##### Other choices of the parameters\.
The numbers2121and19\\frac\{1\}\{9\}did not play a special role in this proof, and the same calculation works withL=⌈cm⌉L=\\lceil cm\\rceilandt=⌈θm⌉t=\\lceil\\theta m\\rceilfor any constantsc\>10c\>10and0<θ<0\.90<\\theta<0\.9\. This gives Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31)below, which we use for the left half of Table[2](https://arxiv.org/html/2610.06783#S4.T2), with theccof the row and theθ\\thetathat gives theqqof the column \(θ=19\\theta=\\frac\{1\}\{9\}forq=0\.43q=0\.43\)\. To state it, letH\(x\):=−xlnx−\(1−x\)ln\(1−x\)\\Hh\(x\):=\-x\\ln x\-\(1\-x\)\\ln\(1\-x\)be the entropy function \(with natural logarithms\), letΛ:=10ce−12cH\(1/c\)3−\(c−1\)4γ\\Lambda:=10^\{c\}\\,e^\{\-\\frac\{1\}\{2\}c\\Hh\(1/c\)\}\\,3^\{\-\(c\-1\)\}\\,4^\{\\gamma\}be the general form of the baseΛ\\Lambdaabove, and let
Rc\(γ\):=ln4lnΛ=ln4cln10−12cH\(1/c\)−\(c−1\)ln3\+γln4\.R\_\{c\}\(\\gamma\):=\\frac\{\\ln 4\}\{\\ln\\Lambda\}=\\frac\{\\ln 4\}\{c\\ln 10\-\\tfrac\{1\}\{2\}c\\Hh\(1/c\)\-\(c\-1\)\\ln 3\+\\gamma\\ln 4\}\.\(11\)
###### Corollary 31\.
Letc\>10c\>10and0<θ<0\.90<\\theta<0\.9, letρc:=9/\(c−1\)\\rho\_\{c\}:=9/\(c\-1\), and let
γ:=θln\(1/ρc\)ln4\>0andq:=H\(θ\)\+θln9ln4\.\\gamma:=\\frac\{\\theta\\ln\(1/\\rho\_\{c\}\)\}\{\\ln 4\}\>0\\qquad\\text\{and\}\\qquad q:=\\frac\{\\Hh\(\\theta\)\+\\theta\\ln 9\}\{\\ln 4\}\.Given as input matricesX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}whose entries are integers of absolute value at mostNO\(1\)N^\{O\(1\)\}, where2≤D≤Nε2\\leq D\\leq N^\{\\varepsilon\}andε<Rc\(γ\)\\varepsilon<R\_\{c\}\(\\gamma\), withRcR\_\{c\}as in \([11](https://arxiv.org/html/2610.06783#S4.E11)\), we can preprocess them deterministically inO\(N2log2D/Dγ\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\)time and space, after which any single entry\(XY\)\[I,J\]\(XY\)\[I,J\]can be computed deterministically inO\(DqlogD\)O\(D^\{q\}\\log D\)time\. The constants hidden in theO\(⋅\)O\(\\cdot\)depend oncc,θ\\theta, andε\\varepsilon\.
Moreover,Rc\(0\)R\_\{c\}\(0\)increases toε∗=ln4/\(5ln10\)=0\.1204…\\varepsilon^\{\*\}=\\ln 4/\(5\\ln 10\)=0\.1204\\ldotsasccdecreases to1010\.
###### Proof\.
We repeat the proof of Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)withL:=⌈cm⌉L:=\\lceil cm\\rceilandt:=⌈θm⌉t:=\\lceil\\theta m\\rceil\. After the padding, the assumptionD≤NεD\\leq N^\{\\varepsilon\}now readsN≥4\(m−1\)/εN\\geq 4^\{\(m\-1\)/\\varepsilon\}\. For the boxes,ρ<ρc\\rho<\\rho\_\{c\}givesρt≤ρcθm=D−γ\\rho^\{t\}\\leq\\rho\_\{c\}^\{\\theta m\}=D^\{\-\\gamma\}\. For the queries, the same calculation withx:=\(1−θ\)/θx:=\(1\-\\theta\)/\\thetain place of88, where9x\>19x\>1becauseθ<0\.9\\theta<0\.9, gives∑d≤tαd≤\(9x\)t\(1\+1/x\)m=O\(Dq\)\\sum\_\{d\\leq t\}\\alpha\_\{d\}\\leq\(9x\)^\{t\}\(1\+1/x\)^\{m\}=O\(D^\{q\}\)\. For the encodings, the same bound on the binomial coefficient,\(nk\)≥enH\(k/n\)/\(n\+1\)\\binom\{n\}\{k\}\\geq e^\{n\\Hh\(k/n\)\}/\(n\+1\), shows that the left\-hand side of \([10](https://arxiv.org/html/2610.06783#S4.E10)\) isO\(m⋅Λm\)O\(\\sqrt\{m\}\\cdot\\Lambda^\{m\}\)\. Asε<Rc\(γ\)\\varepsilon<R\_\{c\}\(\\gamma\)says thatΛ<41/ε\\Lambda<4^\{1/\\varepsilon\}, the inequality \([10](https://arxiv.org/html/2610.06783#S4.E10)\) thus holds oncemmexceeds a constant depending oncc,θ\\theta, andε\\varepsilon, and for smallermmthe corollary again holds trivially\.
Finally, a direct calculation shows that forγ=0\\gamma=0,lnΛ\\ln\\Lambdaincreases withccand tends to5ln105\\ln 10asccdecreases to1010, by the identityH\(110\)\+910ln9=ln10\\Hh\(\\frac\{1\}\{10\}\)\+\\frac\{9\}\{10\}\\ln 9=\\ln 10\. HenceRc\(0\)R\_\{c\}\(0\)increases toln4/\(5ln10\)=ε∗\\ln 4/\(5\\ln 10\)=\\varepsilon^\{\*\}\. ∎
##### Whereε∗\\varepsilon^\{\*\}comes from\.
The identityH\(110\)\+910ln9=ln10\\Hh\(\\frac\{1\}\{10\}\)\+\\frac\{9\}\{10\}\\ln 9=\\ln 10says that\(10mm\)99m\\binom\{10m\}\{m\}9^\{9m\}, the largest term of the binomial expansion of\(1\+9\)10m\(1\+9\)^\{10m\}, is1010m10^\{10m\}up to polynomial factors\. So atc=10c=10a tile hasM≈10LM\\approx 10^\{L\}output entries, as many as the recursion has leaves, and the encodings costN⋅10L/M≈N⋅10L/2N\\cdot 10^\{L\}/\\sqrt\{M\}\\approx N\\cdot 10^\{L/2\}, which is belowN2N^\{2\}exactly whenN≥10L/2=D1/ε∗N\\geq 10^\{L/2\}=D^\{1/\\varepsilon^\{\*\}\}\.
###### Proof of Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)\.
Letε<ε∗\\varepsilon<\\varepsilon^\{\*\}andq\>0q\>0\. Choosec\>10c\>10withRc\(0\)\>εR\_\{c\}\(0\)\>\\varepsilon\(Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31)\), and thenθ∈\(0,0\.9\)\\theta\\in\(0,0\.9\)small enough that\(H\(θ\)\+θln9\)/ln4<q\(\\Hh\(\\theta\)\+\\theta\\ln 9\)/\\ln 4<qandRc\(θln\(1/ρc\)/ln4\)\>εR\_\{c\}\(\\theta\\ln\(1/\\rho\_\{c\}\)/\\ln 4\)\>\\varepsilon\. This is possible since, asθ→0\\theta\\to 0, the first expression tends to00and the second toRc\(0\)R\_\{c\}\(0\)\. Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31)with theseccandθ\\thetagives the theorem\. ∎
###### Proof of Theorem[25](https://arxiv.org/html/2610.06783#Thmtheorem25)\.
Apply Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)withq:=κ/2q:=\\kappa/2, and ask one query for each position ofWW\. As\|W\|≤N2/Dκ\|W\|\\leq N^\{2\}/D^\{\\kappa\}, this takesO\(N2log2D/Dγ\+\|W\|Dκ/2logD\)=O\(N2log2D/Dγ′\)O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma\}\+\|W\|\\,D^\{\\kappa/2\}\\log D\)=O\(N^\{2\}\\log^\{2\}\\\!D/D^\{\\gamma^\{\\prime\}\}\)time, whereγ′:=min\{γ,κ/2\}\\gamma^\{\\prime\}:=\\min\\\{\\gamma,\\kappa/2\\\}\. ∎
With Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31)in place of Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24), the same argument gives explicit exponents, which we use for the right half of Table[2](https://arxiv.org/html/2610.06783#S4.T2), with theθ\\thetaat whichγ=κ−q\\gamma=\\kappa\-q\. Theε\\varepsilonof a row of the table is the smallestRc\(γ\)R\_\{c\}\(\\gamma\)over its entries\.
###### Corollary 32\.
Letcc,θ\\theta,γ\\gamma,qq,XX,YY,DD, andε\\varepsilonbe as in Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31), and letκ\>0\\kappa\>0\. For every setWWof at mostN2/DκN^\{2\}/D^\{\\kappa\}positions of anN×NN\\times Nmatrix, the entries\(XY\)\[I,J\]\(XY\)\[I,J\],\(I,J\)∈W\(I,J\)\\in W, can be computed deterministically in time
O\(N2log2D\(D−γ\+Dq−κ\)\),O\\big\(N^\{2\}\\log^\{2\}\\\!D\\,\(D^\{\-\\gamma\}\+D^\{q\-\\kappa\}\)\\big\),a saving ofDmin\{γ,κ−q\}D^\{\\min\\\{\\gamma,\\,\\kappa\-q\\\}\}, up to logarithmic factors, over the sizeN2N^\{2\}of the product\.
## 5Further reductions
This section presents the remaining algorithmic results of the introduction: directed unweighted APSP \(Section[5\.1](https://arxiv.org/html/2610.06783#S5.SS1)\), the real\-valued versions of33SUM, APSP, and Exact Triangle \(Section[5\.2](https://arxiv.org/html/2610.06783#S5.SS2)\), the weightedkk\-Clique problems \(Section[5\.3](https://arxiv.org/html/2610.06783#S5.SS3)\), and the refutation of the rectangular hinted OMv conjectures of van den Brand, Nanongkai, and Saranurak\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\(Section[5\.4](https://arxiv.org/html/2610.06783#S5.SS4)\)\. Each result but the last composes a known reduction with the algorithms of Sections[3](https://arxiv.org/html/2610.06783#S3)and[4](https://arxiv.org/html/2610.06783#S4); the last applies the data structure of Section[4](https://arxiv.org/html/2610.06783#S4)directly\. We cite the reduction we use in each case and modify it only where our parameter regime requires it, saying what changes\.
##### What we use\.
We recall the three results of Sections[3](https://arxiv.org/html/2610.06783#S3)and[4](https://arxiv.org/html/2610.06783#S4)that the reductions plug into\.
- •*Exact Triangle*\(Section[3\.2](https://arxiv.org/html/2610.06783#S3.SS2)\) asks whether a complete tripartite graph with partsA,B,CA,B,Cofnnvertices and integer edge weights of absolute value at mostnνn^\{\\nu\}has a triangle of weight zero\. Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19)solves it deterministically inO\(n3−ε′logn\)≤O\(n3−εT\)O\(n^\{3\-\\varepsilon^\{\\prime\}\}\\log n\)\\leq O\(n^\{3\-\\varepsilon\_\{T\}\}\)time, whereε′=0\.00175\\varepsilon^\{\\prime\}=0\.00175andεT=0\.0017\\varepsilon\_\{T\}=0\.0017, and Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)derives from this a deterministicO~\(n3−ε′/3\)\\tilde\{O\}\(n^\{3\-\\varepsilon^\{\\prime\}/3\}\)\-time algorithm for the\(min,\+\)\(\\min,\+\)\-product of twon×nn\\times nmatrices with integer entries of absolute valuenO\(1\)n^\{O\(1\)\}\.
- •Lop\-AE\-SparseTri\(n,D\)\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)and\#Lop\-AE\-SparseTri\(n,D\)\\\#\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}\(n,D\)\(Definitions[13](https://arxiv.org/html/2610.06783#Thmtheorem13)and[14](https://arxiv.org/html/2610.06783#Thmtheorem14)\) are given a tripartite graph with partsAAandBBofnnvertices and a middle part of at mostDDvertices, together with a setWWof*query pairs*\(a,b\)∈A×B\(a,b\)\\in A\\times B, and ask for every query pair inWWwhetheraaandbbhave a common neighbor in the middle part, or for the counting version, how many they have\. Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16)solves both deterministically inO\(\|W\|D0\.437\+n2/D0\.063\)O\(\|W\|D^\{0\.437\}\+n^\{2\}/D^\{0\.063\}\)time whenn≥D18n\\geq D^\{18\}\. Theorem[17](https://arxiv.org/html/2610.06783#Thmtheorem17)reduces Exact Triangle toLop\-AE\-SparseTri\\mathrm\{Lop\}\\text\{\-\}\\mathrm\{AE\}\\text\{\-\}\\mathrm\{SparseTri\}deterministically by hashing the weights modulo a prime\.
- •Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)is the data structure behind Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16)\. GivenX∈ℤN×DX\\in\\mathbb\{Z\}^\{N\\times D\}andY∈ℤD×NY\\in\\mathbb\{Z\}^\{D\\times N\}withN≥D18N\\geq D^\{18\}and entries of absolute valueNO\(1\)N^\{O\(1\)\}, it preprocesses them deterministically inO\(N2/D0\.063\)O\(N^\{2\}/D^\{0\.063\}\)time, after which it computes any entry ofXYXYinO\(D0\.437\)O\(D^\{0\.437\}\)time\. Section[5\.2](https://arxiv.org/html/2610.06783#S5.SS2)applies it to matrices whose entries are not0/10/1, and Section[5\.4](https://arxiv.org/html/2610.06783#S5.SS4)uses its queries online\.
The algorithms of Sections[5\.1](https://arxiv.org/html/2610.06783#S5.SS1),[5\.3](https://arxiv.org/html/2610.06783#S5.SS3), and[5\.4](https://arxiv.org/html/2610.06783#S5.SS4)are deterministic\. Those of Section[5\.2](https://arxiv.org/html/2610.06783#S5.SS2)are randomized \(Las Vegas\), because the reductions of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]that they use as black boxes are randomized\.
### 5\.1Directed APSP with small integer weights
Letω\(1,r,1\)\\omega\(1,r,1\)denote the exponent of multiplying ann×nrn\\times n^\{r\}matrix by annr×nn^\{r\}\\times nmatrix, and letμ\\mube the solution ofω\(1,μ,1\)=1\+2μ\\omega\(1,\\mu,1\)=1\+2\\mu\. Thenμ≥12\\mu\\geq\\frac\{1\}\{2\}, sinceω\(1,μ,1\)≥2\\omega\(1,\\mu,1\)\\geq 2, andμ<0\.5275\\mu<0\.5275by the bounds of\[[ADV\+25](https://arxiv.org/html/2610.06783#bib.bibx10)\]\. Zwick’s algorithm\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172)\]solves APSP in directed unweighted graphs inO~\(n2\+μ\)\\tilde\{O\}\(n^\{2\+\\mu\}\)time, and the Directed Unweighted APSP hypothesis\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66),[CVX23](https://arxiv.org/html/2610.06783#bib.bibx68),[Fis26](https://arxiv.org/html/2610.06783#bib.bibx82)\]asserts that no algorithm is polynomially faster\. We refute this in Theorem[34](https://arxiv.org/html/2610.06783#Thmtheorem34)\.
We revisit Theorem 3\.1 of Chan, Vassilevska Williams, and Xu\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66)\], which is just a presentation of Zwick’s algorithm\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172)\]as a reduction\. Zwick’s algorithm is typically used in its randomized form because the proof is simple, so the reduction in\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66)\]was stated in its randomized form\. However, following an argument by Yuster and Zwick\[[YZ05a](https://arxiv.org/html/2610.06783#bib.bibx170), Section 8\], the reduction has a deterministic version as well:
###### Theorem 33\(Zwick’s algorithm as a deterministic reduction\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172),[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66)\]\)\.
If the\(min,\+\)\(\\min,\+\)\-product of ann×nμn\\times n^\{\\mu\}matrix by annμ×nn^\{\\mu\}\\times nmatrix, both with integer entries of absolute value at mostO~\(n1−μ\)\\tilde\{O\}\(n^\{1\-\\mu\}\), can be computed inO\(n2\+μ−ε1\)O\(n^\{2\+\\mu\-\\varepsilon\_\{1\}\}\)time for a constantε1\>0\\varepsilon\_\{1\}\>0, then APSP in directednn\-vertex graphs with integer weights of absolute valuepolylogn\\polylog nand no negative cycles can be solved inO\(n2\+μ−ε′′\)O\(n^\{2\+\\mu\-\\varepsilon^\{\\prime\\prime\}\}\)time for a constantε′′\>0\\varepsilon^\{\\prime\\prime\}\>0that depends onε1\\varepsilon\_\{1\}andμ\\mu\. If the algorithm for the product is deterministic, then so is the algorithm for APSP\.
The randomized proof of\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66)\]follows the randomized version of Zwick’s algorithm, which takes random samples of vertices to hit the long shortest paths, so the algorithm that it produces is randomized\. Zwick\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172), Sections 6 and 7\]also gives a deterministic version of his algorithm, which constructs the hitting sets \(his bridging sets\) from witnesses of the products by a greedy hitting\-set computation, within the same running time up to polylogarithmic factors, and Yuster and Zwick\[[YZ05a](https://arxiv.org/html/2610.06783#bib.bibx170), Section 8\]announce, without details, a faster deterministic construction of bridging sets for their distance oracle\. Zwick’s construction lists a path withssvertices for each of then2n^\{2\}pairs, which is more than the reduction can afford whenssis large\. We therefore give a deterministic version of the reduction, which lists only walks with an endpoint in the previous hitting set, in the spirit of\[[YZ05a](https://arxiv.org/html/2610.06783#bib.bibx170)\]\. We believe that this is likely what Yuster and Zwick\[[YZ05a](https://arxiv.org/html/2610.06783#bib.bibx170)\]had in mind\.
###### Proof of Theorem[33](https://arxiv.org/html/2610.06783#Thmtheorem33)\.
The deterministic algorithm follows the randomized reduction, with two changes\. It constructs the hitting sets deterministically, by a hierarchy of bridging sets in the manner of Zwick\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172), Section 6\], and it computes the distances that this construction needs only to and from small sets of vertices, like the distance oracle of Yuster and Zwick\[[YZ05a](https://arxiv.org/html/2610.06783#bib.bibx170)\]\. The hypothesized algorithm for the\(min,\+\)\(\\min,\+\)\-product is used only for the values of its products\. \(This is convenient but not essential: the witness\-finding method of Seidel\[[Sei95](https://arxiv.org/html/2610.06783#bib.bibx145)\]and Alon, Galil, Margalit, and Naor\[[AGMN92](https://arxiv.org/html/2610.06783#bib.bibx15),[GM93](https://arxiv.org/html/2610.06783#bib.bibx91)\], derandomized by Alon and Naor\[[AN96](https://arxiv.org/html/2610.06783#bib.bibx24)\]and applied to\(min,\+\)\(\\min,\+\)\-products by Zwick\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172), Lemma 3\.3\], uses the product algorithm only on submatrices, so any deterministic algorithm for the product can be made to return witnesses at a polylogarithmic cost\.\) The price is a factornγn^\{\\gamma\}in the running time, for an arbitrarily small constantγ\>0\\gamma\>0, which the polynomial saving of the hypothesis absorbs\. Throughout,MMis the largest absolute weight, which is polylogarithmic, andO~\\tilde\{O\}hides polylogarithmic factors\.
*Bridges\.*For verticesuuandvv, letδ\(u,v\)\\delta\(u,v\)be the distance fromuutovv, and letη\(u,v\)\\eta\(u,v\)be the smallest number of edges on a shortest path fromuutovv\. Every subpath of a shortest path with the fewest edges is again a shortest path with the fewest edges\. For a thresholdttand a constantCC, a setB⊆VB\\subseteq Vis a*\(t,C\)\(t,C\)\-bridge*if every pair\(u,v\)\(u,v\)withη\(u,v\)≥t\\eta\(u,v\)\\geq thas a shortest*walk*fromuutovvthat passes through a vertex ofBBand has at mostCη\(u,v\)C\\eta\(u,v\)edges\. This is Zwick’s strong bridging set with a constant\-factor slack in the number of edges, and with walks in place of paths because a shortest walk may run around zero\-weight cycles\. LetR:=⌈nγ⌉R:=\\lceil n^\{\\gamma\}\\rceil\(soRRis tiny\!\) andti:=min\{Ri,n\}t\_\{i\}:=\\min\\\{R^\{i\},n\\\}fori=0,1,…,⌈1/γ⌉i=0,1,\\dots,\\lceil 1/\\gamma\\rceil\. We shall construct\(ti,Ci\)\(t\_\{i\},C\_\{i\}\)\-bridgesBiB\_\{i\}with\|Bi\|=O~\(n/ti\)\|B\_\{i\}\|=\\tilde\{O\}\(n/t\_\{i\}\), starting withB0=VB\_\{0\}=VandC0=1C\_\{0\}=1, whereCiC\_\{i\}is a constant that depends only onii\. The slackCiC\_\{i\}grows by a constant factor from each level to the next\. This is why the levels are a factornγn^\{\\gamma\}apart, so that there are onlyO\(1/γ\)O\(1/\\gamma\)of them, rather than a factor3/23/2apart as in Zwick’s algorithm\.
*The tablesEi\(T,H\)E\_\{i\}\(T,H\)\.*The distances to and from small sets of vertices are computed by the following routine\. Given the bridgesB0,…,BiB\_\{0\},\\dots,B\_\{i\}, a setTTofO~\(n/ti\)\\tilde\{O\}\(n/t\_\{i\}\)*target*vertices, and a*horizon*HHwithti≤H≤O\(Rti\)t\_\{i\}\\leq H\\leq O\(Rt\_\{i\}\), the routine returns two tables,Ei\(T,H\)\[V,T\]E\_\{i\}\(T,H\)\[V,T\]andEi\(T,H\)\[T,V\]E\_\{i\}\(T,H\)\[T,V\], with three properties: every finite entry is the weight of a walk that the routine represents explicitly, as described next; every represented walk hasO\(H\)O\(H\)edges, with a constant that depends onii; and the entry for\(u,v\)\(u,v\)isδ\(u,v\)\\delta\(u,v\)wheneverη\(u,v\)≤H\\eta\(u,v\)\\leq H\. The products in the routine are computed with the deterministic\(min,\+\)\(\\min,\+\)\-product algorithm with witnesses of Zwick\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172), Lemma 3\.3\], which finds the witnesses deterministically by the method of Alon and Naor\[[AN96](https://arxiv.org/html/2610.06783#bib.bibx24)\]\. A witness of an entry\(u,v\)\(u,v\)of a product is an indexkkat which its minimum is attained, and we store it with the entry\. The walk that the entry represents is then the concatenation of the walks represented by the entries\(u,k\)\(u,k\)and\(k,v\)\(k,v\)of the two factors, and it is listed, when needed, by following the stored witnesses recursively down to the entries of the weight matrix, which represent single edges; this takesO\(H\)O\(H\)time, because the walk is a concatenation ofO\(H\)O\(H\)such entries\. For a product in which one dimension isnnand the other two are at mostqq, with entries of absolute value at mostWW, that algorithm takesO~\(Wnqω−1\)\\tilde\{O\}\(Wnq^\{\\omega\-1\}\)time, by cutting the product inton/qn/qsquare products\.
The routine for level00takes the weight matrix with zeroes on the diagonal and squares itO\(logH\)O\(\\log H\)times, with the entries larger than2HM2HMreplaced by∞\\infty, and keeps the rows and columns ofTT\. The routine for leveli≥1i\\geq 1first calls the routine for leveli−1i\-1with the target setT∪BiT\\cup B\_\{i\}and the horizonL:=2CitiL:=2C\_\{i\}t\_\{i\}\. This call is okay, because\|T∪Bi\|=O~\(n/ti\)≤O~\(n/ti−1\)\|T\\cup B\_\{i\}\|=\\tilde\{O\}\(n/t\_\{i\}\)\\leq\\tilde\{O\}\(n/t\_\{i\-1\}\)andL=O\(Rti−1\)L=O\(Rt\_\{i\-1\}\)\. LetFFbe the pair of tables that it returns; they have exact distances for the pairs withη≤L\\eta\\leq L, and they have the entries ofV×\(T∪Bi\)V\\times\(T\\cup B\_\{i\}\)and\(T∪Bi\)×V\(T\\cup B\_\{i\}\)\\times V\. LetQQbe the smallest power of two aboveH/tiH/t\_\{i\}, and set the diagonal ofF\[Bi,Bi\]F\[B\_\{i\},B\_\{i\}\]to zero\. The routine computes, by repeated squaring,
Ei\(T,H\)\[V,T\]:=min\{F\[V,T\],F\[V,Bi\]⋆F\[Bi,Bi\]⋆Q⋆F\[Bi,T\]\},E\_\{i\}\(T,H\)\[V,T\]:=\\min\\bigl\\\{F\[V,T\],\\;F\[V,B\_\{i\}\]\\star F\[B\_\{i\},B\_\{i\}\]^\{\\star Q\}\\star F\[B\_\{i\},T\]\\bigr\\\},where⋆\\staris the\(min,\+\)\(\\min,\+\)\-product and the minimum is entrywise, and it computesEi\(T,H\)\[T,V\]E\_\{i\}\(T,H\)\[T,V\]symmetrically\.
The entry for a pair\(u,v\)\(u,v\)withv∈Tv\\in Tandη\(u,v\)≤H\\eta\(u,v\)\\leq His exact\. To see this, take a shortest path fromuutovvwith the fewest edges, and cut it into blocks oftit\_\{i\}edges followed by a remainder of fewer thantit\_\{i\}edges\. Each block is a shortest path with the fewest edges between its endpoints, so the bridge property ofBiB\_\{i\}replaces it by a shortest walk between the same endpoints that has at mostCitiC\_\{i\}t\_\{i\}edges and passes through a vertex ofBiB\_\{i\}; choose one such vertex in each block\. The result is a shortest walk fromuutovvthrough at mostH/tiH/t\_\{i\}chosen vertices ofBiB\_\{i\}, in whichuu, the chosen vertices, andvvare consecutively at mostL=2CitiL=2C\_\{i\}t\_\{i\}edges apart\. The tableFFis exact on these consecutive pairs, so the product above findsδ\(u,v\)\\delta\(u,v\)\. The represented walks haveO\(H\)O\(H\)edges, since those ofFFhaveO\(L\)O\(L\)edges and at mostQ\+2=O\(H/ti\)Q\+2=O\(H/t\_\{i\}\)of them are concatenated\. Every product of the routine has one dimensionnn, the two othersO~\(n/ti\)\\tilde\{O\}\(n/t\_\{i\}\), and entriesO\(HM\)=O~\(Rti\)O\(HM\)=\\tilde\{O\}\(Rt\_\{i\}\), so it takesO~\(Rti⋅n⋅\(n/ti\)ω−1\)≤O~\(nω\+γ\)\\tilde\{O\}\(Rt\_\{i\}\\cdot n\\cdot\(n/t\_\{i\}\)^\{\\omega\-1\}\)\\leq\\tilde\{O\}\(n^\{\\omega\+\\gamma\}\)time, and the recursion hasO\(1/γ\)O\(1/\\gamma\)levels\.
*The stages\.*The algorithm maintains a matrix of distance estimates, initially the weight matrix with zeros on the diagonal, and runs one stage for each leveli=0,1,…i=0,1,\\dotsuntilti\+1=nt\_\{i\+1\}=n\. The stage for leveliicomputes the tablesEi:=Ei\(Bi,Citi\+1\)E\_\{i\}:=E\_\{i\}\(B\_\{i\},C\_\{i\}t\_\{i\+1\}\), then the\(min,\+\)\(\\min,\+\)\-product
Ei\[V,Bi\]⋆Ei\[Bi,V\],E\_\{i\}\[V,B\_\{i\}\]\\star E\_\{i\}\[B\_\{i\},V\],and takes its entrywise minimum with the matrix of estimates\. Then, ifti\+1<nt\_\{i\+1\}<n, it constructsBi\+1B\_\{i\+1\}from the walks represented inEiE\_\{i\}, as described below\. The product fixes every pair\(u,v\)\(u,v\)withti≤η\(u,v\)≤ti\+1t\_\{i\}\\leq\\eta\(u,v\)\\leq t\_\{i\+1\}: the bridge property ofBiB\_\{i\}givesb∈Bib\\in B\_\{i\}withδ\(u,v\)=δ\(u,b\)\+δ\(b,v\)\\delta\(u,v\)=\\delta\(u,b\)\+\\delta\(b,v\)andη\(u,b\),η\(b,v\)≤Ciη\(u,v\)≤Citi\+1\\eta\(u,b\),\\eta\(b,v\)\\leq C\_\{i\}\\eta\(u,v\)\\leq C\_\{i\}t\_\{i\+1\}, so bothEi\[u,b\]E\_\{i\}\[u,b\]andEi\[b,v\]E\_\{i\}\[b,v\]are exact\. The stages thus find all distances, and every estimate is the weight of a walk, so none is too small\.
*The cost of the stages\.*Lets:=ti\+1s:=t\_\{i\+1\}\. The product of the stage for leveliihas middle dimension\|Bi\|=O~\(n/ti\)=O~\(Rn/s\)\|B\_\{i\}\|=\\tilde\{O\}\(n/t\_\{i\}\)=\\tilde\{O\}\(Rn/s\)and entriesO~\(s\)\\tilde\{O\}\(s\)\. CuttingBiB\_\{i\}intoO~\(R\)\\tilde\{O\}\(R\)groups of⌈n/s⌉\\lceil n/s\\rceilvertices turns it intoO~\(nγ\)\\tilde\{O\}\(n^\{\\gamma\}\)products of ann×⌈n/s⌉n\\times\\lceil n/s\\rceilmatrix by an⌈n/s⌉×n\\lceil n/s\\rceil\\times nmatrix with entriesO~\(s\)\\tilde\{O\}\(s\)\. Up to this grouping, these are the products of the randomized reduction, and the analysis of\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66), Theorem 3\.1\]applies to them\. Fix a small constanta\>0a\>0\. Whens≤n1−μ−as\\leq n^\{1\-\\mu\-a\}, the middle dimensionnr:=⌈n/s⌉n^\{r\}:=\\lceil n/s\\rceilhasr≥μ\+ar\\geq\\mu\+a, and fast rectangular matrix multiplication computes the product inO~\(snω\(1,r,1\)\)=O\(n2\+μ−ca\)\\tilde\{O\}\(s\\,n^\{\\omega\(1,r,1\)\}\)=O\(n^\{2\+\\mu\-ca\}\)time\[[Zwi02](https://arxiv.org/html/2610.06783#bib.bibx172), Lemma 3\.3\], for a constantc\>0c\>0, by the convexity ofω\(1,⋅,1\)\\omega\(1,\\cdot,1\), sinceω\(1,μ,1\)=1\+2μ\\omega\(1,\\mu,1\)=1\+2\\muandω<2\+μ\\omega<2\+\\mu\. Whens≥n1−μ\+as\\geq n^\{1\-\\mu\+a\}, the naive algorithm computes it inO\(n2⋅n/s\)=O\(n2\+μ−a\)O\(n^\{2\}\\cdot n/s\)=O\(n^\{2\+\\mu\-a\}\)time\. In between, the middle dimension is at mostnμ\+an^\{\\mu\+a\}and the entries areO~\(n1−μ\+a\)\\tilde\{O\}\(n^\{1\-\\mu\+a\}\); we cut the middle dimension into at mostnan^\{a\}pieces ofnμn^\{\\mu\}columns and pad each piece to an instance withn1\+O\(a\)n^\{1\+O\(a\)\}rows, so that its entries fit the range of the hypothesis, and the hypothesized algorithm computes it inO\(n2\+μ−ε1\+O\(a\)\)O\(n^\{2\+\\mu\-\\varepsilon\_\{1\}\+O\(a\)\}\)time\. Withaasmall enough, the product of every stage takesO\(n2\+μ\+γ−ε2\)O\(n^\{2\+\\mu\+\\gamma\-\\varepsilon\_\{2\}\}\)time, for a constantε2\>0\\varepsilon\_\{2\}\>0that depends onε1\\varepsilon\_\{1\}andμ\\mu\.
*The next bridge\.*Lets:=ti\+1<ns:=t\_\{i\+1\}<n\. The bridgeBi\+1B\_\{i\+1\}is read off the walks represented inEi=Ei\(Bi,Cis\)E\_\{i\}=E\_\{i\}\(B\_\{i\},C\_\{i\}s\), and this is where the small target set pays off\. These are2n\|Bi\|2n\|B\_\{i\}\|walks withO\(s\)O\(s\)edges each, so listing them all takesO~\(n\|Bi\|s\)=O~\(n2R\)≤O~\(n2\+γ\)\\tilde\{O\}\(n\|B\_\{i\}\|s\)=\\tilde\{O\}\(n^\{2\}R\)\\leq\\tilde\{O\}\(n^\{2\+\\gamma\}\)time, whereas listing a path for every pair of vertices, as Zwick’s construction does, would takeO\(n2s\)O\(n^\{2\}s\)time, which exceeds our budget at the large scales\. From each listed walk, erase the cycles, and keep the resulting path if it has at leasts/2s/2edges\. LetBi\+1B\_\{i\+1\}be a greedy hitting set of the vertex sets of the kept paths, each of which has more thans/2s/2vertices\. It hasO\(\(n/s\)logn\)O\(\(n/s\)\\log n\)vertices by the analysis of the greedy heuristic\[[Lov75](https://arxiv.org/html/2610.06783#bib.bibx122),[Chv79](https://arxiv.org/html/2610.06783#bib.bibx56)\], and it is computed in time linear in the total size of the sets, up to a logarithmic factor\.
ThisBi\+1B\_\{i\+1\}is an\(s,Ci\+1\)\(s,C\_\{i\+1\}\)\-bridge for a constantCi\+1C\_\{i\+1\}that depends only onii\. Consider first a pair\(x,y\)\(x,y\)withη\(x,y\)=s\\eta\(x,y\)=s\. The bridgeBiB\_\{i\}givesbbwithδ\(x,y\)=δ\(x,b\)\+δ\(b,y\)\\delta\(x,y\)=\\delta\(x,b\)\+\\delta\(b,y\)andη\(x,b\)\+η\(b,y\)≤Cis\\eta\(x,b\)\+\\eta\(b,y\)\\leq C\_\{i\}s, so the entries ofEiE\_\{i\}for\(x,b\)\(x,b\)and\(b,y\)\(b,y\)are exact, and the two walks that represent them are shortest walks\. A cycle on a shortest walk has weight zero, so the two paths obtained by erasing the cycles are still shortest, and their concatenation is a shortest walk fromxxtoyywithO\(s\)O\(s\)edges\. This walk has at leastssedges, since otherwise erasing its cycles would give a shortest path fromxxtoyywith fewer thanη\(x,y\)\\eta\(x,y\)edges\. So one of the two paths has at leasts/2s/2edges and was kept, andBi\+1B\_\{i\+1\}contains one of its vertices, which lies on the concatenated walk\. For a pair withη\(x,y\)\>s\\eta\(x,y\)\>s, apply this to the firstssedges of a shortest path fromxxtoyywith the fewest edges, and keep the rest of that path; the walk obtained has at mostCi\+1s\+η\(x,y\)−s≤Ci\+1η\(x,y\)C\_\{i\+1\}s\+\\eta\(x,y\)\-s\\leq C\_\{i\+1\}\\eta\(x,y\)edges\.
*Running time\.*There areO\(1/γ\)O\(1/\\gamma\)stages\. Each computes its tables inO~\(nω\+γ\)\\tilde\{O\}\(n^\{\\omega\+\\gamma\}\)time, its product inO\(n2\+μ\+γ−ε2\)O\(n^\{2\+\\mu\+\\gamma\-\\varepsilon\_\{2\}\}\)time, and its bridge inO~\(n2\+γ\)\\tilde\{O\}\(n^\{2\+\\gamma\}\)time\. Choosingγ\\gammasmaller than bothε2/2\\varepsilon\_\{2\}/2and\(2\+μ−ω\)/2\(2\+\\mu\-\\omega\)/2gives the running timeO\(n2\+μ−ε′′\)O\(n^\{2\+\\mu\-\\varepsilon^\{\\prime\\prime\}\}\)for a constantε′′\>0\\varepsilon^\{\\prime\\prime\}\>0, and every step is deterministic\. ∎
We compose the known reduction with the deterministic\(min,\+\)\(\\min,\+\)\-product algorithm of Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)\.
###### Theorem 34\(Directed unweighted APSP\)\.
There is a constantε′′\>0\\varepsilon^\{\\prime\\prime\}\>0such that APSP in directed unweightednn\-vertex graphs, and more generally in directednn\-vertex graphs with integer weights of absolute value at most\(logn\)c\(\\log n\)^\{c\}and no negative cycles, for any constantcc, can be solved inO\(n2\+μ−ε′′\)O\(n^\{2\+\\mu\-\\varepsilon^\{\\prime\\prime\}\}\)time by a deterministic algorithm\.
###### Proof\.
Cut then×nμn\\times n^\{\\mu\}matrix inton1−μn^\{1\-\\mu\}blocks ofnμn^\{\\mu\}consecutive rows, and thenμ×nn^\{\\mu\}\\times nmatrix inton1−μn^\{1\-\\mu\}blocks ofnμn^\{\\mu\}consecutive columns\. The\(min,\+\)\(\\min,\+\)\-product then consists ofn2−2μn^\{2\-2\\mu\}products of twonμ×nμn^\{\\mu\}\\times n^\{\\mu\}matrices, one for each pair of blocks\. Their entries have absolute valueO~\(n1−μ\)≤O~\(nμ\)\\tilde\{O\}\(n^\{1\-\\mu\}\)\\leq\\tilde\{O\}\(n^\{\\mu\}\), becauseμ≥12\\mu\\geq\\frac\{1\}\{2\}, so Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)computes each of them inO~\(\(nμ\)3−ε′/3\)\\tilde\{O\}\(\(n^\{\\mu\}\)^\{3\-\\varepsilon^\{\\prime\}/3\}\)time, and all of them inO~\(n2\+μ−με′/3\)\\tilde\{O\}\(n^\{2\+\\mu\-\\mu\\varepsilon^\{\\prime\}/3\}\)time\. This isO\(n2\+μ−ε1\)O\(n^\{2\+\\mu\-\\varepsilon\_\{1\}\}\)for any constantε1<με′/3\\varepsilon\_\{1\}<\\mu\\varepsilon^\{\\prime\}/3, so\[[CVX21](https://arxiv.org/html/2610.06783#bib.bibx66), Theorem 3\.1\]applies, in the deterministic form of Theorem[33](https://arxiv.org/html/2610.06783#Thmtheorem33), since the algorithm of Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)is deterministic\. ∎
### 5\.23SUM, APSP, and Exact Triangle with real inputs
###### Theorem 35\(Real inputs\)\.
In the real RAM in which the only operations allowed on real numbers are comparisons, additions, and subtractions, Las Vegas algorithms solve the following problems on real inputs:33SUM onnnnumbers inO\(n1\.998\)O\(n^\{1\.998\}\)expected time, and the\(min,\+\)\(\\min,\+\)\-product of twon×nn\\times nmatrices, APSP with no negative cycles, and Exact Triangle inO\(n2\.998\)O\(n^\{2\.998\}\)expected time\. The bounds also hold with probability1−n−c1\-n^\{\-c\}for any constantcc\.
The reductions are by Chan, Vassilevska Williams, and Xu\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\], who reduce the real\-valued problems to the counting version of All\-Edges Sparse Triangle on graphs withmmedges \(and real APSP also to the Boolean version\)\. Our version of All\-Edges Sparse Triangle in Corollary[16](https://arxiv.org/html/2610.06783#Thmtheorem16)needs lopsided sparse graphs\. To deal with this slight change, we follow the reductions of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]down to the point where the All\-Edges Sparse Triangle oracle is called, and change the call\. At that point, the reductions only need the oracle to compute*comparison counts*, which we define next\. These come from Fredman’s trick\[[Fre76](https://arxiv.org/html/2610.06783#bib.bibx87)\]:a′\+b′<a\+ba^\{\\prime\}\+b^\{\\prime\}<a\+bif and only ifa′−a<b−b′a^\{\\prime\}\-a<b\-b^\{\\prime\}\. This turns a comparison of two sums into a comparison of a number that depends only on the row against a number that depends only on the column\.
We first define comparison counts, then restate the reductions of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]as reductions to comparison counts \(Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)\), and then solve the comparison counts problem: following\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\], Lemma[37](https://arxiv.org/html/2610.06783#Thmtheorem37)reduces it to the wanted entries of one thin matrix product using Matoušek’s technique for the dominance product\[[Mat91](https://arxiv.org/html/2610.06783#bib.bibx129)\], and Corollary[38](https://arxiv.org/html/2610.06783#Thmtheorem38)applies Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)to that product\. The proof of Theorem[35](https://arxiv.org/html/2610.06783#Thmtheorem35)then adds up the running times\. The only randomized steps are in the reductions of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\], and the algorithms never output a wrong answer, so they are Las Vegas\.
##### Comparison counts\.
We are givennn*row lists*: for everyr∈\[n\]r\\in\[n\], a listℛr\\mathcal\{R\}\_\{r\}of at mostddreal numbersxx, where eachx∈ℛrx\\in\\mathcal\{R\}\_\{r\}has a*color*χ\(x\)∈\[d\]\\chi\(x\)\\in\[d\]associated with it\.
Similarly, we are givennn*column lists*: for everyc∈\[n\]c\\in\[n\], a list𝒞c\\mathcal\{C\}\_\{c\}of at mostddreal numbersyy, eachy∈𝒞cy\\in\\mathcal\{C\}\_\{c\}again with a colorχ\(y\)∈\[d\]\\chi\(y\)\\in\[d\]associated with it\.
Given a setP⊆\[n\]2P\\subseteq\[n\]^\{2\}of \(row, column\) pairs, we want, for every\(r,c\)∈P\(r,c\)\\in P, the number
γ\(r,c\):=\|\{\(x,y\):x∈ℛr,y∈𝒞c,χ\(x\)=χ\(y\),x<y\}\|\.\\gamma\(r,c\):=\\big\|\\\{\(x,y\):\\ x\\in\\mathcal\{R\}\_\{r\},\\ y\\in\\mathcal\{C\}\_\{c\},\\ \\chi\(x\)=\\chi\(y\),\\ x<y\\\}\\big\|\.
##### The reductions\.
We follow the reductions of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]down to their two counting problems\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67), Problems 4\.1 and 4\.5\], which we define in the proof of Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)below, and turn every call of a counting problem into comparison counts, in place of the triangle\-counting instances of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67), Lemmas 4\.3 and 4\.7\]\. Throughout,d∈\[n\]d\\in\[n\]is a parameter, which the proof of Theorem[35](https://arxiv.org/html/2610.06783#Thmtheorem35)chooses\.
###### Lemma 36\(after Chan, Vassilevska Williams, and Xu\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]\)\.
Let1≤d≤n1\\leq d\\leq n\.
1. \(a\)The\(min,\+\)\(\\min,\+\)\-product of twon×nn\\times nreal matrices, APSP with real edge weights and no negative cycles onnnvertices, and Exact Triangle with real weights onnnvertices reduce, with Las Vegas randomization, toO~\(n/d\)\\tilde\{O\}\(n/d\)*counting calls*andO~\(n3/d\)\\tilde\{O\}\(n^\{3\}/d\)further time\. A counting call consists ofddcomparison counts, each withnnrow lists andnncolumn lists of at mostddnumbers, with at most one number of each color in a list, and with pair setsP1,…,PdP\_\{1\},\\dots,P\_\{d\}satisfying∑k\|Pk\|=n2\\sum\_\{k\}\|P\_\{k\}\|=n^\{2\}; forming its lists costsO\(nd2\)O\(nd^\{2\}\)subtractions\.
2. \(b\)33SUM onnnreal numbers reduces, with Las Vegas randomization, to polylogarithmically many comparison counts, each withnnrow lists andnncolumn lists of at mostddnumbers, all of the same color, and a pair setPPof sizeO\(n2/d\)O\(n^\{2\}/d\), andO~\(n2/d\)\\tilde\{O\}\(n^\{2\}/d\)further time; forming the lists of a comparison count costsO\(nd\)O\(nd\)subtractions\.
A comparison count may have≤\\leqin place of<<\. The only operations on real numbers performed by the reductions are comparisons, additions, and subtractions\.
###### Proof\.
*\(a\)\(min,\+\)\(\\min,\+\)\-product, APSP, and Exact Triangle\.*LetA,B,C∈ℝn×nA,B,C\\in\\mathbb\{R\}^\{n\\times n\}\. As in\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67), Section 3\.2\], cutAAinton/dn/dblocksA′∈ℝn×dA^\{\\prime\}\\in\\mathbb\{R\}^\{n\\times d\}ofddconsecutive columns, andBBinto the corresponding blocksB′∈ℝd×nB^\{\\prime\}\\in\\mathbb\{R\}^\{d\\times n\}ofddconsecutive rows\. For each pair\(A′,B′\)\(A^\{\\prime\},B^\{\\prime\}\)we solve\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67), Problem 3\.2\]: find, for every\(i,j\)\(i,j\), the predecessor and the successor ofC\[i,j\]C\[i,j\]among theddsumsA′\[i,k\]\+B′\[k,j\]A^\{\\prime\}\[i,k\]\+B^\{\\prime\}\[k,j\], where a sum equal toC\[i,j\]C\[i,j\]counts as its predecessor\. For Exact Triangle,A\[i,k\]:=w\(i,k\)A\[i,k\]:=w\(i,k\),B\[k,j\]:=w\(k,j\)B\[k,j\]:=w\(k,j\), andC\[i,j\]:=−w\(i,j\)C\[i,j\]:=\-w\(i,j\), and there is a triangle of weight zero if and only if, in some block, someC\[i,j\]C\[i,j\]is its own predecessor\. For the\(min,\+\)\(\\min,\+\)\-product ofAAandBB, we take everyC\[i,j\]C\[i,j\]smaller than all the sums, for instanceC\[i,j\]:=minkA\[i,k\]\+minkB\[k,j\]−1C\[i,j\]:=\\min\_\{k\}A\[i,k\]\+\\min\_\{k\}B\[k,j\]\-1\. Then the successor ofC\[i,j\]C\[i,j\]in a block is the smallest sum of the block, and the product is the entrywise minimum over then/dn/dblocks, which costsO\(n3/d\)O\(n^\{3\}/d\)comparisons\. APSP with real weights and no negative cycles can be computed by successive squaring of the weight matrix, performing⌈log2n⌉\\lceil\\log\_\{2\}n\\rceilsuch products\.
Fix a pair\(A′,B′\)\(A^\{\\prime\},B^\{\\prime\}\)\. We solve the following*counting problem*\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67), Problem 4\.1\]: we are given a*pivot*kij∈\[d\]k\_\{ij\}\\in\[d\]for every\(i,j\)∈\[n\]2\(i,j\)\\in\[n\]^\{2\}and a subsetS⊆\[d\]S\\subseteq\[d\], and we must count, for every\(i,j\)\(i,j\), the indicesk′∈Sk^\{\\prime\}\\in SwithA′\[i,k′\]\+B′\[k′,j\]<A′\[i,kij\]\+B′\[kij,j\]A^\{\\prime\}\[i,k^\{\\prime\}\]\+B^\{\\prime\}\[k^\{\\prime\},j\]<A^\{\\prime\}\[i,k\_\{ij\}\]\+B^\{\\prime\}\[k\_\{ij\},j\]; a call of the problem may also have≤\\leqin place of<<\.
By Lemmas 3\.4 and 4\.2 of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\], the problem for one pair\(A′,B′\)\(A^\{\\prime\},B^\{\\prime\}\)reduces, with Las Vegas randomization, to polylogarithmically many calls of the counting problem, andO~\(n2\)\\tilde\{O\}\(n^\{2\}\)further time: Lemma 3\.4 finds the predecessors and successors by a randomized search that repeatedly asks, for every\(i,j\)\(i,j\), for a sum strictly between two given sums, and Lemma 4\.2 finds these sums by counting, for each of the two given sums, the sums below it, and by sampling at random\. Lemma 4\.3 of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]turns a call intoO\(d\)O\(d\)triangle\-counting instances; we turn it intoddcomparison counts instead\.
Following\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\], we group the pairs by their pivot,Pk:=\{\(i,j\):kij=k\}P\_\{k\}:=\\\{\(i,j\):k\_\{ij\}=k\\\}\. Fork∈\[d\]k\\in\[d\], let the row listℛi\\mathcal\{R\}\_\{i\}consist of the numbersA′\[i,k′\]−A′\[i,k\]A^\{\\prime\}\[i,k^\{\\prime\}\]\-A^\{\\prime\}\[i,k\],k′∈Sk^\{\\prime\}\\in S, each with colork′k^\{\\prime\}, and let the column list𝒞j\\mathcal\{C\}\_\{j\}consist of the numbersB′\[k,j\]−B′\[k′,j\]B^\{\\prime\}\[k,j\]\-B^\{\\prime\}\[k^\{\\prime\},j\],k′∈Sk^\{\\prime\}\\in S, again with colork′k^\{\\prime\}\.
By Fredman’s trick,A′\[i,k′\]\+B′\[k′,j\]<A′\[i,k\]\+B′\[k,j\]A^\{\\prime\}\[i,k^\{\\prime\}\]\+B^\{\\prime\}\[k^\{\\prime\},j\]<A^\{\\prime\}\[i,k\]\+B^\{\\prime\}\[k,j\]if and only ifA′\[i,k′\]−A′\[i,k\]<B′\[k,j\]−B′\[k′,j\]A^\{\\prime\}\[i,k^\{\\prime\}\]\-A^\{\\prime\}\[i,k\]<B^\{\\prime\}\[k,j\]\-B^\{\\prime\}\[k^\{\\prime\},j\], where both numbers in the latter comparison have colork′k^\{\\prime\}\.
Thus the count of a pair\(i,j\)∈Pk\(i,j\)\\in P\_\{k\}is the comparison countγ\(i,j\)\\gamma\(i,j\)of these lists withP:=PkP:=P\_\{k\}\. Forming the lists costs usO\(nd\)O\(nd\)subtractions for eachkk\. Over then/dn/dpairs\(A′,B′\)\(A^\{\\prime\},B^\{\\prime\}\), and the⌈log2n⌉\\lceil\\log\_\{2\}n\\rceilproducts in the case of APSP, this givesO~\(n/d\)\\tilde\{O\}\(n/d\)counting calls andO~\(n3/d\)\\tilde\{O\}\(n^\{3\}/d\)additional time, which includes theO\(n3/d\)O\(n^\{3\}/d\)comparisons of the entrywise minimum\.
*\(b\)33SUM\.*LetA,B,CA,B,Cbe sets ofnnreals, the problem asks whethera\+b=ca\+b=cfor somea∈Aa\\in A,b∈Bb\\in B, andc∈Cc\\in C\. The33SUM version with one set anda\+b\+c=0a\+b\+c=0reduces to this version in the standard way\.
Now, sortAAandBB, and cut them inton/dn/dconsecutive blocksA1,…,An/dA\_\{1\},\\dots,A\_\{n/d\}andB1,…,Bn/dB\_\{1\},\\dots,B\_\{n/d\}ofddnumbers each, writingAi\[k\]A\_\{i\}\[k\]for thekk\-th number ofAiA\_\{i\}\. Here the counting problem\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67), Problem 4\.5\]is the following: we are given a set𝒬\\mathcal\{Q\}ofO\(n2/d\)O\(n^\{2\}/d\)quadruples\(i,j,k,ℓ\)\(i,j,k,\\ell\), and we must count, for every\(i,j,k,ℓ\)∈𝒬\(i,j,k,\\ell\)\\in\\mathcal\{Q\}, the pairs\(k′,ℓ′\)∈\[d\]2\(k^\{\\prime\},\\ell^\{\\prime\}\)\\in\[d\]^\{2\}withAi\[k′\]\+Bj\[ℓ′\]<Ai\[k\]\+Bj\[ℓ\]A\_\{i\}\[k^\{\\prime\}\]\+B\_\{j\}\[\\ell^\{\\prime\}\]<A\_\{i\}\[k\]\+B\_\{j\}\[\\ell\]; again, a call may have≤\\leqin place of<<, and it may restrictk′k^\{\\prime\}andℓ′\\ell^\{\\prime\}to subsets of\[d\]\[d\]\. By Section 3\.3 and Lemmas 3\.9 and 4\.6 of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\],33SUM reduces, with Las Vegas randomization, to polylogarithmically many calls of this counting problem, andO~\(n2/d\)\\tilde\{O\}\(n^\{2\}/d\)additional time\. By Fredman’s trick, the condition isAi\[k′\]−Ai\[k\]<Bj\[ℓ\]−Bj\[ℓ′\]A\_\{i\}\[k^\{\\prime\}\]\-A\_\{i\}\[k\]<B\_\{j\}\[\\ell\]\-B\_\{j\}\[\\ell^\{\\prime\}\]\. So a call is one comparison count: the rows are thennpairs\(i,k\)\(i,k\)and the columns are thennpairs\(j,ℓ\)\(j,\\ell\), the row listℛ\(i,k\)\\mathcal\{R\}\_\{\(i,k\)\}consists of theddnumbersAi\[k′\]−Ai\[k\]A\_\{i\}\[k^\{\\prime\}\]\-A\_\{i\}\[k\],k′∈\[d\]k^\{\\prime\}\\in\[d\], the column list𝒞\(j,ℓ\)\\mathcal\{C\}\_\{\(j,\\ell\)\}of theddnumbersBj\[ℓ\]−Bj\[ℓ′\]B\_\{j\}\[\\ell\]\-B\_\{j\}\[\\ell^\{\\prime\}\],ℓ′∈\[d\]\\ell^\{\\prime\}\\in\[d\], all numbers have the same color, andP:=𝒬P:=\\mathcal\{Q\}\. A restriction ofk′k^\{\\prime\}or ofℓ′\\ell^\{\\prime\}deletes numbers from the lists\. Forming the lists can be done usingO\(nd\)O\(nd\)subtractions\. ∎
##### Solving comparison counts\.
In the comparison counts of Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)\(a\), every list has at most one number of each color, so thatγ\(r,c\)\\gamma\(r,c\)is the number of colorskkwithA\[r,k\]<B\[k,c\]A\[r,k\]<B\[k,c\], whereA\[r,k\]A\[r,k\]is the number of colorkkinℛr\\mathcal\{R\}\_\{r\}andB\[k,c\]B\[k,c\]the one in𝒞c\\mathcal\{C\}\_\{c\}\(a color missing from either list is skipped\); this is the dominance product of then×dn\\times dmatrixAAand thed×nd\\times nmatrixBBat the positions inPP\. In those of Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)\(b\), all numbers have the same color, andγ\(r,c\)\\gamma\(r,c\)is the number of pairsx<yx<ybetween the two lists\. Merging the two sorted lists of every pair inPPtakesO\(\|P\|d\)O\(\|P\|d\)time\. To improve on this, we utilize Matoušek’s technique for the dominance product\[[Mat91](https://arxiv.org/html/2610.06783#bib.bibx129)\], which counts the pairs that lie in different blocks of the sorted order by one thin matrix product, and the pairs in the same block directly\.
###### Lemma 37\(after Matoušek\[[Mat91](https://arxiv.org/html/2610.06783#bib.bibx129)\]\)\.
Lets≥1s\\geq 1be an integer andD′′:=⌈2nd/s⌉\+dD^\{\\prime\\prime\}:=\\lceil 2nd/s\\rceil\+d\. Given row listsℛr\\mathcal\{R\}\_\{r\}and column lists𝒞c\\mathcal\{C\}\_\{c\}as above and a setP⊆\[n\]2P\\subseteq\[n\]^\{2\}, we can build matricesX∈\{0,…,d\}n×D′′X\\in\\\{0,\\dots,d\\\}^\{n\\times D^\{\\prime\\prime\}\}andY∈\{0,…,d\}D′′×nY\\in\\\{0,\\dots,d\\\}^\{D^\{\\prime\\prime\}\\times n\}and compute integersγ2\(r,c\)\\gamma\_\{2\}\(r,c\),\(r,c\)∈P\(r,c\)\\in P, with
γ\(r,c\)=\(XY\)\[r,c\]\+γ2\(r,c\)for every\(r,c\)∈P,\\gamma\(r,c\)=\(XY\)\[r,c\]\+\\gamma\_\{2\}\(r,c\)\\qquad\\text\{for every \}\(r,c\)\\in P,deterministically inO\(nD′′\+\(\|P\|\+nds\+ds2\)logn\)O\(nD^\{\\prime\\prime\}\+\(\|P\|\+nds\+ds^\{2\}\)\\log n\)time\. The only operations on real numbers are the comparisons made when sorting the numbers of each color\. The same holds with≤\\leqin place of<<in the definition ofγ\\gamma\.
###### Proof\.
For each colorkk, sort the numbers of colorkkof all the lists, and break ties so that, among equal numbers, those from column lists precede those from row lists\. Letpos\(x\)\\mathrm\{pos\}\(x\)be the position ofxxin this order\. Forxxfrom a row list andyyfrom a column list of the same color,x<yx<yholds if and only ifpos\(x\)<pos\(y\)\\mathrm\{pos\}\(x\)<\\mathrm\{pos\}\(y\)\. \(For≤\\leq, we reverse the tie\-breaking rule\.\) Cut the order into*blocks*ofssconsecutive positions, and letblk\(x\):=⌊pos\(x\)/s⌋\\mathrm\{blk\}\(x\):=\\lfloor\\mathrm\{pos\}\(x\)/s\\rfloor\. Thenx<yx<yholds if and only if eitherblk\(x\)<blk\(y\)\\mathrm\{blk\}\(x\)<\\mathrm\{blk\}\(y\), orblk\(x\)=blk\(y\)\\mathrm\{blk\}\(x\)=\\mathrm\{blk\}\(y\)andpos\(x\)<pos\(y\)\\mathrm\{pos\}\(x\)<\\mathrm\{pos\}\(y\)\. As in Matoušek’s algorithm, we count the pairs of the first kind, which lie in different blocks, by a matrix product, and the pairs of the second kind, which lie in the same block, by brute force\.
*Different blocks\.*The lists contain at most2nd2ndnumbers in all, so there are at most2nd/s\+d≤D′′2nd/s\+d\\leq D^\{\\prime\\prime\}pairs \(color, block\), and we index the columns ofXXand the rows ofYYby the pairs, padding with zeros if needed\. LetX\[r,\(k,β\)\]X\[r,\(k,\\beta\)\]be the number of numbers of colorkkinℛr\\mathcal\{R\}\_\{r\}that lie in blockβ\\beta, and letY\[\(k,β\),c\]Y\[\(k,\\beta\),c\]be the number of numbers of colorkkin𝒞c\\mathcal\{C\}\_\{c\}that lie in a block afterβ\\beta\. Then\(XY\)\[r,c\]=∑\(k,β\)X\[r,\(k,β\)\]Y\[\(k,β\),c\]\(XY\)\[r,c\]=\\sum\_\{\(k,\\beta\)\}X\[r,\(k,\\beta\)\]\\,Y\[\(k,\\beta\),c\]is the number of pairs\(x,y\)\(x,y\)of the same color withblk\(x\)<blk\(y\)\\mathrm\{blk\}\(x\)<\\mathrm\{blk\}\(y\), as required, and the entries ofXXandYYare between00andddbecause a list has at mostddnumbers\. We useO\(ndlogn\)O\(nd\\log n\)comparisons to sort and then fill inXXandYYinO\(nD′′\)O\(nD^\{\\prime\\prime\}\)time\.
*Same block\.*For every colorkkand blockβ\\beta, letIIbe the numbersxxof row lists in the block, each with its row, and letJJbe the numbersyyof column lists in the block, each with its column, so that\|I\|\+\|J\|≤s\|I\|\+\|J\|\\leq s\. For every\(x,y\)∈I×J\(x,y\)\\in I\\times Jwithpos\(x\)<pos\(y\)\\mathrm\{pos\}\(x\)<\\mathrm\{pos\}\(y\)whose row and column form a pair\(r,c\)∈P\(r,c\)\\in P\(this can be tested via a binary search inPPafter it is sorted\), we add11toγ2\(r,c\)\\gamma\_\{2\}\(r,c\)\. Thenγ2\\gamma\_\{2\}counts the pairs of the second kind\. Since\|I\|\|J\|≤s2/4\|I\|\|J\|\\leq s^\{2\}/4and there are at most2nd/s\+d2nd/s\+dblocks, we enumerate at most\(2nd/s\+d\)s2/4≤nds\+ds2\(2nd/s\+d\)s^\{2\}/4\\leq nds\+ds^\{2\}pairs\(x,y\)\(x,y\)\. Together with sortingPPand outputting the\|P\|\|P\|integersγ2\(r,c\)\\gamma\_\{2\}\(r,c\), this takesO\(\(\|P\|\+nds\+ds2\)logn\)O\(\(\|P\|\+nds\+ds^\{2\}\)\\log n\)time\. ∎
###### Corollary 38\.
Letd≤n1/40d\\leq n^\{1/40\}, and letnnbe larger than a suitable constant\. Given row listsℛr\\mathcal\{R\}\_\{r\}and column lists𝒞c\\mathcal\{C\}\_\{c\}as above and a setP⊆\[n\]2P\\subseteq\[n\]^\{2\}, the countsγ\(r,c\)\\gamma\(r,c\),\(r,c\)∈P\(r,c\)\\in P, with<<or with≤\\leq, can be computed deterministically in
O\(\|P\|n0\.0229\+n2/d0\.126\+n2−1/440logn\)O\\big\(\|P\|\\,n^\{0\.0229\}\+n^\{2\}/d^\{0\.126\}\+n^\{2\-1/440\}\\log n\\big\)time, by an algorithm whose only operations on real numbers are comparisons\.
###### Proof\.
Apply Lemma[37](https://arxiv.org/html/2610.06783#Thmtheorem37)withs:=⌈n1−1/440/d⌉s:=\\lceil n^\{1\-1/440\}/d\\rceil, so thatD′′≤2d2n1/440\+d\+1≤3d2n1/440D^\{\\prime\\prime\}\\leq 2d^\{2\}n^\{1/440\}\+d\+1\\leq 3d^\{2\}n^\{1/440\}, and pad the product to the inner dimensionD∗:=⌈3d2n1/440⌉D^\{\*\}:=\\lceil 3d^\{2\}n^\{1/440\}\\rceilwith zero columns ofXXand zero rows ofYY\. Sinced≤n1/40d\\leq n^\{1/40\}, we haveD∗≤4n23/440D^\{\*\}\\leq 4n^\{23/440\}, so\(D∗\)18≤418n0\.941≤n\(D^\{\*\}\)^\{18\}\\leq 4^\{18\}n^\{0\.941\}\\leq n, and Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)withN:=nN:=nandD:=D∗D:=D^\{\*\}computes\(XY\)\[r,c\]\(XY\)\[r,c\]for all\(r,c\)∈P\(r,c\)\\in Pdeterministically inO\(\|P\|\(D∗\)0\.437\+n2/\(D∗\)0\.063\)O\(\|P\|\(D^\{\*\}\)^\{0\.437\}\+n^\{2\}/\(D^\{\*\}\)^\{0\.063\}\)time\. Here\(D∗\)0\.437≤40\.437n0\.437⋅23/440=O\(n0\.0229\)\(D^\{\*\}\)^\{0\.437\}\\leq 4^\{0\.437\}n^\{0\.437\\cdot 23/440\}=O\(n^\{0\.0229\}\)and\(D∗\)0\.063≥\(3d2\)0\.063≥d0\.126\(D^\{\*\}\)^\{0\.063\}\\geq\(3d^\{2\}\)^\{0\.063\}\\geq d^\{0\.126\}\.
SincenD∗=O\(n1\.06\)nD^\{\*\}=O\(n^\{1\.06\}\),nds≤2n2−1/440nds\\leq 2n^\{2\-1/440\}andds2≤4n2−1/440ds^\{2\}\\leq 4n^\{2\-1/440\}, the time of Lemma[37](https://arxiv.org/html/2610.06783#Thmtheorem37)itself is
O\(nD∗\+\(\|P\|\+nds\+ds2\)logn\)=O\(\|P\|n0\.0229\+n2−1/440logn\)\.O\(nD^\{\*\}\+\(\|P\|\+nds\+ds^\{2\}\)\\log n\)=O\(\|P\|\\,n^\{0\.0229\}\+n^\{2\-1/440\}\\log n\)\.∎
###### Proof of Theorem[35](https://arxiv.org/html/2610.06783#Thmtheorem35)\.
Letd:=⌊n1/40⌋d:=\\lfloor n^\{1/40\}\\rfloor, apply Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)with thisdd, and answer every comparison count by Corollary[38](https://arxiv.org/html/2610.06783#Thmtheorem38)\.
*\(min,\+\)\(\\min,\+\)\-product, APSP, and Exact Triangle\.*By Corollary[38](https://arxiv.org/html/2610.06783#Thmtheorem38), theddcomparison counts of a counting call cost
∑k∈\[d\]O\(\|Pk\|n0\.0229\+n2/d0\.126\+n2−1/440logn\)=O\(n2\.0229logn\),\\sum\_\{k\\in\[d\]\}O\\big\(\|P\_\{k\}\|\\,n^\{0\.0229\}\+n^\{2\}/d^\{0\.126\}\+n^\{2\-1/440\}\\log n\\big\)=O\(n^\{2\.0229\}\\log n\),since∑k\|Pk\|=n2\\sum\_\{k\}\|P\_\{k\}\|=n^\{2\},d⋅n2/d0\.126≤n2\+0\.874/40≤n2\.0219d\\cdot n^\{2\}/d^\{0\.126\}\\leq n^\{2\+0\.874/40\}\\leq n^\{2\.0219\}, andd⋅n2−1/440≤n2\+1/40−1/440≤n2\.0228d\\cdot n^\{2\-1/440\}\\leq n^\{2\+1/40\-1/440\}\\leq n^\{2\.0228\}; forming the lists costsO\(nd2\)=O\(n1\.05\)O\(nd^\{2\}\)=O\(n^\{1\.05\}\)\. So theO~\(n/d\)\\tilde\{O\}\(n/d\)counting calls of Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)\(a\) cost
O~\(\(n/d\)n2\.0229\)=O~\(n3−1/40\+0\.0229\)≤O\(n2\.998\)\\tilde\{O\}\\big\(\(n/d\)\\,n^\{2\.0229\}\\big\)=\\tilde\{O\}\\big\(n^\{3\-1/40\+0\.0229\}\\big\)\\leq O\(n^\{2\.998\}\)expected time, and its additional time isO~\(n3/d\)=O~\(n2\.975\)\\tilde\{O\}\(n^\{3\}/d\)=\\tilde\{O\}\(n^\{2\.975\}\)\.
*33SUM\.*By Corollary[38](https://arxiv.org/html/2610.06783#Thmtheorem38), a comparison count of Lemma[36](https://arxiv.org/html/2610.06783#Thmtheorem36)\(b\) costs
O\(n2dn0\.0229\+n2d0\.126\+n2−1/440logn\)=O\(n2−1/40\+0\.0229logn\)=O\(n1\.9979logn\),O\\Big\(\\frac\{n^\{2\}\}\{d\}\\,n^\{0\.0229\}\+\\frac\{n^\{2\}\}\{d^\{0\.126\}\}\+n^\{2\-1/440\}\\log n\\Big\)=O\\big\(n^\{2\-1/40\+0\.0229\}\\log n\\big\)=O\(n^\{1\.9979\}\\log n\),so33SUM can also be solved inO~\(n1\.9979\)≤O\(n1\.998\)\\tilde\{O\}\(n^\{1\.9979\}\)\\leq O\(n^\{1\.998\}\)expected time\.
*Las Vegas, and high probability\.*The reductions of\[[CVX22](https://arxiv.org/html/2610.06783#bib.bibx67)\]never return a wrong answer and Corollary[38](https://arxiv.org/html/2610.06783#Thmtheorem38)is deterministic, so the output is always correct, and only the running time is random\. The bounds also hold with probability1−n−c1\-n^\{\-c\}for any constantcc: we stop a run that exceeds twice the bound on its expected time and start again, andclog2nc\\log\_\{2\}nruns all fail with probability at mostn−cn^\{\-c\}\. ∎
### 5\.3Zero\-Weight, Min\-Weight, and Max\-Weightkk\-Clique
The classical reduction of Nešetřil and Poljak\[[NP85](https://arxiv.org/html/2610.06783#bib.bibx132)\]fromkk\-Clique to triangle detection turns the weightedkk\-Clique problems into Exact Triangle instances withn⌊k/3⌋n^\{\\lfloor k/3\\rfloor\}vertices per part \(after fixingk−3⌊k/3⌋k\-3\\lfloor k/3\\rfloorvertices when3∤k3\\nmid k\), so Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19)gives:
###### Corollary 39\(Weightedkk\-Clique\)\.
Letk≥3k\\geq 3andν≥1\\nu\\geq 1be constants\. Given a completekk\-partite graph with parts ofnnvertices and integer edge weights of absolute value at mostnνn^\{\\nu\}, deterministic algorithms decide inO\(nk−εT⌊k/3⌋\)O\(n^\{k\-\\varepsilon\_\{T\}\\lfloor k/3\\rfloor\}\)time whether somekk\-clique, with one vertex in each part, has total edge weight zero, and find akk\-clique of minimum, or of maximum, total edge weight\.
###### Proof\.
We apply the classical reduction fromkk\-Clique to triangle detection of Nešetřil and Poljak\[[NP85](https://arxiv.org/html/2610.06783#bib.bibx132)\]\. Whenkkis divisible by33, the reduction is simple\. Split thekkparts into three groups ofk/3k/3parts each, and build a tripartite graphHHwhose vertices in theiith part \(fori=1,2,3i=1,2,3\) are thek/3k/3\-cliques of the original graph with one vertex in each part of theiith group, with an edge between two such cliques when together they form a2k/32k/3\-clique\. Since the original graph is completekk\-partite, every choice of one vertex from each part of a group is ak/3k/3\-clique, and any two such cliques from different groups form a2k/32k/3\-clique, soHHis simply the complete tripartite graph withnk/3n^\{k/3\}vertices per part\. The triangles ofHHcorrespond bijectively to thekk\-cliques of the original graph with one vertex in each part\.
Whenkkis not divisible by33, lett:=k−3⌊k/3⌋∈\{1,2\}t:=k\-3\\lfloor k/3\\rfloor\\in\\\{1,2\\\}\. We enumerate thentn^\{t\}ways of fixing one vertex in each of the firstttparts, and for each of them we buildHHas above from the remaining3⌊k/3⌋3\\lfloor k/3\\rfloorparts; now the triangles ofHHcorrespond to thekk\-cliques through thettfixed vertices\. In both casesHHhasN:=n⌊k/3⌋N:=n^\{\\lfloor k/3\\rfloor\}vertices per part, and we index its parts byi∈ℤ3i\\in\\mathbb\{Z\}\_\{3\}\.
We giveHHedge weights so that a triangle and itskk\-clique have the same weight\. LetUUbe a vertex ofHHin partiiandVVa vertex in parti\+1i\+1\. The weight of the edgeUVUVofHHis the total weight of the edges of the original graph between a vertex ofUUand a vertex ofVV, of the edges insideUU, of the edges betweenUUand the fixed vertices, and, ifi=1i=1andt=2t=2, of the edge between the two fixed vertices\. The edges insideVVand the edges betweenVVand the fixed vertices are not counted here; they are counted in the edge fromVVto parti\+2i\+2\. In this way every edge of akk\-clique is counted exactly once over the three edges of its triangle, so there is no double\-counting and the weights agree\. The weight of an edge ofHHhas absolute value at most\(k2\)nν≤N2ν\\binom\{k\}\{2\}n^\{\\nu\}\\leq N^\{2\\nu\}forn≥k2n\\geq k^\{2\}\.
Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19)decides whetherHHhas a triangle of weight zero inO\(N3−ε′logN\)O\(N^\{3\-\\varepsilon^\{\\prime\}\}\\log N\)time, with the constantsε′\>εT\\varepsilon^\{\\prime\}\>\\varepsilon\_\{T\}of that theorem\. By\[[VW13](https://arxiv.org/html/2610.06783#bib.bibx158), Theorem 3\.3\], finding a maximum weight triangle costsO\(log2n\)O\(\\log^\{2\}n\)times as much, and a minimum weight triangle is a maximum weight triangle for the negated weights\. Sinceε′\>εT\\varepsilon^\{\\prime\}\>\\varepsilon\_\{T\}, the logarithmic factors are absorbed, so each graphHHcostsO\(N3−εT\)O\(N^\{3\-\\varepsilon\_\{T\}\}\)time, and thentn^\{t\}graphs together costO\(ntN3−εT\)=O\(nk−εT⌊k/3⌋\)O\(n^\{t\}N^\{3\-\\varepsilon\_\{T\}\}\)=O\(n^\{k\-\\varepsilon\_\{T\}\\lfloor k/3\\rfloor\}\)\. ∎
Consequently, the Zero\-Weight, Min\-Weight, and Max\-Weightkk\-Clique hypotheses\[[AL13](https://arxiv.org/html/2610.06783#bib.bibx21),[LVW18](https://arxiv.org/html/2610.06783#bib.bibx125),[BDT16](https://arxiv.org/html/2610.06783#bib.bibx36)\]with polynomially bounded weights are refuted, also on general graphs, by the standard reduction to the completekk\-partite form\.
### 5\.4Three conjectures of van den Brand, Nanongkai, and Saranurak
Van den Brand, Nanongkai, and Saranurak\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]propose three “hinted” variants of the Online Matrix–Vector conjecture\[[HKNS15](https://arxiv.org/html/2610.06783#bib.bibx100)\], which they use to prove matching lower bounds for the running times of their dynamic matrix inverse algorithms\. All three are over the Boolean semiring, allow polynomial preprocessing time in the first phase, and have parameterst=nτt=n^\{\\tau\}andti=nτit\_\{i\}=n^\{\\tau\_\{i\}\}for constantsτ,τi∈\(0,1\)\\tau,\\tau\_\{i\}\\in\(0,1\)\. We writeω\(a,b,c\)\\omega\(a,b,c\)for the exponent of multiplying anna×nbn^\{a\}\\times n^\{b\}matrix by annb×ncn^\{b\}\\times n^\{c\}matrix\. Each conjecture asserts that no algorithmsimultaneouslybeats all of its listed bounds, for anyε\>0\\varepsilon\>0\.
- •*vv\-hinted Mv*\(Definition 5\.1 and Conjecture 5\.2 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\)\. Phase 1: ann×tn\\times tmatrixMM\. Phase 2: at×nt\\times nmatrixVV\. Phase 3: an indexii, after which the algorithm outputsMV\[n\],iMV\_\{\[n\],i\}, the product ofMMand columniiofVV\. Bounds conjectured to be impossible to achieve simultaneously:nω\(1,1,τ\)−εn^\{\\omega\(1,1,\\tau\)\-\\varepsilon\}for Phase 2 andn1\+τ−εn^\{1\+\\tau\-\\varepsilon\}for Phase 3\.
- •*Mv\-hinted Mv*\(Definition 5\.6 and Conjecture 5\.7 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\)\. Phase 1:N∈\{0,1\}n×nN\\in\\\{0,1\\\}^\{n\\times n\}andV∈\{0,1\}t×nV\\in\\\{0,1\\\}^\{t\\times n\}\. Phase 2: a vectorI∈\[n\]tI\\in\[n\]^\{t\}of column indices\. Phase 3: an indexjj, after which the algorithm outputsN\[n\],IV\[t\],jN\_\{\[n\],I\}V\_\{\[t\],j\}, whereN\[n\],IN\_\{\[n\],I\}is then×tn\\times tmatrix whosekk\-th column is columnIkI\_\{k\}ofNN\. Bounds conjectured to be impossible to achieve simultaneously:nω\(1,τ,1\)−εn^\{\\omega\(1,\\tau,1\)\-\\varepsilon\}for Phase 2 andn1\+τ−εn^\{1\+\\tau\-\\varepsilon\}for Phase 3\.
- •*uMv\-hinted uMv*\(Definition 5\.11 and Conjecture 5\.12 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\)\. Phase 1:U∈\{0,1\}n×t1U\\in\\\{0,1\\\}^\{n\\times t\_\{1\}\},N∈\{0,1\}n×nN\\in\\\{0,1\\\}^\{n\\times n\}, andV∈\{0,1\}t2×nV\\in\\\{0,1\\\}^\{t\_\{2\}\\times n\}\. Phase 2:I∈\[n\]t1I\\in\[n\]^\{t\_\{1\}\}\. Phase 3:J∈\[n\]t2J\\in\[n\]^\{t\_\{2\}\}\. Phase 4: indicesiiandjj, after which the algorithm outputs\(UNI,JV\)i,j\(UN\_\{I,J\}V\)\_\{i,j\}, whereNI,JN\_\{I,J\}is thet1×t2t\_\{1\}\\times t\_\{2\}submatrix ofNNwith the rowsIIand the columnsJJ\. Bounds conjectured to be impossible to achieve simultaneously:nω\(1,τ1,1\)−εn^\{\\omega\(1,\\tau\_\{1\},1\)\-\\varepsilon\}for Phase 2,nω\(τ2,τ1,1\)−εn^\{\\omega\(\\tau\_\{2\},\\tau\_\{1\},1\)\-\\varepsilon\}for Phase 3, andnτ1\+τ2−εn^\{\\tau\_\{1\}\+\\tau\_\{2\}\-\\varepsilon\}for Phase 4\.
The two obvious algorithms are to multiply everything out with fast matrix multiplication as soon as the hint arrives, or to wait and compute one matrix–vector product at the end, and the conjectures say that no algorithm is polynomially faster than both of these\. The main lower bounds of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\],n1\.528n^\{1\.528\}for dynamic matrix inverse with column updates and row queries andn1\.407n^\{1\.407\}with element updates and element queries, use the conjectures atτ≈0\.53\\tau\\approx 0\.53and atτ1\+τ2≈1\.41\\tau\_\{1\}\+\\tau\_\{2\}\\approx 1\.41, where they match the algorithms of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\. For thin hints, the conjectures are false, because the data structure of Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)is faster than both obvious algorithms\.
###### Corollary 40\(Hinted OMv\)\.
Conjectures 5\.2 and 5\.7 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]fail for every0<τ<1/180<\\tau<1/18: Phase 2 takesO\(n2−0\.063τ\)O\(n^\{2\-0\.063\\tau\}\)time and Phase 3 takesO\(n1\+0\.437τ\)O\(n^\{1\+0\.437\\tau\}\)time\. Conjecture 5\.12 fails for every0<τ1<τ2/180<\\tau\_\{1\}<\\tau\_\{2\}/18: Phase 3 takesO\(n1\+τ2−0\.063τ1\)O\(n^\{1\+\\tau\_\{2\}\-0\.063\\tau\_\{1\}\}\)time and Phase 4 takesO\(nτ2\+0\.437τ1\)O\(n^\{\\tau\_\{2\}\+0\.437\\tau\_\{1\}\}\)time, with polynomial Phase 1 and a Phase 2 that only storesII\.
More generally, Conjectures 5\.2 and 5\.7 fail for every0<τ<ε∗=0\.1204…0<\\tau<\\varepsilon^\{\*\}=0\.1204\\ldots, and Conjecture 5\.12 fails for every0<τ1<ε∗τ20<\\tau\_\{1\}<\\varepsilon^\{\*\}\\tau\_\{2\}\. In each case the phases beat the conjectured bounds whatever the value ofω\\omega, sinceω\(1,1,τ\)=ω\(1,τ,1\)≥2\\omega\(1,1,\\tau\)=\\omega\(1,\\tau,1\)\\geq 2andω\(τ2,τ1,1\)≥1\+τ2\\omega\(\\tau\_\{2\},\\tau\_\{1\},1\)\\geq 1\+\\tau\_\{2\}because of the input and output sizes\.
###### Proof\.
We compute overℤ\\mathbb\{Z\}with0/10/1matrices; a Boolean entry is 1 exactly when the corresponding integer entry is positive\. LetD:=t=nτD:=t=n^\{\\tau\}be the inner dimension\. Forτ<1/18\\tau<1/18we haveD18=n18τ≤nD^\{18\}=n^\{18\\tau\}\\leq n, so Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)applies withN=nN=n\.
*Conjecture 5\.2 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\.*In Phase 2, we preprocessX:=MX:=MandY:=VY:=Vby Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26), inO\(n2/D0\.063\)=O\(n2−0\.063τ\)O\(n^\{2\}/D^\{0\.063\}\)=O\(n^\{2\-0\.063\\tau\}\)time\. In Phase 3, thennentries of columniiofMVMVarennqueries, which takeO\(nD0\.437\)=O\(n1\+0\.437τ\)O\(n\\,D^\{0\.437\}\)=O\(n^\{1\+0\.437\\tau\}\)time\.
*Conjecture 5\.7 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\.*The proof is the same, withX:=N\[n\],IX:=N\_\{\[n\],I\}andY:=VY:=V, which are both known in Phase 2 \(XXmay have repeated columns, which do not affect the argument\)\. Phase 1 only reads its input\.
*Conjecture 5\.12 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\.*LetX:=UX:=U, ann×t1n\\times t\_\{1\}matrix, andY:=NI,JY:=N\_\{I,J\}, at1×t2t\_\{1\}\\times t\_\{2\}matrix, which are both known in Phase 3, with the inner dimensionD:=t1=nτ1D:=t\_\{1\}=n^\{\\tau\_\{1\}\}\. Cut thennrows ofUUinton/t2n/t\_\{2\}blocks oft2t\_\{2\}rows, and preprocess each of then/t2n/t\_\{2\}products of a block withYY, which are products of at2×t1t\_\{2\}\\times t\_\{1\}matrix by at1×t2t\_\{1\}\\times t\_\{2\}matrix, by Corollary[26](https://arxiv.org/html/2610.06783#Thmtheorem26)\. It applies becauset2=nτ2≥n18τ1=D18t\_\{2\}=n^\{\\tau\_\{2\}\}\\geq n^\{18\\tau\_\{1\}\}=D^\{18\}whenτ1<τ2/18\\tau\_\{1\}<\\tau\_\{2\}/18\. So Phase 3 costs\(n/t2\)⋅O\(t22/D0\.063\)=O\(n1\+τ2−0\.063τ1\)\(n/t\_\{2\}\)\\cdot O\(t\_\{2\}^\{2\}/D^\{0\.063\}\)=O\(n^\{1\+\\tau\_\{2\}\-0\.063\\tau\_\{1\}\}\)time\. In Phase 4,\(UNI,JV\)i,j=∑ℓ=1t2\(UNI,J\)i,ℓVℓ,j\(UN\_\{I,J\}V\)\_\{i,j\}=\\sum\_\{\\ell=1\}^\{t\_\{2\}\}\(UN\_\{I,J\}\)\_\{i,\\ell\}V\_\{\\ell,j\}is a sum of at mostt2t\_\{2\}entries ofXYXY, which aret2t\_\{2\}queries and takeO\(t2D0\.437\)=O\(nτ2\+0\.437τ1\)O\(t\_\{2\}D^\{0\.437\}\)=O\(n^\{\\tau\_\{2\}\+0\.437\\tau\_\{1\}\}\)time\. Phase 2 only storesII\.
*Generalτ\\tau\.*Let0<τ<ε∗0<\\tau<\\varepsilon^\{\*\}, and fixε\\varepsilonwithτ<ε<ε∗\\tau<\\varepsilon<\\varepsilon^\{\*\}\. By Corollary[31](https://arxiv.org/html/2610.06783#Thmtheorem31), withccandθ\\thetachosen as in the proof of Theorem[24](https://arxiv.org/html/2610.06783#Thmtheorem24)forq:=12q:=\\frac\{1\}\{2\}, there is, after absorbing the logarithmic factors, aγ\>0\\gamma\>0such that, sinceD=nτ≤nεD=n^\{\\tau\}\\leq n^\{\\varepsilon\}, the arguments above go through with Phase 2 inO\(n2/Dγ\)=O\(n2−γτ\)O\(n^\{2\}/D^\{\\gamma\}\)=O\(n^\{2\-\\gamma\\tau\}\)time and Phase 3 inO\(nD1/2\)=O\(n1\+τ/2\)O\(n\\,D^\{1/2\}\)=O\(n^\{1\+\\tau/2\}\)time\. For Conjecture 5\.12, we use the same blocks, which requiresnτ1≤nετ2n^\{\\tau\_\{1\}\}\\leq n^\{\\varepsilon\\tau\_\{2\}\}, that is,τ1≤ετ2\\tau\_\{1\}\\leq\\varepsilon\\tau\_\{2\}for someε<ε∗\\varepsilon<\\varepsilon^\{\*\}\. ∎
We conclude this section by discussing which results of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]rely on the conjectures in the refuted regime\. From Conjectures 5\.2 and 5\.7,\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]derive trade\-offs between the worst\-case update timeuuand query timeqqof dynamic algorithms, for every0<τ<10<\\tau<1: eitheru=Ω\(nω\(1,1,τ\)−τ−ε\)u=\\Omega\(n^\{\\omega\(1,1,\\tau\)\-\\tau\-\\varepsilon\}\)orq=Ω\(n1\+τ−ε\)q=\\Omega\(n^\{1\+\\tau\-\\varepsilon\}\)\. These trade\-offs cover the dynamic matrix product, inverse, and adjoint problems with column updates and row queries \(Theorem 5\.3 and Corollary 5\.5 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\) or with element updates and row queries \(Theorem 5\.8 and Corollary 5\.9 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\), and dynamic transitive closure and DAG path counting with vertex or edge updates and source queries \(Corollaries 5\.4 and 5\.10 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\)\. For element or pair queries, the condition becomesq=Ω\(nτ−ε\)q=\\Omega\(n^\{\\tau\-\\varepsilon\}\)\(Corollaries 5\.9 and 5\.10 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\)\.
The main bounds, such asu\+q=Ω\(n1\.528\)u\+q=\\Omega\(n^\{1\.528\}\)for column updates and row queries, balance the two terms atτ≈0\.53\\tau\\approx 0\.53\. For this setting, the current best upper bound onω\(1,1,τ\)\\omega\(1,1,\\tau\)is strictly greater than22, so the products are far from thin enough for our construction, and these bounds are still supported by the unrefuted forms of the conjectures\. The same holds for the bounds from Conjecture 5\.12 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\], such asΩ\(n1\.407\)\\Omega\(n^\{1\.407\}\)for dynamic determinant, rank, and bipartite perfect matching \(Corollaries 5\.15 and 5\.16 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]\), since Corollary[40](https://arxiv.org/html/2610.06783#Thmtheorem40)refutes Conjecture 5\.12 in\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]only forτ1<0\.1204τ2\\tau\_\{1\}<0\.1204\\,\\tau\_\{2\}, far from theτ1\+τ2≈1\.41\\tau\_\{1\}\+\\tau\_\{2\}\\approx 1\.41at which these bounds are proved\.
Forτ<0\.1204\\tau<0\.1204, however, whereω\(1,1,τ\)=2\\omega\(1,1,\\tau\)=2, the trade\-offs say that an update requiresn2−τ−o\(1\)n^\{2\-\\tau\-o\(1\)\}time unless a row or source query takesn1\+τ−o\(1\)n^\{1\+\\tau\-o\(1\)\}time, or, in the versions with element or pair queries, unless such a query takesnτ−o\(1\)n^\{\\tau\-o\(1\)\}time; Corollary[40](https://arxiv.org/html/2610.06783#Thmtheorem40)refutes the forms of the conjectures that would imply these trade\-offs\. This is the end of the trade\-offs with the fastest queries, where they match the algorithms of\[[San04](https://arxiv.org/html/2610.06783#bib.bibx141),[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\], such as element updates inO\(n2−τ\)O\(n^\{2\-\\tau\}\)time with element queries inO\(nτ\)O\(n^\{\\tau\}\)time\[[San04](https://arxiv.org/html/2610.06783#bib.bibx141), Theorem 3\]\. For smallτ\\tau, these algorithms are no longer known to be conditionally optimal\.
The same goes for results that rely on this end of the trade\-offs\. Haeupler, Long, and Saranurak\[[HLS24](https://arxiv.org/html/2610.06783#bib.bibx101)\]cite Corollary 5\.10 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]as showing that incremental and decremental distance oracles with approximation factor below5/35/3cannot have worst\-case update timen2−Ω\(1\)n^\{2\-\\Omega\(1\)\}and query timeno\(1\)n^\{o\(1\)\}\. With queries this fast, ruling out update timen2−δn^\{2\-\\delta\}needs Conjecture 5\.7 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]for someτ<δ\\tau<\\delta, so new evidence of hardness would be needed forδ≤0\.1204\\delta\\leq 0\.1204, although the remaining cases of the conjecture still rule out update timeO\(n1\.87\)O\(n^\{1\.87\}\)\. Van den Brand, Song, and Zhou\[[vdBSZ24](https://arxiv.org/html/2610.06783#bib.bibx156)\]show that their data structure for dynamic attention, with amortized update timenω\(1,1,τ\)−τn^\{\\omega\(1,1,\\tau\)\-\\tau\}, is conditionally optimal for every0<τ≤10<\\tau\\leq 1under a variant of Conjecture 5\.7 of\[[vdBNS19](https://arxiv.org/html/2610.06783#bib.bibx155)\]in which Phase 2 gives a matrix with at mostnτn^\{\\tau\}nonzero entries instead of the vectorII\. Our proof applies to this variant as well, since after Phase 2 the product again has inner dimension at mostnτn^\{\\tau\}, so this lower bound needs a new hypothesis forτ<0\.1204\\tau<0\.1204\.
## 6Conclusion
We believe our results open exciting research directions in both algorithm design and complexity theory, and we highlight a few here\.
##### Fine\-grained complexity\.
An important message from our paper is that the fine\-grained reductions that FGC has built up are incredibly valuable, and that it is even more important to design more reductions to enable further algorithm design and improved conditional hardness\.
Which hypotheses should take the place of33SUM and APSP? As discussed in the introduction, one possibility is to restrict these hypotheses to combinatorial algorithms\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[AV14](https://arxiv.org/html/2610.06783#bib.bibx26)\], motivated by the search for more practical algorithms or practical hardness\. Another possibility is the hypothesis that the balanced case of All\-Edges Sparse Triangle, withmmedges, needsm4/3−o\(1\)m^\{4/3\-o\(1\)\}time\. Our algorithms do not speed up this balanced case, and since it is the target of several lower\-bound reductions from33SUM and Exact Triangle\[[Păt10](https://arxiv.org/html/2610.06783#bib.bibx135),[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116),[VX20](https://arxiv.org/html/2610.06783#bib.bibx160),[CX24](https://arxiv.org/html/2610.06783#bib.bibx71)\], the hypothesis still gives many problems evidence of hardness\. Is it possible that the lopsided version has a faster algorithm but the balanced version does not?
More broadly, the complexity of the many problems that are only known to be 3SUM\-hard or APSP\-hard, rather than equivalent to33SUM or APSP, is now open \(the gray boxes of Figure[1](https://arxiv.org/html/2610.06783#S1.F1)\); we get no faster algorithms for them, since the reductions go the other way\. For instance, can one decide in truly subquadratic time whethernnpoints in the plane contain three on a line\[[GO95](https://arxiv.org/html/2610.06783#bib.bibx92)\]? As far as we know, the fastest known running time is stillO\(n2\)O\(n^\{2\}\), without even any polylogarithmic improvements\. A similar question arises for the hypotheses that our results say nothing about, such askk\-SUM fork≥4k\\geq 4, 3SUM\-Indexing, OMv \(without hints\), and Orthogonal Vectors\. Do ideas like ours help to speed up algorithms for any of them?
Our new technique gives a way to deal with sparsity, at least in lopsided instances\. Much work has gone into algorithms for sparse matrix multiplication\[[YZ05b](https://arxiv.org/html/2610.06783#bib.bibx171),[AP09](https://arxiv.org/html/2610.06783#bib.bibx25),[PS14](https://arxiv.org/html/2610.06783#bib.bibx137),[ABFK24](https://arxiv.org/html/2610.06783#bib.bibx2),[BGGW26](https://arxiv.org/html/2610.06783#bib.bibx38),[BFN26](https://arxiv.org/html/2610.06783#bib.bibx37),[Gra26](https://arxiv.org/html/2610.06783#bib.bibx95)\]\. However, our techniques do not seem to give new algorithms for sparse matrix multiplication\. Is improving upon the known algorithms for this problem hard, or is there another technique that could help here? This question is related to the balanced version of All\-Edges Sparse Triangle\.
What are the true exponents of33SUM, APSP, and the many other problems of Figure[1](https://arxiv.org/html/2610.06783#S1.F1)that now have faster algorithms? Our exponents can certainly be improved, and one place to gain is the reductions\. Each of our algorithms composes known reductions with the matrix theorem, and many reductions lose a constant fraction of the saving in the exponent\. For instance, the reduction from Exact Triangle to Lopsided All\-Edges Sparse Triangle keeps only half of the saving in the exponent, and the reductions from33SUM and APSP to Exact Triangle keep a half and a third \(Section[3](https://arxiv.org/html/2610.06783#S3)\)\. These reductions, like most fine\-grained reductions, were designed to prove hardness, where it only matters that they keep some polynomial saving\. Now that they are being used as algorithms, how much they keep is more important\. Which of them can be improved? Are there more efficient reductions from all these different problems to Lopsided All\-Edges Sparse Triangle, or to thin matrix products themselves, that skip the intermediate problems?101010For one example, the exponents for APSP and33SUM presented here can already be improved slightly without too much work, by not going through the decision version of Exact Triangle\. For APSP, the proof of Theorem[17](https://arxiv.org/html/2610.06783#Thmtheorem17)also solves the all\-edges version of Exact Triangle \(scanning each pair only until its zero triangle is found\), to which the\(min,\+\)\(\\min,\+\)\-product reduces on the samennvertices\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159),[VW13](https://arxiv.org/html/2610.06783#bib.bibx158)\], so that APSP keeps all of the saving of Exact Triangle rather than a third\. For33SUM, the direct reduction of\[[KPP16](https://arxiv.org/html/2610.06783#bib.bibx116)\]to offline Set Disjointness keeps all of the saving rather than a quarter, but it is randomized \(its derandomization\[[FKP24](https://arxiv.org/html/2610.06783#bib.bibx84)\]keeps far less of the saving\)\. Substantially better improvements than these would be more exciting\. We focused in this paper on simplifying the presentation rather than giving slight further improvements to the exponents\.
Some of these losses cannot be removed by reductions alone\. Sheffield, Vassilevska Williams, and Xi\[[SVX27](https://arxiv.org/html/2610.06783#bib.bibx149)\]show that the loss of a third in the reduction from the all\-edges version of a triangle problem to its detection version\[[VW10](https://arxiv.org/html/2610.06783#bib.bibx157),[VW18](https://arxiv.org/html/2610.06783#bib.bibx159)\]is optimal for black\-box reductions, those that work for every relation on the three edge weights at once, so a tighter reduction must use the structure of the particular problem\. The loss can still be avoided on the algorithmic side, as in the footnote: our algorithm for Exact Triangle solves the all\-edges version at no extra cost, as all known algorithms for triangle problems do\[[SVX27](https://arxiv.org/html/2610.06783#bib.bibx149)\]\. Our reductions are not black\-box in this sense either: the reduction from Exact Triangle to Lopsided All\-Edges Sparse Triangle hashes the weights modulo a prime, which uses the additive structure of the problem, so the barriers of\[[SVX27](https://arxiv.org/html/2610.06783#bib.bibx149)\]say nothing against improving the half that it loses\. The same paper also gives new black\-box reductions among triangle, listing, and matrix problems, and such reductions are now of algorithmic interest as well\.
Beyond the reductions, all of our algorithms use the same matrix theorem, and a different technique might give improvements such as better exponents, combinatorial or practical algorithms, or algorithms for All\-Edges Sparse Triangle with a middle part larger thann0\.12n^\{0\.12\}, such as then1/2n^\{1/2\}that arises in an approach to girth approximation\[[RV12](https://arxiv.org/html/2610.06783#bib.bibx139)\]\.
##### Algebraic algorithm design\.
Any improvement to the matrix theorem carries over to all the other speedups we achieve here\. We do not know the true complexity of computing a setWWof entries of a thin productXYXY, as a function ofDDand\|W\|\|W\|\. In particular, to handleD\>N0\.12D\>N^\{0\.12\}, one could look for new base identities that compute longer inner products per multiplication than Schönhage’s, perhaps by computer search\[[FBH\+22](https://arxiv.org/html/2610.06783#bib.bibx81),[KM23](https://arxiv.org/html/2610.06783#bib.bibx114),[NVE\+25](https://arxiv.org/html/2610.06783#bib.bibx134)\], or ask whether other known identities, such as border rank expressions for the Coppersmith–Winograd tensor\[[CW90](https://arxiv.org/html/2610.06783#bib.bibx69)\], which underlie the current bounds onω\\omegaandα\\alpha\[[VXXZ24](https://arxiv.org/html/2610.06783#bib.bibx161),[ADV\+25](https://arxiv.org/html/2610.06783#bib.bibx10),[DEK\+26](https://arxiv.org/html/2610.06783#bib.bibx72)\], can be used in the same way\. It is not immediately clear how to make use of other tensors, since our analysis uses specific properties of Schönhage’s identity, such as its sparsity and the way the leaves of its recursion are shared among the output entries \(Section[2\.4](https://arxiv.org/html/2610.06783#S2.SS4)\)\. If other tensors cannot be used in this way, it would be interesting to understand why\. For instance, even if the rank or border rank of a tensor is known, it might be that we need to find different rank or border rank expressions to use, similar to work on improving leading constants of matrix multiplication algorithms \(see, e\.g\.,\[[BB15](https://arxiv.org/html/2610.06783#bib.bibx33),[KS20](https://arxiv.org/html/2610.06783#bib.bibx118),[BS19](https://arxiv.org/html/2610.06783#bib.bibx47),[AY25](https://arxiv.org/html/2610.06783#bib.bibx31),[MS25](https://arxiv.org/html/2610.06783#bib.bibx131)\]\)\.
## Acknowledgments and Methodology
##### How the result was originally found and shared with the authors\.
An Anthropic employee used an internal research model to investigate open problems in the theory of cryptography\. One of them was about cryptographic constructions based on the average\-case hardness of Zero\-kk\-Clique\[[LLV19](https://arxiv.org/html/2610.06783#bib.bibx121),[AHY25](https://arxiv.org/html/2610.06783#bib.bibx20)\]\. Claude was tasked with verifying and improving the constructions, but instead developed this algorithm, first for the average case, then for the worst case\. The session used 16M output tokens with no human input\.
Anthropic shared the algorithm with the authors in September 2026 under a confidentiality agreement, offered compensation, and provided access to the public version of Claude\.
##### Shared algorithm\.
The algorithm that was shared with the authors is essentially the algorithm in Section[2](https://arxiv.org/html/2610.06783#S2), although presented differently and with other numerical parameters\. A different reduction from Exact Triangle to the problem of Section[2](https://arxiv.org/html/2610.06783#S2)was also shared, although the authors did not include it here, and instead used known reductions to All\-Edges Sparse Triangle, which suffice and strengthen the connection\. The authors derived the data structure version in Section[4](https://arxiv.org/html/2610.06783#S4)and its connection with Hinted OMv\.
##### Lean certification\.
After the paper was completely written, Anthropic used an internal research model to certify this paper’s main results using the Lean 4 proof assistant with the Mathlib library\. The formalization is available at[https://github\.com/anthropics/formal\-math/tree/main/3sum\-apsp](https://github.com/anthropics/formal-math/tree/main/3sum-apsp)\. The following are formalized there: Theorem[19](https://arxiv.org/html/2610.06783#Thmtheorem19)\(Exact Triangle inO\(n2\.9983\)O\(n^\{2\.9983\}\)time\), Theorem[22](https://arxiv.org/html/2610.06783#Thmtheorem22)\(33SUM inO\(n1\.9992\)O\(n^\{1\.9992\}\)time, and the\(min,\+\)\(\\min,\+\)\-product and APSP inO\(n2\.99942\)O\(n^\{2\.99942\}\)time\), and the Zero\-Weight case of Corollary[39](https://arxiv.org/html/2610.06783#Thmtheorem39)\(Zero\-Weightkk\-Clique inO\(nk−0\.0017⌊k/3⌋\)O\(n^\{k\-0\.0017\\lfloor k/3\\rfloor\}\)time for everyk≥3k\\geq 3\)\. All lemmas and prior results that these statements rely on are also formalized there\.
##### Further acknowledgments\.
The authors used Claude to help with writing, figure creation, and checking mathematical details throughout this project\. They have attempted to make the entire paper accessible and well\-written, and take full responsibility for its contents\.
The authors’ contribution to this publication was done in their individual capacities, not in connection with their duties or responsibilities to Columbia University or to MIT\. Any opinions expressed in this work are opinions of the authors; they are not official positions or endorsements of Columbia University or of MIT, and do not represent the research of the authors at Columbia University or MIT\.
## References
- \[ABF23\]Amir Abboud, Karl Bringmann, and Nick Fischer\.Stronger 3\-SUM lower bounds for approximate distance oracles via additive combinatorics\.InProc\. 55th ACM Symposium on Theory of Computing \(STOC 2023\), pages 391–404, 2023\.
- \[ABFK24\]Amir Abboud, Karl Bringmann, Nick Fischer, and Marvin Künnemann\.The time complexity of fully sparse matrix multiplication\.InProc\. 35th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2024\), pages 4670–4703, 2024\.
- \[ABKZ22\]Amir Abboud, Karl Bringmann, Seri Khoury, and Or Zamir\.Hardness of approximation in P via short cycle removal: Cycle detection, distance oracles, and beyond\.InProc\. 54th ACM Symposium on Theory of Computing \(STOC 2022\), pages 1487–1500, 2022\.Full version: arXiv:2204\.10465\.
- \[AC05\]Nir Ailon and Bernard Chazelle\.Lower bounds for linear degeneracy testing\.Journal of the ACM, 52\(2\):157–171, 2005\.
- \[ACJ\+22\]Shyan Akmal, Lijie Chen, Ce Jin, Malvika Raj, and Ryan Williams\.Improved Merlin–Arthur protocols for central problems in fine\-grained complexity\.InProc\. 13th Innovations in Theoretical Computer Science Conference \(ITCS 2022\), volume 215 ofLIPIcs, pages 3:1–3:25, 2022\.
- \[ACLL14\]Amihood Amir, Timothy M\. Chan, Moshe Lewenstein, and Noa Lewenstein\.On hardness of jumbled indexing\.InProc\. 41st International Colloquium on Automata, Languages, and Programming \(ICALP 2014\), volume 8572 ofLNCS, pages 114–125, 2014\.
- \[ACW16\]Josh Alman, Timothy M\. Chan, and Ryan Williams\.Polynomial representations of threshold functions and algorithmic applications\.InProc\. 57th IEEE Symposium on Foundations of Computer Science \(FOCS 2016\), pages 467–476, 2016\.
- \[ACW20\]Josh Alman, Timothy M\. Chan, and R\. Ryan Williams\.Faster deterministic and Las Vegas algorithms for offline approximate nearest neighbors in high dimensions\.InProc\. 31st ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2020\), pages 637–649, 2020\.
- \[ADKF70\]Vladimir L\. Arlazarov, Efim A\. Dinic, Mikhail A\. Kronrod, and Igor A\. Faradžev\.On economical construction of the transitive closure of an oriented graph\.Soviet Mathematics Doklady, 11:1209–1210, 1970\.
- \[ADV\+25\]Josh Alman, Ran Duan, Virginia Vassilevska Williams, Yinzhan Xu, Zixuan Xu, and Renfei Zhou\.More asymmetry yields faster matrix multiplication\.InProc\. 36th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2025\), pages 2005–2039, 2025\.
- \[AFK\+24\]Amir Abboud, Nick Fischer, Zander Kelley, Shachar Lovett, and Raghu Meka\.New graph decompositions and combinatorial Boolean matrix multiplication algorithms\.InProc\. 56th ACM Symposium on Theory of Computing \(STOC 2024\), pages 935–943, 2024\.
- \[AFW20\]Amir Abboud, Shon Feller, and Oren Weimann\.On the fine\-grained complexity of parity problems\.InProc\. 47th International Colloquium on Automata, Languages, and Programming \(ICALP 2020\), volume 168 ofLIPIcs, pages 5:1–5:19, 2020\.
- \[AGHP92\]Noga Alon, Oded Goldreich, Johan Håstad, and René Peralta\.Simple constructions of almostkk\-wise independent random variables\.Random Structures & Algorithms, 3\(3\):289–304, 1992\.
- \[AGM97\]Noga Alon, Zvi Galil, and Oded Margalit\.On the exponent of the all pairs shortest path problem\.Journal of Computer and System Sciences, 54\(2\):255–262, 1997\.
- \[AGMN92\]Noga Alon, Zvi Galil, Oded Margalit, and Moni Naor\.Witnesses for Boolean matrix multiplication and for shortest paths\.InProc\. 33rd IEEE Symposium on Foundations of Computer Science \(FOCS 1992\), pages 417–426, 1992\.
- \[AGV15\]Amir Abboud, Fabrizio Grandoni, and Virginia Vassilevska Williams\.Subcubic equivalences between graph centrality problems, APSP and diameter\.InProc\. 26th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2015\), pages 1681–1697, 2015\.
- \[AGV23\]Amir Abboud, Fabrizio Grandoni, and Virginia Vassilevska Williams\.Subcubic equivalences between graph centrality problems, APSP, and diameter\.ACM Transactions on Algorithms, 19\(1\):3:1–3:30, 2023\.
- \[AHP08\]Boris Aronov and Sariel Har\-Peled\.On approximating the depth and related problems\.SIAM Journal on Computing, 38\(3\):899–921, 2008\.
- \[AHU74\]Alfred V\. Aho, John E\. Hopcroft, and Jeffrey D\. Ullman\.The Design and Analysis of Computer Algorithms\.Addison\-Wesley, 1974\.
- \[AHY25\]Josh Alman, Yizhi Huang, and Kevin Yeo\.Fine\-grained complexity in a world without cryptography\.InAdvances in Cryptology – EUROCRYPT 2025, Part VII, volume 15607 ofLNCS, pages 375–405, 2025\.
- \[AL13\]Amir Abboud and Kevin Lewi\.Exact weight subgraphs and thekk\-sum conjecture\.InProc\. 40th International Colloquium on Automata, Languages, and Programming \(ICALP 2013\), volume 7965 ofLNCS, pages 1–12, 2013\.
- \[AL25\]Josh Alman and Baitian Li\.Kronecker powers, orthogonal vectors, and the asymptotic spectrum\.InProc\. 66th IEEE Symposium on Foundations of Computer Science \(FOCS 2025\), pages 1411–1441, 2025\.arXiv:2509\.14489\.
- \[ALW14\]Amir Abboud, Kevin Lewi, and Ryan Williams\.Losing weight by gaining edges\.InProc\. 22nd European Symposium on Algorithms \(ESA 2014\), volume 8737 ofLNCS, pages 1–12, 2014\.
- \[AN96\]Noga Alon and Moni Naor\.Derandomization, witnesses for Boolean matrix multiplication and construction of perfect hash functions\.Algorithmica, 16\(4–5\):434–449, 1996\.
- \[AP09\]Rasmus Resen Amossen and Rasmus Pagh\.Faster join\-projects and sparse matrix multiplications\.InProc\. 12th International Conference on Database Theory \(ICDT 2009\), pages 121–126, 2009\.
- \[AV14\]Amir Abboud and Virginia Vassilevska Williams\.Popular conjectures imply strong lower bounds for dynamic problems\.InProc\. 55th IEEE Symposium on Foundations of Computer Science \(FOCS 2014\), pages 434–443, 2014\.
- \[AVW14\]Amir Abboud, Virginia Vassilevska Williams, and Oren Weimann\.Consequences of faster alignment of sequences\.InProc\. 41st International Colloquium on Automata, Languages, and Programming \(ICALP 2014\), volume 8572 ofLNCS, pages 39–51, 2014\.
- \[AVY15\]Amir Abboud, Virginia Vassilevska Williams, and Huacheng Yu\.Matching triangles and basing hardness on an extremely popular conjecture\.InProc\. 47th ACM Symposium on Theory of Computing \(STOC 2015\), pages 41–50, 2015\.
- \[AW15\]Josh Alman and Ryan Williams\.Probabilistic polynomials and Hamming nearest neighbors\.InProc\. 56th IEEE Symposium on Foundations of Computer Science \(FOCS 2015\), pages 136–150, 2015\.
- \[AWY15\]Amir Abboud, Ryan Williams, and Huacheng Yu\.More applications of the polynomial method to algorithm design\.InProc\. 26th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2015\), pages 218–230, 2015\.
- \[AY25\]Josh Alman and Hantao Yu\.Improving the leading constant of matrix multiplication\.InProc\. 36th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2025\), pages 1933–1971, 2025\.
- \[AYZ97\]Noga Alon, Raphael Yuster, and Uri Zwick\.Finding and counting given length cycles\.Algorithmica, 17\(3\):209–223, 1997\.
- \[BB15\]Austin R\. Benson and Grey Ballard\.A framework for practical parallel fast matrix multiplication\.InProc\. 20th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming \(PPoPP 2015\), pages 42–53, 2015\.
- \[BCD\+14\]David Bremner, Timothy M\. Chan, Erik D\. Demaine, Jeff Erickson, Ferran Hurtado, John Iacono, Stefan Langerman, Mihai Pătraşcu, and Perouz Taslakian\.Necklaces, convolutions, andX\+YX\+Y\.Algorithmica, 69\(2\):294–314, 2014\.
- \[BDP08\]Ilya Baran, Erik D\. Demaine, and Mihai Pătraşcu\.Subquadratic algorithms for 3SUM\.Algorithmica, 50\(4\):584–596, 2008\.
- \[BDT16\]Arturs Backurs, Nishanth Dikkala, and Christos Tzamos\.Tight hardness results for maximum weight rectangles\.InProc\. 43rd International Colloquium on Automata, Languages, and Programming \(ICALP 2016\), volume 55 ofLIPIcs, pages 81:1–81:13, 2016\.
- \[BFN26\]Karl Bringmann, Nick Fischer, and Vasileios Nakos\.Robustifying sparse matrix multiplication\.InProc\. 34th European Symposium on Algorithms \(ESA 2026\), volume 388 ofLIPIcs, pages 157:1–157:25, 2026\.Full version: arXiv:2607\.01427\.
- \[BGGW26\]Huck Bennett, Karthik Gajulapalli, Alexander Golovnev, and Evelyn Warton\.Output\-sparse matrix multiplication using compressed sensing\.InApproximation, Randomization, and Combinatorial Optimization\. Algorithms and Techniques \(APPROX/RANDOM 2026\), volume 392 ofLIPIcs, pages 40:1–40:20, 2026\.Full version: arXiv:2508\.10250\.
- \[BGMW20\]Karl Bringmann, Paweł Gawrychowski, Shay Mozes, and Oren Weimann\.Tree edit distance cannot be computed in strongly subcubic time \(unless APSP can\)\.ACM Transactions on Algorithms, 16\(4\):48:1–48:22, 2020\.
- \[BHKK10\]Andreas Björklund, Thore Husfeldt, Petteri Kaski, and Mikko Koivisto\.Trimmed Moebius inversion and graphs of bounded degree\.Theory of Computing Systems, 47\(3\):637–654, 2010\.
- \[BHP01\]Gill Barequet and Sariel Har\-Peled\.Polygon containment and translational min\-Hausdorff\-distance between segment sets are 3SUM\-hard\.International Journal of Computational Geometry & Applications, 11\(4\):465–474, 2001\.
- \[Bin80\]Dario Bini\.Relations between exact and approximate bilinear algorithms\. Applications\.Calcolo, 17:87–97, 1980\.
- \[BIS17\]Arturs Backurs, Piotr Indyk, and Ludwig Schmidt\.Better approximations for tree sparsity in nearly\-linear time\.InProc\. 28th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2017\), pages 2215–2229, 2017\.
- \[BN21\]Karl Bringmann and Vasileios Nakos\.A fine\-grained perspective on approximating subset sum and partition\.InProc\. 32nd ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2021\), pages 1797–1815, 2021\.
- \[Bri19\]Karl Bringmann\.Fine\-grained complexity theory \(tutorial\)\.InProc\. 36th International Symposium on Theoretical Aspects of Computer Science \(STACS 2019\), volume 126 ofLIPIcs, pages 4:1–4:7, 2019\.
- \[Bri24\]Karl Bringmann\.Knapsack with small items in near\-quadratic time\.InProc\. 56th ACM Symposium on Theory of Computing \(STOC 2024\), pages 259–270, 2024\.
- \[BS19\]Gal Beniamini and Oded Schwartz\.Faster matrix multiplication via sparse decomposition\.InProc\. 31st ACM Symposium on Parallelism in Algorithms and Architectures \(SPAA 2019\), pages 11–22, 2019\.
- \[BW09\]Nikhil Bansal and Ryan Williams\.Regularity lemmas and combinatorial algorithms\.InProc\. 50th IEEE Symposium on Foundations of Computer Science \(FOCS 2009\), pages 745–754, 2009\.
- \[CDL\+16\]Marek Cygan, Holger Dell, Daniel Lokshtanov, Dániel Marx, Jesper Nederlof, Yoshio Okamoto, Ramamohan Paturi, Saket Saurabh, and Magnus Wahlström\.On problems as hard as CNF\-SAT\.ACM Transactions on Algorithms, 12\(3\):41:1–41:24, 2016\.
- \[CGI\+16\]Marco L\. Carmosino, Jiawei Gao, Russell Impagliazzo, Ivan Mihajlin, Ramamohan Paturi, and Stefan Schneider\.Nondeterministic extensions of the strong exponential time hypothesis and consequences for non\-reducibility\.InProc\. 7th ACM Conference on Innovations in Theoretical Computer Science \(ITCS 2016\), pages 261–270, 2016\.
- \[CH20\]Timothy M\. Chan and Qizheng He\.Reducing 3SUM to convolution\-3SUM\.InProc\. 3rd SIAM Symposium on Simplicity in Algorithms \(SOSA 2020\), pages 1–7, 2020\.
- \[Cha08\]Timothy M\. Chan\.All\-pairs shortest paths with real weights inO\(n3/logn\)O\(n^\{3\}/\\log n\)time\.Algorithmica, 50\(2\):236–243, 2008\.Preliminary version in WADS 2005\.
- \[Cha10\]Timothy M\. Chan\.More algorithms for all\-pairs shortest paths in weighted graphs\.SIAM Journal on Computing, 39\(5\):2075–2089, 2010\.
- \[Cha15\]Timothy M\. Chan\.Speeding up the four Russians algorithm by about one more logarithmic factor\.InProc\. 26th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2015\), pages 212–217, 2015\.
- \[Cha20\]Timothy M\. Chan\.More logarithmic\-factor speedups for 3SUM, \(median,\+\)\-convolution, and some geometric 3SUM\-hard problems\.ACM Transactions on Algorithms, 16\(1\):7:1–7:23, 2020\.
- \[Chv79\]Vašek Chvátal\.A greedy heuristic for the set\-covering problem\.Mathematics of Operations Research, 4\(3\):233–235, 1979\.
- \[CIO16\]Jean Cardinal, John Iacono, and Aurélien Ooms\.Solvingkk\-SUM using few linear queries\.InProc\. 24th European Symposium on Algorithms \(ESA 2016\), volume 57 ofLIPIcs, pages 25:1–25:17, 2016\.
- \[CIP10\]Chris Calabro, Russell Impagliazzo, and Ramamohan Paturi\.On the exact complexity of evaluating quantifiedkk\-CNF\.InProc\. 5th International Symposium on Parameterized and Exact Computation \(IPEC 2010\), volume 6478 ofLNCS, pages 50–59, 2010\.Journal version: Algorithmica 65\(4\):817–827, 2013\.
- \[CMWW19\]Marek Cygan, Marcin Mucha, Karol Węgrzycki, and Michał Włodarczyk\.On problems equivalent to \(min,\+\)\-convolution\.ACM Transactions on Algorithms, 15\(1\):14:1–14:25, 2019\.
- \[CN85\]Norishige Chiba and Takao Nishizeki\.Arboricity and subgraph listing algorithms\.SIAM Journal on Computing, 14\(1\):210–223, 1985\.
- \[Coo71\]Stephen A\. Cook\.The complexity of theorem\-proving procedures\.InProc\. 3rd ACM Symposium on Theory of Computing \(STOC 1971\), pages 151–158, 1971\.
- \[Cop82\]Don Coppersmith\.Rapid multiplication of rectangular matrices\.SIAM Journal on Computing, 11\(3\):467–471, 1982\.
- \[Cop97\]Don Coppersmith\.Rectangular matrix multiplication revisited\.Journal of Complexity, 13\(1\):42–49, 1997\.
- \[CP10\]Hagai Cohen and Ely Porat\.Fast set intersection and two\-patterns matching\.Theoretical Computer Science, 411\(40–42\):3795–3800, 2010\.
- \[CT65\]James W\. Cooley and John W\. Tukey\.An algorithm for the machine calculation of complex Fourier series\.Mathematics of Computation, 19\(90\):297–301, 1965\.
- \[CVX21\]Timothy M\. Chan, Virginia Vassilevska Williams, and Yinzhan Xu\.Algorithms, reductions and equivalences for small weight variants of all\-pairs shortest paths\.InProc\. 48th International Colloquium on Automata, Languages, and Programming \(ICALP 2021\), volume 198 ofLIPIcs, pages 47:1–47:21, 2021\.Full version: arXiv:2102\.06181, whose numbering we follow\.
- \[CVX22\]Timothy M\. Chan, Virginia Vassilevska Williams, and Yinzhan Xu\.Hardness for triangle problems under even more believable hypotheses: Reductions from real APSP, real 3SUM, and OV\.InProc\. 54th ACM Symposium on Theory of Computing \(STOC 2022\), pages 1501–1514, 2022\.Full version: arXiv:2203\.08356, whose numbering we follow\.
- \[CVX23\]Timothy M\. Chan, Virginia Vassilevska Williams, and Yinzhan Xu\.Fredman’s trick meets dominance product: Fine\-grained complexity of unweighted APSP, 3SUM counting, and more\.InProc\. 55th ACM Symposium on Theory of Computing \(STOC 2023\), pages 419–432, 2023\.
- \[CW90\]Don Coppersmith and Shmuel Winograd\.Matrix multiplication via arithmetic progressions\.Journal of Symbolic Computation, 9\(3\):251–280, 1990\.
- \[CW21\]Timothy M\. Chan and R\. Ryan Williams\.Deterministic APSP, orthogonal vectors, and more: Quickly derandomizing Razborov–Smolensky\.ACM Transactions on Algorithms, 17\(1\):2:1–2:14, 2021\.
- \[CX24\]Timothy M\. Chan and Yinzhan Xu\.Simpler reductions from exact triangle\.InProc\. 7th SIAM Symposium on Simplicity in Algorithms \(SOSA 2024\), pages 28–38, 2024\.
- \[DEK\+26\]Emilien Dupont, Marvin Eisenberger, Borislav Kozlovskii, Abbas Mehrabian, Francisco J\. R\. Ruiz, Abigail See, Renfei Zhou, Josh Alman, Virginia Vassilevska Williams, and Matej Balog\.Improving the matrix multiplication exponent with modern optimization and AlphaEvolve\.arXiv:2608\.16884, 2026\.
- \[DGS20\]Bartłomiej Dudek, Paweł Gawrychowski, and Tatiana Starikovskaya\.All non\-trivial variants of 3\-LDT are equivalent\.InProc\. 52nd ACM Symposium on Theory of Computing \(STOC 2020\), pages 974–981, 2020\.
- \[DKPV20\]Lech Duraj, Krzysztof Kleiner, Adam Polak, and Virginia Vassilevska Williams\.Equivalences between triangle and range query problems\.InProc\. 31st ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2020\), pages 30–47, 2020\.
- \[DMRW09\]Erik D\. Demaine, Shay Mozes, Benjamin Rossman, and Oren Weimann\.An optimal decomposition algorithm for tree edit distance\.ACM Transactions on Algorithms, 6\(1\):2:1–2:19, 2009\.
- \[Dob90\]Włodzimierz Dobosiewicz\.A more efficient algorithm for the min\-plus multiplication\.International Journal of Computer Mathematics, 32\(1–2\):49–60, 1990\.
- \[DSW18\]Martin Dietzfelbinger, Philipp Schlag, and Stefan Walzer\.A subquadratic algorithm for 3XOR\.InProc\. 43rd International Symposium on Mathematical Foundations of Computer Science \(MFCS 2018\), volume 117 ofLIPIcs, pages 59:1–59:15, 2018\.
- \[Dür23\]Anita Dürr\.Improved bounds for rectangular monotone Min\-Plus product and applications\.Information Processing Letters, 181:106358, 2023\.
- \[Eri99\]Jeff Erickson\.Lower bounds for linear satisfiability problems\.Chicago Journal of Theoretical Computer Science, 1999\(8\), 1999\.
- \[ES17\]Esther Ezra and Micha Sharir\.A nearly quadratic bound for the decision tree complexity ofkk\-SUM\.InProc\. 33rd International Symposium on Computational Geometry \(SoCG 2017\), volume 77 ofLIPIcs, pages 41:1–41:15, 2017\.
- \[FBH\+22\]Alhussein Fawzi, Matej Balog, Aja Huang, Thomas Hubert, Bernardino Romera\-Paredes, Mohammadamin Barekatain, Alexander Novikov, Francisco J\. R\. Ruiz, Julian Schrittwieser, Grzegorz Swirszcz, David Silver, Demis Hassabis, and Pushmeet Kohli\.Discovering faster matrix multiplication algorithms with reinforcement learning\.Nature, 610\(7930\):47–53, 2022\.
- \[Fis26\]Nick Fischer\.Universe reduction for APSP: Equivalence of three fine\-grained hypotheses\.InProc\. 58th ACM Symposium on Theory of Computing \(STOC 2026\), pages 922–932, 2026\.
- \[FJX25\]Nick Fischer, Ce Jin, and Yinzhan Xu\.New applications of 3SUM\-counting in fine\-grained complexity and pattern matching\.InProc\. 36th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2025\), pages 4547–4595, 2025\.
- \[FKP24\]Nick Fischer, Piotr Kaliciak, and Adam Polak\.Deterministic 3SUM\-hardness\.InProc\. 15th Innovations in Theoretical Computer Science Conference \(ITCS 2024\), volume 287 ofLIPIcs, pages 49:1–49:24, 2024\.Full version: arXiv:2310\.12913, whose numbering we follow\.
- \[Flo62\]Robert W\. Floyd\.Algorithm 97: Shortest path\.Communications of the ACM, 5\(6\):345, 1962\.
- \[FM71\]Michael J\. Fischer and Albert R\. Meyer\.Boolean matrix multiplication and transitive closure\.InProc\. 12th Symposium on Switching and Automata Theory \(SWAT 1971\), pages 129–131, 1971\.
- \[Fre76\]Michael L\. Fredman\.New bounds on the complexity of the shortest path problem\.SIAM Journal on Computing, 5\(1\):83–89, 1976\.
- \[GGH\+20\]Alexander Golovnev, Siyao Guo, Thibaut Horel, Sunoo Park, and Vinod Vaikuntanathan\.Data structures meet cryptography: 3SUM with preprocessing\.InProc\. 52nd ACM Symposium on Theory of Computing \(STOC 2020\), pages 294–307, 2020\.
- \[GKLP17\]Isaac Goldstein, Tsvi Kopelowitz, Moshe Lewenstein, and Ely Porat\.Conditional lower bounds for space/time tradeoffs\.InProc\. 15th Algorithms and Data Structures Symposium \(WADS 2017\), volume 10389 ofLNCS, pages 421–436, 2017\.
- \[GLP19\]Isaac Goldstein, Moshe Lewenstein, and Ely Porat\.On the hardness of set disjointness and set intersection with bounded universe\.InProc\. 30th International Symposium on Algorithms and Computation \(ISAAC 2019\), volume 149 ofLIPIcs, pages 7:1–7:22, 2019\.
- \[GM93\]Zvi Galil and Oded Margalit\.Witnesses for Boolean matrix multiplication and for transitive closure\.Journal of Complexity, 9\(2\):201–221, 1993\.
- \[GO95\]Anka Gajentaan and Mark H\. Overmars\.On a class ofO\(n2\)O\(n^\{2\}\)problems in computational geometry\.Computational Geometry: Theory and Applications, 5\(3\):165–185, 1995\.
- \[Goo58\]Irving J\. Good\.The interaction algorithm and practical Fourier analysis\.Journal of the Royal Statistical Society, Series B, 20\(2\):361–372, 1958\.
- \[GP18\]Allan Grønlund and Seth Pettie\.Threesomes, degenerates, and love triangles\.Journal of the ACM, 65\(4\):22:1–22:25, 2018\.
- \[Gra26\]Omar Graia\.Optimal deterministic fully sparse matrix multiplication\.arXiv:2608\.18496, 2026\.
- \[GS17\]Omer Gold and Micha Sharir\.Improved bounds for 3SUM,kk\-SUM, and linear degeneracy\.InProc\. 25th European Symposium on Algorithms \(ESA 2017\), volume 87 ofLIPIcs, pages 42:1–42:13, 2017\.
- \[Han04\]Yijie Han\.Improved algorithm for all pairs shortest paths\.Information Processing Letters, 91\(5\):245–250, 2004\.
- \[Han08\]Yijie Han\.AnO\(n3\(loglogn/logn\)5/4\)O\(n^\{3\}\(\\log\\log n/\\log n\)^\{5/4\}\)time algorithm for all pairs shortest path\.Algorithmica, 51\(4\):428–434, 2008\.Preliminary version in ESA 2006\.
- \[Her14\]Timon Hertli\.3\-SAT faster and simpler—unique\-SAT bounds for PPSZ hold in general\.SIAM Journal on Computing, 43\(2\):718–729, 2014\.
- \[HKNS15\]Monika Henzinger, Sebastian Krinninger, Danupon Nanongkai, and Thatchaphol Saranurak\.Unifying and strengthening hardness for dynamic problems via the online matrix\-vector multiplication conjecture\.InProc\. 47th ACM Symposium on Theory of Computing \(STOC 2015\), pages 21–30, 2015\.
- \[HLS24\]Bernhard Haeupler, Yaowei Long, and Thatchaphol Saranurak\.Dynamic deterministic constant\-approximate distance oracles withnϵn^\{\\epsilon\}worst\-case update time\.InProc\. 65th IEEE Symposium on Foundations of Computer Science \(FOCS 2024\), pages 2033–2044, 2024\.
- \[HT16\]Yijie Han and Tadao Takaoka\.AnO\(n3loglogn/log2n\)O\(n^\{3\}\\log\\log n/\\log^\{2\}n\)time algorithm for all pairs shortest paths\.Journal of Discrete Algorithms, 38–41:9–19, 2016\.Preliminary version in SWAT 2012\.
- \[IP01\]Russell Impagliazzo and Ramamohan Paturi\.On the complexity ofkk\-SAT\.Journal of Computer and System Sciences, 62\(2\):367–375, 2001\.
- \[IPZ01\]Russell Impagliazzo, Ramamohan Paturi, and Francis Zane\.Which problems have strongly exponential complexity?Journal of Computer and System Sciences, 63\(4\):512–530, 2001\.
- \[IR78\]Alon Itai and Michael Rodeh\.Finding a minimum circuit in a graph\.SIAM Journal on Computing, 7\(4\):413–423, 1978\.
- \[Jin24\]Ce Jin\.0\-1 knapsack in nearly quadratic time\.InProc\. 56th ACM Symposium on Theory of Computing \(STOC 2024\), pages 271–282, 2024\.
- \[Joh77\]Donald B\. Johnson\.Efficient algorithms for shortest paths in sparse networks\.Journal of the ACM, 24\(1\):1–13, 1977\.
- \[JV16\]Zahra Jafargholi and Emanuele Viola\.3SUM, 3XOR, triangles\.Algorithmica, 74\(1\):326–343, 2016\.
- \[JX23\]Ce Jin and Yinzhan Xu\.Removing additive structure in 3SUM\-based reductions\.InProc\. 55th ACM Symposium on Theory of Computing \(STOC 2023\), pages 405–418, 2023\.
- \[Kar72\]Richard M\. Karp\.Reducibility among combinatorial problems\.InComplexity of Computer Computations, pages 85–103\. Plenum Press, 1972\.
- \[Ker70\]Leslie Robert Kerr\.The Effect of Algebraic Structure on the Computational Complexity of Matrix Multiplication\.PhD thesis, Cornell University, 1970\.
- \[KKP93\]David R\. Karger, Daphne Koller, and Steven J\. Phillips\.Finding the hidden path: Time bounds for all\-pairs shortest paths\.SIAM Journal on Computing, 22\(6\):1199–1217, 1993\.
- \[KLM19\]Daniel M\. Kane, Shachar Lovett, and Shay Moran\.Near\-optimal linear decision trees forkk\-SUM and related problems\.Journal of the ACM, 66\(3\):16:1–16:18, 2019\.
- \[KM23\]Manuel Kauers and Jakob Moosbauer\.Flip graphs for matrix multiplication\.InProc\. 48th International Symposium on Symbolic and Algebraic Computation \(ISSAC 2023\), pages 381–388, 2023\.
- \[KP19\]Tsvi Kopelowitz and Ely Porat\.The strong 3SUM\-INDEXING conjecture is false\.arXiv:1907\.11206, 2019\.
- \[KPP16\]Tsvi Kopelowitz, Seth Pettie, and Ely Porat\.Higher lower bounds from the 3SUM conjecture\.InProc\. 27th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2016\), pages 1272–1287, 2016\.
- \[KPS17\]Marvin Künnemann, Ramamohan Paturi, and Stefan Schneider\.On the fine\-grained complexity of one\-dimensional dynamic programming\.InProc\. 44th International Colloquium on Automata, Languages, and Programming \(ICALP 2017\), volume 80 ofLIPIcs, pages 21:1–21:15, 2017\.
- \[KS20\]Elaye Karstadt and Oded Schwartz\.Matrix multiplication, a little faster\.Journal of the ACM, 67\(1\):1:1–1:31, 2020\.Preliminary version in SPAA 2017\.
- \[KV20\]Tsvi Kopelowitz and Virginia Vassilevska Williams\.Towards optimal set\-disjointness and set\-intersection data structures\.InProc\. 47th International Colloquium on Automata, Languages, and Programming \(ICALP 2020\), volume 168 ofLIPIcs, pages 74:1–74:16, 2020\.
- \[LG12\]François Le Gall\.Faster algorithms for rectangular matrix multiplication\.InProc\. 53rd IEEE Symposium on Foundations of Computer Science \(FOCS 2012\), pages 514–523, 2012\.
- \[LLV19\]Rio LaVigne, Andrea Lincoln, and Virginia Vassilevska Williams\.Public\-key cryptography in the fine\-grained setting\.InAdvances in Cryptology – CRYPTO 2019, Part III, volume 11694 ofLNCS, pages 605–635, 2019\.
- \[Lov75\]László Lovász\.On the ratio of optimal integral and fractional covers\.Discrete Mathematics, 13\(4\):383–390, 1975\.
- \[LPV20\]Andrea Lincoln, Adam Polak, and Virginia Vassilevska Williams\.Monochromatic triangles, intermediate matrix products, and convolutions\.InProc\. 11th Innovations in Theoretical Computer Science Conference \(ITCS 2020\), volume 151 ofLIPIcs, pages 53:1–53:18, 2020\.Full version: arXiv:2009\.14479, whose statement of Theorem 8 we follow\.
- \[LU18\]François Le Gall and Florent Urrutia\.Improved rectangular matrix multiplication using powers of the Coppersmith–Winograd tensor\.InProc\. 29th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2018\), pages 1029–1046, 2018\.
- \[LVW18\]Andrea Lincoln, Virginia Vassilevska Williams, and R\. Ryan Williams\.Tight hardness for shortest cycles and paths in sparse graphs\.InProc\. 29th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2018\), pages 1236–1252, 2018\.
- \[LVWW16\]Andrea Lincoln, Virginia Vassilevska Williams, Joshua R\. Wang, and R\. Ryan Williams\.Deterministic time\-space trade\-offs forkk\-SUM\.InProc\. 43rd International Colloquium on Automata, Languages, and Programming \(ICALP 2016\), volume 55 ofLIPIcs, pages 58:1–58:14, 2016\.
- \[Mao21\]Xiao Mao\.Breaking the cubic barrier for \(unweighted\) tree edit distance\.InProc\. 62nd IEEE Symposium on Foundations of Computer Science \(FOCS 2021\), pages 792–803, 2021\.Journal version: SIAM J\. Comput\., pp\. FOCS21\-195–FOCS21\-223, 2023\.
- \[Mar71\]John D\. Markel\.FFT pruning\.IEEE Transactions on Audio and Electroacoustics, 19\(4\):305–311, 1971\.
- \[Mat91\]Jiří Matoušek\.Computing dominances inEnE^\{n\}\.Information Processing Letters, 38\(5\):277–278, 1991\.
- \[Mey84\]Friedhelm Meyer auf der Heide\.A polynomial linear search algorithm for thenn\-dimensional knapsack problem\.Journal of the ACM, 31\(3\):668–676, 1984\.
- \[MS25\]Erik Mårtensson and Paul Stankovski Wagner\.The number of the beast: Reducing additions in fast matrix multiplication algorithms for dimensions up to 666\.InProc\. SIAM Conference on Applied and Computational Discrete Algorithms \(ACDA 2025\), pages 47–60, 2025\.
- \[NP85\]Jaroslav Nešetřil and Svatopluk Poljak\.On the complexity of the subgraph problem\.Commentationes Mathematicae Universitatis Carolinae, 26\(2\):415–419, 1985\.
- \[NPS\+25\]Jakob Nogler, Adam Polak, Barna Saha, Virginia Vassilevska Williams, Yinzhan Xu, and Christopher Ye\.Faster weighted and unweighted tree edit distance and APSP equivalence\.InProc\. 57th ACM Symposium on Theory of Computing \(STOC 2025\), pages 2167–2178, 2025\.
- \[NVE\+25\]Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po\-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco J\. R\. Ruiz, Abbas Mehrabian, M\. Pawan Kumar, Abigail See, Swarat Chaudhuri, George Holland, Alex Davies, Sebastian Nowozin, Pushmeet Kohli, and Matej Balog\.AlphaEvolve: A coding agent for scientific and algorithmic discovery\.arXiv:2506\.13131, 2025\.
- \[Păt10\]Mihai Pătraşcu\.Towards polynomial lower bounds for dynamic problems\.InProc\. 42nd ACM Symposium on Theory of Computing \(STOC 2010\), pages 603–610, 2010\.
- \[PPSZ05\]Ramamohan Paturi, Pavel Pudlák, Michael E\. Saks, and Francis Zane\.An improved exponential\-time algorithm forkk\-SAT\.Journal of the ACM, 52\(3\):337–364, 2005\.
- \[PS14\]Rasmus Pagh and Morten Stöckel\.The input/output complexity of sparse matrix multiplication\.InProc\. 22nd European Symposium on Algorithms \(ESA 2014\), volume 8737 ofLNCS, pages 750–761, 2014\.
- \[RV11\]Liam Roditty and Virginia Vassilevska Williams\.Minimum weight cycles and triangles: Equivalences and algorithms\.InProc\. 52nd IEEE Symposium on Foundations of Computer Science \(FOCS 2011\), pages 180–189, 2011\.
- \[RV12\]Liam Roditty and Virginia Vassilevska Williams\.Subquadratic time approximation algorithms for the girth\.InProc\. 23rd ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2012\), pages 833–845, 2012\.
- \[RZ04\]Liam Roditty and Uri Zwick\.On dynamic shortest paths problems\.InProc\. 12th European Symposium on Algorithms \(ESA 2004\), volume 3221 ofLNCS, pages 580–591, 2004\.Journal version: Algorithmica 61\(2\):389–401, 2011\.
- \[San04\]Piotr Sankowski\.Dynamic transitive closure via dynamic matrix inverse\.InProc\. 45th IEEE Symposium on Foundations of Computer Science \(FOCS 2004\), pages 509–517, 2004\.
- \[SB93\]Henrik V\. Sorensen and C\. Sidney Burrus\.Efficient computation of the DFT with only a subset of input or output points\.IEEE Transactions on Signal Processing, 41\(3\):1184–1200, 1993\.
- \[Sch81\]Arnold Schönhage\.Partial and total matrix multiplication\.SIAM Journal on Computing, 10\(3\):434–455, 1981\.
- \[Sch99\]Uwe Schöning\.A probabilistic algorithm forkk\-SAT and constraint satisfaction problems\.InProc\. 40th IEEE Symposium on Foundations of Computer Science \(FOCS 1999\), pages 410–414, 1999\.
- \[Sei95\]Raimund Seidel\.On the all\-pairs\-shortest\-path problem in unweighted undirected graphs\.Journal of Computer and System Sciences, 51\(3\):400–403, 1995\.
- \[SEO03\]Michael Soss, Jeff Erickson, and Mark H\. Overmars\.Preprocessing chains for fast dihedral rotations is hard or even impossible\.Computational Geometry: Theory and Applications, 26\(3\):235–246, 2003\.
- \[Str69\]Volker Strassen\.Gaussian elimination is not optimal\.Numerische Mathematik, 13:354–356, 1969\.
- \[Str73\]Volker Strassen\.Vermeidung von Divisionen\.Journal für die reine und angewandte Mathematik, 264:184–202, 1973\.
- \[SVX27\]Nathan Sheffield, Virginia Vassilevska Williams, and Zoe Xi\.The limits of black\-box reductions for all\-pairs triangle detection\.InProc\. 38th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2027\), 2027\.To appear\. Full version: arXiv:2608\.19092\.
- \[Tak92\]Tadao Takaoka\.A new upper bound on the complexity of the all pairs shortest path problem\.Information Processing Letters, 43\(4\):195–199, 1992\.
- \[Tak04\]Tadao Takaoka\.A faster algorithm for the all\-pairs shortest path problem and its application\.InProc\. 10th International Computing and Combinatorics Conference \(COCOON 2004\), volume 3106 ofLNCS, pages 278–289, 2004\.
- \[Tak05\]Tadao Takaoka\.AnO\(n3loglogn/logn\)O\(n^\{3\}\\log\\log n/\\log n\)time algorithm for the all\-pairs shortest path problem\.Information Processing Letters, 96\(5\):155–161, 2005\.
- \[TT00\]Hisao Tamaki and Takeshi Tokuyama\.Algorithms for the maximum subarray problem based on matrix multiplication\.Interdisciplinary Information Sciences, 6\(2\):99–104, 2000\.Preliminary version in SODA 1998\.
- \[Vas18\]Virginia Vassilevska Williams\.On some fine\-grained questions in algorithms and complexity\.InProceedings of the International Congress of Mathematicians \(ICM 2018\), pages 3447–3487\. World Scientific, 2018\.
- \[vdBNS19\]Jan van den Brand, Danupon Nanongkai, and Thatchaphol Saranurak\.Dynamic matrix inverse: Improved algorithms and matching conditional lower bounds\.InProc\. 60th IEEE Symposium on Foundations of Computer Science \(FOCS 2019\), pages 456–480, 2019\.Full version: arXiv:1905\.05067\.
- \[vdBSZ24\]Jan van den Brand, Zhao Song, and Tianyi Zhou\.Algorithm and hardness for dynamic attention maintenance in large language models\.InProc\. 41st International Conference on Machine Learning \(ICML 2024\), volume 235 ofPMLR, pages 49008–49028, 2024\.
- \[VW10\]Virginia Vassilevska Williams and Ryan Williams\.Subcubic equivalences between path, matrix and triangle problems\.InProc\. 51st IEEE Symposium on Foundations of Computer Science \(FOCS 2010\), pages 645–654, 2010\.
- \[VW13\]Virginia Vassilevska Williams and Ryan Williams\.Finding, minimizing, and counting weighted subgraphs\.SIAM Journal on Computing, 42\(3\):831–854, 2013\.
- \[VW18\]Virginia Vassilevska Williams and R\. Ryan Williams\.Subcubic equivalences between path, matrix, and triangle problems\.Journal of the ACM, 65\(5\):27:1–27:38, 2018\.
- \[VX20\]Virginia Vassilevska Williams and Yinzhan Xu\.Monochromatic triangles, triangle listing and APSP\.InProc\. 61st IEEE Symposium on Foundations of Computer Science \(FOCS 2020\), pages 786–797, 2020\.Full version: arXiv:2007\.09318, whose numbering we follow\.
- \[VXXZ24\]Virginia Vassilevska Williams, Yinzhan Xu, Zixuan Xu, and Renfei Zhou\.New bounds for matrix multiplication: From alpha to omega\.InProc\. 35th ACM\-SIAM Symposium on Discrete Algorithms \(SODA 2024\), pages 3792–3835, 2024\.
- \[War62\]Stephen Warshall\.A theorem on Boolean matrices\.Journal of the ACM, 9\(1\):11–12, 1962\.
- \[Wil05\]Ryan Williams\.A new algorithm for optimal 2\-constraint satisfaction and its implications\.Theoretical Computer Science, 348\(2–3\):357–365, 2005\.
- \[Wil14\]R\. Ryan Williams\.The polynomial method in circuit complexity applied to algorithm design \(invited talk\)\.InProc\. 34th International Conference on Foundation of Software Technology and Theoretical Computer Science \(FSTTCS 2014\), volume 29 ofLIPIcs, pages 47–60, 2014\.
- \[Wil16\]R\. Ryan Williams\.Strong ETH breaks with Merlin and Arthur: Short non\-interactive proofs of batch evaluation\.InProc\. 31st Computational Complexity Conference \(CCC 2016\), volume 50 ofLIPIcs, pages 2:1–2:17, 2016\.
- \[Wil18\]R\. Ryan Williams\.Faster all\-pairs shortest paths via circuit complexity\.SIAM Journal on Computing, 47\(5\):1965–1985, 2018\.
- \[Wil24\]R\. Ryan Williams\.The orthogonal vectors conjecture and non\-uniform circuit lower bounds\.InProc\. 65th IEEE Symposium on Foundations of Computer Science \(FOCS 2024\), pages 1372–1387, 2024\.ECCC TR24\-142\.
- \[Yat37\]Frank Yates\.The design and analysis of factorial experiments\.Technical Communication 35, Imperial Bureau of Soil Science, Harpenden, 1937\.
- \[Yu18\]Huacheng Yu\.An improved combinatorial algorithm for Boolean matrix multiplication\.Information and Computation, 261:240–247, 2018\.
- \[YZ05a\]Raphael Yuster and Uri Zwick\.Answering distance queries in directed graphs using fast matrix multiplication\.InProc\. 46th IEEE Symposium on Foundations of Computer Science \(FOCS 2005\), pages 389–396, 2005\.
- \[YZ05b\]Raphael Yuster and Uri Zwick\.Fast sparse matrix multiplication\.ACM Transactions on Algorithms, 1\(1\):2–13, 2005\.
- \[Zwi02\]Uri Zwick\.All pairs shortest paths using bridging sets and rectangular matrix multiplication\.Journal of the ACM, 49\(3\):289–317, 2002\.
- \[Zwi06\]Uri Zwick\.A slightly improved sub\-cubic algorithm for the all pairs shortest paths problem with real edge lengths\.Algorithmica, 46\(2\):181–192, 2006\.Preliminary version in ISAAC 2004\.Similar Articles
@ryanlpeterman: Didn't realize 3SUM could be done faster then N^2 until I did this interview "Threesomes, Degenerates, and Love Triangl…
Discusses a 2014 paper that refutes the 3SUM conjecture by presenting subquadratic algorithms for the 3SUM problem, with implications for computational geometry and graph algorithms.
An unreleased Anthropic model made progress on one of math’s biggest unsolved problems
An unreleased Anthropic model made significant progress on the Riemann hypothesis, using 60 subagents and 31 million tokens to test 650 ideas and improve the lower bound, with results formalized in Lean.
For 31 years, mathematicians couldn’t finish this proof. The new paper says ChatGPT found most of the ideas and proofs behind a problem tied to efficient computer search and sampling, while the authors mostly worked to understand and explain it.
A new paper claims to present a proof of the 31-year-old Kannan-Lovász-Simonovits conjecture, building on Song and Zhang's recent criterion for high-dimensional convex bodies and log-concave measures. According to the article, ChatGPT generated most of the key ideas and proofs, with the human authors focused on understanding and explaining them.
Interesting thoughts from an expert on a specific problem (#180 Barnette's Conjecture) from OpenAl solutions
A user shares thoughts on an expert solution to Barnette's Conjecture (#180), highlighting a surprising technique involving complex-valued exponential sums on edges with annihilating terms resembling quantum physics calculations.
Sum-product, unit distances, and number fields
Thomas Bloom provides an expository blog post on recent counterexamples to the Erdős unit distance conjecture and sum-product conjecture over the reals, including an OpenAI-assisted disproof of the unit distance conjecture and a collaborative disproof of the sum-product conjecture, sketching the constructions and intuition behind them.