Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.Fast

Actual selected-prime complete fast execution #

The real selector returns a minimum modular-count prime. One actual instruction delivers that prime to the complete callable solver. Original readback survives the selector's dirty scratch, and the final workspace frame covers the union of the actual counting and solving intervals. These are internal staged rules: the whole program computes the parameter postconditions and derives all numerical fits from original inputs.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.exec_fast {w W n F b : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hv : ∀ z ∈ values, z.natAbs ≤ F) (hblocks : 0 < ExactTriangle.ParameterChoice.blocks n) (x : WordRAM.Data 640) (xn : x.regs CallableFixedPrime.Reg.n = n) (xd : x.regs (parameterBank DyadicParameters.Reg.window) = MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) (xg : x.regs (parameterBank DyadicParameters.Reg.groups) = ExactTriangle.ParameterChoice.groups n) (xb : x.regs CallableFixedPrime.Reg.base = b) (hab : x.regs CallableFixedPrime.Reg.ab + n * n ≤ b) (hbc : x.regs CallableFixedPrime.Reg.bc + n * n ≤ b) (hac : x.regs CallableFixedPrime.Reg.ac + n * n ≤ b) (vab : ∀ q < n * n, x.mem (x.regs CallableFixedPrime.Reg.ab + q) = WordRAM.Signed.encode (values.getD q 0)) (vbc : ∀ q < n * n, x.mem (x.regs CallableFixedPrime.Reg.bc + q) = WordRAM.Signed.encode (values.getD (n * n + q) 0)) (vac : ∀ q < n * n, x.mem (x.regs CallableFixedPrime.Reg.ac + q) = WordRAM.Signed.encode (values.getD (2 * (n * n) + q) 0)) (hmag : GenericRAM.Signed.Fits w ↑(CountPrime.magnitudeBudget (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)).sqrt (Nat.clog 2 n) F)) (haddr : WordRAM.Fits (w + 2) (CountPrime.addressBudget n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)).sqrt (Nat.clog 2 n) b (x.regs CallableFixedPrime.Reg.ab) (x.regs CallableFixedPrime.Reg.bc) (x.regs CallableFixedPrime.Reg.ac))) (hwidth : w + 2 ≤ W) (hctrl : WordRAM.Fits W (4 * (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n) + 2) * (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n) + 2) + 4)) (hfit : WordRAM.Fits W (b + 4 * CallableFixedPrime.windowSize n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) (ExactTriangle.ParameterChoice.groups n) (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)).sqrt (CallableFixedPrime.rawTotal n values) + 1024)) :
have V := fun (q : ℕ) => values.getD q 0; have A := fun (i j : Fin n) => V (Matrix.pairIndex (i, j)); have B := fun (i j : Fin n) => V (n * n + Matrix.pairIndex (i, j)); have C := fun (i j : Fin n) => V (2 * (n * n) + Matrix.pairIndex (i, j)); have hn := ⋯; ∃ (p : ℕ) (a : WordRAM.Data 64), ExactTriangle.IsSelectedPrime A B C (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) p ∧ Instances.Output n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) (ExactTriangle.ParameterChoice.groups n) p V (WordRAM.Data.init (PreparationInput.input n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) (ExactTriangle.ParameterChoice.groups n) p values)) a ∧ ∃ (y : WordRAM.Data 640), WordRAM.ExecWithin W fast x y (8 + PrimeSelection.timeBound n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) + 1 + CallableFixedPrime.timeBound hn (ExactTriangle.ParameterChoice.groups n) p values a.mem) ∧ (y.regs CallableFixedPrime.Reg.found = 0 ∨ y.regs CallableFixedPrime.Reg.found = 1) ∧ (y.regs CallableFixedPrime.Reg.found = 1 ↔ ExactTriangle.HasZeroTriangle A B C) ∧ y.regs CallableFixedPrime.Reg.scans ≤ ExactTriangle.falsePositiveCount A B C p + y.regs CallableFixedPrime.Reg.found ∧ (∀ (q : ℕ), q < b ∨ max (CountPrime.memoryEnd n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)).sqrt (Nat.clog 2 n) b) (b + CallableFixedPrime.windowSize n (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)) (ExactTriangle.ParameterChoice.groups n) (MatrixMultiplication.Schonhage.D (ExactTriangle.ParameterChoice.level n)).sqrt (CallableFixedPrime.rawTotal n values)) ≤ q → y.mem q = x.mem q) ∧ ∀ (j : Fin 640), 143 ≤ ↑j ∧ ↑j < 160 ∨ j = CallableFixedPrime.Reg.n ∨ 604 ≤ ↑j ∧ ↑j ≤ 607 → y.regs j = x.regs j

Concrete selection followed by the complete concrete solver, with both verdict directions. Parameter postconditions here are established by the real preceding parameter execution; none is a runtime certificate or a hypothesis about an unspecified algorithm.