Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.Prefix

Original-data bounds for every assembled-solver prefix #

The actual complete execution at minimum admission controls every prefix at every wider word size. Caller admission includes the original raw-word bound before dirty loads. This extra hypothesis is confined to numerical resource results; semantic execution on arbitrary old data still uses exec_at. No comparison run is supplied by the caller.

Resource admission includes the original caller's raw words, before normalization.

A physical-width-independent numerical bound for all words and newly written addresses.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.admissionWidth_pos (n F b ap bp cp P : ℕ) (values : List ℤ) :
0 < admissionWidth n F b ap bp cp P values

Caller resource admission is positive, including empty inputs and zero bounds.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.executionWidth_le_admissionWidth (n F b ap bp cp P : ℕ) (values : List ℤ) :
executionWidth n F b ap bp cp values ≤ admissionWidth n F b ap bp cp P values

Resource admission implies the weaker semantic execution admission.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.pow_admissionWidth_le (n F b ap bp cp P : ℕ) (values : List ℤ) :
2 ^ admissionWidth n F b ap bp cp P values ≤ wordBound n F b ap bp cp P values

Powers of the resource threshold stay within the original-data envelope.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.original_bounded {W n F b ap bp cp P : ℕ} (values : List ℤ) (x : WordRAM.Data 640) (hregs : ∀ (i : Fin 640), x.regs i ≤ P) (hmem : ∀ (q : ℕ), x.mem q ≤ P) (hW : admissionWidth n F b ap bp cp P values ≤ W) :

Raw caller data fit at the resource threshold, before any actual remainder instruction.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.bounded_reachable_caller {W n F ap bp cp b P k : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hv : ∀ z ∈ values, z.natAbs ≤ F) (x : WordRAM.Data 640) (xn : x.regs Reg.side = n) (xF : x.regs Reg.bound = F) (xap : x.regs Reg.ab = ap) (xbp : x.regs Reg.bc = bp) (xcp : x.regs Reg.ac = cp) (xb : x.regs Reg.free = b) (hab : ap + n * n ≤ b) (hbc : bp + n * n ≤ b) (hac : cp + n * n ≤ b) (vab : ∀ q < n * n, x.mem (ap + q) = WordRAM.Signed.encode (values.getD q 0)) (vbc : ∀ q < n * n, x.mem (bp + q) = WordRAM.Signed.encode (values.getD (n * n + q) 0)) (vac : ∀ q < n * n, x.mem (cp + q) = WordRAM.Signed.encode (values.getD (2 * (n * n) + q) 0)) (hregs : ∀ (i : Fin 640), x.regs i ≤ P) (hmem : ∀ (q : ℕ), x.mem q ≤ P) (hW : admissionWidth n F b ap bp cp P values ≤ W) {s : WordRAM.State 640} (hr : WordRAM.Runs W (program.program Reg.result) { pc := 0, data := x } s k) :
(∀ (i : Fin 640), s.data.regs i < wordBound n F b ap bp cp P values) ∧ (∀ (q : ℕ), s.data.mem q < wordBound n F b ap bp cp P values) ∧ ∀ (q : ℕ), wordBound n F b ap bp cp P values ≤ q → s.data.mem q = x.mem q

Every actual caller prefix has a width-independent bound. The semantic solver proves the comparison run itself; arbitrary unused old words are bounded only in this theorem.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.ParameterSelecting.bounded_reachable_input {W n F k : ℕ} (values : List ℤ) (hlen : values.length = 3 * (n * n)) (hv : ∀ z ∈ values, z.natAbs ≤ F) (hW : inputWidth n F values ≤ W) {s : WordRAM.State 640} (hr : WordRAM.Runs W (entryProgram.program Reg.result) (WordRAM.State.init (CountPrime.inputWords n F values)) s k) :
have E := envelope n F (3 + 3 * (n * n)) 3 (3 + n * n) (3 + 2 * (n * n)) values; (∀ (i : Fin 640), s.data.regs i < 16 * E) ∧ (∀ (q : ℕ), s.data.mem q < 16 * E) ∧ ∀ (q : ℕ), 16 * E ≤ q → s.data.mem q = 0

The initialized program has no physical-width-dependent word or address support.