Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The simulation theorem (round six, `sim`)

Proved
NLogN.KIL.RSim.sim

by xuanji · Oct 20, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theoryinteger-multiplicationkappa-improvement

The simulation theorem.

The following holds (Lean statement, in the scope of module Solutions.KIL4Sim):

theorem NLogN.KIL.RSim.sim {π : PMap} (hπ : PLow π) {p p' : RS} (h : RSim π p p') :
    (∀ i v, π i = some v → i ∉ p.writes) → ∀ s, PV π s → p.ok s →
      p'.ok s ∧ p'.run s = p.run s ∧ p'.cost s ≤ 200 * p.cost s

Context. KIL4: literal-to-register simulation of register programs

The KIL1–KIL3 programs carry the sizes of a configuration (field sizes, volumes, the modulus, pass counts, …) as literals Ex.lit v. A uniform program reads them from parameter stacks instead. RSim π p p' says that p' is p with some literal occurrences .lit v replaced by register reads .reg i, where the parameter map π says π i = some v.

RSim.sim: on a state where every parameter stack i holds v on top (PV π s) and is not written by p, the program p' is executable whenever p is, ends in the same state, and costs at most 200 × the cost of p (a register read costs at most 200 × a literal of the same value). Hence every KIL specification Sp p s t c transfers to Sp p' s t (200 * c) (Sp.sim).

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 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
open IntMul NLogN.RS
Formal statement
theorem NLogN.KIL.RSim.sim {π : PMap} (hπ : PLow π) {p p' : RS} (h : RSim π p p') :
    (∀ i v, π i = some v → i ∉ p.writes) → ∀ s, PV π s → p.ok s →
      p'.ok s ∧ p'.run s = p.run s ∧ p'.cost s ≤ 200 * p.cost s := by sorry
Source
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.KIL.RSim.sim`, Solutions/KIL4Sim.lean (lines 249–356) of the round-six development.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me