Round-six lemma `compile_correct_r6`
ProvedNLogN.compile_correct_r6complexity-theoryinteger-multiplicationkappa-improvement
An auxiliary lemma of the round-six development, published as a separate node because its proof is long or shared.
The following holds (Lean statement, in the scope of module NLogN.IComp):
theorem NLogN.compile_correct_r6 {iprog : Fin P → IStmt S P} (hprog : ∀ j, prog j = compile (iprog j))
{p : IStmt S P} {s s' : IState S} {c : ℕ} (h : IExec I iprog p s s' c) :
Runs I prog (compile p) (encI s) (encI s') c ∧
∀ i f b, p = .loop i f b →
Runs I prog (inner i f b) (encF i f s) ((encI s').push (s3 S) 0) (c - 24) ∧ 24 ≤ c
Context. Control flow of the item language and the compiler correctness theorem
Formalization Note. Part of the Lean formalization of the round-six κ-improvement (integer-multiplication-kappa campaign, target IntMul.Kappa.jain_round6_framework). The statement is copied verbatim from the Lean development; the platform node carries the same declaration name. Definitions it mentions live in the IntMul_Kappa_R6_Defs* bundles (on top of the published κ bundles IntMul_Kappa_K_Defs*).
Preamble
-- Round-six κ development (integer-multiplication-kappa), generated by skeleton subtraction.
import Definitions.Def_IntMul_Kappa_K_Defs33
import Definitions.Def_IntMul_Kappa_R6_Defs1
import Definitions.Def_IntMul_MultitapeModel
import Mathlib
import Definitions.Def_IntMul_HvdH_M_Defs8
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open NLogN
open IntMul
variable {S P : ℕ}
variable {I : List Sym} {prog : Fin P → Stmt (S + 4) P}
Formal statement
theorem NLogN.compile_correct_r6 {iprog : Fin P → IStmt S P} (hprog : ∀ j, prog j = compile (iprog j))
{p : IStmt S P} {s s' : IState S} {c : ℕ} (h : IExec I iprog p s s' c) :
Runs I prog (compile p) (encI s) (encI s') c ∧
∀ i f b, p = .loop i f b →
Runs I prog (inner i f b) (encF i f s) ((encI s').push (s3 S) 0) (c - 24) ∧ 24 ≤ c := by sorrySource
S. Jain, round-six networks for the integer-multiplication κ-improvement campaign (https://github.com/Swapnil-jain/integer-mult-kappa, commit 5868dc7) and D. Colkitt, integer-mult-bounds (https://github.com/CrocSwap/integer-mult-bounds); target `IntMul.Kappa.jain_round6_framework`. Lean declaration `NLogN.compile_correct`, Solutions/IComp.lean (lines 159–206) of the round-six development.