Pointwise products of two residue lists in the Fermat ring
ProvedNLogN.FW.pmL_specLet be lists of canonical residues modulo , on stack XD and on YC, with registers holding , , , and let the multiplication spec multiply -bit integers at cost . For , , the program pmL replaces by the list of products pmulZ (2^n+1) A B and consumes , within cost pmCost N W Φm .
Formalization Note. The machine layer: IState HS is a state with stacks of items (Item = integer or mark), an input position and an output; RM programs (straight-line register code RS, loops rep, conditionals, calls of the multiplication procedure through a MulSpec giving its domain and cost) have a functional semantics p.run s, a definedness predicate p.ok M s and a cost p.cost M s; Spec M p s s' c abbreviates p.ok M s ∧ p.run s = s' ∧ p.cost M s ≤ c. ints L / gints U push an integer list / a list of pairs as items (head = top); zsz z is the bit length of . MulBnd M m Φ says the multiplication procedure accepts all pairs of integers of bit length at cost . Register names (GU, CR, KB, XN, …) are fixed stack indices.
-- Harvey–van der Hoeven multitape-TM development (NLogN), generated by skeleton subtraction. import Definitions.Def_IntMul_HvdH_M_Defs4 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 set_option linter.unusedSimpArgs false set_option linter.unusedVariables false open NLogN open NLogN.FW open IntMul IntMul.HvdH NLogN
theorem NLogN.FW.pmL_spec (M : MulSpec) {Φm : ℕ} (n W N : ℕ) (hM : MulBnd M (n + 1) Φm) (s : IState HS)
(A B : List ℤ) (RD RY LN LXN LXF : List Item) (hAl : A.length = N) (hBl : B.length = N)
(hAc : Canon (2 ^ n + 1) A) (hBc : Canon (2 ^ n + 1) B) (hX : s.G XD = ints B ++ RD)
(hY : s.G YC = ints A ++ RY) (hN : s.G NN = .int (N : ℤ) :: LN)
(hXN : s.G NLogN.FW.XN = .int (2 ^ n) :: LXN) (hXF : s.G XF = .int (2 ^ n + 1) :: LXF)
(hW : 2 * n + 2 ≤ W) (hNW : zsz (N : ℤ) ≤ W) :
Spec M pmL s ((s.upd XD (ints (Ref.pmulZ (2 ^ n + 1) A B) ++ RD)).upd YC RY)
(pmCost N W Φm) := by sorry