Compilation is correct (round six, `good`)
ProvedNLogN.KIL.NE.goodCompilation is correct.
The following holds (Lean statement, in the scope of module Solutions.KIL6NE):
theorem NLogN.KIL.NE.good {t : IState HS} {v : Fin HS → ℕ} {M B : ℕ} (hM : zsz (M : ℤ) ≤ B) :
∀ e : NE, Holds t v e → e.OK v M →
e.toEx.ok t ∧ e.toEx.Bnd t B ∧ e.toEx.eval t = (e.val v : ℤ)
Context. KIL6: natural-number expressions
NE is a small language of natural-number expressions over registers (+, - (truncation
excluded by hypothesis), *, /, %, if a < b then x else y), compiled to Ex HS.
NE.good: on a state whose registers hold the naturals v i, if every intermediate value is
≤ M and zsz M ≤ B, then the compiled expression is clean, well defined, B-bounded and
evaluates to the natural value. This turns every descriptor computation into arithmetic.
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*).
-- 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 Mathlib import Definitions.Def_IntMul_HvdH_M_Defs8 import Definitions.Def_IntMul_MultitapeModel set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 open NLogN NLogN.KIL NLogN.KIL.NE open IntMul NLogN.RS AModel AModelL12
theorem NLogN.KIL.NE.good {t : IState HS} {v : Fin HS → ℕ} {M B : ℕ} (hM : zsz (M : ℤ) ≤ B) :
∀ e : NE, Holds t v e → e.OK v M →
e.toEx.ok t ∧ e.toEx.Bnd t B ∧ e.toEx.eval t = (e.val v : ℤ) := by sorry