Two WordRAM models: simulation and runtime transfer
DefinitionWordRAM_APSP_BridgeCompare the WordRAM model with unsigned pointers, bit operations, and shifts to the WordRAM model with signed pointers and branching on sign. Both have bounded-word arithmetic and multiplication. Use the existing native-free programs for the former and the existing instruction lists for the latter.
For positive source word width w, widen the target to w+4 bits. Map a natural source address a to signed target address 8+2a. In the other direction map integer source address z to natural target address 8+2zigzag(z), where zigzag(a)=2a and zigzag(-a-1)=2a+1. Store source words by zero extension, put the source width in cell zero, and initialize other cells outside the image to zero. The final-memory relations require exact preservation of every mapped source word; reserved and scratch cells are unconstrained by those relations.
Runs start at program counter zero. The model with unsigned pointers starts unhalted with zero ticks. Define the time bound B(C,d,t,w)=C(t+w+1)(w+1)^d. Each simulation predicate requires that a source halt by fuel t yields a target halt by some fuel u≤B, with related final memory. Every target halt by fuel u must conversely arise from a source halt by some t≤u. Explicit halt in the model with unsigned pointers becomes accept in the other model. In the reverse direction, accept/reject becomes an explicit halt with the Boolean verdict encoded as 1/0 in reserved cell one.
UniformOperationalSimulation groups these two requirements, using one exponent d. The source memories are arbitrary total functions and source widths are positive.
For problem-level runtime transfer, use ordinary packed integer inputs in both machines: n in cell zero, followed by the input list, then zeros. The wordramSolvedBy predicate runs a native-free program in the model with unsigned pointers directly, requires a Boolean verdict in final cell zero, and interprets the signed output cells immediately after the input. It uses the given problem’s own instance type, input, acceptance condition, and output condition. This packed-word convention is the fine-grained interface; the NP-oriented BitIO interface remains available separately.
APSPSolves and WordRAMSolves require a fixed program and one time bound T(n), valid for every n and instance with input magnitudes at most n^κ and every physical word width above b(⌊log₂ n⌋+1). Widths in the model with unsigned pointers are positive; the model with signed pointers retains its original natural-width domain. WordRAMSolvedInTime quantifies a program, width coefficient, and time bound for every κ and uses the published BigO predicate. Identifiers containing APSP reflect the source namespace; the predicates quantify general problems.
FiniteIO Q K q bounds input length by B(n)=K(n+1)^q and requires that the output condition depend only on the first B(n) output words. The transfer bound is C(T(n)+B(n)+1)(⌊log₂ n⌋+1)^d. UniformTimeTransfer maps every correct source program/time witness to a target witness in both directions using this bound, starting from ordinary inputs and producing final outputs; initialization, conversion, and output recovery therefore count toward runtime. Target programs and constants are fixed before sizes, instances, and physical widths. The bound is independent of physical word width.
APSPBelow and WordRAMBelow mean solvability with some rational exponent strictly below a rational threshold R. FineGrainedTimeEquivalence equates these properties for every finite-I/O problem whenever q<R. The source problem adapter copies the published EndStatement problem fields into the equivalent TrulySubcubicAPSP problem structure so the existing 3SUM statement is reused.
import Definitions.Def_WordRAM_Complexity_Programs
import Definitions.Def_TrulySubcubicAPSP_WordRAM
import Definitions.Def_TrulySubcubicAPSP_Problems
import Definitions.Def_TrulySubcubicAPSP_SourceSpecification
set_option autoImplicit false
namespace WordRAM.APSPBridge
/-- Four additional bits leave room for the tagged address map and signed addressing. -/
def widened (w : Width) : Width where
bits := w.bits + 4
positive := by omega
/-- Interleave nonnegative and negative signed addresses. -/
def zigzag : Int → Nat
| .ofNat a => 2 * a
| .negSucc a => 2 * a + 1
def unzigzag (a : Nat) : Int :=
if a % 2 = 0 then Int.ofNat (a / 2) else Int.negSucc (a / 2)
/-- The original unsigned-addressed memory occupies positive even target cells. -/
def wordramAddress (a : Nat) : Int := Int.ofNat (8 + 2 * a)
/-- The signed-addressed memory occupies positive even target cells. -/
def apspAddress (a : Int) : Nat := 8 + 2 * zigzag a
/-- Copy each source word unchanged as an unsigned bit pattern. Cell zero supplies
the source width; the remaining cells outside the image start at zero. -/
def encodeWordRAMMemory (w : Width) (m : Memory w) : Int → BitVec (widened w).bits :=
fun a =>
if a = 0 then BitVec.ofNat (widened w).bits w.bits
else if 8 ≤ a ∧ a % 2 = 0 then
BitVec.ofNat (widened w).bits (m ((a.toNat - 8) / 2)).toNat
else 0
/-- Cell zero supplies the source width. The other reserved cells, including
verdict cell one, start at zero. Signed source addresses are mapped by `zigzag`. -/
def encodeAPSPMemory (w : Width) (m : Int → BitVec w.bits) : Memory (widened w) :=
fun a =>
if a = 0 then BitVec.ofNat (widened w).bits w.bits
else if 8 ≤ a ∧ a % 2 = 0 then
BitVec.ofNat (widened w).bits (m (unzigzag ((a - 8) / 2))).toNat
else 0
def WordRAMMemoryRelated (w : Width) (source : Memory w)
(target : Int → BitVec (widened w).bits) : Prop :=
∀ a, target (wordramAddress a) =
BitVec.ofNat (widened w).bits (source a).toNat
def APSPMemoryRelated (w : Width) (source : Int → BitVec w.bits)
(target : Memory (widened w)) : Prop :=
∀ a, target (apspAddress a) =
BitVec.ofNat (widened w).bits (source a).toNat
/-- A fresh run starts at PC zero, with no previous ticks and without a halt flag. -/
def wordramHalt (P : Complexity.Program .multiplication) (w : Width)
(input : Memory w) (t : Nat) (output : Memory w) : Prop :=
let s := WordRAM.run Uniform.noConstants (P.lower w) t { mem := input }
s.halted = true ∧ s.mem = output
def apspHalt (P : List TrulySubcubicAPSP.Instr) (w : Width)
(input : Int → BitVec w.bits) (t : Nat) (verdict : Bool)
(output : Int → BitVec w.bits) : Prop :=
TrulySubcubicAPSP.exec P t 0 input = some (verdict, output)
def simulationBound (C d t : Nat) (w : Width) : Nat :=
C * (t + w.bits + 1) * (w.bits + 1) ^ d
/-- Each successful source halt is simulated with a polynomial-in-width overhead.
Conversely, every target halt comes from a source halt. A source explicit halt
becomes an APSP `accept`; every source memory cell remains observable. -/
def WordRAMToAPSP (P : Complexity.Program .multiplication)
(Q : List TrulySubcubicAPSP.Instr) (C d : Nat) : Prop :=
∀ (w : Width) (input : Memory w),
(∀ t output, wordramHalt P w input t output →
∃ u, u ≤ simulationBound C d t w ∧
∃ targetOutput,
apspHalt Q (widened w) (encodeWordRAMMemory w input) u true targetOutput ∧
WordRAMMemoryRelated w output targetOutput) ∧
(∀ u verdict targetOutput,
apspHalt Q (widened w) (encodeWordRAMMemory w input) u verdict targetOutput →
verdict = true ∧
∃ t, t ≤ u ∧ ∃ output,
wordramHalt P w input t output ∧
WordRAMMemoryRelated w output targetOutput)
/-- The reverse simulation preserves the APSP verdict in reserved target cell
one, in addition to preserving the entire signed-addressed source memory. -/
def APSPToWordRAM (P : List TrulySubcubicAPSP.Instr)
(Q : Complexity.Program .multiplication) (C d : Nat) : Prop :=
∀ (w : Width) (input : Int → BitVec w.bits),
(∀ t verdict output, apspHalt P w input t verdict output →
∃ u, u ≤ simulationBound C d t w ∧ ∃ targetOutput,
wordramHalt Q (widened w) (encodeAPSPMemory w input) u targetOutput ∧
(targetOutput 1).toNat = verdict.toNat ∧
APSPMemoryRelated w output targetOutput) ∧
(∀ u targetOutput,
wordramHalt Q (widened w) (encodeAPSPMemory w input) u targetOutput →
∃ t, t ≤ u ∧ ∃ verdict output,
apspHalt P w input t verdict output ∧
(targetOutput 1).toNat = verdict.toNat ∧
APSPMemoryRelated w output targetOutput)
/-- A single exponent works for uniform simulators in both directions. -/
def UniformOperationalSimulation (d : Nat) : Prop :=
(∀ P : Complexity.Program .multiplication,
∃ Q : List TrulySubcubicAPSP.Instr, ∃ C : Nat,
0 < C ∧ WordRAMToAPSP P Q C d) ∧
(∀ P : List TrulySubcubicAPSP.Instr,
∃ Q : Complexity.Program .multiplication, ∃ C : Nat,
0 < C ∧ APSPToWordRAM P Q C d)
/-- Packed integer input for the unsigned-addressed machine: size in cell zero,
input entries in cells one onward, and zero in every remaining cell. -/
def packedInitialMemory (w : Width) (n : Nat) (input : List Int) : Memory w :=
fun a => BitVec.ofInt w.bits (((n : Int) :: input).getD a 0)
/-- A genuine run of our native-free multiplication model. The final cell zero
is a Boolean verdict; signed output begins immediately after the input. -/
def wordramSolvedBy (Q : TrulySubcubicAPSP.Problem) {n : Nat} (x : Q.Instance n)
(P : Complexity.Program .multiplication) (w : Width) (t : Nat) : Prop :=
∃ verdict : Bool, ∃ output : Memory w,
wordramHalt P w (packedInitialMemory w n (Q.input x)) t output ∧
(output 0).toNat = verdict.toNat ∧
(verdict = true ↔ Q.yes x) ∧
Q.output x (fun a => (output (1 + (Q.input x).length + a)).toInt)
/-- The published APSP input promise and its all-sufficiently-large-width
convention, with an explicit program and runtime witness. -/
def APSPSolves (Q : TrulySubcubicAPSP.Problem) (κ : Nat)
(P : List TrulySubcubicAPSP.Instr) (b : Nat) (T : Nat → Nat) : Prop :=
∀ (n : Nat) (x : Q.Instance n),
(∀ a ∈ Q.input x, a.natAbs ≤ n ^ κ) →
∀ W ≥ b * (Nat.log2 n + 1), Q.SolvedBy x P W (T n)
/-- The same input promise and width convention for our machine. Programs are
fixed before the size, instance, and physical word width are supplied. -/
def WordRAMSolves (Q : TrulySubcubicAPSP.Problem) (κ : Nat)
(P : Complexity.Program .multiplication) (b : Nat) (T : Nat → Nat) : Prop :=
∀ (n : Nat) (x : Q.Instance n),
(∀ a ∈ Q.input x, a.natAbs ≤ n ^ κ) →
∀ w : Width, b * (Nat.log2 n + 1) ≤ w.bits →
wordramSolvedBy Q x P w (T n)
def WordRAMSolvedInTime (Q : TrulySubcubicAPSP.Problem) (r : Rat) : Prop :=
∀ κ : Nat, ∃ (P : Complexity.Program .multiplication) (b : Nat) (T : Nat → Nat),
TrulySubcubicAPSP.BigO T r ∧ WordRAMSolves Q κ P b T
def ioBound (K q n : Nat) : Nat := K * (n + 1) ^ q
/-- Input length is bounded and the output condition observes only a bounded
prefix. The bound is an explicit polynomial, not an instance-dependent oracle. -/
def FiniteIO (Q : TrulySubcubicAPSP.Problem) (K q : Nat) : Prop :=
(∀ (n : Nat) (x : Q.Instance n), (Q.input x).length ≤ ioBound K q n) ∧
(∀ (n : Nat) (x : Q.Instance n) (f g : Nat → Int),
(∀ a, a < ioBound K q n → f a = g a) → (Q.output x f ↔ Q.output x g))
/-- End-to-end runtime, including finite input packing and output recovery.
The overhead depends on the problem size, not on the physical word width. -/
def transferBound (C d K q : Nat) (T : Nat → Nat) (n : Nat) : Nat :=
C * (T n + ioBound K q n + 1) * (Nat.log2 n + 1) ^ d
/-- Transfer witnesses in both directions. Each target must solve the original
problem from ordinary packed input, at every sufficiently large physical width. -/
def UniformTimeTransfer (d : Nat) : Prop :=
∀ (Q : TrulySubcubicAPSP.Problem) (K q : Nat), FiniteIO Q K q →
(∀ (κ : Nat) (P : List TrulySubcubicAPSP.Instr) (b : Nat) (T : Nat → Nat),
APSPSolves Q κ P b T →
∃ (P' : Complexity.Program .multiplication) (b' C : Nat),
0 < C ∧ WordRAMSolves Q κ P' b' (transferBound C d K q T)) ∧
(∀ (κ : Nat) (P : Complexity.Program .multiplication) (b : Nat) (T : Nat → Nat),
WordRAMSolves Q κ P b T →
∃ (P' : List TrulySubcubicAPSP.Instr) (b' C : Nat),
0 < C ∧ APSPSolves Q κ P' b' (transferBound C d K q T))
def APSPBelow (Q : TrulySubcubicAPSP.Problem) (R : Rat) : Prop :=
∃ r : Rat, r < R ∧ Q.SolvedInTime r
def WordRAMBelow (Q : TrulySubcubicAPSP.Problem) (R : Rat) : Prop :=
∃ r : Rat, r < R ∧ WordRAMSolvedInTime Q r
/-- Strict polynomial-exponent thresholds above the I/O exponent coincide.
This permits arbitrarily small exponent loss without asserting identical
exact-exponent runtime bounds. -/
def FineGrainedTimeEquivalence : Prop :=
∀ (Q : TrulySubcubicAPSP.Problem) (K q : Nat), FiniteIO Q K q →
∀ R : Rat, (q : Rat) < R → (APSPBelow Q R ↔ WordRAMBelow Q R)
/-- Preserve exactly the published source specification's instances, input,
decision predicate, and output predicate when moving between its namespaces. -/
def sourceProblem (Q : EndStatement.Problem) : TrulySubcubicAPSP.Problem where
Instance := Q.Instance
input := fun x => Q.input x
yes := fun x => Q.yes x
output := fun x out => Q.output x out
end WordRAM.APSPBridge
Read-back
What the Lean code literally says, in plain math · gpt-6
widened. For every word width whose bit count is a positive natural number, this definition returns the positive word width with exactly bits; it has no dependence on a program, input, or problem size.
zigzag. This function sends each integer to the natural number , and sends each negative integer written uniquely as with to . In particular, map respectively to .
unzigzag. For every natural number , this function returns the integer when is even, and the integer when is odd, where natural-number division is rounded down. In particular it returns at .
wordramAddress. For every natural-number source address , this definition returns the integer target address , without any modular reduction. Its image is exactly the even integer addresses at least .
apspAddress. For every integer source address , this definition returns the natural-number target address , where for and for . Addresses undergo no modular reduction; the image is exactly the even natural-number addresses at least .
encodeWordRAMMemory. Given a positive bit width and any memory , this defines an integer-addressed memory of -bit words. Address contains the -bit encoding of . At every even integer address , it contains the zero-extended unsigned source word ; every other address, including every negative address, contains zero. Thus source cell is copied to cell . The memory may have infinitely many nonzero source cells; no finite-support assumption is imposed.
encodeAPSPMemory. Given a positive bit width and any integer-addressed memory of -bit words, this defines a natural-number-addressed memory of -bit words. Cell contains . At an even address , let ; the cell contains the zero-extended unsigned bit pattern of if is even, and of if is odd. Every remaining cell, including cell , contains zero. Equivalently, source address is stored at , where for and . There is no restriction on the source memory's support.
WordRAMMemoryRelated. For every positive source bit width , natural-number-addressed source memory of -bit words, and integer-addressed target memory of -bit words, this proposition says that for every natural address , equals the zero-extension of the unsigned bit pattern . It constrains all source cells, including arbitrarily large addresses, and leaves every target cell outside these addresses unconstrained.
APSPMemoryRelated. For every positive source bit width , integer-addressed source memory of -bit words, and natural-number-addressed target memory of -bit words, this proposition says that for every integer address , equals the zero-extension of the unsigned source bit pattern , where for and . All positive and negative source cells are constrained; target cells outside this image, including cells and , are not constrained by this relation.
wordramHalt. Given a fixed finite width-independent multiplication-model program , a positive bit width , two arbitrary memories on natural-number addresses with -bit words, and a natural fuel bound , this proposition says that execution from memory , program counter , tick count , and halt flag false, after being allowed interpreter steps, has halt flag true and memory exactly . The program permits copying, addition, subtraction, multiplication modulo , zero-filling left and right shifts by unsigned word values, bitwise AND, OR and NOT, unconditional jumps, unsigned equality/strict-order/non-strict-order branches, and explicit halt; operands may be natural immediates reduced modulo or memory reads, with natural direct addresses or indirect addresses obtained from unsigned pointer words. There are no native constants. Each executed instruction, including halt, costs one step; after halt the state stays fixed, and an invalid instruction fetch leaves the machine stuck without setting its halt flag. Thus this means explicit halt within steps, not first halt exactly at ; it is false for , and equality of output memories includes every address.
apspHalt. Given a finite signed-addressed program , a positive bit width , arbitrary integer-addressed -bit input and output memories , a natural fuel bound , and a Boolean , this proposition says that execution beginning at program position with memory returns exactly verdict and final memory within steps. Instructions write the constant one, add, subtract or multiply words modulo , load or store indirectly using a pointer word's signed two's-complement value, branch to a natural program position on a negative signed word, accept, or reject; literal memory addresses are integers. Ordinary writes advance to the next instruction. Each instruction, including acceptance, rejection, or the default rejection for a fetch beyond the program, consumes one fuel step; zero fuel returns no result. Consequently the proposition is false at , and a successful result need not first occur exactly at the supplied bound.
simulationBound. For arbitrary natural numbers and a positive word width with bit count , the defined natural number is exactly . In particular gives zero, removes the power factor, and still leaves the additive width term.
WordRAMToAPSP. For a fixed finite width-independent natural-addressed multiplication program without native constants, a finite integer-addressed add/subtract/multiply/load/store/negative-branch/accept/reject program , and arbitrary naturals , this proposition requires both following implications for every positive source bit width and every source memory , with no support restriction. Initialize at width with cell equal to , cell equal to the zero-extended unsigned word for every natural , and all other cells zero. For every natural and memory , if from its fresh state on explicitly halts within unit instruction steps with memory , there exist a natural and a target memory such that from position zero accepts within steps with memory , and equals the zero-extended for every natural . Conversely, for every natural , Boolean , and target memory , if this initialized returns within steps, then is true and there exist and a source memory such that explicitly halts within steps with memory and the same equality holds at every embedded source address. Source out-of-range fetches are stuck rather than successful halts; target out-of-range fetches reject. Both halting steps are counted, both start at program counter zero, and no run succeeds with zero fuel. The definition does not require and gives no additional conditions on target output cells outside the embedded memory.
APSPToWordRAM. For a finite integer-addressed add/subtract/multiply/load/store/negative-branch/accept/reject program , a fixed finite width-independent natural-addressed multiplication program without native constants, and arbitrary naturals , the following holds for every positive source bit width and every integer-addressed source memory . Initialize at width with cell equal to , cell equal to the zero-extended unsigned word for every integer , and all other cells zero, where for and . For every natural , Boolean , and source memory , a source return from position zero within steps implies the existence of a natural and target memory such that from its fresh state explicitly halts within steps with memory , the unsigned value of is for true and for false , and is the zero-extension of for every integer . Conversely, for every natural and memory , any explicit halt of this initialized within steps implies the existence of , a Boolean , and a source memory giving a source return within steps and exactly those same verdict-cell and embedded-memory equalities. All instruction and halting steps cost one; source out-of-range fetches reject, target invalid fetches are stuck, and zero fuel never succeeds. Neither finite support nor is required, and other target output cells are unconstrained.
UniformOperationalSimulation. For a natural exponent , this proposition is the conjunction of two uniform existence assertions. Every finite width-independent natural-addressed multiplication program without native constants has a finite signed-addressed arithmetic/load/store/negative-branch/accept/reject simulator and a positive natural constant ; every finite program of the latter kind has a finite width-independent native-free multiplication simulator of the former kind and a positive natural constant . In either direction are chosen before the positive source width , arbitrary source memory, and fuel bounds. The target width is , cell initially contains , every source bit pattern is zero-extended into cell for natural source addresses or for integer source addresses, with for and , and other target cells initially vanish. Every source halt within any bound has a target halt within some preserving every embedded memory cell. Every target halt within any bound arises from a source halt within some preserving those same cells. Natural-addressed source explicit halts become acceptance and every target verdict is true; in the reverse direction the source Boolean verdict is recorded as unsigned or in target cell . Execution begins at position zero, natural-addressed runs begin unhalted with zero ticks, halting instructions cost one, signed-addressed invalid fetches reject, and natural-addressed invalid fetches do not halt. The same serves both directions and all programs; the simulators and constants may depend on the source program.
packedInitialMemory. For every positive bit width , natural size , and finite list of integers , this defines a memory on all natural addresses: cell contains modulo , cells through the length of contain the entries of in order, each reduced modulo , and every later cell contains zero. The size and the list length need not agree, and no representability or magnitude assumption is made; and the empty list are allowed.
wordramSolvedBy. Given a problem consisting of an instance type at each natural size, an integer input list, a decision predicate, and a predicate on integer output sequences, a natural size (an implicit argument), an instance of size , a fixed finite width-independent natural-addressed multiplication program without native constants, a positive bit width , and a natural bound , this says that there exist a Boolean and an -bit output memory such that , started at position zero, unhalted and with zero ticks, explicitly halts within unit steps on the memory containing in cell , 's input list in subsequent cells, and zeros elsewhere, all entries reduced modulo . The unsigned value of must equal the Boolean encoding of ( or ), is true if and only if the decision predicate holds for , and the output predicate must hold for the sequence whose term at each natural is the signed two's-complement value of . Thus the output starts immediately after the input and is required even for a rejecting verdict. No input-size promise or adequacy of the width is assumed here; invalid fetches are not successful halts, and cannot satisfy the proposition.
APSPSolves. Given a problem with size-indexed instances, integer input lists, decision and output predicates, naturals , a fixed finite signed-addressed arithmetic/load/store/negative-branch/accept/reject program , and a function , this proposition says: for every natural size and every instance of size whose every input integer satisfies , and for every natural bit width , running at position zero with in cell , the input list in subsequent nonnegative cells, and zeros everywhere else (including negative addresses), all values reduced modulo , returns some Boolean and memory within unit steps. It requires if and only if 's decision predicate holds, and requires 's output predicate on the signed values for all natural output indices . Accept, reject, and default out-of-range rejection each count as a step. The program, , and are fixed for all ; there is no upper bound on and the runtime bound is independent of . Here and it is the floor of the base-two logarithm for positive ; sizes zero and one are included, as are with and , in which case width zero is also required. The input promise is vacuous for an empty input list; no instance satisfies any additional, unstated promise.
WordRAMSolves. Given a problem with size-indexed instances, integer input lists, decision and output predicates, naturals , a fixed finite width-independent natural-addressed multiplication program without native constants, and a function , this requires that for every natural , every instance of size whose input integers all satisfy , and every positive bit width , the fresh run of from position zero explicitly halts within unit instruction steps on memory containing , followed by the input list, followed by zeros, with every value reduced modulo . Some Boolean and final memory must have the unsigned value of cell equal to the encoding or of , have true exactly when the decision predicate holds, and satisfy the output predicate on the signed values in cells , for every natural output index . The output condition applies to either verdict. An invalid fetch does not count as a halt. The fixed program's natural immediates are reduced at each width. All sufficiently large positive physical widths are required with the same and no upper width bound; may be zero but width zero is excluded. The cases , , empty input lists, and empty instance types are included, with and .
WordRAMSolvedInTime. For a problem with size-indexed instances, integer input lists and decision/output predicates, and any rational in its reduced representation with positive denominator , this proposition requires that for every natural input-magnitude exponent there exist a finite width-independent native-free natural-addressed multiplication program , a natural , and such that for some natural , for every , and the following correctness holds for every natural and every size- instance whose input integers have absolute values at most : at every positive width , explicitly halts within unit steps on the packed memory consisting of , the input list, then zeros, all reduced modulo . Its final cell is unsigned or , indicating the truth of the decision predicate, and the signed words immediately after the input satisfy the output predicate. The witnesses may depend on , but not on , the instance, or the physical width. Correctness includes while the displayed growth inequality does not; , , and is allowed. The definition accepts negative , for which the exponent of in the growth inequality is truncated to zero rather than interpreted as a negative power.
ioBound. For arbitrary natural , this defines exactly . In particular it is for , it is for , and it is at .
FiniteIO. Given a problem with size-indexed instances, integer input lists and decision/output predicates and naturals , this proposition is the conjunction of: for every natural size and every size- instance , the input list has length at most ; and for every such and every two integer sequences , equality at all natural indices implies equivalence of the output predicate evaluated at and at . There is no restriction on the decision predicate, input magnitudes, or output magnitudes, and the conditions apply to all instances rather than only instances meeting a magnitude promise. At every input list must be empty and the output predicate must have the same truth value for every pair of sequences, though that value may be false; at the bound is . Any condition at a size having no instances is vacuous.
transferBound. For arbitrary natural constants , any function , and any natural size , this defines exactly , where and for positive . The expression has no physical-word-width argument. It is zero if , its logarithmic factor is one if or , and it includes the input/output polynomial even if .
UniformTimeTransfer. For a natural , this proposition quantifies over every problem and every pair of naturals for which, at every natural size and every instance, the input length is at most and the output predicate depends only on the first entries of its integer output sequence. It asserts transfer in both directions between finite signed-addressed arithmetic/load/store/negative-branch/accept/reject programs and finite width-independent native-free natural-addressed multiplication programs. In either direction, for every natural input-magnitude exponent , source program , natural threshold coefficient , and function , if the source correctly solves within steps for every , every instance with input values bounded in absolute value by , and every source physical width at least , then there exist a target program , natural , and positive natural solving exactly the same instances at every target width at least within steps. Widths are arbitrary naturals for the signed-addressed machine, including zero when its threshold permits, and positive naturals for the natural-addressed machine. Both solvers start at position zero on ordinary packed input , then the input integers, then zeros (also zero at all negative addresses for the signed-addressed machine), with values reduced modulo , where is the physical bit width; signed outputs immediately after the input satisfy 's output predicate. Correctness requires acceptance exactly for the decision predicate in the signed-addressed machine, and explicit halt with that Boolean encoded as unsigned or in cell zero in the natural-addressed machine. Halting steps count, signed-addressed out-of-range fetches reject, and natural-addressed invalid fetches do not halt. Witnesses may depend on all preceding source data, but not on , the instance, or physical width. The assertion does not assume any growth bound on , includes , , and , and uses and .
APSPBelow. For any problem with size-indexed instances and integer input/decision/output data, and any rational threshold , this proposition asserts the existence of a rational such that for every natural there exist a finite signed-addressed arithmetic/load/store/negative-branch/accept/reject program , a natural , and satisfying both: if has positive reduced denominator , there is a natural with for all ; and for every natural size , every size- instance with all input absolute values at most , and every natural width , returns within counted instruction steps the correct Boolean verdict and a memory whose signed words immediately after the input satisfy the output predicate. The run starts at position zero with , then the input list, then zeros, all reduced modulo , and negative cells initially zero; out-of-range fetches reject. The exponent is chosen before ; program, , and may depend on , but not on size, instance, or width. Sizes still require correctness; includes width zero, , , and negative rational exponents use the displayed numerator truncation.
WordRAMBelow. For any problem with size-indexed instances and integer input/decision/output data, and any rational threshold , this asserts that some rational has the following property: for every natural , there exist a fixed finite width-independent natural-addressed multiplication program without native constants, a natural , and such that, writing in reduced form with , some natural satisfies for every , and for every natural , every size- instance whose input absolute values are at most , and every positive physical width , explicitly halts within unit instruction steps on packed memory , then input, then zeros, all reduced modulo . Final cell zero must be unsigned or and indicate exactly the decision predicate, and the signed output cells immediately after the input must satisfy the output predicate. An invalid fetch is not a successful halt. The exponent is chosen before , and each program, , and is fixed before the size, instance, and width. Correctness includes sizes although the growth condition does not; still permits only positive widths, , , and a negative numerator is truncated to zero in the growth condition.
FineGrainedTimeEquivalence. For every problem and naturals such that every size- input has length at most and, for every instance and every two integer output sequences agreeing at indices below this bound, the output predicate has equivalent truth values, this proposition requires the following for every rational : there exists a rational with a signed-addressed arithmetic/load/store/negative-branch/accept/reject solver of exponent if and only if there exists a rational with a native-free natural-addressed multiplication solver of exponent . An exponent (positive reduced denominator) means that for every natural magnitude exponent there are a fixed finite program, a natural , and with for all and some natural , solving every size- instance whose input absolute values are at most , at every physical width at least , within counted steps. Widths may be zero for the signed-addressed machine and must be positive for the natural-addressed machine. Runs use packed size and integer input, reduced modulo , where is the physical bit width, with all other cells initially zero; they return the correct verdict and signed output immediately after the input, the natural-addressed verdict being encoded as unsigned or in final cell zero and requiring explicit halt. Correctness includes , with and ; the growth condition truncates negative numerators. The two rational exponents, programs, width thresholds, and runtime functions need not coincide, and the equivalence itself does not assert that either solver exists. No conclusion at is included.
sourceProblem. For every problem in the namespace EndStatement, this constructs a problem in the namespace TrulySubcubicAPSP with exactly the same instance type at every natural size , exactly the same integer input list for each instance, exactly the same decision predicate, and exactly the same output predicate for every integer sequence indexed by the naturals. No encoding, restriction on instances or integer magnitudes, or change to the output condition is applied; this declaration contains no assertion about programs or runtime.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.