Cost bound for decoding one Fermat-ring residue
ProvedNLogN.decP_costLet , , and let registers KZ, KB, KN, KR hold , , , . If and , the cost of the decoding program decP from this state is at most .
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 open NLogN open IntMul IntMul.HvdH IntMul.HvdH.Ref set_option maxHeartbeats 4000000
theorem NLogN.decP_cost (M : MulSpec) (s : IState HS) (P r Q : ℕ) (hP : 1 ≤ P) (z : ℤ) (hz : 0 ≤ z)
(hzF : z < 2 ^ (4 * r * P) + 1) (LZ LB LN LR : List Item)
(hZ : s.G KZ = .int z :: LZ) (hB : s.G KB = .int (2 ^ P) :: LB)
(hN : s.G KN = .int (2 ^ (4 * r * P)) :: LN) (hR : s.G KR = .int r :: LR)
(hPQ : P ≤ Q) (hrQ : zsz (r : ℤ) ≤ Q) :
decP.cost M s ≤ 1000000 * (r + 1) * (Q + 5) + 200000 * (r * P + 1) := by sorry