Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.FixedPrime.TimeBound

Aggregate box-backed native fixed-prime charges #

For m = 9k, the actual producer chunk cardinalities derive occurrence sparsity for every real product. Summing over the existing finite instances gives an aggregate product saving, with the one-time preparation and all root/query/controller costs separate. Failed original-weight scans use one global F(p)+1 reserve, not that reserve per instance. The fixed prime is still an input: this does not select parameters or establish the final ET/3SUM source exponent.

noncomputable def Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.timeBound {m n : ℕ} (hn : 0 < n) (g p : ℕ) (values : List ℤ) (mem : ℕ → ℕ) :

Conservative complete envelope: standalone preparation, all logical record charges, one global failed-scan budget and controller/loop/halt work. The one-slot solver fits this envelope without executing the standalone all-record preparation. No workspace clearing is charged.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.products_time_le {k n g p : ℕ} (hn : 0 < n) (values : ℕ → ℤ) (mem : ℕ → ℕ) (hD : 16 ≤ MatrixMultiplication.Schonhage.D (9 * k)) (hg : 1 ≤ g) (hp : p ∈ (MatrixMultiplication.Schonhage.D (9 * k)).sqrtPrimeWindow) (hN : MatrixMultiplication.Schonhage.D (9 * k) ^ 18 ≤ n) :
have I := ExactTriangle.instanceIndices (fun (u v : Fin n) => values (Matrix.pairIndex (u, v))) (MatrixMultiplication.Schonhage.D (9 * k)) g p; have qs := fun (idx : ExactTriangle.InstanceIndex p) => RecordProduct.decodedQueries hn mem (RecordProduct.recordQueries n (MatrixMultiplication.Schonhage.D (9 * k)) p idx) (RecordProduct.recordQueryCount n (MatrixMultiplication.Schonhage.D (9 * k)) p values idx); ↑(∑ idx ∈ I, (RecordBoxProduct.timeBound (qs idx) + 1)) ≤ 125829120 * ↑(189 * k + 1) ^ 2 * ↑(9 * k + 1) * ↑(MatrixMultiplication.Schonhage.D (9 * k)) ^ (-(8 / 125)) * ↑n ^ 3 * ↑g

The existing finite family bounds the sum of actual queried-product charges, including a standalone halt for each term as a conservative upper bound. Every occurrence bound is derived from the real chunk count; there is no supplied sparse execution or solver premise.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.FixedPrime.timeBound_le {k n g p : ℕ} (hn : 0 < n) (values : List ℤ) (mem : ℕ → ℕ) (hD : 16 ≤ MatrixMultiplication.Schonhage.D (9 * k)) (hg : 1 ≤ g) (hp : p ∈ (MatrixMultiplication.Schonhage.D (9 * k)).sqrtPrimeWindow) (hN : MatrixMultiplication.Schonhage.D (9 * k) ^ 18 ≤ n) :
have V := fun (q : ℕ) => values.getD q 0; have F := ExactTriangle.falsePositiveCount (fun (u v : Fin n) => V (Matrix.pairIndex (u, v))) (fun (b c : Fin n) => V (n * n + Matrix.pairIndex (b, c))) (fun (u c : Fin n) => V (2 * (n * n) + Matrix.pairIndex (u, c))) p; ↑(timeBound hn g p values mem) ≤ 690 * ↑n ^ 2 * ↑(MatrixMultiplication.Schonhage.D (9 * k)) * ↑g + 125829120 * ↑(189 * k + 1) ^ 2 * ↑(9 * k + 1) * ↑(MatrixMultiplication.Schonhage.D (9 * k)) ^ (-(8 / 125)) * ↑n ^ 3 * ↑g + 4 * ↑n * ↑g * ↑(5 * (MatrixMultiplication.Schonhage.D (9 * k)).sqrt + 8 * ExactTriangle.queryCap n (MatrixMultiplication.Schonhage.D (9 * k)) + 61) + ↑((42 * ExactTriangle.pieceSize (MatrixMultiplication.Schonhage.D (9 * k)) g + 28) * (F + 1) + 7)

Complete halt-inclusive charged bound, retaining the one-time producer and the single global failed-scan reserve. Root, query, ordinal, call, return and loop overheads are explicit. In particular this is not a prime-selection or an unconditional aggregate exponent theorem.