rotStep_spec (KFU §7: one prefix-controlled cyclic shift with a linear offset table)
ProvedNLogN.KFU.rotStep_specThe following holds (Lean statement, in the scope of module Solutions.KFURot):
theorem NLogN.KFU.rotStep_spec (A C : Shape) (Q : ℕ) (cs : List ℕ) (hcs : cs.length = A.length)
(hcQ : ∀ c ∈ cs, c < Q) (hA : ∀ a ∈ A, 1 ≤ a) (hQ : 1 ≤ Q) (w Bb : ℕ)
(hVb : zsz ((AModel.vol A : ℕ) : ℤ) ≤ Bb) (hQb : zsz ((2 * Q : ℕ) : ℤ) ≤ Bb)
(xs : List ℤ) (hlen : xs.length = AModel.vol (A ++ Q :: C)) (hb : Bnd w xs)
(t : IState HS) (R : List Item) (h0 : t.G 0 = ints xs ++ R) :
IRuns I iprog (NLogN.KFU.rotStep Q (AModel.vol A) (AModel.vol C) (A.zip cs)) t
(t.upd 0 (ints (AModel.pull (A ++ Q :: C) (A ++ Q :: C)
(NLogN.KFU.rotG A.length Q (fun a => KIL.lf cs a % Q)) 0 xs) ++ R))
(NLogN.KFU.cRot (AModel.vol A) Q (AModel.vol C) w Bb A.length)
Context. The lemma belongs to the part KFU §7: one prefix-controlled cyclic shift with a linear offset table: rotStep Q P B ac: generate the offset table tbl Q ac (KIL2 genP, register code), push
P, Q, B, run KFC rotF, pop. For the shape A ++ Q :: C and coefficients cs (one per
field of A), rotStep_spec computes the full-shape pull by
Formalization Note. This lemma belongs to the item-language (IL) layer of the integer-multiplication-kappa campaign: tape-level programs (register programs over 64 item stacks of the NLogN multitape framework, definition bundles IntMul_HvdH_M_Defs1–IntMul_HvdH_M_Defs8) that implement the data-movement primitives of the OpenAI preprint Integer multiplication below (field moves, row split/merge, shifts, the uniform Proposition 11 interchange, Lemma 12 with fine -per-element costs, Gaussian record primitives, Proposition 14 pieces) with exact list denotations from the array-model bundles IntMul_Kappa_K_Defs* and explicit cost bounds. All names refer to the definition bundles up to IntMul_Kappa_K_Defs18.
-- OpenAI-preprint / κ-improvement development (integer-multiplication-kappa), generated by skeleton subtraction.
import Definitions.Def_IntMul_Kappa_K_Defs18
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
set_option linter.unusedSimpArgs false
set_option linter.unnecessarySeqFocus false
open NLogN
open NLogN.KFU
open IntMul KFC AModel AModelL12
variable {Pp : ℕ} {I : List Sym} {iprog : Fin Pp → IStmt HS Pp}
theorem NLogN.KFU.rotStep_spec (A C : Shape) (Q : ℕ) (cs : List ℕ) (hcs : cs.length = A.length)
(hcQ : ∀ c ∈ cs, c < Q) (hA : ∀ a ∈ A, 1 ≤ a) (hQ : 1 ≤ Q) (w Bb : ℕ)
(hVb : zsz ((AModel.vol A : ℕ) : ℤ) ≤ Bb) (hQb : zsz ((2 * Q : ℕ) : ℤ) ≤ Bb)
(xs : List ℤ) (hlen : xs.length = AModel.vol (A ++ Q :: C)) (hb : Bnd w xs)
(t : IState HS) (R : List Item) (h0 : t.G 0 = ints xs ++ R) :
IRuns I iprog (NLogN.KFU.rotStep Q (AModel.vol A) (AModel.vol C) (A.zip cs)) t
(t.upd 0 (ints (AModel.pull (A ++ Q :: C) (A ++ Q :: C)
(NLogN.KFU.rotG A.length Q (fun a => KIL.lf cs a % Q)) 0 xs) ++ R))
(NLogN.KFU.cRot (AModel.vol A) Q (AModel.vol C) w Bb A.length) := by sorry